/* =========================================================================
   臺北市公有林地數位孿生系統 (FDT) — 決策門戶樣式表
   設計語彙：深森林夜色 + Glass 玻璃感 + 森林綠強調 + SIF 螢光金黃
   參考精神：ESA Forest Digital Twin / Google Earth Engine
   ========================================================================= */

/* -------------------------------------------------------------------------
   0. Design Tokens — 設計變數
   ------------------------------------------------------------------------- */
:root {
    /* 深森林夜色背景 */
    --bg-deep:           #0a1410;
    --bg-base:           #0f1a14;
    --bg-elev:           #142220;
    --bg-elev-2:         #1a2b27;

    /* Glass 半透明層 */
    --glass-bg:          rgba(18, 30, 26, 0.55);
    --glass-bg-strong:   rgba(20, 34, 30, 0.78);
    --glass-border:      rgba(255, 255, 255, 0.08);
    --glass-border-hi:   rgba(120, 220, 160, 0.22);
    --glass-inset:       inset 0 1px 0 rgba(255, 255, 255, 0.04);

    /* 森林綠主強調（碳匯、正 NEP、active） */
    --green-300:         #86efac;
    --green-400:         #4ade80;
    --green-500:         #22c55e;
    --green-600:         #16a34a;
    --green-700:         #15803d;
    --green-glow:        rgba(74, 222, 128, 0.35);
    --green-glow-soft:   rgba(34, 197, 94, 0.18);

    /* 警示 — 暖琥珀 / 紅銅（碳排放、負 NEP） */
    --amber-400:         #fbbf24;
    --copper-400:        #ef8b5b;
    --copper-500:        #d6663a;
    --copper-glow:       rgba(214, 102, 58, 0.28);

    /* SIF 生理熱圖漸層（金黃 → 橙紅） */
    --sif-1:             #fde047;
    --sif-2:             #facc15;
    --sif-3:             #f59e0b;
    --sif-4:             #ea580c;

    /* 文字階層 */
    --text-primary:      rgba(255, 255, 255, 0.94);
    --text-secondary:    rgba(230, 240, 235, 0.72);
    --text-tertiary:     rgba(200, 215, 208, 0.50);
    --text-muted:        rgba(180, 200, 190, 0.38);
    --text-on-green:     #062012;

    /* 邊框與分隔 */
    --line-soft:         rgba(255, 255, 255, 0.06);
    --line-mid:          rgba(255, 255, 255, 0.10);

    /* 陰影 */
    --shadow-card:       0 8px 32px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.2);
    --shadow-float:      0 12px 48px rgba(0, 0, 0, 0.55), 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-green:      0 0 24px rgba(34, 197, 94, 0.22);

    /* 圓角 */
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 18px;
    --r-pill: 999px;

    /* 字體 */
    --ff-display: "Outfit", "Inter", "Noto Sans TC", system-ui, sans-serif;
    --ff-body:    "Inter", "Noto Sans TC", system-ui, sans-serif;
    --ff-num:     "Outfit", "Inter", system-ui, sans-serif;

    /* 動效 */
    --ease:       cubic-bezier(0.4, 0, 0.2, 1);
    --t-fast:     150ms;
    --t-base:     200ms;

    /* 版面 */
    --sidebar-w:  420px;

    /* 干擾情境主題色 (Disturbance Theme Colors) — 2026-05-21 新增 */
    --disturb-plant:        #4ade80;
    --disturb-plant-glow:   rgba(74, 222, 128, 0.45);
    --disturb-log:          #f97316;
    --disturb-log-glow:     rgba(249, 115, 22, 0.45);
    --disturb-typhoon:      #818cf8;
    --disturb-typhoon-glow: rgba(129, 140, 248, 0.45);
    --disturb-landslide:    #d97706;
    --disturb-landslide-glow: rgba(217, 119, 6, 0.45);
}

/* -------------------------------------------------------------------------
   1. Base / Reset
   ------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
}

body {
    font-family: var(--ff-body);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-deep);
    background-image:
        radial-gradient(1200px 700px at 85% -10%, rgba(34, 197, 94, 0.08), transparent 60%),
        radial-gradient(900px 600px at -10% 110%, rgba(20, 80, 60, 0.18), transparent 60%),
        linear-gradient(180deg, #0a1410 0%, #0c1612 100%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
}

h1, h2, h3, h4, h5 {
    font-family: var(--ff-display);
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

p {
    margin: 0;
    color: var(--text-secondary);
}

button {
    font-family: var(--ff-body);
    border: none;
    cursor: pointer;
    background: transparent;
    color: inherit;
}

select {
    font-family: var(--ff-body);
    color: inherit;
}

/* 所有數字使用等寬數字，避免抖動 */
.value,
.unit,
.weight,
.metric-box,
.shap-item,
.layer-pill {
    font-variant-numeric: tabular-nums;
}

/* 自訂滾動軸 */
.sidebar-content::-webkit-scrollbar {
    width: 6px;
}
.sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-content::-webkit-scrollbar-thumb {
    background: rgba(74, 222, 128, 0.18);
    border-radius: 999px;
}
.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 222, 128, 0.32);
}

/* -------------------------------------------------------------------------
   2. App Shell
   ------------------------------------------------------------------------- */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* -------------------------------------------------------------------------
   3. Glass 通用視覺
   ------------------------------------------------------------------------- */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-card), var(--glass-inset);
}

/* -------------------------------------------------------------------------
   4. Sidebar
   ------------------------------------------------------------------------- */
