/* 罗定学宫数字展馆 V1.0
 * 顶部、底部沿用系列母版（见 docs/场馆前端设计规范.md），pavilion-shell.css 在本文件之后加载。
 * 本馆主题：旧砖红 + 琉璃绿，纸色底；夜间模式重新校正文字与边线。
 */
:root {
  color-scheme: light;
  --paper: #f2efe7;
  --paper-deep: #e8e3d7;
  --ink: #272a25;
  --muted: #64685f;
  --accent: #9b4535;
  --accent-dark: #7f3528;
  --secondary: #4e6a5a;
  --gold: #9c8458;
  --line: rgba(70, 72, 58, .17);
  --line-strong: rgba(70, 72, 58, .34);
  --surface: rgba(250, 248, 242, .84);
  --surface-solid: #f8f6f0;
  --shadow: 0 16px 48px rgba(60, 48, 30, .08);
  --stage-sky: #dedcd3;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Noto Serif SC", "SimSun", serif;
  --sans: "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --latin: Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --gutter: 5.25%;
}
html[data-theme=night] {
  color-scheme: dark;
  --paper: #171d21;
  --paper-deep: #20282d;
  --ink: #e4e2d8;
  --muted: #a5aea9;
  --accent: #d69a84;
  --accent-dark: #e2b09c;
  --secondary: #9fbcab;
  --gold: #c7b088;
  --line: rgba(206, 214, 206, .15);
  --line-strong: rgba(206, 214, 206, .3);
  --surface: rgba(28, 36, 41, .84);
  --surface-solid: #1d252a;
  --shadow: 0 16px 48px rgba(0, 0, 0, .25);
  --stage-sky: #252c31;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.9 var(--sans);
  overflow-x: hidden;
  transition: background-color .3s ease, color .3s ease;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 22px; top: -100px; z-index: 600; background: var(--paper); padding: 10px 20px; border: 1px solid var(--accent); }
.skip:focus { top: 12px; }
main:focus { outline: none; }

/* ---------- 顶部（系列母版；中等宽度与手机按长岗坡已验证规则） ---------- */
.site-header { height: 105px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 13px; flex-shrink: 0; white-space: nowrap; }
.brand-seal { width: 49px; height: 62px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: 2px; background: var(--accent); }
html[data-theme=night] .brand-seal { background: #a8604f; }
.brand-seal .brand-symbol { width: 49px; height: 61px; color: #f7f0e2; stroke-width: 1.3; overflow: visible; }
.brand-name { font-family: var(--serif); font-size: 24px; letter-spacing: 3.3px; line-height: 1.3; white-space: nowrap; }
.brand-name small { display: block; font: 8px/1.4 var(--latin); letter-spacing: 2.15px; margin-top: 7px; color: var(--muted); }
.brand-dot { display: inline-block; width: 3px; height: 3px; margin: 0 9px 6px 7px; background: var(--accent); transform: rotate(45deg); }
.desktop-nav { display: flex; align-items: center; gap: 36px; }
.nav-link { position: relative; font-size: 13px; letter-spacing: 1.5px; white-space: nowrap; min-height: 44px; padding: 12px 0; transition: color .2s ease; }
.nav-link::after { content: ""; height: 3px; width: 3px; border-radius: 50%; background: var(--accent); position: absolute; bottom: 4px; left: 50%; opacity: 0; transition: opacity .2s ease; }
.nav-link.active, .nav-link:hover { color: var(--accent); }
.nav-link.active::after { opacity: 1; }
.header-right { display: flex; align-items: center; gap: 20px; flex-shrink: 0; white-space: nowrap; }
.museum-label { font-size: 10px; letter-spacing: 1.3px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.live-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--secondary); display: inline-block; }
.header-home, .about-button { display: flex; align-items: center; gap: 7px; min-width: 44px; font-size: 12px; min-height: 44px; white-space: nowrap; transition: color .2s ease; }
.header-home:hover, .about-button:hover { color: var(--accent); }
.header-home svg { width: 14px; height: 14px; flex: 0 0 14px; }
.about-button { padding: 0 0 0 18px; position: relative; }
.about-button::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 1px; background: var(--line); }
.about-button svg { width: 15px; height: 15px; }

