/**
 * 航空票務-航權與指標教學系統 - 向量地圖專用樣式
 * 支援深色/明亮雙主題、消除飄動點點、頂層TC區域標示與浮動教學圖例
 */

.map-controls {
    position: absolute;
    top: 14px;
    left: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 20;
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    padding: 5px 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.map-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    user-select: none;
    line-height: 1;
}

.map-btn i {
    pointer-events: none;
    font-size: 13px;
    line-height: 1;
}

.map-btn:hover {
    background: rgba(0, 240, 255, 0.15);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.map-btn.map-btn-clear {
    width: auto;
    padding: 0 10px;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.4);
}

.map-btn.map-btn-clear:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
    color: #f87171;
}

.map-btn.map-btn-clear i {
    font-size: 11px;
    color: #f87171;
}

.map-coord-display {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    padding-left: 8px;
    border-left: 1px solid var(--border-color);
    user-select: none;
}

/* 國際換日線 (IDL 180°) 專屬視覺樣式 (宣告 fill: none 徹底杜絕黑色多邊形填充) */
.date-line {
    fill: none !important;
    stroke: #f43f5e;
    stroke-width: 2.8;
    stroke-dasharray: 10, 5;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.date-line-glow {
    fill: none !important;
    stroke: #ef4444;
    stroke-width: 7;
    opacity: 0.4;
    filter: url(#glow);
    pointer-events: none;
}

.date-line-tag {
    pointer-events: none;
    user-select: none;
}

.date-line-badge {
    fill: rgba(225, 29, 72, 0.88);
    stroke: #fda4af;
    stroke-width: 1.5;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

.date-line-text {
    font-size: 12px;
    font-weight: 800;
    fill: #ffffff;
    letter-spacing: 0.5px;
    dominant-baseline: central;
}

.date-line-sub {
    font-size: 9.5px;
    font-weight: 600;
    fill: #ffe4e6;
    letter-spacing: 0.3px;
    dominant-baseline: central;
}

.tz-badge-bg.idl-badge {
    fill: #e11d48;
    stroke: #fda4af;
    stroke-width: 1.2;
}

.tz-badge-text.idl-text {
    fill: #ffffff;
    font-weight: 800;
}

/* 明亮模式換日線適配 */
[data-theme="light"] .date-line-badge,
.theme-light .date-line-badge {
    fill: rgba(225, 29, 72, 0.94);
    stroke: #be123c;
}

[data-theme="light"] .tz-badge-bg.idl-badge,
.theme-light .tz-badge-bg.idl-badge {
    fill: #be123c;
    stroke: #9f1239;
}

/* TC 區域色塊與標籤聚焦/變暗樣式 (滑鼠點選單區時自動變暗其餘兩區) */
.zone-poly {
    transition: opacity 0.35s ease, filter 0.35s ease;
}

.zone-poly.dimmed {
    opacity: 0.05 !important;
}

.zone-poly.highlighted {
    opacity: 1 !important;
}

.tc-header-group {
    transition: opacity 0.35s ease, transform 0.35s ease;
    cursor: pointer;
}

.tc-header-group:hover {
    filter: brightness(1.15);
}

.tc-header-group.dimmed {
    opacity: 0.22 !important;
}

.tc-header-group.highlighted {
    opacity: 1 !important;
    filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.4));
}

.tc-boundary-tag, .tc-real-boundary {
    transition: opacity 0.35s ease;
}

.tc-boundary-tag.dimmed, .tc-real-boundary.dimmed {
    opacity: 0.25 !important;
}

/* SVG 畫布整體 */
#aviation-svg {
    width: 100%;
    height: 100%;
    display: block;
    cursor: default;
    user-select: none;
}

/* 陸地輪廓 (置於底層，可互動點擊) */
.country-poly {
    fill: #14213d;
    stroke: #1f3158;
    stroke-width: 0.8;
    transition: fill 0.2s, stroke 0.2s, filter 0.2s;
    cursor: pointer;
}

.country-poly:hover {
    fill: #1e3a63;
    stroke: #00f0ff;
    stroke-width: 1.2;
}

/* 點擊選中釘選之國家高亮效果 (深色模式) */
.country-poly.selected-country {
    fill: rgba(0, 240, 255, 0.35) !important;
    stroke: #00f0ff !important;
    stroke-width: 1.8 !important;
    filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.85));
}