.sidebar {
    flex: 0 0 var(--sidebar-w);
    width: var(--sidebar-w);
    height: 100vh;
    display: flex;
    flex-direction: column;
    border-radius: 0;
    border-left: none;
    border-top: none;
    border-bottom: none;
    border-right: 1px solid var(--glass-border);
    background: linear-gradient(180deg,
                    rgba(14, 26, 22, 0.92) 0%,
                    rgba(10, 20, 16, 0.88) 100%);
    backdrop-filter: blur(24px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    z-index: 10;
    position: relative;
}

.sidebar::after {
    /* 細微的右側綠光分隔 */
    content: "";
    position: absolute;
    top: 0;
    right: -1px;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg,
                    transparent 0%,
                    rgba(74, 222, 128, 0.22) 30%,
                    rgba(74, 222, 128, 0.22) 70%,
                    transparent 100%);
    pointer-events: none;
}

/* ---- Sidebar Header ---- */
.sidebar-header {
    padding: 22px 22px 18px;
    border-bottom: 1px solid var(--line-soft);
    background: linear-gradient(180deg,
                    rgba(34, 197, 94, 0.06) 0%,
                    transparent 100%);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-icon {
    font-size: 30px;
    color: var(--green-400);
    filter: drop-shadow(0 0 12px var(--green-glow));
    flex-shrink: 0;
}

.brand h1 {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-tertiary);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.brand h2 {
    font-family: var(--ff-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.system-status {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 12px;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(74, 222, 128, 0.18);
    border-radius: var(--r-pill);
    width: fit-content;
}

.status-text {
    font-size: 11.5px;
    color: var(--green-300);
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ---- Pulse Indicator (生理遙測即時呼吸光暈) ---- */
.pulse-indicator {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
    position: relative;
}

.pulse-indicator.online {
    background: var(--green-400);
    box-shadow: 0 0 0 0 var(--green-glow);
    animation: pulse-breath 2.2s var(--ease) infinite;
}

@keyframes pulse-breath {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55),
                    0 0 8px rgba(74, 222, 128, 0.6);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(74, 222, 128, 0),
                    0 0 12px rgba(74, 222, 128, 0.4);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0),
                    0 0 8px rgba(74, 222, 128, 0.6);
    }
}

/* ---- Sidebar Content (Scroll Area) ---- */
.sidebar-content {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 18px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* -------------------------------------------------------------------------
   5. Card 通用
   ------------------------------------------------------------------------- */
.card {
    background: linear-gradient(180deg,
                    rgba(26, 43, 39, 0.55) 0%,
                    rgba(20, 34, 30, 0.45) 100%);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-lg);
    padding: 16px 16px 15px;
    box-shadow: var(--shadow-card), var(--glass-inset);
    transition: border-color var(--t-base) var(--ease);
}

.card:hover {
    border-color: rgba(120, 220, 160, 0.18);
}

.card h3 {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card h3 i {
    color: var(--green-400);
    font-size: 13px;
    filter: drop-shadow(0 0 6px var(--green-glow-soft));
}

/* -------------------------------------------------------------------------
   6. Layer Pills — 五層架構藥丸
   ------------------------------------------------------------------------- */
.layers-indicator {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.layer-pill {
    flex: 1 1 auto;
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    padding: 7px 10px;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line-mid);
    color: var(--text-tertiary);
    cursor: default;
    letter-spacing: 0.02em;
    transition: all var(--t-base) var(--ease);
    white-space: nowrap;
}

.layer-pill.active {
    background: linear-gradient(135deg,
                    rgba(34, 197, 94, 0.22) 0%,
                    rgba(22, 163, 74, 0.14) 100%);
    border-color: rgba(74, 222, 128, 0.45);
    color: var(--green-300);
    box-shadow: inset 0 0 12px rgba(74, 222, 128, 0.18),
                0 0 8px rgba(34, 197, 94, 0.12);
}

/* -------------------------------------------------------------------------
   7. Select / Form Control
   ------------------------------------------------------------------------- */
.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: "\f078"; /* fa-chevron-down */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--green-400);
    font-size: 10px;
    pointer-events: none;
}

#plot-selector {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(10, 20, 16, 0.65);
    border: 1px solid var(--line-mid);
    border-radius: var(--r-md);
    color: var(--text-primary);
    padding: 11px 36px 11px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color var(--t-base) var(--ease),
                box-shadow var(--t-base) var(--ease);
}

#plot-selector:hover {
    border-color: rgba(74, 222, 128, 0.35);
}

#plot-selector:focus {
    outline: none;
    border-color: var(--green-400);
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.18);
}

#plot-selector optgroup {
    background: var(--bg-elev);
    color: var(--green-300);
    font-style: normal;
    font-weight: 600;
}

#plot-selector option {
    background: var(--bg-elev);
    color: var(--text-primary);
    padding: 8px;
}

/* -------------------------------------------------------------------------
   8. Metrics Panel
   ------------------------------------------------------------------------- */
.metric-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.metric-box {
    background: rgba(10, 20, 16, 0.5);
    border: 1px solid var(--line-soft);
    border-radius: var(--r-md);
    padding: 12px 12px 10px;
    position: relative;
    overflow: hidden;
    transition: border-color var(--t-base) var(--ease),
                background var(--t-base) var(--ease);
}

.metric-box::before {
    /* 左側細條強調 */
    content: "";
    position: absolute;
    left: 0;
    top: 14%;
    bottom: 14%;
    width: 2px;
    background: linear-gradient(180deg, var(--green-400), transparent);
    opacity: 0.6;
    border-radius: 2px;
}