/* ---------- 首屏与展台 ---------- */
.hero { position: relative; }
.hero-copy {
  position: absolute;
  z-index: 4;
  top: clamp(28px, 5.5vh, 56px);
  left: var(--gutter);
  max-width: 520px;
  pointer-events: none;
}
.hero-copy > * { pointer-events: auto; }
.hero-copy { transition: opacity .5s var(--ease), transform .5s var(--ease); }
@media (min-width: 701px) {
  .hero.is-focused .hero-copy { opacity: 0; transform: translateY(-10px); pointer-events: none; }
  .hero.is-focused .hero-copy > * { pointer-events: none; }
  .hero.is-focused .stage-shade { background: linear-gradient(to bottom, var(--paper) 0, color-mix(in srgb, var(--paper) 40%, transparent) 50px, transparent 130px), linear-gradient(to top, var(--paper) 0, transparent 110px); }
}
.eyebrow { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; color: var(--secondary); font-size: 11px; letter-spacing: .16em; }
.eyebrow > span { width: 30px; height: 1px; background: var(--accent); }
h1 { margin: 0; font: 400 clamp(64px, 6.4vw, 92px)/1.02 var(--serif); letter-spacing: .06em; }
h1 span { color: var(--accent); }
.english { margin: 12px 0 0 4px; font: 10px/1.4 var(--latin); letter-spacing: .32em; color: var(--muted); }
.hero-lead { margin: 22px 0 0; padding-left: 16px; border-left: 1px solid var(--gold); font: 17px/1.95 var(--serif); letter-spacing: .06em; }
.model-flag { display: inline-flex; align-items: center; gap: 10px; margin: 20px 0 0; font-size: 11px; letter-spacing: .08em; color: var(--muted); }
.model-flag span, .data-tag, .tier-tag {
  display: inline-block; padding: 2px 8px; border: 1px solid rgba(155, 69, 53, .32); color: var(--accent);
  font-size: 10px; letter-spacing: .12em; line-height: 1.7; border-radius: 2px; white-space: nowrap;
}
html[data-theme=night] .model-flag span, html[data-theme=night] .data-tag, html[data-theme=night] .tier-tag { border-color: rgba(214, 154, 132, .4); }

.stage {
  position: relative;
  height: calc(100svh - var(--pavilion-header-height, 105px));
  min-height: 620px;
  max-height: 1000px;
  overflow: hidden;
  background: var(--stage-sky);
  isolation: isolate;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.stage-poster {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0;
  filter: saturate(.9); transition: opacity .9s var(--ease), filter .9s var(--ease);
}
.stage[data-state=loading] .stage-poster, .stage[data-state=waiting] .stage-poster, .stage[data-state=error] .stage-poster { filter: saturate(.75) blur(2px); opacity: .55; }
html[data-theme=night] .stage-poster { opacity: .35; }
#xuegong-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 1; opacity: 0; transition: opacity .9s var(--ease); cursor: grab; outline: none; }
#xuegong-canvas:active { cursor: grabbing; }
#xuegong-canvas:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.stage[data-state=ready] #xuegong-canvas { opacity: 1; }
.stage[data-state=ready] .stage-poster { opacity: 0; }
/* 顶部和底部与纸色渐融，展台不出现边框。 */
.stage-shade { position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    linear-gradient(to bottom, var(--paper) 0, color-mix(in srgb, var(--paper) 55%, transparent) 70px, transparent 190px),
    linear-gradient(to top, var(--paper) 0, color-mix(in srgb, var(--paper) 50%, transparent) 46px, transparent 150px),
    linear-gradient(to right, color-mix(in srgb, var(--paper) 78%, transparent) 0, color-mix(in srgb, var(--paper) 40%, transparent) 26%, transparent 44%);
}

/* 载入 */
.loader {
  position: absolute; z-index: 6; left: 50%; top: 52%; transform: translate(-50%, -50%);
  width: min(360px, calc(100% - 44px)); padding: 28px 30px 24px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: opacity .5s ease, transform .5s var(--ease);
}
.stage[data-state=ready] .loader { opacity: 0; transform: translate(-50%, -46%); pointer-events: none; }
.loader[hidden] { display: none; }
.loader-mark { width: 38px; height: 48px; color: var(--accent); stroke-width: 1.2; }
.loader-mark use { stroke-dasharray: 260; stroke-dashoffset: 0; }
.stage[data-state=loading] .loader-mark use { animation: trace 3.2s ease-in-out infinite; }
@keyframes trace { 0% { stroke-dashoffset: 260; } 55% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -260; } }
.loader-title { margin: 12px 0 14px; font: 18px/1.5 var(--serif); letter-spacing: .1em; }
.loader-bar { height: 2px; background: var(--line); overflow: hidden; border-radius: 1px; }
.loader-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s linear; }
.stage[data-state=decoding] .loader-bar span { width: 100% !important; animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .45; } }
.loader-meta { margin: 10px 0 0; font: 12px/1.6 var(--latin); color: var(--ink); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.loader-note { margin: 4px 0 0; font-size: 11px; line-height: 1.8; color: var(--muted); }
.primary-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; margin-top: 16px; padding: 0 22px;
  background: var(--accent); color: #fbf6ec; border: 1px solid var(--accent); border-radius: 3px; font-size: 13px; letter-spacing: .1em;
  transition: background-color .2s ease, transform .15s ease;
}
html[data-theme=night] .primary-button { color: #1b1f22; }
.primary-button:hover { background: var(--accent-dark); }
.primary-button:active { transform: translateY(1px); }
.primary-button[hidden] { display: none; }

/* 控件基础 */
.views, .gates, .tools, .info-card, .advanced, .stage-hint, .stage-flag, .mobile-bar, .hotspots, .toast { z-index: 5; }
.stage:not([data-state=ready]) .views, .stage:not([data-state=ready]) .gates, .stage:not([data-state=ready]) .tools,
.stage:not([data-state=ready]) .stage-hint, .stage:not([data-state=ready]) .mobile-bar { opacity: 0; pointer-events: none; }
.views, .gates, .tools, .stage-hint, .mobile-bar { transition: opacity .6s ease .2s; }
.glass, .views, .gates, .tools, .info-card, .advanced {
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(50, 42, 28, .07);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}

/* 视角 */
.views { position: absolute; left: var(--gutter); bottom: 38px; display: flex; padding: 3px; border-radius: 4px; }
.view-button {
  position: relative; min-height: 40px; padding: 0 14px; font-size: 13px; letter-spacing: .08em; white-space: nowrap; border-radius: 2px;
  color: var(--ink); transition: color .2s ease, background-color .2s ease;
}
.view-button + .view-button::before { content: ""; position: absolute; left: 0; top: 13px; bottom: 13px; width: 1px; background: var(--line); }
.view-button:hover { background: rgba(155, 69, 53, .06); color: var(--accent); }
.view-button[aria-current=true] { color: var(--accent); }
.view-button[aria-current=true]::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 14px; height: 1px; margin-left: -7px; background: var(--accent); }
.view-button:active { transform: translateY(1px); }

