/* 孟子 · 跟孟子游列国 —— 全站样式
   色板：纸 / 墨 / 朱砂 / 竹青 / 赭石 / 靛青；夜读模式重定义同一组变量。 */

:root {
  --paper: #f3ead8;
  --paper-2: #faf5ea;
  --paper-3: #ebdfc7;
  --card: #fffbf2;
  --ink: #1d1814;
  --ink-2: #3b322a;
  --muted: #7a6b5b;
  --line: #ddcfb5;
  --line-2: #cdbb9c;
  --cinnabar: #a8322a;
  --cinnabar-2: #c4473a;
  --cinnabar-soft: #f3ddd5;
  --bamboo: #3d6a54;
  --bamboo-soft: #dde9df;
  --ochre: #a8742a;
  --ochre-soft: #f3e4c4;
  --indigo: #2f4d6e;
  --indigo-soft: #dae3ee;
  --plum: #6d4a73;
  --plum-soft: #ebdfee;
  --map-water: #c9d6d0;
  --map-land: #efe4cc;
  --shadow-sm: 0 1px 2px rgba(60, 40, 20, .07);
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 10px 28px rgba(60, 40, 20, .09);
  --shadow-lg: 0 2px 6px rgba(60, 40, 20, .08), 0 24px 60px rgba(60, 40, 20, .16);
  --r: 18px;
  --r-sm: 12px;
  --top: 64px;
  --tabbar: 0px;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "Source Han Serif CN", "SimSun", serif;
  --kai: "Kaiti SC", "STKaiti", "KaiTi", "BiauKai", "Noto Serif SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --seal-tex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.09' numOctaves='3' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .96 0 0 0 0 .9 0 0 0 8 -4.6'/%3E%3C/filter%3E%3Crect width='90' height='90' filter='url(%23s)' opacity='.55'/%3E%3C/svg%3E");
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #16130f;
  --paper-2: #1d1914;
  --paper-3: #26211a;
  --card: #211c16;
  --ink: #efe6d4;
  --ink-2: #d8ccb6;
  --muted: #a39580;
  --line: #3a3228;
  --line-2: #4a4033;
  --cinnabar: #e0614f;
  --cinnabar-2: #ef7a66;
  --cinnabar-soft: #3d211c;
  --bamboo: #7fb597;
  --bamboo-soft: #1e2c24;
  --ochre: #d9a65a;
  --ochre-soft: #33281a;
  --indigo: #8fb0d6;
  --indigo-soft: #1c2633;
  --plum: #c39acb;
  --plum-soft: #2c2130;
  --map-water: #23302d;
  --map-land: #221d16;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 10px 28px rgba(0, 0, 0, .35);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .3), 0 24px 60px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--paper);
  background-image:
    radial-gradient(1100px 520px at 8% -12%, color-mix(in srgb, var(--ochre-soft) 70%, transparent), transparent 60%),
    radial-gradient(900px 480px at 108% 4%, color-mix(in srgb, var(--cinnabar-soft) 55%, transparent), transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .35 0 0 0 0 .2 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--cinnabar); text-underline-offset: 3px; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
img { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; line-height: 1.3; margin: 0; letter-spacing: .01em; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid var(--cinnabar); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- 顶栏 ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 40; height: var(--top);
  display: flex; align-items: center; gap: 16px; padding: 0 20px;
  padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.3) blur(14px);
  -webkit-backdrop-filter: saturate(1.3) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.brand__seal {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px;
  background: var(--cinnabar); color: #fff6ec; font-family: var(--kai); font-size: 22px; line-height: 1;
  box-shadow: inset 0 0 0 2px rgba(255, 240, 220, .35); background-image: var(--seal-tex);
}
.brand__text { font-family: var(--serif); font-weight: 800; font-size: 19px; line-height: 1.05; display: flex; flex-direction: column; }
.brand__text small { font-family: var(--sans); font-weight: 500; font-size: 10.5px; letter-spacing: .32em; color: var(--muted); margin-top: 3px; }
.nav {
  position: relative; margin: 0 auto; display: flex; gap: 2px; padding: 4px;
  background: color-mix(in srgb, var(--paper-3) 70%, transparent); border-radius: 999px;
}
.nav a {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px; text-decoration: none; color: var(--ink-2);
  font-size: 14.5px; font-weight: 500; white-space: nowrap; transition: color .25s;
}
.nav a svg { font-size: 16px; }
.nav a.is-active { color: #fff8ef; }
.nav__ink {
  position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; width: 0;
  background: var(--cinnabar); border-radius: 999px; box-shadow: 0 4px 14px color-mix(in srgb, var(--cinnabar) 40%, transparent);
  transition: transform .45s var(--ease), width .45s var(--ease); pointer-events: none;
}
.nav__ai svg { color: var(--ochre); }
.nav__ai.is-active svg { color: #ffe7b8; }
.topbar__tools { display: flex; align-items: center; gap: 6px; flex: none; }
.age-btn {
  height: 36px; padding: 0 14px; border-radius: 999px; border: 0;
  background: var(--ink); color: var(--paper); font-weight: 600; font-size: 13.5px; letter-spacing: .08em;
}
.age-btn::before { content: "学段 · "; opacity: .65; font-weight: 400; }
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center; flex: none;
  border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  transition: transform .2s var(--ease), background .2s, color .2s, border-color .2s;
}
.icon-btn svg { font-size: 18px; }
.icon-btn:hover { border-color: var(--line-2); color: var(--ink); }
.icon-btn:active { transform: scale(.92); }
.icon-btn[aria-pressed="true"] { background: var(--cinnabar-soft); border-color: color-mix(in srgb, var(--cinnabar) 35%, transparent); color: var(--cinnabar); }
.icon-btn--lg { width: 46px; height: 46px; }

/* ---------- 手机底栏 ---------- */
.tabbar { display: none; }

/* ---------- 视图 ---------- */
main { padding-top: var(--top); }
.view { display: none; min-height: calc(100vh - var(--top)); padding: 32px max(20px, calc((100vw - 1180px) / 2)) 80px; }
.view.is-active { display: block; animation: viewIn .55s var(--ease) backwards; }
.view--full { padding: 0; min-height: 0; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }


/* ---------- 通用组件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap;
  transition: transform .2s var(--ease), box-shadow .2s, background .2s, color .2s;
}
.btn svg { font-size: 18px; }
.btn:active { transform: scale(.96); }
.btn--red { background: var(--cinnabar); color: #fff8ef; box-shadow: 0 6px 18px color-mix(in srgb, var(--cinnabar) 32%, transparent); }
.btn--red:hover { background: var(--cinnabar-2); }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--line-2); }
.btn--lg { height: 52px; padding: 0 26px; font-size: 16px; }
.btn--sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2); font-size: 13.5px; white-space: nowrap;
}
.chip-btn svg { font-size: 15px; }
.chip-btn[aria-pressed="true"], .chip-btn[aria-expanded="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.eyebrow { font-size: 12px; letter-spacing: .26em; color: var(--cinnabar); font-weight: 600; text-transform: uppercase; margin-bottom: 8px; }
.section-head { text-align: center; margin: 0 auto 28px; max-width: 760px; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 38px); }
.section-sub { color: var(--muted); margin-top: 10px; font-size: 15.5px; }
.section-head--left { text-align: left; margin: 0; }
.section-head--left h2 { font-size: clamp(24px, 3vw, 32px); }
.br-m { display: none; }

.grade {
  display: inline-flex; align-items: center; gap: 3px; height: 21px; padding: 0 8px; border-radius: 6px;
  font-family: var(--sans); font-size: 11.5px; font-weight: 600; letter-spacing: .04em; line-height: 1;
  vertical-align: 2px; white-space: nowrap; border: 1px solid transparent;
}
.grade--A { background: var(--bamboo-soft); color: var(--bamboo); }
.grade--B { background: var(--indigo-soft); color: var(--indigo); }
.grade--C { background: var(--ochre-soft); color: var(--ochre); }
.grade--D { background: var(--plum-soft); color: var(--plum); }
.grade--E { background: transparent; color: var(--cinnabar); border-color: color-mix(in srgb, var(--cinnabar) 45%, transparent); border-style: dashed; }
button.grade { cursor: pointer; }

.seg {
  position: relative; display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px;
  background: color-mix(in srgb, var(--paper-3) 80%, transparent); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%;
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  position: relative; z-index: 1; border: 0; background: none; padding: 7px 15px; border-radius: 999px;
  font-size: 14px; color: var(--ink-2); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
  transition: color .25s;
}
.seg button b { font-size: 11px; font-weight: 600; color: var(--muted); }
.seg button.is-active { color: var(--ink); font-weight: 600; }
.seg__ink { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; width: 0; background: var(--card); border-radius: 999px; box-shadow: var(--shadow-sm); transition: transform .4s var(--ease), width .4s var(--ease); }

.tabs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 5px; margin: 0 auto 30px; max-width: 760px;
  background: color-mix(in srgb, var(--paper-3) 80%, transparent); border-radius: 16px;
}
.tabs--4 { grid-template-columns: repeat(4, 1fr); max-width: 860px; }
.tab {
  display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px; border: 0; border-radius: 12px;
  background: none; color: var(--ink-2); font-size: 15px; font-weight: 500; transition: background .25s, color .25s, box-shadow .25s;
}
.tab svg { font-size: 17px; }
.tab.is-active { background: var(--card); color: var(--cinnabar); font-weight: 600; box-shadow: var(--shadow-sm); }

.search {
  display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); min-width: 0; flex: 1;
}
.search svg { color: var(--muted); font-size: 17px; }
.search input { border: 0; outline: 0; background: none; width: 100%; min-width: 0; font-size: 15px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm);
}
.quote {
  font-family: var(--serif); font-size: 18px; line-height: 1.9; color: var(--ink);
  padding: 14px 18px 14px 20px; border-left: 3px solid var(--cinnabar); background: color-mix(in srgb, var(--paper-3) 45%, transparent);
  border-radius: 0 12px 12px 0;
}
.quote cite { display: block; margin-top: 6px; font-style: normal; font-family: var(--sans); font-size: 12.5px; color: var(--muted); }
.ref {
  display: inline-flex; align-items: center; gap: 4px; padding: 0 7px; height: 22px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--paper-2); font-size: 12px; color: var(--ink-2); text-decoration: none; font-family: var(--sans); vertical-align: 2px; cursor: pointer;
}
.ref:hover { border-color: var(--cinnabar); color: var(--cinnabar); }
.ref svg { font-size: 12px; }

.bubble {
  position: relative; display: inline-block; padding: 10px 14px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-sm); font-size: 14.5px; line-height: 1.6;
}
.bubble::before {
  content: ""; position: absolute; left: -7px; top: 18px; width: 12px; height: 12px; background: var(--card);
  border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: rotate(45deg);
}

/* 书童小砚：动作循环 */
.mascot { display: block; width: 100%; height: 100%; overflow: visible; }
.art, #route-svg, .atlas__svg, .duan__field, .hero__art svg, .home-map { stroke: none; } /* 不吃图标用的全局描边 */
.shiver { animation: shiver .18s linear infinite; }
@keyframes shiver { 0%, 100% { translate: 0 0; } 50% { translate: 1.2px 0; } }
.flame { animation: flicker .5s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes flicker { to { transform: scaleY(1.12) skewX(-3deg); } }
.mascot .m-body { transform-origin: 60px 150px; animation: mBreath 3.2s ease-in-out infinite; }
.mascot .m-arm-r, .mascot .m-arm-l { transform-box: view-box; }
.mascot .m-arm-r { transform-origin: 80px 92px; }
.mascot .m-arm-l { transform-origin: 40px 92px; }
.mascot .m-blink { transform-origin: 60px 62px; animation: mBlink 4.6s infinite; }
.m-wave .m-arm-r { animation: mWave 1.1s ease-in-out infinite; }
.m-cheer .m-body { animation: mJump .7s var(--ease) infinite; }
.m-cheer .m-arm-r { transform: rotate(-150deg); }
.m-cheer .m-arm-l { transform: rotate(150deg); }
.m-think .m-arm-r { transform: rotate(146deg) scale(.78); }
.m-think .m-q { opacity: 1; animation: mQ 1.6s ease-in-out infinite; }
.m-sad .m-head { transform: translateY(3px) rotate(4deg); transform-origin: 60px 80px; }
.m-sad .m-mouth { transform: scaleY(-1); transform-origin: 60px 72px; }
.m-walk .m-body { animation: mWalk .5s ease-in-out infinite; }
.m-q { opacity: 0; }
@keyframes mBreath { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.6px); } }
@keyframes mBlink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes mWave { 0%, 100% { transform: rotate(-130deg); } 50% { transform: rotate(-165deg); } }
@keyframes mJump { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-10px); } }
@keyframes mQ { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes mWalk { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-3px) rotate(1.5deg); } }

