:root {
  --paper: #f2efe7;
  --paper-deep: #e9e3d7;
  --ink: #162b32;
  --muted: #5c6e70;
  --sea: #c9dce0;
  --land: #d9cead;
  --line: #b9c7c5;
  --gold: #b9822b;
  --panel: rgba(250, 248, 242, .94);
  --shadow: 0 14px 38px rgba(28, 48, 52, .11);
  --radius: 6px;
  --topbar-h: 72px;
  --deck-h: 116px;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; }
body {
  color: var(--ink);
  background: var(--paper);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 18px;
  overflow: hidden;
}
button { color: inherit; font: inherit; letter-spacing: 0; }
button, [role="button"] { cursor: pointer; }
button:focus-visible, [tabindex]:focus-visible { outline: 3px solid #0e6b83; outline-offset: 3px; }
.is-hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.app-shell {
  min-height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: var(--topbar-h) minmax(0, 1fr) var(--deck-h);
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(96, 82, 52, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 82, 52, .025) 1px, transparent 1px);
  background-size: 32px 32px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 8px 20px;
  border-bottom: 1px solid rgba(80, 102, 103, .28);
  background: rgba(246, 243, 235, .96);
  z-index: 20;
}
.title-block, .top-actions { display: flex; align-items: center; }
.title-block { gap: 14px; min-width: 0; }
.unit-mark {
  display: grid; place-items: center; width: 48px; height: 48px;
  border: 1px solid var(--gold); color: var(--gold); font-family: "Noto Serif SC", "Songti SC", serif;
  font-weight: 700; font-size: 14px;
}
.eyebrow { margin: 0 0 2px; color: var(--gold); font-size: 12px; font-weight: 700; letter-spacing: .12em; }
h1, h2, strong { letter-spacing: 0; }
h1 { margin: 0; font-family: "Noto Serif SC", "Songti SC", serif; font-size: 24px; line-height: 1.15; }
h1 span { margin-left: 8px; color: var(--muted); font-family: inherit; font-size: 17px; font-weight: 500; }
.top-actions { gap: 8px; }
.mode-switch { display: inline-flex; padding: 3px; border: 1px solid var(--line); background: #e7e4dc; border-radius: var(--radius); }
.mode-button { min-height: 38px; min-width: 62px; padding: 0 14px; border: 0; border-radius: 4px; background: transparent; font-size: 14px; font-weight: 700; }
.mode-button.is-active { color: white; background: var(--ink); }
.icon-button {
  position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; min-height: 44px;
  padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.6);
}
.icon-button svg { width: 21px; height: 21px; }
.icon-button:hover { color: #0f5f71; border-color: #6e9aa0; background: white; }
[data-tooltip]::after {
  content: attr(data-tooltip); position: absolute; right: 0; top: calc(100% + 7px); z-index: 30; padding: 5px 8px;
  color: white; background: var(--ink); border-radius: 3px; font-size: 12px; white-space: nowrap; opacity: 0; pointer-events: none; transform: translateY(-2px);
}
[data-tooltip]:hover::after, [data-tooltip]:focus-visible::after { opacity: 1; transform: translateY(0); }

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: 260px minmax(440px, 1fr) 304px;
  gap: 0;
}
.voyager-nav, .info-panel { min-height: 0; overflow: auto; background: var(--panel); }
.voyager-nav { padding: 16px 14px; border-right: 1px solid var(--line); }
.rail-heading { display: flex; align-items: baseline; justify-content: space-between; margin: 0 2px 12px; }
.rail-heading span { color: var(--gold); font-size: 12px; font-weight: 700; }
.rail-heading strong { font-size: 15px; }
.voyager-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 6px;
  align-items: stretch;
  margin: 0 0 9px;
}
.voyager-card, .compare-button {
  width: 100%; min-height: 92px; display: grid; grid-template-columns: 62px minmax(0,1fr) 22px; align-items: center;
  gap: 10px; padding: 8px; margin: 0 0 9px; text-align: left; border: 1px solid transparent; border-radius: var(--radius);
  background: rgba(255,255,255,.43); transition: border-color .2s, background .2s, transform .2s;
}
.voyager-row .voyager-card { margin: 0; }
.voyager-card:hover { background: white; transform: translateX(2px); }
.voyager-card.is-active { border-color: var(--route-color, var(--gold)); background: white; box-shadow: 0 6px 18px rgba(31,48,52,.08); }
.route-instant {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 36px;
  min-width: 36px;
  min-height: 44px;
  align-self: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255,255,255,.72);
  transition: color .2s, border-color .2s, background .2s, box-shadow .2s;
}
.route-instant svg { width: 18px; height: 18px; }
.route-instant:hover { color: #0f5f71; border-color: #6e9aa0; background: white; }
.voyager-row.is-preview .route-instant,
.route-instant.is-active {
  color: white;
  border-color: var(--ink);
  background: var(--ink);
  box-shadow: 0 4px 12px rgba(31,48,52,.14);
}
.route-instant[data-tooltip]::after { right: auto; left: 50%; transform: translate(-50%, -2px); }
.route-instant[data-tooltip]:hover::after,
.route-instant[data-tooltip]:focus-visible::after { transform: translate(-50%, 0); }
.portrait-frame {
  position: relative; width: 58px; aspect-ratio: 4/5; overflow: hidden; border: 1px solid rgba(33,52,56,.24); background: #d8d0bc;
}
.portrait-frame::after { content: ""; position: absolute; inset: 4px; border: 1px solid transparent; transition: border-color .25s; }
.voyager-card.is-active .portrait-frame::after { border-color: var(--route-color); }
.portrait-frame img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 18%; filter: saturate(.82) contrast(1.03); transform: scale(1); transition: transform .36s cubic-bezier(.2,.8,.2,1), filter .3s; }
.voyager-card.is-active img { transform: scale(1.035); filter: saturate(1) contrast(1.06); animation: portrait-drift 7s ease-in-out infinite alternate; }
@keyframes portrait-drift { to { transform: scale(1.055) translateY(-1%); } }
.voyager-copy { min-width: 0; }
.voyager-copy strong, .voyager-copy small { display: block; }
.voyager-copy strong { margin-bottom: 7px; font-family: "Noto Serif SC", "Songti SC", serif; font-size: 18px; line-height: 1.25; white-space: nowrap; }
.voyager-copy small { color: var(--muted); font-size: 12px; line-height: 1.25; white-space: normal; word-break: keep-all; overflow-wrap: normal; }
kbd { display: inline-grid; place-items: center; min-width: 21px; height: 21px; padding: 0 5px; border: 1px solid #a7b3b2; border-bottom-width: 2px; border-radius: 3px; color: var(--muted); background: #f7f5ef; font: 11px/1 monospace; }
.compare-button { grid-template-columns: 40px minmax(0,1fr) 22px; min-height: 70px; border-color: #b9a67d; background: #eee5d2; }
.compare-button svg { width: 26px; height: 26px; color: var(--gold); }
.compare-button strong, .compare-button small { display: block; }
.compare-button strong { margin-bottom: 4px; font-size: 16px; }
.compare-button small { color: var(--muted); font-size: 11px; }
.compare-button.is-active { color: white; border-color: var(--ink); background: var(--ink); }
.compare-button.is-active svg, .compare-button.is-active small { color: #e8c77f; }

.map-stage { min-width: 0; min-height: 0; display: grid; grid-template-rows: 42px minmax(0,1fr) 28px; background: var(--sea); }
.map-toolbar, .map-caption { display: flex; align-items: center; justify-content: space-between; min-width: 0; padding: 0 16px; background: rgba(242,239,231,.86); }
.map-toolbar { border-bottom: 1px solid rgba(76,100,104,.2); }
.stage-instruction { min-width: 0; margin: 0; display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 13px; font-weight: 700; }
.status-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(185,130,43,.12); }
.map-legend { display: flex; align-items: center; gap: 13px; }
.map-legend span { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.map-legend span::before { content: ""; width: 24px; height: 2px; background: var(--legend); }
.map-legend .dash-long::before { background: repeating-linear-gradient(90deg,var(--legend) 0 9px,transparent 9px 14px); }
.map-legend .dash-dot::before { background: repeating-linear-gradient(90deg,var(--legend) 0 7px,transparent 7px 10px,var(--legend) 10px 12px,transparent 12px 16px); }
.map-legend .dash-short::before { background: repeating-linear-gradient(90deg,var(--legend) 0 4px,transparent 4px 8px); }
.map-canvas { position: relative; min-height: 0; overflow: hidden; background: #c9dce0; }
#routeMap { width: 100%; height: 100%; display: block; }
.ocean-labels text { fill: #4f737a; fill-opacity: .52; font-family: "Noto Serif SC", "Songti SC", serif; font-size: 16px; font-weight: 700; text-anchor: middle; }
.route-underlay { fill: none; stroke: rgba(242,239,231,.88); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.route-path { fill: none; stroke-width: 3.8; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 1px rgba(20,40,44,.22)); }
.route-group.is-muted { opacity: .42; }
.route-label { font-family: "Noto Sans SC", sans-serif; font-size: 12px; font-weight: 800; paint-order: stroke; stroke: #f4f0e5; stroke-width: 4px; stroke-linejoin: round; }
.route-node circle { fill: var(--paper); stroke-width: 3; transition: r .2s; }
.route-node.is-start circle { fill: var(--ink); stroke: var(--paper); stroke-width: 2; }
.route-node.is-end circle { fill: var(--gold); stroke: var(--paper); stroke-width: 2; }
.route-node text { fill: var(--ink); font-size: 12px; font-weight: 800; paint-order: stroke; stroke: var(--paper); stroke-width: 4px; }
.route-node text.is-compare-label { font-size: 10px; font-weight: 700; stroke-width: 3.5px; }
.route-node.is-future { opacity: .16; }
.route-node.is-current circle { animation: node-pulse 1.1s ease-out infinite; }
@keyframes node-pulse { 0% { r: 5; stroke-opacity: 1; } 100% { r: 12; stroke-opacity: 0; } }
.ship-marker { color: var(--ink); transition: opacity .15s; }
.ship-marker circle { fill: #f7f2e6; stroke: currentColor; stroke-width: 2; filter: drop-shadow(0 3px 4px rgba(20,36,40,.25)); }
.checkpoint-card { position: absolute; left: 50%; bottom: 18px; width: min(430px, calc(100% - 30px)); padding: 12px 15px; transform: translateX(-50%); border-left: 4px solid var(--gold); border-radius: var(--radius); background: rgba(250,248,241,.96); box-shadow: var(--shadow); }
.checkpoint-card span { color: var(--gold); font-size: 11px; font-weight: 800; }
.checkpoint-card strong { display: block; margin: 3px 0; font-family: "Noto Serif SC", serif; font-size: 17px; }
.checkpoint-card p { margin: 0; color: var(--muted); font-size: 13px; }
.empty-prompt { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; pointer-events: none; }
.empty-prompt p { margin: 12px 0 3px; color: #47656a; font: 700 18px "Noto Serif SC", serif; }
.empty-prompt strong { color: #6f8587; font-size: 12px; }
.compass-mark { position: relative; display: block; width: 58px; height: 58px; border: 1px solid rgba(58,88,94,.45); border-radius: 50%; }
.compass-mark::before,.compass-mark::after { content:""; position:absolute; background:rgba(58,88,94,.35); }
.compass-mark::before { width:1px;height:76px;left:28px;top:-9px; }.compass-mark::after { width:76px;height:1px;left:-9px;top:28px; }
.compass-mark i { position:absolute; left:22px; top:8px; width:14px;height:42px;background:linear-gradient(to bottom,var(--gold) 0 50%,#617d82 50%); clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%); }
.map-caption { color: #5d7376; font-size: 10px; border-top: 1px solid rgba(76,100,104,.18); }

.info-panel { padding: 18px; border-left: 1px solid var(--line); }
.info-kicker { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; color: var(--gold); font-size: 11px; font-weight: 800; }
.info-panel h2 { margin: 0 0 10px; font: 700 23px/1.22 "Noto Serif SC", "Songti SC", serif; }
.prediction { margin: 0 0 15px; padding: 10px 11px; border-left: 3px solid var(--gold); color: #465b5f; background: #ede7d9; font-size: 13px; line-height: 1.5; }
.fact-list { margin: 0; }
.fact-list div { padding: 10px 0; border-bottom: 1px solid #d3d9d5; }
.fact-list dt { margin-bottom: 4px; color: #7a8a89; font-size: 10px; font-weight: 800; }
.fact-list dd { margin: 0; font-size: 13px; line-height: 1.45; }
.result-block, .caveat-block, .core-conclusion { margin-top: 14px; padding: 11px 12px; border-radius: var(--radius); }
.result-block { border: 1px solid #c7b27b; background: #f5edd9; }
.caveat-block { border: 1px solid #c6d2d0; background: #edf3f1; }
.result-block span, .caveat-block span, .core-conclusion span { color: var(--gold); font-size: 10px; font-weight: 800; }
.result-block p, .caveat-block p, .core-conclusion p { margin: 5px 0 0; font-size: 13px; line-height: 1.55; }
.compare-lead { color: var(--muted); font-size: 12px; }
.question-list { display: grid; gap: 7px; }
.question-item { border: 1px solid #cbd3ce; border-radius: 4px; background: #faf8f2; }
.question-item button { width: 100%; min-height: 44px; display: grid; grid-template-columns: 24px 1fr 18px; gap: 7px; align-items: start; padding: 9px; text-align: left; border: 0; background: transparent; font-size: 12px; line-height: 1.4; }
.question-item button strong { color: var(--gold); }
.question-item button i { width: 7px; height: 7px; margin-top: 5px; border-right: 1px solid; border-bottom: 1px solid; transform: rotate(45deg); transition: transform .2s; }
.question-item.is-open button i { transform: rotate(225deg); margin-top: 9px; }
.question-answer { display: none; margin: 0; padding: 0 10px 10px 40px; color: #40575a; font-size: 11px; line-height: 1.5; }
.question-item.is-open .question-answer { display: block; }
.core-conclusion { color: white; background: var(--ink); }
.core-conclusion span { color: #e2be72; }

.control-deck { display: grid; grid-template-columns: minmax(430px,1fr) auto 250px; align-items: center; gap: 18px; padding: 9px 20px; border-top: 1px solid rgba(80,102,103,.28); background: #f6f3eb; z-index: 20; }
.timeline { position: relative; display: grid; grid-template-columns: repeat(4,1fr); align-items: center; min-width: 0; height: 82px; }
.timeline-line { position: absolute; left: 8%; right: 8%; top: 23px; height: 1px; background: #97a8a7; }
.timeline button { position: relative; min-height: 70px; padding: 0 4px; border: 0; background: transparent; text-align: center; }
.timeline button i { display: block; width: 10px; height: 10px; margin: 18px auto 6px; border: 2px solid #6d8586; border-radius: 50%; background: #f6f3eb; transition: transform .2s,background .2s; }
.timeline button strong, .timeline button small { display: block; }
.timeline button strong { font-family: "Noto Serif SC", serif; font-size: 15px; }
.timeline button small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.timeline button.is-active i { border-color: var(--route-color,var(--gold)); background: var(--route-color,var(--gold)); transform: scale(1.35); box-shadow: 0 0 0 5px rgba(185,130,43,.12); }
.transport { display: flex; align-items: center; gap: 8px; }
.icon-button.secondary { background: transparent; }
.play-button { min-height: 48px; min-width: 154px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; border: 0; border-radius: var(--radius); color: white; background: var(--ink); font-weight: 800; }
.play-button svg { width: 21px; height: 21px; }
.play-button .pause-icon { display: none; }
.play-button.is-playing .play-icon { display: none; }.play-button.is-playing .pause-icon { display: block; }
.play-button:hover { background: #24444c; }
.progress-readout { display: grid; grid-template-columns: 1fr 40px; gap: 6px 10px; align-items: center; }
.progress-readout > span { grid-column: 1/3; color: var(--muted); font-size: 11px; }
.progress-track { height: 5px; overflow: hidden; border-radius: 9px; background: #d6dcda; }
.progress-track i { display: block; width: 0; height: 100%; background: var(--gold); transition: width .12s linear; }
.progress-readout strong { font-size: 12px; text-align: right; }

.modal-backdrop { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(15,30,34,.64); }
.modal-panel { position: relative; width: min(720px,100%); max-height: min(760px,calc(100vh - 40px)); overflow: auto; padding: 26px; border-radius: var(--radius); background: #f8f5ed; box-shadow: 0 28px 80px rgba(0,0,0,.28); }
.modal-panel h2 { margin: 0 0 18px; font: 700 27px "Noto Serif SC",serif; }
.modal-close { position: absolute; top: 14px; right: 14px; }
.workflow-list { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; padding: 0; list-style: none; counter-reset: steps; }
.workflow-list li { min-height: 128px; padding: 14px; border-top: 3px solid var(--gold); background: white; counter-increment: steps; }
.workflow-list li::before { content: "0" counter(steps); color: #b8a477; font: 700 24px "Noto Serif SC",serif; }
.workflow-list strong,.workflow-list span { display:block; }.workflow-list strong { margin: 8px 0; }.workflow-list span { color:var(--muted);font-size:12px;line-height:1.5; }
.shortcut-grid { display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin-top:18px; }.shortcut-grid span { padding:10px;background:#ece8de;font-size:12px; }.shortcut-grid kbd { margin-right:5px; }
.source-list { display:grid;gap:10px; }.source-entry { padding:12px;border:1px solid #d0d8d3;background:white; }.source-entry strong { display:block;margin-bottom:4px; }.source-entry p { margin:0;color:var(--muted);font-size:12px;line-height:1.5; }.source-entry a { color:#0f6478; }.source-note { margin:16px 0 0;padding:12px;border-left:3px solid var(--gold);background:#efe8d7;color:#4c5c5d;font-size:12px;line-height:1.55; }

@media (max-width: 1439px) {
  :root { --topbar-h: 66px; --deck-h: 108px; }
  .workspace { grid-template-columns: 236px minmax(410px,1fr) 270px; }
  .voyager-nav { padding: 11px 9px; }
  .voyager-row { grid-template-columns: minmax(0, 1fr) 32px; gap: 5px; }
  .voyager-card { min-height: 76px; grid-template-columns: 48px minmax(0,1fr) 19px; padding: 6px; }
  .route-instant { width: 32px; min-width: 32px; }
  .portrait-frame { width: 45px; }
  .voyager-copy strong { font-size: 15px; margin-bottom: 3px; }
  .voyager-copy small { font-size: 10px; }
  .compare-button { min-height: 58px; }
  .info-panel { padding: 13px; }.info-panel h2 { font-size: 20px; }
  .control-deck { grid-template-columns: minmax(360px,1fr) auto 210px; padding-inline: 12px; gap: 10px; }
  .play-button { min-width: 130px; }
}

@media (max-width: 1050px) {
  :root { --topbar-h: 62px; --deck-h: 100px; }
  .topbar { min-height: 62px; padding-inline: 10px; }
  .title-block .eyebrow { display:none; } h1 { font-size:20px; }
  .workspace { grid-template-columns: 204px minmax(400px,1fr) 240px; }
  .voyager-card { grid-template-columns: 44px minmax(0,1fr); }
  .voyager-card kbd, .compare-button kbd { display:none; }
  .compare-button { grid-template-columns: 30px minmax(0,1fr); }
  .info-panel { padding: 11px; }
  .control-deck { grid-template-columns: minmax(320px,1fr) auto 170px; }
  .progress-readout { grid-template-columns:1fr 34px; }
}

@media (max-width: 900px) {
  body { overflow: auto; }
  .app-shell { width:100%; min-width:0; max-width:100vw; height: auto; min-height: 100dvh; grid-template-rows: auto auto auto; overflow-x:hidden; }
  body { font-size:16px; }
  .topbar { width:100%; min-width:0; max-width:100vw; padding:8px 10px; }.unit-mark { display:none; }.top-actions { flex:0 0 auto;gap:4px; }.mode-button { min-width:52px;padding-inline:8px; }.top-actions .icon-button[data-action="sources"] { display:none; }
  .workspace { width:100%; min-width:0; max-width:100vw; display:flex;flex-direction:column; }
  .voyager-nav { width:100%;min-width:0;max-width:100%;display:grid;grid-template-columns:repeat(5,132px);gap:7px;overflow-x:auto;border-right:0;border-bottom:1px solid var(--line); }
  .rail-heading { display:none; }
  .voyager-row { margin:0; min-width:132px; grid-template-columns:minmax(0,1fr) 28px; gap:4px; }
  .voyager-card,.compare-button { min-width:0;height:68px;min-height:68px;margin:0;grid-template-columns:38px 1fr;padding:5px; }
  .voyager-card kbd,.compare-button kbd,.voyager-copy small,.compare-button small { display:none; }
  .portrait-frame { width:36px; }.voyager-copy strong { font-size:13px; }.compare-button { grid-template-columns:28px 1fr; min-width:116px; }
  .route-instant { width:28px; min-width:28px; min-height:44px; }
  .map-stage { height: min(68vw,520px); min-height:420px; }.map-toolbar { padding-inline:9px; }.map-legend { display:none; }.map-caption span:last-child { display:none; }
  .info-panel { display:block; padding:15px; }
  .control-deck { position:static;width:100%;min-width:0;max-width:100vw;display:flex;flex-direction:column;gap:5px;padding:6px 10px; }.timeline { width:100%;min-width:0;height:66px; }.timeline-line{top:17px}.timeline button{min-width:0;min-height:58px}.timeline button i{margin-top:12px}.transport{order:-1}.play-button{min-height:44px}.progress-readout{display:none}
  .workflow-list { grid-template-columns:1fr 1fr; }.shortcut-grid { grid-template-columns:1fr 1fr; }
}

@media (max-width: 520px) {
  h1 span { display:none; }
  .top-actions .icon-button[data-action="help"] { display:none; }
  .map-stage { height:420px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .voyager-card.is-active img { transform: none; }
}