.metric-box:hover {
    border-color: rgba(74, 222, 128, 0.22);
    background: rgba(14, 26, 22, 0.7);
}

.metric-box .label {
    display: block;
    font-size: 10.5px;
    color: var(--text-tertiary);
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 6px;
    letter-spacing: 0.01em;
    min-height: 28px;
}

.value-container {
    display: flex;
    align-items: baseline;
    gap: 5px;
    flex-wrap: wrap;
}

.metric-box .value {
    font-family: var(--ff-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.02em;
}

.metric-box .unit {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* 碳匯狀態 — 正 NEP */
.status-汇 {
    color: var(--green-400) !important;
    text-shadow: 0 0 18px rgba(74, 222, 128, 0.45);
}

/* 預留 — 碳排放狀態（負 NEP） */
.status-排 {
    color: var(--copper-400) !important;
    text-shadow: 0 0 18px var(--copper-glow);
}

/* -------------------------------------------------------------------------
   9. Chart Containers
   ------------------------------------------------------------------------- */
.chart-container,
.projection-container {
    position: relative;
    width: 100%;
    max-height: 220px;
    height: 200px;
    margin-top: 4px;
}

.chart-container canvas,
.projection-container canvas {
    max-height: 220px !important;
}

.projection-container {
    height: 180px;
    max-height: 200px;
}

/* -------------------------------------------------------------------------
   10. Scenario Simulator
   ------------------------------------------------------------------------- */
.scenario-simulator .description {
    font-size: 11.5px;
    color: var(--text-tertiary);
    margin-bottom: 10px;
    line-height: 1.5;
}

.scenario-buttons {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.btn-scenario {
    flex: 1 1 calc(33% - 4px);
    min-width: 0;
    padding: 9px 8px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line-mid);
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all var(--t-base) var(--ease);
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.btn-scenario i {
    font-size: 11px;
    opacity: 0.7;
}

.btn-scenario:hover {
    border-color: rgba(74, 222, 128, 0.35);
    color: var(--green-300);
    background: rgba(34, 197, 94, 0.06);
    transform: translateY(-1px);
}

.btn-scenario.active {
    background: linear-gradient(135deg, var(--green-500) 0%, var(--green-600) 100%);
    border-color: var(--green-500);
    color: var(--text-on-green);
    font-weight: 600;
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.35),
                inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn-scenario.active i {
    opacity: 1;
}

/* -------------------------------------------------------------------------
   11. QA/QC + SHAP
   ------------------------------------------------------------------------- */
.qaqc-status {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: var(--r-pill);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
}

.badge i {
    font-size: 10px;
}

.badge-success {
    background: rgba(34, 197, 94, 0.12);
    color: var(--green-300);
    border-color: rgba(74, 222, 128, 0.3);
}

.badge-info {
    background: rgba(56, 189, 248, 0.10);
    color: #7dd3fc;
    border-color: rgba(56, 189, 248, 0.25);
}

.shap-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shap-item {
    display: grid;
    grid-template-columns: 130px 1fr 44px;
    gap: 10px;
    align-items: center;
}

.shap-item .feature {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.3;
}

.shap-item .bar-bg {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--r-pill);
    overflow: hidden;
    position: relative;
    border: 1px solid var(--line-soft);
}

.shap-item .bar-fill {
    height: 100%;
    background: linear-gradient(90deg,
                    var(--green-600) 0%,
                    var(--green-400) 70%,
                    var(--green-300) 100%);
    border-radius: var(--r-pill);
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.35),
                inset 0 0 4px rgba(255, 255, 255, 0.15);
    transition: width 600ms var(--ease);
}

.shap-item .weight {
    text-align: right;
    font-family: var(--ff-display);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--green-300);
}

/* -------------------------------------------------------------------------
   12. Map Viewport — 2026-05-21 改版：上下兩段式
   上半：3D Forest Scene (Three.js, 主視覺)
   下半：干擾控制台 + 結果 + MRV (可滾動)
   ------------------------------------------------------------------------- */
.map-viewport {
    flex: 1 1 auto;
    position: relative;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: #050a08;
    display: flex;
    flex-direction: column;
}

.map-viewport::-webkit-scrollbar {
    width: 8px;
}
.map-viewport::-webkit-scrollbar-track {
    background: transparent;
}
.map-viewport::-webkit-scrollbar-thumb {
    background: rgba(74, 222, 128, 0.18);
    border-radius: 999px;
}
.map-viewport::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 222, 128, 0.32);
}

/* Cesium 現在綁在 minimap 卡片內 (右下角) — 不再吃滿視窗 */
#cesiumContainer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--r-md);
    overflow: hidden;
}

#cesiumContainer .cesium-viewer-bottom,
#cesiumContainer .cesium-viewer-toolbar {
    /* Cesium 預設 UI 收斂，避免與 overlay 重疊 */
    opacity: 0.5;
    transform: scale(0.7);
    transform-origin: bottom right;
}

/* -------------------------------------------------------------------------
   13. Map Overlay Header
   ------------------------------------------------------------------------- */
.map-overlay-header {
    position: absolute;
    top: 18px;
    left: 18px;
    right: 18px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 20px;
    border-radius: var(--r-lg);
    background: rgba(10, 20, 16, 0.55);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-float);
}

.map-title-info h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3px;
    letter-spacing: -0.01em;
}

.map-title-info p {
    font-size: 11.5px;
    color: var(--text-tertiary);
    font-family: var(--ff-num);
    letter-spacing: 0.02em;
}

