
  @import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

  * { margin: 0; padding: 0; box-sizing: border-box; }

  /* ── 无障碍：键盘焦点环 (WCAG 2.4.7) ── */
  :focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }
  /* 仅键盘 Tab 焦点显示环；鼠标点击不显示默认描边 */
  :focus:not(:focus-visible) { outline: none; }

  :root {
    /* ── Adventure Dark Palette ── */
    --bg: #0a0e14;
    --panel: #0d1219;
    --panel-alt: #161b22;
    --panel-bg: rgba(13,18,25,0.95);
    --border: #1c2333;
    --border-light: #21262d;
    --text: #e6edf3;
    --text-dim: #8b949e;
    --text-dimmer: #7d8590;
    --accent: #58a6ff;
    --accent-bg: #1a3a5c;
    --accent2: #f0883e;
    --route-done: #ef9f27;
    --route-plan: #484f58;
    --green: #3fb950;
    --red: #f85149;
    --red-deep: #b62324;
    --purple: #bc8cff;
    --yellow: #d29922;
    --cyan: #39d2c0;
    --current-province: rgba(88,166,255,0.20);
  }

  body {
    font-family: 'Noto Sans SC', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
  }

  .app { display: grid; grid-template-rows: 50px 1fr 26px; height: 100vh; min-height: 0; }

  /* ── LEFT NAV (icon strip) ── */
  .nav-left {
    width: 46px;
    background: var(--panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0 8px;
    z-index: 2000;
    flex-shrink: 0;
    border-radius: 0 12px 12px 0;
  }
  .nav-left .nav-logo {
    width: 34px; height: 34px;
    border-radius: 8px;
    background: var(--accent-bg);
    border: 1px solid rgba(88,166,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-bottom: 8px;
    cursor: default;
  }
  .nav-left .nav-btn {
    width: 34px; height: 34px;
    border: none; border-radius: 8px;
    background: transparent;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    position: relative;
    color: var(--text-dim);
  }
  .nav-left .nav-btn:hover { background: rgba(255,255,255,0.04); color: var(--text); }
  .nav-left .nav-btn.active { background: var(--accent-bg); color: var(--accent); border: 1px solid rgba(88,166,255,0.25); }
  .nav-left .nav-btn .badge {
    position: absolute;
    top: 3px; right: 3px;
    width: 6px; height: 6px;
    background: var(--green);
    border-radius: 50%;
    display: none;
  }
  .nav-left .nav-btn .badge.show { display: block; }
  .nav-left .nav-spacer { flex: 1; }
  .nav-left .nav-donate {
    width: 38px; height: 24px;
    border: none; border-radius: 6px;
    background: var(--red-deep);
    color: #fff;
    font-size: 9px;
    font-weight: 500;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: all 0.2s;
  }
  .nav-left .nav-donate:hover { filter: brightness(1.15); transform: scale(1.05); }

  /* ── CENTER AREA: map + info bars stacked ── */
  .center-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
  }
  .center-col {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .map-wrap {
    flex: 1;
    min-height: 0;
    position: relative;
  }
  #map { width: 100%; height: 100%; background: #080c10; }

  /* ── INFO BAR (below map: progress + today + next) ── */
  .info-bar {
    flex-shrink: 0;
    background: var(--panel);
    border-top: 1px solid var(--border);
    padding: 8px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .info-progress-row {
    display: flex;
    align-items: center;
    gap: 18px;
  }
  .info-pct {
    font-size: 30px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    white-space: nowrap;
  }
  .info-pct small { font-size: 11px; color: var(--text-dim); font-weight: 400; margin-left: 6px; }
  .info-daycount {
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
    white-space: nowrap;
  }
  .info-daycount b { color: var(--accent); }
  .info-slip {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
  }
  .info-slip.behind { background: rgba(248,81,73,0.15); color: var(--red); border: 1px solid rgba(248,81,73,0.35); }
  .info-slip.ahead { background: rgba(63,185,80,0.15); color: var(--green); border: 1px solid rgba(63,185,80,0.35); }
  .info-slip.on { background: rgba(88,166,255,0.12); color: var(--accent); border: 1px solid rgba(88,166,255,0.3); }
  .info-chips { display: flex; gap: 8px; margin-left: auto; }
  .info-chip {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 10px;
    color: var(--text-dim);
    text-align: center;
    white-space: nowrap;
  }
  .info-chip b { display: block; font-size: 13px; color: var(--text); font-weight: 600; }

  .info-today-next {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .info-sub {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 10px;
    overflow: hidden;
  }
  .info-sub .t {
    font-size: 10px;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
  }
  .info-sub .v { font-size: 12px; color: var(--text); line-height: 1.4; }
  .info-sub .v .dim { color: var(--text-dim); font-size: 11px; }
  .info-sub.rest { opacity: 0.7; }
  .info-sub.empty .v { color: var(--text-dim); font-style: italic; }

  /* ── RIGHT PANEL (narrower) ── */
  .panel-right {
    width: 0;
    background: var(--panel);
    border-left: 1px solid var(--border);
    overflow: hidden;
    transition: width 0.25s ease;
    display: flex;
    flex-direction: column;
    z-index: 1500;
    flex-shrink: 0;
    border-radius: 12px 0 0 12px;
  }
  .panel-right.open { width: 360px; }
  .panel-right .panel-header {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    white-space: nowrap;
  }
  .panel-right .panel-header h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
  }
  .panel-right .panel-close {
    width: 28px; height: 28px;
    border: none; border-radius: 6px;
    background: transparent;
    color: var(--text-dim);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .panel-right .panel-close:hover { background: rgba(255,255,255,0.08); color: var(--text); }
  .panel-right .panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px 10px;
  }
  .panel-right .panel-body::-webkit-scrollbar { width: 3px; }
  .panel-right .panel-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

  /* ── TAB TOGGLE (in right panel) ── */
  .tab-toggle {
    display: flex;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px;
    margin-bottom: 8px;
  }
  .tab-toggle .tab-btn {
    flex: 1;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-dim);
    font-size: 10px;
    font-weight: 500;
    padding: 5px 0;
    cursor: pointer;
    transition: all 0.2s;
  }
  .tab-toggle .tab-btn.active {
    background: var(--accent-bg);
    color: var(--accent);
  }

  /* ── EXPEDITION SUMMARY CARD (right panel top) ── */
  .exped-summary {
    background: var(--panel-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
  }
  .exped-summary .es-label {
    font-size: 10px;
    color: var(--text-dim);
    margin-bottom: 4px;
  }
  .exped-summary .es-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
  }
  .exped-summary .es-sub {
    font-size: 9px;
    color: var(--text-dim);
    margin-top: 2px;
  }

  /* ── ELEVATION PROFILE (inline in center stack) ── */
  .elevation-panel {
    flex-shrink: 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
  }
  .elevation-panel .elevation-header {
    padding: 6px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    color: var(--text-dim);
    flex-shrink: 0;
    white-space: nowrap;
    user-select: none;
  }
  .elevation-panel .elev-scope { display: inline-flex; gap: 2px; flex-shrink: 0; }
  .elevation-panel .elev-scope button {
    font-size: 10px; line-height: 1; padding: 3px 8px; border-radius: 10px;
    border: 1px solid var(--border); background: transparent; color: var(--text-dim); cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
  }
  .elevation-panel .elev-scope button:hover { color: var(--text); }
  .elevation-panel .elev-scope button.on {
    background: var(--accent); color: #fff; border-color: var(--accent);
  }
  .elevation-panel .elevation-body {
    height: 112px;
    padding: 0 10px 6px;
    overflow: hidden;
    flex-shrink: 0;
  }
  .elevation-panel .elevation-body svg { width: 100%; height: 100%; display: block; }

  /* ── MAP OVERLAYS ── */
  .map-overlay {
    position: absolute;
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    z-index: 1000;
    backdrop-filter: blur(10px);
  }
  .pos-badge {
    bottom: 12px; right: 12px;
    padding: 8px 12px;
    font-size: 11px;
    border-radius: 6px;
  }
  .pos-badge .prov-name { font-weight: 600; color: var(--accent); }
  .pos-badge .prov-elev { color: var(--text-dim); font-size: 11px; margin-left: 6px; }

  /* ── COMPASS / NORTH INDICATOR (small SVG rose, top-right, clear of zoom) ── */
  .map-compass {
    top: 12px; right: 12px;
    width: 30px; height: 30px;
    padding: 0; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(13,18,25,0.45);
  }
  .map-compass svg { display: block; }
  /* ── LEGEND (top-left, clear of compass) ── */
  .map-legend {
    top: 12px; left: 12px;
    padding: 8px 10px;
    font-size: 11px;
    line-height: 1.4;
    border-radius: 6px;
    background: rgba(13,18,25,0.55);
    pointer-events: none;
  }
  .map-legend .lg-row { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
  .map-legend .lg-sw { width: 16px; height: 4px; border-radius: 2px; flex-shrink: 0; }
  /* 预设轨迹图例：深蓝单条稀疏虚线（低密度，与地图计划线 #1e4f8f / dashArray '4,14' 一致） */
  .map-legend .lg-plan {
    width: 24px; height: 3px; border: none;
    background: repeating-linear-gradient(90deg, #1e4f8f 0 4px, transparent 4px 18px);
  }
  .map-legend .lg-cyan { background: #3fb950; }
  @media (max-width: 640px) {
    .map-legend { width: 160px; top: 8px; left: 8px; }
    .map-compass { top: 8px; right: 8px; }
  }

  /* ── 13-REGION TERRITORY OVERLAYS (prototype style) ── */
  .region-info {
    top: 50px; right: 12px;
    padding: 12px 14px;
    font-size: 12px;
    max-width: 260px;
    line-height: 1.45;
  }
  .region-info .ri-name { font-size: 14px; font-weight: 600; color: var(--text); }
  .region-info .ri-name span { font-weight: 400; color: var(--text-dim); font-size: 12px; }
  .region-info .ri-park { color: #85B7EB; margin-top: 6px; font-weight: 500; }
  .region-info .ri-meta { color: var(--text-dim); margin-top: 4px; }
  .region-info .ri-dlist { color: var(--text-dim); margin-top: 6px; font-size: 11px; max-height: 64px; overflow-y: auto; }

  .region-num {
    width: 26px; height: 26px; border-radius: 50%;
    background: #fff; border: 2.5px solid #000;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  }

  /* ── PROGRESS BAR (below map, hero level) ── */
  .progress-hero {
    padding: 10px 16px;
    background: var(--panel-alt);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
  }
  .progress-hero .ph-pct {
    font-size: 26px;
    font-weight: 500;
    color: var(--accent);
    line-height: 1;
    min-width: 64px;
  }
  .progress-hero .ph-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }
  .progress-hero .ph-day {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
  }
  .progress-hero .ph-slip {
    font-size: 10px;
    color: var(--text-dim);
  }
  .progress-hero .ph-chips {
    display: flex;
    gap: 6px;
    margin-left: auto;
  }
  .progress-hero .chip-stat {
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 5px 10px;
    text-align: center;
    min-width: 58px;
  }
  .progress-hero .chip-stat .cs-val {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
  }
  .progress-hero .chip-stat .cs-lbl {
    font-size: 8px;
    color: var(--text-dimmer);
    margin-top: 1px;
  }
  .progress-hero .ph-bar-wrap {
    position: absolute;
    bottom: 0; left: 16px; right: 16px;
    height: 3px;
  }
  .progress-hero .ph-bar {
    height: 100%;
    border-radius: 2px;
    background: var(--accent);
    transition: width 0.5s ease;
  }
  .progress-hero .ph-bar-bg {
    height: 100%;
    border-radius: 2px;
    background: var(--border-light);
  }

  /* ── TODAY + NEXT STAGE strips ── */
  .info-strips {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    flex-shrink: 0;
  }
  .info-strip {
    flex: 1;
    background: var(--panel-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-width: 0;
  }
  .info-strip .is-label {
    font-size: 11px;
    font-weight: 500;
    flex-shrink: 0;
  }
  .info-strip .is-label.is-today { color: var(--accent); }
  .info-strip .is-label.is-next { color: var(--green); }
  .info-strip .is-main {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .info-strip .is-sub {
    font-size: 10px;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* ── PROGRESS DASHBOARD (legacy, kept for right panel) ── */
  .dashboard-hero {
    text-align: center;
    padding: 10px 0 16px;
  }
  .dashboard-hero .big-pct {
    font-size: 52px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), var(--green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
  }
  .dashboard-hero .pct-sub {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 2px;
  }

  .stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 12px 0;
  }
  .stat-card {
    padding: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-align: center;
  }
  .stat-card .label { font-size: 10px; color: var(--text-dim); margin-bottom: 4px; }
  .stat-card .value { font-size: 18px; font-weight: 600; }
  .stat-card .unit { font-size: 10px; font-weight: 400; color: var(--text-dim); }

  .section-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
  }
  .section-item:hover { border-color: var(--accent); }
  .section-item.active { border-color: var(--accent); background: rgba(88,166,255,0.06); }
  .section-item.completed { border-color: rgba(63,185,80,0.3); }
  .section-indicator {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
  }
  .section-indicator.done { background: var(--green); }
  .section-indicator.current { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
  .section-indicator.upcoming { background: var(--border); }
  .section-info .name { font-weight: 500; margin-bottom: 2px; }
  .section-info .detail { font-size: 10px; color: var(--text-dim); }

  .progress-bar-outer {
    height: 6px; background: var(--border);
    border-radius: 3px; overflow: hidden;
    margin: 8px 0;
  }
  .progress-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, var(--green), var(--accent));
    transition: width 0.5s;
  }

  .btn { 
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    padding: 8px 16px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
  }
  .btn:hover { border-color: var(--accent); }
  .btn.primary { background: rgba(88,166,255,0.12); border-color: rgba(88,166,255,0.3); }
  .btn.primary:hover { background: rgba(88,166,255,0.2); }

  .btn-reset {
    font-size: 10px; padding: 3px 8px;
    background: transparent;
    border: 1px solid rgba(248,81,73,0.3);
    color: var(--text-dim);
    border-radius: 4px;
    cursor: pointer;
    display: none;
    margin-top: 6px;
  }
  .btn-reset.visible { display: inline-block; }
  .btn-reset:hover { background: rgba(248,81,73,0.15); color: var(--red); }

  /* ── MODAL (数据管理 / password-gated) ── */
  .modal-overlay {
    position: fixed; inset: 0; z-index: 1200;
    background: rgba(0,0,0,0.62);
    display: none; align-items: center; justify-content: center;
    padding: 16px;
  }
  .modal-overlay.open { display: flex; }
  .modal {
    width: 100%; max-width: 420px;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 12px; box-shadow: 0 24px 64px rgba(0,0,0,0.55);
    overflow: hidden;
  }
  .modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid var(--border);
    font-weight: 600; color: var(--text); font-size: 14px;
  }
  .modal-close {
    background: transparent; border: none; color: var(--text-dim);
    cursor: pointer; font-size: 14px; line-height: 1; padding: 4px;
  }
  .modal-close:hover { color: var(--text); }
  .modal-body { padding: 16px; }
  .pwd-gate { display: flex; flex-direction: column; gap: 10px; }
  .pwd-hint { font-size: 13px; color: var(--text-dim); margin: 0; line-height: 1.5; }
  .form-input {
    width: 100%; padding: 9px 12px; font-size: 14px;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text); font-family: inherit;
  }
  .form-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(88,166,255,0.15); }
  .pwd-err { font-size: 12px; color: var(--red); }

  /* ── ITINERARY ── */
  .itinerary-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
  }
  .itinerary-header .it-stat {
    padding: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-align: center;
  }
  .itinerary-header .it-stat .val {
    font-size: 20px;
    font-weight: 700;
  }
  .itinerary-header .it-stat .val.green { color: var(--green); }
  .itinerary-header .it-stat .val.yellow { color: var(--yellow); }
  .itinerary-header .it-stat .val.blue { color: var(--accent); }
  .itinerary-header .it-stat .lbl { font-size: 10px; color: var(--text-dim); margin-top: 2px; }

  .itinerary-day {
    padding: 8px 10px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 11px;
    transition: all 0.2s;
  }
  .itinerary-day:hover { border-color: var(--accent); }
  .itinerary-day.today { border-color: var(--accent); background: rgba(88,166,255,0.06); }
  .itinerary-day.ahead { border-left: 3px solid var(--green); }
  .itinerary-day.behind { border-left: 3px solid var(--red); }
  .itinerary-day.on-track { border-left: 3px solid var(--accent); }

  .itinerary-day .day-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
  }
  .itinerary-day .day-num {
    font-weight: 700;
    font-size: 13px;
  }
  .itinerary-day .day-route {
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 4px;
  }
  .itinerary-day .day-route .arrow { color: var(--accent); margin: 0 4px; }
  .itinerary-day .day-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }
  .itinerary-day .day-stats .stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
  }
  .itinerary-day .day-stats .stat-row .plan { color: var(--text-dim); }
  .itinerary-day .day-stats .stat-row .actual-wrap { display: flex; align-items: center; gap: 4px; }
  .itinerary-day .day-stats .stat-row .actual { color: var(--green); font-weight: 500; }
  .itinerary-day .day-stats .stat-row .delta-green { color: var(--green); font-size: 9px; }
  .itinerary-day .day-stats .stat-row .delta-red { color: var(--red); font-size: 9px; }
  .itinerary-day .day-stats .stat-row .delta-gray { color: var(--text-dim); font-size: 9px; }

  .itinerary-day .no-data {
    font-size: 10px;
    color: var(--text-dim);
    font-style: italic;
    margin-top: 4px;
  }

  /* —— 计划 vs 实际 双栏对照（紧凑版）—— */
  .itinerary-day .cols {
    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    margin-top: 4px;
    gap: 4px;
  }
  .itinerary-day .col { padding: 5px 6px; border-radius: 3px; }
  .itinerary-day .col.col-plan { background: rgba(88,166,255,0.05); border: 1px solid rgba(88,166,255,0.12); }
  .itinerary-day .col.col-actual { background: rgba(63,185,80,0.05); border: 1px solid rgba(63,185,80,0.12); }
  .itinerary-day .divider { background: var(--border); }
  .itinerary-day .col-title { font-size: 9px; font-weight: 700; letter-spacing: .3px; margin-bottom: 3px; }
  .itinerary-day .col-title.plan-t { color: var(--accent); }
  .itinerary-day .col-title.act-t { color: var(--green); }
  .itinerary-day .col .stat-row { display: flex; justify-content: space-between; padding: 1px 0; font-size: 9px; }
  .itinerary-day .col .stat-row .plan { color: var(--text-dim); min-width: 36px; display: inline-block; }
  .itinerary-day .col .stat-row .actual { color: var(--green); font-weight: 500; }
  .itinerary-day .col .route { font-size: 9px; color: var(--text-dim); line-height: 1.3; }
  .itinerary-day .warn {
    background: rgba(248,81,73,0.08); border: 1px solid rgba(248,81,73,0.25); color: var(--red);
    padding: 3px 5px; border-radius: 4px; font-size: 8px; margin-top: 4px; line-height: 1.3;
  }
  .chip { font-size: 10px; padding: 1px 6px; border-radius: 4px; margin-left: 5px; vertical-align: middle; }
  .chip.rest { background: rgba(63,185,80,.2); color: var(--green); }
  .chip.delay { background: rgba(255,169,77,.2); color: #FFA94D; }
  .chip.today { background: var(--accent); color: #fff; }
  .chip.ahead { background: rgba(63,185,80,.18); color: var(--green); }
  .chip.behind { background: rgba(248,81,73,.18); color: var(--red); }
  .chip.ontime { background: rgba(88,166,255,.18); color: var(--accent); }

  .btn-edit-day {
    opacity: 0;
    transition: opacity 0.15s;
  }
  .itinerary-day:hover .btn-edit-day { opacity: 1; }
  .btn-edit-day:hover { color: var(--accent) !important; }
  .delay-pick { display: inline-flex; gap: 3px; vertical-align: middle; }
  .dp-btn { opacity: 1 !important; }

  .itineray-edit-form {
    padding: 10px;
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: 8px;
    margin-bottom: 10px;
  }
  .itineray-edit-form input, .itineray-edit-form select {
    width: 100%;
    background: var(--panel);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 8px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 12px;
    margin-bottom: 6px;
  }
  .itineray-edit-form input:focus { border-color: var(--accent); }
  .itineray-edit-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .schedule-summary {
    padding: 10px;
    background: rgba(63,185,80,0.08);
    border: 1px solid rgba(63,185,80,0.2);
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 12px;
  }
  .schedule-summary .summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
  }
  .schedule-summary .summary-row:last-child { margin-bottom: 0; }

  .log-entry {
    padding: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 13px;
  }
  .log-entry .date { font-size: 11px; color: var(--text-dim); margin-bottom: 6px; font-weight: 500; }
  .log-entry .text { font-size: 13px; margin-top: 4px; line-height: 1.5; }
  .log-entry .gpx-badge {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(63,185,80,0.15);
    color: var(--green);
    border-radius: 4px;
    font-size: 11px;
    margin-bottom: 4px;
  }
  .log-entry .daily-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 8px;
  }
  .log-entry .daily-stats .stat-item {
    text-align: center;
    font-size: 10px;
    color: var(--text-dim);
  }
  .log-entry .daily-stats .stat-item .val {
    display: block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
  }
  .log-entry .daily-stats .stat-item .val.green { color: var(--green); }
  .log-entry .daily-stats .stat-item .val.orange { color: var(--accent2); }
  .log-entry .daily-stats .stat-item .val.white { color: var(--text); }


  .donate-section { text-align: center; padding: 20px 0; }
  .donate-section .qr-box {
    width: 160px; height: 160px;
    margin: 16px auto;
    background: #fff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #333;
  }

  .loading-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
  }
  .loading-overlay.active { display: flex; }
  .loading-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px 32px;
    text-align: center;
    color: var(--text);
  }
  .loading-card .spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
  }
  @keyframes spin { to { transform: rotate(360deg); } }
  @keyframes location-pulse {
    0%   { transform: translate(-50%, -50%) scale(0.4); opacity: 0.6; }
    100% { transform: translate(-50%, -50%) scale(2.2); opacity: 0; }
  }
  @keyframes location-pulse2 {
    0%   { transform: translate(-50%, -50%) scale(0.4); opacity: 0.4; }
    100% { transform: translate(-50%, -50%) scale(2.8); opacity: 0; }
  }

  @media (max-width: 768px) {
    .nav-left { width: 44px; }
    .nav-left .nav-btn { width: 34px; height: 34px; font-size: 16px; }
    .panel-right.open { width: 280px; }
    .elevation-panel.open { height: 120px; }
    .pos-badge { bottom: 140px; }
  }

  .basemap-switcher {
    background: var(--panel-bg);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    display: flex; flex-direction: column;
    overflow: hidden;
    margin-top: 8px;
  }
  .basemap-btn {
    width: 34px; height: 34px;
    background: transparent;
    border: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; cursor: pointer;
    color: var(--text-dim);
    user-select: none;
    transition: all 0.15s;
  }
  .basemap-btn + .basemap-btn { border-top: 1px solid rgba(255,255,255,0.1); }
  .basemap-btn:hover { background: rgba(88,166,255,0.1); color: var(--text); }
  .basemap-btn.active { background: rgba(88,166,255,0.15); color: var(--accent); }

  /* Fit-to-route button (between zoom and basemap, bottom-left) */
  .fitview-control { margin-top: 8px; }
  .fitview-btn {
    width: 34px; height: 34px;
    background: var(--panel-bg);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; cursor: pointer; color: var(--text);
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    transition: all 0.15s;
  }
  .fitview-btn:hover { background: rgba(88,166,255,0.2); color: #fff; }

  .region-tooltip {
    background: var(--panel-bg);
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--text);
    font-size: 11px;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    white-space: nowrap;
  }

  .leaflet-control-attribution {
    background: rgba(13,18,25,0.82) !important;
    color: var(--text-dim) !important;
    font-size: 10px !important;
    padding: 2px 6px !important;
    border-radius: 4px 0 0 0 !important;
    backdrop-filter: blur(4px);
  }
  .leaflet-control-attribution a { color: var(--accent) !important; }

  .leaflet-control-scale-line { background: var(--panel-bg) !important; border-color: rgba(255,255,255,0.15) !important; color: var(--text-dim) !important; }
  .leaflet-control-zoom { border: none !important; }
  .leaflet-control-zoom a { background: var(--panel-bg) !important; color: var(--text) !important; border: 1px solid rgba(255,255,255,0.15) !important; font-size: 18px !important; }
  .leaflet-control-zoom a:hover { background: rgba(88,166,255,0.2) !important; color: #fff !important; }
  .leaflet-control-zoom a:first-child { border-radius: 6px 6px 0 0 !important; }
  .leaflet-control-zoom a:last-child { border-radius: 0 0 6px 6px !important; border-top: none !important; }

  /* Waypoint tooltip — dark card, compact */
  .wpt-tooltip {
    background: rgba(22,27,34,0.92) !important;
    border: 1px solid rgba(255,255,255,0.12) !important;
    border-radius: 8px !important;
    color: #e6edf3 !important;
    padding: 6px 10px !important;
    font-size: 12px !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5) !important;
    white-space: nowrap !important;
  }
  .wpt-tooltip::before {
    border-top-color: rgba(22,27,34,0.92) !important;
  }

  /* ── 路段探索器（方案 C）── */
  .sec-card { background: var(--bg); border-left: 3px solid #888; border-radius: 0 10px 10px 0;
    margin-bottom: 12px; overflow: hidden; cursor: pointer; transition: transform .15s, box-shadow .15s; }
  .sec-card:hover { transform: translateX(2px); }
  .sec-card.active { box-shadow: 0 0 0 1px var(--accent), 0 6px 18px rgba(88,166,255,.18); }
  .sec-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 10px; }
  .sec-title { font-weight: 600; font-size: 13px; flex: 1; }
  .sec-title small { display: block; font-weight: 400; font-size: 11px; color: var(--text-dim); }
  .sec-meta { font-size: 11px; color: var(--text-dim); text-align: right; line-height: 1.6; }
  .sec-bar { height: 4px; background: rgba(255,255,255,.08); margin: 0 14px 10px; border-radius: 2px; overflow: hidden; }
  .sec-bar > i { display: block; height: 100%; }
  .sec-detail { max-height: 0; overflow: hidden; transition: max-height .35s ease; padding: 0 14px; }
  .sec-card.active .sec-detail { max-height: 560px; padding-bottom: 14px; }
  .elev-box { background: rgba(255,255,255,.03); border-radius: 8px; padding: 8px; margin-bottom: 10px; }
  .elev-box .cap { font-size: 10px; color: var(--text-dim); margin-bottom: 4px; }
  .wp-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 12px;
    border-top: 1px solid var(--border); }
  .wp-ico { width: 18px; text-align: center; }
  .wp-name { flex: 1; }
  .wp-elev { color: var(--text-dim); font-size: 11px; }
  .tag { font-size: 10px; padding: 1px 6px; border-radius: 6px; margin-left: 6px; }
  .tag.pass { background: rgba(248,81,73,.15); color: var(--red); }
  .tag.camp { background: rgba(63,185,80,.15); color: var(--green); }
  .sec-hint { font-size: 10px; color: var(--text-dim); padding: 4px 14px 12px; text-align: center; }

  /* ════════════════════════════════════════════════════
     NO TWO DASHBOARD LAYOUT
     ════════════════════════════════════════════════════ */
  /* ── TOP NAV ── */
  .topnav {
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 16px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    z-index: 2000;
  }
  .topnav .brand { display: flex; align-items: baseline; gap: 8px; font-weight: 800; font-size: 15px; color: var(--text); white-space: nowrap; }
  .topnav .brand .brand-logo { width: 22px; height: 22px; flex: none; align-self: center; margin-right: 4px; filter: drop-shadow(0 1px 4px rgba(31,111,235,0.4)); }
  .topnav .brand .sub { font-size: 9px; font-weight: 500; color: var(--text-dim); letter-spacing: 0.4px; }
  .topnav-tabs { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
  .tn-tab {
    padding: 6px 13px; border-radius: 6px; cursor: pointer; white-space: nowrap;
    font-size: 12px; color: var(--text-dim); background: transparent; border: none;
    transition: all 0.15s; font-family: inherit;
  }
  .tn-tab:hover { color: var(--text); background: rgba(255,255,255,0.05); }
  .tn-tab.active { color: var(--accent); background: var(--accent-bg); }
  .tn-ext {
    display: inline-flex; align-items: center; margin-left: 4px;
    padding: 6px 13px; border-radius: 6px; cursor: pointer; white-space: nowrap;
    font-size: 12px; font-family: inherit; text-decoration: none;
    color: var(--accent); background: transparent; border: 1px solid rgba(88,166,255,0.25);
    transition: all 0.15s;
  }
  .tn-ext:hover { color: #fff; background: var(--accent); }
  .topnav-right { display: flex; align-items: center; gap: 12px; }
  .top-btn {
    background: var(--bg); border: 1px solid var(--border); color: var(--text-dim);
    border-radius: 8px; padding: 7px 13px; font-size: 12px; cursor: pointer; font-family: inherit;
  }
  .top-btn:hover { color: var(--text); border-color: var(--accent); }
  .lang-btn {
    background: rgba(255,255,255,.04); border: 1px solid var(--border-light); color: var(--text);
    border-radius: 8px; padding: 7px 13px; font-size: 12px; cursor: pointer; font-family: inherit;
  }
  .lang-btn:hover { color: #fff; border-color: var(--accent); background: rgba(88,166,255,.08); }

  /* ── DASH GRID ── */
  .dash-grid {
    grid-row: 2;
    display: grid;
    grid-template-columns: 250px 1fr 274px;
    min-height: 0;
    overflow: hidden;
  }
  .col-left, .col-right {
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg);
  }
  .col-left { border-right: 1px solid var(--border); }
  .col-right { border-left: 1px solid var(--border); }
  .col-left::-webkit-scrollbar, .col-right::-webkit-scrollbar { width: 4px; }
  .col-left::-webkit-scrollbar-thumb, .col-right::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

  .col-center { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
  .col-center .map-wrap { flex: 1; min-height: 0; position: relative; }
  .col-center .elevation-panel { height: 168px; flex-shrink: 0; }
  .col-center .elevation-panel .elevation-body { flex: 1; min-height: 0; padding: 0 10px 8px; }
  .col-center .elevation-panel .elevation-body svg { width: 100%; height: 100%; display: block; }

  /* ── CARDS ── */
  .card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
  .card-h {
    padding: 8px 12px; font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
    color: var(--text-dim); text-transform: uppercase;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
  }
  /* English subtitle: hidden on the Chinese page; shown as the title only in EN mode */
  .card-h .en { display: none; }
  html[lang="en"] .card-h > span:first-child { display: none; }
  html[lang="en"] .card-h .en { display: inline; font-size: 11px; color: var(--text); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
  .card-b { padding: 12px; }

  /* progress card */
  .pc-pct { font-size: 38px; font-weight: 800; color: var(--accent); line-height: 1; }
  .pc-pct small { font-size: 14px; color: var(--text-dim); font-weight: 500; }
  .pc-day { font-size: 12px; color: var(--text); margin: 6px 0 10px; }
  .pc-day b { color: var(--accent); }
  .pc-bar { height: 6px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; }
  .pc-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--green)); }
  .pc-stats { display: flex; gap: 6px; margin-top: 12px; }
  .pc-stat { flex: 1; text-align: center; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 6px 2px; }
  .pc-stat .v { font-size: 13px; font-weight: 700; color: var(--text); }
  .pc-stat .l { font-size: 9px; color: var(--text-dim); margin-top: 2px; }

  /* status list */
  .st-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 12px; border-top: 1px solid var(--border); }
  .st-row:first-child { border-top: none; }
  .st-ico { width: 18px; text-align: center; }
  .st-k { color: var(--text-dim); }
  .st-v { margin-left: auto; text-align: right; color: var(--text); font-weight: 500; }
  .st-v small { display: block; color: var(--text-dim); font-weight: 400; font-size: 10px; }

  /* today 3x2 grid */
  .tg { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .tg-cell { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 7px 4px; text-align: center; }
  .tg-cell .v { font-size: 13px; font-weight: 700; color: var(--text); }
  .tg-cell .l { font-size: 9px; color: var(--text-dim); margin-top: 2px; }

  /* safety 3 cells */
  /* weather/safety card styles removed with the module (cardSafety) */

  /* exped info */
  .ei-meta { display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; font-size: 11px; }
  .ei-meta .k { color: var(--text-dim); }
  .ei-meta .v { color: var(--text); text-align: right; font-weight: 500; }

  /* passes list */
  .pass-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--border); font-size: 12px; }
  .pass-row:first-child { border-top: none; }
  .pass-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--accent); }
  .pass-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pass-elev { color: var(--text-dim); font-size: 11px; }
  .pass-days { font-size: 10px; padding: 1px 6px; border-radius: 10px; background: rgba(63,185,80,0.15); color: var(--green); white-space: nowrap; }
  .pass-days.far { background: rgba(139,148,158,0.15); color: var(--text-dim); }
  .more-link { display: block; text-align: center; font-size: 11px; color: var(--accent); padding: 8px 0 2px; cursor: pointer; }
  .pass-summary { display: flex; align-items: center; gap: 10px; padding: 2px 0 10px; }
  .pass-summary-num { font-size: 12px; font-weight: 700; color: var(--text); white-space: nowrap; }
  .pass-summary-bar { flex: 1; height: 5px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; }
  .pass-summary-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--accent)); transition: width .4s ease; }
  /* 垭口清单：桌面端随右栏剩余高度填充(占满整列、尽量一屏)，超出才滚动；小屏用 max-height 兜底 */
  #cardPasses { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
  .pass-list { flex: 1 1 auto; min-height: 140px; overflow-y: auto; }
  #cardPasses .card-b { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  .pass-check { width: 15px; height: 15px; border-radius: 50%; flex-shrink: 0; background: var(--green); color: #0a0e14; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
  .pass-row.done { opacity: .5; }
  .pass-row.done .pass-name { text-decoration: line-through; text-decoration-color: rgba(255,255,255,.35); }

  /* upload card */
  .upload-zone { text-align: center; }
  .upload-zone input[type=file] { display: none; }
  .upload-hint { font-size: 10px; color: var(--text-dim); margin-top: 6px; line-height: 1.5; }
  .date-row { font-size: 11px; color: var(--text-dim); margin-top: 10px; text-align: left; padding-top: 10px; border-top: 1px dashed var(--border); }
  .date-row input { background: var(--bg); border: 1px solid var(--border); color: var(--text); padding: 3px 6px; border-radius: 5px; font-family: inherit; font-size: 11px; margin-left: 4px; }

  /* ── BOTTOM STATUS BAR ── */
  .statusbar {
    grid-row: 3; display: flex; align-items: center; gap: 18px;
    padding: 0 14px; background: var(--panel); border-top: 1px solid var(--border);
    font-size: 10px; color: var(--text-dim); white-space: nowrap; overflow: hidden;
  }
  .statusbar .live-dot { color: var(--green); display: flex; align-items: center; gap: 4px; }
  .statusbar .live-dot.offline { color: var(--text-dim); }
  .statusbar .spacer { flex: 1; }

  /* legend → top-left; compass → top-right (zoom/basemap moved to bottom-left) */
  .map-legend { top: 12px; left: 12px; right: auto; }
  .map-compass { top: 12px; right: 12px; }

  @media (max-width: 920px) {
    .dash-grid { grid-template-columns: 1fr; grid-auto-rows: min-content; overflow-y: auto; }
    .col-left, .col-right { border: none; border-bottom: 1px solid var(--border); }
    .col-right .pass-list { max-height: 60vh; }
    .col-center { min-height: 62vh; }
    .topnav .brand .sub { display: none; }
  }
