:root {
  --paper: #F2F4F6;
  --surface: #FFFFFF;
  --ink: #15202B;
  --ink-2: #46525F;
  --ink-3: #66717D;
  --rule: #DFE3E8;
  --rule-2: #C8CFD6;
  --night: #0B1730;
  --cobalt: #2450B8;
  --cobalt-deep: #1B3E91;
  --cobalt-wash: #E7EDF8;
  --signal: #D2452F;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --math: "Times New Roman", "Nimbus Roman", Times, serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --stage-bg: #FFFFFF;
}

@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: .42s; animation-timing-function: var(--ease); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .24s; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 60px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.7 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; border-radius: 4px; }
.night :focus-visible, .bar.dark :focus-visible, .v-top :focus-visible, .foot :focus-visible { outline-color: #fff; }
i { font-family: var(--math); font-style: italic; }
sub, sup { font-family: var(--math); font-style: normal; font-size: .7em; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 32px; }
:root { --gutter: max(32px, calc((100vw - 1280px) / 2 + 32px)); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

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

/* ---------- 顶栏 ---------- */
.bar {
  position: sticky; top: 0; z-index: 30; color: var(--ink);
  background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule); transition: background-color .35s, border-color .35s, color .35s;
}
/* 深色区上的顶栏 */
.bar.dark { color: #F3F6FB; background: var(--night); border-bottom-color: rgba(243, 246, 251, .08); }
.home .bar { position: fixed; left: 0; right: 0; }
.home .bar.top { background: transparent; border-bottom-color: transparent; backdrop-filter: none; }
.bar-inner { height: 60px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand svg { width: 28px; height: 28px; display: block; }
.brand b { font-size: 19px; font-weight: 650; letter-spacing: .08em; }
.nav { margin-left: auto; display: flex; gap: 4px; }
.nav a { padding: 6px 12px; border-radius: 7px; font-size: 15px; opacity: .78; transition: opacity .2s, background-color .2s; }
.nav a:hover { opacity: 1; background: rgba(127, 140, 160, .14); }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-3); min-width: 0; white-space: nowrap; overflow: hidden; }
.crumbs a { transition: color .15s; }
.crumbs a:hover { color: var(--ink); }
.crumbs .sep { color: var(--rule-2); }
.crumbs .here { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.bar.dark .crumbs { color: rgba(243, 246, 251, .58); }
.bar.dark .crumbs a:hover, .bar.dark .crumbs .here { color: #F3F6FB; }
.bar.dark .crumbs .sep { color: rgba(243, 246, 251, .24); }

/* ---------- 按钮与控件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 7px;
  border: 1px solid var(--rule-2); background: var(--surface); color: var(--ink);
  font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: border-color .15s, background-color .15s, color .15s, transform .15s var(--ease);
}
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: scale(.97); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn.icon { width: 38px; padding: 0; }
.btn.rec .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--signal); transition: background-color .15s; }
.btn.rec.on { background: var(--signal); color: #fff; border-color: var(--signal); }
.btn.rec.on .dot { background: #fff; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }

.seg { position: relative; display: inline-flex; border: 1px solid var(--rule-2); border-radius: 7px; background: var(--surface); padding: 2px; }
.seg button { position: relative; z-index: 1; border: 0; background: none; height: 32px; padding: 0 12px; font-size: 14px; color: var(--ink-2); border-radius: 5px; transition: color .2s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { color: var(--cobalt-deep); font-weight: 600; }
.seg .thumb { position: absolute; z-index: 0; top: 2px; bottom: 2px; left: 0; border-radius: 5px; background: var(--cobalt-wash); transition: transform .32s var(--ease), width .32s var(--ease); }
.seg.full { display: flex; width: 100%; }
.seg.full button { flex: 1; padding: 0 6px; }

/* tooltip：给图标按钮与补充信息用 */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px);
  transform: translate(-50%, 4px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 400; line-height: 1.5;
  padding: 6px 10px; border-radius: 6px; white-space: nowrap; z-index: 50;
  transition: opacity .16s, transform .16s var(--ease);
}
[data-tip].tip-wide::after { white-space: normal; width: 240px; text-align: left; }
[data-tip].tip-left::after { left: auto; right: -6px; transform: translate(0, 4px); }
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); transition-delay: .25s; }
[data-tip].tip-left:hover::after, [data-tip].tip-left:focus-visible::after { transform: translate(0, 0); }
.info { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 0; background: none; border-radius: 50%; color: var(--ink-3); padding: 0; transition: color .15s, background-color .15s; }
.info:hover { color: var(--ink); background: var(--paper); }
.info svg { width: 16px; height: 16px; }