/* ---------- 首页 ---------- */
#view-home { padding-top: 0; }
.hero { position: relative; min-height: calc(100vh - var(--top)); display: grid; align-items: center; margin: 0 calc(-1 * max(20px, calc((100vw - 1180px) / 2))); padding: 40px max(20px, calc((100vw - 1180px) / 2)); overflow: hidden; }
.hero__art { position: absolute; inset: 0; z-index: 0; }
.hero__art svg { width: 100%; height: 100%; }
.hero__inner { position: relative; z-index: 1; max-width: 620px; }
.hero__years {
  border: 0; background: none; padding: 0; font-family: var(--serif); font-size: 15px; letter-spacing: .3em; color: var(--cinnabar);
  display: inline-flex; align-items: center; gap: 10px;
}
.hero__years .grade { letter-spacing: .04em; }
.hero__title {
  font-family: var(--kai); font-weight: 400; font-size: clamp(96px, 15vw, 196px); line-height: .98; margin: 14px 0 18px -6px;
  display: flex; gap: .02em; letter-spacing: 0;
}
.hero__title span { display: inline-block; }
.hero__title span:last-child { color: var(--cinnabar); }
.hero__sub { font-family: var(--serif); font-size: clamp(16px, 1.6vw, 18.5px); line-height: 1.95; color: var(--ink-2); max-width: 30em; }
.hero__guide { display: flex; align-items: center; gap: 14px; margin: 26px 0 28px; }
.hero__mascot { width: 76px; height: 100px; flex: none; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__progress { margin-top: 22px; font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero__progress b { color: var(--cinnabar); font-family: var(--serif); font-size: 17px; }
[data-anim] { animation: rise .9s var(--ease) backwards; }
[data-anim]:nth-child(2) { animation-delay: .08s; }
[data-anim]:nth-child(3) { animation-delay: .18s; }
[data-anim]:nth-child(4) { animation-delay: .28s; }
[data-anim]:nth-child(5) { animation-delay: .36s; }
.hero__title span { animation: brush 1.2s var(--ease) backwards; }
.hero__title span:last-child { animation-delay: .25s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes brush { from { opacity: 0; filter: blur(10px); transform: scale(1.08); } to { opacity: 1; filter: none; transform: none; } }
.hero-route { stroke-dasharray: 6 9; animation: dash 30s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -600; } }

.ask-li { padding: 70px 0 30px; }
.ask-li h2 { font-family: var(--kai); font-weight: 400; font-size: clamp(28px, 4vw, 44px); }
.ask-li__opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; max-width: 820px; margin: 0 auto; }
.opt {
  display: flex; align-items: flex-start; gap: 12px; text-align: left; padding: 16px 18px; border-radius: 16px;
  border: 1.5px solid var(--line); background: var(--card); font-size: 15.5px; line-height: 1.55;
  transition: transform .2s var(--ease), border-color .2s, background .2s, box-shadow .2s;
}
.opt:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.opt__k {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--paper-3); font-family: var(--serif); font-weight: 700; font-size: 14px;
}
.opt.is-right { border-color: var(--bamboo); background: var(--bamboo-soft); }
.opt.is-right .opt__k { background: var(--bamboo); color: #fff; }
.opt.is-wrong { border-color: color-mix(in srgb, var(--cinnabar) 55%, transparent); background: var(--cinnabar-soft); }
.opt.is-wrong .opt__k { background: var(--cinnabar); color: #fff; }
.opt.is-picked { border-color: var(--ink); }
.opt[disabled] { cursor: default; }
.opt[disabled]:hover { transform: none; }
.ask-li__fb { max-width: 820px; margin: 18px auto 0; padding: 18px 20px; display: grid; gap: 10px; animation: rise .5s var(--ease) backwards; }
.ask-li__fb p { color: var(--ink-2); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 50px 0 20px; }
.stat { padding: 22px 18px; text-align: center; }
.stat b { display: block; font-family: var(--serif); font-size: clamp(32px, 4vw, 46px); line-height: 1.1; color: var(--cinnabar); font-variant-numeric: tabular-nums; }
.stat span { display: block; color: var(--muted); font-size: 13.5px; margin-top: 6px; }

.duan { padding: 60px 0 30px; }
.duan__stage { position: relative; max-width: 900px; margin: 0 auto; }
.duan__field { width: 100%; height: auto; display: block; overflow: visible; }
.duan__field .seed { cursor: pointer; outline: none; }
.duan__field .seed:focus-visible .seed__ring { stroke: var(--cinnabar); stroke-width: 3; }
.duan__field .seed__ring { fill: var(--card); stroke: var(--line-2); stroke-width: 1.5; transition: stroke .3s; }
.duan__field .seed:hover .seed__ring { stroke: var(--cinnabar); }
.duan__field .seed__plant { transform-box: fill-box; transform-origin: 50% 100%; transform: scale(.0001); transition: transform 1.1s var(--spring); }
.duan__field .seed.is-grown .seed__plant { transform: scale(1); }
.duan__field .seed__virtue { opacity: 0; transition: opacity .6s .5s; font-family: var(--kai); }
.duan__field .seed.is-grown .seed__virtue { opacity: 1; }
.duan__card { text-align: center; margin-top: 8px; min-height: 76px; display: grid; gap: 4px; justify-items: center; }
.duan__card strong { font-family: var(--serif); font-size: 19px; }
.duan__card span { color: var(--muted); font-size: 14px; }
.duan__card .quote { text-align: left; max-width: 640px; }

.entries { padding: 60px 0 20px; }
.entries__grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.entry {
  grid-column: span 2; position: relative; display: grid; gap: 4px; align-content: start; padding: 22px 22px 22px;
  border-radius: var(--r); background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--ink);
  min-height: 150px; text-align: left; transition: transform .25s var(--ease), box-shadow .25s;
}
.entry:nth-child(1), .entry:nth-child(2) { grid-column: span 3; }
.entry:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.entry__icon { font-size: 28px; color: var(--cinnabar); margin-bottom: 10px; }
.entry strong { font-family: var(--serif); font-size: 21px; }
.entry > span { color: var(--muted); font-size: 14px; }
.entry__arrow { position: absolute; right: 20px; top: 22px; font-size: 20px; color: var(--muted); transition: transform .25s var(--ease); }
.entry:hover .entry__arrow { transform: translateX(4px); }
.entry--red { background: var(--cinnabar); color: #fff8ef; border-color: transparent; }
.entry--red .entry__icon, .entry--red span, .entry--red .entry__arrow { color: #ffe9dc; }
.entry--dark { background: var(--ink); color: var(--paper); border-color: transparent; }
.entry--dark .entry__icon { color: var(--ochre); }
.entry--dark span, .entry--dark .entry__arrow { color: color-mix(in srgb, var(--paper) 70%, transparent); }
.view [data-reveal] { opacity: 0; translate: 0 18px; transition: opacity .8s var(--ease), translate .8s var(--ease), transform .25s var(--ease), box-shadow .25s, border-color .2s; }
.view [data-reveal].is-in { opacity: 1; translate: 0 0; }

.foot { margin-top: 60px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; display: grid; gap: 6px; text-align: center; }

/* ---------- 游列国 ---------- */
#view-route.is-active { display: grid; grid-template-columns: 1fr 380px; height: calc(100vh - var(--top)); }
.map { position: relative; overflow: hidden; background: var(--map-water); touch-action: none; cursor: grab; isolation: isolate; }
.map:active { cursor: grabbing; }
/* 宣纸纹理 + 四角压暗 */
.map::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background:
    radial-gradient(120% 90% at 50% 45%, transparent 55%, color-mix(in srgb, var(--ink) 16%, transparent) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .3 0 0 0 0 .18 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply; }
:root[data-theme="dark"] .map::after { mix-blend-mode: normal; opacity: .55; }
.map.has-basemap::after { opacity: .35; }
#route-svg { width: 100%; height: 100%; display: block; }
.map-note { position: absolute; z-index: 3; left: 14px; bottom: 12px; font-size: 11.5px; color: var(--muted); background: color-mix(in srgb, var(--paper) 82%, transparent); padding: 3px 9px; border-radius: 6px; max-width: calc(100% - 120px); }
.map-note a { color: var(--cinnabar); }
.map__zoom { position: absolute; z-index: 3; right: 14px; top: 14px; display: grid; gap: 8px; }

/* 图题、指北针、比例尺 */
.map-title { position: absolute; z-index: 2; left: 18px; top: 16px; display: flex; flex-direction: row-reverse; align-items: flex-start; gap: 8px; pointer-events: none;
  padding: 14px 10px 12px; border: 1px solid color-mix(in srgb, var(--ink) 30%, transparent); outline: 3px double color-mix(in srgb, var(--ink) 16%, transparent); outline-offset: 3px;
  background: color-mix(in srgb, var(--paper-2) 78%, transparent); backdrop-filter: blur(2px); animation: rise 1s .3s var(--ease) backwards; }
.map-title b { writing-mode: vertical-rl; font-family: var(--kai); font-size: 23px; letter-spacing: .18em; color: var(--ink); font-weight: 400; }
.map-title span { writing-mode: vertical-rl; font-family: var(--serif); font-size: 11px; letter-spacing: .12em; color: var(--muted); }
.map-title__seal { writing-mode: horizontal-tb; align-self: flex-end; font-style: normal; font-family: var(--kai); font-size: 10.5px; line-height: 1.15; color: #fff6ec; background: var(--cinnabar); background-image: var(--seal-tex); padding: 4px 4px 3px; border-radius: 3px; transform: rotate(-4deg); }
.map-compass { position: absolute; z-index: 2; right: 18px; bottom: 44px; width: 64px; height: 64px; pointer-events: none; animation: compassIn 1.6s .4s var(--spring) backwards; }
.map-compass svg { width: 100%; height: 100%; overflow: visible; }
.mc-ring { fill: color-mix(in srgb, var(--paper-2) 70%, transparent); stroke: color-mix(in srgb, var(--ink) 40%, transparent); stroke-width: .8; }
.mc-ring--in { fill: none; stroke-dasharray: 1.2 2.6; }
.mc-n { fill: var(--cinnabar); }
.mc-s { fill: color-mix(in srgb, var(--ink) 55%, transparent); }
.mc-ew { fill: color-mix(in srgb, var(--ink) 30%, transparent); }
.map-compass text { font-family: var(--kai); fill: var(--paper-2); font-weight: 700; }
@keyframes compassIn { from { opacity: 0; transform: rotate(-200deg) scale(.6); } }
.map-scale { position: absolute; z-index: 3; left: 14px; bottom: 40px; display: grid; gap: 3px; font-size: 11px; color: var(--ink-2); pointer-events: none; font-variant-numeric: tabular-nums; }
.map-scale i { display: block; height: 6px; border: 1.5px solid var(--ink-2); border-top: 0; transition: width .25s var(--ease);
  background: linear-gradient(90deg, var(--ink-2) 0 25%, transparent 25% 50%, var(--ink-2) 50% 75%, transparent 75%) bottom / 100% 2px no-repeat; }

/* 图层面板、疆域卡片 */
.map-layers { position: absolute; z-index: 4; right: 62px; top: 14px; width: 250px; padding: 14px; display: grid; gap: 8px; border-radius: 16px; box-shadow: var(--shadow-lg); animation: sheetIn .3s var(--ease) backwards; }
.map-layers[hidden], .map-terr[hidden] { display: none; }
.map-layers__h { font-size: 12px; color: var(--muted); letter-spacing: .1em; }
.map-layers__h:not(:first-child) { margin-top: 6px; }
.map-layers__tip { font-size: 12px; color: var(--muted); line-height: 1.6; padding: 8px 10px; border-radius: 10px; background: var(--paper-3); }
.map-layers__tip code { font-size: 11px; }
.map-radio { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); cursor: pointer; transition: border-color .2s, background .2s; }
.map-radio:has(input:checked) { border-color: var(--cinnabar); background: var(--cinnabar-soft); }
.map-radio input { accent-color: var(--cinnabar); margin-top: 3px; }
.map-radio span { display: grid; font-size: 14px; }
.map-radio small { font-size: 11.5px; color: var(--muted); }
.map-layers__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.map-chk { display: flex; gap: 6px; align-items: center; font-size: 13.5px; padding: 5px 8px; border-radius: 8px; background: var(--paper-3); cursor: pointer; }
.map-chk input { accent-color: var(--cinnabar); }
.map-terr { position: absolute; z-index: 4; width: min(290px, calc(100% - 20px)); padding: 14px 16px; display: grid; gap: 8px; border-radius: 16px; box-shadow: var(--shadow-lg); animation: sheetIn .3s var(--ease) backwards; font-size: 14px; color: var(--ink-2); }
.map-terr header { display: flex; align-items: center; gap: 8px; }
.map-terr header strong { font-family: var(--kai); font-size: 22px; font-weight: 400; color: var(--ink); }
.map-terr__dot { width: 12px; height: 12px; border-radius: 4px; }
.map-terr__x { margin-left: auto; border: 0; background: none; color: var(--muted); padding: 4px; display: grid; }
.map-terr__x svg { width: 16px; height: 16px; }

/* 地理 */
.m-land { fill: var(--map-land); stroke: none; }
.m-isle { stroke: color-mix(in srgb, var(--ink) 30%, transparent); stroke-width: .8; vector-effect: non-scaling-stroke; }
.m-sea { fill: var(--map-water); }
.m-wave { fill: none; stroke: color-mix(in srgb, var(--indigo) 16%, transparent); stroke-width: 1.2; }
.m-waves { animation: waves 14s linear infinite; }
@keyframes waves { to { transform: translate(44px, 0); } }
.m-coast { fill: none; stroke: color-mix(in srgb, var(--ink) 45%, transparent); stroke-width: 1.2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
/* 海岸辉光：五层由宽到窄的淡描边叠出柔和渐变（不用 blur 滤镜，缩放时不必每帧重算） */
.m-coast-glow path { fill: none; stroke: var(--indigo); stroke-opacity: .03; stroke-linejoin: round; stroke-linecap: round; }
.m-coast-glow path:nth-child(1) { stroke-width: 19; }
.m-coast-glow path:nth-child(2) { stroke-width: 15; }
.m-coast-glow path:nth-child(3) { stroke-width: 11; }
.m-coast-glow path:nth-child(4) { stroke-width: 7; }
.m-coast-glow path:nth-child(5) { stroke-width: 3; }
.m-lake { fill: var(--map-water); stroke: color-mix(in srgb, var(--indigo) 45%, transparent); stroke-width: 1; vector-effect: non-scaling-stroke; }
.m-river { fill: none; stroke: color-mix(in srgb, var(--indigo) 55%, var(--map-water)); stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.m-river--major { stroke-width: 2.8; }
.m-canal { stroke-dasharray: 4 4; }
.m-flow { fill: none; stroke: color-mix(in srgb, #fff 75%, var(--map-water)); stroke-width: calc(1.2px * var(--k, 1)); stroke-linecap: round; stroke-dasharray: calc(3px * var(--k, 1)) calc(26px * var(--k, 1)); animation: flow 3.2s linear infinite; opacity: .8; }
.m-flow--major { stroke-width: calc(1.6px * var(--k, 1)); }
:root[data-theme="dark"] .m-flow { stroke: color-mix(in srgb, var(--indigo) 60%, transparent); }
@keyframes flow { to { stroke-dashoffset: calc(-29px * var(--k, 1)); } }
.m-mount { fill: color-mix(in srgb, var(--ochre) 42%, var(--map-land)); stroke: none; }
.m-mount--back { fill: color-mix(in srgb, var(--ochre) 20%, var(--map-land)); }
.m-mount-ridge { fill: none; stroke: color-mix(in srgb, var(--ink) 35%, transparent); stroke-width: .9; stroke-linecap: round; }
.m-mount-label { font-family: var(--serif); fill: var(--ink-2); }
.m-terr__fill { opacity: .2; transition: opacity .35s; }
.m-terr__edge { fill: none; stroke-width: 1.3; stroke-dasharray: 6 3 1.5 3; vector-effect: non-scaling-stroke; opacity: .55; pointer-events: none; }
.m-terr-img { opacity: 0; transition: opacity 1.2s ease; pointer-events: none; }
#m-terr.is-baked .m-terr-img { opacity: .2; }
#m-terr.is-baked .m-terr__fill { opacity: 0; }
#m-terr.is-baked .m-terr.is-hot .m-terr__fill { opacity: .14; }
.m-terr.is-hot .m-terr__fill { opacity: .34; }
.m-terr--minor .m-terr__fill { opacity: .3; }
:root[data-theme="dark"] .m-terr__fill, :root[data-theme="dark"] #m-terr.is-baked .m-terr-img { opacity: .27; }
:root[data-theme="dark"] #m-terr.is-baked .m-terr__fill { opacity: 0; }
:root[data-theme="dark"] #m-terr.is-baked .m-terr.is-hot .m-terr__fill { opacity: .18; }
.m-wall-base { fill: none; stroke: color-mix(in srgb, var(--ink) 50%, transparent); stroke-width: 1; vector-effect: non-scaling-stroke; }
.m-wall { fill: none; stroke: color-mix(in srgb, var(--ink) 62%, transparent); stroke-width: calc(4px * var(--k, 1)); stroke-dasharray: calc(1.6px * var(--k, 1)) calc(2.6px * var(--k, 1)); }
.m-label--wall { font-family: var(--kai); font-size: 11px; fill: var(--ink-2); }
.m-cap__wall { fill: var(--map-land); stroke: var(--ink-2); stroke-width: 1.4; }
.m-cap__core { fill: var(--ink-2); }
.m-cap text { font-family: var(--kai); fill: var(--ink); paint-order: stroke; stroke: var(--map-land); stroke-width: 3px; stroke-linejoin: round; }
.m-cap__st { fill: var(--muted); }
/* 云：三层渐淡描边做出柔边（代替 blur 滤镜） */
.m-cloud__body { fill: color-mix(in srgb, var(--paper-2) 82%, transparent); }
.m-cloud__soft { fill: none; stroke: color-mix(in srgb, var(--paper-2) 82%, transparent); stroke-linejoin: round; }
.m-cloud__soft:nth-child(1) { stroke-width: 9; stroke-opacity: .14; }
.m-cloud__soft:nth-child(2) { stroke-width: 6; stroke-opacity: .2; }
.m-cloud__soft:nth-child(3) { stroke-width: 3; stroke-opacity: .3; }
.m-cloud { opacity: .7; animation: cloud 46s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -9s); pointer-events: none; }
.m-cloud__curl { fill: none; stroke: color-mix(in srgb, var(--ink) 18%, transparent); stroke-width: 1.4; stroke-linecap: round; }
@keyframes cloud { from { transform: translate(-40px, 0); } to { transform: translate(60px, -8px); } }
#route-svg.is-cam .m-flow, #route-svg.is-cam .m-cloud { animation-play-state: paused; } /* 拖动、缩放时暂停，减少每帧重绘 */
:root[data-theme="dark"] .m-cloud { opacity: .45; }
:root[data-theme="dark"] .m-cloud__body { fill: color-mix(in srgb, var(--paper-3) 80%, transparent); }
:root[data-theme="dark"] .m-cloud__soft { stroke: color-mix(in srgb, var(--paper-3) 80%, transparent); }
.m-state { font-family: var(--kai); fill: color-mix(in srgb, var(--ink) 30%, transparent); text-anchor: middle; dominant-baseline: middle; pointer-events: none; letter-spacing: .3em; }
.m-state--minor { fill: color-mix(in srgb, var(--ink) 38%, transparent); letter-spacing: .15em; }
.m-state--sea { fill: color-mix(in srgb, var(--indigo) 40%, transparent); }
.m-label { font-family: var(--serif); fill: var(--ink-2); font-size: 12px; pointer-events: none; paint-order: stroke; stroke: var(--map-land); stroke-width: 3px; stroke-linejoin: round; }
.m-label--river { fill: color-mix(in srgb, var(--indigo) 80%, var(--ink)); font-size: 10.5px; font-style: italic; stroke: var(--map-land); }
.m-layer { transition: opacity .45s; }
.m-layer.is-off { opacity: 0; pointer-events: none; }
#route-svg.has-basemap #m-ink, #route-svg.has-basemap #m-water, #route-svg.has-basemap #m-mounts, #route-svg.has-basemap #m-clouds { display: none; }
#route-svg.has-basemap #m-terr { opacity: .7; }
#m-basemap image { opacity: 0; transition: opacity .5s; }
#m-basemap image.is-on { opacity: 1; }

/* 第一次打开的描线动画 */
.m-draw { stroke-dasharray: 1; stroke-dashoffset: 0; }
#route-svg.is-intro .m-draw { animation: drawIn 1.8s var(--ease) backwards; animation-delay: var(--d, 0s); }
#route-svg.is-intro .m-river { animation-delay: calc(.5s + var(--d, 0s)); }
#route-svg.is-intro #m-terr { animation: fade 1.6s .5s backwards; }
#route-svg.is-intro #m-states, #route-svg.is-intro #m-caps, #route-svg.is-intro #m-walls, #route-svg.is-intro #m-mounts { animation: fade 1.2s 1.1s backwards; }
#route-svg.is-intro #rt-nodes { animation: fade .8s 1.5s backwards; }
@keyframes drawIn { from { stroke-dashoffset: 1; } }

/* 路线 */
.m-route-bg { fill: none; stroke: color-mix(in srgb, var(--cinnabar) 28%, transparent); stroke-width: calc(3px * var(--k, 1)); stroke-dasharray: calc(2px * var(--k, 1)) calc(7px * var(--k, 1)); stroke-linecap: round; }
.m-route { fill: none; stroke: var(--cinnabar); stroke-width: calc(3.4px * var(--k, 1)); stroke-linecap: round; stroke-linejoin: round; }
.m-route-glow { fill: none; stroke: color-mix(in srgb, var(--cinnabar) 45%, transparent); stroke-width: calc(10px * var(--k, 1)); stroke-linecap: round; filter: blur(calc(3px * var(--k, 1))); opacity: 0; transition: opacity .6s; }
.m-route-glow.is-drawing { opacity: 1; transition: none; }
#route-svg .m-label, #route-svg .m-state, #route-svg .m-label--wall { transform-box: fill-box; transform-origin: center; transform: scale(var(--ks, 1)); }
#route-svg .m-sc { transform: scale(var(--ks, 1)); }
.m-node { cursor: pointer; }
.m-node circle { fill: var(--card); stroke: var(--cinnabar); stroke-width: 2; vector-effect: non-scaling-stroke; transition: fill .3s; }
.m-node.is-past circle { fill: var(--cinnabar); }
.m-node.is-now circle { fill: var(--cinnabar); }
.m-node .m-pulse { fill: none; stroke: var(--cinnabar); stroke-width: 2; opacity: 0; }
.m-node.is-now .m-pulse { animation: pulse 2.2s ease-out infinite; }
.m-node.is-now .m-pulse--2 { animation-delay: 1.1s; }
.m-node .m-pulse { transform-box: fill-box; transform-origin: center; }
@keyframes pulse { from { transform: scale(1); opacity: .7; } to { transform: scale(3.4); opacity: 0; } }
.m-node text { font-family: var(--serif); font-weight: 700; fill: var(--ink); paint-order: stroke; stroke: var(--map-land); stroke-width: 4px; stroke-linejoin: round; transition: fill .3s; }
.m-node:hover text { fill: var(--cinnabar); }
.m-walker { pointer-events: none; transition: transform .35s var(--ease); }
.is-moving .m-walker { transition: none; }
.m-cart { filter: drop-shadow(0 1px 1.5px rgba(40, 20, 10, .35)); }
.m-cart__shadow { fill: rgba(30, 20, 10, .22); }
.m-leg { stroke: #5a4330; stroke-width: 1.8; stroke-linecap: round; }
.m-wheel { animation: none; }
.m-pennant { transform-box: fill-box; transform-origin: left center; animation: pennant 1.4s ease-in-out infinite; }
@keyframes pennant { 50% { transform: skewY(-8deg) scaleX(.9); } }
.is-moving .m-wheel > * { animation: wheel .5s linear infinite; }
.is-moving .m-cart { animation: cartBob .25s ease-in-out infinite alternate; }
.is-moving .m-leg--a { animation: trotA .25s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: top; }
.is-moving .m-leg--b { animation: trotA .25s ease-in-out infinite alternate-reverse; transform-box: fill-box; transform-origin: top; }
@keyframes wheel { to { transform: rotate(360deg); } }
@keyframes cartBob { to { transform: translateY(-1.2px); } }
@keyframes trotA { from { transform: rotate(-14deg); } to { transform: rotate(14deg); } }
.m-dust { fill: color-mix(in srgb, var(--ochre) 50%, var(--map-land)); opacity: .7; animation: dust 1.1s ease-out forwards; transform-box: fill-box; transform-origin: center; pointer-events: none; }
@keyframes dust { to { transform: scale(3) translateY(-2px); opacity: 0; } }
.m-splash { fill: none; stroke: var(--cinnabar); stroke-width: 2.4; vector-effect: non-scaling-stroke; transform-box: fill-box; transform-origin: center; animation: splash 1.4s var(--ease) forwards; filter: url(#m-ink); }
.m-splash--2 { animation-delay: .25s; stroke-width: 1.2; }
@keyframes splash { from { transform: scale(.4); opacity: .9; } to { transform: scale(5.5); opacity: 0; } }
.m-stamp { animation: mapStamp 2.6s var(--spring) forwards; transform-box: fill-box; transform-origin: center; }
.m-stamp rect { fill: var(--cinnabar); }
.m-stamp__t text { font-family: var(--kai); fill: #fff6ec; }
@keyframes mapStamp { 0% { opacity: 0; transform: scale(2.4) rotate(-18deg); } 14% { opacity: 1; transform: scale(1) rotate(-6deg); } 80% { opacity: 1; transform: scale(1) rotate(-6deg); } 100% { opacity: 0; transform: scale(1) rotate(-6deg); } }
#rn-title.is-ink { animation: inkTitle .9s var(--ease) backwards; }
@keyframes inkTitle { from { opacity: 0; filter: blur(6px); letter-spacing: .3em; } to { opacity: 1; filter: none; } }

.route-panel { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 16px; padding: 20px; background: var(--paper-2); border-left: 1px solid var(--line); overflow-y: auto; }
.seg--route { align-self: flex-start; }
.route-now__meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.route-now h2 { font-size: 27px; margin-top: 6px; }
.route-now__place { color: var(--muted); font-size: 14px; margin-top: 4px; }
.scrub { width: 100%; accent-color: var(--cinnabar); -webkit-appearance: none; appearance: none; height: 22px; background: transparent; cursor: pointer; }
.scrub::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--cinnabar) var(--p, 0%), var(--line) var(--p, 0%)); }
.scrub::-moz-range-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--cinnabar) var(--p, 0%), var(--line) var(--p, 0%)); }
.scrub::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 4px; background: var(--cinnabar); background-image: var(--seal-tex); transform: rotate(45deg); box-shadow: 0 2px 6px color-mix(in srgb, var(--cinnabar) 45%, transparent); transition: transform .2s var(--spring); }
.scrub::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 4px; background: var(--cinnabar); transform: rotate(45deg); }
.scrub:active::-webkit-slider-thumb { transform: rotate(45deg) scale(1.25); }
.route-ctrl { display: flex; align-items: center; gap: 10px; }
.play-btn {
  width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--cinnabar); color: #fff;
  display: grid; place-items: center; box-shadow: 0 8px 22px color-mix(in srgb, var(--cinnabar) 38%, transparent);
}
.play-btn svg { font-size: 24px; }
.route-ctrl .chip-btn { margin-left: auto; }
.rn-card { display: grid; gap: 12px; animation: rise .4s var(--ease) backwards; }
.rn-card__text { color: var(--ink-2); font-size: 15px; }
.rn-card__people { font-size: 13.5px; color: var(--muted); }
.rn-card__alt { font-size: 13.5px; padding: 10px 12px; border-radius: 10px; background: var(--paper-3); color: var(--ink-2); }
.rn-card .btn { justify-self: start; }
.order-note { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* ---------- 闯关 ---------- */
.play-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.medals { display: flex; gap: 8px; }
.medal {
  width: 46px; height: 46px; display: grid; place-items: center; border-radius: 10px; font-family: var(--kai); font-size: 26px;
  border: 1.5px dashed var(--line-2); color: var(--line-2); background: transparent; transition: all .4s var(--spring);
}
.medal.is-new { animation: medalNew 1s var(--spring) backwards; }
@keyframes medalNew { from { transform: scale(2.4) rotate(-20deg); opacity: 0; } 60% { opacity: 1; } }
.medal.is-on { border: 0; background: var(--cinnabar); color: #fff6ec; background-image: var(--seal-tex); transform: rotate(-4deg); }
.medal:nth-child(2n).is-on { transform: rotate(3deg); }
.trail { position: relative; max-width: 900px; margin: 0 auto; padding: 10px 0 30px; }
.trail__path { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.trail__path path { fill: none; stroke: var(--line-2); stroke-width: 2.5; stroke-dasharray: 3 9; stroke-linecap: round; }
.trail__path path.is-done { stroke: var(--cinnabar); stroke-dasharray: none; }
.lv { position: relative; display: flex; align-items: center; gap: 16px; width: min(440px, 88%); margin: 0 0 18px; text-align: left; border: 0; background: none; padding: 6px; border-radius: 18px; }
.lv:nth-child(4n+2) { margin-left: 22%; }
.lv:nth-child(4n+3) { margin-left: 44%; }
.lv:nth-child(4n+4) { margin-left: 22%; }
.lv__node {
  position: relative; flex: none; width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card); border: 2px solid var(--line-2); font-family: var(--kai); font-size: 30px; color: var(--ink-2);
  transition: transform .3s var(--spring), box-shadow .3s;
}
.lv:hover .lv__node { transform: scale(1.06); }
.lv.is-open .lv__node { border-color: var(--cinnabar); color: var(--cinnabar); box-shadow: 0 0 0 6px color-mix(in srgb, var(--cinnabar) 14%, transparent); }
.lv.is-next .lv__node { animation: lvPulse 2s ease-in-out infinite; }
@keyframes lvPulse { 0%, 100% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--cinnabar) 16%, transparent); } 50% { box-shadow: 0 0 0 13px color-mix(in srgb, var(--cinnabar) 6%, transparent); } }
.lv.is-done .lv__node { background: var(--cinnabar); border-color: var(--cinnabar); color: #fff6ec; }
.lv.is-locked .lv__node { opacity: .55; }
.lv__lock { position: absolute; right: -3px; bottom: -3px; width: 24px; height: 24px; border-radius: 50%; background: var(--ink-2); color: var(--paper); display: grid; place-items: center; font-size: 13px; }
.lv__medal { position: absolute; right: -6px; top: -6px; width: 26px; height: 26px; border-radius: 7px; background: var(--ochre); color: #fff; font-family: var(--kai); font-size: 16px; display: grid; place-items: center; background-image: var(--seal-tex); }
.lv__meta { font-size: 12px; color: var(--muted); letter-spacing: .08em; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lv__title { font-family: var(--serif); font-weight: 700; font-size: 19px; color: var(--ink); }
.lv__sub { font-size: 13.5px; color: var(--muted); }
.lv.is-locked .lv__title { color: var(--muted); }

.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.game-card {
  position: relative; display: grid; gap: 6px; text-align: left; padding: 20px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--card); min-height: 172px; align-content: start; transition: transform .25s var(--ease), box-shadow .25s;
}
.game-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.game-card__icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--cinnabar-soft); color: var(--cinnabar); font-size: 23px; margin-bottom: 6px; }
.game-card strong { font-family: var(--serif); font-size: 19px; }
.game-card > span:not(.game-card__icon) { color: var(--muted); font-size: 14px; }
.game-card em { position: absolute; right: 16px; top: 18px; font-style: normal; font-size: 12px; color: var(--ochre); }

