:root {
  --ocean-dark: #006994;
  --ocean-light: #064889;
  --sand: #FFFDF7;
  --coral: #FF6B6B; 
  --gift-orange: #FF9F1C;
  --eco-green: #2D6A4F;
  --white: #ffffff;
  --text-main: #2B2D42;
  --text-gray: #6D6E7C;
  --shadow-card: 0 10px 30px rgba(0,0,0,0.08);
  
  /* 人數狀態顏色 */
  --status-safe: #4CAF50;
  --status-warn: #FF9800;
  --status-full: #F44336;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: 'Noto Sans TC', sans-serif; background-color: var(--sand); color: var(--text-main); }

/* --- Hero 區塊 --- */
.island-hero { 
  height: 50vh; min-height: 400px; 
  background: linear-gradient(rgba(0,105,148,0.7), rgba(0,0,0,0.4)), url('https://images.unsplash.com/photo-1582967788606-a171c1080cb0?q=80&w=2000&auto=format&fit=crop') center/cover;
  display: flex; flex-direction: column; justify-content: center; align-items: center; color: white; text-align: center;
}
.hero-content h1 { font-size: 3rem; margin: 10px 0; text-shadow: 0 2px 10px rgba(0,0,0,0.3); }

.main-content { max-width: 1200px; margin: 0 auto; padding: 40px 20px; }
.section-title { color: var(--ocean-dark); font-size: 1.8rem; border-left: 5px solid var(--gift-orange); padding-left: 15px; margin-bottom: 30px; }

/* --- 即時人數儀表板 --- */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 50px;
}
.status-card {
  background: white; padding: 30px; border-radius: 20px; text-align: center;
  box-shadow: var(--shadow-card); transition: 0.3s;
}
.status-card:hover { transform: translateY(-5px); }
.status-card h3 { color: var(--ocean-dark); margin-top: 0; font-size: 1.4rem; }

/* CSS 圓形進度條 */
.progress-circle {
  width: 140px; height: 140px; border-radius: 50%;
  background: conic-gradient(var(--circle-color, var(--status-safe)) calc(var(--percent) * 1%), #e0e0e0 0);
  margin: 0 auto 20px; display: flex; align-items: center; justify-content: center; position: relative;
}
.progress-circle::after {
  content: ""; position: absolute; width: 110px; height: 110px; background: white; border-radius: 50%;
}
.progress-text { position: relative; z-index: 10; display: flex; flex-direction: column; line-height: 1.2; }
.progress-text .num { font-size: 2rem; font-weight: 900; color: var(--circle-color, var(--text-main)); }
.progress-text .total { font-size: 0.8rem; color: var(--text-gray); }

.status-label { font-size: 0.9rem; font-weight: bold; padding: 5px 15px; border-radius: 20px; background: #f0f7f9; display: inline-block; }

/* --- 法規清單卡片 --- */
.rules-grid { display: grid; grid-template-columns: 1fr; gap: 15px; margin-bottom: 50px; }
.rule-card {
  background: white; border-left: 5px solid var(--eco-green); padding: 20px; border-radius: 0 15px 15px 0;
  box-shadow: 0 4px 15px rgba(0,0,0,0.04); display: flex; align-items: flex-start; gap: 15px;
}
.rule-card i { color: var(--eco-green); font-size: 1.5rem; margin-top: 3px; }
.rule-card.alert { border-left-color: var(--coral); }
.rule-card.alert i { color: var(--coral); }
.rule-content h4 { margin: 0 0 8px 0; font-size: 1.1rem; color: var(--text-main); }
.rule-content p { margin: 0; font-size: 0.95rem; color: var(--text-gray); line-height: 1.6; }

/* --- 歷史法規時間軸 --- */
.timeline { border-left: 2px solid var(--ocean-light); padding-left: 20px; margin-left: 10px; }
.timeline-item { position: relative; margin-bottom: 25px; }
.timeline-item::before {
  content: ""; position: absolute; left: -27px; top: 0; width: 12px; height: 12px;
  background: var(--ocean-light); border-radius: 50%; border: 3px solid white; box-shadow: 0 0 0 2px var(--ocean-light);
}
.timeline-date { font-weight: 900; color: var(--ocean-dark); font-size: 0.9rem; margin-bottom: 5px; display: block; }
.timeline-title { font-weight: bold; font-size: 1.1rem; margin-bottom: 5px; color: var(--text-main); }
.timeline-desc { font-size: 0.9rem; color: var(--text-gray); line-height: 1.5; margin: 0; }

/* --- 軟糖泡泡感的地圖與介紹分頁 (Tabs) --- */
.map-wrapper { text-align: center; margin-bottom: 40px; }
.map-wrapper img { max-width: 100%; max-height: 450px; border-radius: 15px; object-fit: contain; }

.tabs-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.06); 
    padding: 35px;
    margin-bottom: 60px;
    position: relative;
    overflow: hidden;
}

/* 分頁按鈕列：大螢幕預設為水平橫排 */
.tab-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    border-bottom: 3px solid #f1f6f9;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