.map-controls {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

.btn-tool {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line-mid);
    border-radius: var(--r-md);
    transition: all var(--t-base) var(--ease);
    white-space: nowrap;
}

.btn-tool i {
    font-size: 11px;
    color: var(--green-400);
}

.btn-tool:hover {
    background: rgba(34, 197, 94, 0.10);
    border-color: rgba(74, 222, 128, 0.40);
    color: var(--green-300);
    transform: translateY(-1px);
}

.btn-tool.active {
    background: linear-gradient(135deg,
                    rgba(34, 197, 94, 0.30) 0%,
                    rgba(22, 163, 74, 0.20) 100%);
    border-color: var(--green-500);
    color: var(--green-300);
    box-shadow: inset 0 0 10px rgba(74, 222, 128, 0.18),
                0 0 12px rgba(34, 197, 94, 0.20);
}

/* -------------------------------------------------------------------------
   14. MRV Exporter Card
   ------------------------------------------------------------------------- */
.mrv-exporter-card {
    /* 2026-05-21 改版：不再浮在地圖，改成貼底 inline 卡片 */
    position: relative;
    margin: 0;
    padding: 18px 22px;
    border-radius: var(--r-lg);
    background: linear-gradient(135deg,
                    rgba(34, 197, 94, 0.08) 0%,
                    rgba(10, 20, 16, 0.78) 60%);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    border: 1px solid rgba(74, 222, 128, 0.20);
    box-shadow: var(--shadow-card),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.mrv-exporter-card .card-content {
    flex: 1 1 320px;
    min-width: 0;
}

.mrv-exporter-card::before {
    /* 細微的左側綠條 — premium / 認證感 */
    content: "";
    position: absolute;
    left: 0;
    top: 18%;
    bottom: 18%;
    width: 3px;
    background: linear-gradient(180deg, var(--green-300), var(--green-600));
    border-radius: 0 3px 3px 0;
    box-shadow: 0 0 12px var(--green-glow);
}

.mrv-exporter-card .card-content h4 {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.005em;
}

.mrv-exporter-card .card-content h4 i {
    color: var(--green-400);
    filter: drop-shadow(0 0 6px var(--green-glow-soft));
}

.mrv-exporter-card .card-content p {
    font-size: 11.5px;
    color: var(--text-tertiary);
    line-height: 1.55;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-on-green);
    background: linear-gradient(135deg, var(--green-400) 0%, var(--green-600) 100%);
    border: 1px solid var(--green-500);
    border-radius: var(--r-md);
    cursor: pointer;
    letter-spacing: 0.01em;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.28),
                inset 0 1px 0 rgba(255, 255, 255, 0.22);
    transition: all var(--t-base) var(--ease);
}

.btn-primary i {
    font-size: 13px;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.40),
                inset 0 1px 0 rgba(255, 255, 255, 0.28);
    background: linear-gradient(135deg, var(--green-300) 0%, var(--green-500) 100%);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.32),
                inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* -------------------------------------------------------------------------
   15. Fallback Canvas (離線/無 Token 模式)
   ------------------------------------------------------------------------- */
#fallbackCanvasContainer {
    /* 2026-05-21 改版：限制在 minimap 內 */
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: var(--r-md);
    overflow: hidden;
    background: radial-gradient(ellipse at center,
                    rgba(10, 20, 16, 0.4) 0%,
                    rgba(5, 10, 8, 0.85) 100%);
}

#fallbackCanvasContainer.hidden {
    display: none;
}

#fallbackWebGLCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

.canvas-instructions {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    padding: 16px 24px;
    background: rgba(10, 20, 16, 0.7);
    backdrop-filter: blur(14px);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-md);
    pointer-events: none;
}

.canvas-instructions p {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.canvas-instructions i {
    color: var(--amber-400);
}

/* -------------------------------------------------------------------------
   16. Cesium 內建元件樣式微調
   ------------------------------------------------------------------------- */
.cesium-viewer .cesium-widget-credits {
    display: none !important;
}

.cesium-viewer-toolbar {
    top: 80px !important;
    right: 18px !important;
}

.cesium-button {
    background: rgba(10, 20, 16, 0.65) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--green-300) !important;
}

/* -------------------------------------------------------------------------
   17. 響應式
   ------------------------------------------------------------------------- */
@media (max-width: 1280px) {
    :root {
        --sidebar-w: 380px;
    }
    .metric-box .value {
        font-size: 25px;
    }
    .map-title-info h2 {
        font-size: 15px;
    }
}

@media (max-width: 1100px) {
    :root {
        --sidebar-w: 360px;
    }
    .shap-item {
        grid-template-columns: 110px 1fr 40px;
    }
    .btn-scenario {
        font-size: 10.5px;
        padding: 8px 6px;
    }
    .mrv-exporter-card {
        max-width: 380px;
    }
}

@media (max-width: 960px) {
    .map-overlay-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 14px;
    }
    .mrv-exporter-card {
        max-width: calc(100% - 36px);
        left: 18px;
        right: 18px;
    }
}

@media (max-width: 900px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        flex: 0 0 auto;
        width: 100%;
        height: 50vh;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
    }
    .map-viewport {
        height: 50vh;
    }
}

/* -------------------------------------------------------------------------
   18. Utility
   ------------------------------------------------------------------------- */
.hidden {
    display: none !important;
}

/* =========================================================================
   19. 3D Forest Scene Container — 2026-05-21 新增（主視覺）
   ========================================================================= */