.people-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 22px; }
.people-count { color: var(--muted); font-size: 14px; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.person {
  position: relative; text-align: left; padding: 18px; border-radius: var(--r); border: 1px solid var(--line); background: var(--card);
  display: grid; gap: 6px; align-content: start; min-height: 200px; transition: transform .25s var(--ease), box-shadow .25s;
}
.person:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.person__seal { width: 52px; height: 52px; border-radius: 10px; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-family: var(--kai); font-size: 28px; background-image: var(--seal-tex); margin-bottom: 6px; }
.person strong { font-family: var(--serif); font-size: 19px; }
.person > span:not(.person__seal) { color: var(--muted); font-size: 13.5px; }
.person q { font-family: var(--serif); font-size: 14.5px; color: var(--ink-2); quotes: "“" "”"; }
.person.is-locked { opacity: .6; }
.person.is-locked .person__seal { background: var(--paper-3); color: var(--muted); }

/* ---------- 故事 ---------- */
.story-filter { display: flex; width: max-content; margin: 0 auto 26px; }
.stories { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.story-card {
  position: relative; display: grid; grid-template-rows: auto 1fr; text-align: left; padding: 0; border-radius: var(--r); overflow: hidden;
  border: 1px solid var(--line); background: var(--card); transition: transform .25s var(--ease), box-shadow .25s;
}
.story-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.story-card__art { aspect-ratio: 16 / 10; background: var(--paper-3); overflow: hidden; }
.story-card__art svg { width: 100%; height: 100%; display: block; }
.story-card__body { padding: 16px 18px 18px; display: grid; gap: 6px; align-content: start; }
.story-card__meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.story-card strong { font-family: var(--serif); font-size: 20px; }
.story-card p { color: var(--muted); font-size: 14px; line-height: 1.6; }
.story-card__done { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 8px; background: var(--cinnabar); color: #fff; display: grid; place-items: center; font-family: var(--kai); font-size: 18px; background-image: var(--seal-tex); }

/* 故事播放器 */
.book { position: relative; display: grid; grid-template-rows: minmax(0, 1fr) auto auto; height: 100%; max-width: 1100px; margin: 0 auto; width: 100%; }
.book__scene { position: relative; overflow: hidden; border-radius: 22px; background: var(--paper-3); box-shadow: var(--shadow); min-height: 0; }
.book__scene svg { width: 100%; height: 100%; display: block; }
.book__layer { position: absolute; inset: 0; animation: unroll 1s cubic-bezier(.5, .1, .25, 1) backwards;
  -webkit-mask-image: linear-gradient(90deg, #000 45%, rgba(0, 0, 0, .6) 50%, transparent 55%); mask-image: linear-gradient(90deg, #000 45%, rgba(0, 0, 0, .6) 50%, transparent 55%);
  -webkit-mask-size: 260% 100%; mask-size: 260% 100%; -webkit-mask-position: 0 0; mask-position: 0 0; }
.book__layer:only-child { animation: fade .8s ease backwards; }
@keyframes unroll { from { -webkit-mask-position: 100% 0; mask-position: 100% 0; } }
/* 故事画面上的一缕游雾 */
.book__scene::after { content: ""; position: absolute; left: -30%; right: -30%; top: 38%; height: 26%; pointer-events: none; z-index: 1;
  background: radial-gradient(50% 50% at 30% 50%, color-mix(in srgb, var(--paper-2) 55%, transparent), transparent 70%), radial-gradient(40% 50% at 75% 60%, color-mix(in srgb, var(--paper-2) 45%, transparent), transparent 70%);
  filter: blur(8px); animation: mist 22s ease-in-out infinite alternate; }
.book__cap {
  position: relative; z-index: 1; margin: -34px auto 0; width: min(780px, calc(100% - 24px)); min-height: 92px;
  padding: 14px 20px; border-radius: 16px; background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow); font-family: var(--serif); font-size: clamp(16px, 1.8vw, 19px); line-height: 1.8; text-align: center;
}
.book__cap .orig { display: block; font-family: var(--kai); font-size: .95em; color: var(--cinnabar); margin-top: 6px; }
.book__cap mark { background: none; color: var(--cinnabar); }
.book__ctrl { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px 0 4px; flex-wrap: wrap; }
.book__dots { display: flex; gap: 6px; }
.book__dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); transition: all .3s; }
.book__dots i.is-on { background: var(--cinnabar); width: 22px; border-radius: 4px; }
.book-end { max-width: 720px; margin: 0 auto; display: grid; gap: 16px; padding: 10px 0 30px; }
.book-end h3 { font-size: 26px; text-align: center; }
.source-box { padding: 16px 18px; display: grid; gap: 8px; }
.source-box header { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.source-box .quote { font-size: 16.5px; }

/* ---------- 舞台（关卡 / 游戏 / 故事） ---------- */
.stage { position: fixed; inset: 0; z-index: 60; background: var(--paper); display: grid; grid-template-rows: auto 1fr; animation: stageIn .45s var(--ease) backwards; }
@keyframes stageIn { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }
.stage__bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); border-bottom: 1px solid var(--line); background: var(--paper-2); }
.stage__title { font-family: var(--serif); font-weight: 700; font-size: 17px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage__hud { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stage__hud b { color: var(--cinnabar); font-size: 17px; }
.stage__body { overflow-y: auto; overflow-x: hidden; padding: 24px 20px 40px; padding-bottom: max(40px, env(safe-area-inset-bottom)); position: relative; }
.stage__body.is-fill { display: flex; flex-direction: column; padding: 16px 20px 20px; }
.stage__in { display: contents; }

.lvl { max-width: 780px; margin: 0 auto; display: grid; gap: 18px; }
.lvl__scene { position: relative; aspect-ratio: 16 / 7.5; border-radius: 22px; overflow: hidden; background: var(--paper-3); box-shadow: var(--shadow); }
.lvl__scene svg { width: 100%; height: 100%; display: block; }
.lvl__scene .lvl__say { position: absolute; right: 16px; top: 14px; max-width: 58%; font-size: 14px; }
.lvl__scene .lvl__say::before { display: none; }
.lvl__head { text-align: center; display: grid; gap: 6px; justify-items: center; }
.lvl__head .eyebrow { margin: 0; }
.lvl__head h2 { font-size: clamp(30px, 4.6vw, 46px); font-family: var(--kai); font-weight: 400; }
.lvl__where { color: var(--muted); font-size: 14px; display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.lvl__intro { font-family: var(--serif); font-size: 17px; line-height: 1.9; color: var(--ink-2); text-align: center; max-width: 36em; margin: 0 auto; }
.lvl__steps { display: flex; justify-content: center; gap: 6px; }
.lvl__steps i { width: 30px; height: 4px; border-radius: 2px; background: var(--line); transition: background .3s; }
.lvl__steps i.is-on { background: var(--cinnabar); }
.lvl__panel { display: grid; gap: 14px; animation: rise .45s var(--ease) backwards; }
.lvl__panel h3 { font-size: 20px; display: flex; align-items: center; gap: 10px; }
.lvl__panel h3 small { font-family: var(--sans); font-size: 13px; color: var(--muted); font-weight: 400; }
.lvl__bai { font-size: 15.5px; color: var(--ink-2); padding: 0 4px; }
.lvl__bai b { color: var(--cinnabar); font-weight: 600; }
.lvl__actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.choices { display: grid; gap: 10px; }
.fb { padding: 14px 16px; border-radius: 14px; background: var(--paper-3); font-size: 15px; display: grid; gap: 8px; animation: rise .4s var(--ease) backwards; }
.fb--ok { background: var(--bamboo-soft); }
.fb--no { background: var(--cinnabar-soft); }
.fb strong { font-family: var(--serif); }
.probe { display: grid; gap: 10px; }
.probe textarea {
  width: 100%; min-height: 96px; resize: vertical; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--card); font-size: 15.5px; line-height: 1.7; outline: none;
}
.probe textarea:focus { border-color: var(--cinnabar); }
.probe__chips { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ochre); font-weight: 600; letter-spacing: .04em; }
.ai-tag svg { font-size: 13px; }
.award { display: grid; justify-items: center; gap: 14px; text-align: center; padding: 10px 0; }
.award__seal {
  width: 120px; height: 120px; border-radius: 18px; background: var(--cinnabar); color: #fff6ec; display: grid; place-items: center;
  font-family: var(--kai); font-size: 74px; background-image: var(--seal-tex); transform: rotate(-5deg); animation: stamp .7s var(--spring) backwards;
}
@keyframes stamp { from { transform: scale(2.2) rotate(-14deg); opacity: 0; } 60% { opacity: 1; } to { transform: scale(1) rotate(-5deg); } }
.award h3 { font-size: 26px; }
.award p { color: var(--ink-2); max-width: 34em; }
.kcard { padding: 16px 18px; display: grid; gap: 8px; text-align: left; width: 100%; }
.kcard header { font-size: 12.5px; letter-spacing: .2em; color: var(--ochre); font-weight: 600; }
.kcard p { font-size: 15px; color: var(--ink-2); }

/* 小测 */
.quiz { display: grid; gap: 14px; }
.quiz__q { font-family: var(--serif); font-size: 20px; line-height: 1.6; text-align: center; }
.quiz__opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.timer { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.timer i { display: block; height: 100%; background: var(--cinnabar); transform-origin: left; }

/* 游戏通用 */
.game { max-width: 820px; margin: 0 auto; display: grid; gap: 18px; width: 100%; }
.game__intro { text-align: center; display: grid; gap: 10px; justify-items: center; padding: 10px 0; }
.game__intro h2 { font-family: var(--kai); font-weight: 400; font-size: 40px; }
.game__intro p { color: var(--ink-2); max-width: 32em; }
.game__icon { width: 80px; height: 80px; border-radius: 22px; display: grid; place-items: center; background: var(--cinnabar-soft); color: var(--cinnabar); font-size: 40px; }
.result { text-align: center; display: grid; gap: 12px; justify-items: center; padding: 20px 0; }
.result__score { font-family: var(--serif); font-size: 64px; color: var(--cinnabar); line-height: 1; }
.result__stars { display: flex; gap: 8px; font-size: 34px; color: var(--line-2); }
.result__stars .is-on { color: var(--ochre); }

.flip-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 100%; max-width: min(560px, 62vh); margin-inline: auto; }
.flip { display: block; width: 100%; aspect-ratio: 3 / 4; perspective: 800px; border: 0; background: none; padding: 0; }
.flip__in { display: block; position: relative; width: 100%; height: 100%; transition: transform .5s var(--ease); transform-style: preserve-3d; }
.flip.is-up .flip__in, .flip.is-done .flip__in { transform: rotateY(180deg); }
.flip__f, .flip__b { position: absolute; inset: 0; border-radius: 14px; backface-visibility: hidden; display: grid; place-items: center; padding: 8px; text-align: center; }
.flip__f { background: var(--cinnabar); color: #fff4ea; font-family: var(--kai); font-size: 34px; box-shadow: var(--shadow-sm); background-image: radial-gradient(circle at 50% 50%, transparent 38%, rgba(255,255,255,.08) 39%, transparent 41%); }
.flip__b { background: var(--card); border: 1.5px solid var(--line); transform: rotateY(180deg); font-family: var(--serif); font-size: 16px; line-height: 1.4; }
.flip__b b { display: block; font-family: var(--kai); font-size: 30px; color: var(--cinnabar); font-weight: 400; }
.flip.is-done .flip__b { border-color: var(--bamboo); background: var(--bamboo-soft); }

.order-list { display: grid; gap: 8px; }
.order-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--card); font-family: var(--serif); font-size: 17px; text-align: left; transition: border-color .2s, transform .25s var(--ease), background .2s;
}
.order-item b { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--paper-3); font-family: var(--sans); font-size: 13px; }
.order-item.is-sel { border-color: var(--cinnabar); background: var(--cinnabar-soft); }
.order-item.is-ok { border-color: var(--bamboo); background: var(--bamboo-soft); }
.order-pool { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.order-chip { padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); font-family: var(--serif); font-size: 16.5px; transition: transform .2s var(--ease), opacity .2s; }
.order-chip:hover { border-color: var(--cinnabar); }
.order-chip.is-used { opacity: .25; pointer-events: none; }
.order-slots { display: grid; gap: 8px; }
.order-slot { min-height: 50px; padding: 10px 14px; border-radius: 12px; border: 1.5px dashed var(--line-2); font-family: var(--serif); font-size: 17px; display: flex; align-items: center; gap: 10px; }
.order-slot b { font-family: var(--sans); font-size: 12px; color: var(--muted); width: 18px; }
.order-slot.is-filled { border-style: solid; background: var(--card); }
.order-slot.is-ok { border-color: var(--bamboo); background: var(--bamboo-soft); }
.order-slot.is-bad { border-color: var(--cinnabar); background: var(--cinnabar-soft); animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.garden { position: relative; border-radius: 22px; overflow: hidden; background: var(--paper-3); box-shadow: var(--shadow); touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.garden svg { width: 100%; height: auto; aspect-ratio: 800 / 380; display: block; }
.garden__tools { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.garden__tools .btn.is-on { background: var(--ink); color: var(--paper); }
.meter { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.meter b { color: var(--ink); font-variant-numeric: tabular-nums; }

.ripple { position: relative; aspect-ratio: 1; max-width: 520px; width: 100%; margin: 0 auto; }
.ripple svg { width: 100%; height: 100%; overflow: visible; }
.ripple__ring { fill: none; stroke: var(--line-2); stroke-width: 1.5; stroke-dasharray: 4 6; transition: stroke .5s, fill .5s; }
.ripple__ring.is-on { stroke: var(--cinnabar); stroke-dasharray: none; fill: color-mix(in srgb, var(--cinnabar) 6%, transparent); }
.ripple__label { font-family: var(--kai); font-size: 15px; fill: var(--muted); text-anchor: middle; }
.ripple__label.is-on { fill: var(--cinnabar); }
.ripple-opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

.jing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-width: 380px; width: 100%; margin: 0 auto; aspect-ratio: 1; padding: 8px; border-radius: 16px; background: color-mix(in srgb, var(--bamboo) 18%, var(--paper-3)); }
.jing__cell { border-radius: 10px; border: 1.5px dashed color-mix(in srgb, var(--bamboo) 45%, transparent); background: color-mix(in srgb, var(--bamboo-soft) 70%, transparent); display: grid; place-items: center; font-family: var(--kai); font-size: 20px; color: var(--bamboo); transition: background .3s, transform .3s var(--spring); position: relative; }
.jing__cell.is-public { background: color-mix(in srgb, var(--ochre) 28%, var(--paper-2)); border-style: solid; border-color: var(--ochre); color: var(--ochre); }
.jing__cell.is-family { background: var(--card); border-style: solid; border-color: var(--bamboo); }
.jing__cell.is-family::after { content: attr(data-f); position: absolute; bottom: 4px; font-family: var(--sans); font-size: 11px; color: var(--muted); }
.jing__cell.is-sown { background: color-mix(in srgb, var(--bamboo) 35%, var(--card)); }
.jing__cell.is-public.is-sown { background: color-mix(in srgb, var(--ochre) 55%, var(--card)); color: #fff; }
.jing__cell:active { transform: scale(.95); }
.tokens { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.token { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 1.5px solid var(--bamboo); font-family: var(--kai); font-size: 18px; color: var(--bamboo); transition: opacity .3s, transform .3s; }
.token.is-used { opacity: .2; transform: scale(.8); }

.qianx { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.qianx__place { display: grid; gap: 6px; justify-items: center; text-align: center; padding: 14px 10px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--card); transition: transform .25s var(--ease), border-color .25s, background .25s; }
.qianx__place svg { width: 100%; height: auto; max-height: 120px; }
.qianx__place strong { font-family: var(--serif); font-size: 17px; }
.qianx__place span { font-size: 13px; color: var(--muted); }
.qianx__place.is-here { border-color: var(--cinnabar); background: var(--cinnabar-soft); }

.slider-row { display: grid; gap: 8px; }
.slider-row input { width: 100%; accent-color: var(--cinnabar); }
.slider-row output { text-align: center; font-family: var(--serif); font-size: 18px; }

/* ---------- 书院：原典 ---------- */
.reader { display: grid; grid-template-columns: 250px 1fr; gap: 22px; align-items: start; }
.reader__toc { position: sticky; top: calc(var(--top) + 16px); max-height: calc(100vh - var(--top) - 32px); overflow-y: auto; padding: 8px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); scrollbar-width: thin; }
.toc-book { border-bottom: 1px solid var(--line); }
.toc-book:last-child { border-bottom: 0; }
.toc-book > button { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 10px 10px; border: 0; background: none; font-family: var(--serif); font-weight: 700; font-size: 15.5px; text-align: left; border-radius: 10px; }
.toc-book > button span { font-family: var(--sans); font-weight: 400; font-size: 12px; color: var(--muted); }
.toc-book > button:hover { background: var(--paper-3); }
.toc-book.is-open > button { color: var(--cinnabar); }
.toc-chs { display: none; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 2px 6px 10px; }
.toc-book.is-open .toc-chs { display: grid; }
.toc-chs a { display: grid; place-items: center; height: 30px; border-radius: 8px; font-size: 13px; text-decoration: none; color: var(--ink-2); font-variant-numeric: tabular-nums; position: relative; }
.toc-chs a:hover { background: var(--paper-3); }
.toc-chs a.is-key::after { content: ""; position: absolute; top: 4px; right: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--cinnabar); }
.toc-chs a.is-active { background: var(--cinnabar); color: #fff; }
.reader__main { min-width: 0; display: grid; gap: 16px; }
.reader__main > * { min-width: 0; }
.reader__bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; position: sticky; top: calc(var(--top) + 8px); z-index: 5; padding: 6px; margin: -6px; border-radius: 999px; background: color-mix(in srgb, var(--paper) 85%, transparent); backdrop-filter: blur(10px); }
.reader__tools { display: flex; gap: 6px; }
.reader__results { padding: 14px; display: grid; gap: 6px; max-height: 50vh; overflow-y: auto; }
.reader__results header { font-size: 13px; color: var(--muted); padding: 0 4px 4px; }
.hit { display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 9px 10px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-family: var(--serif); font-size: 15px; line-height: 1.6; }
.hit:hover { background: var(--paper-3); }
.hit b { font-family: var(--sans); font-size: 12px; color: var(--cinnabar); padding-top: 3px; }
.hit mark, .ch-text mark { background: color-mix(in srgb, var(--ochre) 30%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.reader__body { padding: 30px clamp(18px, 4vw, 48px) 36px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); min-height: 60vh; }
.ch-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.ch-head h2 { font-size: 28px; }
.ch-head h2 small { font-family: var(--sans); font-size: 14px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.ch-head .eyebrow { margin-bottom: 4px; }
.ch-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ch-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.ch-badge { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--ochre-soft); color: var(--ochre); }
.ch-badge--text { background: var(--bamboo-soft); color: var(--bamboo); }
.ch-text { font-family: var(--serif); font-size: var(--rs, 20px); line-height: 2.05; color: var(--ink); }
.ch-text p { margin: 0 0 .7em; text-indent: 2em; }
.ch-text.is-vertical { writing-mode: vertical-rl; height: min(66vh, 620px); max-width: 100%; overflow-x: auto; line-height: 2.2; padding-bottom: 8px; }
.ch-text.is-vertical p { margin: 0 0 0 .6em; }
.ch-notes { margin-top: 10px; font-size: 13px; color: var(--muted); }
.ch-study { margin-top: 26px; display: grid; gap: 14px; }
.ch-study h3 { font-size: 18px; display: flex; gap: 8px; align-items: center; }
.ch-study .card { padding: 16px 18px; }
.ch-bai { font-size: 15.5px; color: var(--ink-2); line-height: 1.9; }
.ch-words { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.ch-words div { padding: 8px 12px; border-radius: 10px; background: var(--paper-2); font-size: 14px; }
.ch-words b { font-family: var(--serif); color: var(--cinnabar); margin-right: 6px; }
.views { display: grid; gap: 10px; }
.view-item { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper-2); font-size: 14.5px; display: grid; gap: 4px; }
.view-item strong { font-family: var(--serif); }
.view-item span { color: var(--muted); font-size: 13px; }
.ch-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 26px; }
.ch-hl { animation: hl 2.4s ease-out; border-radius: 4px; }
@keyframes hl { from { background: color-mix(in srgb, var(--ochre) 40%, transparent); } to { background: transparent; } }

/* ---------- 书院：思想图谱 ---------- */
.atlas-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.atlas-hint { color: var(--muted); font-size: 14px; }
.atlas { position: relative; height: min(72vh, 680px); border-radius: 22px; background: var(--card); border: 1px solid var(--line); overflow: hidden; touch-action: none; }
.atlas__svg { width: 100%; height: 100%; display: block; }
.a-link { stroke: var(--line-2); stroke-width: 1.4; transition: stroke .3s, opacity .3s; }
.a-link.is-hl { stroke: var(--cinnabar); stroke-width: 2.2; }
.a-node { cursor: grab; }
.a-node circle { stroke: var(--card); stroke-width: 3; transition: r .3s; }
.a-node text { font-family: var(--serif); font-weight: 700; fill: var(--ink); text-anchor: middle; paint-order: stroke; stroke: var(--card); stroke-width: 4px; stroke-linejoin: round; pointer-events: none; }
.a-node.is-dim, .a-link.is-dim { opacity: .18; }
.atlas__legend { position: absolute; left: 14px; top: 14px; display: flex; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.atlas__legend span { display: inline-flex; align-items: center; gap: 5px; }
.atlas__legend i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.atlas__card { position: absolute; right: 14px; top: 14px; bottom: 14px; width: min(400px, calc(100% - 28px)); overflow-y: auto; padding: 20px; border-radius: 18px; background: color-mix(in srgb, var(--card) 96%, transparent); backdrop-filter: blur(10px); border: 1px solid var(--line); box-shadow: var(--shadow-lg); display: grid; gap: 14px; align-content: start; animation: rise .35s var(--ease) backwards; }
.atlas__card h3 { font-size: 24px; }
.atlas__card .x { position: absolute; right: 12px; top: 12px; }
.lvtabs { display: flex; gap: 4px; }
.lvtabs button { border: 1px solid var(--line); background: none; padding: 4px 11px; border-radius: 999px; font-size: 13px; color: var(--ink-2); }
.lvtabs button.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- 书院：课程 ---------- */
.class-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.course { text-align: left; padding: 18px 18px 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); display: grid; gap: 8px; align-content: start; border-left: 4px solid var(--c, var(--cinnabar)); transition: transform .25s var(--ease), box-shadow .25s; }
.course:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.course__stage { font-size: 12px; font-weight: 600; letter-spacing: .1em; color: var(--c); }
.course strong { font-family: var(--serif); font-size: 19px; }
.course p { font-size: 14px; color: var(--muted); }
.course__tags { display: flex; gap: 6px; flex-wrap: wrap; }
.course__tags span { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--paper-3); color: var(--ink-2); }

/* 详情面板 */
.sheet { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; }
.sheet__backdrop { position: absolute; inset: 0; border: 0; background: rgba(20, 14, 8, .42); backdrop-filter: blur(3px); animation: fade .3s backwards; }
@keyframes fade { from { opacity: 0; } }
.sheet__panel { position: relative; width: min(760px, calc(100% - 32px)); max-height: min(86vh, 900px); display: grid; grid-template-rows: auto 1fr; border-radius: 24px; background: var(--paper-2); box-shadow: var(--shadow-lg); overflow: hidden; animation: sheetIn .45s var(--ease) backwards; }
@keyframes sheetIn { from { opacity: 0; transform: translateY(24px) scale(.98); } }
.sheet__grip { display: none; }
.sheet__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 22px 24px 14px; border-bottom: 1px solid var(--line); }
.sheet__head h2 { font-size: 24px; }
.sheet__body { overflow-y: auto; padding: 18px 24px 28px; display: grid; gap: 16px; align-content: start; }
.sheet__body h4 { font-size: 16px; margin-top: 4px; }
.sheet__body ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; color: var(--ink-2); font-size: 15px; }
.links { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- 资料馆 ---------- */
.library { display: grid; gap: 34px; max-width: 980px; margin: 0 auto; }
.lib-sec { display: grid; gap: 14px; }
.lib-sec > h3 { font-size: 24px; }
.lib-sec > p { color: var(--ink-2); }
.grades { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.grades div { padding: 14px; display: grid; gap: 6px; align-content: start; font-size: 13.5px; color: var(--ink-2); }
.chrono { padding: 20px; display: grid; gap: 14px; }
.chrono__axis { position: relative; height: 26px; border-bottom: 1px solid var(--line-2); font-size: 11.5px; color: var(--muted); }
.chrono__axis span { position: absolute; bottom: 4px; transform: translateX(-50%); font-variant-numeric: tabular-nums; }
.chrono__row { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: center; font-size: 14px; }
.chrono__bar { position: relative; height: 26px; }
.chrono__bar i { position: absolute; top: 4px; bottom: 4px; border-radius: 6px; background: color-mix(in srgb, var(--c) 30%, transparent); border: 1.5px solid var(--c); }
.chrono__bar i.fuzzy { border-style: dashed; background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--c) 22%, transparent) 0 6px, transparent 6px 10px); }
.chrono__bar em { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.chrono__note { font-size: 13px; color: var(--muted); }
.src-table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--card); border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); }
.src-table th, .src-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.src-table th { font-size: 12.5px; color: var(--muted); font-weight: 600; background: var(--paper-2); }
.src-table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; border-radius: var(--r); }
.myths { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.myth { padding: 14px 16px; display: grid; gap: 6px; }
.myth s { color: var(--cinnabar); text-decoration-thickness: 1.5px; font-family: var(--serif); }
.myth p { font-size: 14px; color: var(--ink-2); }

/* ---------- AI 课堂 ---------- */
#view-ai.is-active { display: block; height: calc(100vh - var(--top)); }
.ai { display: grid; grid-template-columns: 280px 1fr 320px; height: 100%; }
.ai__side { border-right: 1px solid var(--line); background: var(--paper-2); padding: 18px 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.ai__status { padding: 10px 12px; border-radius: 12px; background: var(--paper-3); font-size: 12.5px; color: var(--ink-2); display: grid; gap: 4px; }
.ai__status b { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.ai__status b i { width: 8px; height: 8px; border-radius: 50%; background: var(--ochre); }
.ai__status.is-llm b i { background: var(--bamboo); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bamboo) 25%, transparent); }
.ai__lessons { display: grid; gap: 6px; }
.lesson { display: grid; gap: 3px; text-align: left; padding: 11px 12px; border-radius: 12px; border: 1px solid transparent; background: none; transition: background .2s, border-color .2s; }
.lesson:hover { background: var(--paper-3); }
.lesson.is-active { background: var(--card); border-color: var(--line); box-shadow: var(--shadow-sm); }
.lesson strong { font-family: var(--serif); font-size: 15.5px; display: flex; align-items: center; gap: 6px; }
.lesson span { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.lesson em { font-style: normal; font-size: 11px; padding: 1px 6px; border-radius: 5px; background: var(--paper-3); color: var(--ink-2); font-family: var(--sans); font-weight: 500; }
.lesson__done { color: var(--bamboo); font-size: 14px; }
.ai__rule { margin-top: auto; font-size: 12px; color: var(--muted); line-height: 1.6; padding: 10px 4px 0; border-top: 1px solid var(--line); }
.ai__main { display: grid; grid-template-rows: auto 1fr auto auto; min-height: 0; min-width: 0; }
.ai__head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.ai__menu { display: none; }
.ai__title { flex: 1; min-width: 0; }
.ai__title .eyebrow { margin: 0 0 2px; font-size: 11px; }
.ai__title h2 { font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai__steps { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.ai__steps li { font-size: 11.5px; padding: 3px 8px; border-radius: 999px; background: var(--paper-3); color: var(--muted); white-space: nowrap; transition: all .3s; }
.ai__steps li.is-done { background: var(--bamboo-soft); color: var(--bamboo); }
.ai__steps li.is-now { background: var(--cinnabar); color: #fff; }
.ai__log { overflow-y: auto; padding: 22px 20px 12px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.msg { display: flex; gap: 10px; max-width: 760px; width: 100%; animation: rise .35s var(--ease) backwards; }
.msg__av { flex: none; width: 34px; height: 40px; }
.msg__av .mascot, .msg__av .mascot * { animation: none !important; }
.msg__av--u { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--paper); font-family: var(--kai); font-size: 17px; }
.msg__body { min-width: 0; display: grid; gap: 6px; }
.msg__caret { display: inline-block; width: .45em; height: 1.05em; margin-left: 2px; vertical-align: -.15em; border-radius: 1px; background: var(--cinnabar); opacity: .55; animation: caret 1s steps(2, start) infinite; }
@keyframes caret { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .msg__caret { animation: none; } }
.msg__bubble { padding: 12px 15px; border-radius: 4px 16px 16px 16px; background: var(--card); border: 1px solid var(--line); font-size: 15.5px; line-height: 1.75; overflow-wrap: anywhere; }
.msg__bubble p + p { margin-top: 8px; }
.msg__bubble q { font-family: var(--kai); font-size: 1.04em; color: var(--cinnabar); quotes: "“" "”"; }
.msg__bubble q.is-unverified { color: var(--ochre); text-decoration: underline wavy color-mix(in srgb, var(--ochre) 60%, transparent); text-underline-offset: 4px; }
.msg__bubble ul, .msg__bubble ol { margin: 6px 0; padding-left: 1.3em; }
.msg__bubble strong { color: var(--ink); }
.msg__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.msg__meta .ai-tag { font-size: 11.5px; }
.msg__meta button { border: 0; background: none; color: var(--muted); font-size: 12px; padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.msg__warn { font-size: 12.5px; color: var(--ochre); display: flex; align-items: center; gap: 5px; }
.msg--u { align-self: flex-end; flex-direction: row-reverse; }
.msg--u .msg__bubble { background: var(--ink); color: var(--paper); border-color: var(--ink); border-radius: 16px 4px 16px 16px; }
.msg--sys { align-self: center; max-width: 560px; }
.msg--sys .msg__bubble { background: var(--paper-3); border: 0; border-radius: 12px; font-size: 13.5px; color: var(--ink-2); text-align: center; }
.score { display: grid; gap: 8px; margin-top: 6px; }
.score__row { display: grid; grid-template-columns: 100px 1fr 46px; gap: 10px; align-items: center; font-size: 13.5px; }
.score__bar { height: 8px; border-radius: 4px; background: var(--paper-3); overflow: hidden; }
.score__bar i { display: block; height: 100%; background: var(--bamboo); border-radius: 4px; transform-origin: left; animation: grow 1s var(--ease) backwards; }
@keyframes grow { from { transform: scaleX(0); } }
.score__row b { text-align: right; font-variant-numeric: tabular-nums; }
.score__total { font-family: var(--serif); font-size: 22px; color: var(--cinnabar); }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: typing 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { opacity: .25; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.ai__suggest { display: flex; gap: 8px; padding: 0 20px 10px; overflow-x: auto; scrollbar-width: none; }
.ai__suggest::-webkit-scrollbar { display: none; }
.ai__suggest button { flex: none; border: 1px solid var(--line); background: var(--card); padding: 7px 13px; border-radius: 999px; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; }
.ai__suggest button:hover { border-color: var(--cinnabar); color: var(--cinnabar); }
.ai__form { display: flex; gap: 10px; align-items: flex-end; padding: 12px 20px 18px; border-top: 1px solid var(--line); background: var(--paper-2); }
.ai__form textarea { flex: 1; resize: none; max-height: 160px; min-height: 46px; padding: 11px 15px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--card); outline: none; font-size: 15.5px; line-height: 1.55; }
.ai__form textarea:focus { border-color: var(--cinnabar); }
.ai__send { width: 46px; height: 46px; padding: 0; }
.ai__evidence { border-left: 1px solid var(--line); background: var(--paper-2); display: grid; grid-template-rows: auto 1fr; min-height: 0; }
.ai__evhead { padding: 16px 16px 10px; display: grid; gap: 2px; }
.ai__evhead strong { font-family: var(--serif); font-size: 16px; }
.ai__evhead span { font-size: 12px; color: var(--muted); }
.ai__evlist { overflow-y: auto; padding: 0 12px 16px; display: grid; gap: 10px; align-content: start; }
.ev { padding: 12px 13px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); display: grid; gap: 8px; animation: rise .35s var(--ease) backwards; }
.ev header { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--muted); }
.ev p { font-family: var(--serif); font-size: 15px; line-height: 1.8; }
.ev p mark { background: color-mix(in srgb, var(--ochre) 28%, transparent); color: inherit; border-radius: 3px; }
.ev footer { display: flex; gap: 6px; }
.ev footer button { border: 1px solid var(--line); background: none; padding: 3px 10px; border-radius: 999px; font-size: 12px; color: var(--ink-2); display: inline-flex; gap: 4px; align-items: center; }
.ev footer button:hover { border-color: var(--cinnabar); color: var(--cinnabar); }
.ev-empty { font-size: 13px; color: var(--muted); padding: 10px 4px; line-height: 1.7; }

/* ---------- 年龄选择 ---------- */
.age-modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(20, 14, 8, .38); backdrop-filter: blur(6px); animation: fade .3s backwards; }
.age-modal__panel { position: relative; width: min(720px, 100%); padding: 66px 24px 24px; border-radius: 26px; background: var(--paper-2); box-shadow: var(--shadow-lg); text-align: center; animation: sheetIn .5s var(--ease) backwards; }
.age-modal__mascot { position: absolute; left: 50%; top: -62px; width: 92px; height: 120px; transform: translateX(-50%); }
.age-modal__panel h2 { font-size: 26px; }
.age-modal__panel > p { color: var(--muted); margin: 6px 0 20px; }
.age-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.age-opt { display: grid; gap: 4px; justify-items: center; padding: 18px 10px 16px; border-radius: 18px; border: 1.5px solid var(--line); background: var(--card); transition: transform .25s var(--spring), border-color .2s; animation: rise .5s var(--ease) backwards; animation-delay: calc(var(--i) * 70ms + .15s); }
.age-opt:hover { transform: translateY(-4px); border-color: var(--line-2); }
.age-opt.is-active { border-color: var(--cinnabar); box-shadow: 0 0 0 4px color-mix(in srgb, var(--cinnabar) 14%, transparent); }
.age-opt__seal { width: 50px; height: 50px; border-radius: 12px; display: grid; place-items: center; font-family: var(--kai); font-size: 27px; color: #fff6ec; background: var(--c); background-image: var(--seal-tex); margin-bottom: 6px; }
.age-opt strong { font-family: var(--serif); font-size: 20px; }
.age-opt em { font-style: normal; font-size: 12.5px; color: var(--cinnabar); font-weight: 600; }
.age-opt > span:last-child { font-size: 12.5px; color: var(--muted); line-height: 1.5; }

/* ---------- 提示与彩带 ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 95; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 11px 18px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 14.5px; box-shadow: var(--shadow-lg); transition: opacity .3s, transform .3s var(--ease); max-width: calc(100% - 32px); text-align: center; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.confetti { position: fixed; inset: 0; z-index: 96; pointer-events: none; width: 100%; height: 100%; }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .nav a { padding: 7px 11px; }
  .ai { grid-template-columns: 250px 1fr; }
  .ai__evidence { display: none; }
  .ai.show-ev .ai__evidence { display: grid; position: fixed; right: 0; top: var(--top); bottom: 0; width: min(340px, 90vw); z-index: 30; box-shadow: var(--shadow-lg); }
}
@media (max-width: 980px) {
  :root { --tabbar: 64px; }
  .nav { display: none; }
  .topbar { gap: 10px; padding: 0 14px; }
  .topbar__tools { margin-left: auto; }
  .tabbar {
    display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; inset: auto 0 0 0; z-index: 40;
    height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--paper-2) 92%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  }
  .tabbar a { display: grid; justify-items: center; align-content: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: 10.5px; }
  .tabbar a svg { font-size: 21px; }
  .tabbar a.is-active { color: var(--cinnabar); font-weight: 600; }
  .tabbar__main svg { color: var(--ochre); }
  .view { padding-bottom: calc(var(--tabbar) + 40px); }
  .view--full { padding-bottom: 0; }
  #view-route.is-active { grid-template-columns: 1fr; grid-template-rows: 1fr auto; height: calc(100vh - var(--top) - var(--tabbar)); height: calc(100dvh - var(--top) - var(--tabbar)); }
  .route-panel { border-left: 0; border-top: 1px solid var(--line); max-height: 48vh; padding: 14px 16px; gap: 12px; }
  .route-now h2 { font-size: 22px; }
  .order-note { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
  .order-note.is-open { -webkit-line-clamp: unset; }
  .order-note:not(.is-open)::after { content: ''; }
  #view-ai.is-active { height: calc(100vh - var(--top) - var(--tabbar)); height: calc(100dvh - var(--top) - var(--tabbar)); }
  .ai { grid-template-columns: 1fr; }
  .ai__side { display: none; position: fixed; left: 0; top: var(--top); bottom: var(--tabbar); width: min(320px, 88vw); z-index: 30; box-shadow: var(--shadow-lg); }
  .ai.show-side .ai__side { display: flex; }
  .ai__menu { display: inline-grid; }
  .ai__steps { display: none; }
  .reader { grid-template-columns: 1fr; }
  .reader__toc { position: static; max-height: none; display: flex; gap: 6px; overflow-x: auto; padding: 6px; flex-wrap: nowrap; }
  .toc-book { border: 0; flex: none; }
  .toc-book > button { white-space: nowrap; padding: 8px 12px; }
  .toc-book > button span { display: none; }
  .toc-book .toc-chs { display: none !important; }
  .reader__chips { display: flex; }
  .stage { bottom: 0; }
  .toast { bottom: calc(var(--tabbar) + 20px); }
}
@media (max-width: 720px) {
  .map .sand3d.is-real .sand3d__title { display: none; } /* 手机上地图只有半屏，章节标题与下方面板重复 */
  /* 首页路线预览：手机上地图缩小近一半，字号同比放大，保证约 12–13px 可读 */
  .home-map .home-map__node text { font-size: 23px; stroke-width: 5; }
  .home-map .home-map__geography { font-size: 21px; }
  .home-map .home-map__north, .home-map .home-map__scale { font-size: 17px; }
  .home-map .home-map__dot { r: 6; }
  .map-mode { top: 10px; } .map-mode button { padding: 5px 10px; font-size: 12.5px; }
  .sand3d__hint { display: none; }
  .map.is-3d .map-compass { display: block; width: 40px; height: 40px; right: 12px; bottom: 36px; }
  .map-title, .map-compass { display: none; }
  .map-scale { bottom: 34px; }
  .map-layers { right: 58px; width: min(250px, calc(100% - 70px)); }
  .map-note { max-width: calc(100% - 28px); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body { font-size: 15.5px; }
  .brand__text small { display: none; }
  .age-btn::before { display: none; }
  .age-btn { padding: 0 12px; }
  .icon-btn { width: 36px; height: 36px; }
  .view { padding: 22px 16px calc(var(--tabbar) + 40px); }
  .view--full { padding: 0; }
  .hero { margin: 0 -16px; padding: 30px 16px 40px; min-height: auto; }
  .hero__title { font-size: 104px; }
  .hero__sub br { display: none; }
  .hero__cta .btn { flex: 1; }
  .br-m { display: inline; }
  .ask-li { padding: 40px 0 10px; }
  .ask-li__opts { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 30px; }
  .entries__grid { grid-template-columns: 1fr; }
  .entry, .entry:nth-child(1), .entry:nth-child(2) { grid-column: auto; min-height: 0; }
  .tabs { margin-bottom: 20px; }
  .tab { flex-direction: column; gap: 2px; height: 56px; font-size: 12.5px; }
  .lv, .lv:nth-child(n) { margin-left: 0; width: 100%; }
  .lv__node { width: 62px; height: 62px; font-size: 26px; }
  .trail__path { display: none; }
  .trail { border-left: 2px dashed var(--line-2); margin-left: 31px; padding-left: 0; }
  .lv { margin-left: -37px !important; }
  .medal { width: 38px; height: 38px; font-size: 22px; }
  .quiz__opts, .ripple-opts { grid-template-columns: 1fr; }
  .flip-grid { gap: 7px; }
  .flip__b { font-size: 13.5px; padding: 5px; }
  .flip__b b { font-size: 24px; }
  .flip__f { font-size: 26px; }
  .qianx { grid-template-columns: 1fr; }
  .qianx__place { grid-template-columns: 90px 1fr; text-align: left; justify-items: start; align-items: center; }
  .qianx__place svg { grid-row: span 2; }
  .grades { grid-template-columns: 1fr; }
  .myths { grid-template-columns: 1fr; }
  .chrono__row { grid-template-columns: 1fr; gap: 4px; }
  .age-opts { grid-template-columns: repeat(2, 1fr); }
  .age-modal__panel { padding: 60px 14px 16px; }
  .sheet { place-items: end center; }
  .sheet__panel { width: 100%; max-height: 88vh; border-radius: 24px 24px 0 0; animation-name: sheetUp; }
  @keyframes sheetUp { from { transform: translateY(100%); } }
  .sheet__grip { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 8px auto 0; }
  .sheet__head { padding: 12px 18px 12px; }
  .sheet__body { padding: 14px 18px calc(28px + env(safe-area-inset-bottom)); }
  .reader__body { padding: 22px 16px 26px; }
  .ch-head h2 { font-size: 23px; }
  .reader__bar { border-radius: 16px; }
  .reader__tools { width: 100%; }
  .reader__tools .chip-btn { flex: 1; justify-content: center; }
  .atlas { height: 64vh; }
  .atlas__card { left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; max-height: 70%; }
  .lvl__scene { aspect-ratio: 16 / 10; }
  .lvl__scene .lvl__say { max-width: 70%; font-size: 13px; padding: 8px 11px; right: 10px; top: 10px; }
  .book__cap { margin-top: -20px; padding: 10px 14px; min-height: 0; }
  .ai__log { padding: 16px 12px 10px; }
  .ai__form { padding: 10px 12px 12px; }
  .ai__suggest { padding: 0 12px 8px; }
  .ai__head { padding: 10px 12px; }
  .score__row { grid-template-columns: 76px 1fr 40px; }
  .game__intro h2 { font-size: 32px; }
  .story-filter { width: 100%; }
}
/* 平面图 / 3D 沙盘 */
.map-mode { position: absolute; z-index: 5; left: 50%; top: 14px; translate: -50% 0; box-shadow: var(--shadow); background: color-mix(in srgb, var(--paper-2) 92%, transparent); backdrop-filter: blur(6px); }
.map-mode button { padding: 7px 14px; font-size: 13.5px; }
.sand3d { position: absolute; inset: 0; z-index: 2; overflow: hidden; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
  background: radial-gradient(120% 90% at 50% 30%, color-mix(in srgb, var(--paper-2) 96%, transparent), color-mix(in srgb, var(--paper-3) 90%, var(--ink) 6%)); }
.sand3d:active { cursor: grabbing; }
.sand3d[hidden] { display: none; }
.sand3d canvas { display: block; width: 100%; height: 100%; animation: fade .8s backwards; }
.sand3d__labels { position: absolute; inset: 0; pointer-events: none; }
.sand3d__hint { position: absolute; right: 14px; bottom: 116px; z-index: 1; font-size: 11.5px; color: var(--muted); background: color-mix(in srgb, var(--paper) 80%, transparent); padding: 3px 9px; border-radius: 6px; pointer-events: none; animation: fade 1s 1s backwards; }
.sl { position: absolute; left: 0; top: 0; white-space: nowrap; transition: opacity .25s; will-change: transform; font-family: var(--kai); }
.sl--node { pointer-events: auto; cursor: pointer; font-family: var(--serif); font-weight: 700; font-size: 14px; color: var(--ink); padding: 2px 8px 3px; border-radius: 7px; background: color-mix(in srgb, var(--card) 88%, transparent); border: 1.5px solid var(--cinnabar); box-shadow: var(--shadow-sm); }
.sl--node::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1.5px; height: 10px; background: var(--cinnabar); }
.sl--node.is-past { background: var(--cinnabar-soft); }
.sl--node.is-now { background: var(--cinnabar); color: #fff6ec; z-index: 2; }
.sl--node.is-stamp { animation: slStamp .7s var(--spring); }
@keyframes slStamp { from { transform-origin: bottom; scale: 2.2; rotate: -14deg; opacity: 0; } 60% { opacity: 1; } }
.sl--cap { font-size: 13px; color: var(--ink-2); text-shadow: 0 0 3px var(--paper-2), 0 0 3px var(--paper-2); }
.sl--cap small { font-size: 10px; color: var(--muted); margin-left: 2px; }
.sl--peak { display: grid; justify-items: center; line-height: 1.15; padding: 3px 8px 4px; border-radius: 8px; background: rgba(255, 250, 240, .86); border: 1px solid rgba(122, 42, 32, .35); box-shadow: 0 2px 6px rgba(40, 20, 10, .15); color: #4a2a1a; }
.sl--peak b { font-family: var(--kai); font-size: 15px; font-weight: 400; letter-spacing: .1em; }
.sl--peak small { font-family: var(--sans); font-size: 10px; color: #7a5a40; }
.sl--peak::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: 8px; background: rgba(122, 42, 32, .5); }
.sl--range { font-family: var(--kai); font-size: 14px; letter-spacing: .4em; color: rgba(74, 46, 26, .75); text-shadow: 0 0 4px rgba(255, 248, 235, .95); }
.sand3d.is-dragging { cursor: grabbing; }
.sand3d.is-dragging .sl { pointer-events: none; }
/* 积木风格：深色圆角胶囊 + 白字，前面一粒积木小图标 */
.sand3d.is-brick { background: radial-gradient(120% 90% at 50% 25%, #f1ece4, #ded6ca); }
.sand3d.is-brick .sl { font-family: "PingFang SC", "Hiragino Sans GB", var(--sans); font-weight: 600; }
.sand3d.is-brick .sl--node { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 6px; border: 0; border-radius: 999px; background: #1b2a34; color: #fff; font-size: 13px; box-shadow: 0 3px 0 rgba(0,0,0,.25), 0 6px 14px rgba(20,30,40,.25); }
.sand3d.is-brick .sl--node::before { content: ""; width: 12px; height: 12px; border-radius: 3px; background: radial-gradient(circle at 50% 50%, rgba(255,255,255,.45) 0 26%, transparent 30%), #f2cd37; box-shadow: inset 0 -2px 0 rgba(0,0,0,.18); }
.sand3d.is-brick .sl--node::after { background: #1b2a34; width: 2px; }
.sand3d.is-brick .sl--node.is-past { background: #3a4a55; }
.sand3d.is-brick .sl--node.is-past::before { background: radial-gradient(circle, rgba(255,255,255,.45) 0 26%, transparent 30%), #c91a09; }
.sand3d.is-brick .sl--node.is-now { background: #c91a09; color: #fff; }
.sand3d.is-brick .sl--node.is-now::before { background: radial-gradient(circle, rgba(255,255,255,.5) 0 26%, transparent 30%), #f2f2ee; }
.sand3d.is-brick .sl--node.is-stamp { animation: brickPop .5s steps(6, end); }
@keyframes brickPop { 0% { translate: 0 -26px; } 50% { translate: 0 2px; } 70% { translate: 0 -3px; } 100% { translate: 0 0; } }
.sand3d.is-brick .sl--peak { background: #f2f2ee; border: 0; border-radius: 10px; box-shadow: 0 3px 0 #a0a5a9, 0 6px 12px rgba(20,30,40,.2); color: #1b2a34; }
.sand3d.is-brick .sl--peak b { font-family: inherit; font-weight: 700; font-size: 13px; letter-spacing: .05em; }
.sand3d.is-brick .sl--peak small { color: #5a6670; font-family: inherit; font-weight: 500; }
.sand3d.is-brick .sl--peak::after { background: #6c6e68; }
.sand3d.is-brick .sl--cap { font-size: 11.5px; color: #1b2a34; padding: 1px 7px; border-radius: 999px; background: rgba(242,242,238,.88); text-shadow: none; }
.sand3d.is-brick .sl--cap small { color: #6c6e68; }
.sand3d.is-brick .sl--river { font-style: normal; font-size: 11px; color: #fff; padding: 1px 7px; border-radius: 999px; background: rgba(0,85,191,.82); text-shadow: none; }
.sand3d.is-brick .sl--range { font-family: inherit; font-weight: 700; letter-spacing: .3em; color: rgba(27,42,52,.7); text-shadow: 0 0 4px rgba(255,255,255,.9); }
.sp__style { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 3px; border-radius: 10px; background: var(--paper-3); }
.sp__style button { border: 0; background: none; padding: 6px 0; border-radius: 8px; font-size: 13px; color: var(--ink-2); }
.sp__style button.is-on { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }
.sp__bricks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 8px; font-size: 12px; color: var(--ink-2); }
.sp__bricks span { display: flex; align-items: center; gap: 6px; }
.sp__bricks i { width: 16px; height: 12px; border-radius: 3px; box-shadow: inset 0 -2px 0 rgba(0,0,0,.18); background-image: radial-gradient(circle at 30% 45%, rgba(255,255,255,.4) 0 18%, transparent 22%), radial-gradient(circle at 72% 45%, rgba(255,255,255,.4) 0 18%, transparent 22%) !important; }
.sp__bricks small { color: var(--muted); font-size: 10.5px; margin-left: auto; font-variant-numeric: tabular-nums; }
/* 实景（写实）风格：深色展台 + 悬浮地块 + 玻璃卡片标签（青色描边、英文小字） */
.sand3d.is-real { --rx-c: #7fd6d6; --rx-bg: rgba(12, 22, 30, .84); --rx-line: rgba(127, 214, 214, .28);
  background:
    linear-gradient(rgba(127,214,214,.045) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, rgba(127,214,214,.045) 1px, transparent 1px) 0 0 / 48px 48px,
    radial-gradient(110% 80% at 50% 38%, #1a2a35 0%, #0d161d 55%, #070b10 100%); }
.sand3d.is-real .sl { font-family: "PingFang SC", "Hiragino Sans GB", var(--sans); }
.sand3d.is-real .sl small, .sand3d.is-real .sl em { display: block; font-style: normal; font-size: 9px; letter-spacing: .16em; color: rgba(200, 230, 232, .62); font-weight: 500; text-transform: uppercase; }
.sand3d.is-real .sl--node { display: grid; gap: 1px; padding: 5px 10px 5px 9px; border: 0; border-left: 3px solid var(--rx-c); border-radius: 4px; background: var(--rx-bg); color: #eef6f6; font-size: 13.5px; font-weight: 600; letter-spacing: .04em; box-shadow: 0 8px 22px rgba(0,0,0,.35); backdrop-filter: blur(6px); }
.sand3d.is-real .sl--node::after { left: 9px; width: 1px; height: 16px; background: var(--rx-c); }
.sand3d.is-real .sl--node::before { content: ""; position: absolute; left: 4px; top: calc(100% + 15px); width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--rx-c); background: rgba(8,16,22,.85); box-shadow: 0 0 10px rgba(127,214,214,.6); }
.sand3d.is-real .sl--node.is-past { border-left-color: rgba(224, 97, 79, .9); }
.sand3d.is-real .sl--node.is-now { background: rgba(168, 50, 42, .92); border-left-color: #ffd7a8; }
.sand3d.is-real .sl--node.is-now::before { border-color: #ffd7a8; box-shadow: 0 0 14px rgba(255, 200, 150, .9); }
.sand3d.is-real .sl--node { transform-origin: 9px 100%; }
.sand3d.is-real .sl--peak { display: grid; justify-items: start; padding: 5px 10px 5px 9px; border: 0; border-left: 3px solid #e7c98c; border-radius: 4px; background: var(--rx-bg); color: #f3efe6; box-shadow: 0 8px 22px rgba(0,0,0,.35); backdrop-filter: blur(6px); }
.sand3d.is-real .sl--peak b { font-family: inherit; font-weight: 600; font-size: 13px; letter-spacing: .06em; }
.sand3d.is-real .sl--peak small { color: rgba(240, 225, 190, .8); letter-spacing: .04em; text-transform: none; font-size: 10px; }
.sand3d.is-real .sl--peak::after { left: 9px; background: #e7c98c; }
.sand3d.is-real .sl--cap { font-size: 11.5px; color: #dfeaea; text-shadow: 0 1px 3px rgba(0,0,0,.9); }
.sand3d.is-real .sl--cap small { display: inline; color: rgba(200,230,232,.6); letter-spacing: .08em; }
.sand3d.is-real .sl--river { font-style: normal; font-size: 11px; color: #bff0f2; text-shadow: 0 1px 3px rgba(0,0,0,.85); }
.sand3d.is-real .sl--range, .sand3d.is-real .sl--landform { color: rgba(240, 246, 246, .88); text-shadow: 0 1px 4px rgba(0,0,0,.85); }
.sand3d.is-real .sl--landform small { color: rgba(200,230,232,.7); }
.sand3d.is-real .sl--wetland { color: #bff0f2; text-shadow: 0 1px 3px rgba(0,0,0,.85); }
.sand3d.is-brick .sl--node small, .sand3d.is-brick .sl--peak em { display: none; }
.sand3d:not(.is-real) .sl--peak em { display: none; }
/* 左上章节标题 */
.sand3d__title { display: none; position: absolute; z-index: 2; left: 0; top: 0; padding: 18px 60px 28px 22px; max-width: 52%; pointer-events: none; color: #eef6f6;
  background: radial-gradient(120% 120% at 0 0, rgba(7,12,17,.78), rgba(7,12,17,.45) 55%, transparent 80%); border-bottom-right-radius: 40px; }
.sand3d.is-real .sand3d__title { display: block; }
.sand3d__title p { font: 600 11px/1.4 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .22em; color: #7fd6d6; }
.sand3d__title h3 { margin-top: 6px; font: 700 30px/1.15 "PingFang SC", var(--sans); letter-spacing: .06em; color: #fff; text-shadow: 0 2px 16px rgba(0,0,0,.5); }
.sand3d__title span { display: block; margin-top: 6px; font-size: 11px; letter-spacing: .2em; color: rgba(200, 230, 232, .7); }
.sand3d__title.is-in > * { animation: rise .6s var(--ease) backwards; }
.sand3d__title.is-in h3 { animation-delay: .06s; } .sand3d__title.is-in span { animation-delay: .12s; }
/* 面板、提示、比例尺换成深色玻璃 */
.sand3d.is-real .sand3d__panel { background: rgba(12, 22, 30, .86); border-color: rgba(127,214,214,.22); color: #dfeaea; box-shadow: 0 16px 40px rgba(0,0,0,.45); }
.sand3d.is-real .sp__head { color: #eef6f6; }
.sand3d.is-real .sp__head svg, .sand3d.is-real .sp__note, .sand3d.is-real .sp__eyebrow, .sand3d.is-real .sp__ticks, .sand3d.is-real .sp__sources { color: rgba(200, 225, 228, .68); }
.sand3d.is-real .sp__style { background: rgba(255,255,255,.06); }
.sand3d.is-real .sp__style button { color: rgba(220,235,236,.7); }
.sand3d.is-real .sp__style button.is-on { background: rgba(127,214,214,.18); color: #fff; box-shadow: inset 0 0 0 1px rgba(127,214,214,.45); }
.sand3d.is-real .map-chk { background: rgba(255,255,255,.06); color: #dfeaea; }
.sand3d.is-real .map-chk input, .sand3d.is-real .sp__range input { accent-color: #7fd6d6; }
.sand3d.is-real .sp__range { color: #dfeaea; }
.sand3d.is-real .sp__range b { color: #7fd6d6; }
.sand3d.is-real .sp__presets button { background: rgba(255,255,255,.06); color: #dfeaea; border-color: rgba(127,214,214,.2); }
.sand3d.is-real .sp__presets button[aria-pressed="true"] { background: rgba(127,214,214,.18); color: #fff; border-color: rgba(127,214,214,.6); }
.sand3d.is-real .sand3d__hint, .sand3d.is-real .sand3d__scale { background: rgba(12,22,30,.7); color: rgba(200,225,228,.75); }
.sand3d.is-real .sand3d__scale i { border-color: rgba(200,225,228,.75); }
.sp__nat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 8px; font-size: 11.5px; }
.sp__nat span { display: flex; align-items: center; gap: 5px; }
.sp__nat i { width: 12px; height: 12px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.map.is-3d.is-real3d .map__zoom .icon-btn, .map.is-3d.is-real3d .map-mode { background: rgba(12,22,30,.82); color: #dfeaea; border-color: rgba(127,214,214,.25); }
.map.is-3d.is-real3d .map-mode button { color: rgba(220,235,236,.75); }
.map.is-3d.is-real3d .map-mode .seg__ink { background: rgba(127,214,214,.2); }
.map.is-3d.is-real3d .map-mode button.is-active { color: #fff; }
.map.is-3d.is-real3d .map-note { background: rgba(12,22,30,.75); color: rgba(200,225,228,.75); }
.map.is-3d.is-real3d .mc-ring { fill: rgba(12,22,30,.7); stroke: rgba(127,214,214,.5); }
/* 3D 图例与设置 */
.sand3d__panel { position: absolute; z-index: 3; left: 14px; bottom: 44px; width: 232px; border-radius: 14px; background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(8px); box-shadow: var(--shadow); border: 1px solid var(--line); cursor: default; overflow: hidden; }
.sp__head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; border: 0; background: none; font-size: 13px; font-weight: 600; color: var(--ink); }
.sp__head svg { width: 16px; height: 16px; color: var(--muted); }
.sp__body { display: grid; gap: 8px; padding: 0 12px 12px; }
.sand3d__panel.is-closed { width: auto; }
.sand3d__panel.is-closed .sp__body { display: none; }
.sp__legend { display: flex; height: 10px; border-radius: 3px; overflow: hidden; border: 1px solid rgba(0, 0, 0, .12); transition: opacity .3s; }
.sp__legend i { flex: 1; }
.sp__legend.is-off { opacity: .35; }
.sp__ticks { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-top: -4px; font-variant-numeric: tabular-nums; }
.sp__note { font-size: 11.5px; color: var(--muted); }
.sp__chks { display: flex; flex-wrap: wrap; gap: 6px; }
.sp__chks .map-chk { font-size: 12.5px; padding: 4px 8px; }
.sp__range { display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-2); }
.sp__range b { color: var(--cinnabar); font-variant-numeric: tabular-nums; }
.sp__range input { accent-color: var(--cinnabar); width: 100%; }
.sl--river { font-family: var(--serif); font-style: italic; font-size: 11px; color: #2f5a78; text-shadow: 0 0 3px rgba(255,248,235,.9); }
:root[data-theme="dark"] .sl--mount, :root[data-theme="dark"] .sl--river { text-shadow: 0 0 3px rgba(0,0,0,.8); color: #d8c6a4; }
.map.is-3d .map-title, .map.is-3d .map-scale, .map.is-3d #map-layers-btn, .map.is-3d .map-layers, .map.is-3d .map-terr { display: none; }
.map.is-3d .map-compass { z-index: 3; }
.map-compass svg { transition: transform .1s linear; }
.map.is-loading3d::before { content: "正在搭沙盘……"; position: absolute; z-index: 6; left: 50%; top: 50%; translate: -50% -50%; padding: 10px 18px; border-radius: 12px; background: var(--card); box-shadow: var(--shadow); font-size: 14px; color: var(--ink-2); animation: fade .3s; }

/* ---------- 水墨特效（js/ink.js） ---------- */
/* 开场 */
.splash { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: var(--paper); overflow: hidden;
  animation: splashOut .8s 3.2s forwards; /* 脚本失效时也会自己退场 */ }
.no-splash .splash { display: none; }
.splash > * { grid-area: 1 / 1; }
.splash__enso { width: min(46vmin, 320px); height: min(46vmin, 320px); overflow: visible; }
.splash__enso path { fill: none; stroke: var(--ink); stroke-width: 9; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; filter: url(#seal-rough); animation: enso 1.25s .15s cubic-bezier(.6, .05, .3, 1) forwards; opacity: .88; }
.splash__char { font-family: var(--kai); font-size: min(22vmin, 150px); color: var(--ink); animation: brush 1s .55s var(--ease) backwards; }
.splash__seal { align-self: center; justify-self: center; translate: min(21vmin, 150px) min(14vmin, 100px); font-family: var(--kai); font-size: 15px; line-height: 1.15; color: #fff6ec; padding: 6px 6px 5px; border-radius: 4px; background: var(--cinnabar); background-image: var(--seal-tex); animation: stamp .6s 1.25s var(--spring) backwards; transform: rotate(-6deg); }
.splash__line { align-self: end; margin-bottom: 14vh; font-family: var(--serif); letter-spacing: .5em; color: var(--muted); font-size: 14px; animation: fade 1s 1.1s backwards; }
.splash.is-out { animation: splashOut .8s forwards; }
@keyframes enso { to { stroke-dashoffset: 0; } }
@keyframes splashOut { to { opacity: 0; visibility: hidden; filter: blur(6px); transform: scale(1.04); } }

/* 转场：墨晕 */
.view.is-active.is-inked { animation: none; }
.view.is-active.is-inking { animation: inkReveal .8s cubic-bezier(.3, .7, .2, 1) both; }
@keyframes inkReveal { from { clip-path: circle(6vmax at var(--rx, 50%) var(--ry, 0)); opacity: .4; } 40% { opacity: 1; } to { clip-path: circle(160vmax at var(--rx, 50%) var(--ry, 0)); } }
.ink-ring { position: fixed; z-index: 150; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; pointer-events: none;
  border: 2px solid color-mix(in srgb, var(--ink) 55%, transparent); filter: url(#seal-rough) blur(.3px);
  background: radial-gradient(circle, color-mix(in srgb, var(--ink) 16%, transparent) 0 30%, transparent 62%);
  animation: inkRing .7s var(--ease) forwards; }
.ink-ring--big { width: 80px; height: 80px; margin: -40px 0 0 -40px; border-width: 3px; border-color: color-mix(in srgb, var(--cinnabar) 50%, transparent); animation-duration: .95s; }
@keyframes inkRing { from { transform: scale(.2); opacity: .9; } to { transform: scale(2.6); opacity: 0; } }
#ink-fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 120; pointer-events: none; }

/* 夜读切换：从按钮处漫开 */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { animation: themeIn .75s cubic-bezier(.3, .7, .2, 1); }
@keyframes themeIn { from { clip-path: circle(0 at var(--tx, 100%) var(--ty, 0)); } to { clip-path: circle(160vmax at var(--tx, 100%) var(--ty, 0)); } }

/* 滚动墨线 */
.scroll-ink { position: fixed; z-index: 45; left: 0; right: 0; top: var(--top); height: 2px; transform: scaleX(0); transform-origin: left; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--cinnabar) 12%, var(--cinnabar) 92%, color-mix(in srgb, var(--cinnabar) 30%, transparent)); transition: transform .12s linear; }

/* 卡片倾斜 + 高光 */
.entry, .story-card, .game-card, .person, .stat { transform-style: preserve-3d; will-change: auto; }
.entry::after, .story-card::after, .game-card::after, .person::after, .stat::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 250, 238, .38), transparent 45%); mix-blend-mode: soft-light; }
.is-tilt::after { opacity: 1; }
.is-tilt { transition: transform .08s linear, box-shadow .25s !important; box-shadow: var(--shadow-lg) !important; }
.stat { position: relative; }

/* 小标题下的一笔朱砂 */
.section-head h2 { position: relative; }
.section-head h2::after { content: ""; display: block; width: 72px; height: 9px; margin-top: 12px; transform: scaleX(0); transform-origin: left; transition: transform 1s .25s var(--ease);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 14'%3E%3Cpath d='M3 9 C 20 3 48 5 70 6 S 108 4 117 7 C 108 11 80 10 60 11 S 18 13 3 9Z' fill='%23a8322a'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.section-head:not(.section-head--left) h2::after { margin-inline: auto; transform-origin: center; }
.section-head[data-reveal].is-in h2::after, .section-head:not([data-reveal]) h2::after { transform: scaleX(1); }
.view:not(.is-active) .section-head h2::after { transform: scaleX(0); transition: none; }

/* 逐字显影 */
.ink-ch { display: inline-block; animation: inkCh .55s var(--ease) backwards; }
@keyframes inkCh { from { opacity: 0; filter: blur(4px); transform: translateY(3px) scale(1.15); } }

/* 首页：视差、日晕、雁阵、雾带、游历点 */
.hero__art .hp { will-change: transform; }
.hero-sun__halo { transform-box: fill-box; transform-origin: center; animation: halo 5s ease-out infinite; }
@keyframes halo { from { transform: scale(1); opacity: .9; } to { transform: scale(1.9); opacity: 0; } }
.hero-geese { animation: geese 38s ease-in-out infinite alternate; }
@keyframes geese { from { transform: translate(60px, 18px); } to { transform: translate(-160px, -14px); } }
.hero-mist ellipse { fill: color-mix(in srgb, var(--paper-2) 75%, transparent); filter: blur(18px); animation: mist 24s ease-in-out infinite alternate; }
.hero-mist ellipse:nth-child(2) { animation-duration: 31s; animation-direction: alternate-reverse; }
.hero-mist ellipse:nth-child(3) { animation-duration: 19s; }
@keyframes mist { from { transform: translateX(-80px); } to { transform: translateX(90px); } }
.hero-pin { animation: fade .6s backwards; animation-delay: calc(1s + var(--i) * .18s); }
.hero-pin__ring { transform-box: fill-box; transform-origin: center; animation: pulse 3s ease-out infinite; animation-delay: calc(var(--i) * .5s); }
.hero__catkins { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.hero__title { position: relative; }
.hero__title::before { content: ""; position: absolute; left: -2%; bottom: 4%; width: 88%; height: 34%; z-index: -1; opacity: .16; pointer-events: none; transform-origin: left center;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 60' preserveAspectRatio='none'%3E%3Cpath d='M6 38 C 40 20 110 16 170 20 S 270 18 294 26 C 286 36 250 40 210 42 S 120 50 70 50 S 14 52 6 38Z' fill='%23a8322a'/%3E%3Cpath d='M30 46 C 90 40 180 40 280 34' stroke='%23a8322a' stroke-width='2' fill='none' opacity='.6'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  filter: url(#seal-rough); animation: sweep 1.1s .5s cubic-bezier(.6, .05, .3, 1) backwards; }
@keyframes sweep { from { transform: scaleX(0); opacity: 0; } }
:root[data-theme="dark"] .hero__title::before { opacity: .3; }

/* 得印：印泥飞溅后微微一震 */
.award__seal { position: relative; }
.award__seal.is-stamped { animation: stamp .7s var(--spring) backwards, sealThud .35s .02s ease-out; }
@keyframes sealThud { 40% { transform: scale(.94) rotate(-5deg); } }
.award__seal::after { content: ""; position: absolute; inset: -16px; border-radius: 26px; border: 2px solid color-mix(in srgb, var(--cinnabar) 45%, transparent); opacity: 0; filter: url(#seal-rough); }
.award__seal.is-stamped::after { animation: sealRing 1.1s var(--ease) forwards; }
@keyframes sealRing { from { opacity: .9; transform: scale(.8); } to { opacity: 0; transform: scale(1.6); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .view [data-reveal] { opacity: 1; translate: 0 0; }
  .splash, .ink-ring, #ink-fx, .hero__catkins { display: none !important; }
  .m-draw { stroke-dashoffset: 0 !important; }
}
@media print {
  .topbar, .tabbar, .reader__toc, .reader__bar, .ch-actions, .ch-nav { display: none !important; }
  main { padding: 0; }
  .reader { display: block; }
  .reader__body { border: 0; }
}

/* 地理沙盘：把高程、历史推定与显示比例分别说明。 */
.sp__eyebrow { font-size: 11px; letter-spacing: .12em; color: var(--muted); margin: 0; }
.sand3d__panel { display: flex; flex-direction: column; max-height: calc(100% - 108px); }
.sp__head { flex-shrink: 0; }
.sp__body { min-height: 0; max-height: min(470px, 62vh); overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; }
.sp__presets { display: grid; grid-template-columns: 1fr 1.3fr .7fr; gap: 4px; }
.sp__presets button { padding: 6px 2px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); color: var(--ink-2); font-size: 11px; }
.sp__presets button[aria-pressed="true"] { background: var(--cinnabar-soft); border-color: var(--cinnabar); color: var(--cinnabar); }
.sp__sources { border-top: 1px solid var(--line); padding-top: 7px; font-size: 11px; line-height: 1.7; color: var(--muted); }
.sp__sources summary { cursor: pointer; color: var(--ink-2); }
.sp__sources p { margin: 7px 0; }
.sp__sources a { display: block; color: var(--cinnabar); }
.sand3d__scale { position: absolute; right: 16px; bottom: 155px; display: grid; justify-items: end; gap: 4px; padding: 6px 9px; background: color-mix(in srgb, var(--paper) 88%, transparent); border-radius: 5px; color: var(--ink-2); font: 10px var(--sans); pointer-events: none; }
.sand3d__scale[hidden] { display: none; }
.sand3d__scale i { display: block; height: 6px; border: 1.5px solid currentColor; border-top: 0; background: linear-gradient(90deg, transparent 49%, currentColor 49%, currentColor 51%, transparent 51%); }
.sl--landform { display: grid; gap: 3px; justify-items: center; color: #344837; text-shadow: 0 1px 4px #fff9e9, 0 0 6px #fff9e9; }
.sl--landform b { font-size: 16px; letter-spacing: .17em; font-weight: 500; }
.sl--landform small { font: 10px var(--sans); letter-spacing: .03em; }
.sl--wetland { color: #245665; font-size: 12px; text-shadow: 0 0 5px #fff9e9; }
.sl--wetland small { display: block; font: 9px var(--sans); }
@media (max-width: 700px) {
  .sand3d__panel { max-width: calc(100% - 28px); }
  .sp__body { max-height: min(340px, 48vh); }
  /* 打开时：横跨左侧到右侧按钮列，只占地图下方约四成高度；碰地图就收起（js/sand.js） */
  .sand3d__panel:not(.is-closed) { left: 10px; right: 62px; width: auto; max-width: none; max-height: 40%; }
  .sand3d__panel:not(.is-closed) .sp__body { max-height: none; gap: 6px; padding: 0 10px 10px; }
  .sand3d__panel .sp__head { padding: 7px 10px; }
  .sand3d__panel .sp__style button { padding: 4px 0; font-size: 12.5px; }
  .sand3d__panel .sp__chks { gap: 4px; }
  .sand3d__panel .sp__chks .map-chk { font-size: 11.5px; padding: 2px 6px; gap: 4px; border-radius: 6px; }
  .sand3d__panel .sp__chks .map-chk input { width: 13px; height: 13px; margin: 0; }
  .sand3d__panel .sp__presets button { padding: 4px 2px; }
  .sand3d__panel .sp__eyebrow, .sand3d__panel .sp__note { display: none; }
  .sp__bricks { grid-template-columns: repeat(3, 1fr); gap: 3px 6px; font-size: 11.5px; }
  .sp__bricks small { font-size: 9.5px; }
  .sp__nat { font-size: 11px; }
  .sand3d__scale { bottom: 78px; right: 12px; font-size: 9px; }
  .sand3d:has(.sand3d__panel:not(.is-closed)) .sand3d__scale { display: none; }
  .sl--landform b { font-size: 13px; }
  .sl--landform small { display: none; }
}

/* 首页游历预览：同一地理坐标，独立于装饰山水。 */
.hero__layout { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(24px, 4vw, 56px); width: 100%; align-items: center; }
.hero__layout .hero__title { font-size: clamp(96px, 12vw, 158px); }
.hero__layout .hero__cta { gap: 8px; }
.hero__layout .hero__cta .btn { padding: 12px 16px; font-size: 14px; }
.hero__layout .hero__sub { max-width: 26em; }
.hero__art { opacity: .55; pointer-events: none; }
.home-journey { min-width: 0; padding: 22px; border: 1px solid var(--line-2); border-radius: 4px; background: color-mix(in srgb, var(--paper-2) 96%, transparent); box-shadow: 0 18px 46px rgba(58,45,26,.07); }
.home-journey__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.home-journey__head .eyebrow { font-size: 10px; letter-spacing: .2em; margin-bottom: 7px; }
.home-journey__head h2 { font: 400 clamp(21px, 2.1vw, 28px)/1.3 var(--kai); }
.home-journey__seal { font: 16px/1.15 var(--kai); background: var(--cinnabar); background-image: var(--seal-tex); color: #fff6e7; padding: 6px; transform: rotate(-4deg); }
.home-journey__orders { display: flex; align-items: center; gap: 3px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.home-journey__orders button { border: 0; border-bottom: 2px solid transparent; padding: 8px 8px 10px; background: none; color: var(--muted); font-size: 12px; }
.home-journey__orders button[aria-pressed="true"] { color: var(--cinnabar); border-color: var(--cinnabar); }
.home-journey__orders > span { margin-left: auto; color: var(--muted); font-size: 10px; }
.home-map { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
.home-map__coast { fill: none; stroke: #839b93; stroke-width: 1; }
.home-map__river { fill: none; stroke: #69929a; stroke-width: 1.4; opacity: .72; }
.home-map__lake { fill: #82a4a2; opacity: .5; }
.home-map__route { fill: none; stroke: var(--cinnabar); stroke-width: 2.1; stroke-dasharray: 5 4; stroke-linejoin: round; opacity: .7; }
.home-map__geography { fill: #566950; font: 15px var(--kai); letter-spacing: 1px; opacity: .75; pointer-events: none; }
.home-map__node { cursor: pointer; outline: none; }
.home-map__hit { fill: transparent; }
.home-map__dot { fill: var(--cinnabar); stroke: #f8f0dd; stroke-width: 2; }
.home-map__leader { fill: none; stroke: #927966; stroke-width: .7; }
.home-map__node text { font: 600 16px var(--serif); fill: #3f3328; stroke: #ede8d3; stroke-width: 4; paint-order: stroke; stroke-linejoin: round; }
.home-map__node.is-selected .home-map__dot, .home-map__node:hover .home-map__dot, .home-map__node:focus-visible .home-map__dot { r: 7; stroke-width: 3; }
.home-map__node.is-selected text { fill: var(--cinnabar); }
.home-map__node:focus-visible .home-map__hit { stroke: var(--cinnabar); stroke-width: 2; }
.home-map__north, .home-map__scale { fill: #5a6251; font: 11px var(--sans); pointer-events: none; }
.home-map__north path, .home-map__scale path { fill: none; stroke: #5a6251; stroke-width: 1.3; }
.home-journey__mapnote { color: var(--muted); font-size: 10px; margin: 7px 0 12px; }
.home-journey__stops { display: flex; flex-wrap: wrap; gap: 3px; }
.home-journey__stops button { border: 1px solid transparent; background: none; display: flex; align-items: center; gap: 4px; padding: 5px 6px; font-size: 11px; color: var(--ink-2); border-radius: 3px; }
.home-journey__stops button small { font: 9px var(--sans); color: var(--muted); }
.home-journey__stops button[aria-pressed="true"] { background: var(--cinnabar-soft); border-color: var(--cinnabar); color: var(--cinnabar); }
.home-journey__detail { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; min-height: 70px; }
.home-journey__detail > div { display: flex; align-items: center; gap: 9px; }
.home-journey__index { color: var(--cinnabar); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.home-journey__detail h3 { font: 600 16px var(--serif); }
.home-journey__detail .grade { margin-left: auto; flex-shrink: 0; }
.home-journey__detail p { color: var(--muted); font-size: 11px; margin-top: 6px; }
.home-journey__actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.home-journey__sandbox { display: flex; gap: 5px; align-items: center; font-size: 12px; color: var(--ink-2); text-decoration: none; padding: 8px 0; }
.home-journey__sandbox:hover { color: var(--cinnabar); }
:root[data-theme="dark"] .home-map { filter: brightness(.78) saturate(.8); }
@media (max-width: 960px) {
  .hero__layout { grid-template-columns: 1fr; gap: 30px; }
  .hero__inner { max-width: 640px; }
  .home-journey { max-width: 680px; width: 100%; }
  .hero { min-height: auto; padding-top: 42px; padding-bottom: 42px; }
  .hero__layout .hero__title { font-size: 112px; }
}
@media (max-width: 600px) {
  .home-journey { padding: 15px; }
  .hero__layout .hero__title { font-size: 94px; }
  .hero__layout .hero__guide { margin: 18px 0 22px; }
  .hero__layout .hero__cta .btn { flex: none; padding: 10px 12px; font-size: 12px; }
  .home-journey__head { margin-bottom: 10px; }
  .home-journey__orders > span { display: none; }
  .home-journey__mapnote { font-size: 9px; }
  .home-journey__detail h3 { font-size: 14px; }
  .home-journey__detail p { font-size: 10px; }
  .home-journey__actions { gap: 8px; }
}

/* ---------- 手机 / 平板竖屏：游列国地图与 3D 沙盘铺满，信息面板做成底部抽屉（收起时只占约 1/6） ---------- */
.route-panel__grip { display: none; }
@media (max-width: 980px) {
  #view-route.is-active { display: block; position: relative; }
  #view-route .map { position: absolute; inset: 0; }
  #view-route .route-panel {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; max-height: none; gap: 10px;
    padding: 6px 16px 12px; border: 0; border-radius: 20px 20px 0 0; overflow: hidden;
    background: color-mix(in srgb, var(--paper-2) 94%, transparent); backdrop-filter: blur(14px);
    box-shadow: 0 -10px 30px rgba(30, 20, 10, .16); transition: max-height .35s var(--ease);
  }
  .route-panel__grip { display: grid; place-items: center; width: 100%; height: 18px; margin: 0 0 -4px; border: 0; background: none; cursor: pointer; }
  .route-panel__grip i { width: 40px; height: 4px; border-radius: 4px; background: var(--line-2); }
  /* 收起：只留站名与上一站 / 播放 / 下一站 */
  #view-route .route-panel:not(.is-open) > .seg--route,
  #view-route .route-panel:not(.is-open) > .order-note,
  #view-route .route-panel:not(.is-open) > .scrub { display: none; }
  #view-route .route-panel:not(.is-open) .route-now { display: grid; grid-template-columns: 1fr auto; align-items: baseline; column-gap: 10px; }
  #view-route .route-panel:not(.is-open) .route-now__meta { order: 2; font-size: 12px; }
  #view-route .route-panel:not(.is-open) .route-now__meta #rn-grade { display: none; }
  #view-route .route-panel:not(.is-open) .route-now h2 { font-size: 19px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #view-route .route-panel:not(.is-open) .route-now__place { order: 3; grid-column: 1 / -1; font-size: 12.5px; margin-top: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #view-route .route-panel:not(.is-open) .play-btn { width: 46px; height: 46px; }
  #view-route .route-panel:not(.is-open) .route-ctrl .icon-btn--lg { width: 40px; height: 40px; }
  /* 展开：抽屉最多盖住地图的 60%，可滚动 */
  #view-route .route-panel.is-open { max-height: 60%; overflow-y: auto; }
  /* 地图上的浮层让到抽屉上方 */
  #view-route .map-note { bottom: calc(var(--sheet, 0px) + 8px); }
  #view-route .map-scale { bottom: calc(var(--sheet, 0px) + 32px); }
  #view-route .map-compass { bottom: calc(var(--sheet, 0px) + 30px); }
  #view-route .sand3d__panel { bottom: calc(var(--sheet, 0px) + 34px); }
  #view-route .sand3d__scale, #view-route .sand3d__hint { bottom: calc(var(--sheet, 0px) + 34px); right: 64px; }
  #view-route .map-layers { max-height: calc(100% - var(--sheet, 0px) - 80px); overflow-y: auto; }
  /* 思想图谱也给足高度 */
  .atlas { height: calc(100dvh - var(--top) - var(--tabbar) - 120px); min-height: 68vh; }
}
