:root {
  color-scheme: light;
  --paper: #f8f6ef;
  --paper-light: #fdfbf6;
  --ink: #222830;
  --muted: #535d69;
  --accent: #263950;
  --accent-hover: #3a5270;
  --soft: #e5eaf0;
  --wash: #eeece5;
  --line: #d3d5d7;
  --outline: #8795a5;
  --on-accent: #fdfbf6;
  --paper-rgb: 248 246 239;
  --paper-light-rgb: 253 251 246;
  --accent-rgb: 38 57 80;
  --hero-veil: linear-gradient(90deg, var(--paper) 0, rgb(var(--paper-rgb) / .98) 19%, rgb(var(--paper-rgb) / .91) 34%, rgb(var(--paper-rgb) / .12) 67%, transparent 83%);
  /* 窄屏时画面收成顶部一条横幅，遮罩改为自上而下淡出，让横幅下缘化进纸里。 */
  --hero-veil-narrow: linear-gradient(180deg, transparent 0%, transparent 66%, rgb(var(--paper-rgb) / .38) 80%, rgb(var(--paper-rgb) / .88) 93%, var(--paper) 100%);
  --hero-art-filter: grayscale(.96) sepia(.13);
  --hero-title-size: clamp(49px, 5.9vw, 91px);
  --intro-size: clamp(30px, 3.5vw, 52px);
  --glass: rgb(var(--paper-light-rgb) / .77);
  --map-bg: #e4eaf1;
  --map-image-filter: grayscale(1);
  --map-image-blend: multiply;
  --map-image-opacity: .74;
  --serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  --sans: "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
  --gutter: clamp(20px, 5.25vw, 76px);
  --measure: 1190px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #101319;
  --paper-light: #171b23;
  --ink: #e4e7ec;
  --muted: #9ba5b4;
  --accent: #8fb6dd;
  --accent-hover: #a9c9ea;
  --soft: #1d222c;
  --wash: #13171f;
  --line: #2b313c;
  --outline: #6f7c8e;
  --on-accent: #0d1017;
  --paper-rgb: 16 19 25;
  --paper-light-rgb: 23 27 35;
  --accent-rgb: 143 182 221;
  --hero-art-filter: grayscale(1) brightness(.34) contrast(1.16);
  --hero-veil-narrow: linear-gradient(180deg, transparent 0%, transparent 58%, rgb(var(--paper-rgb) / .42) 78%, rgb(var(--paper-rgb) / .9) 92%, var(--paper) 100%);
  --map-bg: #0d121a;
  --map-image-filter: grayscale(1) invert(1) contrast(1.12);
  --map-image-blend: screen;
  --map-image-opacity: .42;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 94px; }
body { margin: 0; min-width: 0; background: var(--paper); color: var(--ink); font: 16px/1.65 var(--sans); }
main { min-height: calc(100svh - 152px); }
:where(h1, h2, h3, p, figure) { margin: 0; }
p { text-wrap: pretty; }
:where(h1, h2, h3) { font-family: var(--serif); font-weight: 650; line-height: 1.19; text-wrap: balance; }
:where(button, a):focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
:where(h1, h2, main):focus { outline: none; }
a { color: inherit; text-decoration: none; }
button { color: inherit; cursor: pointer; font: inherit; }
img { max-width: 100%; }
::selection { background: rgb(var(--accent-rgb) / .28); }