#forest-scene-container {
    flex: 0 0 60vh;
    min-height: 480px;
    position: relative;
    width: 100%;
    overflow: hidden;
    /* Three.js 失敗時的 fallback：黎明森林漸層 */
    background:
        radial-gradient(ellipse 90% 60% at 50% 100%, rgba(20, 60, 40, 0.55) 0%, transparent 70%),
        radial-gradient(ellipse 70% 40% at 80% 10%, rgba(254, 215, 102, 0.10) 0%, transparent 60%),
        linear-gradient(180deg, #0a1410 0%, #1a2a20 55%, #3a4a40 100%);
    border-bottom: 1px solid rgba(74, 222, 128, 0.18);
    box-shadow: inset 0 -20px 40px rgba(0, 0, 0, 0.4);
}

/* Three.js canvas mount target — 同事 forest_scene.js 會 append 到這裡 */
#forest-scene-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    position: absolute;
    inset: 0;
}

/* Scene 標題列 (左上角) */
.forest-scene-header {
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 6;
    padding: 12px 18px;
    border-radius: var(--r-lg);
    background: rgba(10, 20, 16, 0.55);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-float);
    max-width: calc(100% - 280px); /* 留空間給工具列 */
}

.forest-scene-header .map-title-info h2 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3px;
    letter-spacing: -0.01em;
}

.forest-scene-header .map-title-info p {
    font-size: 11px;
    color: var(--text-tertiary);
    font-family: var(--ff-num);
    letter-spacing: 0.02em;
}

/* =========================================================================
   20. Forest Toolbar — 場景控制（季節 / SIF / 陰影）
   ========================================================================= */
.forest-toolbar {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 6;
    display: flex;
    gap: 8px;
    padding: 8px;
    border-radius: var(--r-pill);
    background: rgba(10, 20, 16, 0.55);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-card);
}

.btn-forest-tool {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(10, 20, 16, 0.5);
    border: 1px solid var(--line-mid);
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    transition: all var(--t-base) var(--ease);
}

.btn-forest-tool i {
    font-size: 16px;
    color: var(--green-400);
    transition: color var(--t-base) var(--ease), filter var(--t-base) var(--ease);
}

.btn-forest-tool .forest-tool-label {
    font-size: 9.5px;
    font-weight: 600;
    color: var(--text-tertiary);
    letter-spacing: 0.02em;
}

.btn-forest-tool:hover {
    border-color: rgba(74, 222, 128, 0.45);
    background: rgba(34, 197, 94, 0.10);
    transform: translateY(-1px);
}

.btn-forest-tool:hover i {
    filter: drop-shadow(0 0 8px var(--green-glow));
}

.btn-forest-tool.active {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.32) 0%, rgba(22, 163, 74, 0.18) 100%);
    border-color: var(--green-500);
    box-shadow: inset 0 0 12px rgba(74, 222, 128, 0.22),
                0 0 14px rgba(34, 197, 94, 0.28);
}

.btn-forest-tool.active i,
.btn-forest-tool.active .forest-tool-label {
    color: var(--green-300);
}

/* 季節按鈕：依 data-season 切換 icon 顏色提示 */
.btn-forest-tool#btn-season-toggle[data-season="spring"] i { color: #86efac; }
.btn-forest-tool#btn-season-toggle[data-season="summer"] i { color: #fbbf24; }
.btn-forest-tool#btn-season-toggle[data-season="autumn"] i { color: #ef8b5b; }
.btn-forest-tool#btn-season-toggle[data-season="winter"] i { color: #93c5fd; }

/* 效果工具列按鈕 — 時間/霧/光束 active override */
#btn-tod-cycle.active  { color: #fbbf24; border-color: #fbbf24; box-shadow: 0 0 8px #fbbf2466; }
#btn-tod-cycle.active i { color: #fbbf24; filter: drop-shadow(0 0 8px #fbbf2466); }
#btn-toggle-fog.active { color: #a5f3fc; border-color: #67e8f9; box-shadow: 0 0 8px #67e8f966; }
#btn-toggle-fog.active i { color: #a5f3fc; filter: drop-shadow(0 0 8px #67e8f966); }
#btn-toggle-godrays.active { color: #fde68a; border-color: #fcd34d; box-shadow: 0 0 8px #fcd34d66; }
#btn-toggle-godrays.active i { color: #fde68a; filter: drop-shadow(0 0 8px #fcd34d66); }

/* =========================================================================
   21. Cesium Minimap — 地理上下文小卡 (右下角浮動)
   ========================================================================= */
.cesium-minimap {
    position: absolute;
    right: 18px;
    bottom: 18px;
    z-index: 7;
    width: 280px;
    height: 200px;
    padding: 0;
    border-radius: var(--r-lg);
    overflow: hidden;
    background: rgba(10, 20, 16, 0.75);
    border: 1px solid rgba(74, 222, 128, 0.22);
    box-shadow: var(--shadow-float),
                inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: width var(--t-base) var(--ease),
                height var(--t-base) var(--ease),
                border-color var(--t-base) var(--ease),
                box-shadow var(--t-base) var(--ease);
    cursor: zoom-in;
}

