/* Verdandi · 产品介绍页 · 「飘带」：白底、靛蓝，一条由蓝到紫的飘带 */
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/fonts/jbmono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --bg: #fbfbfe;
  --paper: #ffffff;
  --tint: #f2f3fc;
  --ink: #22254d;
  --ink-2: #585d86;
  --ink-3: #868aab;
  --accent: #3e48c6;
  --line: rgba(34, 37, 77, .12);
  --b1: #3d7bff;
  --b2: #7d6bff;
  --b3: #b08cff;
  --night: #15172f;
  --night-2: #1d2042;
  --on-night: #ecedf9;
  --on-night-2: #a9acd0;
  --night-card: #1f2247;
  --code-bg: #15172f;
  --code-ink: #dfe2ff;
  --code-dim: #8e93c2;
  --code-line: rgba(255, 255, 255, .08);
  --r: 28px;
  --sans: "Inter", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", system-ui, sans-serif;
  --serif: "Noto Serif SC", "Songti SC", serif;
  --display: "Cormorant Garamond", "Noto Serif SC", serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
  --pad: clamp(20px, 6vw, 96px);
  --max: 1280px;
  --shadow: 0 1px 2px rgba(34, 37, 77, .06), 0 12px 30px -12px rgba(34, 37, 77, .22), 0 40px 80px -40px rgba(34, 37, 77, .28);
  --shadow-soft: 0 1px 2px rgba(34, 37, 77, .05), 0 10px 24px -14px rgba(34, 37, 77, .22);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font: 400 16px/1.75 var(--sans);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p, figure, blockquote, h1, h2, h3, ul, ol, pre { margin: 0; }
