:root {
  --paper: #F2F4F6;
  --surface: #FFFFFF;
  --ink: #15202B;
  --ink-2: #46525F;
  --ink-3: #66717D;
  --rule: #DFE3E8;
  --rule-2: #C8CFD6;
  --night: #070B16;
  --accent: #8FB4FF;
  --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;
  /* 标题用宋体；只列有真粗体的字体，没有时回退到黑体（Windows 自带宋体没有粗体） */
  --display: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --stage-bg: #FFFFFF;
}

/* 强调色随所选领域平滑过渡 */
@property --accent { syntax: '<color>'; inherits: true; initial-value: #8FB4FF; }
@property --ax { syntax: '<percentage>'; inherits: false; initial-value: 78%; }
html { transition: --accent 1.2s var(--ease); }

@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; }
::view-transition { pointer-events: none; }   /* 过渡期间不拦截点击（课件页连点上移、下移） */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 60px; }
body {
  margin: 0; color: var(--ink);
  background: var(--paper) radial-gradient(rgba(21, 32, 43, .075) 1px, transparent 1.4px) 0 0 / 22px 22px;
  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)); --sheet-r: 36px; }
.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-delay: 0s !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.dark { background: color-mix(in srgb, var(--night) 62%, transparent); -webkit-backdrop-filter: saturate(1.3) blur(16px); backdrop-filter: saturate(1.3) blur(16px); }
.home .bar.top { background: transparent; border-bottom-color: transparent; -webkit-backdrop-filter: none; 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: 26px; height: 26px; display: block; overflow: visible; }
.brand b { font-family: var(--display); font-size: 20px; font-weight: 900; letter-spacing: .12em; }
/* 标志：波源取当前领域的强调色；浅色顶栏上改用钴蓝。悬停时各点按到波源的距离依次起伏 */
.logo .src { fill: var(--accent); }
.bar:not(.dark) .logo .src { fill: var(--cobalt); }
.logo circle { transform-box: fill-box; transform-origin: center; }
.brand:hover .logo circle, .brand:focus-visible .logo circle { animation: ping .9s var(--ease) calc(var(--d, 0) * 120ms); }
@keyframes ping { 40% { transform: scale(1.5); } }
.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); }
.nav .badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px; border-radius: 9px; background: var(--cobalt); color: #fff; font-size: 12px; font-weight: 600; line-height: 1; vertical-align: 1px; }
.bar.dark .nav .badge { background: var(--accent); color: var(--night); }
.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[hidden] { display: none; }
.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 { position: relative; isolation: isolate; background: var(--night); color: #F3F6FB; padding-bottom: var(--sheet-r); }
.night > canvas { position: fixed; z-index: -1; left: 0; top: 0; display: block; width: 100%; height: 100vh; height: 100lvh; background: var(--night); }
/* 场景上的一层空气：随领域变色的光晕，底部压暗给展台让出层次 */
.night::after {
  content: ""; position: fixed; z-index: -1; left: 0; top: 0; width: 100%; height: 100vh; height: 100lvh; pointer-events: none;
  background:
    radial-gradient(52% 58% at 66% 40%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 72%),
    linear-gradient(to bottom, transparent 58%, rgba(7, 11, 22, .82));
}
.hero { position: relative; height: clamp(520px, 82vh, 920px); height: clamp(520px, 82svh, 920px); touch-action: pan-y; }
.night[data-domain="wave"] .hero { cursor: crosshair; }
.hero-title { position: absolute; inset: 0; display: flex; align-items: center; padding-bottom: 5vh; pointer-events: none; }
.hero h1 {
  margin: 0; font-family: var(--display); font-size: clamp(40px, 6vw, 88px); line-height: 1.18; font-weight: 900; letter-spacing: .05em;
  text-shadow: 0 2px 30px rgba(7, 11, 22, .8);
}
.hero h1 span { display: block; animation: rise 1.2s var(--ease) both .25s; }
.hero h1 span + span { animation-delay: .4s; }
/* 标题里藏着品牌名：“图”是一幅被取景框住的静止插图，“动”带着拖影向前一冲再弹回；两个字随领域变色 */
.hero h1 b { position: relative; display: inline-block; font-weight: inherit; letter-spacing: 0; color: color-mix(in srgb, var(--accent) 72%, #fff); }
.hero h1 .tu { margin-left: .06em; }
.hero h1 .tu::before {
  content: ""; position: absolute; inset: .1em -.09em .08em; pointer-events: none; opacity: .8;
  --l: linear-gradient(currentColor, currentColor); --h: .17em 2px; --v: 2px .17em;
  background: var(--l) 0 0 / var(--h), var(--l) 0 0 / var(--v), var(--l) 100% 0 / var(--h), var(--l) 100% 0 / var(--v),
    var(--l) 0 100% / var(--h), var(--l) 0 100% / var(--v), var(--l) 100% 100% / var(--h), var(--l) 100% 100% / var(--v);
  background-repeat: no-repeat;
}
.hero h1 .dong { margin-right: .05em; --glow: 0 2px 30px rgba(7, 11, 22, .8); --c1: color-mix(in srgb, var(--accent) 42%, transparent); --c2: color-mix(in srgb, var(--accent) 18%, transparent); }
@media (prefers-reduced-motion: no-preference) {
  .hero h1 .dong { animation: dong 5.2s var(--ease) infinite 2.2s; }
}
/* 减少动态效果时：停在带拖影的一瞬，仍然读得出“动” */
@media (prefers-reduced-motion: reduce) {
  .hero h1 .dong { transform: skewX(-8deg); text-shadow: -.07em 0 0 var(--c1), -.15em 0 0 var(--c2), var(--glow); }
}
@keyframes dong {
  0%, 58%, 100% { transform: none; text-shadow: 0 0 0 transparent, 0 0 0 transparent, var(--glow); }
  66% { transform: translateX(.05em) skewX(-11deg); text-shadow: -.09em 0 0 var(--c1), -.19em 0 0 var(--c2), var(--glow); }
  76% { transform: translateX(-.025em) skewX(4deg); text-shadow: 0 0 0 transparent, 0 0 0 transparent, var(--glow); }
  86% { transform: translateX(.01em) skewX(-1.5deg); }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

.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.accent { background: var(--accent); border-color: transparent; color: var(--night); font-weight: 600; transition: filter .2s, transform .15s var(--ease); }
.btn.accent:hover { border-color: transparent; filter: brightness(1.1); }
.btn.ghost[aria-disabled="true"] { opacity: .3; cursor: default; transform: none; }

.showcase { position: relative; margin-top: -76px; padding-bottom: 72px; }
.showcase-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; animation: rise 1s var(--ease) both .6s; }
.domains { display: flex; gap: 30px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.domains::-webkit-scrollbar { display: none; }
.domain {
  position: relative; flex: none; display: flex; align-items: baseline; gap: 7px; padding: 10px 0 13px; border: 0; background: none;
  font-size: 17px; font-weight: 500; letter-spacing: .04em; color: rgba(243, 246, 251, .5); white-space: nowrap; transition: color .3s;
}
.domain:hover { color: rgba(243, 246, 251, .86); }
.domain:focus-visible { outline-offset: -2px; }
.domain small { font-family: var(--math); font-size: 14px; letter-spacing: 0; color: rgba(243, 246, 251, .5); font-variant-numeric: tabular-nums; transition: color .3s; }
.domain[aria-selected="true"] { color: #fff; }
.domain[aria-selected="true"] small { color: var(--c); }
.domain .prog { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; overflow: hidden; background: rgba(243, 246, 251, .16); opacity: 0; transition: opacity .3s; }
.domain[aria-selected="true"] .prog { opacity: 1; }
.domain .prog::after { content: ""; position: absolute; inset: 0; background: var(--c); transform-origin: left; }
/* 自动巡览：进度线走完由脚本切到下一个领域 */
@media (prefers-reduced-motion: no-preference) {
  .domains.auto .domain[aria-selected="true"] .prog::after { animation: prog 16s linear both; }
  .domains.auto.hold .prog::after { animation-play-state: paused; }
  .domains.auto.away .domain .prog::after { animation: none; }
}
@keyframes prog { from { transform: scaleX(0); } }
.rail-btns { display: flex; gap: 8px; flex: none; }
.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;
  transition: opacity .2s;
}
.rail.swap { opacity: 0; }
.rail.drift { scroll-snap-type: none; scroll-behavior: auto; }   /* 自动轮播期间由脚本逐帧平移 */
.rail::-webkit-scrollbar { display: none; }
.rail .card { scroll-snap-align: start; animation: rise .8s var(--ease) both; animation-delay: calc(var(--i, 0) * .05s); }
.no-intro .showcase-head, .no-intro .hero h1 span, .no-intro .rail .card { 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: var(--accent); transition: none; }
.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); }
.card-cap small { margin-left: auto; font-size: 13px; color: var(--ink-3); white-space: nowrap; }

/* 目录：背景点阵呼应首屏的点云 */
.catalog { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 36px 48px; padding-top: 84px; padding-bottom: 104px; }
.cat-head { grid-column: 1 / -1; display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.cat-head h2 { margin: 0; font-family: var(--display); font-size: 38px; line-height: 1.2; font-weight: 900; letter-spacing: .04em; margin-right: auto; }
.search { position: relative; display: block; width: min(320px, 100%); }
.search svg { position: absolute; left: 11px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search input {
  width: 100%; height: 38px; padding: 0 12px 0 36px; border-radius: 7px; border: 1px solid var(--rule-2);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 14.5px; transition: border-color .15s, box-shadow .15s;
}
.search input::placeholder { color: var(--ink-3); }
.search input:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 3px var(--cobalt-wash); }
.is-hidden { display: none !important; }
.no-hit { grid-column: 2; margin: 8px 0 0; color: var(--ink-3); font-size: 15px; }
.searching .rows li { border-top: 0; }
.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), opacity .2s; }
.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-family: var(--display); font-size: 27px; line-height: 1.3; font-weight: 900; letter-spacing: .03em; white-space: nowrap; }
.book-head .meter { flex: 1; max-width: 220px; }
/* 翻开课本：有课本页面的册，在册名旁边 */
.book-open {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px 0 10px; border-radius: 15px; flex: none;
  border: 1px solid var(--rule-2); background: var(--surface); color: var(--ink-2); font-size: 13.5px; font-weight: 500;
  transition: border-color .2s, color .2s, box-shadow .3s var(--ease), transform .2s var(--ease);
}
.book-open svg { width: 16px; height: 16px; }
.book-open:hover { border-color: var(--cobalt); color: var(--cobalt-deep); box-shadow: 0 6px 16px -10px rgba(36, 80, 184, .6); transform: translateY(-1px); }
.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;
  opacity: 0; transform: translateY(16px);
  transition: opacity .7s var(--ease) var(--d, 0ms), transform .8s var(--ease) var(--d, 0ms), border-color .25s, box-shadow .35s var(--ease);
}
.chapter.in, .no-intro .chapter { opacity: 1; transform: none; }
.chapter:hover { border-color: var(--rule-2); box-shadow: 0 14px 30px -24px rgba(11, 23, 48, .4); }
.chapter h4 { margin: 0 0 6px; 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; }
/* 章名前的色点：这一章所属的物理领域 */
.chapter h4::before { content: ""; flex: none; align-self: center; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.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 solid color-mix(in srgb, var(--rule) 60%, transparent); }
.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: 14px; width: calc(100% + 16px); margin: 4px -8px; padding: 6px 10px 6px 8px;
  border-radius: 9px; color: var(--ink); transition: background-color .25s;
}
.rows .ready a:hover { background: var(--cobalt-wash); }
.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; min-width: 0; font-weight: 550; }
/* 教材原图徽章：默认右移与右侧“待做”标签对齐，悬停时轻盈左移给箭头让位 */
.rows .ready .orig-tag {
  flex: none; font-size: 11.5px; font-weight: 550; line-height: 1; letter-spacing: .04em; white-space: nowrap;
  padding: 4px 8px; border-radius: 999px;
  color: var(--cobalt-deep);
  background: color-mix(in srgb, var(--cobalt) 8%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cobalt) 22%, transparent);
  transform: translateX(30px);
  transition: transform .3s var(--ease), background-color .25s, box-shadow .25s;
}
.rows .ready a:hover .orig-tag, .rows .ready a:focus-visible .orig-tag {
  transform: none;
  background: color-mix(in srgb, var(--cobalt) 12%, #fff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cobalt) 36%, transparent);
}
.rows .ready svg { width: 16px; height: 16px; flex: none; color: var(--cobalt); opacity: 0; transform: translateX(-6px); transition: transform .3s var(--ease), opacity .2s; }
.rows .ready a:hover svg, .rows .ready a:focus-visible svg { opacity: 1; transform: none; }
.rows .ready canvas, .rows .ready img { transition: transform .35s var(--ease), box-shadow .35s; }
.rows .ready a:hover canvas, .rows .ready a:hover img { transform: scale(1.06); box-shadow: 0 0 0 1px rgba(21, 32, 43, .08), 0 8px 18px -10px rgba(11, 23, 48, .5); }
.only-ready .rows li { border-top: 0; }

/* 目录：一张带圆角的纸，压在深色区的下沿上 */
.sheet {
  position: relative; margin-top: calc(-1 * var(--sheet-r)); border-radius: var(--sheet-r) var(--sheet-r) 0 0;
  background: var(--paper) radial-gradient(rgba(21, 32, 43, .075) 1px, transparent 1.4px) 0 0 / 22px 22px;
  box-shadow: 0 -24px 60px -12px rgba(0, 0, 0, .5);
}
.foot { position: relative; 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: 18px; }
.foot .suggest { color: rgba(243, 246, 251, .78); transition: color .2s; }
.foot .suggest:hover { color: #fff; }
.foot .crew { display: block; padding-bottom: 36px; margin-bottom: 32px; border-bottom: 1px solid rgba(243, 246, 251, .08); }
.crew h2 { margin: 0 0 8px; font: 600 15px/1.4 var(--sans); color: #F3F6FB; display: flex; align-items: center; justify-content: center; gap: 8px; }
.crew h2 small { font: 500 12px/1 var(--sans); color: rgba(243, 246, 251, .7); background: rgba(243, 246, 251, .1); padding: 4px 8px; border-radius: 99px; }
.crew-note { margin: 0 0 22px; text-align: center; font: 400 12px/1.6 var(--sans); color: rgba(243, 246, 251, .5); }
.crew ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.crew li { width: 164px; }
.crew-card { display: flex; flex-direction: column; align-items: center; gap: 10px; height: 100%; padding: 14px 10px; border-radius: 12px; text-align: center; transition: background-color .2s; }
a.crew-card:hover { background: rgba(243, 246, 251, .05); }
.crew-av { flex: none; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: rgba(243, 246, 251, .08); box-shadow: 0 0 0 1px rgba(243, 246, 251, .12); transition: transform .3s var(--ease); }
a.crew-card:hover .crew-av { transform: translateY(-2px); }
span.crew-av { display: grid; place-items: center; font: 600 24px/1 var(--sans); color: #fff; background: linear-gradient(140deg, hsl(var(--h) 52% 46%), hsl(calc(var(--h) + 36) 48% 30%)); }
.crew-text { display: grid; gap: 2px; width: 100%; line-height: 1.5; }
.crew-text b { color: #F3F6FB; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crew-text span { color: rgba(243, 246, 251, .58); font-size: 12px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }

/* ---------- 演示页 ---------- */
.v-top { position: relative; isolation: isolate; background: var(--night); color: #F3F6FB; padding-bottom: 168px; }
/* 顶带：一团随领域变色、缓慢游移的光晕，加一层呼应标志的点阵 */
.v-top::before, .v-top::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.v-top::before {
  background: radial-gradient(46% 130% at var(--ax) 0%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 72%);
  animation: aurora 16s ease-in-out infinite alternate;
}
.v-top::after {
  background: radial-gradient(rgba(243, 246, 251, .2) 1px, transparent 1.4px) 0 0 / 22px 22px;
  -webkit-mask-image: radial-gradient(56% 120% at 82% 0%, #000, transparent 78%); mask-image: radial-gradient(56% 120% at 82% 0%, #000, transparent 78%);
}
/* 全屏演示时顶带被盖住，光晕不必继续重绘 */
body:has(.stage-frame.is-present) .v-top::before { animation-play-state: paused; }
@keyframes aurora { from { --ax: 58%; opacity: .7; } to { --ax: 90%; opacity: 1; } }
.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-family: var(--display); font-size: 31px; line-height: 1.3; font-weight: 900; letter-spacing: .02em; animation: rise .7s var(--ease) both; }
.v-head .sec { font-family: var(--math); color: var(--accent); font-weight: 400; margin-right: 14px; }
.v-head .upd { display: block; margin-top: 6px; font-family: var(--sans); font-size: 13px; font-weight: 400; letter-spacing: 0; color: rgba(243, 246, 251, .5); font-variant-numeric: tabular-nums; }
.v-main > .v-layout { margin-top: -168px; }
.v-pager { display: flex; gap: 8px; flex: none; }
/* backwards：入场结束后不残留 transform，不会变成层叠上下文或 fixed 的包含块 */
.v-layout > div > .transport { animation: rise .8s var(--ease) backwards .1s; }
.v-layout > .side { position: relative; z-index: 1; animation: rise .8s var(--ease) backwards .18s; }
.notes { animation: rise .8s var(--ease) backwards .26s; }
.notes[hidden] { display: 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: 14px; overflow: hidden; transition: background-color .3s; box-shadow: 0 34px 70px -36px rgba(7, 11, 22, .7), 0 0 110px -40px color-mix(in srgb, var(--accent) 60%, transparent); }
.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: 14px; box-shadow: 0 30px 60px -40px rgba(11, 23, 48, .55); }
.side > * { padding: 18px; }
.side > :not(:empty, [hidden]) ~ :not(:empty, [hidden]) { border-top: 1px solid var(--rule); }
.ctrl { margin-bottom: 16px; }
.ctrl:last-child { margin-bottom: 0; }
/* 按 when 隐藏了末尾的控件时，最后一个可见控件也不留底边距 */
.ctrl:not(:has(~ .ctrl:not([hidden]))) { 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), box-shadow .2s; }
input[type="range"]:hover::-webkit-slider-thumb { box-shadow: 0 1px 2px rgba(21, 32, 43, .2), 0 0 0 6px color-mix(in srgb, var(--cobalt) 14%, transparent); }
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); transition: transform .3s var(--ease), border-color .2s, box-shadow .3s; }
.formula:hover { transform: translateY(-2px); border-color: var(--rule-2); box-shadow: 0 10px 20px -14px rgba(11, 23, 48, .45); }

.v-more { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--rule); }
.v-more h2 { font-family: var(--display); font-size: 22px; margin: 0 0 18px; font-weight: 900; letter-spacing: .03em; }
.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 > :not(:empty, [hidden]) ~ :not(:empty, [hidden]) { border-top: 0; border-left: 1px solid var(--rule); }
}
@media (max-width: 860px) {
  :root { --gutter: 20px; --sheet-r: 24px; }
  .hero-title { align-items: flex-end; padding-bottom: 132px; }
  .hero h1 { font-size: clamp(34px, 11vw, 48px); }
  .domains { gap: 22px; margin: 0 -20px; padding: 0 20px; }
  .wrap, .v-main { padding-left: 20px; padding-right: 20px; }
  .nav { display: none; }
  .rail { grid-auto-columns: 78vw; gap: 14px; }
  .rail-btns .btn:not(#autoBtn) { display: none; }   /* 触屏直接滑动展台，只留暂停键 */
  .catalog { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 48px; }
  .cat-head h2 { font-size: 26px; }
  .search { order: 3; width: 100%; }
  .no-hit { grid-column: 1; }
  .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 > :not(:empty, [hidden]) ~ :not(:empty, [hidden]) { border-left: 0; border-top: 1px solid var(--rule); }
  .crumbs .hide-sm { display: none; }
  .v-head { padding: 22px 20px 18px; }
  .v-head { flex-wrap: wrap; row-gap: 14px; }
  .v-head h1 { font-size: 22px; flex: 1 1 100%; }
  .v-head .upd { white-space: nowrap; }
  .v-top { padding-bottom: 120px; }
  .v-main > .v-layout { margin-top: -120px; }
}

/* ---------- 课件页 ---------- */
.lesson-top { display: flex; align-items: flex-end; min-height: 320px; padding-bottom: 0; overflow: hidden; }
.lesson-top::before, .lesson-top::after { content: none; }   /* 这里用粒子场景代替光晕 */
.lesson-top canvas {
  position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%;
  -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent); mask-image: linear-gradient(to bottom, #000 62%, transparent);
}
body.showing .lesson-top canvas { display: none; }   /* 连续演示时停掉顶带的粒子渲染 */
.lesson-top .v-head { width: 100%; padding-bottom: 38px; pointer-events: none; }
.lesson-top .v-head > * { pointer-events: auto; }
.lesson-top h1 { font-size: clamp(38px, 5vw, 56px); letter-spacing: .06em; text-shadow: 0 2px 30px rgba(7, 11, 22, .8); }
.lesson-top h1 small { margin-left: 14px; font-family: var(--math); font-size: .5em; font-weight: 400; letter-spacing: 0; color: var(--accent); }
.lesson-main { padding-top: 36px; min-height: 52vh; }
.lesson-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; margin-bottom: 18px; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); }
.lesson-banner[hidden] { display: none; }
.lesson-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.lesson-item {
  position: relative; display: grid; grid-template-columns: 40px 176px minmax(0, 1fr) auto; align-items: center; gap: 18px;
  padding: 12px 16px 12px 14px; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px;
  animation: rise .7s var(--ease) both calc(var(--i, 0) * 60ms);
  transition: border-color .2s, box-shadow .35s var(--ease), transform .35s var(--ease);
}
.ready .lesson-item { animation: none; }
.lesson-item:hover, .lesson-item:focus-within { border-color: var(--rule-2); box-shadow: 0 18px 34px -24px rgba(11, 23, 48, .5); transform: translateY(-2px); }
/* 左侧色条：这个模型所属的物理领域 */
.lesson-item::before { content: ""; position: absolute; left: -1px; top: 16px; bottom: 16px; width: 3px; border-radius: 2px; background: var(--c); transform: scaleY(.4); opacity: .7; transition: transform .35s var(--ease), opacity .2s; }
.lesson-item:hover::before, .lesson-item:focus-within::before { transform: none; opacity: 1; }
.lesson-item .idx { font-family: var(--math); font-style: italic; font-size: 26px; color: var(--ink-3); text-align: center; font-variant-numeric: tabular-nums; transition: color .2s; }
.lesson-item:hover .idx, .lesson-item:focus-within .idx { color: var(--ink); }
.lesson-thumb { display: block; border-radius: 8px; overflow: hidden; border: 1px solid var(--rule); background: #fff; }
.lesson-thumb canvas { display: block; width: 100%; aspect-ratio: 16 / 9; transition: transform .5s var(--ease); }
.lesson-item:hover .lesson-thumb canvas { transform: scale(1.04); }
.lesson-meta { display: grid; gap: 4px; min-width: 0; }
.lesson-meta b { font-size: 17px; font-weight: 600; transition: color .2s; }
.lesson-meta a:hover b { color: var(--cobalt); }
.lesson-meta small { color: var(--ink-3); font-size: 13.5px; }
.lesson-ops { display: flex; gap: 6px; }
.btn:disabled { opacity: .4; cursor: default; transform: none; }
.lesson-empty { text-align: center; padding: 72px 16px; color: var(--ink-2); animation: rise .8s var(--ease) both .1s; }
.lesson-empty[hidden] { display: none; }
.lesson-empty p { margin: 0 auto 18px; max-width: 32em; }
.sim-missing { min-height: calc(100vh - 220px); display: flex; flex-direction: column; align-items: center; justify-content: center; padding-bottom: 12vh; }

.lesson-show { position: fixed; inset: 0; z-index: 300; background: #000; display: grid; place-items: center; }
.lesson-show[hidden] { display: none; }
.lesson-show iframe { width: 100%; height: 100%; border: 0; background: var(--night); transition: opacity .25s; }
.lesson-show iframe.fading { opacity: 0; }
.show-bar {
  position: absolute; left: 50%; top: 18px; transform: translate(-50%, -8px); display: flex; align-items: center; gap: 4px;
  padding: 5px; border-radius: 12px; background: rgba(21, 32, 43, .88); color: #fff; opacity: 0; pointer-events: none;
  transition: opacity .3s, transform .3s var(--ease);
}
.lesson-show.show-ui-on .show-bar, .show-bar:focus-within { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.show-bar button { height: 38px; min-width: 38px; padding: 0 11px; border: 0; border-radius: 8px; background: transparent; color: #fff; font-size: 14px; display: inline-grid; place-items: center; }
.show-bar button:hover { background: rgba(255, 255, 255, .12); }
.show-bar button:disabled { opacity: .35; }
.show-bar svg { width: 18px; height: 18px; }
.show-bar .div { width: 1px; align-self: stretch; background: rgba(255, 255, 255, .18); margin: 7px 4px; }
.show-count { font-family: var(--math); font-size: 16px; padding: 0 6px; font-variant-numeric: tabular-nums; }
.show-title { font-size: 14px; opacity: .8; padding-right: 6px; max-width: 32vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.showing { overflow: hidden; }
@media (max-width: 860px) {
  .lesson-item { grid-template-columns: 28px 112px minmax(0, 1fr); }
  .lesson-top { min-height: 260px; }
  .lesson-top .v-head { flex-wrap: wrap; padding-bottom: 26px; }
  .lesson-ops { grid-column: 1 / -1; justify-self: end; margin-top: -6px; }
  .lesson-ops .btn.icon { width: 34px; height: 34px; }
  /* 播放控制一行，速度、配色与演示另起一行 */
  .transport .spacer { flex-basis: 100%; height: 0; }
  .transport #presentBtn { margin-left: auto; }
}


/* ---------- 原图动画 ---------- */
.btn.primary { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.btn.primary:hover { background: var(--cobalt-deep); border-color: var(--cobalt-deep); }
.btn.primary[aria-pressed="true"] { background: var(--cobalt-wash); border-color: var(--cobalt); color: var(--cobalt-deep); }
label.btn { cursor: pointer; }
label.btn:focus-within { outline: 2px solid #8FB4FF; outline-offset: 2px; }
.seg.dark { background: rgba(243, 246, 251, .06); border-color: rgba(243, 246, 251, .16); }
.seg.dark button { color: rgba(243, 246, 251, .72); }
.seg.dark button:hover { color: #fff; }
.seg.dark button[aria-pressed="true"] { color: #fff; }
.seg.dark .thumb { background: rgba(143, 180, 255, .22); }

.fig-frame { user-select: none; -webkit-user-select: none; }
.fig-overlay { position: absolute; left: 0; top: 0; touch-action: none; }
.fig-frame.is-tool .fig-overlay { cursor: crosshair; }
.fig-frame.is-present .fig-overlay, .fig-frame.is-present .fig-hint { display: none; }
.fig-hint {
  position: absolute; left: 50%; top: 16px; transform: translateX(-50%); pointer-events: none;
  padding: 7px 14px; border-radius: 999px; background: rgba(21, 32, 43, .86); color: #fff; font-size: 14px;
  box-shadow: 0 8px 24px -12px rgba(11, 23, 48, .6); animation: hint-in .35s var(--ease) both;
}
.fig-hint[hidden] { display: none; }
@keyframes hint-in { from { opacity: 0; transform: translate(-50%, -6px); } }
.fig-drop:not([hidden]) { animation: fade .25s var(--ease); }
.fig-drop {
  position: absolute; inset: 10px; border: 2px dashed var(--cobalt); border-radius: 10px; pointer-events: none;
  display: grid; place-items: center; background: rgba(231, 237, 248, .82); color: var(--cobalt-deep); font-size: 16px; font-weight: 600;
}
.fig-drop[hidden] { display: none; }

.side > [hidden] { display: none; }
.fig-layers { display: grid; gap: 10px; }
.fig-layers > .btn { width: 100%; }
.layer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.layer-list:empty { display: none; }
.layer-item { display: flex; align-items: center; gap: 4px; border-radius: 8px; transition: background-color .2s; }
.layer-item:hover { background: var(--paper); }
.layer-item[aria-current="true"]:hover { background: var(--cobalt-wash); }
.layer-item[aria-current="true"] { background: var(--cobalt-wash); }
.layer-pick { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; height: 38px; padding: 0 8px; border: 0; background: none; font-size: 14px; color: var(--ink-2); text-align: left; border-radius: 8px; }
.layer-item[aria-current="true"] .layer-pick { color: var(--cobalt-deep); font-weight: 600; }
.layer-pick .idx { transition: background-color .2s, transform .3s var(--ease); }
.layer-item:hover .idx { transform: scale(1.1); }
.layer-pick .idx { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(21, 32, 43, .6); color: #fff; font-size: 12px; font-weight: 600; flex: none; }
.layer-item[aria-current="true"] .idx { background: var(--cobalt); }
.layer-del { border-color: transparent; background: transparent; color: var(--ink-3); width: 32px; height: 32px; }
.layer-del:hover { color: var(--signal); border-color: transparent; }
.fig-redo { width: 100%; margin-bottom: 12px; }
.motion-seg.flash { animation: seg-flash 1.2s var(--ease); }
@keyframes seg-flash { 0%, 100% { box-shadow: 0 0 0 0 rgba(36, 80, 184, 0); } 30% { box-shadow: 0 0 0 4px rgba(36, 80, 184, .25); } }
@media (prefers-reduced-motion: reduce) { .fig-hint, .motion-seg.flash { animation: none; } }
.figure-page .v-head { flex-wrap: wrap; }
.figure-page .v-head h1 { white-space: nowrap; }
.figure-page .v-pager { flex-wrap: wrap; }
.fig-undo { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 6px 6px 12px; border-radius: 8px; background: var(--paper); font-size: 14px; color: var(--ink-2); animation: hint-in .3s var(--ease) both; }
.fig-undo[hidden] { display: none; }
.fig-undo .btn { height: 30px; padding: 0 12px; }
.fig-overlay:focus-visible { outline: 2px solid var(--cobalt); outline-offset: -2px; border-radius: 0; }
.seg.motion-seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; }
.motion-seg button { padding: 0 4px; }
.motion-seg button[aria-pressed="true"] { background: var(--cobalt-wash); }
.rows .ready img { display: block; width: 92px; aspect-ratio: 16 / 9; flex: none; border-radius: 5px; background: #fff; object-fit: cover; box-shadow: 0 0 0 1px rgba(21, 32, 43, .08); }
.fig-caption { margin: 10px 0 0; text-align: center; font-size: 14px; color: var(--ink-3); animation: rise .8s var(--ease) backwards .06s; }
.fig-caption[hidden] { display: none; }
.sec-mode #samples, .sec-mode #uploadBtn { display: none; }
.v-head .crumb-line { display: block; font-family: var(--sans); letter-spacing: 0; font-size: 14px; font-weight: 400; color: rgba(243, 246, 251, .6); margin-bottom: 6px; }
.v-head .crumb-line a { color: inherit; }
.v-head .crumb-line a:hover { color: #fff; }
.fig-edit { display: none; }
.fig-edit .btn { width: 100%; }
/* 三维复刻页只演示：不提供圈选等制作工具，也不显示周期滑块 */
.sec-mode .fig-edit, .sec-mode #periodBox, .sec-mode .fig-layers, .sec-mode #settings { display: none !important; }
.view-only .fig-layers, .view-only #settings { display: none; }
.view-only .fig-overlay { cursor: pointer; }
#more[hidden] { display: none; }
/* 有三维复刻的小节：本节模型行缩进，紧跟在三维复刻行下面 */
.rows li.sub { padding-left: 28px; border-top: 0; }
.rows li.sub a { margin-top: 0; }
.scene-ctl[hidden], #periodBox[hidden], .fig-edit[hidden] { display: none !important; }
.side > :empty { display: none; }   /* 没有滑块或开关的模型不留空白分区 */
/* 窄屏上长标题换行，不撑出横向滚动（放在文件末尾，排在上面的 nowrap 之后） */
@media (max-width: 860px) { .figure-page .v-head h1 { white-space: normal; } }
/* 待做的教材原图：原图缩略图 + “待做”标签，点开看原图 */
.rows li.todo { padding-top: 0; padding-bottom: 0; }
.rows .todo button {
  display: flex; align-items: center; gap: 14px; width: calc(100% + 16px); margin: 3px -8px; padding: 5px 10px 5px 8px;
  border: 0; border-radius: 9px; background: none; font: inherit; font-size: 13.5px; text-align: left; color: var(--ink-3); cursor: zoom-in;
  transition: background-color .25s, color .25s;
}
.rows .todo button:hover, .rows .todo button:focus-visible { background: color-mix(in srgb, var(--rule) 30%, transparent); color: var(--ink); }
.rows .todo img {
  display: block; width: 92px; aspect-ratio: 16 / 9; flex: none; object-fit: contain; border-radius: 5px; background: #fff;
  box-shadow: 0 0 0 1px rgba(21, 32, 43, .08); filter: grayscale(.35); opacity: .78;
  transition: filter .3s, opacity .3s, transform .35s var(--ease);
}
.rows .todo button:hover img, .rows .todo button:focus-visible img { filter: none; opacity: 1; transform: scale(1.06); }
.rows .todo .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rows .todo .tag { flex: none; font-size: 11.5px; line-height: 1; padding: 4px 8px; border-radius: 999px; color: #8A5A0B; background: #FDF1D8; box-shadow: inset 0 0 0 1px #F1D9A6; }
.only-ready .rows li.todo { display: none; }

/* 原图查看弹层 */
.todo-view {
  max-width: min(92vw, 980px); max-height: 92vh; padding: 0; border: 0; border-radius: 16px; background: #fff; color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(11, 23, 48, .55); overflow: visible;
}
.todo-view[open] { animation: todo-in .32s var(--ease); }
.todo-view::backdrop { background: rgba(11, 18, 32, .58); backdrop-filter: blur(4px); animation: todo-fade .25s ease; }
@keyframes todo-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes todo-fade { from { opacity: 0; } }
.todo-view figure { position: relative; margin: 0; padding: 28px 28px 20px; max-height: 92vh; overflow-y: auto; overscroll-behavior: contain; }
.todo-imgs { display: flex; gap: 18px; justify-content: center; align-items: center; flex-wrap: wrap; }
.todo-imgs img { display: block; max-width: 100%; max-height: calc(92vh - 150px); object-fit: contain; }
.todo-imgs[data-n="2"] img { max-width: calc(50% - 9px); }
.todo-imgs[data-n="3"] img, .todo-imgs[data-n="4"] img { max-width: calc(50% - 9px); max-height: calc(46vh - 80px); }
/* “待做”章：斜盖在原图右上角 */
.todo-view .stamp {
  position: absolute; top: 18px; right: 24px; padding: 6px 16px; border: 3px solid #C2410C; border-radius: 8px;
  color: #C2410C; font-size: 26px; font-weight: 800; letter-spacing: .18em; line-height: 1;
  background: rgba(255, 255, 255, .78); transform: rotate(-12deg); opacity: .88; pointer-events: none;
}
.todo-view[open] .stamp { animation: stamp-in .42s .12s var(--ease) both; }
@keyframes stamp-in { from { opacity: 0; transform: rotate(-12deg) scale(1.6); } }
.todo-view figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-top: 16px; font-size: 15px; }
.todo-view figcaption b { font-family: var(--math); font-weight: 600; color: var(--cobalt-deep); }
.todo-view figcaption small { flex-basis: 100%; color: var(--ink-3); font-size: 12.5px; }
.todo-close {
  position: absolute; top: -14px; right: -14px; display: grid; place-items: center; width: 36px; height: 36px;
  border: 0; border-radius: 50%; background: #fff; color: var(--ink); cursor: pointer; box-shadow: 0 6px 18px -6px rgba(11, 23, 48, .45);
}
.todo-close svg { width: 16px; height: 16px; }
@media (max-width: 600px) {
  .rows .todo img { width: 64px; }
  .todo-close { top: 8px; right: 8px; }
  .todo-view .stamp { font-size: 20px; top: 12px; right: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .todo-view[open], .todo-view[open] .stamp, .todo-view::backdrop { animation: none; }
}
@media (max-width: 860px), (hover: none) {
  .rows .ready svg { display: none; }
  .rows .ready .orig-tag { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rows .ready .orig-tag { transform: none; }
}