.cesium-minimap:hover {
    width: 360px;
    height: 240px;
    border-color: rgba(74, 222, 128, 0.55);
    box-shadow: var(--shadow-float),
                0 0 24px rgba(34, 197, 94, 0.25),
                inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.cesium-minimap-label {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: var(--r-pill);
    background: rgba(10, 20, 16, 0.78);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    font-size: 10.5px;
    font-weight: 600;
    color: var(--green-300);
    letter-spacing: 0.04em;
    pointer-events: none;
}

.cesium-minimap-label i {
    font-size: 10px;
    color: var(--green-400);
    filter: drop-shadow(0 0 4px var(--green-glow-soft));
}

/* =========================================================================
   22. Control Deck — 下半段：控制台 + 結果 + MRV
   ========================================================================= */
.control-deck {
    flex: 1 1 auto;
    padding: 18px;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    grid-template-areas:
        "panel  results"
        "panel  narrative"
        "mrv    mrv";
    gap: 14px;
    align-content: start;
}

#disturbance-panel        { grid-area: panel; }
.disturb-results          { grid-area: results; }
.disturb-narrative        { grid-area: narrative; }
.control-deck > .mrv-exporter-card { grid-area: mrv; }

/* =========================================================================
   23. Disturbance Panel — 干擾情境模擬控制台
   ========================================================================= */
#disturbance-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(74, 222, 128, 0.18);
}

.disturb-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 2px;
}

.disturb-header h3 {
    margin-bottom: 0;
}

.disturb-subtitle {
    font-size: 11px;
    color: var(--text-tertiary);
    letter-spacing: 0.01em;
    line-height: 1.4;
}

/* ---- 4 個干擾類型大按鈕 ---- */
.disturb-types {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.btn-disturb {
    height: 100px;
    border-radius: var(--r-md);
    background: rgba(10, 20, 16, 0.55);
    border: 1.5px solid var(--line-mid);
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all var(--t-base) var(--ease);
}

.btn-disturb i {
    font-size: 26px;
    color: var(--text-secondary);
    transition: color var(--t-base) var(--ease), filter var(--t-base) var(--ease);
}

.btn-disturb span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

.btn-disturb small {
    font-size: 9.5px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.btn-disturb::before {
    /* 點擊高亮的內光暈，預設透明 */
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--t-base) var(--ease);
}

.btn-disturb:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(20, 34, 30, 0.65);
}

.btn-disturb:hover i {
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.22));
}

/* === 主題色：種植 === */
.btn-disturb[data-disturb="plant"]:hover i,
.btn-disturb[data-disturb="plant"]:hover span { color: var(--disturb-plant); }
.btn-disturb[data-disturb="plant"].active {
    background: linear-gradient(135deg,
                    rgba(74, 222, 128, 0.28) 0%,
                    rgba(22, 163, 74, 0.16) 100%);
    border-color: var(--disturb-plant);
    box-shadow: 0 0 18px var(--disturb-plant-glow),
                inset 0 0 22px rgba(74, 222, 128, 0.18);
}
.btn-disturb[data-disturb="plant"].active i,
.btn-disturb[data-disturb="plant"].active span { color: var(--disturb-plant); }
.btn-disturb[data-disturb="plant"].active i { filter: drop-shadow(0 0 10px var(--disturb-plant-glow)); }

/* === 主題色：砍伐 === */
.btn-disturb[data-disturb="log"]:hover i,
.btn-disturb[data-disturb="log"]:hover span { color: var(--disturb-log); }
.btn-disturb[data-disturb="log"].active {
    background: linear-gradient(135deg,
                    rgba(249, 115, 22, 0.28) 0%,
                    rgba(194, 65, 12, 0.16) 100%);
    border-color: var(--disturb-log);
    box-shadow: 0 0 18px var(--disturb-log-glow),
                inset 0 0 22px rgba(249, 115, 22, 0.18);
}
.btn-disturb[data-disturb="log"].active i,
.btn-disturb[data-disturb="log"].active span { color: var(--disturb-log); }
.btn-disturb[data-disturb="log"].active i { filter: drop-shadow(0 0 10px var(--disturb-log-glow)); }

/* === 主題色：颱風 === */
.btn-disturb[data-disturb="typhoon"]:hover i,
.btn-disturb[data-disturb="typhoon"]:hover span { color: var(--disturb-typhoon); }
.btn-disturb[data-disturb="typhoon"].active {
    background: linear-gradient(135deg,
                    rgba(129, 140, 248, 0.28) 0%,
                    rgba(79, 70, 229, 0.16) 100%);
    border-color: var(--disturb-typhoon);
    box-shadow: 0 0 18px var(--disturb-typhoon-glow),
                inset 0 0 22px rgba(129, 140, 248, 0.18);
}
.btn-disturb[data-disturb="typhoon"].active i,
.btn-disturb[data-disturb="typhoon"].active span { color: var(--disturb-typhoon); }
.btn-disturb[data-disturb="typhoon"].active i { filter: drop-shadow(0 0 10px var(--disturb-typhoon-glow)); }

/* === 主題色：土石流 === */
.btn-disturb[data-disturb="landslide"]:hover i,
.btn-disturb[data-disturb="landslide"]:hover span { color: var(--disturb-landslide); }
.btn-disturb[data-disturb="landslide"].active {
    background: linear-gradient(135deg,
                    rgba(217, 119, 6, 0.30) 0%,
                    rgba(146, 64, 14, 0.16) 100%);
    border-color: var(--disturb-landslide);
    box-shadow: 0 0 18px var(--disturb-landslide-glow),
                inset 0 0 22px rgba(217, 119, 6, 0.18);
}
.btn-disturb[data-disturb="landslide"].active i,
.btn-disturb[data-disturb="landslide"].active span { color: var(--disturb-landslide); }
.btn-disturb[data-disturb="landslide"].active i { filter: drop-shadow(0 0 10px var(--disturb-landslide-glow)); }

/* =========================================================================
   24. Disturbance Intensity Slider (自訂滑桿)
   ========================================================================= */