ul, ol { padding: 0; list-style: none; }
code { font-family: var(--mono); }
button { font: inherit; color: inherit; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.wrap { width: min(100% - 2 * var(--pad), var(--max)); margin-inline: auto; }
:focus-visible { outline: 2px solid var(--b2); outline-offset: 4px; border-radius: 6px; }
section[id], div[id].ch { scroll-margin-top: 24px; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 30; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; text-decoration: none; font-size: .85rem; }
.skip:focus { top: 12px; }

/* ---------- 回主页 / 语言 ---------- */
.home {
  display: inline-flex; align-items: center; gap: .55em;
  font: 600 .8rem/1 var(--sans); letter-spacing: .2em;
  text-decoration: none; color: var(--ink);
  padding: 6px 0;
}
.home-star { width: 15px; height: 19px; fill: var(--ink); transition: transform .5s cubic-bezier(.3, 1.4, .5, 1); }
.home:hover .home-star { transform: rotate(45deg) scale(1.15); }
.home span { padding-top: .1em; }

.topbar {
  position: absolute; left: 0; right: 0; top: 30px; z-index: 5;
  display: flex; justify-content: space-between; align-items: center;
}
.lang { display: flex; gap: 1.1em; font: 500 .78rem/1 var(--sans); letter-spacing: .06em; padding: 2px 12px; margin-right: -12px; border-radius: 999px; background: rgba(251, 251, 254, .78); }
.lang a, .lang span { text-decoration: none; color: var(--ink-2); padding: .45em 0; position: relative; }
.lang a:hover { color: var(--ink); }
.lang [aria-current] { color: var(--ink); }
.lang [aria-current]::after {
  content: ""; position: absolute; left: 50%; bottom: -4px; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%; background: linear-gradient(135deg, var(--b1), var(--b3));
}

/* ---------- 章节导航 ---------- */
.toc {
  position: fixed; top: 14px; left: 50%; z-index: 20;
  display: flex; gap: 2px; padding: 5px;
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border: 1px solid var(--line); border-radius: 999px;
  box-shadow: 0 8px 24px -14px rgba(34, 37, 77, .35);
  transform: translate(-50%, -12px); opacity: 0; pointer-events: none;
  transition: opacity .35s ease, transform .45s cubic-bezier(.2, .8, .2, 1);
}
.toc.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toc a {
  font: 500 .78rem/1 var(--sans); letter-spacing: .04em; color: var(--ink-2); text-decoration: none;
  padding: 8px 13px; border-radius: 999px; white-space: nowrap;
  transition: color .2s, background-color .2s;
}
.toc a:hover { color: var(--ink); }
.toc a[aria-current="true"] { color: #fff; background: var(--ink); }
.toc.on-night { background: rgba(29, 32, 66, .82); border-color: rgba(255, 255, 255, .12); }
.toc.on-night a { color: var(--on-night-2); }
.toc.on-night a:hover { color: #fff; }
.toc.on-night a[aria-current="true"] { color: var(--night); background: #fff; }

/* ---------- 首屏：浮雕钉在右边，左边一栏是四「步」：名字和导语第一段占满一屏，后三段各约半屏 ---------- */
.hero {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr);
  overflow: clip; /* 不能用 hidden：hidden 会让下面的 sticky 失效 */
}
.hero-art {
  grid-area: 1 / 1; justify-self: end; align-self: start;
  position: sticky; top: 0;
  width: min(64vw, calc(50vw + 160px)); height: max(620px, 100svh);
  overflow: hidden; z-index: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 30%), linear-gradient(180deg, #000 78%, transparent 100%);
  -webkit-mask-composite: source-in; mask-composite: intersect;
  mask-image: linear-gradient(90deg, transparent 0, #000 30%), linear-gradient(180deg, #000 78%, transparent 100%);
}
.hero-art img {
  width: 100%; height: 100%; object-fit: cover; object-position: 58% 44%;
  transform-origin: 44% 46%; /* 推近时以脸为中心 */
}
.hero-text {
  grid-area: 1 / 1; position: relative; z-index: 2;
  --col: calc(27 * 1.04rem); /* 导语这一栏的宽度：第一段 27em */
}
.step { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.step-first { min-height: max(620px, 100svh); padding: 110px 0; }
.step:not(.step-first) { min-height: 56svh; }
.step-last { margin-bottom: 20svh; }
.hero-mark { display: flex; align-items: center; gap: 18px; margin-bottom: 30px; }
.app-icon {
  width: 64px; height: 64px; border-radius: 15px;
  box-shadow: 0 1px 2px rgba(34, 37, 77, .08), 0 10px 22px -10px rgba(34, 37, 77, .3);
}
.title {
  font: 600 clamp(5.4rem, 9.6vw, 9.6rem)/.84 var(--display);
  letter-spacing: -.012em;
  margin: 0 0 30px -.04em;
}
.year {
  font: 500 .9rem/1 var(--sans); letter-spacing: .1em; color: var(--ink-2); white-space: nowrap;
  padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255, 255, 255, .7);
}
/* 定位：电脑上在逗号后断成两行，第二行大致和「Verdandi」一样宽（字号跟着标题的 9.6vw 走） */
.tagline {
  font: 600 clamp(1.25rem, 1.7vw, 1.7rem)/1.6 var(--serif); letter-spacing: .03em;
  margin-bottom: 24px;
}
.tagline > span { display: block; white-space: nowrap; }
.tagline .nb { white-space: nowrap; } /* 窄屏上第二行放不下时，只在这个词前面断 */
.intro {
  font: 400 1.04rem/2 var(--sans); color: var(--ink);
  max-width: var(--col); text-wrap: pretty;
}
.step-p { font: 400 1.08rem/2 var(--sans); color: var(--ink); max-width: var(--col); text-wrap: pretty; }
.ribbon-mark {
  display: block; width: 26px; height: 7px; border-radius: 6px;
  margin-bottom: 24px;
  background: linear-gradient(90deg, var(--b1), var(--b2) 70%, var(--b3));
  clip-path: polygon(0 50%, 30% 0, 100% 35%, 100% 65%, 30% 100%);
}
.thesis { font: 500 1.35rem/1.85 var(--serif); letter-spacing: .02em; color: var(--ink); max-width: var(--col); }
.thesis .ph { display: inline; } /* 这一栏窄，按词组断行会留下很短的行，所以顺着排满 */

/* 聚焦：屏幕中段的那一步是实的，别的步淡下去；浮雕每进一步推近一点（脚本给 .hero 加 is-steps 和 data-at） */
@media (min-width: 1101px), (min-width: 761px) and (orientation: landscape) {
  .hero.is-steps .step { opacity: .3; transition: opacity .5s ease; }
  .hero.is-steps .step.is-on { opacity: 1; }
  .hero.is-steps .hero-art img { transition: transform 1.2s cubic-bezier(.2, .7, .2, 1); }
  .hero.is-steps[data-at="1"] .hero-art img { transform: scale(1.015); }
  .hero.is-steps[data-at="2"] .hero-art img { transform: scale(1.03); }
  .hero.is-steps[data-at="3"] .hero-art img { transform: scale(1.045); }
}

/* ---------- 通用章节：每一章是一组组「大画面 + 贴着它的字」 ---------- */
/* 首屏保持原来的版心 */
.hero .wrap { --max: 1240px; }
.ch {
  padding: clamp(88px, 8vw, 132px) 0;
  --grp: clamp(64px, 6vw, 96px);
  --cap: var(--ink-3);
}
.band-tint { background: var(--tint); }
.band-night { background: var(--night); color: var(--on-night); --cap: var(--on-night-2); }
/* 一组和下一组之间 */
.ch .wrap > * + * { margin-top: var(--grp); }
.ch .wrap > .ch-head + * { margin-top: 52px; }

.eyebrow {
  font: 600 .8rem/1 var(--sans); letter-spacing: .16em; color: var(--accent);
  margin-bottom: 22px;
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before {
  content: ""; width: 22px; height: 6px; border-radius: 6px;
  background: linear-gradient(90deg, var(--b1), var(--b2) 70%, var(--b3));
  clip-path: polygon(0 50%, 30% 0, 100% 35%, 100% 65%, 30% 100%);
}
h2 {
  font: 600 clamp(2.3rem, 4.4vw, 4rem)/1.18 var(--serif);
  letter-spacing: .01em;
  max-width: 18em; text-wrap: balance;
}
/* 第一章的章头：标题占左 7 栏，导语占右 5 栏，和标题的最后一行底对齐 */
.ch-head-split { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: end; }
.ch-head-split .ch-t { grid-column: 1 / 8; }
.ch-head-split .lede { grid-column: 8 / 13; margin: 0 0 .5em; padding-left: clamp(0px, 2.4vw, 40px); }
h2 .ph { display: inline-block; }
h3 { font: 600 1.2rem/1.45 var(--serif); letter-spacing: .03em; }
.band-night .eyebrow { color: #9ea6ff; }
.band-night h2 { color: #fff; }
/* 第一章的导语 */
.lede { margin-top: 28px; font: 400 1.3rem/1.75 var(--sans); max-width: 30em; color: var(--on-night); text-wrap: pretty; }

/* 栅格：一行一个 .g12；画面 7 栏、字 5 栏（个别行另有说明） */
.g12 {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px; row-gap: 24px; align-items: center;
}
.g12 > * { grid-row: 1; min-width: 0; }
.c1-5 { grid-column: 1 / 6; }
.c1-6 { grid-column: 1 / 7; }
.c1-7 { grid-column: 1 / 8; }
.c1-8 { grid-column: 1 / 9; }
.c1-4 { grid-column: 1 / 5; }
.c5-12 { grid-column: 5 / 13; }
.c6-12 { grid-column: 6 / 13; }
.c7-12 { grid-column: 7 / 13; }
.c8-12 { grid-column: 8 / 13; }
.c9-12 { grid-column: 9 / 13; }
/* 字离画面远一点：在左边的往左收，在右边的往右收 */
.txt.l { padding-right: clamp(0px, 2.4vw, 40px); }
.txt.r { padding-left: clamp(0px, 2.4vw, 40px); }
.para { font: 400 1.0625rem/1.9 var(--sans); color: var(--ink); max-width: 30em; text-wrap: pretty; }
.band-night .para { color: var(--on-night); }
.para code, .step-p code, .thesis code, .lede code {
  font-size: .86em; padding: .08em .36em; border-radius: 5px;
  background: rgba(34, 37, 77, .055); color: inherit;
  overflow-wrap: anywhere;
}
.band-night .para code { background: rgba(255, 255, 255, .09); color: #dfe2ff; }
.para strong, .step-p strong { font-weight: 600; }

/* 图注 */
.cap, figure > figcaption { margin-top: 14px; font: 400 .82rem/1.75 var(--sans); color: var(--cap, var(--ink-3)); max-width: 56em; }

/* ---------- 卡片：画面、演示、终端都装在大圆角卡片里 ---------- */
.card {
  position: relative; border-radius: var(--r); overflow: hidden;
  background: var(--paper); box-shadow: var(--shadow-soft);
}
.card > img { width: 100%; }
.r-3x2 { aspect-ratio: 3 / 2; }
.r-16x9 { aspect-ratio: 16 / 9; }
.r-5x3 { aspect-ratio: 5 / 3; }
.r-3x2 > img, .r-16x9 > img, .r-5x3 > img { height: 100%; object-fit: cover; }
/* 岩浆：3:2 裁掉两边的黑以后再放大一点，让那圈岩浆占满卡片的高度 */
.r-lava > img { transform: scale(1.12); transform-origin: 50% 60%; }
.band-night .card { background: var(--night-card); box-shadow: 0 40px 80px -50px rgba(0, 0, 0, .9); }
.band-tint .card { box-shadow: 0 1px 2px rgba(34, 37, 77, .05), 0 18px 40px -24px rgba(34, 37, 77, .28); }
/* 编辑器窗口的截图：卡片底色跟截图的边一样 */
.window { background: #eef0f6; }
.card.dark { background: var(--code-bg); color: var(--code-ink); }
.band-tint .card.dark, .card.dark { box-shadow: 0 1px 2px rgba(10, 11, 30, .2), 0 30px 60px -36px rgba(10, 11, 30, .55); }

/* 等宽字的连字（<!-- 变成箭头之类）关掉 */
.vfoot code { font-variant-ligatures: none; font-feature-settings: "calt" 0, "liga" 0; }

/* ---------- 出场：滚进视口时从下方淡入 ---------- */
.js:not(.shot) .reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }
.js:not(.shot) .reveal.in { opacity: 1; transform: none; }
.js:not(.shot) .g12 > .reveal:nth-child(2) { transition-delay: .08s; }

/* ---------- 第一章：入夜 ---------- */
.tl-card { aspect-ratio: 16 / 9; background: #0e1024; }
.tl-frames { position: absolute; inset: 0; --fd: 300ms; }
.tl-f { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; z-index: 1; transition: opacity 0s linear var(--fd); }
.tl-f.is-on { opacity: 1; z-index: 2; transition: opacity var(--fd) ease; }
.tl-bar {
  position: absolute; left: 24px; right: 24px; bottom: 22px; z-index: 3;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 22px 10px 10px; border-radius: 999px;
  background: rgba(12, 13, 30, .55);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
  color: #fff;
}
.tl-btn {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: #fff; color: var(--night);
  transition: transform .2s;
}
.tl-btn:hover { transform: scale(1.06); }
.tl-btn svg { width: 16px; height: 16px; fill: currentColor; grid-area: 1 / 1; }
.tl-btn .i-pause, .tl-btn.is-playing .i-play { display: none; }
.tl-btn.is-playing .i-pause { display: block; }
.tl-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 50%; }
.tl-end { flex: none; font: 500 .8rem/1 var(--sans); letter-spacing: .06em; color: rgba(255, 255, 255, .82); }
.tl-track { position: relative; flex: 1; height: 32px; margin: 0 6px; cursor: pointer; touch-action: none; --p: 0; }
.tl-track:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 8px; }
.tl-rail { position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 4px; background: rgba(255, 255, 255, .22); overflow: hidden; }
.tl-fill { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(var(--p)); background: linear-gradient(90deg, var(--b1), var(--b2) 60%, var(--b3)); }
.tl-ticks { position: absolute; left: 0; right: 0; top: 50%; }
.tl-ticks i { position: absolute; top: -2.5px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: rgba(255, 255, 255, .55); }
.tl-ticks i:nth-child(1) { left: 0; } .tl-ticks i:nth-child(2) { left: 8.333%; } .tl-ticks i:nth-child(3) { left: 16.667%; }
.tl-ticks i:nth-child(4) { left: 25%; } .tl-ticks i:nth-child(5) { left: 33.333%; } .tl-ticks i:nth-child(6) { left: 41.667%; }
.tl-ticks i:nth-child(7) { left: 50%; } .tl-ticks i:nth-child(8) { left: 58.333%; } .tl-ticks i:nth-child(9) { left: 66.667%; }
.tl-ticks i:nth-child(10) { left: 75%; } .tl-ticks i:nth-child(11) { left: 83.333%; } .tl-ticks i:nth-child(12) { left: 91.667%; }
.tl-ticks i:nth-child(13) { left: 100%; }
/* 圆点：整条宽度的一层，按 --p 平移 */
.tl-knob { position: absolute; inset: 0; pointer-events: none; transform: translateX(calc(var(--p) * 100%)); transition: transform var(--kd, .3s) ease; }
.tl-knob span {
  position: absolute; left: 0; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%;
  background: linear-gradient(135deg, var(--b1), var(--b2) 60%, var(--b3));
  box-shadow: 0 0 0 3px #fff, 0 4px 12px rgba(0, 0, 0, .45);
}
/* 屏幕够密、图被放大时按像素放大（和对比滑块一样） */
@media (min-resolution: 2dppx) and (min-width: 1101px) { .tl-f { image-rendering: pixelated; } }

/* ---------- 第一章：光照对比 ---------- */
.cmp-card { aspect-ratio: 16 / 9; background: #0b0b10; }
.cmp {
  position: absolute; inset: 0;
  touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: ew-resize;
}
.cmp img { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cmp-b { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--x)); }
/* 换视图：新图加载完才盖上来淡入，旧图等它淡入完再撤掉，中间不露底 */
.cmp-v { opacity: 0; transition: opacity 0s linear .4s; }
.cmp-v.is-on { opacity: 1; z-index: 1; transition: opacity .35s ease; }
@media (min-resolution: 2dppx) and (min-width: 1101px) { .cmp img { image-rendering: pixelated; } }
.cmp-tag {
  position: absolute; bottom: 20px; z-index: 2;
  font: 600 .74rem/1 var(--sans); letter-spacing: .1em; color: #fff;
  padding: 8px 12px; border-radius: 999px; background: rgba(12, 13, 26, .62);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.cmp-tag-a { left: 20px; }
.cmp-tag-b { right: 20px; letter-spacing: .04em; }
.cmp-handle {
  position: absolute; top: 0; bottom: 0; left: var(--x); width: 44px; margin-left: -22px; z-index: 3;
  display: flex; align-items: center; justify-content: center; cursor: ew-resize;
}
.cmp-handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: rgba(255, 255, 255, .92); }
.cmp-grip { position: relative; width: 40px; height: 40px; border-radius: 50%; background: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .4); }
.cmp-grip::before, .cmp-grip::after {
  content: ""; position: absolute; top: 50%; width: 0; height: 0; margin-top: -5px;
  border: 5px solid transparent;
}
.cmp-grip::before { left: 8px; border-right: 6px solid var(--night); border-left: 0; }
.cmp-grip::after { right: 8px; border-left: 6px solid var(--night); border-right: 0; }
.cmp-handle:focus-visible { outline: none; }
.cmp-handle:focus-visible .cmp-grip { outline: 2px solid #9ea6ff; outline-offset: 3px; }
/* 视图按钮压在卡片右上角 */
.ltabs {
  position: absolute; top: 18px; right: 18px; z-index: 4;
  display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; max-width: calc(100% - 36px);
  background: rgba(12, 13, 30, .58);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
}
.ltabs button {
  border: 0; background: none; cursor: pointer; white-space: nowrap;
  padding: 8px 15px; border-radius: 999px;
  font: 500 .82rem/1.25 var(--sans); color: rgba(255, 255, 255, .78);
  transition: background-color .2s, color .2s;
}
.ltabs button:hover { color: #fff; }
.ltabs button[aria-pressed="true"] { background: #fff; color: var(--night); }
.ltabs button:focus-visible { outline-color: #fff; outline-offset: 1px; border-radius: 999px; }

/* ---------- 第一章：编辑器的三个画面 ---------- */
.ed-win { aspect-ratio: 3200 / 1574; background: #22253f; }
/* 只露出窗口上面的约 82%（第二张的菜单要露全），顶对齐，裁口和历史那张一样往下渐隐 */
.ed-win { -webkit-mask-image: linear-gradient(#000 90%, transparent); mask-image: linear-gradient(#000 90%, transparent); }
.ed-stack { position: absolute; inset: 0; }
.ed-v { position: absolute; left: 0; top: 0; width: 100%; height: auto; opacity: 0; transition: opacity 0s linear .35s; }
.ed-v.is-on { opacity: 1; z-index: 1; transition: opacity .35s ease; }
.ed-tabs {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px;
  width: min(100%, 1040px); margin: 20px auto 0;
}
.ed-tab { text-align: center; cursor: pointer; }
.ed-tab button {
  border: 0; cursor: pointer; white-space: nowrap;
  padding: 10px 20px; border-radius: 999px;
  font: 500 .9rem/1.2 var(--sans); letter-spacing: .01em;
  color: var(--on-night); background: rgba(255, 255, 255, .08);
  transition: background-color .25s, color .25s;
}
.ed-tab button:hover { background: rgba(255, 255, 255, .14); }
.ed-tab button[aria-selected="true"] { color: #fff; background: linear-gradient(90deg, var(--b1), var(--b2) 60%, var(--b3)); box-shadow: 0 8px 24px -10px rgba(125, 107, 255, .8); }
.ed-tab button:focus-visible { outline-color: #fff; border-radius: 999px; }
.ed-cap { margin: 12px auto 0; max-width: 24em; font: 400 .82rem/1.7 var(--sans); color: var(--on-night-2); opacity: .55; transition: opacity .25s; }
.ed-tab.is-on .ed-cap { opacity: 1; color: var(--on-night); }
.ed-zoom { display: none; }

/* ---------- 第一章：同一帧上的叠加层和光照视图 ---------- */
.ex-stack { position: relative; aspect-ratio: 16 / 9; background: #0e1024; }
.ex-v { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0s linear .35s; }
.ex-v.is-on { opacity: 1; z-index: 1; transition: opacity .35s ease; }
.ex-ctl { display: grid; gap: 16px; padding: 20px 24px 24px; }
.ex-k { font: 600 .66rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--on-night-2); margin-bottom: 10px; }
.ex-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.ex-btns button {
  border: 0; cursor: pointer; white-space: nowrap;
  padding: 6px 12px; border-radius: 999px;
  font: 500 .78rem/1.25 var(--sans); color: var(--on-night-2); background: rgba(255, 255, 255, .06);
  transition: background-color .2s, color .2s;
}
.ex-btns button:hover { color: #fff; background: rgba(255, 255, 255, .12); }
.ex-btns button[aria-pressed="true"] { color: var(--night); background: #fff; }
.ex-btns button[data-ov][aria-pressed="true"] { color: #fff; background: linear-gradient(90deg, var(--b1), var(--b2) 60%, var(--b3)); }
.ex-btns button:focus-visible { outline-color: #fff; outline-offset: 2px; border-radius: 999px; }

/* ---------- 第二章：带标注的编辑器截图 ---------- */
.arch-card { position: relative; }
.arch-vp {
  position: absolute; left: 18.5%; top: 5%; width: 58%; height: 65%; z-index: 2; pointer-events: none;
  border-radius: 6px; padding: 2px;
  background: linear-gradient(135deg, var(--b1), var(--b2) 55%, var(--b3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .4);
}
.arch-tag {
  position: absolute; z-index: 3;
  display: grid; gap: 2px; padding: 9px 13px; border-radius: 12px;
  background: #fff; color: var(--ink);
  box-shadow: 0 1px 2px rgba(34, 37, 77, .12), 0 12px 28px -10px rgba(34, 37, 77, .45);
  font: 400 .74rem/1.45 var(--sans); white-space: nowrap;
}
.arch-tag b { font: 600 .86rem/1.3 var(--sans); }
.arch-tag span { color: var(--ink-2); }
.arch-tag::before { content: ""; position: absolute; left: 13px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, var(--b1), var(--b3)); box-shadow: 0 0 0 2px #fff; }
.arch-tag-v { left: calc(18.5% + 14px); top: calc(5% + 44px); }
.arch-tag-w { right: -14px; top: -22px; }
.arch-tag-w::before { left: auto; right: 13px; }

/* ---------- 第三章：历史 ---------- */
.hist-k { font: 500 .95rem/1.6 var(--sans); color: var(--ink-2); margin-bottom: 18px; }
.hist-stage { position: relative; }
.hist-win { aspect-ratio: 5 / 1.86; }
.hist-win img { position: absolute; left: 0; top: 0; width: 100%; height: auto; }
/* 裁口：整张卡片（连同投影）往下渐隐到底色 */
.hist-win { -webkit-mask-image: linear-gradient(#000 70%, transparent 98%); mask-image: linear-gradient(#000 70%, transparent 98%); }
.hist-zoom {
  position: absolute; right: -20px; bottom: -44px; z-index: 2; width: 540px;
  background: #fff; border-radius: 20px; padding: 12px 12px 4px;
  box-shadow: 0 2px 4px rgba(34, 37, 77, .08), 0 30px 60px -20px rgba(34, 37, 77, .5);
}
.hist-zoom img { width: 100%; border-radius: 10px; }
.hist-zoom figcaption { margin: 10px 8px 10px; }

/* ---------- 第三章：verify ---------- */
.vdemo { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 40px; padding: 30px 32px 32px; align-items: stretch; }
.vleft { min-width: 0; display: flex; flex-direction: column; }
.vdemo-stage { margin: 0; min-width: 0; }
.vbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 16px; }
.vtabs { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .07); max-width: 100%; }
.vtabs button {
  border: 0; background: none; cursor: pointer; white-space: nowrap;
  padding: 8px 16px; border-radius: 999px;
  font: 500 .84rem/1.25 var(--sans); color: var(--code-dim);
  transition: background-color .2s, color .2s;
}
.vtabs button:hover { color: #fff; }
.vtabs button[aria-selected="true"] { background: #fff; color: var(--night); }
.vtabs button[aria-disabled="true"] { opacity: .4; cursor: default; }
.vtabs button:focus-visible { outline-color: #fff; outline-offset: 1px; border-radius: 999px; }
.vnav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.vnav button {
  width: 34px; height: 34px; padding: 0 0 2px; border-radius: 50%; cursor: pointer;
  border: 0; background: rgba(255, 255, 255, .08);
  font: 400 1.2rem/1 var(--sans); color: var(--code-ink);
  display: grid; place-items: center;
  transition: background-color .2s;
}
.vnav button:hover { background: rgba(255, 255, 255, .16); }
.vnav button:focus-visible { outline-color: #fff; outline-offset: 2px; border-radius: 50%; }
.vdemo:not(.is-ready) .vnav button { visibility: hidden; }
.vpos { min-width: 4.4em; text-align: center; font: 500 .8rem/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--code-dim); }
.vstack { position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #0a0b1c; }
/* 换一张时，先用总览图里那一格垫着，大图到了再淡入 */
.vstack::before {
  content: ""; position: absolute; inset: 0;
  background: var(--ph, none) no-repeat; background-size: 800% 600%; background-position: var(--ph-x, 0) var(--ph-y, 0);
  filter: blur(3px); transform: scale(1.04);
}
.vstack img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .35s ease; }
.vstack img.is-on { opacity: 1; }
.vdemo-stage figcaption { min-height: 3.5em; margin-top: 14px; font: 400 .84rem/1.75 var(--sans); color: var(--code-ink); }
.vdemo-stage figcaption span { display: none; }
.vdemo-stage figcaption span.is-on { display: inline; }
.vside { min-width: 0; display: grid; gap: 22px; align-content: start; }
.verdict { display: grid; gap: 12px; }
.verdict-k { font: 600 .7rem/1 var(--sans); letter-spacing: .14em; color: var(--code-dim); }
.verdict-v { display: flex; gap: 12px; align-items: flex-start; }
.fail {
  flex: none; font: 600 .76rem/1 var(--sans); letter-spacing: .06em; margin-top: 3px;
  color: #ffb3bd; background: rgba(255, 97, 120, .2); padding: 5px 8px; border-radius: 6px;
}
.verdict-sum { font: 500 1rem/1.6 var(--sans); color: #fff; }
.vsheet[hidden] { display: none; }
.vsheet { padding-top: 20px; border-top: 1px solid var(--code-line); }
.vsheet-head { display: grid; gap: 8px; margin-bottom: 14px; }
.vsheet-k { font: 600 .7rem/1.5 var(--sans); letter-spacing: .14em; color: var(--code-dim); }
.vsheet-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font: 400 .78rem/1.5 var(--sans); color: var(--code-ink); }
.lg { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.lg::before { content: ""; flex: none; width: 16px; height: 3px; border-radius: 2px; }
.lg-d::before { background: #ff5d86; }
.lg-m::before { background: #4ed79c; }
.vgrid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.vgrid li { min-width: 0; }
.vthumb {
  display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; border-radius: 4px;
  position: relative; overflow: hidden; cursor: pointer;
  background-color: #2a2d55; background-repeat: no-repeat; background-size: 800% 600%;
  transition: transform .25s;
}
.vgrid.is-live .vthumb { background-image: url("/projects/verdandi/assets/verify/sheet.avif"); }
.vthumb::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: #ff5d86; }
.vthumb.is-m::after { background: #4ed79c; }
.vthumb:hover { transform: translateY(-2px); }
.vthumb[aria-current="true"] { outline: 2px solid #fff; outline-offset: 2px; }
.vthumb:focus-visible { outline: 2px solid #b9b0ff; outline-offset: 2px; border-radius: 4px; box-shadow: 0 0 0 6px rgba(125, 107, 255, .3); }
.vsheet-hint { margin-top: 14px; font: 400 .78rem/1.7 var(--sans); color: var(--code-dim); }
.vfoot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--code-line); }
.vdemo-stage + .vfoot { margin-top: auto; }
.vleft > .vdemo-stage { margin-bottom: 20px; }
.vfoot code { font: 400 .74rem/1.5 var(--mono); color: #f5b94a; }
/* verify 卡片下面紧贴的两段字 */
.ch .wrap .verify-grp > .notes { margin-top: 40px; align-items: start; }

/* ---------- 第三章：六步 ---------- */
.loop-card { padding: clamp(28px, 3vw, 44px); }
.how > h3 { margin-bottom: 30px; font-size: 1.24rem; max-width: 40em; }
.how-stage { display: grid; grid-template-columns: minmax(0, 19em) minmax(0, 1fr); gap: clamp(24px, 3vw, 48px); align-items: start; }
.how-svg { display: block; width: 100%; height: auto; overflow: visible; }
.how-svg .edges path {
  stroke: #9aa0c6; stroke-width: 1.6; marker-end: url(#arrow);
  transition: opacity .35s, stroke .35s;
}
.how-svg .elabels text {
  font: 500 13px var(--sans); fill: var(--ink-2); text-anchor: middle;
  paint-order: stroke; stroke: #fff; stroke-width: 6px; stroke-linejoin: round;
  transition: opacity .35s;
}
.how-svg .elabels text.l { text-anchor: start; }
.how-svg .nodes rect { fill: var(--bg); stroke: rgba(34, 37, 77, .16); stroke-width: 1.2; transition: opacity .35s, stroke .35s, fill .35s; }
.how-svg .nodes text { text-anchor: middle; transition: opacity .35s; }
.how-svg .nodes .t { font: 600 19px var(--serif); fill: var(--ink); letter-spacing: .04em; }
.how-svg .nodes .s { font: 400 14px var(--sans); fill: var(--ink-2); }
.how-svg .nodes g { transition: opacity .35s; }
.how.has-step .nodes g:not(.on) { opacity: .32; }
.how.has-step .edges path:not(.on) { opacity: .2; }
.how.has-step .elabels text:not(.on) { opacity: 0; }
.how-svg .edges path.on { stroke: var(--accent); stroke-width: 2.2; }
.how-svg .nodes g.on rect { stroke: var(--accent); stroke-width: 1.8; fill: #fff; }
.how-svg .elabels text.on { fill: var(--accent); font-weight: 600; }
.how-steps { counter-reset: step; order: -1; }
.how-steps li { border-radius: 14px; transition: background-color .2s; }
.how-steps li.on { background: var(--tint); }
.how-steps button {
  counter-increment: step; width: 100%;
  display: flex; align-items: center; gap: 12px;
  text-align: left; border: 0; background: none; cursor: pointer;
  padding: 9px 12px; border-radius: 12px;
  font: 600 1rem/1.3 var(--serif); letter-spacing: .04em; color: var(--ink-2);
  transition: color .2s;
}
.how-steps button::before {
  content: counter(step); flex: none;
  width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font: 600 .74rem/1 var(--sans); border: 1px solid var(--line); color: var(--ink-2); background: #fff;
}
.how-steps button:hover, .how-steps li.on button { color: var(--ink); }
.how-steps li.on button::before { background: var(--ink); color: #fff; border-color: var(--ink); }
.how-steps p { display: none; font: 400 .9rem/1.85 var(--sans); color: var(--ink); padding: 0 14px 14px 48px; }
.how-steps li.on p { display: block; }

/* ---------- 第四章：357 个地板精灵 ---------- */
.floor-card {
  background: var(--tint); box-shadow: none;
  display: grid; grid-template-columns: 44% 44%; justify-content: space-evenly; align-content: center;
  padding: 40px 0 36px;
}
.floor-f { min-width: 0; }
.floor-a, .floor-b { aspect-ratio: 21 / 17; border-radius: 4px; }
/* 没有脚本时：一张画着格子的底图 */
.floor-a {
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(100% / 21 - 1px), var(--tint) calc(100% / 21 - 1px) calc(100% / 21)),
    repeating-linear-gradient(180deg, transparent 0 calc(100% / 17 - 1px), var(--tint) calc(100% / 17 - 1px) calc(100% / 17)),
    #b9a58f;
}
.floor-a.is-tiles { background: none; display: grid; grid-template-columns: repeat(21, minmax(0, 1fr)); grid-template-rows: repeat(17, minmax(0, 1fr)); gap: 1px; }
.floor-a i { display: block; border-radius: 1px; background: #b9a58f; }
.floor-a i.f1 { background: #ad9883; }
.floor-a i.f2 { background: #c4b19b; }
.floor-b {
  border: 2px solid transparent;
  background:
    linear-gradient(90deg, rgba(90, 70, 50, .1) 1px, transparent 1px) 0 0 / calc(100% / 21) calc(100% / 17) padding-box,
    linear-gradient(180deg, rgba(90, 70, 50, .1) 1px, transparent 1px) 0 0 / calc(100% / 21) calc(100% / 17) padding-box,
    linear-gradient(#b9a58f, #b9a58f) padding-box,
    linear-gradient(135deg, var(--b1), var(--b2) 55%, var(--b3)) border-box;
  border-radius: 6px;
}
.floor-l { margin-top: 16px; text-align: center; font: 500 .95rem/1.4 var(--sans); color: var(--ink); }

/* ---------- 第四章：操作指南 ---------- */
.gcard { padding: clamp(22px, 2.4vw, 30px); }
.gdemo { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.5fr); gap: 22px; align-items: stretch; }
.gdemo-k { font: 600 .74rem/1 var(--sans); letter-spacing: .14em; color: var(--ink-2); margin: 4px 0 14px; }
.gtasks [role=tablist] { display: grid; gap: 4px; }
.gtasks button {
  text-align: left; border: 0; background: none; cursor: pointer;
  padding: 10px 12px; border-radius: 10px;
  font: 500 .9rem/1.45 var(--sans); color: var(--ink-2);
  transition: background-color .2s, color .2s;
}
.gtasks button:hover { color: var(--ink); background: var(--bg); }
.gtasks button[aria-selected="true"] { background: var(--tint); color: var(--ink); }
.gpanel {
  background: var(--bg); border-radius: 18px; outline: 1px solid rgba(34, 37, 77, .06);
  padding: 22px;
  display: grid; grid-template-columns: 9.6em minmax(0, 1fr); gap: 20px;
}
.glist { border-right: 1px solid var(--line); padding-right: 12px; }
.glist li {
  font: 400 .76rem/1 var(--sans); color: var(--ink-3); padding: 5px 8px; border-radius: 6px;
  transition: color .2s, background-color .2s;
}
.glist li.on { color: #fff; background: var(--ink); }
.gd { display: none; }
.gd.on { display: block; }
/* 说明下面不再放命令，字放大一点，让这一栏不显得缺一块 */
.gd { padding: 4px 6px 0 4px; }
.gd-name { font: 600 1.3rem/1.3 var(--sans); color: var(--ink); margin-bottom: 16px; }
.gd p:not(.gd-name) { font: 400 1.02rem/1.95 var(--sans); }

/* ---------- 第四章：模板和 Workshop ---------- */
.ch .wrap .start-grp > .ws { margin-top: 24px; }

/* ---------- 示意图：代码和文件原文换成它们变成的东西（第二到第四章的六块） ---------- */
.mk-ok { --c: #1e9e6a; --cb: #e4f6ed; }
.mk-err { --c: #d9415b; --cb: #fdebee; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 9px; border-radius: 999px; background: var(--cb); color: var(--c); font: 600 .8rem/1.2 var(--sans); white-space: nowrap; }
.pill svg { width: 14px; height: 14px; flex: none; }
.ico { width: 18px; height: 18px; flex: none; color: var(--accent); }
/* 示意图的底卡和节点 */
.dg { background: var(--tint); box-shadow: none; padding: 32px; }
.nd { background: #fff; border-radius: 18px; padding: 16px 18px 18px; box-shadow: var(--shadow-soft); min-width: 0; }
.nd-k { display: flex; align-items: center; gap: 8px; font: 600 .98rem/1.4 var(--sans); color: var(--ink); }
.nd-s { margin-top: 2px; font: 400 .78rem/1.5 var(--sans); color: var(--ink-3); }

/* 第二章：两个入口，一个操作库 */
.same-in { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.same-shot { margin-top: 14px; height: 132px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.same-shot img { width: 100%; margin-top: -47%; }
.tools { margin-top: 14px; display: grid; gap: 8px; }
.tools li { padding: 10px 12px; border-radius: 12px; background: var(--tint); }
.tools code { display: block; font: 400 .82rem/1.4 var(--mono); color: var(--ink); }
.tools span { display: block; margin-top: 3px; font: 400 .74rem/1.5 var(--sans); color: var(--ink-2); }
.u { position: relative; margin: 0 calc(25% - 6px); height: 30px; border: 2px solid var(--b2); border-top: 0; border-radius: 0 0 22px 22px; }
.stem { position: relative; width: 2px; height: 26px; margin: 0 auto; background: var(--b2); }
.stem::after { content: ""; position: absolute; left: 50%; bottom: -1px; width: 9px; height: 9px; border: solid var(--b2); border-width: 0 2px 2px 0; transform: translate(-50%, 0) rotate(45deg); }
.stem-in { height: 18px; }
.stem-out { margin-top: 8px; }
.lib { width: max-content; max-width: 100%; margin: 8px auto 0; padding: 11px 26px; border-radius: 999px; background: linear-gradient(90deg, var(--b1), var(--b2) 55%, var(--b3)); color: #fff; font: 600 1rem/1.3 var(--sans); letter-spacing: .04em; text-align: center; box-shadow: 0 14px 30px -14px rgba(93, 96, 255, .7); }
.same-file { width: max-content; max-width: 100%; margin: 8px auto 0; display: flex; align-items: center; gap: 16px; padding: 14px 22px 14px 18px; background: #fff; border-radius: 18px; box-shadow: var(--shadow-soft); }
.docs { position: relative; width: 52px; height: 46px; flex: none; }
.docs svg { position: absolute; top: 0; width: 34px; height: 44px; }
.docs svg:first-child { left: 0; color: #c3c7ee; }
.docs svg:last-child { left: 16px; top: 2px; color: var(--accent); }
.same-file b { display: block; font: 600 .98rem/1.4 var(--sans); }
.same-file span { display: block; font: 400 .8rem/1.5 var(--sans); color: var(--ink-2); }

/* 第二章：六种文本文件拼成一版 */
.ch .wrap > [data-sec="files"] + [data-sec="check"] { margin-top: 40px; }
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; grid-template-rows: 300px 292px; }
.tile { position: relative; overflow: hidden; border-radius: var(--r); background: var(--tint); }
.tile-h { position: absolute; z-index: 3; left: 22px; top: 18px; right: 22px; display: flex; align-items: center; gap: 10px; }
.tile-h b { font: 600 1.06rem/1.3 var(--sans); color: var(--ink); }
.ext { font: 400 .74rem/1 var(--mono); padding: 5px 8px; border-radius: 7px; background: #fff; color: var(--ink-2); box-shadow: 0 1px 2px rgba(34, 37, 77, .08); }
.tile.on-pic .tile-h b { color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, .5); }
.tile.on-pic .ext { background: rgba(255, 255, 255, .92); }
.tile.on-pic::before { content: ""; position: absolute; z-index: 2; inset: 0 0 auto 0; height: 96px; background: linear-gradient(rgba(16, 18, 40, .62), rgba(16, 18, 40, 0)); pointer-events: none; }
.t-scene { grid-column: span 6; container: scene / inline-size; }
.t-prefab { container: pf / inline-size; }
.t-prefab, .t-tree, .t-data { grid-column: span 3; }
.t-ui { grid-column: span 5; }
.t-auto { grid-column: span 4; }
/* 场景：小镇俯视图加几个标记 */
/* 卡片高 300px：图往上提 65px；卡片窄到图不够高时，图的下边贴住卡片的下边 */
.scene-img { position: absolute; left: 0; top: max(-65px, calc(300px - 70.8cqw)); width: 100%; aspect-ratio: 1856 / 1314; }
.scene-img img { width: 100%; height: 100%; }
.pin { position: absolute; z-index: 2; transform: translate(-50%, -50%); width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(125, 107, 255, .55), 0 2px 8px rgba(0, 0, 0, .4); }
.pin span { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); white-space: nowrap; padding: 4px 9px; border-radius: 8px; background: rgba(255, 255, 255, .95); color: var(--ink); font: 500 .74rem/1.3 var(--sans); box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.pin.lft span { left: auto; right: 20px; }
.pin-well { left: 51%; top: 48.4%; }
.pin-bench { left: 42.8%; top: 66.2%; }
.pin-lamp { left: 67.6%; top: 34%; }
.pin-villager { left: 42.7%; top: 57.8%; }
/* 预制体：路灯和它的组件 */
.pf { position: absolute; inset: 58px 20px 0 22px; display: grid; grid-template-columns: 96px 1fr; align-items: end; }
.pf-lamp { position: relative; height: 100%; display: grid; align-items: end; justify-items: center; }
.pf-lamp::before { content: ""; position: absolute; left: 50%; top: 4px; width: 150px; height: 150px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 196, 92, .55), rgba(255, 196, 92, 0)); }
.pf-lamp img { position: relative; width: 56px; height: auto; image-rendering: pixelated; margin-bottom: 14px; }
.pf-list { align-self: center; display: grid; gap: 8px; padding-bottom: 14px; }
.pf-list li { position: relative; padding: 8px 12px; border-radius: 10px; background: #fff; font: 400 .78rem/1.2 var(--mono); color: var(--ink); box-shadow: 0 1px 2px rgba(34, 37, 77, .06); }
.pf-list li::before { content: ""; position: absolute; right: 100%; top: 50%; width: 14px; height: 1.5px; background: #c3c7ee; }
/* 状态树 */
.tree { position: absolute; inset: 52px 12px 8px; }
.tree svg { width: 100%; height: 100%; }
.tree .grp { fill: none; stroke: #c3c7ee; stroke-width: 1.4; stroke-dasharray: 5 5; }
.tree .st rect { fill: #fff; stroke: rgba(34, 37, 77, .14); stroke-width: 1.2; }
.tree .st text { font: 400 13px var(--mono); fill: var(--ink); text-anchor: middle; }
.tree .st.on rect { fill: url(#rib); stroke: none; }
.tree .st.on text { fill: #fff; }
.tree .gl { font: 400 12px var(--mono); fill: var(--ink-3); }
.tree .ar { fill: none; stroke: var(--b2); stroke-width: 1.6; marker-end: url(#ah); }
/* 界面：标题画面压暗一层，框出几个元素 */
/* 画面和框装在一个和卡片一样高的 16 : 9 盒子里、居中：卡片宽窄怎么变，框都压在标志和按钮上 */
.ui-img { position: absolute; top: 0; left: 50%; height: 100%; min-width: 100%; aspect-ratio: 16 / 9; transform: translateX(-50%); }
.ui-img img { width: 100%; height: 100%; object-fit: cover; }
/* 压暗一层，底下再加一段渐暗衬标题；都画在画面盒子里，框和标签在它上面 */
.ui-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(16, 18, 40, 0) calc(100% - 110px), rgba(16, 18, 40, .72)), linear-gradient(rgba(20, 22, 50, .34), rgba(20, 22, 50, .34)); }
.wf { position: absolute; z-index: 2; border: 1.5px solid #fff; border-radius: 6px; box-shadow: 0 0 0 1px rgba(16, 18, 40, .45), inset 0 0 0 1px rgba(16, 18, 40, .3); }
.wf i { position: absolute; left: calc(100% + 7px); top: 50%; transform: translateY(-50%); padding: 3px 6px; border-radius: 5px; background: #fff; color: var(--ink); font: 400 .64rem/1 var(--mono); font-style: normal; white-space: nowrap; }
.wf.in i { left: 7px; top: 7px; transform: none; }
.wf-logo { left: 10.5%; top: 3.5%; width: 80%; height: 28%; }
.wf-begin { left: 40.6%; top: 73%; width: 18.8%; height: 8%; }
.wf-quit { left: 40.6%; top: 82.4%; width: 18.8%; height: 8%; }
.wf-hint { left: 37%; top: 92.3%; width: 26%; height: 5.6%; }
.t-ui.on-pic::before { display: none; }
.t-ui .tile-h { top: auto; bottom: 16px; }
/* 数据表 */
.tb { position: absolute; inset: 58px 20px 20px; background: #fff; border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow-soft); display: grid; align-content: start; gap: 9px; }
.tb-tabs { display: flex; gap: 6px; margin-bottom: 3px; }
.tb-tabs span { padding: 4px 10px; border-radius: 999px; font: 500 .72rem/1.3 var(--sans); color: var(--ink-3); background: var(--tint); }
.tb-tabs span.on { background: var(--ink); color: #fff; }
.tb-r { display: grid; grid-template-columns: 54px 1fr 44px; gap: 10px; align-items: center; height: 22px; }
.tb-r i { height: 18px; border-radius: 6px; background: var(--tint); }
.tb-r b { height: 8px; border-radius: 4px; background: #e3e5f6; }
.tb-r u { height: 8px; border-radius: 4px; background: #eceefa; }
.tb-r:nth-child(2) b { width: 82%; }
.tb-r:nth-child(3) b { width: 64%; }
.tb-r:nth-child(4) b { width: 74%; }
.tb-r:nth-child(5) b { width: 50%; }
.tb-r:nth-child(6) b { width: 70%; }
.tb-r.on { margin: 0 -8px; padding: 0 8px; height: 30px; border-radius: 9px; background: var(--tint); box-shadow: inset 2.5px 0 0 var(--b2); }
.tb-r.on i { background: #fff; }
.tb-r.on b { background: #b9bdf0; }
/* 自动化测试脚本：一串步骤和它截下的画面 */
.au { position: absolute; inset: 58px 22px 22px; display: grid; grid-template-rows: 1fr auto; gap: 18px; }
.au-film { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; align-content: end; }
.au-film img { width: 100%; border-radius: 9px; box-shadow: 0 6px 16px -8px rgba(34, 37, 77, .5); }
.au-steps { position: relative; display: flex; justify-content: space-between; }
.au-steps::before { content: ""; position: absolute; left: 20px; right: 20px; top: 50%; height: 1.5px; background: #c3c7ee; }
.au-steps li { position: relative; padding: 6px 11px; border-radius: 999px; background: #fff; font: 500 .76rem/1.3 var(--sans); color: var(--ink); box-shadow: 0 1px 2px rgba(34, 37, 77, .1); }
.au-steps li.on { background: var(--ink); color: #fff; }

/* 第二章：拼错一个字母 */
.typo { padding: 44px 40px 40px; container: typo / inline-size; }
.typo-w { display: flex; align-items: baseline; justify-content: center; gap: 18px; }
.typo-word { font: 400 min(4.3rem, 10.6cqi)/1.2 var(--mono); letter-spacing: -.02em; color: #fff; }
.typo-word em { font-style: normal; color: #ff7a8f; text-decoration: underline wavy #ff7a8f 3px; text-underline-offset: 14px; }
.skip-x { align-self: center; padding: 6px 12px; border-radius: 999px; border: 1.2px dashed rgba(255, 255, 255, .4); color: rgba(255, 255, 255, .62); font: 400 .8rem/1.3 var(--sans); text-decoration: line-through; white-space: nowrap; }
.typo-fork { position: relative; margin: 30px calc(25% - 6px) 0; height: 28px; border: 2px solid rgba(255, 122, 143, .7); border-bottom: 0; border-radius: 22px 22px 0 0; }
.typo-fork::before { content: ""; position: absolute; left: 50%; bottom: 100%; width: 2px; height: 16px; margin-left: -1px; background: rgba(255, 122, 143, .7); }
.typo-fork span { position: absolute; left: 50%; top: -1px; transform: translate(-50%, -50%); padding: 5px 14px; border-radius: 999px; background: #2a2d5c; color: var(--on-night); font: 500 .8rem/1.3 var(--sans); white-space: nowrap; }
.outs { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.out { padding: 18px 20px 20px; border-radius: 18px; background: rgba(255, 255, 255, .06); }
.out-k { display: flex; align-items: center; gap: 8px; font: 600 .98rem/1.4 var(--sans); color: #fff; }
.out-k code { font: 400 .98rem/1.4 var(--mono); }
.out-s { margin-top: 2px; font: 400 .78rem/1.5 var(--sans); color: var(--code-dim); }
.out .ico { color: #a9b0ff; }
.out-row { margin-top: 14px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, .25); }
.dot-err { width: 18px; height: 18px; flex: none; border-radius: 50%; background: #ff7a8f; color: #15172f; display: grid; place-items: center; font: 700 .7rem/1 var(--sans); }
.bars { flex: 1; display: grid; gap: 6px; }
.bars i { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .2); }
.bars i:last-child { width: 62%; }
.tabs3 { margin-top: 14px; display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 12px; background: rgba(0, 0, 0, .25); font: 500 .8rem/1.3 var(--sans); color: var(--code-dim); }
.tabs3 span { padding: 6px 12px; border-radius: 8px; display: inline-flex; align-items: center; gap: 7px; }
.tabs3 span.on { background: rgba(255, 255, 255, .12); color: #fff; }
.tabs3 .n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ff7a8f; color: #15172f; display: inline-grid; place-items: center; font: 700 .7rem/1 var(--sans); }
.fix { margin-top: 26px; display: flex; align-items: center; justify-content: center; gap: 16px; }
.fix-arrow { width: 44px; height: 2px; background: #62d6a0; position: relative; flex: none; }
.fix-arrow::after { content: ""; position: absolute; right: 0; top: 50%; width: 9px; height: 9px; border: solid #62d6a0; border-width: 2px 2px 0 0; transform: translateY(-50%) rotate(45deg); }
.fix-word { font: 400 2.3rem/1.2 var(--mono); letter-spacing: -.02em; color: #62d6a0; }
.fix-s { font: 400 .82rem/1.5 var(--sans); color: var(--code-dim); }

/* 第二章：按钮和处理函数 */
.wire { padding: 28px 32px 32px; container: wire / inline-size; }
.stages { display: grid; grid-template-columns: minmax(0, 1fr) 132px 184px; gap: 24px; margin-bottom: 10px; }
.stages p { position: relative; padding-bottom: 12px; font: 600 .8rem/1.4 var(--sans); letter-spacing: .08em; color: var(--ink-3); }
.stages p::after { content: ""; position: absolute; left: 0; right: -24px; bottom: 0; height: 2px; background: #d9dcf3; }
.stages p:last-child::after { right: 0; }
.stages p.stop { color: var(--ink); }
.stages p.stop::before { content: ""; position: absolute; left: 0; bottom: -5px; z-index: 1; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--b2); }
.wrow { display: grid; grid-template-columns: minmax(0, 1fr) 132px 184px; gap: 24px; align-items: center; padding: 22px 0; }
.wrow + .wrow { border-top: 1px solid var(--line); }
.wr-write { display: grid; grid-template-columns: 176px minmax(40px, 1fr) 150px; align-items: center; }
.wr-btn { width: 176px; border-radius: 6px; image-rendering: pixelated; box-shadow: 0 8px 18px -10px rgba(34, 37, 77, .6); }
.wr-line { position: relative; height: 2px; margin: 0 6px; background: linear-gradient(90deg, var(--b1), var(--b3)); }
.wr-line::after { content: ""; position: absolute; right: -1px; top: 50%; width: 9px; height: 9px; border: solid var(--b3); border-width: 2px 2px 0 0; transform: translateY(-50%) rotate(45deg); }
.wr-fn { padding: 12px 14px; border-radius: 14px; background: #fff; box-shadow: var(--shadow-soft); }
.wr-fn b { display: block; font: 600 .9rem/1.4 var(--sans); }
.wr-fn span { display: inline-block; margin-top: 4px; padding: 3px 7px; border-radius: 6px; background: var(--tint); font: 400 .72rem/1.2 var(--mono); color: var(--ink-2); }
.wrow.bad .wr-line { background: repeating-linear-gradient(90deg, #e58a9a 0 6px, transparent 6px 12px); }
.wrow.bad .wr-line::after { display: none; }
.wrow.bad .wr-line::before { content: "×"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -52%); width: 22px; height: 22px; border-radius: 50%; background: #d9415b; color: #fff; display: grid; place-items: center; font: 700 .9rem/1 var(--sans); }
.wrow.bad .wr-fn { background: transparent; box-shadow: none; border: 1.5px dashed #c9cce6; }
.wrow.bad .wr-fn b { color: var(--ink-3); font-weight: 500; }
.wr-run { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 9; background: #e8eaf7; }
.wr-run img { width: 100%; height: 100%; object-fit: cover; }
.wr-run.no { display: grid; place-items: center; border: 1.5px dashed #c9cce6; background: transparent; color: var(--ink-3); font: 400 .78rem/1.4 var(--sans); text-align: center; }

/* 第三章：一处改动，标签、前后、撤销 */
.chg { background: #fff; padding: 30px 32px 32px; container: chg / inline-size; }
.chg-label { display: flex; align-items: center; gap: 12px; }
.who { flex: none; padding: 6px 11px; border-radius: 999px; background: var(--ink); color: #fff; font: 600 .76rem/1.3 var(--sans); }
.say { position: relative; padding: 10px 16px; border-radius: 14px; background: var(--tint); font: 500 1rem/1.5 var(--sans); color: var(--ink); }
.say::before { content: ""; position: absolute; left: -5px; top: 50%; width: 12px; height: 12px; background: var(--tint); transform: translateY(-50%) rotate(45deg); border-radius: 2px; }
.say-tag { margin-left: auto; font: 400 .76rem/1 var(--mono); padding: 6px 9px; border-radius: 8px; background: var(--tint); color: var(--ink-2); }
.ba { margin-top: 22px; display: grid; grid-template-columns: 1fr 56px 1fr; align-items: center; }
.ba figure { position: relative; border-radius: 16px; overflow: hidden; }
.ba img { width: 100%; image-rendering: pixelated; }
.ba figcaption { position: absolute; left: 10px; top: 10px; margin: 0; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .92); color: var(--ink); font: 600 .74rem/1.4 var(--sans); }
.ba-mid { display: grid; justify-items: center; gap: 14px; }
.ba-go { width: 30px; height: 2px; background: var(--b2); position: relative; }
.ba-go::after { content: ""; position: absolute; right: 0; top: 50%; width: 8px; height: 8px; border: solid var(--b2); border-width: 2px 2px 0 0; transform: translateY(-50%) rotate(45deg); }
.ba-undo { display: grid; justify-items: center; gap: 3px; color: var(--ink-3); font: 500 .7rem/1.2 var(--sans); }
.ba-undo svg { width: 22px; height: 22px; }
.hrow { margin-top: 22px; padding: 14px 18px; border-radius: 16px; background: var(--tint); display: grid; grid-template-columns: 1fr auto; gap: 6px 24px; align-items: center; }
.hrow small { font: 500 .7rem/1.4 var(--sans); letter-spacing: .06em; color: var(--ink-3); }
.hrow .path { font: 500 .92rem/1.5 var(--sans); color: var(--ink); }
.hrow .path i { font-style: normal; color: var(--ink-3); margin: 0 6px; }
.hrow .val { font: 400 .84rem/1.5 var(--mono); color: var(--ink); white-space: nowrap; }
.hrow .val s { color: var(--ink-3); }
.hrow .val b { font-weight: 400; padding: 3px 7px; border-radius: 6px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--b2); }
.hrow .val i { font-style: normal; color: var(--b2); margin: 0 6px; }

/* 第四章：一个入口，两端各跑一遍 */
.run { background: #fff; padding: 30px 32px; display: grid; grid-template-columns: auto 34px 1fr; align-items: center; }
.run-in { padding: 14px 18px; border-radius: 16px; background: var(--night); color: #fff; }
.run-in small { display: block; font: 500 .7rem/1.4 var(--sans); letter-spacing: .06em; color: var(--on-night-2); }
.run-in code { display: block; margin-top: 4px; font: 400 .9rem/1.4 var(--mono); white-space: nowrap; }
.run-fork { align-self: stretch; margin: 46px 0; border: 2px solid var(--b2); border-right: 0; border-radius: 16px 0 0 16px; margin-left: 16px; position: relative; }
.run-fork::before { content: ""; position: absolute; right: 100%; top: 50%; width: 16px; height: 2px; background: var(--b2); }
.lanes { display: grid; gap: 20px; }
.lane { position: relative; padding: 16px 18px 18px; border-radius: 18px; background: var(--tint); }
.lane h3 { font: 600 1rem/1.4 var(--sans); }
.lane h3 .lane-s { margin-left: 8px; font: 400 .78rem/1.4 var(--sans); color: var(--ink-2); }
.lane ol { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lane li { padding: 7px 12px; border-radius: 999px; background: #fff; font: 500 .8rem/1.3 var(--sans); box-shadow: 0 1px 2px rgba(34, 37, 77, .08); white-space: nowrap; }
.lane li.sep { padding: 0; width: 14px; height: 1.5px; background: #c3c7ee; box-shadow: none; border-radius: 0; flex: none; }
.lane li.done { margin-left: auto; background: #e4f6ed; color: #1e9e6a; box-shadow: none; display: inline-flex; gap: 6px; align-items: center; }
.lane li.done svg { width: 14px; height: 14px; }

/* 示意图在 1101–1440 和平板上：卡片比样稿窄时，按卡片自己的宽度换排法（手机上另有几条） */
[data-sec="tests"] > .pic { container: run / inline-size; }
@container pf (max-width: 255px) {
  .pf { grid-template-columns: 64px minmax(0, 1fr); }
  .pf-lamp img { width: 44px; }
  .pf-lamp::before { width: 110px; height: 110px; }
}
@container typo (max-width: 632px) {
  .tabs3 { font-size: .74rem; }
  .tabs3 span { padding: 6px 9px; }
}
@container typo (max-width: 562px) {
  .typo-fork { width: 2px; height: 50px; margin: 20px auto 12px; border: 0; border-radius: 0; background: rgba(255, 122, 143, .7); }
  .typo-fork::before { display: none; }
  .typo-fork span { top: 50%; }
  .outs { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}
@container wire (max-width: 729px) {
  .wr-write { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .wr-btn { width: min(152px, 100%); }
  .wr-line { width: 2px; height: 28px; margin: 6px 0; background: linear-gradient(var(--b1), var(--b3)); }
  .wr-line::after { left: 50%; right: auto; top: auto; bottom: 0; transform: translateX(-50%) rotate(135deg); }
  .wrow.bad .wr-line { background: repeating-linear-gradient(180deg, #e58a9a 0 6px, transparent 6px 12px); }
  .wr-fn { min-width: min(152px, 100%); text-align: center; }
}
@container chg (max-width: 600px) {
  .hrow { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .hrow .h-path { order: 1; }
  .hrow .path { order: 2; margin-bottom: 8px; }
  .hrow .h-val { order: 3; }
  .hrow .val { order: 4; display: flex; flex-wrap: wrap; align-items: center; row-gap: 6px; white-space: normal; }
  .hrow .val s, .hrow .val b { white-space: nowrap; }
}
/* 一个入口，两端各跑一遍：卡片窄时入口在上，一根竖线分到下面两条线 */
@container run (max-width: 600px) {
  .run { grid-template-columns: minmax(0, 1fr); }
  .run-in { justify-self: start; }
  .run-fork { display: none; }
  .lanes { padding: 18px 0 0 30px; gap: 14px; }
  .lane::before { content: ""; position: absolute; left: -14px; top: -18px; width: 12px; height: calc(50% + 18px); border: solid var(--b2); border-width: 0 0 2px 2px; border-bottom-left-radius: 12px; }
  .lane + .lane::before { top: -14px; height: calc(50% + 14px); }
  .lane:not(:last-child)::after { content: ""; position: absolute; left: -14px; top: 0; bottom: -14px; width: 2px; background: var(--b2); }
  .lane h3 .lane-s { display: block; margin-left: 0; }
}

/* ---------- 尾声：图铺满整个宽度，字从图的下半部分往下排 ---------- */
.epi { padding: 0 0 clamp(80px, 8vw, 120px); text-align: center; overflow: hidden; }
.epi-art { position: relative; height: min(72vh, 56.25vw); }
.epi-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; }
.epi-art::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 55%; background: linear-gradient(rgba(21, 23, 47, 0), rgba(21, 23, 47, .7) 50%, var(--night)); }
.epi .col { position: relative; z-index: 1; width: min(100% - 2 * var(--pad), 42em); margin: calc(-1 * min(17vh, 13vw)) auto 0; }
.epi-k { display: inline-flex; margin-bottom: 22px; font: 600 .8rem/1 var(--sans); letter-spacing: .16em; max-width: none; padding: 9px 16px 9px 14px; border-radius: 999px; background: rgba(21, 23, 47, .78); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.epi-big { font: 600 clamp(1.9rem, 2.8vw, 2.7rem)/1.45 var(--serif); letter-spacing: .02em; color: #fff; text-wrap: balance; text-shadow: 0 2px 24px rgba(10, 11, 30, .8); }
.epi-p { margin-top: 30px; font: 400 1.0625rem/1.95 var(--sans); color: var(--on-night); text-wrap: balance; }

/* ---------- 结尾 ---------- */
.tail { position: relative; height: 170px; overflow: hidden; background: var(--night); }
.tail .home { color: var(--on-night); }
.tail .home-star { fill: var(--on-night); }
.tail-ribbon { position: absolute; inset: 0; width: 100%; height: 100%; }
.home-end { position: absolute; left: 0; top: 0; font-size: .86rem; }

/* ---------- 截图模式 / 减少动效 ---------- */
.shot *, .shot *::before, .shot *::after { animation: none !important; transition: none !important; }
.shot { scroll-behavior: auto; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* 换图、换标签直接换，不淡入；旧图也不等延迟 */
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
}

/* ---------- 窄屏 ---------- */
@media (max-width: 1280px) {
  .hero-art { width: 50vw; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 34%), linear-gradient(180deg, #000 78%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 34%), linear-gradient(180deg, #000 78%, transparent 100%); }
  .hero-art img { object-position: 62% 42%; }
  .hero-text { --col: calc(25 * 1.04rem); }
}
@media (max-width: 1240px) {
  .ltabs button { padding: 7px 12px; font-size: .78rem; }
}
/* 平板：并排的行改成上下排，先字后图 */
@media (max-width: 1100px) {
  .g12 > * { grid-column: 1 / -1; grid-row: auto; }
  .ch-head-split { display: block; }
  .ch-head-split .lede { margin: 28px 0 0; padding: 0; }
  .g12 { row-gap: 32px; }
  .txt.l, .txt.r { padding: 0; }
  .para { max-width: 36em; }
  .ch .wrap .verify-grp > .notes { row-gap: 24px; }
  .vdemo { grid-template-columns: minmax(0, 1fr); }
  /* 上下排时，「没经过人」那一行放回整张卡片的最下面 */
  .vleft { display: contents; }
  .vleft > .vdemo-stage { margin-bottom: 0; }
  .vside { order: 1; }
  .vfoot { order: 2; }
  /* 示意图：六张卡片排成 6 栏，场景、界面通栏，另外四张两两并排 */
  .bento { grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: none; }
  .t-scene, .t-ui { grid-column: span 6; }
  .t-prefab, .t-tree, .t-data, .t-auto { grid-column: span 3; height: 300px; }
  .t-scene { aspect-ratio: 2 / 1; }
  .scene-img { top: -10.4cqw; }
  .t-ui { aspect-ratio: 16 / 9; }
  .hist-zoom { width: 46%; }
  .how-stage { grid-template-columns: minmax(0, 1fr); }
  .how-svg { order: -1; }
  .ltabs { top: 12px; right: 12px; max-width: calc(100% - 24px); overflow-x: auto; scrollbar-width: none; }
}
@media (max-width: 960px) {
  .toc a { padding: 8px 9px; font-size: .74rem; }
  .tagline > span { white-space: normal; }
  .gdemo { grid-template-columns: minmax(0, 1fr); }
}
/* 竖着的平板和手机：浮雕整张放在上面，不让它被裁得只剩头发和飘带；不钉、不淡，四段导语顺着往下排 */
@media (max-width: 760px), (min-width: 761px) and (max-width: 1100px) and (orientation: portrait) {
  .hero { display: block; padding-bottom: clamp(88px, 11vw, 120px); }
  .hero-art {
    position: relative; top: auto; width: 100%; height: auto; margin-top: 72px;
    -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent 100%); mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
  }
  .hero-art img { height: auto; aspect-ratio: 1536 / 1024; }
  .hero-text { margin-top: 16px; --col: calc(34 * 1.04rem); }
  .step, .step:not(.step-first) { min-height: 0; padding: 0; }
  .step-last { margin-bottom: 0; }
  .step + .step { margin-top: 1.3em; }
  .step-p { font-size: 1.04rem; }
  .step-last .ribbon-mark { margin-top: 32px; }
}
@media (max-width: 760px) {
  :root { --r: 18px; }
  body { font-size: 15px; }
  .toc { display: none; }
  .topbar { top: 18px; }
  .hero-art { margin-top: 60px; }
  .hero-text { margin-top: 8px; }
  .hero-mark { display: contents; }
  .app-icon { width: 52px; height: 52px; border-radius: 12px; margin-bottom: 20px; order: 1; }
  .title { font-size: 4.4rem; order: 2; margin-bottom: 14px; }
  .year { font-size: .76rem; order: 3; margin-bottom: 26px; }
  .tagline { order: 4; font-size: 1.36rem; line-height: 1.6; }
  .intro { order: 5; font-size: .98rem; line-height: 1.95; }
  .step-p { font-size: 1rem; line-height: 1.95; }
  .step-last .ribbon-mark { margin-top: 28px; margin-bottom: 22px; }
  .thesis { font-size: 1.26rem; line-height: 1.8; }

  .ch { padding: 72px 0; --grp: 56px; }
  .ch .wrap > .ch-head + * { margin-top: 36px; }
  .ch-head h2, h2 { font-size: 1.85rem; line-height: 1.3; }
  .lede { font-size: 1.1rem; margin-top: 20px; }
  .para { font-size: 1rem; line-height: 1.9; }
  .g12 { row-gap: 24px; }
  /* 入夜：底边的条收窄 */
  .tl-bar { left: 10px; right: 10px; bottom: 10px; gap: 10px; padding: 6px 14px 6px 6px; }
  .tl-btn { width: 32px; height: 32px; }
  .tl-btn svg { width: 13px; height: 13px; }
  .tl-end { font-size: .7rem; }
  .tl-track { height: 28px; }
  .tl-ticks i { width: 3px; height: 3px; top: -1.5px; margin-left: -1.5px; }
  .tl-knob span { width: 14px; height: 14px; margin: -7px 0 0 -7px; box-shadow: 0 0 0 2px #fff, 0 3px 8px rgba(0, 0, 0, .45); }

  /* 光照对比：按钮条放到图的下面 */
  .cmp-card { aspect-ratio: auto; overflow: visible; background: none; box-shadow: none; }
  .cmp { position: relative; inset: auto; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: #0b0b10; }
  .ltabs { position: static; display: flex; margin-top: 12px; max-width: 100%; overflow-x: auto; background: rgba(255, 255, 255, .07); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .ltabs button { flex: none; padding: 7px 12px; font-size: .76rem; }
  .cmp-tag { bottom: 10px; padding: 6px 8px; font-size: .66rem; }
  .cmp-tag-a { left: 10px; }
  .cmp-tag-b { right: 10px; }
  .cmp-grip { width: 34px; height: 34px; }
  .cmp-grip::before { left: 6px; }
  .cmp-grip::after { right: 6px; }

  /* 编辑器：标签横排可滚动，下面放一张放大的面板 */
  .ed-tabs { display: flex; gap: 8px; overflow-x: auto; width: auto; margin: 18px -20px 0; padding: 0 20px 4px; scrollbar-width: none; }
  .ed-tabs::-webkit-scrollbar { display: none; }
  .ed-tab { flex: none; width: min(78vw, 300px); text-align: left; }
  .ed-tab button { padding: 8px 14px; font-size: .82rem; }
  .ed-cap { margin: 10px 0 0; font-size: .8rem; }
  .ed-zoom { display: block; width: min(100%, 320px); margin: 24px auto 0; }
  .ed-win { aspect-ratio: 5 / 3; -webkit-mask-image: none; mask-image: none; }
  .ed-zoom img { border-radius: var(--r); background: #fefefe; padding: 10px; }

  .ex-ctl { padding: 16px; }
  .ex-btns button { padding: 6px 10px; font-size: .74rem; }

  /* 带标注的截图：标签缩小，只留第一行 */
  .arch-tag { padding: 5px 9px; border-radius: 8px; font-size: .68rem; }
  .arch-tag b { font-size: .68rem; }
  .arch-tag span { display: none; }
  .arch-tag::before { display: none; }
  .arch-tag-v { left: calc(18.5% + 6px); top: calc(5% + 18px); }
  .arch-tag-w { right: 8px; top: -12px; }

  /* 示意图：卡片的内边距收小 */
  .dg, .wire, .chg, .run { padding: 20px; }
  .nd { padding: 14px 16px 16px; }

  /* 两个入口上下排：一根竖线从上一个穿到下一个，再带箭头到操作库 */
  .same-in { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .u { display: none; }
  .stem-in { height: 26px; }
  .same-file { padding: 12px 16px 12px 14px; gap: 12px; }

  /* 六张卡片一张一行：场景、界面保持画面的比例，别的给够高度 */
  .bento { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .t-scene, .t-prefab, .t-tree, .t-ui, .t-data, .t-auto { grid-column: auto; }
  .t-scene { aspect-ratio: 1856 / 1314; }
  .scene-img { top: 0; }
  .t-prefab, .t-tree, .t-data { height: 280px; }
  .t-auto { height: 270px; }
  .tile-h { left: 18px; top: 16px; right: 18px; }
  .pf { inset: 54px 18px 0 18px; }
  .tree { inset: 50px 10px 8px; }
  .tb { inset: 54px 16px 16px; }
  .au { inset: 54px 16px 16px; gap: 14px; }
  .pin span { padding: 3px 7px; font-size: .7rem; }
  /* 界面：标题放到画面上面，画面按 16 : 9 整张露出来 */
  .t-ui { display: flex; flex-direction: column; aspect-ratio: auto; }
  .ui-img::after { background: rgba(20, 22, 50, .34); }
  .t-ui .tile-h { order: -1; position: static; padding: 16px 18px 14px; }
  .t-ui.on-pic .tile-h b { color: var(--ink); text-shadow: none; }
  .t-ui.on-pic .ext { background: #fff; }
  .ui-img { position: relative; top: auto; left: auto; height: auto; width: 100%; transform: none; aspect-ratio: 16 / 9; }
  .wf i { padding: 2px 4px; font-size: .56rem; }

  /* 拼错一个字母：大字缩到一行，「悄悄跳过」换到下面（两个出口上下排在上面按卡片宽度换好了） */
  .typo { padding: 30px 20px 24px; }
  .typo-w { flex-direction: column; align-items: center; gap: 12px; }
  .typo-word { font-size: clamp(2rem, 13vw, 4.3rem); }
  .typo-word em { text-underline-offset: 10px; }
  .out { padding: 16px 16px 18px; }
  .fix { flex-wrap: wrap; gap: 4px 12px; margin-top: 22px; }
  .fix-word { font-size: clamp(1.6rem, 9vw, 2.3rem); }
  .fix-s { flex-basis: 100%; text-align: center; }

  /* 按钮和处理函数：表头留一份当图例，每一行是一张小卡片 */
  .stages { display: flex; justify-content: center; align-items: center; gap: 22px; margin-bottom: 14px; }
  .stages p { padding: 4px 11px; border-radius: 999px; background: #fff; font-size: .72rem; letter-spacing: .04em; }
  .stages p::after { left: 100%; right: auto; top: 50%; bottom: auto; width: 14px; margin: -1px 0 0 4px; background: #c3c7ee; }
  .stages p:last-child::after { display: none; }
  .stages p.stop::before { display: none; }
  .stages p.stop { box-shadow: inset 0 0 0 1.5px var(--b2); }
  .wrow { grid-template-columns: auto minmax(0, 1fr); gap: 14px; padding: 16px; border-radius: 16px; background: #fff; box-shadow: var(--shadow-soft); }
  .wrow + .wrow { border-top: 0; margin-top: 12px; }
  .wr-write { grid-column: 1 / -1; }
  .wrow .wr-fn { background: var(--tint); box-shadow: none; }

  /* 一处改动：标签那一行可以折行，前后两张上下排，箭头和「撤销」横过来 */
  .chg-label { flex-wrap: wrap; gap: 10px; }
  .say { order: 3; flex-basis: 100%; font-size: .94rem; }
  .say::before { left: 22px; top: -5px; transform: rotate(45deg); }
  .ba { grid-template-columns: minmax(0, 1fr); margin-top: 18px; }
  .ba-mid { grid-auto-flow: column; justify-content: center; align-items: center; gap: 18px; padding: 12px 0; }
  .ba-go { transform: rotate(90deg); }
  .ba-undo { grid-auto-flow: column; align-items: center; gap: 6px; }
  .hrow { padding: 14px 16px; }

  /* 一个入口，两端各跑一遍：竖排在上面按卡片宽度换好了，这里只把步骤挤一点 */
  .lane { padding: 14px 16px 16px; }
  .lane ol { gap: 8px 6px; }
  .lane li { padding: 7px 10px; }

  /* 历史：整张缩小显示，放大卡片排到下面 */
  .hist-win { aspect-ratio: 5 / 3; }
  .hist-win { -webkit-mask-image: none; mask-image: none; }
  .hist-zoom { position: static; width: auto; margin-top: 16px; }

  .vdemo { padding: 18px 16px 20px; gap: 24px; }
  .vgrid { gap: 3px; }
  .vtabs { flex: 1 1 100%; }
  .vtabs button { flex: 1 1 auto; padding: 7px 8px; }
  .vdemo-stage figcaption { min-height: 0; }

  .loop-card { padding: 22px 18px; }
  .how > h3 { font-size: 1.12rem; }
  .how-svg { display: none; }
  .how-steps li, .how-steps li.on { padding: 14px 0; border-top: 1px solid var(--line); border-radius: 0; background: none; }
  .how-steps button { padding: 0; pointer-events: none; color: var(--ink); }
  .how-steps li.on button::before { background: #fff; color: var(--ink-2); border-color: var(--line); }
  .how-steps p { display: block; padding: 8px 0 0; font-size: .94rem; }

  .floor-card { padding: 24px 0 22px; }
  .floor-l { font-size: .8rem; margin-top: 10px; }

  .gcard { padding: 18px; }
  .gpanel { grid-template-columns: minmax(0, 1fr); padding: 18px; }
  .glist { display: flex; flex-wrap: wrap; gap: 4px; border-right: 0; padding-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
  .glist li { font-size: .74rem; padding: 4px 7px; }
  .gtasks [role=tablist] { grid-template-columns: minmax(0, 1fr); }

  .epi-art { height: 62vw; }
  .epi .col { margin-top: -14vw; }
  .epi-big { font-size: 1.5rem; }
  .epi-p { text-align: left; font-size: 1rem; }
  .tail { height: 180px; }
}

/* 正文的换行：尽量不让最后一行只剩一个字（tools/check-typo.mjs 会量）。已经指定了 balance 的标题不受影响 */
p, li, figcaption, dd, dt, blockquote, td, th { text-wrap: pretty; }
h3, h4 { text-wrap: balance; }

/* ---------- 各语言的排版（en/、ja/ 两份网页用；中文页不受影响） ---------- */
/* 日文：日文字体排在中文字体前面，自托管的 Noto Serif SC 和 PingFang SC 不用来显示日文 */
:root:lang(ja) {
  --sans: "Inter", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  --display: "Cormorant Garamond", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
}
/* 英文：自托管的 Noto Serif SC 里弯引号、省略号是全角的，衬线标题里这几个符号改用系统的西文衬线字 */
@font-face { font-family: "Verdandi Latin Punct"; src: local("Georgia"), local("Times New Roman"), local("Noto Serif"); unicode-range: U+2013-2014, U+2018-201D, U+2026; }
:root:lang(en) { --serif: "Verdandi Latin Punct", "Noto Serif SC", "Songti SC", serif; }
/* 英文：去掉给中文加的字距 */
:root:lang(en) .tagline, :root:lang(en) .ch-head h2, :root:lang(en) h3, :root:lang(en) .thesis, :root:lang(en) .epi-big,
:root:lang(en) .how-steps button, :root:lang(en) .how-svg .nodes .t { letter-spacing: 0; }
:root:lang(en) .eyebrow { letter-spacing: .08em; }
:root:lang(en) .gdemo-k, :root:lang(en) .verdict-k, :root:lang(en) .vsheet-k { letter-spacing: .06em; }
:root:lang(en) .cmp-tag { letter-spacing: .04em; }
:root:lang(en) .year, :root:lang(en) .toc a, :root:lang(en) .tl-end { letter-spacing: .02em; }

/* 首屏的定位句：仍是两行，在给定的地方断；句子比中文长，字号按左边那一栏的宽度定，第二行不碰浮雕 */
:root:lang(en) .tagline { font-size: clamp(1.15rem, 1.36vw, 1.36rem); line-height: 1.55; }
:root:lang(ja) .tagline { font-size: clamp(1.15rem, 1.45vw, 1.42rem); letter-spacing: 0; font-feature-settings: "palt"; }

/* 章标题：英文、日文句子长，字号收一点，栏放宽 */
:root:lang(en) .ch-head h2 { max-width: 20em; }
:root:lang(en) .ch-head h2 { font-size: clamp(2rem, 3.4vw, 3.1rem); line-height: 1.16; }
:root:lang(ja) .ch-head h2 { font-size: clamp(2rem, 3.6vw, 3.3rem); line-height: 1.3; letter-spacing: .01em; }
:root:lang(ja) h2, :root:lang(ja) h3, :root:lang(ja) .tagline, :root:lang(ja) .thesis, :root:lang(ja) .epi-big { word-break: auto-phrase; }
:root:lang(ja) .gtasks button, :root:lang(ja) .verdict-sum, :root:lang(ja) .ed-cap { word-break: auto-phrase; }
/* 日文：行首不放小假名和长音符 */
:root:lang(ja) { line-break: strict; }

/* 首屏导语这一栏：英文一行太短，栏放宽一点（仍在浮雕渐隐的那一段以内）；连字符的词不拆开。日文大字顺着排满，不按词组留短行 */
@media (min-width: 1281px) { :root:lang(en) .hero-text { --col: calc(30 * 1.04rem); } }
@media (min-width: 1101px) and (max-width: 1280px) { :root:lang(en) .hero-text { --col: calc(28 * 1.04rem); } }
@media (min-width: 761px) and (max-width: 1100px) and (orientation: landscape) { :root:lang(en) .hero-text { --col: calc(27 * 1.04rem); } }
:root:lang(en) .thesis .ph { white-space: nowrap; }
:root:lang(ja) .hero .thesis { word-break: normal; }
/* 英文的正文：一行六十来个字符 */
:root:lang(en) .para { max-width: 34em; line-height: 1.75; }
:root:lang(en) .epi .col { width: min(100% - 2 * var(--pad), 37em); }
:root:lang(en) .how > h3 { font-size: 1.08rem; max-width: 44em; }
/* 示意图：英文、日文的小字比中文长，放不下的地方只在这里调 */
:root:lang(en) .tools span { text-wrap: balance; }
:root:lang(ja) .tools span { word-break: auto-phrase; text-wrap: balance; }
/* 日文的「コンパイルエラー」比中间那一栏宽：电脑和平板上这一栏放宽一点（手机上不是表格，不用） */
@media (min-width: 761px) {
  :root:lang(ja) .stages, :root:lang(ja) .wrow { grid-template-columns: minmax(0, 1fr) 148px 184px; }
}

/* 开场的大字和尾声的大字：英文用标题那套西文衬线（Cormorant Garamond），字号按拉丁字母放大 */
:root:lang(en) .thesis { font: 500 1.78rem/1.55 var(--display); }
:root:lang(en) .epi-big { font: 600 clamp(2.2rem, 3vw, 2.9rem)/1.3 var(--display); }

/* 竖着的平板：浮雕在上面，定位句可以放大 */
@media (min-width: 761px) and (max-width: 1100px) and (orientation: portrait) {
  :root:lang(en) .tagline, :root:lang(ja) .tagline { font-size: 1.4rem; }
}
@media (max-width: 760px) {
  :root:lang(en) .tagline { font-size: 1.3rem; }
  :root:lang(en) .tagline > span { text-wrap: balance; }
  :root:lang(ja) .tagline { font-size: 1.3rem; }
  :root:lang(en) .ch-head h2 { font-size: 1.6rem; }
  :root:lang(ja) .ch-head h2 { font-size: 1.6rem; }
  :root:lang(en) .thesis { font-size: 1.5rem; }
  :root:lang(en) .epi-big { font-size: 1.9rem; }
}