/* 明亮模式下之陸地與海洋 */
[data-theme="light"] .ocean-bg {
    fill: url(#ocean-grad-light) !important;
}

[data-theme="light"] .country-poly {
    fill: #e2e8f0;
    stroke: #94a3b8;
}

[data-theme="light"] .country-poly:hover {
    fill: #cbd5e1;
    stroke: #0284c7;
    stroke-width: 1.2;
}

/* 明亮模式下選中釘選之國家高亮效果 */
[data-theme="light"] .country-poly.selected-country {
    fill: rgba(14, 165, 233, 0.32) !important;
    stroke: #0284c7 !important;
    stroke-width: 2 !important;
    filter: drop-shadow(0 0 5px rgba(2, 132, 199, 0.65));
}

/* 經緯網格線 */
.grid-line {
    stroke: rgba(148, 163, 184, 0.35);
    stroke-width: 1;
    stroke-dasharray: 4,4;
}

.equator-line {
    stroke: #00f0ff;
    stroke-width: 1.4;
    stroke-dasharray: 6,4;
    opacity: 0.8;
}

.tropic-line {
    stroke: #f59e0b;
    stroke-width: 1;
    stroke-dasharray: 4,3;
    opacity: 0.6;
}

.grid-label {
    fill: var(--text-dim);
    font-size: 9.5px;
    font-family: var(--font-mono);
    user-select: none;
}
.grid-label.small {
    font-size: 8px;
}

/* 時區經線 */
.tz-meridian {
    stroke: rgba(148, 163, 184, 0.3);
    stroke-width: 0.8;
}

.prime-meridian {
    stroke: #00f0ff;
    stroke-width: 2.2;
    stroke-dasharray: 8,4;
    filter: drop-shadow(0 0 5px rgba(0, 240, 255, 0.6));
}

.dateline-meridian {
    stroke: #ef4444;
    stroke-width: 2.2;
    stroke-dasharray: 6,3;
    filter: drop-shadow(0 0 5px rgba(239, 68, 68, 0.6));
}

.tz-badge-bg {
    fill: var(--bg-card);
    stroke: var(--border-color);
    stroke-width: 0.8;
}
.tz-badge-bg.prime {
    fill: rgba(0, 240, 255, 0.2);
    stroke: #00f0ff;
}
.tz-badge-bg.dateline {
    fill: rgba(239, 68, 68, 0.3);
    stroke: #ef4444;
}

.tz-label-text {
    fill: var(--text-main);
    font-size: 9px;
    font-family: var(--font-mono);
    font-weight: 700;
}

/* TC 頂層標題與旗標 (在最上層，清晰可讀) */
.tc-header-group {
    cursor: pointer;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
    transition: transform 0.2s;
}
.tc-header-group:hover {
    transform: translateY(-2px);
}

.tc-header-badge {
    stroke-width: 1.5;
}
.tc1-badge {
    fill: rgba(30, 58, 138, 0.88);
    stroke: #60a5fa;
}
.tc2-badge {
    fill: rgba(6, 78, 59, 0.88);
    stroke: #34d399;
}
.tc3-badge {
    fill: rgba(120, 53, 15, 0.88);
    stroke: #fbbf24;
}

[data-theme="light"] .tc1-badge {
    fill: rgba(219, 234, 254, 0.95);
    stroke: #2563eb;
}
[data-theme="light"] .tc2-badge {
    fill: rgba(209, 250, 229, 0.95);
    stroke: #059669;
}
[data-theme="light"] .tc3-badge {
    fill: rgba(254, 243, 199, 0.95);
    stroke: #d97706;
}

.tc-header-title {
    fill: #ffffff;
    font-size: 13px;
    font-weight: 800;
}
.tc-header-sub {
    fill: #e2e8f0;
    font-size: 10px;
}

[data-theme="light"] .tc-header-title {
    fill: #0f172a;
}
[data-theme="light"] .tc-header-sub {
    fill: #475569;
}

/* TC 區域交界標記與真實邊界線 */
.boundary-badge-bg {
    fill: #0f172a;
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 1.2;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

[data-theme="light"] .boundary-badge-bg,
.theme-light .boundary-badge-bg {
    fill: #ffffff;
    stroke: #94a3b8;
    stroke-width: 1.2;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.18));
}