/* 开门 */
.gates { position: absolute; right: var(--gutter); bottom: 38px; display: flex; align-items: center; padding: 3px 3px 3px 14px; border-radius: 4px; gap: 2px; }
.gates-label { display: inline-flex; align-items: center; gap: 7px; margin-right: 8px; font-size: 12px; letter-spacing: .1em; color: var(--muted); white-space: nowrap; }
.gates-label svg { width: 16px; height: 16px; }
.gates-label small { font-size: 10px; letter-spacing: .06em; opacity: .8; }
.gate-button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; font-size: 13px; letter-spacing: .06em; border-radius: 2px;
  white-space: nowrap; transition: color .2s ease, background-color .2s ease;
}
.gate-button svg { width: 15px; height: 15px; }
.gate-button .open-icon { display: none; }
.gate-button[aria-pressed=true] { background: rgba(155, 69, 53, .1); color: var(--accent); }
html[data-theme=night] .gate-button[aria-pressed=true] { background: rgba(214, 154, 132, .13); }
.gate-button[aria-pressed=true] .open-icon { display: inline; }
.gate-button[aria-pressed=true] .closed-icon { display: none; }
.gate-button:hover { color: var(--accent); }
.gate-button:active { transform: translateY(1px); }
.gate-all { border-left: 1px solid var(--line); margin-left: 4px; padding-left: 14px; border-radius: 0 2px 2px 0; }

/* 工具栏 */
.tools { position: absolute; right: var(--gutter); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 2px; padding: 5px 4px; border-radius: 24px; }
.tool { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); transition: background-color .2s ease, color .2s ease, transform .15s ease; }
.tool svg { width: 19px; height: 19px; }
.tool:hover { background: rgba(155, 69, 53, .08); color: var(--accent); }
.tool:active { transform: scale(.93); }
.tool[aria-pressed=true], .tool[aria-expanded=true] { color: var(--accent); background: rgba(155, 69, 53, .1); }
.tool[data-tool=labels][aria-pressed=true] { background: transparent; }
.tool .when-night, .tool .when-full { display: none; }
html[data-theme=night] .tool .when-night { display: block; }
html[data-theme=night] .tool .when-day { display: none; }
.stage.is-full .tool .when-full { display: block; }
.stage.is-full .tool .when-normal { display: none; }
.tool-tip {
  position: absolute; right: calc(100% + 10px); top: 50%; transform: translate(4px, -50%); padding: 3px 9px; border-radius: 2px;
  background: var(--ink); color: var(--paper); font-size: 11px; letter-spacing: .06em; line-height: 1.7; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease;
}
.tool:hover .tool-tip, .tool:focus-visible .tool-tip { opacity: 1; transform: translate(0, -50%); }