.theme-shift *, .theme-shift *::before, .theme-shift *::after {
  transition: background-color 240ms ease, border-color 240ms ease, color 240ms ease, fill 240ms ease, filter 240ms ease !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-content {
  position: fixed;
  z-index: 10;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  background: var(--paper-light);
  transform: translateY(-150%);
}
.skip-content:focus { transform: translateY(0); }
.noscript { max-width: var(--measure); margin: auto; padding: var(--gutter); }
.wrap { max-width: calc(var(--measure) + var(--gutter) * 2); margin: auto; padding-inline: var(--gutter); }

/* 页眉吸顶：长页面（观点对照、图谱）里随时能切换栏目与主题。 */
.site-head { position: sticky; top: 0; z-index: 20; background: rgb(var(--paper-rgb) / .9); -webkit-backdrop-filter: saturate(1.2) blur(10px); backdrop-filter: saturate(1.2) blur(10px); border-bottom: 1px solid var(--line); transition: opacity 500ms ease; }
.head-inner, .site-foot {
  max-width: 1640px;
  margin: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.head-inner { height: 70px; }
.head-tools { display: flex; align-items: center; gap: clamp(10px, 2.4vw, 24px); }
.site-head nav { display: flex; align-items: stretch; align-self: stretch; gap: clamp(14px, 4vw, 38px); }
.site-head nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  color: var(--muted);
}
.site-head nav a:hover, .site-head nav a[data-current] { color: var(--accent); }
.site-head nav a[data-current]::after {
  position: absolute;
  content: "";
  inset: auto 0 0;
  height: 2px;
  background: var(--accent);
}
.brand { display: inline-flex; align-items: center; min-height: 44px; gap: 11px; font: 700 21px var(--serif); white-space: nowrap; }
.mark { display: inline-block; flex: 0 0 19px; width: 19px; height: 19px; position: relative; }
.mark::before, .mark::after { content: ""; position: absolute; inset: 3px; border: 1px solid var(--accent); transform: rotate(45deg); }
.mark::after { inset: 6px 0; }
.theme-toggle {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper-light);
  color: var(--muted);
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--outline); }
.theme-toggle svg { width: 19px; height: 19px; display: block; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.site-foot { min-height: 81px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.site-foot .brand { color: var(--ink); font-size: 16px; }
.site-foot .mark { scale: .85; }
.site-foot a:last-child { display: inline-flex; align-items: center; gap: .35em; min-height: 44px; }

.kicker { color: var(--accent); font-size: 13px; font-weight: 670; letter-spacing: .12em; }
.kicker > span:empty { display: inline-block; width: 17px; height: 1px; margin: 0 .35em .28em; background: var(--outline); }
.small-label { color: var(--muted); font-size: 13px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.button, .text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  gap: 13px;
  font-size: 14px;
  font-weight: 620;
}
.button { padding: 9px 16px; border: 1px solid transparent; line-height: 1.4; transition: background-color 160ms ease, border-color 160ms ease; }
.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.quiet { background: var(--paper-light); border-color: var(--outline); color: var(--accent); }
.quiet:hover { background: var(--soft); }
.text-link { color: var(--accent); }
.text-link:hover, .site-foot a:last-child:hover { text-decoration: underline; text-underline-offset: .25em; }

.home {
  isolation: isolate;
  position: relative;
  /* 首屏铺满（减去页眉 70px 与底部导引 76px），同时不让画面比 5:4 更"竖"，避免横向裁掉人物与松树。 */
  min-height: max(520px, min(calc(100svh - 146px), 80vw));
  display: grid;
  align-items: center;
  overflow: clip;
}
.hero-visual { position: absolute; z-index: -1; inset: 0; overflow: hidden; background: var(--paper); }
/* 四周各留 16px 出血，供指针视差位移时不露边；画布与插画共用这一宿主，裁切保持一致。 */
.hero-artwork { position: absolute; inset: -16px; filter: var(--hero-art-filter); transform-origin: 64% 58%; translate: var(--pan-x, 0px) var(--pan-y, 0px); transition: translate 1.4s cubic-bezier(.2, .7, .2, 1); }
.hero-art { position: absolute; display: block; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 66% 32%; }
.hero-artwork img { transition: opacity 700ms ease; }
.home.art-pending .hero-artwork img { opacity: 0; }
.hero-art[hidden] { display: none; }
.hero-canvas { object-fit: fill; object-position: 0 0; }
.hero-wind { pointer-events: none; }
.hero-veil { position: absolute; inset: 0; pointer-events: none; background: var(--hero-veil); transition: opacity 650ms ease; }
.hero-inner { margin: auto; width: 100%; max-width: 1640px; padding: 72px var(--gutter); }
.hero-copy { position: relative; max-width: 535px; }
.hero-title { position: relative; }
.hero-copy h1 { margin: 17px 0 19px; font-size: var(--hero-title-size); line-height: 1.03; letter-spacing: -.065em; text-wrap: balance; }
.hero-copy h1 > span { display: block; }
.hero-description { max-width: 370px; font-size: clamp(16px, 1.5vw, 20px); color: var(--muted); }
.hero-actions { margin-top: 26px; }
.hero-actions .button { min-height: 50px; }
.hero-actions .quiet { background: var(--glass); }
.hero-actions .quiet:hover { background: var(--soft); }
.intro-lines {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  align-content: start;
  align-items: start;
  padding-top: calc((var(--hero-title-size) * 1.03 - var(--intro-size)) / 2);
  pointer-events: none;
}
.intro-lines::before {
  content: "";
  position: absolute;
  inset: -14% -16% -10% -20%;
  z-index: -1;
  background: radial-gradient(58% 62% at 32% 46%, rgb(var(--paper-rgb) / .93) 0%, rgb(var(--paper-rgb) / .74) 38%, rgb(var(--paper-rgb) / .32) 66%, rgb(var(--paper-rgb) / 0) 88%);
}
.intro-line {
  grid-area: 1 / 1;
  margin: 0;
  font-family: var(--serif);
  font-size: var(--intro-size);
  font-weight: 650;
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--ink);
  opacity: 0;
}
.home-guide {
  max-width: 1640px;
  min-height: 75px;
  margin: auto;
  padding: 8px var(--gutter);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  transition: opacity 500ms ease;
}
.guide-path { display: flex; flex-wrap: wrap; align-items: center; gap: 11px; color: var(--muted); font-size: 13px; }
.guide-path i { height: 1px; width: 17px; background: var(--outline); }
.skip-intro {
  /* 固定在视口右下角：首页高于视口时（矮屏、手机横屏）也始终看得见。 */
  position: fixed;
  z-index: 5;
  right: var(--gutter);
  bottom: max(18px, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--outline);
  background: var(--glass);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--accent);
  font-size: 13px;
  opacity: 0;
  transition: background-color 160ms ease, border-color 160ms ease;
}
.skip-intro:hover { background: var(--soft); border-color: var(--accent); }
.skip-intro > span { transition: translate 200ms ease; }
.skip-intro:hover > span { translate: 3px 0; }
/* 底边一条细线随开场推进，提示还剩多久。 */
.skip-progress { position: absolute; inset: auto 0 0; height: 2px; background: var(--accent); opacity: .5; transform: scaleX(0); transform-origin: left; }
.home.is-moving .skip-intro { animation: skip-in 520ms ease 900ms both; }
.home.is-moving .skip-progress { animation: skip-progress var(--opening-duration) linear both; }
.home.is-intro .skip-intro:focus-visible { animation: none; opacity: 1; }
.awaiting-ui .site-head, .awaiting-ui .site-foot, .opening .site-head, .opening .site-foot, .opening .home-guide, .home.is-intro .hero-veil { opacity: 0; }
.home.is-intro .hero-copy > .kicker,
.home.is-intro .hero-copy h1 > span,
.home.is-intro .hero-copy .hero-description,
.home.is-intro .hero-copy .hero-actions { opacity: 0; }
.home.is-intro .hero-artwork img { opacity: 0; }
/* 时间轴变量由 app.js 从 opening.js 的 openingBeats 写入，这里的默认值只是兜底。 */
.home.is-intro .hero-artwork { transform: scale(var(--opening-zoom, 1.06)); }
/* 推镜起步慢、一路滑行到标题出现，不在前半段就推完。 */
.home.is-moving .hero-artwork { animation: art-opening var(--opening-duration) cubic-bezier(.42, .06, .3, 1) both; }
.home.is-moving .hero-veil { animation: veil-opening calc(var(--opening-duration) - var(--copy-at, 9800ms)) ease var(--copy-at, 9800ms) both; }
.home.is-moving .intro-lines { animation: intro-scrim var(--scrim-length, 9200ms) linear var(--scrim-at, 300ms) both; }
.home.is-moving .intro-line { animation: intro-beat var(--line-length, 2900ms) cubic-bezier(.32, 0, .24, 1) both; }
.home.is-moving .intro-line:nth-child(1) { animation-delay: var(--line-1-at, 500ms); }
.home.is-moving .intro-line:nth-child(2) { animation-delay: var(--line-2-at, 3450ms); }
.home.is-moving .intro-line:nth-child(3) { animation-delay: var(--line-3-at, 6400ms); }
.home.is-revealing .hero-copy > .kicker { animation: copy-rise 820ms cubic-bezier(.22, .68, .24, 1) both; }
.home.is-revealing .hero-copy h1 > span { animation: copy-rise 960ms cubic-bezier(.22, .68, .24, 1) 120ms both; }
.home.is-revealing .hero-copy h1 > span:nth-child(2) { animation-delay: 240ms; }
.home.is-revealing .hero-copy .hero-description { animation: copy-rise 880ms cubic-bezier(.22, .68, .24, 1) 620ms both; }
.home.is-revealing .hero-copy .hero-actions { animation: copy-rise 820ms cubic-bezier(.22, .68, .24, 1) 780ms both; }
@keyframes art-opening {
  from { transform: scale(var(--opening-zoom, 1.06)); }
  to { transform: scale(1); }
}
@keyframes skip-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes skip-progress {
  to { transform: scaleX(1); }
}
@keyframes veil-opening {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes intro-scrim {
  0% { opacity: 0; }
  8% { opacity: 1; }
  92% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes intro-beat {
  0% { opacity: 0; transform: translateY(16px); }
  16% { opacity: 1; transform: translateY(0); }
  80% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-11px); }
}
@keyframes copy-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.lab, .atlas, .recap, .experiments { padding-top: clamp(26px, 5vw, 57px); padding-bottom: clamp(50px, 8vw, 92px); }
.lab-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 18px; }
.lab-active { max-width: calc(620px + var(--gutter) * 2); }
.lab-progress { color: var(--muted); font-size: 13px; }
.lab-progress a { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); }
.lab-progress a:hover { text-decoration: underline; text-underline-offset: .2em; }
.layer-rail { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.layer-step { display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.layer-step.visited { color: var(--accent); background: var(--soft); border-color: var(--outline); }
.layer-step.active { color: var(--on-accent); background: var(--accent); border-color: var(--accent); font-weight: 700; }
nav.layer-rail .layer-step { width: 44px; height: 44px; }
a.layer-step:hover { border-color: var(--accent); }
.page-heading { margin: 28px 0 25px; }
.atlas .page-heading { margin-top: 0; }
.page-heading h1 { font-size: clamp(38px, 5vw, 67px); margin: 7px 0; letter-spacing: -.055em; }
.thread { max-width: 710px; margin-top: 11px; color: var(--muted); }
.panel { background: var(--paper-light); border: 1px solid var(--line); padding: clamp(18px, 3.05vw, 34px); min-width: 0; }
.panel h2 { margin: 4px 0 16px; font-size: clamp(25px, 3vw, 35px); }
.experiments .page-heading { margin-top: 0; }
.experiment-stage { padding-block: 22px 28px; border-top: 1px solid var(--outline); }
.experiment-stage + .experiment-stage { margin-top: 6px; }
.experiment-stage-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 22px; margin-bottom: 17px; }
.experiment-stage-heading h2 { font-size: clamp(28px, 3vw, 36px); }
.experiment-stage-heading p, .experiment-card > p:not(.kicker) { color: var(--muted); }
.experiment-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.experiment-card { display: grid; grid-template-rows: auto auto 1fr auto; gap: 8px; transition: border-color 160ms ease, background-color 160ms ease; }
.experiment-card:hover { background: var(--soft); border-color: var(--outline); }
.experiment-card h3 { text-wrap: pretty; font-size: clamp(24px, 3vw, 33px); }
.experiment-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 5px; color: var(--accent); font-size: 14px; font-weight: 650; }
.decision { margin-top: 13px; animation: enter-decision 220ms ease-out; }
.decision-phase { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
/* 每层三步：先选、改条件、再选。当前一步用实心，走过的打勾。 */
.phase-steps { display: flex; align-items: center; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.phase-steps li { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.phase-steps li + li::before { content: ""; width: 14px; height: 1px; background: var(--line); }
.phase-steps li > span { display: inline-grid; place-items: center; width: 18px; height: 18px; border: 1px solid var(--line); border-radius: 50%; font-size: 11px; font-variant-numeric: tabular-nums; }
.phase-steps li.done { color: var(--accent); }
.phase-steps li.done > span { border-color: var(--outline); background: var(--soft); }
.phase-steps li[aria-current] { color: var(--accent); font-weight: 650; }
.phase-steps li[aria-current] > span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.decision-question { margin-top: 14px; color: var(--muted); font-size: 14px; }
.decision-question span { margin-inline-end: .6em; color: var(--accent); font-size: 12px; font-weight: 650; letter-spacing: .12em; }
.decision h1 { margin: 6px 0 15px; font-size: clamp(29px, 4.8vw, 46px); }
.scene { background: var(--wash); color: var(--ink); padding: 12px 14px; margin-bottom: 13px; line-height: 1.65; }
.changed { background: var(--soft); }
.locked-answer, .decision-note { font-size: 13px; color: var(--muted); }
.locked-answer { margin-bottom: 8px; }
.locked-answer strong { color: var(--accent); }
@keyframes enter-decision {
  from { opacity: .7; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.choices { display: grid; gap: 8px; }
.choice, .chip { min-height: 44px; border: 1px solid var(--line); background: var(--paper-light); transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease; }
.choice { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; padding: 9px 12px; line-height: 1.45; font-size: 16px; touch-action: manipulation; }
.choice:hover, .chip:hover { border-color: var(--outline); }
.choice:hover { background: var(--soft); }
.choice-arrow { transition: translate 180ms ease; }
.choice:hover .choice-arrow, .choice:focus-visible .choice-arrow { translate: 3px 0; }
.choice.is-picked { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.choice.is-picked .choice-arrow { color: var(--on-accent); translate: 5px 0; }
.choice:disabled { cursor: default; }
.choice:disabled:not(.is-picked) { opacity: .55; }
.choice:active { background: var(--soft); }
.choice-arrow { color: var(--accent); }
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { display: inline-flex; align-items: center; justify-content: center; padding: 8px 12px; color: var(--accent); font-size: 14px; line-height: 1.45; }
.chip[aria-current] { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }

.compare-section { margin-top: 20px; border: 1px solid var(--line); background: var(--paper-light); }
.section-heading { padding: clamp(18px, 3vw, 31px); display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 7px 16px; border-bottom: 1px solid var(--line); }
.section-heading h2, .reflection h1 { font-size: clamp(26px, 3.4vw, 41px); margin-top: 4px; }
.perspectives { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.perspective { display: grid; align-content: start; padding: clamp(18px, 3vw, 31px); }
.perspective + .perspective { border-left: 1px solid var(--line); }
.perspective-label { color: var(--accent); font-size: 14px; font-weight: 650; }
.perspective-label span { margin-inline-start: .5em; font-size: 12px; font-weight: 450; color: var(--muted); }
.perspective h3 { font-size: clamp(23px, 3.1vw, 33px); margin: 9px 0; }
.perspective .text-link { width: fit-content; margin-top: 6px; align-self: end; }
.hinge { padding: 14px clamp(18px, 3vw, 31px); display: flex; gap: 10px 17px; align-items: baseline; flex-wrap: wrap; background: var(--soft); }
.hinge p { flex: 1 1 260px; }
.reflection { display: grid; gap: 14px; padding-top: 18px; }
.answer-trail { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: stretch; }
.answer-trail div { display: grid; grid-template-rows: auto 1fr auto; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); background: var(--paper-light); }
.answer-trail div:last-child { background: var(--soft); border-color: var(--outline); }
.answer-trail div > span { color: var(--muted); font-size: 13px; }
.answer-trail p, .answer-trail strong { font-size: 14px; }
.answer-trail strong { color: var(--accent); }
.trail-arrow { align-self: center; color: var(--muted); }
.next-step { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 9px 18px; margin-top: 17px; }
.next-step p { color: var(--muted); max-width: 680px; }
.recap-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.recap-history { margin-top: 29px; }
.recap-history > h2 { margin-bottom: 13px; font-size: clamp(24px, 3vw, 34px); }
.recap-layer h3 { margin: 4px 0 16px; font-size: clamp(23px, 2.5vw, 31px); }
.recap-trail { border-top: 1px solid var(--line); padding: 9px 0; }
.recap-trail span { color: var(--muted); font-size: 13px; }
.recap-trail p { color: var(--accent); font-size: 14px; }
.recap-actions { margin-top: 22px; }
.recap-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; color: var(--muted); }
.recap-summary strong { color: var(--accent); font-size: 18px; font-variant-numeric: tabular-nums; }
.recap-meter { flex: 0 1 220px; height: 4px; background: var(--line); overflow: hidden; }
.recap-meter span { display: block; height: 100%; background: var(--accent); transform: scaleX(var(--done)); transform-origin: left; }
.recap-layer { display: flex; flex-direction: column; }
.recap-layer > .text-link { margin-top: auto; width: fit-content; }
.recap-layer.is-next { border-color: var(--outline); box-shadow: inset 3px 0 0 var(--accent); }
.recap-layer.is-locked { background: transparent; }
.recap-layer.is-locked h3 { color: var(--muted); }

.relationship-map { border: 1px solid var(--line); background: var(--paper-light); }
.relationship-map figcaption > p { color: var(--muted); font-size: 14px; }
.relation-branches { display: grid; gap: 0; padding: 0 clamp(13px, 3vw, 31px); margin: 0; list-style: none; }
.relation-branch { display: grid; gap: 6px; padding-block: 16px 10px; }
.relation-branch + .relation-branch { border-top: 1px solid var(--line); }
.relation-track { display: grid; grid-template-columns: minmax(0, 1fr) minmax(5.4em, .65fr) minmax(0, 1fr); align-items: stretch; }
.relation-node { display: grid; gap: 2px; place-content: center; min-height: 60px; padding: 8px; text-align: center; background: var(--soft); border: 1px solid var(--outline); color: var(--accent); line-height: 1.35; overflow-wrap: anywhere; }
.relation-node:hover { background: var(--wash); border-color: var(--accent); }
.relation-node span { color: var(--muted); font-size: 12px; }
.relation-label { display: flex; align-items: center; justify-content: center; gap: 5px; color: var(--accent); text-align: center; font-size: 12px; font-weight: 650; }
.relation-label::before, .relation-label::after { content: ""; flex: 1; height: 1px; background: var(--outline); }
.relation-note { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0 16px; color: var(--muted); font-size: 14px; }
.atlas-return { margin-bottom: 9px; }

.period-rail { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); background: var(--paper-light); margin-bottom: 17px; }
.period { display: grid; gap: 2px; padding: 9px 14px; min-height: 59px; line-height: 1.45; color: var(--muted); }
.period + .period { border-left: 1px solid var(--line); }
.period strong { font-size: 16px; }
.period span { font-variant-numeric: tabular-nums; font-size: 12px; }
.period[aria-current] { background: var(--accent); color: var(--on-accent); }
.period:hover:not([aria-current]) { background: var(--soft); color: var(--accent); }
.topic-filter { display: flex; align-items: center; justify-content: space-between; gap: 6px 13px; flex-wrap: wrap; padding: 0 1px 6px; color: var(--muted); font-size: 14px; }
.atlas-search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 13px; margin-bottom: 16px; }
.atlas-search label { color: var(--accent); font-size: 14px; font-weight: 650; }
.atlas-search input { flex: 1 1 210px; min-width: 0; max-width: 360px; min-height: 44px; padding: 8px 11px; border: 1px solid var(--outline); background: var(--paper-light); color: var(--ink); font: inherit; }
.atlas-search input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.atlas-search-status { color: var(--muted); font-size: 13px; }
.atlas-search-results { display: grid; flex-basis: 100%; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 7px; margin: 0; padding: 0; list-style: none; }
.atlas-search-results:empty { display: none; }
.atlas-search-result { display: grid; gap: 1px; padding: 8px 11px; height: 100%; min-height: 44px; border: 1px solid var(--line); background: var(--paper-light); color: var(--accent); }
.atlas-search-result:hover { background: var(--soft); border-color: var(--outline); }
.atlas-search-result span { color: var(--muted); font-size: 13px; }
.atlas-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 17px; align-items: stretch; }
.atlas-canvas { position: relative; min-width: 0; display: flex; flex-direction: column; overflow-x: clip; border: 1px solid var(--line); background: var(--paper-light); }
.atlas-canvas-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; padding: 14px 17px; }
.atlas-canvas-head h2 { font-size: clamp(21px, 2.5vw, 30px); }
.atlas-canvas-head span { color: var(--muted); font-size: 13px; }
.map { position: relative; flex: 1; aspect-ratio: 2 / 1; min-height: 235px; margin: 0 11px; background: var(--map-bg); overflow: clip; }
.map > img { display: block; position: absolute; inset: 0; height: 100%; width: 100%; object-fit: fill; mix-blend-mode: var(--map-image-blend); opacity: var(--map-image-opacity); filter: var(--map-image-filter); }
.map-pin { position: absolute; top: var(--pin-y); left: var(--pin-x); transform: translate(-50%, -100%); min-height: 46px; display: grid; justify-items: center; gap: 3px; padding: 4px; }
.map-pin span { display: grid; place-items: center; background: var(--paper-light); border: 1px solid var(--outline); font-size: 12px; font-weight: 590; padding: 4px 7px; white-space: nowrap; }
.map-pin i { width: 10px; height: 10px; border: 2px solid var(--accent); border-radius: 50%; background: var(--paper-light); }
.map-pin[aria-current] span, .map-pin:hover span { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.map-pin[aria-current] i { background: var(--accent); outline: 2px solid var(--paper-light); }
.map-notes { padding: 8px 13px 13px; }
.map-notes p { color: var(--muted); margin-bottom: 6px; font-size: 12px; }
.map-notes .chip { font-size: 13px; }
.time-glyph { position: absolute; width: 126px; aspect-ratio: 1; top: 67px; right: min(8%, 40px); pointer-events: none; opacity: .65; }
.time-glyph span, .time-glyph i { position: absolute; border: 1px solid var(--outline); inset: 13%; border-radius: 50%; }
.time-glyph span { border-style: dashed; inset: 1%; }
.time-glyph i:nth-of-type(1) { inset: 22% 8%; transform: rotate(-28deg); }
.time-glyph i:nth-of-type(2) { inset: 9% 24%; transform: rotate(27deg); }
.time-glyph i:nth-of-type(3) { width: 6px; height: 6px; inset: 20% auto auto 79%; background: var(--accent); border-color: var(--accent); }
.time-focus { position: relative; z-index: 1; display: grid; gap: 3px; width: fit-content; max-width: 79%; margin: 22px 23px 10px; }
.time-focus > span { color: var(--accent); font-size: clamp(31px, 5vw, 58px); font-family: var(--serif); line-height: 1.1; }
.time-focus strong { color: var(--muted); font-size: 15px; }
.time-plot { --visible-lanes: var(--plot-lanes); position: relative; min-height: calc(var(--visible-lanes) * 44px + 28px); margin: auto 10px 0; }
.time-axis { position: absolute; inset: auto 8% 24px; height: 1px; background: var(--outline); }
.time-range { position: absolute; inset: auto 8% 0; display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.plot-point { --visible-lane: var(--point-lane); position: absolute; z-index: 1; left: var(--point-x); bottom: calc(25px + var(--visible-lane) * 44px); width: 44px; height: 44px; display: grid; place-items: center; transform: translateX(-50%); }
.plot-point::before { content: ""; position: absolute; z-index: -1; top: 50%; left: 50%; width: 1px; height: calc(22px + var(--visible-lane) * 44px); background: var(--line); }
.plot-point span { width: 9px; height: 9px; border: 1px solid var(--accent); border-radius: 50%; background: var(--paper); }
.plot-point[aria-current] span, .plot-point:hover span { background: var(--accent); outline: 1px solid var(--outline); outline-offset: 3px; }
/* 悬停时在点上方显示名字和年代。 */
.plot-point::after { content: attr(data-label); position: absolute; bottom: calc(100% - 4px); left: 50%; padding: 3px 8px; background: var(--ink); color: var(--paper); font-size: 12px; line-height: 1.5; white-space: nowrap; opacity: 0; transform: translate(-50%, 4px); pointer-events: none; transition: opacity 140ms ease, transform 140ms ease; }
.plot-point:hover { z-index: 3; }
.plot-point:hover::after { opacity: 1; transform: translate(-50%, 0); }
/* 靠近两端的点，提示框向内对齐，避免伸出画面。 */
.plot-point.tip-end::after { left: auto; right: 6px; transform: translateY(4px); }
.plot-point.tip-end:hover::after { transform: none; }
.plot-point.tip-start::after { left: 6px; transform: translateY(4px); }
.plot-point.tip-start:hover::after { transform: none; }
.plot-chips { padding: 2px 15px 15px; gap: 6px; }
.plot-chips .chip { gap: 6px; padding: 6px 10px; font-size: 13px; }
.plot-chips .chip span { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.plot-chips .chip[aria-current] span { color: inherit; opacity: .8; }
.time-controls { display: flex; justify-content: space-between; padding: 5px 15px 5px; min-height: 48px; }
.station { border: 1px solid var(--line); background: var(--soft); padding: clamp(17px, 3.6vw, 38px); }
.station h2 { font-size: clamp(30px, 3.7vw, 47px); margin-top: 9px; }
.station-person { margin-top: 13px; color: var(--accent); font-size: 16px; font-weight: 650; }
.station-person span { display: block; color: var(--muted); font-weight: 450; font-size: 13px; }
.source { border-top: 1px solid var(--outline); margin-top: 15px; padding: 9px 0 5px; }
.source p + p { font-size: 14px; }
.source-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin-top: 2px; }
.source-links .text-link { min-height: 44px; }
.station .button { display: flex; justify-content: space-between; width: fit-content; margin: 8px 0 0; text-align: left; }
.button-text { display: grid; gap: 1px; }
.button-text small { font-size: 12px; font-weight: 450; opacity: .82; }

@media (max-width: 1080px) {
  .recap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  :root { --hero-title-size: clamp(47px, 8.4vw, 65px); --intro-size: clamp(27px, 7vw, 46px); }
  html { scroll-padding-top: 84px; }
  .head-inner { height: 60px; }
  /* 窄屏上把画面收成顶部一条横幅。竖长的宿主会让 cover 只剩四成画幅，
     人物与岔道正好压在标题背后；改成横幅后画幅宽了，人物与岔道留在横幅上半，
     标题落在下面的纸面上。横幅高度由 --hero-band-h 调整。 */
  .home { --hero-band-h: 264px; min-height: min(685px, max(536px, 76svh)); align-items: end; }
  .hero-visual { inset: 0 0 auto 0; height: var(--hero-band-h); }
  .hero-artwork { inset: -16px -16px auto; height: calc(var(--hero-band-h) + 16px); transform-origin: 57% 62%; }
  .hero-art { object-position: 58% 50%; }
  .hero-veil { background: var(--hero-veil-narrow); }
  /* 横幅下缘始终化进纸里：开场时画面还在显影，也不能留一条硬边。 */
  .home.is-intro .hero-veil { opacity: 1; }
  .home.is-moving .hero-veil { animation: none; }
  /* 文案区始终排在横幅之下：文案变长时首屏跟着长高，不会压到画面上。 */
  .hero-inner { margin: 0 auto; padding: calc(var(--hero-band-h) + 20px) var(--gutter) 31px; }
  .hero-copy h1 { max-width: 430px; }
  .hero-description { color: var(--ink); }
  .home-guide { padding-block: 9px; gap: 1px; }
  .lab { padding-top: 14px; }
  .lab-active { padding-bottom: 22px; }
  .lab-progress { font-size: 12px; }
  .lab-active .layer-step { width: 18px; height: 18px; font-size: 10px; }
  .decision { padding: 14px; margin-top: 10px; }
  .decision h1 { margin-bottom: 10px; }
  .scene { padding: 10px 11px; margin-bottom: 10px; }
  .atlas-grid, .recap-grid, .experiment-grid { grid-template-columns: minmax(0, 1fr); }
  .map { min-height: 215px; }
  .perspectives { grid-template-columns: minmax(0, 1fr); }
  .perspective + .perspective { border-left: 0; border-top: 1px solid var(--line); }
  .answer-trail { grid-template-columns: 1fr; }
  .trail-arrow { display: none; }
  .atlas-canvas-head { padding-inline: 12px; }
  .time-glyph { right: 13px; width: 102px; }
  .time-plot { --visible-lanes: var(--plot-narrow); }
  .plot-point { --visible-lane: var(--point-narrow); }
}

@media (max-width: 400px) {
  .head-inner { gap: 8px; }
  .brand { font-size: 19px; gap: 7px; }
  .hero-copy h1 { margin-top: 12px; }
  .guide-path { gap: 6px; font-size: 12px; }
  .guide-path i { width: 11px; }
  .period { padding-inline: 7px; }
  .period span { font-size: 12px; letter-spacing: -.02em; }
  .map-pin span { padding-inline: 4px; font-size: 12px; }
  .layer-rail { gap: 3px; }
  .relation-node { padding-inline: 4px; font-size: 14px; }
  .relation-label { gap: 3px; }
}

/* 选择后的撤销提示：贴在视口底部，底边细线显示剩余时间，悬停或聚焦时暂停。 */
.undo-toast { position: fixed; z-index: 30; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 4px 14px; max-width: min(560px, calc(100vw - 24px)); padding: 6px 6px 6px 16px; overflow: hidden; background: var(--ink); color: var(--paper); box-shadow: 0 10px 30px rgb(0 0 0 / .18); transform: translateX(-50%); animation: toast-in 260ms cubic-bezier(.22, .68, .24, 1) both; }
.undo-toast[hidden] { display: none; }
.undo-toast.is-leaving { animation: toast-out 200ms ease-in both; }
.undo-toast p { min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.undo-button { flex: none; min-height: 40px; padding: 6px 14px; border: 1px solid rgb(var(--paper-rgb) / .4); background: transparent; color: inherit; font-size: 14px; font-weight: 650; }
.undo-button:hover { background: rgb(var(--paper-rgb) / .12); }
.undo-button:focus-visible { outline-color: var(--paper); outline-offset: 2px; }
.undo-timer { position: absolute; inset: auto 0 0; height: 2px; background: var(--paper); opacity: .45; transform-origin: left; animation: undo-timer 6000ms linear both; }
.undo-toast.is-paused .undo-timer { animation-play-state: paused; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, 8px); } }
@keyframes undo-timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* 页面之间的交叉淡入（支持 View Transitions 的浏览器）。 */
/* 页眉与撤销提示单独成层，切页时保持不动。 */
.site-head { view-transition-name: site-head; }
.undo-toast { view-transition-name: undo-toast; }
::view-transition-group(site-head), ::view-transition-group(undo-toast) { animation: none; }
::view-transition-old(site-head), ::view-transition-old(undo-toast) { display: none; }
::view-transition-new(site-head), ::view-transition-new(undo-toast) { animation: none; }
::view-transition-old(root) { animation: 160ms ease-in both vt-out; }
::view-transition-new(root) { animation: 260ms cubic-bezier(.22, .68, .24, 1) both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