.boundary-text {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.tc12-text { fill: #60a5fa; }
.tc23-text { fill: #34d399; }
.tc31-text { fill: #fbbf24; }

[data-theme="light"] .tc12-text,
.theme-light .tc12-text { fill: #1d4ed8; }
[data-theme="light"] .tc23-text,
.theme-light .tc23-text { fill: #047857; }
[data-theme="light"] .tc31-text,
.theme-light .tc31-text { fill: #b45309; }

/* 三大分界線樣式 */
.tc12-line { stroke: #3b82f6 !important; }
.tc23-line { stroke: #10b981 !important; }
.tc31-line { stroke: #f59e0b !important; }

[data-theme="light"] .tc12-line,
.theme-light .tc12-line { stroke: #2563eb !important; }
[data-theme="light"] .tc23-line,
.theme-light .tc23-line { stroke: #059669 !important; }
[data-theme="light"] .tc31-line,
.theme-light .tc31-line { stroke: #d97706 !important; }

/* 航點標記 (靜態高質感雷達標記，無移動跳躍點點) */
.airport-marker {
    cursor: pointer;
}

.ap-ring {
    fill: rgba(0, 240, 255, 0.15);
    stroke: #00f0ff;
    stroke-width: 1.2;
}

.ap-dot {
    fill: #00f0ff;
    stroke: #ffffff;
    stroke-width: 1;
}

.ap-badge-bg {
    fill: #0f172a;
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 0.9;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.ap-badge-text {
    fill: #f8fafc;
    font-size: 8.5px;
    font-family: var(--font-mono);
    font-weight: 700;
    letter-spacing: 0.3px;
}

/* 明亮模式一般航點標記 */
[data-theme="light"] .ap-badge-bg,
.theme-light .ap-badge-bg {
    fill: #ffffff;
    stroke: #94a3b8;
    stroke-width: 1;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.18));
}

[data-theme="light"] .ap-badge-text,
.theme-light .ap-badge-text {
    fill: #0f172a;
    font-weight: 800;
}

/* 臺灣航點特殊標記 (深色模式：金黃對比，深底清晰高辨識度) */
.marker-taiwan .ap-ring {
    stroke: #f59e0b;
    fill: rgba(245, 158, 11, 0.2);
}
.marker-taiwan .ap-dot {
    fill: #fbbf24;
    stroke: #ffffff;
    stroke-width: 1.2;
}
.marker-taiwan .ap-badge-bg {
    fill: #0f172a !important;
    stroke: #f59e0b !important;
    stroke-width: 1.4 !important;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.7)) !important;
}
.marker-taiwan .ap-badge-text {
    fill: #fbbf24 !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px;
}

/* 臺灣航點特殊標記 (明亮模式：白底深琥珀色字體，超高對比度極度清晰) */
[data-theme="light"] .marker-taiwan .ap-ring,
.theme-light .marker-taiwan .ap-ring {
    stroke: #b45309;
    fill: rgba(217, 119, 6, 0.15);
}
[data-theme="light"] .marker-taiwan .ap-dot,
.theme-light .marker-taiwan .ap-dot {
    fill: #b45309;
    stroke: #ffffff;
    stroke-width: 1.2;
}
[data-theme="light"] .marker-taiwan .ap-badge-bg,
.theme-light .marker-taiwan .ap-badge-bg {
    fill: #ffffff !important;
    stroke: #b45309 !important;
    stroke-width: 1.5 !important;
    filter: drop-shadow(0 1px 4px rgba(180, 83, 9, 0.25)) !important;
}
[data-theme="light"] .marker-taiwan .ap-badge-text,
.theme-light .marker-taiwan .ap-badge-text {
    fill: #78350f !important;
    font-weight: 900 !important;
    letter-spacing: 0.5px;
}

/* 選中與高亮航點 (包含一般航點與臺灣航點，全模式皆以鮮明玫瑰紅實心底色與純白字體呈現) */
.airport-marker.highlighted .ap-ring,
.airport-marker.selected .ap-ring {
    stroke: #e11d48 !important;
    fill: rgba(225, 29, 72, 0.3) !important;
    r: 9;
}
.airport-marker.highlighted .ap-dot,
.airport-marker.selected .ap-dot {
    fill: #ffffff !important;
    stroke: #e11d48 !important;
    stroke-width: 1.6 !important;
    r: 5;
}
.airport-marker.highlighted .ap-badge-bg,
.airport-marker.selected .ap-badge-bg,
.airport-marker.highlighted.marker-taiwan .ap-badge-bg,
.airport-marker.selected.marker-taiwan .ap-badge-bg {
    fill: #e11d48 !important;
    stroke: #ffffff !important;
    stroke-width: 1.5 !important;
    filter: drop-shadow(0 2px 8px rgba(225, 29, 72, 0.6)) !important;
}
.airport-marker.highlighted .ap-badge-text,
.airport-marker.selected .ap-badge-text,
.airport-marker.highlighted.marker-taiwan .ap-badge-text,
.airport-marker.selected.marker-taiwan .ap-badge-text {
    fill: #ffffff !important;
    font-weight: 900 !important;
    letter-spacing: 0.5px;
}

/* 明亮模式下的選中與高亮航點陰影調整 */
[data-theme="light"] .airport-marker.highlighted .ap-badge-bg,
[data-theme="light"] .airport-marker.selected .ap-badge-bg,
.theme-light .airport-marker.highlighted .ap-badge-bg,
.theme-light .airport-marker.selected .ap-badge-bg {
    fill: #e11d48 !important;
    stroke: #ffffff !important;
    stroke-width: 1.5 !important;
    filter: drop-shadow(0 2px 6px rgba(225, 29, 72, 0.45)) !important;
}

/* 航點角色標籤 (如 A國, B國, C國) */
.role-badge-bg {
    fill: rgba(15, 23, 42, 0.9);
    stroke: #ff5d8f;
    stroke-width: 1.2;
}
[data-theme="light"] .role-badge-bg {
    fill: rgba(255, 255, 255, 0.95);
    stroke: #e11d48;
}
.role-badge-text {
    fill: #ffffff;
    font-size: 9.5px;
    font-weight: 800;
}
[data-theme="light"] .role-badge-text {
    fill: #e11d48;
}

/* 航線動態流光 (僅航線上流動，無外部飄動點點) */
.flight-route-line {
    animation: dash-flight 1.5s linear infinite;
}

@keyframes dash-flight {
    from { stroke-dashoffset: 26; }
    to { stroke-dashoffset: 0; }
}

/* 飛行中飛機標記 */
.flying-aircraft-marker {
    filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.8));
    pointer-events: none;
}

/* 地圖浮動專屬教學圖例卡片 (解決部分航權無圖例問題) */
.map-floating-legend-card {
    position: absolute;
    bottom: 45px;
    left: 14px;
    z-index: 30;
    max-width: 420px;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1.5px solid var(--accent-rose);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    animation: fadeIn 0.2s ease-out;
}

.f-legend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.f-legend-badge {
    font-size: 11px;
    font-weight: 800;
    color: var(--accent-rose);
}
.f-legend-close {
    font-size: 18px;
    line-height: 1;
    color: var(--text-dim);
    cursor: pointer;
}
.f-legend-close:hover {
    color: var(--text-main);
}
.f-legend-title {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 6px;
}
.f-legend-flow {
    font-size: 12px;
    color: var(--accent-cyan);
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid var(--border-glow);
    padding: 5px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
}
.f-legend-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}
.legend-role-chip {
    font-size: 10px;
    font-weight: 700;
    background: rgba(255, 93, 143, 0.15);
    color: var(--accent-rose);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid rgba(255, 93, 143, 0.35);
}
.f-legend-notes {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.35;
}

/* 懸浮 Tooltip */
.map-tooltip {
    position: fixed;
    display: none;
    z-index: 1000;
    pointer-events: none;
    background: var(--bg-card);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(12px);
    max-width: 280px;
}

.tip-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 4px;
}
.tip-iata {
    font-size: 18px;
    font-weight: 900;
    color: var(--accent-cyan);
    font-family: var(--font-mono);
}
.tip-name {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-main);
}
.tip-country {
    font-size: 11px;
    color: var(--text-dim);
}

.tip-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11.5px;
}
.tip-row {
    display: flex;
    justify-content: space-between;
}
.tip-k { color: var(--text-dim); }
.tip-v { color: var(--text-main); }
.tip-note {
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(0, 240, 255, 0.06);
    padding: 4px 6px;
    border-radius: 4px;
    margin-top: 4px;
}
.tip-footer {
    font-size: 10px;
    color: var(--text-dim);
    margin-top: 6px;
    text-align: center;
    border-top: 1px dashed var(--border-color);
    padding-top: 4px;
}

/* ====================================================
   地圖點擊國家釘選標籤 (SVG 釘選針與名稱卡片)
   ==================================================== */
.country-pin-marker {
    cursor: pointer;
    animation: cPinPop 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    pointer-events: all;
}

@keyframes cPinPop {
    0% { transform: scale(0.6); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* 呼吸脈衝圓圈 */
.c-pin-pulse {
    fill: rgba(0, 240, 255, 0.18);
    stroke: #00f0ff;
    stroke-width: 1.4;
    animation: cPulseAnim 1.8s infinite;
}

@keyframes cPulseAnim {
    0% { r: 5; opacity: 1; stroke-width: 1.6; }
    50% { r: 16; opacity: 0.45; stroke-width: 1.1; }
    100% { r: 25; opacity: 0; stroke-width: 0.5; }
}

.c-pin-dot {
    fill: #00f0ff;
    stroke: #ffffff;
    stroke-width: 1.5;
}

.c-pin-stem {
    stroke: #00f0ff;
    stroke-width: 1.6;
    stroke-dasharray: 2, 2;
}

.c-pin-rect {
    fill: rgba(11, 20, 42, 0.94);
    stroke: #00f0ff;
    stroke-width: 1.6;
    filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.7));
    transition: all 0.2s ease;
}

.country-pin-marker:hover .c-pin-rect {
    fill: rgba(16, 29, 61, 0.98);
    stroke: #38bdf8;
    stroke-width: 2;
}

.c-pin-title {
    fill: #ffffff;
    font-size: 13.5px;
    font-weight: 800;
    font-family: var(--font-sans, system-ui, -apple-system, sans-serif);
    letter-spacing: 0.3px;
}

.c-pin-sub {
    fill: #38bdf8;
    font-size: 10px;
    font-weight: 700;
    font-family: var(--font-mono, monospace);
}

.c-pin-hint {
    fill: #94a3b8;
    font-size: 9px;
    font-family: var(--font-sans, system-ui, sans-serif);
}

/* 明亮主題下的釘選卡片樣式 */
[data-theme="light"] .c-pin-pulse {
    stroke: #0284c7;
    fill: rgba(2, 132, 199, 0.15);
}
[data-theme="light"] .c-pin-dot {
    fill: #0284c7;
    stroke: #ffffff;
}
[data-theme="light"] .c-pin-stem {
    stroke: #0284c7;
}
[data-theme="light"] .c-pin-rect {
    fill: rgba(255, 255, 255, 0.96);
    stroke: #0284c7;
    stroke-width: 1.6;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.15));
}
[data-theme="light"] .c-pin-title {
    fill: #0f172a;
}
[data-theme="light"] .c-pin-sub {
    fill: #0369a1;
}
[data-theme="light"] .c-pin-hint {
    fill: #64748b;
}

/* ====================================================
   地圖底部浮動國家選取狀態條 (Country Floating Banner)
   ==================================================== */
.country-floating-banner {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 120;
    display: none;
    align-items: center;
    gap: 12px;
    background: rgba(11, 20, 42, 0.94);
    border: 1px solid var(--accent-cyan);
    border-radius: 30px;
    padding: 7px 18px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 12px rgba(0, 240, 255, 0.25);
    backdrop-filter: blur(12px);
    animation: cBannerSlideUp 0.25s ease-out;
}

@keyframes cBannerSlideUp {
    from { opacity: 0; transform: translate(-50%, 15px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.c-banner-icon {
    font-size: 15px;
    color: var(--accent-cyan);
    display: flex;
    align-items: center;
}

.c-banner-content {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.c-banner-title {
    font-size: 14px;
    font-weight: 800;
    color: #ffffff;
}

.c-banner-tc {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-cyan);
    background: rgba(0, 240, 255, 0.12);
    padding: 2px 7px;
    border-radius: 10px;
    border: 1px solid rgba(0, 240, 255, 0.3);
}

.c-banner-hint {
    font-size: 11px;
    color: var(--text-dim);
    margin-left: 4px;
}

.c-banner-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.c-banner-close:hover {
    color: #ef4444;
}

[data-theme="light"] .country-floating-banner {
    background: rgba(255, 255, 255, 0.95);
    border-color: #0284c7;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12), 0 0 8px rgba(2, 132, 199, 0.2);
}

[data-theme="light"] .c-banner-title {
    color: #0f172a;
}

[data-theme="light"] .c-banner-tc {
    color: #0284c7;
    background: rgba(2, 132, 199, 0.1);
    border-color: rgba(2, 132, 199, 0.3);
}

/* ====================================================
   經度線與時區標準教學圖層樣式 (Longitude & Timezone Standard)
   ==================================================== */

/* 時區感應帶 (15° 跨度) */
.lon-zone-band {
    fill: transparent;
    transition: fill 0.2s ease;
    cursor: pointer;
}

.lon-zone-band:hover {
    fill: rgba(0, 240, 255, 0.08);
}

.lon-zone-band.tpe-zone:hover {
    fill: rgba(245, 158, 11, 0.12);
}

.lon-zone-band.prime-zone:hover {
    fill: rgba(59, 130, 246, 0.12);
}

/* ±7.5° 時區範圍邊界線 */
.lon-boundary-line {
    stroke: rgba(148, 163, 184, 0.25);
    stroke-width: 0.9;
    stroke-dasharray: 4, 4;
    pointer-events: none;
}

.lon-boundary-tick-text {
    fill: var(--text-dim);
    font-size: 7.5px;
    font-family: var(--font-mono);
    pointer-events: none;
    user-select: none;
    opacity: 0.7;
}

/* 中央經線 (每 15° 標準經線) */
.lon-central-meridian {
    stroke: rgba(148, 163, 184, 0.45);
    stroke-width: 1.2;
    pointer-events: none;
    transition: stroke 0.2s, stroke-width 0.2s;
}

.lon-central-meridian.prime-meridian {
    stroke: #00f0ff;
    stroke-width: 2.2;
    stroke-dasharray: 8, 4;
    filter: drop-shadow(0 0 5px rgba(0, 240, 255, 0.7));
}

.lon-central-meridian.tpe-meridian {
    stroke: #f59e0b;
    stroke-width: 2.2;
    stroke-dasharray: 8, 4;
    filter: drop-shadow(0 0 5px rgba(245, 158, 11, 0.7));
}

.lon-central-meridian.idl-meridian {
    stroke: #f43f5e;
    stroke-width: 2.2;
    stroke-dasharray: 6, 3;
    filter: drop-shadow(0 0 5px rgba(244, 63, 94, 0.7));
}

/* 頂部雙層度數與時區指示徽章 */
.lon-badge-group {
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.lon-badge-group:hover {
    transform: scale(1.15) translateY(-2px);
    filter: brightness(1.25);
}

.lon-badge-group.highlighted {
    filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.9)) !important;
}

.lon-badge-bg {
    fill: rgba(15, 23, 42, 0.94);
    stroke: var(--border-color);
    stroke-width: 1;
}

.lon-badge-bg.prime {
    fill: rgba(14, 116, 144, 0.95);
    stroke: #00f0ff;
}

.lon-badge-bg.tpe {
    fill: rgba(180, 83, 9, 0.95);
    stroke: #fbbf24;
}

.lon-badge-bg.idl {
    fill: rgba(190, 18, 60, 0.95);
    stroke: #fda4af;
}

.lon-badge-text {
    fill: #ffffff;
    font-size: 8.5px;
    font-weight: 800;
    font-family: var(--font-mono);
    dominant-baseline: central;
}

.lon-badge-sub {
    fill: var(--accent-cyan);
    font-size: 7.5px;
    font-weight: 700;
    font-family: var(--font-mono);
    dominant-baseline: central;
}

.lon-badge-bg.tpe ~ .lon-badge-sub {
    fill: #fef08a;
}

.lon-badge-bg.idl ~ .lon-badge-sub {
    fill: #ffe4e6;
}

/* 底部經度度數標籤 */
.lon-bottom-badge {
    pointer-events: none;
    user-select: none;
    color: var(--text-dim);
}

.lon-bottom-text {
    fill: var(--text-muted);
    font-size: 8.5px;
    font-weight: 700;
    font-family: var(--font-mono);
    dominant-baseline: central;
}

/* 課本範例 5 特殊指標線 (杜拜 55°E) */
.lon-example-group {
    pointer-events: none;
    user-select: none;
}

.lon-example-line {
    stroke: #c084fc;
    stroke-width: 1.4;
    stroke-dasharray: 4, 3;
    pointer-events: none;
}

.lon-example-badge {
    pointer-events: all;
    cursor: pointer;
}

.lon-ex-rect {
    fill: rgba(107, 33, 168, 0.92);
    stroke: #c084fc;
    stroke-width: 1.2;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

.lon-ex-text {
    fill: #f5f3ff;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.3px;
    dominant-baseline: central;
}

/* ====================================================
   地圖左下角：時區標準與經度換算教學指引卡片
   ==================================================== */
.tz-standard-guide-card {
    position: absolute;
    bottom: 16px;
    left: 14px;
    width: 320px;
    z-index: 90;
    background: rgba(11, 20, 42, 0.95);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border-color);
    border-left: 3.5px solid var(--accent-cyan);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    box-shadow: var(--shadow-md), 0 0 16px rgba(0, 240, 255, 0.12);
    transition: all 0.25s ease;
}

.tz-standard-guide-card.minimized {
    width: auto;
    padding: 6px 12px;
}

.tz-standard-guide-card.minimized .tz-guide-body {
    display: none;
}

.tz-guide-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.tz-standard-guide-card.minimized .tz-guide-header {
    margin-bottom: 0;
}

.tz-guide-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 800;
    color: var(--text-main);
}

.tz-guide-title i {
    color: var(--accent-cyan);
}

.tz-guide-badge {
    font-size: 10px;
    background: rgba(0, 240, 255, 0.15);
    color: var(--accent-cyan);
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid rgba(0, 240, 255, 0.3);
    font-weight: 700;
}

.tz-guide-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 22px;
    height: 22px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    transition: all 0.15s;
}

.tz-guide-btn:hover {
    color: var(--text-main);
    border-color: var(--accent-cyan);
    background: rgba(0, 240, 255, 0.1);
}

.tz-guide-formula-box {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    margin-bottom: 8px;
}

.tz-formula-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    margin-bottom: 4px;
}

.tz-formula-row:last-child {
    margin-bottom: 0;
}

.tz-formula-tag {
    font-size: 9.5px;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 600;
}

.tz-formula-math {
    color: var(--text-main);
}

.tz-formula-math strong {
    color: var(--accent-cyan);
}

.tz-formula-sub {
    font-size: 10px;
    color: var(--text-dim);
}

.tz-guide-examples-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tz-guide-quick-pills {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin-bottom: 8px;
}

.tz-pill-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 10.5px;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tz-pill-btn:hover {
    border-color: var(--accent-cyan);
    background: rgba(0, 240, 255, 0.1);
    transform: translateY(-1px);
}

.pill-dot {
    width: 6.5px;
    height: 6.5px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pill-dot.amber { background: #f59e0b; box-shadow: 0 0 5px #f59e0b; }
.pill-dot.purple { background: #c084fc; box-shadow: 0 0 5px #c084fc; }
.pill-dot.cyan { background: #00f0ff; box-shadow: 0 0 5px #00f0ff; }
.pill-dot.red { background: #ef4444; box-shadow: 0 0 5px #ef4444; }

.tz-guide-hint {
    font-size: 10.5px;
    color: var(--text-dim);
    line-height: 1.4;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    padding-top: 6px;
}

.tz-guide-hint strong {
    color: var(--accent-cyan);
}

/* 時區 Tooltip 專用卡片 */
.tz-tooltip-card {
    min-width: 240px;
    padding: 2px;
}

.tz-tooltip-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border-color);
}

.tz-tooltip-badge {
    background: var(--accent-cyan);
    color: #040914;
    font-weight: 800;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 3px;
}

.tz-tooltip-title {
    font-weight: 800;
    font-size: 12px;
    color: var(--text-main);
}

.tz-tooltip-row {
    font-size: 11px;
    margin-bottom: 3px;
    color: var(--text-muted);
}

.tz-t-label {
    color: var(--text-dim);
}

.tz-t-val {
    color: var(--text-main);
}

/* 明亮模式經度線與時區指引卡適配 */
[data-theme="light"] .lon-zone-band:hover {
    fill: rgba(2, 132, 199, 0.08);
}

[data-theme="light"] .lon-boundary-line {
    stroke: rgba(100, 116, 139, 0.3);
}

[data-theme="light"] .lon-central-meridian {
    stroke: rgba(100, 116, 139, 0.45);
}

[data-theme="light"] .lon-badge-bg {
    fill: #ffffff;
    stroke: #cbd5e1;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .lon-badge-text {
    fill: #0f172a;
}

[data-theme="light"] .lon-badge-sub {
    fill: #0284c7;
}

[data-theme="light"] .lon-bottom-text {
    fill: #475569;
}

[data-theme="light"] .tz-standard-guide-card {
    background: rgba(255, 255, 255, 0.96);
    border-color: #cbd5e1;
    border-left-color: #0284c7;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 0 12px rgba(2, 132, 199, 0.1);
}

[data-theme="light"] .tz-guide-formula-box {
    background: rgba(241, 245, 249, 0.95);
    border-color: #e2e8f0;
}

[data-theme="light"] .tz-guide-hint {
    border-top-color: rgba(0, 0, 0, 0.08);
}

/* ====================================================
   GMT+0 格林威治子午線 (本初子午線) 專屬教學標示與經緯度網格
   ==================================================== */

/* 本初子午線發光光軌 */
.prime-meridian-glow {
    fill: none !important;
    stroke: #00f0ff;
    stroke-width: 8;
    opacity: 0.35;
    pointer-events: none;
    filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.8));
}

/* 經緯度平行線 (網格) */
.lat-grid-line {
    stroke: rgba(148, 163, 184, 0.22);
    stroke-width: 0.9;
    stroke-dasharray: 4, 6;
    pointer-events: none;
}

.lat-grid-line.equator {
    stroke: rgba(0, 240, 255, 0.35);
    stroke-width: 1.2;
    stroke-dasharray: 6, 4;
}

.lat-grid-label {
    fill: rgba(148, 163, 184, 0.7);
    font-size: 8px;
    font-family: var(--font-mono);
    font-weight: 700;
    pointer-events: none;
    user-select: none;
    dominant-baseline: central;
}

/* 本初子午線專屬教學卡片標籤 */
.prime-meridian-tag {
    cursor: pointer;
    user-select: none;
    transition: transform 0.25s ease, filter 0.25s ease;
}

.prime-meridian-tag:hover {
    transform: scale(1.08) translateY(-2px);
    filter: brightness(1.2);
}

.prime-meridian-badge {
    fill: rgba(14, 116, 144, 0.94);
    stroke: #00f0ff;
    stroke-width: 1.8;
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.6));
}