/* 預設的軟糖按鈕形狀 */
.tab-btn {
    background: #f1f6f9;
    color: var(--text-gray);
    border: none;
    padding: 14px 26px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn:hover { background: #e3ecf1; transform: translateY(-3px); }

/* 當處於活躍 (Active) 時的表現 (顏色交給JS控制) */
.tab-btn.active {
    box-shadow: 0 10px 20px rgba(0,0,0,0.15); 
    transform: scale(1.05) translateY(-2px); 
}

/* 文字區塊切換時的流暢動畫 */
.tab-content { display: none; }
.tab-content.active { display: block; animation: bounceInUp 0.6s ease; }

.zone-header { display: flex; align-items: center; margin-bottom: 15px; }
.zone-title { font-size: 1.8rem; margin: 0; font-weight: 900; }
.zone-desc { color: #555; line-height: 1.9; font-size: 1.05rem; }

@keyframes bounceInUp {
    0% { opacity: 0; transform: translateY(20px); }
    60% { opacity: 1; transform: translateY(-5px); }
    100% { transform: translateY(0); }
}


/* =======================================
   平板 / 手機版 終極響應式優化 
======================================= */
@media (max-width: 768px) {
    /* 1. 地圖的按鈕選單變成 2x2 並排 */
    .tabs-container { padding: 25px 15px; }
    
    .tab-buttons { 
        display: grid; 
        grid-template-columns: repeat(2, 1fr); /* 2x2 排列的關鍵 */
        gap: 10px; 
    }

    .tab-btn { 
        width: 100%; 
        padding: 12px 5px;       /* 減少內邊距以容納文字 */
        font-size: 0.85rem;      /* 文字微調小一點 */
        gap: 5px; 
        letter-spacing: -0.5px;  /* 微收縮防止換行斷頭 */
    }
    
    /* 2. 上方即時人數變成 2x2 並排 */
    .status-grid {
        grid-template-columns: repeat(2, 1fr); 
        gap: 15px; 
    }
    
    .status-card { padding: 15px 10px; }
    .status-card h3 { font-size: 1.1rem; margin-bottom: 10px; }

    /* 3. 等比例縮小狀態圓餅圖 */
    .progress-circle { width: 100px; height: 100px; margin-bottom: 15px; }
    .progress-circle::after { width: 78px; height: 78px; }

    .progress-text .num { font-size: 1.4rem; }
    .progress-text .total { font-size: 0.75rem; }
    
    .status-label {
        font-size: 0.8rem; padding: 4px 8px; border-radius: 12px; letter-spacing: -0.5px;
    }
}

/* 給極小螢幕手機的特別保護措施 (例如 SE) */
@media (max-width: 400px) {
    .tab-btn { font-size: 0.78rem; padding: 10px 4px; }
    .progress-circle { width: 90px; height: 90px; }
    .progress-circle::after { width: 70px; height: 70px; }
    .progress-text .num { font-size: 1.2rem; }
    .status-card { padding: 12px 5px; }
    .status-label { font-size: 0.75rem; letter-spacing: -1px; }
}
/* =======================================
   生物圖鑑 - 專屬巨型跳轉橫幅按鈕 
======================================= */
.bio-cta-banner {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--ocean-dark), var(--ocean-light));
    border-radius: 20px;
    padding: 40px 50px;
    color: white;
    text-decoration: none;
    box-shadow: 0 15px 35px rgba(0, 105, 148, 0.25);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.bio-cta-banner:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 105, 148, 0.4);
}

.bio-cta-content {
    position: relative;
    z-index: 2; /* 壓在浮水印 Icon 之上 */
}

.bio-cta-content h2 {
    font-size: 2.2rem;
    margin: 0 0 15px;
    font-weight: 900;
    text-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.bio-cta-content p {
    font-size: 1.15rem;
    line-height: 1.7;
    margin: 0 0 25px 0;
    opacity: 0.9;
}

/* 按鈕本體 */
.bio-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--gift-orange);
    color: white;
    font-weight: 800;
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 1.1rem;
    transition: 0.3s;
    box-shadow: 0 5px 15px rgba(255, 159, 28, 0.4);
}

.bio-cta-banner:hover .bio-cta-btn {
    background: var(--coral);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.5);
    transform: scale(1.05);
}

/* 卡片右下的裝飾大圖標 */
.bio-bg-icon {
    position: absolute;
    right: 5%;
    bottom: -30px;
    font-size: 13rem;
    color: white;
    opacity: 0.12; /* 微弱透明浮水感 */
    z-index: 1;
    transform: rotate(20deg);
    transition: transform 0.8s ease;
}

.bio-cta-banner:hover .bio-bg-icon {
    transform: rotate(45deg) scale(1.1); /* 滑鼠游標移過去會轉圈放大 */
}

/* -- 手機版版面微調 -- */
@media (max-width: 768px) {
    .bio-cta-banner {
        flex-direction: column;
        text-align: center;
        padding: 30px 20px;
    }
    .bio-cta-content h2 {
        font-size: 1.6rem;
    }
    .bio-cta-content p {
        font-size: 1rem;
    }
    .bio-cta-btn {
        width: 100%;
        justify-content: center;
    }
    /* 手機因為太小，右下的星星大裝飾就不秀了 */
    .bio-bg-icon { 
        display: none; 
    } 
}