/* 热点 */
.hotspots { position: absolute; inset: 0; pointer-events: none; }
.hotspot {
  position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; pointer-events: auto;
  transform: translate3d(var(--x, -999px), var(--y, -999px), 0) translate(-50%, -100%); transition: opacity .25s ease; will-change: transform;
}
.hotspot[data-hidden=true] { opacity: 0; pointer-events: none; visibility: hidden; transition: opacity .2s ease, visibility 0s linear .2s; }
.hs-name {
  padding: 2px 9px; border: 1px solid var(--line-strong); border-radius: 2px; background: var(--surface);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font: 12px/1.75 var(--serif); letter-spacing: .1em; white-space: nowrap; color: var(--ink);
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.hs-name small { margin-left: 5px; font: 10px/1 var(--sans); color: var(--muted); letter-spacing: .04em; }
.hotspot[data-kind=schematic] .hs-name { border-style: dashed; }
.hs-dot { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--accent); background: var(--paper); box-shadow: 0 0 0 3px rgba(155, 69, 53, .14); }
.hs-stem { width: 1px; height: 10px; background: var(--line-strong); margin: -5px 0 -5px; }
.hotspot:hover .hs-name, .hotspot:focus-visible .hs-name, .hotspot[aria-expanded=true] .hs-name { background: var(--accent); border-color: var(--accent); color: #fbf6ec; }
html[data-theme=night] .hotspot:hover .hs-name, html[data-theme=night] .hotspot:focus-visible .hs-name, html[data-theme=night] .hotspot[aria-expanded=true] .hs-name { color: #1b1f22; }
.hotspot:hover .hs-name small, .hotspot[aria-expanded=true] .hs-name small { color: inherit; opacity: .8; }
.hotspot:focus-visible { outline: none; }

/* 建筑说明卡 */
.info-card {
  position: absolute; right: calc(var(--gutter) + 64px); top: 50%; transform: translateY(-50%); width: 330px; max-height: calc(100% - 140px); overflow: auto;
  padding: 22px 24px 20px; border-radius: 4px; animation: card-in .35s var(--ease);
}
.info-card[hidden] { display: none; }
@keyframes card-in { from { opacity: 0; transform: translate(10px, -50%); } }
.info-close { position: absolute; right: 10px; top: 10px; }
.info-tags { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.info-kicker { font-size: 10px; letter-spacing: .14em; color: var(--muted); }
.tier-tag[data-tier=schematic] { color: var(--secondary); border-color: rgba(78, 106, 90, .4); border-style: dashed; }
.tier-tag[data-tier=modern] { color: var(--gold); border-color: rgba(156, 132, 88, .5); }
.info-card h2 { margin: 0 0 8px; font: 400 26px/1.4 var(--serif); letter-spacing: .1em; }
.info-text { margin: 0; font-size: 13px; line-height: 1.95; }
.info-caution { margin: 14px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.85; color: var(--muted); }
.info-caution strong { display: block; margin-bottom: 2px; font-weight: 400; font-size: 11px; letter-spacing: .12em; color: var(--secondary); }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); transition: background-color .2s ease, color .2s ease; }
.icon-button svg { width: 17px; height: 17px; }
.icon-button:hover { background: rgba(155, 69, 53, .08); color: var(--accent); }

/* 高级面板 */
.advanced {
  position: absolute; right: calc(var(--gutter) + 64px); top: 50%; transform: translateY(-50%); width: 300px; max-height: calc(100% - 120px); overflow: auto;
  padding: 16px 20px 18px; border-radius: 4px; animation: card-in .3s var(--ease);
}
.advanced[hidden] { display: none; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.panel-head h2 { margin: 0; font: 400 18px/1.5 var(--serif); letter-spacing: .14em; }
fieldset { margin: 10px 0 0; padding: 10px 0 0; border: 0; border-top: 1px solid var(--line); min-width: 0; }
legend { padding: 0; margin-bottom: 4px; font-size: 10px; letter-spacing: .16em; color: var(--muted); float: left; width: 100%; }
legend + * { clear: both; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 38px; font-size: 13px; cursor: pointer; }
.switch span { display: flex; flex-direction: column; line-height: 1.45; }
.switch small { font-size: 10px; color: var(--muted); }
.switch input {
  appearance: none; -webkit-appearance: none; order: 2; flex: 0 0 30px; width: 30px; height: 18px; margin: 0; border-radius: 9px; position: relative;
  background: var(--line-strong); cursor: pointer; transition: background-color .2s ease;
}
.switch input::after { content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface-solid); transition: transform .2s var(--ease); box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(12px); }
.segmented { display: flex; border: 1px solid var(--line); border-radius: 3px; padding: 2px; margin-top: 6px; }
.segmented button { flex: 1; min-height: 34px; font-size: 12px; letter-spacing: .08em; border-radius: 2px; transition: background-color .2s ease, color .2s ease; }
.segmented button:hover { color: var(--accent); }
.segmented button[aria-checked=true] { background: var(--accent); color: #fbf6ec; }
html[data-theme=night] .segmented button[aria-checked=true] { color: #1b1f22; }
.panel-status { margin: 8px 0 0; font-size: 11px; line-height: 1.7; color: var(--muted); }

/* 提示、声明、提示条 */
.stage-hint { position: absolute; left: 50%; top: 22px; transform: translateX(-50%); margin: 0; font-size: 11px; letter-spacing: .1em; color: var(--muted); white-space: nowrap; pointer-events: none; }
.stage.has-interacted .stage-hint { opacity: 0 !important; transition: opacity .8s ease; }
.hint-touch { display: none; }
@media (pointer: coarse) { .hint-touch { display: inline; } .hint-desktop { display: none; } }
.stage-flag { position: absolute; right: var(--gutter); bottom: 12px; margin: 0; font-size: 10px; letter-spacing: .14em; color: var(--muted); pointer-events: none; }
.toast { position: absolute; left: 50%; bottom: 100px; transform: translateX(-50%); padding: 8px 16px; border-radius: 3px; background: var(--ink); color: var(--paper); font-size: 12px; letter-spacing: .06em; white-space: nowrap; animation: toast-in .3s var(--ease); }
.toast[hidden] { display: none; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 6px); } }
.mobile-bar { display: none; }

/* 全屏（无全屏接口的浏览器用沉浸模式） */
.stage:fullscreen { height: 100vh; max-height: none; }
.stage.is-immersive { position: fixed; inset: 0; z-index: 400; height: 100dvh; max-height: none; min-height: 0; }
.stage.is-full .stage-shade { background: none; }

/* ---------- 正文 ---------- */
.wrap { max-width: 1480px; margin: 0 auto; padding-inline: 6.7%; }
.facts { padding-block: 34px 30px; }
.facts dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin: 0; padding: 26px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts dl > div { padding-left: 18px; border-left: 1px solid var(--line); }
.facts dl > div:first-child { border-left: 0; padding-left: 0; }
.facts dt { font-size: 11px; letter-spacing: .16em; color: var(--muted); }
.facts dd { margin: 6px 0 0; }
.facts strong { display: block; font: 400 26px/1.3 var(--serif); letter-spacing: .06em; }
.facts strong.num { font: 400 34px/1.15 var(--latin); letter-spacing: .02em; }
.facts dd span { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.facts-source { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 14px 0 0; font-size: 11px; line-height: 1.8; color: var(--muted); }
.text-link { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; color: var(--accent); font-size: 12px; letter-spacing: .1em; transition: gap .2s ease, color .2s ease; }
.text-link svg { width: 15px; height: 15px; }
.text-link:hover { gap: 11px; color: var(--accent-dark); }

.chapter-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px 64px; align-items: end; margin-bottom: 34px; }
.chapter-head .kicker { grid-column: 1 / -1; margin: 0; }
.kicker { font: 10px/1.4 var(--latin); letter-spacing: .26em; color: var(--accent); }
.chapter-head h2 { margin: 0; font: 400 clamp(30px, 3vw, 40px)/1.35 var(--serif); letter-spacing: .1em; }
.chapter-head > p:last-child { margin: 0; max-width: 560px; font-size: 14px; line-height: 2.05; color: var(--muted); }
.axis { padding-block: 72px 40px; }
.plan-figure { margin: 0 0 40px; padding: 30px 0 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.axis-plan { display: block; width: 100%; max-width: 940px; height: auto; margin: 0 auto; }
.plan-wall { fill: none; stroke: var(--line-strong); stroke-width: 1.4; }
.plan-axis { stroke: var(--accent); stroke-width: 1; stroke-dasharray: 2 6; opacity: .7; }
.plan-fit { fill: rgba(155, 69, 53, .08); stroke: var(--accent); stroke-width: 1.2; }
.plan-gate { fill: var(--accent); stroke: none; }
.plan-schematic { fill: none; stroke: var(--secondary); stroke-width: 1.1; stroke-dasharray: 5 4; }
.plan-water { fill: rgba(78, 106, 90, .14); stroke: var(--secondary); stroke-width: 1.1; }
.plan-bridge { fill: var(--paper); stroke: var(--secondary); stroke-width: 1; }
.plan-num circle { fill: var(--paper); stroke: var(--accent); stroke-width: 1; }
.plan-num text { font: 12px var(--latin); fill: var(--accent); stroke: none; text-anchor: middle; }
.plan-dir { font: 14px var(--serif); fill: var(--muted); stroke: none; letter-spacing: .1em; }
.plan-arrow { stroke: var(--muted); stroke-width: 1.2; }
.plan-figure figcaption { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 18px; margin-top: 14px; font-size: 11px; color: var(--muted); text-align: center; }
.legend { display: inline-flex; align-items: center; gap: 7px; }
.legend::before { content: ""; width: 16px; height: 9px; }
.legend-fit::before { background: rgba(155, 69, 53, .08); border: 1px solid var(--accent); }
.legend-schematic::before { border: 1px dashed var(--secondary); }

.stops { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0 48px; }
.stops li { position: relative; padding: 24px 0 22px; border-top: 1px solid var(--line); display: flex; flex-direction: column; }
.stop-num { font: 13px/1 var(--latin); letter-spacing: .14em; color: var(--accent); }
.stops h3 { margin: 12px 0 8px; font: 400 23px/1.4 var(--serif); letter-spacing: .1em; }
.stops p { margin: 0; font-size: 14px; line-height: 2; }
.stops .stop-caution { margin-top: 8px; font-size: 12px; line-height: 1.85; color: var(--muted); }
.stops .text-link { margin-top: auto; padding-top: 12px; align-self: flex-start; }

.model { padding-block: 64px 80px; }
.model-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 40px; }
.model-grid article { padding-top: 22px; border-top: 1px solid var(--line); }
.model-grid h3, .visit-note h3 { margin: 0 0 10px; font: 400 21px/1.45 var(--serif); letter-spacing: .1em; }
.model-grid p, .visit-note p { margin: 0; font-size: 13px; line-height: 2; color: var(--muted); }
.grade-bar { display: flex; height: 6px; margin-top: 16px; gap: 2px; }
.grade-bar span { display: block; border-radius: 1px; }
.grade-a { background: var(--secondary); }
.grade-b { background: color-mix(in srgb, var(--secondary) 55%, var(--paper)); }
.grade-c { background: color-mix(in srgb, var(--gold) 45%, var(--paper)); }
.grade-legend { display: flex; gap: 16px; margin-top: 8px !important; font: 11px var(--latin) !important; }
.grade-legend i { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 1px; vertical-align: 0; }
.visit-note { margin-top: 48px; padding: 22px 26px; border-left: 2px solid var(--gold); background: color-mix(in srgb, var(--paper-deep) 55%, transparent); }

/* ---------- 底部（系列母版） ---------- */
.site-footer { margin: 0 var(--gutter); padding: 26px 0 25px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.footer-wordmark { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; font: 20px/1.5 var(--serif); letter-spacing: 2px; }
.footer-mark { width: 34px; height: 43px; color: var(--accent); stroke-width: 1.3; }
.footer-wordmark > span small { display: block; font: 7px/1.4 var(--latin); letter-spacing: 2px; margin-top: 5px; color: var(--muted); }
.footer-motto { font-size: 11px; letter-spacing: 1.5px; color: var(--muted); }
.footer-source { display: flex; align-items: center; gap: 12px; font-size: 11px; color: var(--muted); letter-spacing: 1px; min-height: 44px; transition: color .2s ease; }
.footer-source:hover { color: var(--accent); }
.footer-source svg { width: 15px; height: 15px; }
.footer-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; width: 100%; }
.footer-links { display: flex; align-items: center; gap: 24px; }
.footer-home-link { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; font-size: 11px; line-height: 1.5; color: var(--muted); transition: color .2s ease; }
.footer-home-link:hover { color: var(--accent); }
.footer-home-link svg { width: 13px; height: 13px; }
.footer-meta > small { font-size: 10px; line-height: 1.9; color: var(--muted); text-align: right; max-width: 680px; }
.footer-break { display: none; }

/* ---------- 弹窗 ---------- */
.about-dialog {
  width: min(680px, calc(100% - 32px)); max-height: min(86dvh, 860px); padding: 0; border: 1px solid var(--line); border-radius: 4px;
  background: var(--surface-solid); color: var(--ink); box-shadow: 0 24px 80px rgba(30, 24, 14, .22); overflow: auto;
}
.about-dialog::backdrop { background: rgba(25, 27, 24, .42); }
.about-dialog[open] { animation: dialog-in .3s var(--ease); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px); } }
.dialog-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 28px 14px; background: var(--surface-solid); border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 6px 0 0; font: 400 26px/1.4 var(--serif); letter-spacing: .1em; }
.dialog-body { padding: 18px 28px 26px; font-size: 14px; line-height: 2; }
.dialog-body p { margin: 0 0 10px; }
.dialog-lead { font: 19px/1.8 var(--serif); letter-spacing: .06em; }
.dialog-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.dialog-section h3 { margin: 10px 0 6px; font: 400 20px/1.5 var(--serif); letter-spacing: .08em; }
.source-list { list-style: none; margin: 0; padding: 0; }
.source-list li { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.source-list a { display: inline-flex; align-items: baseline; gap: 8px; color: var(--accent); }
.source-list a svg { width: 13px; height: 13px; flex: 0 0 13px; align-self: center; }
.source-list p { margin: 4px 0 0 34px; font-size: 12px; line-height: 1.8; color: var(--muted); }
.source-number { font: 12px var(--latin); letter-spacing: .1em; }
.dialog-note, .dialog-foot { font-size: 12px; color: var(--muted); }
.dialog-foot { margin-top: 20px !important; }
.dialog-foot a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* 手机抽屉 */
.sheet-backdrop { position: fixed; inset: 0; z-index: 480; background: rgba(25, 27, 24, .38); animation: fade-in .25s ease; }
.sheet-backdrop[hidden], .sheet[hidden] { display: none; }
@keyframes fade-in { from { opacity: 0; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 490; max-height: 82dvh; overflow: auto;
  padding: 8px 22px calc(18px + env(safe-area-inset-bottom)); background: var(--surface-solid); border-top: 1px solid var(--line);
  border-radius: 4px 4px 0 0; box-shadow: 0 -16px 50px rgba(30, 24, 14, .16); animation: sheet-in .32s var(--ease);
}
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
.sheet-handle { width: 36px; height: 3px; margin: 2px auto 10px; border-radius: 2px; background: var(--line-strong); }
.sheet-views { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.sheet-view { display: flex; flex-direction: column; align-items: flex-start; min-height: 58px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 3px; text-align: left; transition: border-color .2s ease, background-color .2s ease; }
.sheet-view strong { font: 400 16px/1.5 var(--serif); letter-spacing: .1em; }
.sheet-view small { font-size: 11px; line-height: 1.5; color: var(--muted); }
.sheet-view[aria-current=true] { border-color: var(--accent); background: rgba(155, 69, 53, .06); }
.sheet-view[aria-current=true] strong { color: var(--accent); }
.sheet-view:active { transform: translateY(1px); }
.sheet-gates { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.sheet-gates::before { content: "开门 · 数字讲解"; grid-column: 1 / -1; font-size: 11px; letter-spacing: .14em; color: var(--muted); }
.sheet-gates .gate-button { justify-content: center; min-height: 44px; padding: 0 6px; border: 1px solid var(--line); font-size: 13px; }
.sheet-gates .gate-all { margin-left: 0; padding-left: 6px; border-left: 1px solid var(--line); border-radius: 2px; }
.sheet[data-mode=gates] .sheet-views { display: none; }
.sheet[data-mode=gates] .sheet-gates { margin-top: 6px; padding-top: 0; border-top: 0; }
.noscript { margin: 0; padding: 14px var(--gutter); background: var(--paper-deep); font-size: 13px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1150px) {
  .site-header { height: 93px; gap: 20px; }
  .brand-seal, .brand-seal .brand-symbol { width: 44px; height: 55px; }
  .brand-name { font-size: 22px; letter-spacing: 2.8px; }
  .brand-name small { font-size: 7px; letter-spacing: 2px; }
  .brand-dot { margin-left: 5px; margin-right: 8px; }
  .desktop-nav { gap: 24px; }
  .nav-link { font-size: 12px; letter-spacing: 1px; }
  .header-right { gap: 18px; }
  .header-right .museum-label { display: none; }
  .header-home, .about-button { font-size: 11px; }
  h1 { font-size: 66px; }
  .hero-lead { font-size: 16px; }
  .views { bottom: 92px; }
  .gates { right: auto; left: var(--gutter); }
  .model-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 36px; }
  .model-grid article { padding-bottom: 24px; }
  .facts dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts dl > div:nth-child(3) { border-left: 0; padding-left: 0; }
}
@media (max-width: 850px) {
  .site-header { gap: 16px; }
  .brand { gap: 10px; }
  .brand-name { font-size: 21px; letter-spacing: 2px; }
  .desktop-nav { gap: 14px; }
  .nav-link { font-size: 11px; letter-spacing: 0; }
  .header-right { gap: 12px; }
  .header-home, .about-button { font-size: 10px; }
  .about-button { padding-left: 12px; gap: 4px; }
  .about-button svg { width: 12px; height: 12px; }
  .chapter-head { grid-template-columns: 1fr; }
  .info-card, .advanced { right: calc(var(--gutter) + 56px); width: 300px; }
  .views { overflow-x: auto; max-width: calc(100% - 2 * var(--gutter)); scrollbar-width: none; }
  .views::-webkit-scrollbar { display: none; }
  .view-button { padding: 0 11px; font-size: 12px; }
}
@media (max-width: 700px) {
  :root { --gutter: 22px; }
  .site-header { height: 79px; gap: 12px; }
  .brand-seal, .brand-seal .brand-symbol { width: 38px; height: 48px; }
  .brand-name { font-size: 21px; letter-spacing: 2.7px; }
  .brand-name small { font-size: 6.5px; letter-spacing: 1.8px; margin-top: 5px; }
  .brand-place, .brand-dot { display: none; }
  .header-right { gap: 12px; margin-left: auto; }
  .header-home, .about-button { font-size: 10px; min-height: 44px; min-width: 44px; justify-content: center; }
  .header-home { gap: 3px; }
  .header-home svg { width: 12px; height: 12px; flex-basis: 12px; }
  .about-button { padding: 0; gap: 4px; }
  .about-button::before { display: none; }

  .hero-copy { position: relative; top: auto; left: auto; max-width: none; padding: 22px 22px 14px; }
  .eyebrow { margin-bottom: 10px; font-size: 10px; letter-spacing: .08em; gap: 9px; }
  .eyebrow > span { width: 17px; }
  h1 { font-size: clamp(46px, 13vw, 56px); }
  .english { margin-top: 8px; font-size: 8px; }
  .hero-lead { margin-top: 12px; padding-left: 12px; font-size: 15px; line-height: 1.85; }
  .hero-lead br { display: none; }
  .model-flag { display: none; }
  .stage { height: min(68svh, 560px); min-height: 400px; }
  .stage-shade { background: linear-gradient(to bottom, var(--paper) 0, transparent 70px), linear-gradient(to top, color-mix(in srgb, var(--paper) 70%, transparent) 0, transparent 120px); }
  .views, .gates, .stage-hint { display: none; }
  .tools { top: 14px; right: 10px; transform: none; padding: 3px; }
  .tool { width: 40px; height: 40px; }
  .tool[data-tool=shot] { display: none; }
  .tool-tip { display: none; }
  .stage-flag { left: 14px; right: auto; top: 16px; bottom: auto; padding: 2px 8px; border: 1px solid var(--line); border-radius: 2px; background: var(--surface); font-size: 10px; letter-spacing: .06em; }
  .mobile-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; position: absolute; left: 12px; right: 12px; bottom: 12px; }
  .mobile-bar-button {
    display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 14px; border-radius: 4px; text-align: left;
    background: var(--surface); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(50, 42, 28, .08);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  }
  .mobile-bar-button > svg { width: 18px; height: 18px; flex: 0 0 18px; color: var(--accent); }
  .mobile-bar-button span { display: flex; flex-direction: column; flex: 1; min-width: 0; font-size: 11px; line-height: 1.4; color: var(--muted); letter-spacing: .08em; }
  .mobile-bar-button small { font: 15px/1.4 var(--serif); color: var(--ink); letter-spacing: .08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mobile-bar-button .chev { width: 14px; height: 14px; flex: 0 0 14px; color: var(--muted); }
  .mobile-bar-button:active { transform: translateY(1px); }
  .info-card, .advanced { left: 12px; right: 12px; top: auto; bottom: 12px; width: auto; max-height: calc(100% - 80px); transform: none; z-index: 7; animation-name: card-up; padding: 18px 18px 16px; }
  @keyframes card-up { from { opacity: 0; transform: translateY(10px); } }
  .info-card h2 { font-size: 22px; }
  .toast { bottom: 80px; }
  .loader { top: 50%; padding: 22px 20px 20px; }
  .stage.is-full .hero-copy { display: none; }

  .facts { padding-block: 26px 20px; }
  .facts dl { gap: 18px 16px; padding: 20px 0; }
  .facts strong { font-size: 21px; }
  .facts strong.num { font-size: 28px; }
  .axis { padding-block: 48px 24px; }
  .chapter-head { margin-bottom: 24px; }
  .chapter-head h2 { font-size: 29px; }
  .plan-figure { margin-inline: -8px; padding-top: 18px; }
  .stops { grid-template-columns: 1fr; }
  .stops h3 { font-size: 21px; }
  .model { padding-block: 44px 56px; }
  .model-grid { grid-template-columns: 1fr; }
  .visit-note { margin-top: 28px; padding: 18px 18px; }
  .wrap { padding-inline: 22px; }

  .site-footer { margin: 0 22px; flex-direction: column; align-items: flex-start; gap: 6px; padding: 22px 0 calc(20px + env(safe-area-inset-bottom)); }
  .footer-meta { flex-direction: column; align-items: flex-start; gap: 4px; }
  .footer-meta > small { text-align: left; }
  .footer-break { display: inline; }
  .about-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 20px); }
  .dialog-head { padding: 18px 18px 12px; }
  .dialog-head h2 { font-size: 22px; }
  .dialog-body { padding: 14px 18px 22px; }
  .source-list p { margin-left: 0; }
}
@media (max-width: 370px) {
  .brand-seal, .brand-seal .brand-symbol { width: 35px; height: 44px; }
  .brand-name { font-size: 18px; letter-spacing: 1.6px; }
  .brand-name small { font-size: 6px; letter-spacing: 1.2px; }
  .brand { gap: 8px; }
  .header-right { gap: 8px; }
  .header-home { font-size: 9px; }
  .mobile-bar-button { padding: 0 10px; gap: 8px; }
  .facts dl { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 701px) and (max-height: 760px) {
  h1 { font-size: 58px; }
  .hero-lead { font-size: 15px; margin-top: 14px; }
  .model-flag { margin-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print {
  .site-header, .tools, .views, .gates, .mobile-bar, .hotspots, .loader, .info-card, .advanced { display: none !important; }
  .stage { height: auto; min-height: 0; max-height: none; }
  .stage-poster { position: static; opacity: 1 !important; filter: none !important; }
  #xuegong-canvas { display: none; }
}