.prime-meridian-badge-mid {
    fill: rgba(15, 23, 42, 0.94);
    stroke: #38bdf8;
}

.prime-meridian-text {
    font-size: 11.5px;
    font-weight: 800;
    fill: #ffffff;
    letter-spacing: 0.6px;
    dominant-baseline: central;
}

.prime-meridian-sub {
    font-size: 9px;
    font-weight: 600;
    fill: #a5f3fc;
    letter-spacing: 0.2px;
    dominant-baseline: central;
}

/* 格林威治天文台脈衝定位點與標記 */
.prime-meridian-pin {
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s ease;
}

.prime-meridian-pin:hover {
    transform: scale(1.12);
}

.prime-pin-pulse {
    fill: rgba(0, 240, 255, 0.2);
    stroke: #00f0ff;
    stroke-width: 1.5;
    animation: primePulse 2s infinite ease-in-out;
}

.prime-pin-dot {
    fill: #00f0ff;
    stroke: #ffffff;
    stroke-width: 1.5;
    filter: drop-shadow(0 0 5px #00f0ff);
}

.prime-pin-badge {
    fill: rgba(15, 23, 42, 0.94);
    stroke: #00f0ff;
    stroke-width: 1.2;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

.prime-pin-text {
    font-size: 8.5px;
    font-weight: 800;
    fill: #e0f2fe;
    dominant-baseline: central;
}

@keyframes primePulse {
    0% { r: 5; opacity: 1; stroke-width: 2; }
    50% { r: 14; opacity: 0.45; stroke-width: 1.2; }
    100% { r: 22; opacity: 0; stroke-width: 0.5; }
}

/* 明亮模式適配 (Light Theme) */
[data-theme="light"] .prime-meridian-glow,
.theme-light .prime-meridian-glow {
    stroke: #0284c7;
    opacity: 0.25;
}

[data-theme="light"] .prime-meridian-badge,
.theme-light .prime-meridian-badge {
    fill: rgba(255, 255, 255, 0.96);
    stroke: #0284c7;
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.15));
}

