:root {
  color-scheme: dark;
  --base: #080c12;
  --panel: #0c121b;
  --panel-raised: #141f2c;
  --map: #070d16;
  --ink: #f3f3ef;
  --soft-ink: #d6dadf;
  --muted: #a0a9b4;
  --line: #283444;
  --light-line: #394759;
  --accent: #efbe73;
  --accent-dim: #634e32;
  --accent-wash: #28221a;
  --cyan: #9dd7f5;
  --serif: "Songti SC", "Noto Serif CJK SC", "STSong", SimSun, serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  color: var(--ink);
  background: var(--base);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; background: linear-gradient(165deg, #0d1723 0, var(--base) 35rem); }
[hidden] { display: none !important; }
button, select, input { font: inherit; color: inherit; }
button, select, a { -webkit-tap-highlight-color: transparent; }
button, select { cursor: pointer; }
button:disabled, select:disabled { cursor: default; }
:where(button, select, a, input):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
a { color: inherit; text-decoration: none; }
.shell { width: min(100% - 88px, 1360px); margin-inline: auto; }

.masthead { border-bottom: 1px solid var(--line); background: #090e16; }
.masthead-inner {
  min-height: 60px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 26px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; justify-self: start; }
.brand-mark { width: 36px; height: 36px; flex: none; color: var(--accent); }
.brand-name { font: 700 1.37rem/1.03 var(--serif); letter-spacing: .13em; white-space: nowrap; }
.brand-name small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font: 400 .62rem/1 var(--mono);
  letter-spacing: .11em;
}
.nav { align-self: stretch; display: flex; gap: clamp(19px, 3vw, 50px); }
.nav a {
  display: grid;
  place-items: center;
  padding: 1px 2px 0;
  border-bottom: 1px solid transparent;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 550;
  white-space: nowrap;
}
.nav a:hover, .nav a[aria-current] { border-color: var(--accent); color: var(--ink); }
.demo-badge {
  justify-self: end;
  padding: 4px 9px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: .76rem;
  white-space: nowrap;
}

.atlas-layout { margin-top: 18px; scroll-margin-top: 12px; }
.atlas-header, .achievement-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 13px;
}
.atlas-heading h1, .achievement-header h2, .route-title h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 750;
}
.atlas-heading p, .section-label {
  margin: 0;
  color: var(--accent);
  font-size: .82rem;
  font-weight: 620;
  letter-spacing: .09em;
}
.atlas-heading h1 { margin-top: 3px; font-size: clamp(2rem, 3.3vw, 3.3rem); letter-spacing: .10em; line-height: 1.12; }
.atlas-header { align-items: end; }
.mode-control, .achievement-tabs {
  display: flex;
  background: var(--base);
  border: 1px solid var(--line);
}
.mode-control button, .achievement-tabs button {
  min-height: 39px;
  padding: 5px 15px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: .875rem;
  white-space: nowrap;
}
.mode-control button:hover, .achievement-tabs button:hover { color: var(--ink); }
.mode-control button[aria-pressed="true"], .achievement-tabs button[aria-pressed="true"] {
  border-color: var(--accent-dim);
  background: var(--accent-wash);
  color: var(--accent);
}
.atlas-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(302px, 27%, 348px);
  border: 1px solid var(--light-line);
  background: var(--panel);
}
.atlas-card { display: flex; flex-direction: column; min-width: 0; }
.map-stage {
  position: relative;
  min-height: 475px;
  min-height: clamp(404px, calc(100svh - 224px), 575px);
  flex: 1;
  isolation: isolate;
  background: radial-gradient(ellipse at 50% 49%, #101e2e 0, var(--map) 65%);
}
.starfield { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.map-surface { position: absolute; inset: 0; overflow: hidden; }
.map-surface:focus-visible { outline: 1px solid var(--cyan); outline-offset: -2px; }
.map-surface > svg { display: block; }
.globe-route-control text, .globe-station-control text { pointer-events: bounding-box; }
.map-title {
  position: absolute;
  inset: 15px auto auto 15px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border: 1px solid #3e5871;
  background: #090f18df;
  color: var(--soft-ink);
  pointer-events: none;
}
.map-title::before { content: ""; width: 4px; height: 4px; background: var(--cyan); box-shadow: 0 0 6px #8bccfb60; }
.map-title strong { font-size: .83rem; font-weight: 650; line-height: 1.35; }
.map-caption {
  position: absolute;
  inset: auto auto 15px 15px;
  display: grid;
  gap: 5px;
  padding: 6px 9px;
  border-left: 1px solid #3e5871;
  background: #090f18d9;
  color: var(--soft-ink);
  pointer-events: none;
}
.map-key { display: flex; gap: 12px; font-size: .76rem; }
.map-key span { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
[data-mode="year"] .map-key > :last-child { display: none; }
.key-route { display: inline-block; width: 16px; border-top: 2px solid var(--cyan); }
.key-stop { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.map-hint { margin: 0; color: var(--muted); font-size: .78rem; }
[data-mode="year"] .map-hint span:last-child, [data-mode="trip"] .map-hint span:first-child { display: none; }
.map-controls {
  position: absolute;
  inset: auto 15px 15px auto;
  display: grid;
  gap: 1px;
  border: 1px solid var(--light-line);
  background: var(--line);
}
.map-controls button, .icon-button {
  display: grid;
  place-items: center;
  background: #10161f;
  color: var(--soft-ink);
}
.map-controls button {
  width: 39px;
  height: 38px;
  padding: 0;
  border: 0;
}
.map-controls button svg, .icon-button svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.map-controls button svg { width: 20px; height: 20px; }
.map-controls button:not(:disabled):hover, .icon-button:not(:disabled):hover { background: var(--panel-raised); color: var(--accent); }
.map-controls button:disabled, .icon-button:disabled { color: #606975; }
.map-empty {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: max-content;
  max-width: 85%;
  padding: 11px 15px;
  border: 1px solid var(--light-line);
  background: var(--panel);
  color: var(--soft-ink);
  text-align: center;
  pointer-events: none;
}

.timeline { padding: 13px 16px 11px; border-top: 1px solid var(--light-line); }
.timeline-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.timeline-head label { display: flex; align-items: center; gap: 10px; font-size: .87rem; color: var(--soft-ink); }
.timeline-head strong { color: var(--accent); font: 650 1.1rem/1.2 var(--sans); font-variant-numeric: tabular-nums; }
.timeline-count { font-size: .82rem; color: var(--muted); white-space: nowrap; }
.timeline-rail { padding-top: 7px; }
#year-range {
  --progress: 0%;
  --track: linear-gradient(to right, #b99059 var(--progress), #45505e var(--progress));
  display: block;
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  width: 100%;
  height: 24px;
  background: transparent;
  cursor: ew-resize;
}
#year-range::-webkit-slider-runnable-track { height: 2px; margin-inline: 8px; background: var(--track); }
#year-range::-moz-range-track { height: 2px; margin-inline: 8px; background: var(--track); }
#year-range::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -6px;
  background: var(--accent);
  border: 2px solid var(--panel);
  outline: 1px solid var(--accent);
}
#year-range::-moz-range-thumb {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border: 2px solid var(--panel);
  border-radius: 0;
  outline: 1px solid var(--accent);
}
.year-ticks { display: flex; justify-content: space-between; align-items: center; }
.year-ticks button {
  min-height: 26px;
  padding: 1px 3px 2px;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: .82rem/1.3 var(--mono);
}
.year-ticks button:hover { color: var(--ink); }
.year-ticks button[aria-current] { border-color: var(--accent); color: var(--accent); }

.route-card { min-width: 0; display: flex; flex-direction: column; padding: 14px 17px 16px; border-left: 1px solid var(--light-line); }
.route-top { display: flex; justify-content: space-between; align-items: center; gap: 9px; min-height: 35px; }
.picker-wrap { position: relative; min-width: min(147px, 56%); max-width: 59%; }
.picker-wrap::after {
  content: "";
  position: absolute;
  right: 12px;
  top: calc(50% - 5px);
  width: 6px;
  height: 6px;
  border: solid var(--muted);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  pointer-events: none;
}
.picker-wrap select {
  appearance: none;
  width: 100%;
  min-height: 34px;
  padding: 4px 26px 4px 9px;
  border: 1px solid var(--line);
  color: var(--soft-ink);
  background: #141923;
  font-size: .84rem;
  text-overflow: ellipsis;
}
.route-content { display: flex; flex: 1; flex-direction: column; gap: 0; }
.route-title { padding: 12px 0 12px; }
.route-title h3 { font-size: clamp(1.38rem, 2.05vw, 1.85rem); line-height: 1.22; letter-spacing: .035em; }
.route-dates {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
}
.stop-list { display: grid; gap: 0; list-style: none; padding: 0; margin: 0 0 14px; }
.stop-list li { min-width: 0; border-top: 1px solid var(--line); }
.stop-list li:last-child { border-bottom: 1px solid var(--line); }
.stop-list button {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 35px;
  padding: 4px 8px 4px 6px;
  border: 0;
  border-left: 1px solid transparent;
  background: transparent;
  color: var(--soft-ink);
  text-align: left;
}
.stop-list button:hover { background: var(--panel-raised); }
.stop-list button[aria-current] { border-color: var(--accent); background: var(--accent-wash); color: var(--accent); }
.stop-number {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: var(--muted);
  font: .75rem/1 var(--mono);
}
.stop-list button[aria-current] .stop-number { border: 1px solid var(--accent-dim); color: var(--accent); }
.stop-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; font-weight: 620; }
.stop-date { color: var(--muted); white-space: nowrap; font-size: .8rem; font-variant-numeric: tabular-nums; }
.stop-detail { margin-top: 0; }
.stop-figure, .stop-no-photo {
  position: relative;
  overflow: hidden;
  margin: 0;
  height: clamp(111px, 10vw, 136px);
  border: 1px solid var(--line);
  background: var(--map);
}
.stop-figure::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 56%;
  background: linear-gradient(transparent, #080b10e8);
  pointer-events: none;
}
.stop-figure img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 48%; }
.stop-figure figcaption {
  position: absolute;
  z-index: 1;
  bottom: 7px;
  left: 10px;
  color: #f9f9f5;
  font-size: .81rem;
}
.stop-no-photo { display: grid; align-content: center; gap: 4px; padding: 13px; color: var(--soft-ink); }
.stop-no-photo span { color: var(--muted); font-size: .76rem; }
.stop-no-photo strong { font: 700 1.24rem/1.4 var(--serif); }
.stop-note { min-height: 3em; margin: 8px 0 12px; color: var(--soft-ink); font-size: .91rem; line-height: 1.57; }
.player { display: flex; align-items: center; gap: 5px; margin-bottom: 12px; }
.icon-button, .play-button { height: 37px; border: 1px solid var(--line); }
.icon-button { width: 36px; flex: none; padding: 0; }
.icon-button svg { width: 17px; height: 17px; }
.play-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: none;
  padding: 0 11px;
  border-color: var(--accent);
  background: var(--accent);
  color: #17130c;
  font-size: .85rem;
  font-weight: 680;
  white-space: nowrap;
}
.play-button:hover { background: #f6cc8b; }
.play-button:disabled { opacity: .52; }
#play-icon { width: 0; height: 0; border: 5px solid transparent; border-right: 0; border-left: 8px solid currentColor; }
#play-icon.playing { width: 8px; height: 10px; border: solid currentColor; border-width: 0 2px; }
.stop-counter { margin-left: auto; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

.overview-trips { display: grid; margin-top: 6px; border-top: 1px solid var(--line); }
.overview-trips button {
  display: grid;
  gap: 2px;
  justify-items: start;
  width: 100%;
  min-height: 66px;
  padding: 8px 9px;
  border: 0;
  border-left: 1px solid transparent;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--soft-ink);
  text-align: left;
  transition: background-color .18s ease, border-color .18s ease;
}
.overview-trips button:is(:hover, :focus-visible) { border-left-color: var(--cyan); background: #101f2d; }
.overview-trips button[aria-current] { border-left-color: var(--accent); background: var(--accent-wash); }
.overview-trips strong::before {
  content: "";
  display: inline-block;
  margin: 0 .55em .18em 0;
  width: .55em;
  height: 2px;
  background: var(--route-color, var(--cyan));
  box-shadow: 0 0 5px var(--route-color, var(--cyan));
}
.overview-trips strong { color: var(--ink); font-size: .98rem; font-weight: 650; }
.overview-trips span, .overview-trips small { color: var(--muted); font-size: .82rem; line-height: 1.38; }
.overview-trips small { font-variant-numeric: tabular-nums; }
.empty-route, .empty-achievements { color: var(--muted); padding: 10px 0; }
.route-card .section-label { font-size: .92rem; }

.achievement-section { margin-top: 41px; scroll-margin-top: 15px; }
.achievement-header { align-items: end; margin-bottom: 15px; }
.achievement-kicker { margin: 0 0 5px; }
.achievement-header h2 { font-size: clamp(1.6rem, 2.75vw, 2.4rem); letter-spacing: .065em; line-height: 1.17; }
.achievement-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.achievement-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 13px 15px 15px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.achievement-card:first-child { border-top-color: var(--accent-dim); }
.achievement-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; color: var(--muted); font-size: .8rem; }
.achievement-rank { padding-right: 8px; border-right: 1px solid var(--accent-dim); color: var(--accent); font: .97rem/1 var(--mono); }
.achievement-meta time { margin-left: auto; font-variant-numeric: tabular-nums; }
.achievement-card h3 { margin: 8px 0 4px; font: 750 1.21rem/1.45 var(--serif); }
.achievement-card p { margin: 0 0 6px; color: var(--soft-ink); font-size: .92rem; line-height: 1.55; }
.achievement-location { margin-top: auto; padding-top: 4px; color: var(--accent); font-size: .85rem; }
button.achievement-location {
  width: fit-content;
  max-width: 100%;
  padding: 4px 0;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 4px;
  border: 0;
  background: transparent;
}
button.achievement-location:hover { color: var(--ink); }
.footer {
  display: flex;
  justify-content: space-between;
  gap: 8px 17px;
  margin-top: 28px;
  padding: 16px 0 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .81rem;
}
.footer a { text-decoration: underline; text-underline-offset: 3px; }
.footer a:hover { color: var(--ink); }

@media (max-width: 1000px) {
  .shell { width: min(100% - 56px, 1360px); }
  .route-card { padding-inline: 13px; }
  .timeline { padding-inline: 13px; }
}
@media (max-width: 760px) {
  .shell { width: calc(100% - 34px); }
  .masthead-inner { min-height: 56px; gap: 12px; }
  .brand-mark { width: 29px; height: 29px; }
  .brand { gap: 6px; }
  .brand-name { font-size: 1.15rem; }
  .brand-name small { display: none; }
  .nav { gap: 13px; }
  .nav a { font-size: .82rem; }
  .demo-badge { padding: 3px 5px; font-size: .71rem; }
  .atlas-layout { margin-top: 13px; }
  .atlas-header { gap: 9px; margin-bottom: 9px; }
  .atlas-heading h1 { font-size: clamp(1.49rem, 5.2vw, 2.25rem); letter-spacing: .055em; }
  .atlas-heading p { font-size: .72rem; }
  .mode-control button, .achievement-tabs button { min-height: 37px; padding-inline: 9px; font-size: .8rem; }
  .atlas-workspace { grid-template-columns: 1fr; }
  .map-stage { min-height: clamp(300px, 88vw, 475px); }
  .map-title { inset: 8px auto auto 8px; padding: 4px 7px; }
  .map-caption { inset: auto auto 8px 8px; padding: 5px 7px; gap: 3px; }
  .map-controls { inset: auto 8px 8px auto; }
  .map-controls button { width: 42px; height: 42px; }
  .year-ticks button { min-height: 34px; }
  .route-card { padding: 13px 13px 15px; border-left: 0; border-top: 1px solid var(--light-line); }
  .stop-figure { height: clamp(130px, 40vw, 230px); }
  .stop-no-photo { height: 90px; }
  .stop-note { min-height: 0; }
  .stop-list button { min-height: 40px; }
  .achievement-section { margin-top: 29px; }
  .achievement-list { grid-template-columns: 1fr; }
  .footer { flex-wrap: wrap; margin-top: 21px; }
}
@media (max-width: 365px) {
  .shell { width: calc(100% - 24px); }
  .masthead-inner { gap: 7px; }
  .nav { gap: 9px; }
  .mode-control button, .achievement-tabs button { padding-inline: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .overview-trips button { transition: none; }
}

.journey-orbit { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.observation-tools {
  position: absolute; right: 14px; top: 14px;
  display: flex; gap: 2px; align-items: center;
  padding: 3px; background: #0a101bdc;
  border: 1px solid #a997704f; border-radius: 24px;
}
.observation-tools button, .immersive-player button {
  border: 0; color: var(--soft-ink); background: transparent;
  min-height: 32px; padding: 3px 10px; font-size: .81rem;
  display: inline-flex; align-items: center; gap: 6px; border-radius: 20px;
}
.observation-tools button:hover, .immersive-player button:hover { background: #ffffff12; color: #fff; }
.observation-tools button[aria-pressed="true"] { background: #d5b78319; color: #edce9c; }
.light-icon { font-size: 1rem; line-height: 1; }
.observation-tools svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.4; }
#observatory {
  position: fixed; inset: 0; height: 100dvh; width: 100%; max-width: none;
  max-height: none; margin: 0; padding: 0; border: 0; background: var(--map); color: var(--ink);
}
#observatory::backdrop { background: #05080c; }
body:has(#observatory[open]) { overflow: hidden; }
#observatory .atlas-card { height: 100%; }
#observatory .map-stage { min-height: 0; }
#observatory .timeline { width: min(100%, 820px); align-self: center; background: var(--map); }
.immersive-player {
  display: flex; align-items: center; gap: 5px; position: absolute; left: 50%; bottom: 18px;
  transform: translateX(-50%); padding: 4px 6px 4px 12px; white-space: nowrap;
  background: #0b111def; border: 1px solid var(--light-line); border-radius: 30px;
}
.immersive-player span { color: #edd3a9; font-size: .83rem; }
@media (max-width:600px) {
  .observation-tools { top: 8px; right: 8px; }
  .observation-tools button { min-height: 34px; padding-inline: 8px; }
  #observatory .map-caption { display:none; }
  .immersive-player { bottom: 7px; left: 8px; transform: none; gap: 1px; }
}

[data-demo-note][hidden], #data-error[hidden] { display:none; }
.data-error { padding:1rem; }
#retry-data { color:inherit; background:transparent; border:1px solid currentColor; padding:.4rem .75rem; }
#year-ticks { overflow-x:auto; gap:2px; }
#year-ticks button { flex-shrink:0; }

.map-caption-line { display: flex; align-items: center; gap: .5rem; }
.map-attribution { pointer-events: auto; }
.map-attribution summary {
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  cursor: pointer;
  list-style: none;
  color: var(--soft-ink);
  font: 1rem/1 system-ui, sans-serif;
}
.map-attribution summary::-webkit-details-marker { display: none; }
.map-attribution-body {
  position: absolute;
  z-index: 2;
  left: 0;
  bottom: calc(100% + .25rem);
  width: min(19rem, 72vw);
  padding: .6rem .75rem;
  border: 1px solid var(--line);
  background: #0b1320;
  color: var(--soft-ink);
  font-size: .8rem;
  line-height: 1.5;
}
.map-attribution-body p { margin: 0; }
.map-attribution-body p + p { margin-top: .35rem; }
.map-attribution-body a, .photo-credit a { color: #c9e7fc; text-underline-offset: .17em; }
.stop-figure figcaption { right: 10px; }
.photo-credit:not([hidden]) { display: block; }
.photo-credit { font-size: .75rem; line-height: 1.4; text-shadow: 0 1px 4px #000; }