/* ---------- 首页 ---------- */
.night { background: var(--night); color: #F3F6FB; }
.hero { position: relative; overflow: hidden; }
.hero canvas {
  display: block; width: 100%; height: clamp(460px, 72vh, 780px); cursor: crosshair; touch-action: pan-y;
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent); mask-image: linear-gradient(to bottom, #000 70%, transparent);
}
.hero-title { position: absolute; left: 0; right: 0; bottom: 112px; pointer-events: none; }
.hero h1 {
  margin: 0; font-size: clamp(36px, 5.4vw, 68px); line-height: 1.1; font-weight: 650; letter-spacing: .02em;
  text-wrap: balance;
  animation: rise .9s var(--ease) both .1s;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.btn.ghost { background: rgba(243, 246, 251, .06); border-color: rgba(243, 246, 251, .16); color: #F3F6FB; }
.btn.ghost:hover { border-color: rgba(243, 246, 251, .42); background: rgba(243, 246, 251, .1); }
.btn.ghost[aria-disabled="true"] { opacity: .3; cursor: default; transform: none; }

.showcase { position: relative; margin-top: -36px; padding-bottom: 72px; }
.showcase-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.showcase h2 { margin: 0; font-size: 22px; font-weight: 600; display: flex; gap: 12px; align-items: baseline; animation: rise .9s var(--ease) both .35s; }
.showcase h2 .count { font-family: var(--math); font-weight: 400; font-size: 20px; color: #8FB4FF; }
.rail-btns { display: flex; gap: 8px; }
.rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(260px, 26vw, 360px); gap: 22px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; overscroll-behavior-x: contain;
  padding: 8px var(--gutter) 28px; scroll-padding-inline: var(--gutter); scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail .card { scroll-snap-align: start; animation: rise .9s var(--ease) both; animation-delay: calc(.45s + var(--i, 0) * .07s); }
.no-intro .rail .card, .no-intro .showcase h2, .no-intro .hero h1 { animation: none; }
.rail .card .thumb { border-color: rgba(243, 246, 251, .1); box-shadow: 0 26px 50px -30px rgba(0, 0, 0, .85); }
.rail .card:hover .thumb { border-color: rgba(243, 246, 251, .3); box-shadow: 0 30px 60px -28px rgba(0, 0, 0, .9); }
.rail .card-cap { padding-top: 12px; }
.rail .card-cap b { color: #F3F6FB; }
.rail .card:hover .card-cap b { color: #fff; }
.rail .card-cap .sec { color: #8FB4FF; }
.rail .card-cap small { margin-left: auto; font-size: 13px; color: rgba(243, 246, 251, .5); white-space: nowrap; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.card { display: block; border-radius: 10px; }
.card .thumb {
  position: relative; display: block; border-radius: 10px; overflow: hidden; background: #fff;
  border: 1px solid var(--rule);
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0px));
  transition: border-color .2s, box-shadow .45s var(--ease), transform .6s var(--ease);
}
.card .thumb::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .45), transparent 45%);
}
.card:hover .thumb::after { opacity: 1; }
.card canvas { display: block; width: 100%; aspect-ratio: 16 / 9; }
.card:hover .thumb { --lift: -4px; border-color: var(--rule-2); box-shadow: 0 18px 36px -20px rgba(11, 23, 48, .45); transition: border-color .2s, box-shadow .45s var(--ease), transform .18s ease-out; }
.card-cap { display: flex; gap: 10px; align-items: baseline; padding: 10px 2px 0; }
.card-cap .sec { font-family: var(--math); font-size: 15px; color: var(--cobalt); font-variant-numeric: tabular-nums; flex: none; }
.card-cap b { font-size: 16px; font-weight: 600; line-height: 1.45; transition: color .2s; }
.card:hover .card-cap b { color: var(--cobalt); }

/* 目录：背景点阵呼应首屏的点云 */
.paper { background-color: var(--paper); background-image: radial-gradient(rgba(21, 32, 43, .075) 1px, transparent 1.4px); background-size: 22px 22px; }
.catalog { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 36px 48px; padding-top: 76px; padding-bottom: 104px; }
.cat-head { grid-column: 1 / -1; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.cat-head h2 { margin: 0; font-size: 34px; line-height: 1.2; font-weight: 650; }
.toc { position: sticky; top: 92px; align-self: start; }
.toc-list { position: relative; border-left: 1px solid var(--rule); }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a {
  display: grid; grid-template-columns: 1fr auto; align-items: baseline; row-gap: 7px;
  padding: 8px 0 10px 16px; font-size: 15px; color: var(--ink-2); transition: color .2s;
}
.toc a:hover { color: var(--ink); }
.toc a[aria-current="true"] { color: var(--ink); font-weight: 600; }
.toc small { font-family: var(--math); font-size: 14px; color: var(--ink-3); font-weight: 400; font-variant-numeric: tabular-nums; }
.toc a[aria-current="true"] small { color: var(--cobalt); }
.toc .meter { grid-column: 1 / -1; }
.toc .bar-ind { position: absolute; left: -1px; top: 0; width: 2px; height: 38px; background: var(--cobalt); border-radius: 2px; transition: transform .35s var(--ease), height .35s var(--ease); }
.meter { height: 3px; border-radius: 2px; background: var(--rule); overflow: hidden; }
.meter span { display: block; height: 100%; min-width: 3px; border-radius: 2px; background: var(--cobalt); }

.book { padding-bottom: 36px; }
.book-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.book-head h3 { margin: 0; font-size: 26px; line-height: 1.3; font-weight: 650; white-space: nowrap; }
.book-head .meter { flex: 1; max-width: 220px; }
.chapters { columns: 2 320px; column-gap: 18px; }
.chapter {
  display: inline-block; width: 100%; break-inside: avoid; margin: 0 0 18px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 14px 18px 8px;
  transition: border-color .25s, box-shadow .35s var(--ease);
}
.chapter:hover { border-color: var(--rule-2); box-shadow: 0 14px 30px -24px rgba(11, 23, 48, .4); }
.chapter h4 { margin: 0 0 4px; font-size: 16px; font-weight: 600; display: flex; gap: 10px; align-items: baseline; }
.chapter h4 span { color: var(--ink-3); font-weight: 400; font-size: 14px; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; gap: 10px; min-height: 36px; font-size: 14.5px; color: var(--ink-3); }
.rows li + li { border-top: 1px dashed var(--rule); }
.rows .sec { font-family: var(--math); font-size: 14px; min-width: 2.7em; font-variant-numeric: tabular-nums; flex: none; }
.rows .ready a {
  display: flex; align-items: center; gap: 12px; width: calc(100% + 16px); margin: 6px -8px; padding: 6px 10px 6px 8px;
  border-radius: 9px; background: var(--cobalt-wash); color: var(--ink); transition: background-color .2s;
}
.rows .ready a:hover { background: #DAE3F5; }
.rows .ready canvas { display: block; width: 92px; aspect-ratio: 16 / 9; flex: none; border-radius: 5px; background: #fff; box-shadow: 0 0 0 1px rgba(21, 32, 43, .08); }
.rows .ready .sec { color: var(--cobalt); min-width: 0; }
.rows .ready .t { flex: 1; font-weight: 600; }
.rows .ready svg { width: 16px; height: 16px; flex: none; color: var(--cobalt); transition: transform .25s var(--ease); }
.rows .ready a:hover svg { transform: translateX(3px); }
.only-ready .rows li:not(.ready), .only-ready .toc li.empty { display: none; }
.only-ready .rows li { border-top: 0; }
.only-ready .chapter:not(:has(.ready)), .only-ready .book:not(:has(.ready)) { display: none; }

.foot { background: var(--night); color: rgba(243, 246, 251, .55); padding: 36px 0 44px; font-size: 13px; }
.foot .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.foot .brand { color: #F3F6FB; }
.foot .brand b { font-size: 17px; }

/* ---------- 演示页 ---------- */
.v-top { background: var(--night); color: #F3F6FB; padding-bottom: 168px; }
.v-main { max-width: 1440px; margin: 0 auto; padding: 0 32px 80px; }
.v-head { max-width: 1440px; margin: 0 auto; padding: 34px 32px 26px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.v-head h1 { margin: 0; font-size: 30px; line-height: 1.3; font-weight: 650; animation: rise .7s var(--ease) both; }
.v-head .sec { font-family: var(--math); color: #8FB4FF; font-weight: 400; margin-right: 14px; }
.v-main > .v-layout { margin-top: -168px; }
.v-pager { display: flex; gap: 8px; flex: none; }
.v-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }

.stage-frame { position: relative; background: var(--stage-bg); border: 1px solid rgba(127, 140, 160, .35); border-radius: 12px; overflow: hidden; transition: background-color .3s; box-shadow: 0 34px 70px -36px rgba(11, 23, 48, .7); }
.stage-frame canvas { display: block; width: 100%; aspect-ratio: 16 / 9; touch-action: none; }
.rec-badge { position: absolute; left: 14px; top: 14px; display: flex; align-items: center; gap: 8px; background: var(--signal); color: #fff; font-size: 13px; padding: 4px 10px; border-radius: 5px; font-variant-numeric: tabular-nums; }
.rec-badge[hidden] { display: none; }

.transport { display: flex; align-items: center; gap: 8px; padding-top: 12px; flex-wrap: wrap; }
.transport .spacer { flex: 1; }
.clock { font-family: var(--math); font-size: 17px; color: var(--ink-2); min-width: 92px; padding-left: 6px; font-variant-numeric: tabular-nums; }

.side { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; box-shadow: 0 30px 60px -40px rgba(11, 23, 48, .55); }
.side > * { padding: 18px; }
.side > * + * { border-top: 1px solid var(--rule); }
.ctrl { margin-bottom: 16px; }
.ctrl:last-child { margin-bottom: 0; }
.ctrl-label { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 4px; font-size: 14px; color: var(--ink-2); }
.ctrl-label .sym { font-family: var(--math); font-style: italic; font-size: 18px; color: var(--ink); margin-right: 6px; }
.ctrl-label output { font-family: var(--math); font-size: 17px; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ctrl-label output small { font-size: 14px; color: var(--ink-3); margin-left: 3px; }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; margin: 0; --p: 50%; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--cobalt) var(--p), var(--rule-2) var(--p)); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--rule-2); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--cobalt); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: #fff; border: 2px solid var(--cobalt); box-shadow: 0 1px 2px rgba(21, 32, 43, .2); transition: transform .15s var(--ease); }
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.18); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--cobalt); }

.switch-row { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 6px 0; background: none; border: 0; font-size: 14px; color: var(--ink-2); text-align: left; transition: color .15s; }
.switch-row:hover { color: var(--ink); }
.switch { position: relative; width: 34px; height: 20px; border-radius: 10px; background: var(--rule-2); flex: none; transition: background-color .2s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch-row[aria-checked="true"] .switch { background: var(--cobalt); }
.switch-row[aria-checked="true"] .switch::after { transform: translateX(14px); }

.export { display: grid; gap: 8px; }
.export .btn { justify-content: flex-start; width: 100%; }
.export .row { display: flex; gap: 6px; align-items: center; }
.export .row .btn { flex: 1; }

.notes { margin-top: 44px; }
.tabs { position: relative; display: flex; gap: 28px; border-bottom: 1px solid var(--rule); }
.tabs button { background: none; border: 0; padding: 12px 0; font-size: 16px; color: var(--ink-3); transition: color .2s; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); font-weight: 600; }
.tabs .ink { position: absolute; bottom: -1px; left: 0; height: 2px; background: var(--cobalt); transition: transform .35s var(--ease), width .35s var(--ease); }
.tabpanel { padding-top: 22px; max-width: 860px; animation: fade .35s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
.tabpanel p, .tabpanel li { color: var(--ink-2); font-size: 16px; line-height: 1.85; }
.tabpanel p { margin: 0 0 12px; }
.tabpanel strong { color: var(--ink); font-weight: 600; }
.tabpanel ol, .tabpanel ul { margin: 0; padding-left: 1.3em; }
.tabpanel li { margin-bottom: 10px; }
.formulas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.formula { font-family: var(--math); font-size: 21px; padding: 8px 16px; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; color: var(--ink); }

.v-more { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--rule); }
.v-more h2 { font-size: 17px; margin: 0 0 16px; font-weight: 600; }
.v-more .cards { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.v-more .card-cap b { font-size: 14.5px; }

/* ---------- 全屏演示与嵌入 ---------- */
.dock, .drawer { display: none; }
.stage-frame.is-present, body.embed .stage-frame { position: fixed; inset: 0; z-index: 100; border: 0; border-radius: 0; display: grid; place-items: center; }
.stage-frame.is-present canvas, body.embed .stage-frame canvas { width: min(100vw, calc(100vh * 16 / 9)); height: auto; }
.stage-frame.is-present .dock, body.embed .dock {
  display: flex; position: absolute; left: 50%; bottom: 20px; gap: 2px; padding: 5px; border-radius: 12px;
  background: rgba(21, 32, 43, .86); color: #fff; z-index: 2;
  opacity: 0; transform: translate(-50%, 8px); pointer-events: none; transition: opacity .3s, transform .3s var(--ease);
}
.stage-frame.show-ui .dock, .stage-frame .dock:focus-within { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.dock button { height: 38px; min-width: 38px; padding: 0 11px; border: 0; border-radius: 8px; background: transparent; color: #fff; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background-color .15s; }
.dock button:hover { background: rgba(255, 255, 255, .12); }
.dock button[aria-pressed="true"] { background: rgba(255, 255, 255, .2); }
.dock svg { width: 18px; height: 18px; }
.dock .div { width: 1px; background: rgba(255, 255, 255, .18); margin: 7px 4px; }
.dock [data-tip]::after { background: #fff; color: var(--ink); }
.stage-frame.is-present .drawer, body.embed .drawer {
  display: block; position: absolute; right: 16px; top: 16px; width: 300px; max-height: calc(100% - 100px); overflow: auto;
  background: var(--surface); border-radius: 12px; padding: 18px; z-index: 3; box-shadow: 0 12px 36px rgba(0, 0, 0, .28);
  opacity: 0; visibility: hidden; transform: translateX(16px); pointer-events: none;
  transition: opacity .25s, transform .3s var(--ease), visibility 0s linear .3s;
}
.stage-frame .drawer.open { opacity: 1; visibility: visible; transform: none; pointer-events: auto; transition-delay: 0s; }
.drawer .ctrl-group + .ctrl-group { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--rule); }
body.embed { background: var(--stage-bg); overflow: hidden; }
body.embed .bar, body.embed .v-top, body.embed .foot, body.embed .transport, body.embed .side, body.embed .notes, body.embed .v-more { display: none; }

.toast { position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 16px); z-index: 200; background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .3s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .v-layout { grid-template-columns: 1fr; }
  .side { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .side > * + * { border-top: 0; border-left: 1px solid var(--rule); }
}
@media (max-width: 860px) {
  :root { --gutter: 20px; }
  .hero-title { bottom: 96px; }
  .hero h1 { font-size: clamp(26px, 9vw, 34px); }
  .wrap, .v-main { padding-left: 20px; padding-right: 20px; }
  .nav { display: none; }
  .rail { grid-auto-columns: 78vw; gap: 14px; }
  .rail-btns { display: none; }
  .catalog { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 48px; }
  .cat-head h2 { font-size: 26px; }
  .toc { position: sticky; top: 60px; z-index: 5; background: var(--paper); margin: 0 -20px; padding: 8px 20px; border-bottom: 1px solid var(--rule); }
  .toc-list { border-left: 0; min-width: 0; }
  .toc ol { display: flex; overflow-x: auto; scrollbar-width: none; }
  .toc ol::-webkit-scrollbar { display: none; }
  .toc a { display: block; padding: 6px 10px; white-space: nowrap; }
  .toc small, .toc .meter, .toc .bar-ind { display: none; }
  .book { padding-top: 20px; scroll-margin-top: 116px; }
  .book-head h3 { font-size: 22px; }
  .chapters { columns: 1; }
  .side { grid-template-columns: 1fr; }
  .side > * + * { border-left: 0; border-top: 1px solid var(--rule); }
  .crumbs .hide-sm { display: none; }
  .v-head { padding: 22px 20px 18px; }
  .v-head h1 { font-size: 22px; }
  .v-top { padding-bottom: 120px; }
  .v-main > .v-layout { margin-top: -120px; }
}