.disturb-intensity {
    background: rgba(10, 20, 16, 0.55);
    border: 1px solid var(--line-soft);
    border-radius: var(--r-md);
    padding: 12px 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.disturb-intensity-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.disturb-intensity-head label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

#disturb-intensity-value {
    font-family: var(--ff-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--green-300);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
    text-shadow: 0 0 14px var(--green-glow-soft);
}

#disturb-intensity-slider,
.sub-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: var(--r-pill);
    background: linear-gradient(90deg,
                    var(--green-500) 0%,
                    var(--amber-400) 50%,
                    var(--copper-500) 100%);
    outline: none;
    cursor: pointer;
    border: 1px solid var(--line-mid);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

#disturb-intensity-slider::-webkit-slider-thumb,
.sub-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, var(--green-300) 0%, var(--green-500) 70%, var(--green-700) 100%);
    border: 2px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 0 12px var(--green-glow),
                0 2px 6px rgba(0, 0, 0, 0.5);
    cursor: grab;
    transition: transform var(--t-fast) var(--ease);
}

#disturb-intensity-slider::-webkit-slider-thumb:hover,
.sub-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

#disturb-intensity-slider::-moz-range-thumb,
.sub-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, var(--green-300) 0%, var(--green-500) 70%, var(--green-700) 100%);
    border: 2px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 0 12px var(--green-glow);
    cursor: grab;
}

.disturb-intensity-scale {
    display: flex;
    justify-content: space-between;
    font-size: 9.5px;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sub-range {
    height: 6px;
    margin: 4px 0 8px;
}

/* =========================================================================
   25. Disturbance Sub-params (依干擾型動態顯示)
   ========================================================================= */
.disturb-sub-params {
    background: linear-gradient(180deg,
                    rgba(10, 20, 16, 0.65) 0%,
                    rgba(14, 26, 22, 0.55) 100%);
    border: 1px solid var(--line-soft);
    border-radius: var(--r-md);
    padding: 14px 14px 12px;
    min-height: 100px;
    transition: border-color var(--t-base) var(--ease),
                box-shadow var(--t-base) var(--ease);
}

/* 干擾選中時，sub-params 區塊邊框跟著變色 */
#disturbance-panel.disturb-active-plant .disturb-sub-params {
    border-color: var(--disturb-plant);
    box-shadow: inset 0 0 18px rgba(74, 222, 128, 0.10);
}
#disturbance-panel.disturb-active-log .disturb-sub-params {
    border-color: var(--disturb-log);
    box-shadow: inset 0 0 18px rgba(249, 115, 22, 0.10);
}
#disturbance-panel.disturb-active-typhoon .disturb-sub-params {
    border-color: var(--disturb-typhoon);
    box-shadow: inset 0 0 18px rgba(129, 140, 248, 0.10);
}
#disturbance-panel.disturb-active-landslide .disturb-sub-params {
    border-color: var(--disturb-landslide);
    box-shadow: inset 0 0 18px rgba(217, 119, 6, 0.10);
}

.sub-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: subPanelFadeIn var(--t-base) var(--ease);
}

@keyframes subPanelFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.sub-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sub-label i {
    font-size: 11px;
    color: var(--green-400);
}

.sub-label span {
    margin-left: auto;
    font-family: var(--ff-display);
    font-size: 14px;
    color: var(--green-300);
    font-variant-numeric: tabular-nums;
}

.sub-select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(10, 20, 16, 0.65);
    border: 1px solid var(--line-mid);
    border-radius: var(--r-sm);
    color: var(--text-primary);
    padding: 9px 30px 9px 12px;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%234ade80' d='M5 6L0 0h10z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color var(--t-base) var(--ease);
}

.sub-select:hover { border-color: rgba(74, 222, 128, 0.35); }
.sub-select:focus {
    outline: none;
    border-color: var(--green-400);
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.18);
}

.sub-select option,
.sub-select optgroup {
    background: var(--bg-elev);
    color: var(--text-primary);
}

.radio-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.radio-pill {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    font-size: 11.5px;
    font-weight: 500;
    border: 1px solid var(--line-mid);
    border-radius: var(--r-sm);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--t-base) var(--ease);
}

.radio-pill input {
    position: absolute;
    opacity: 0;
    inset: 0;
    cursor: pointer;
}

.radio-pill:hover {
    border-color: rgba(249, 115, 22, 0.45);
    color: var(--disturb-log);
}

.radio-pill:has(input:checked) {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.22) 0%, rgba(194, 65, 12, 0.10) 100%);
    border-color: var(--disturb-log);
    color: var(--disturb-log);
    box-shadow: inset 0 0 10px rgba(249, 115, 22, 0.18);
    font-weight: 600;
}