[data-theme="light"] .prime-meridian-badge-mid,
.theme-light .prime-meridian-badge-mid {
    fill: rgba(240, 249, 255, 0.96);
    stroke: #0369a1;
}

[data-theme="light"] .prime-meridian-text,
.theme-light .prime-meridian-text {
    fill: #0f172a;
}

[data-theme="light"] .prime-meridian-sub,
.theme-light .prime-meridian-sub {
    fill: #0284c7;
}

[data-theme="light"] .prime-pin-badge,
.theme-light .prime-pin-badge {
    fill: rgba(255, 255, 255, 0.96);
    stroke: #0284c7;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.12));
}

[data-theme="light"] .prime-pin-text,
.theme-light .prime-pin-text {
    fill: #0369a1;
}

[data-theme="light"] .prime-pin-pulse,
.theme-light .prime-pin-pulse {
    stroke: #0284c7;
    fill: rgba(2, 132, 199, 0.15);
}

[data-theme="light"] .prime-pin-dot,
.theme-light .prime-pin-dot {
    fill: #0284c7;
}

[data-theme="light"] .lat-grid-line,
.theme-light .lat-grid-line {
    stroke: rgba(100, 116, 139, 0.25);
}

[data-theme="light"] .lat-grid-line.equator,
.theme-light .lat-grid-line.equator {
    stroke: rgba(2, 132, 199, 0.35);
}

[data-theme="light"] .lat-grid-label,
.theme-light .lat-grid-label {
    fill: rgba(100, 116, 139, 0.7);
}