.sub-hint {
    font-size: 11.5px;
    color: var(--text-tertiary);
    text-align: center;
    padding: 18px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sub-hint i {
    color: var(--green-400);
}

/* =========================================================================
   26. Disturbance Actions (Apply / Reset)
   ========================================================================= */
.disturb-actions {
    display: flex;
    gap: 10px;
    margin-top: 2px;
}

.btn-disturb-apply {
    flex: 2 1 auto;
    padding: 12px 18px;
    font-size: 13px;
}

.btn-disturb-apply:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-disturb-apply:disabled:hover {
    transform: none;
}

.btn-ghost {
    flex: 1 1 auto;
    padding: 11px 14px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line-mid);
    border-radius: var(--r-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all var(--t-base) var(--ease);
}

.btn-ghost:hover {
    border-color: rgba(74, 222, 128, 0.40);
    color: var(--green-300);
    background: rgba(34, 197, 94, 0.08);
}

/* =========================================================================
   27. Disturbance Results (20-yr Trajectory + Delta Grid)
   ========================================================================= */
.disturb-results {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 14px;
    align-items: stretch;
    padding: 16px 16px 14px;
}

.disturb-trajectory,
.disturb-deltas {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.trajectory-canvas-wrap {
    position: relative;
    flex: 1 1 auto;
    background: rgba(10, 20, 16, 0.45);
    border: 1px solid var(--line-soft);
    border-radius: var(--r-md);
    padding: 8px;
    min-height: 200px;
    max-height: 240px;
}

.trajectory-canvas-wrap canvas {
    max-height: 224px !important;
}

.delta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 8px;
    flex: 1 1 auto;
}

.delta-box {
    background: rgba(10, 20, 16, 0.55);
    border: 1px solid var(--line-soft);
    border-radius: var(--r-md);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    position: relative;
    overflow: hidden;
    transition: border-color var(--t-base) var(--ease);
}

.delta-box::before {
    content: "";
    position: absolute;
    left: 0;
    top: 16%;
    bottom: 16%;
    width: 2px;
    background: linear-gradient(180deg, var(--green-400), transparent);
    opacity: 0.55;
    border-radius: 2px;
}

.delta-box:hover {
    border-color: rgba(74, 222, 128, 0.22);
}

.delta-box > span {
    font-size: 10.5px;
    color: var(--text-tertiary);
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.delta-box > strong {
    font-family: var(--ff-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.delta-box > small {
    font-size: 9.5px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* delta 數值正負染色 — app.js 設定 class 即可 */
.delta-box.is-positive > strong {
    color: var(--green-400);
    text-shadow: 0 0 14px var(--green-glow-soft);
}
.delta-box.is-positive::before {
    background: linear-gradient(180deg, var(--green-400), transparent);
}
.delta-box.is-negative > strong {
    color: var(--copper-400);
    text-shadow: 0 0 14px var(--copper-glow);
}
.delta-box.is-negative::before {
    background: linear-gradient(180deg, var(--copper-400), transparent);
}

/* =========================================================================
   28. Disturbance Narrative (干擾事件敘述)
   ========================================================================= */
.disturb-narrative {
    padding: 16px 18px 16px 22px;
    position: relative;
    overflow: hidden;
}

.disturb-narrative::before {
    /* 左側捲軸感裝飾 */
    content: "";
    position: absolute;
    left: 0;
    top: 14%;
    bottom: 14%;
    width: 3px;
    background: linear-gradient(180deg,
                    rgba(254, 215, 102, 0.7),
                    rgba(254, 215, 102, 0.1));
    border-radius: 0 3px 3px 0;
    box-shadow: 0 0 10px rgba(254, 215, 102, 0.22);
}

.disturb-narrative h3 i {
    color: var(--amber-400);
    filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.35));
}

#disturb-narrative-text {
    font-size: 12.5px;
    line-height: 1.65;
    color: var(--text-secondary);
    font-style: italic;
    position: relative;
    padding: 4px 0 4px 4px;
    letter-spacing: 0.005em;
}

#disturb-narrative-text::before {
    content: "“";
    font-family: var(--ff-display);
    font-size: 24px;
    color: var(--green-400);
    font-style: normal;
    margin-right: 2px;
    vertical-align: -6px;
    opacity: 0.6;
}

#disturb-narrative-text::after {
    content: "”";
    font-family: var(--ff-display);
    font-size: 24px;
    color: var(--green-400);
    font-style: normal;
    margin-left: 2px;
    vertical-align: -6px;
    opacity: 0.6;
}

/* =========================================================================
   29. 新版面響應式
   ========================================================================= */
@media (max-width: 1400px) {
    .disturb-types {
        grid-template-columns: repeat(2, 1fr);
    }
    .control-deck {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 1280px) {
    .forest-scene-header {
        max-width: calc(100% - 230px);
        padding: 10px 14px;
    }
    .forest-scene-header .map-title-info h2 { font-size: 14px; }
    .btn-forest-tool {
        width: 48px;
        height: 48px;
    }
    .btn-forest-tool i { font-size: 14px; }
}

@media (max-width: 1100px) {
    #forest-scene-container {
        flex: 0 0 55vh;
        min-height: 420px;
    }
    .cesium-minimap {
        width: 180px;
        height: 130px;
    }
    .cesium-minimap:hover {
        width: 240px;
        height: 170px;
    }
    .cesium-minimap-label {
        font-size: 9.5px;
        padding: 4px 8px;
    }
    .control-deck {
        grid-template-columns: 1fr;
        grid-template-areas:
            "panel"
            "results"
            "narrative"
            "mrv";
    }
    .disturb-results {
        grid-template-columns: 1fr;
    }
    .forest-scene-header {
        max-width: calc(100% - 200px);
    }
}

@media (max-width: 900px) {
    #forest-scene-container {
        flex: 0 0 42vh;
        min-height: 320px;
    }
    .forest-toolbar {
        padding: 5px;
        gap: 5px;
    }
    .btn-forest-tool {
        width: 42px;
        height: 42px;
    }
    .btn-forest-tool .forest-tool-label { font-size: 8.5px; }
    .disturb-types {
        grid-template-columns: 1fr 1fr;
    }
    .btn-disturb {
        height: 88px;
    }
    .btn-disturb i { font-size: 22px; }
    .mrv-exporter-card {
        flex-direction: column;
        align-items: stretch;
    }
}

