/* 产品自有的三款字体走稳定路径，不带构建 hash：手写体承担画布上的
   标注层，等宽体只出现在真实测量数据里，Assistant 补西文正文。
   中文没有对应的自托管字形，交给系统栈，与手写标注形成两层语气。 */
@font-face {
  font-family: "Virgil";
  src: url("/Virgil.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Cascadia";
  src: url("/Cascadia.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Assistant";
  src: url("/Assistant-Regular.woff2") format("woff2");
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fbfbfa;
  --ink: #242424;
  --ink-soft: #5c5c58;
  /* 纸底上要过 4.5:1：#85857f 只有 3.6:1，画框标签和脚注读起来发虚 */
  --ink-faint: #6f6f6a;
  --rule: #e4e4df;
  --dot: #d8d8d2;
  --sunk: #f3f3f0;
  --brand: #625cc7;
  --sel: #625cc7;
  --red: #c92a2a;
  --blue: #1864ab;
  --green: #2b8a3e;
  --amber: #b45309;
  --shadow-card: 0 1px 2px rgb(36 36 36 / 6%), 0 10px 28px -14px rgb(36 36 36 / 22%);
  --shadow-lift: 0 2px 4px rgb(36 36 36 / 7%), 0 18px 44px -20px rgb(36 36 36 / 26%);
  --sans: "Assistant", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --hand: "Virgil", "Assistant", ui-sans-serif, sans-serif;
  --mono: "Cascadia", ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #121212;
    --ink: #e6e6e3;
    --ink-soft: #a8a8a2;
    --ink-faint: #86867f;
    --rule: #2b2b2b;
    --dot: #333331;
    --sunk: #1a1a1a;
    --brand: #9a94ee;
    --sel: #8b85e8;
    --red: #ff8787;
    --blue: #74c0fc;
    --green: #8ce99a;
    --amber: #ffd43b;
    --shadow-card: 0 1px 2px rgb(0 0 0 / 40%), 0 10px 28px -14px rgb(0 0 0 / 60%);
    --shadow-lift: 0 2px 4px rgb(0 0 0 / 45%), 0 18px 44px -20px rgb(0 0 0 / 70%);
  }
}

* { box-sizing: border-box; }

html {
  /* 页面本身就是画布：点阵是产品里那张纸，不是装饰纹理 */
  background-color: var(--paper);
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: -1px -1px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
}

.wrap {
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto;
}

a { color: inherit; }

/* 只描边，不动圆角：写死 border-radius 会在聚焦瞬间把按钮的 11px 拍平 */
:focus-visible {
  outline: 2px solid var(--sel);
  outline-offset: 3px;
}

/* ---------- 顶栏 ---------- */

.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 0 0;
}

.mark {
  font-family: var(--hand);
  font-size: 20px;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.top-nav {
  display: flex;
  align-items: baseline;
  gap: 22px;
}

.top-link {
  color: var(--ink-soft);
  font-size: 14px;
  text-decoration: none;
  text-underline-offset: 4px;
  transition: color 140ms ease-out;
}

.top-link:hover { color: var(--ink); text-decoration: underline; }

/* ---------- 首屏 ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 56px;
  padding: 96px 0 104px;
}

h1 {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(40px, 6vw, 68px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

/* ch 是按西文字宽算的，同一个数值在中英两版上给出的行宽差一倍。h2 横跨
   整个内容区，需要各自限宽；h1 落在首屏左半栏里，宽度已由栏宽决定。 */
[lang="en"] h2 { max-width: 26ch; }

.lede {
  max-width: 44ch;
  margin: 24px 0 0;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1.7;
  text-wrap: pretty;
}

/* 五步链：一件事从草稿走到交付，箭头是画布上的那种手绘箭头 */
.hero-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 0;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.hero-steps li {
  display: flex;
  align-items: center;
  opacity: 0;
  animation: sel-in 300ms ease forwards;
}

/* 链条随右侧画布落纸的节奏逐步点亮 */
.hero-steps li:nth-child(1) { animation-delay: 150ms; }
.hero-steps li:nth-child(2) { animation-delay: 330ms; }
.hero-steps li:nth-child(3) { animation-delay: 510ms; }
.hero-steps li:nth-child(4) { animation-delay: 690ms; }
.hero-steps li:nth-child(5) { animation-delay: 870ms; }

/* 前四件事是并列关系，用手绘加号相接；只有「出方案」是结果，
   箭头只出现在它前面 */
.hero-steps li + li::before {
  content: "";
  width: 13px;
  height: 13px;
  margin: 0 10px;
  background-color: var(--ink-faint);
  -webkit-mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" fill="none" stroke="black" stroke-width="1.6" stroke-linecap="round"><path d="M7.2 1.8c-.3 3.4-.3 6.9 0 10.4"/><path d="M1.8 7.1c3.5-.3 7-.3 10.4 0"/></svg>') center / contain no-repeat;
  mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" fill="none" stroke="black" stroke-width="1.6" stroke-linecap="round"><path d="M7.2 1.8c-.3 3.4-.3 6.9 0 10.4"/><path d="M1.8 7.1c3.5-.3 7-.3 10.4 0"/></svg>') center / contain no-repeat;
}

.hero-steps li:last-child::before {
  width: 26px;
  height: 12px;
  margin: 0 9px;
  -webkit-mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 12" fill="none" stroke="black" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M1.5 7c8-1.6 15.5-1.7 22.5-1"/><path d="M18.5 2.5c2.3 1.2 4.3 2.4 6 3.6-2 1-4 2.1-5.8 3.4"/></svg>') center / contain no-repeat;
  mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 12" fill="none" stroke="black" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M1.5 7c8-1.6 15.5-1.7 22.5-1"/><path d="M18.5 2.5c2.3 1.2 4.3 2.4 6 3.6-2 1-4 2.1-5.8 3.4"/></svg>') center / contain no-repeat;
}

/* 链上最后一步落在品牌色上：交付是终点 */
.hero-steps li:last-child { color: var(--brand); }

.lede-tight { margin-top: 14px; font-size: 16px; }

/* 收尾处的缩微版步骤链：与开头呼应，静态呈现 */
.steps-mini {
  justify-content: center;
  margin-top: 18px;
  color: var(--ink-soft);
  font-size: 14.5px;
}

.steps-mini li {
  opacity: 1;
  animation: none;
}

.steps-mini li + li::before { width: 22px; margin: 0 7px; }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 36px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 22px;
  border: 0;
  border-radius: 11px;
  background: var(--brand);
  box-shadow: var(--shadow-card);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 140ms cubic-bezier(0.2, 0, 0, 1),
    box-shadow 140ms cubic-bezier(0.2, 0, 0, 1);
}

@media (prefers-color-scheme: dark) {
  .btn { color: #16151f; }
}

.btn:hover { box-shadow: var(--shadow-lift); }
.btn:active { transform: scale(0.96); }

.btn svg { flex: none; }

.btn-quiet {
  padding: 13px 4px;
  color: var(--ink-soft);
  font-size: 15px;
  text-decoration: none;
  text-underline-offset: 5px;
  transition: color 140ms ease-out;
}

.btn-quiet:hover { color: var(--ink); text-decoration: underline; }

/* 数据本地是主卖点：盾形图标 + 正文级墨色，比按钮下的其他小字重一档 */
.hero-safe {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 18px 0 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.hero-safe svg { flex: none; align-self: center; }

/* 开箱即用不做成章节，做成按钮旁边的一句实话 */
.hero-note {
  margin: 8px 0 0;
  color: var(--ink-faint);
  font-size: 13.5px;
}

/* ---------- 首屏画布：本页唯一一处编排动画 ---------- */

/* 画布上的元素是对齐摆放的，不是随手扔的：两列等宽，列内间距一致，
   每块的图形区等高，所有卡片共用一套内边距。 */
.stage {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 16px;
}

/* 7px 的列内边距是留给选中框的：框从卡片外扩 7px，正好落在这条边距上，
   两列的卡片与选中框因此共用同一条边界。 */
.stage-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding: 0 7px;
}

.piece {
  position: relative;
  padding: 14px;
  border-radius: 10px;
  background: var(--paper);
  box-shadow: var(--shadow-card);
  opacity: 0;
  animation: piece-in 480ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.piece figure {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 116px;
  margin: 0;
  color: var(--ink-faint);
}

.piece-label {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.piece-code .piece-label { color: #8087a2; font-family: var(--sans); }

.piece figure svg {
  display: block;
  width: 100%;
  /* 卡片摊宽时图形不跟着拉大，居中留白比一张横贯全卡的示意图更像画布 */
  max-width: 300px;
  height: auto;
  max-height: 100%;
}

@keyframes piece-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.piece-flow { animation-delay: 40ms; }

.piece-code {
  /* 选中框外扩 7px，正好落在 16px 的列间距里，不会压到相邻元素 */
  padding: 13px 15px;
  background: #1e1e2e;
  animation-delay: 120ms;
  color: #cdd6f4;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
}

.piece-code b { color: #cba6f7; font-weight: 400; }
.piece-code i { color: #a6e3a1; font-style: normal; }
.piece-code u { color: #8087a2; text-decoration: none; }

.piece-wire { animation-delay: 200ms; }

.piece-mind { animation-delay: 280ms; }

.piece-doc { animation-delay: 340ms; }

.piece-photo { animation-delay: 400ms; }

/* 文档卡片没有示意图，用行组占位。行数按右列配平算出来：右列比左列少
   一块卡片时，这里就是吸收差额的地方，行少了下面会空出一大片。 */
.piece-doc figure {
  display: flex;
  flex-direction: column;
  gap: 9px;
  height: auto;
  min-height: 94px;
  padding: 6px 0 2px;
}

/* 代码块和它的批注贴住列底，右列多出来的高度留成画布空隙——空白落在
   元素之间比塞进某张卡片里更像画布，两列底边也仍然齐平。 */
.stage-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
}

.doc-name {
  display: block;
  margin-bottom: 7px;
  overflow: hidden;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 10px;
  white-space: nowrap;
}

.doc-line {
  height: 4px;
  border-radius: 2px;
  background: var(--rule);
}

/* 框选一幕：marquee 扫过 → 每块元素亮起同一套细选中框 → 收成一个带
   手柄的群组框。产品里多选就是这个样子：个体细框、群组带手柄。
   选中框是直角的，不跟随卡片圆角。 */
.marquee {
  position: absolute;
  inset: -7px;
  border: 1px solid var(--sel);
  background: color-mix(in srgb, var(--sel) 7%, transparent);
  transform-origin: top left;
  opacity: 0;
  pointer-events: none;
  animation: marquee-in 420ms cubic-bezier(0.3, 0, 0.2, 1) 640ms forwards,
    marquee-out 280ms ease-out 1150ms forwards;
}

@keyframes marquee-in {
  from { opacity: 0; transform: scale(0.06); }
  12% { opacity: 1; }
  to { opacity: 1; transform: scale(1); }
}

@keyframes marquee-out {
  to { opacity: 0; }
}

.ring {
  position: absolute;
  inset: -4px;
  border: 1px solid var(--sel);
  opacity: 0;
  pointer-events: none;
  animation: sel-in 260ms cubic-bezier(0.16, 1, 0.3, 1) forwards,
    sel-out 300ms ease 1750ms forwards;
}

/* 亮起顺序跟着 marquee 从左上往右下扫；1.75s 一起松开选中 */
.piece-flow .ring { animation-delay: 800ms, 1750ms; }
.piece-doc .ring { animation-delay: 840ms, 1750ms; }
.piece-wire .ring { animation-delay: 890ms, 1750ms; }
.piece-photo .ring { animation-delay: 940ms, 1750ms; }
.piece-mind .ring { animation-delay: 990ms, 1750ms; }
.piece-code .ring { animation-delay: 1040ms, 1750ms; }

.group-box {
  position: absolute;
  inset: -7px;
  border: 1px solid var(--sel);
  opacity: 0;
  pointer-events: none;
  animation: sel-in 360ms cubic-bezier(0.16, 1, 0.3, 1) 1150ms forwards,
    sel-out 300ms ease 1750ms forwards;
}

@keyframes sel-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sel-out {
  to { opacity: 0; }
}

/* 连线一拍：一支手画的箭头从流程图跨到文档，元素之间本来就能连 */
.link-arrow {
  position: absolute;
  top: 78px;
  left: calc(50% - 36px);
  width: 72px;
  height: 24px;
  color: var(--ink-faint);
  pointer-events: none;
}

.link-arrow .la-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: link-draw 420ms ease-out 1900ms forwards;
}

.link-arrow .la-head {
  opacity: 0;
  animation: sel-in 200ms ease-out 2280ms forwards;
}

@keyframes link-draw {
  to { stroke-dashoffset: 0; }
}

/* 对齐一拍：线框卡进场时略歪，吸附到左列边线，参考线闪一下 */
.drift {
  animation: drift-snap 450ms cubic-bezier(0.2, 0, 0, 1) 2450ms both;
}

@keyframes drift-snap {
  from { transform: translateX(-9px) rotate(-1.2deg); }
  to { transform: none; }
}

.guide {
  position: absolute;
  top: -6px;
  bottom: -6px;
  left: 7px;
  width: 0;
  border-left: 1px dashed var(--sel);
  opacity: 0;
  pointer-events: none;
  animation: guide-flash 650ms ease 2350ms;
}

@keyframes guide-flash {
  0%, 100% { opacity: 0; }
  25%, 75% { opacity: 0.9; }
}

/* 裁剪一拍：裁剪框亮起，框外压暗；只讲裁剪这一件事 */
.ph-shade,
.ph-crop {
  opacity: 0;
  animation: sel-in 320ms ease 2950ms forwards;
}

/* 切片一拍：切割线亮起，左右两半分开 */
.ph-cut {
  opacity: 0;
  animation: sel-in 260ms ease 3550ms forwards;
}

.ph-l { animation: cut-left 380ms cubic-bezier(0.2, 0, 0, 1) 3900ms forwards; }
.ph-r { animation: cut-right 380ms cubic-bezier(0.2, 0, 0, 1) 3900ms forwards; }

@keyframes cut-left {
  to { transform: translateX(-4px); }
}

@keyframes cut-right {
  to { transform: translateX(7px); }
}

/* 换风格一拍：三张画出来的图整体在规整与手绘之间来回切两次，落在手绘。
   照片、文档、代码不跟着变——产品里风格开关本来就只影响画出来的元素。 */
.piece figure { position: relative; }

.piece figure .sketch {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  animation: style-flip-in 1250ms ease 4300ms forwards;
}

.piece figure .neat {
  animation: style-flip-out 1250ms ease 4300ms forwards;
}

@keyframes style-flip-in {
  0% { opacity: 0; }
  8%, 42% { opacity: 1; }
  50%, 84% { opacity: 0; }
  92%, 100% { opacity: 1; }
}

@keyframes style-flip-out {
  0% { opacity: 1; }
  8%, 42% { opacity: 0; }
  50%, 84% { opacity: 1; }
  92%, 100% { opacity: 0; }
}

.handle {
  position: absolute;
  width: 7px;
  height: 7px;
  border: 1px solid var(--sel);
  border-radius: 2px;
  background: var(--paper);
  opacity: 0;
  animation: handle-in 260ms cubic-bezier(0.16, 1, 0.3, 1) forwards,
    sel-out 300ms ease 1750ms forwards;
}

@keyframes handle-in {
  from { opacity: 0; transform: scale(0.25); }
  to { opacity: 1; transform: scale(1); }
}

.handle-nw { top: -4px; left: -4px; animation-delay: 1250ms, 1750ms; }
.handle-n { top: -4px; left: calc(50% - 3.5px); animation-delay: 1275ms, 1750ms; }
.handle-ne { top: -4px; right: -4px; animation-delay: 1300ms, 1750ms; }
.handle-e { top: calc(50% - 3.5px); right: -4px; animation-delay: 1325ms, 1750ms; }
.handle-se { right: -4px; bottom: -4px; animation-delay: 1350ms, 1750ms; }
.handle-s { bottom: -4px; left: calc(50% - 3.5px); animation-delay: 1375ms, 1750ms; }
.handle-sw { bottom: -4px; left: -4px; animation-delay: 1400ms, 1750ms; }
.handle-w { top: calc(50% - 3.5px); left: -4px; animation-delay: 1425ms, 1750ms; }

/* 手写层由线条承担，不由字体承担：Virgil 没有中文字形，中文用它只会
   静默退回系统字体，看着和正文一样。批注的手感改由这根引出线给。 */
/* 批注紧跟在选中框下方，引出线短且指向明确 */
.stage-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  opacity: 0;
  animation: sel-in 420ms cubic-bezier(0.16, 1, 0.3, 1) 5650ms forwards;
}

.stage-note p {
  margin: 0;
  color: var(--ink-faint);
  font-size: 14px;
  line-height: 1.5;
}

.note-hook {
  flex: none;
  margin-top: 2px;
  color: var(--ink-faint);
  opacity: 0.85;
}

/* 重播钮：悬停画布区才浮现，不跟首屏抢戏 */
.stage-wrap { position: relative; }

.replay {
  position: absolute;
  top: -8px;
  right: -8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 9px;
  background: var(--paper);
  box-shadow: var(--shadow-card);
  color: var(--ink-faint);
  cursor: pointer;
  opacity: 0;
  transition: opacity 160ms ease-out, color 160ms ease-out, transform 140ms cubic-bezier(0.2, 0, 0, 1);
}

.stage-wrap:hover .replay,
.replay:focus-visible { opacity: 1; }

.replay:hover { color: var(--ink); }
.replay:active { transform: scale(0.96); }

/* 重播实现：瞬时清空 hero 内所有动画再放开，让它们从 0 重跑 */
.hero.anim-reset .stage *,
.hero.anim-reset .hero-steps li { animation: none !important; }

@media (hover: none) {
  .replay { display: none; }
}

/* ---------- 分节 ---------- */

.band { padding: 76px 0; border-top: 1px solid var(--rule); }

/* 画框标签：产品里每个画框左上角就是这样标名字的。角标是画出来的，
   不靠字体，中文标签才不会退化成一行普通小字。 */
.frame-label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 22px;
  color: var(--ink-faint);
  font-size: 14px;
  letter-spacing: 0.02em;
}

.frame-label svg { flex: none; }

h2 {
  max-width: 20ch;
  margin: 0;
  font-size: clamp(27px, 3.4vw, 38px);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.band-lede {
  max-width: 62ch;
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
  text-wrap: pretty;
}

/* ---------- 画得出：等宽等高的画布区域 ---------- */

.draw-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 44px;
}

.plot {
  display: flex;
  flex-direction: column;
  padding: 22px;
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow-card);
}

.plot h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.plot p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.65;
}

/* 示意图区固定等高、SVG 等比居中，六格的标题才会落在同一条基线上 */
.plot figure {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 92px;
  margin: 0 0 18px;
  color: var(--ink-faint);
}

.plot figure svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 100%;
}

/* 思维导图卡的悬停演示：拖一个节点，整棵树（连同子树）让位重排 */
.plot .mm-move,
.plot .mm-up,
.plot .mm-ring {
  transition: transform 420ms cubic-bezier(0.2, 0, 0, 1), opacity 200ms ease-out;
}

.plot .mm-ring { opacity: 0; }

.plot:hover .mm-move { transform: translateY(70px); }
.plot:hover .mm-up,
.plot:hover .mm-ring { transform: translateY(-70px); }
.plot:hover .mm-ring { opacity: 1; }

/* ---------- 搬得进：源码与画布的左右对照 ---------- */

.swap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  /* 源码和转换结果必须等高：一边 129 一边 148 时，中间那支箭头看起来
     是斜的，读者会以为两边不是同一件事的两种形态。 */
  align-items: stretch;
  gap: 26px;
  margin-top: 44px;
  padding: 26px;
  border-radius: 16px;
  background: var(--sunk);
}

.swap-src {
  margin: 0;
  padding: 18px;
  overflow-x: auto;
  border-radius: 11px;
  background: #1e1e2e;
  color: #cdd6f4;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.85;
}

.swap-src b { color: #cba6f7; font-weight: 400; }
.swap-src i { color: #a6e3a1; font-style: normal; }

.swap-arrow {
  align-self: center;
  color: var(--ink-faint);
}

.swap-out {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px;
  border-radius: 11px;
  background: var(--paper);
  box-shadow: var(--shadow-card);
}

#swap-svg {
  width: 100%;
  max-width: 470px;
  height: auto;
}

.swap-claim {
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
}

.swap-claim strong { color: var(--ink); font-weight: 650; }

/* 转换演示：JS 就位后先归零（swap-armed），进入视口再放一遍
   （is-live）。没有 JS 时两个类都不存在，内容原样可见。 */
.swap-armed .src-line {
  display: inline;
  opacity: 0;
}

.swap.is-live .src-line {
  opacity: 1;
  transition: opacity 240ms ease-out;
  transition-delay: var(--d, 0s);
}

.swap-armed .swap-out .draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.swap.is-live .swap-out .draw {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 480ms ease-out;
  transition-delay: var(--d, 0s);
}

.swap-armed .swap-out .fade { opacity: 0; }

.swap.is-live .swap-out .fade {
  opacity: 1;
  transition: opacity 300ms ease-out;
  transition-delay: var(--d, 0s);
}

#swap-svg text {
  fill: var(--ink-soft);
  stroke: none;
  font-family: var(--sans);
  font-size: 11px;
  text-anchor: middle;
}

#swap-svg .fade-small { font-size: 9.5px; }

/* 可拖节点：选中框和小手柄由 JS 场景启用，语义上它是「已被选中的元素」 */
.ship-node { cursor: grab; }
.ship-node.dragging { cursor: grabbing; }

.ship-sel {
  opacity: 0;
  pointer-events: none;
}

.swap-armed.is-live .ship-sel {
  opacity: 1;
  transition: opacity 320ms ease-out 1.55s;
}

.ship-ring {
  fill: none;
  stroke: var(--sel);
  stroke-width: 1;
}

.mh {
  fill: var(--paper);
  stroke: var(--sel);
  stroke-width: 1;
  rx: 1.5;
}

/* 演示播完后手柄呼吸两下：提示这个节点真的能碰 */
.swap-armed.is-live .mh {
  transform-box: fill-box;
  transform-origin: center;
  animation: mh-pulse 640ms ease 2600ms 2;
}

@keyframes mh-pulse {
  50% { transform: scale(1.35); }
}

.drag-hint {
  display: none;
  width: 100%;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 8px;
  margin: 10px 0 0;
  color: var(--ink-faint);
  font-size: 13.5px;
  line-height: 1.4;
}

.drag-hint span { white-space: nowrap; }

.hint-hook { flex: none; margin-top: -6px; opacity: 0.85; }

.swap-armed .drag-hint { display: flex; opacity: 0; }

.swap-armed.is-live .drag-hint {
  opacity: 1;
  transition: opacity 360ms ease-out 1.75s;
}

/* ---------- 搬得进：按「进来之后变成什么」分组的格式清单 ---------- */

.import-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 34px;
  margin-top: 40px;
}

.import-group {
  padding: 20px 0 4px;
  border-top: 1px solid var(--rule);
}

.import-kind {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 5px 12px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
}

.chips li i {
  margin-left: 6px;
  color: var(--ink-faint);
  font-style: normal;
}

.chips .chip-more {
  border-style: dashed;
  color: var(--ink-faint);
  font-family: var(--sans);
}

.import-note {
  max-width: 34ch;
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.65;
}

/* ---------- 看得清：代码块实样 ---------- */

.read-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 44px;
}

.read-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow-card);
}

/* 两张卡片的展示区各自填满剩余高度，底边才落在同一条线上 */
.read-card .sample,
.read-card .page-strip {
  flex: 1;
}

.read-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.read-card p {
  max-width: 44ch;
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.65;
}

.sample {
  padding: 15px 17px;
  border-radius: 10px;
  background: #1e1e2e;
  color: #cdd6f4;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.8;
  white-space: pre;
  overflow-x: auto;
}

.sample b { color: #cba6f7; font-weight: 400; }
.sample i { color: #a6e3a1; font-style: normal; }
.sample em { color: #89b4fa; font-style: normal; }
.sample u { color: #8087a2; text-decoration: none; }

.page-strip {
  display: flex;
  gap: 9px;
  align-items: flex-end;
}

.page-strip div {
  flex: 1;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: var(--sunk);
}

.page-strip div:nth-child(1) { height: 84px; }
.page-strip div:nth-child(2) { height: 96px; border-color: var(--sel); }
.page-strip div:nth-child(3) { height: 84px; }
.page-strip div:nth-child(4) { height: 72px; }

/* ---------- 改得动：同一张图的多种处理结果 ---------- */

.photo-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  /* 同一行里的卡片本来就等高，跨行才会因文案行数不同而参差；窄屏一列一张，
     每张都自成一行，没有这条就全靠文案长度碰运气。 */
  grid-auto-rows: 1fr;
  gap: 18px;
  margin-top: 44px;
}

.photo {
  /* 图框紧贴卡片内壁，圆角要同心：外 20 = 内 8 + 内边距 12 */
  padding: 12px;
  border-radius: 20px;
  background: var(--paper);
  box-shadow: var(--shadow-card);
}

.photo figure {
  margin: 0 0 12px;
  /* 图像边缘统一压一道极浅的描边，避免浅底上边界发虚 */
  outline: 1px solid rgb(0 0 0 / 10%);
  outline-offset: -1px;
  border-radius: 8px;
  overflow: hidden;
  line-height: 0;
}

@media (prefers-color-scheme: dark) {
  .photo figure { outline-color: rgb(255 255 255 / 10%); }
}

.photo b {
  display: block;
  font-size: 14.5px;
  font-weight: 650;
}

.photo span {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.55;
}

/* ---------- 扛得住：一万个元素的实物 + 真实测量数据 ---------- */

.bench {
  position: relative;
  margin-top: 44px;
}

#bench-canvas {
  display: block;
  width: 100%;
  height: 340px;
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow-card);
  cursor: grab;
  touch-action: none;
}

#bench-canvas.dragging { cursor: grabbing; }

/* 触屏设备放行竖向滚动：单指上下滑走页面，横向拖才动画布 */
@media (pointer: coarse) {
  #bench-canvas { touch-action: pan-y; }
}

.bench-hud {
  position: absolute;
  top: 12px;
  right: 14px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 12px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(6px);
  font-family: var(--mono);
  pointer-events: none;
}

.bench-hud b {
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.bench-hud span {
  color: var(--ink-faint);
  font-size: 11.5px;
}

.bench-hint {
  margin: 12px 0 0;
  color: var(--ink-faint);
  font-size: 13.5px;
}

.measure {
  width: 100%;
  margin-top: 44px;
  border-collapse: collapse;
  text-align: left;
}

.measure caption {
  margin-bottom: 14px;
  color: var(--ink-faint);
  font-size: 13.5px;
  text-align: left;
}

.measure th,
.measure td {
  padding: 16px 18px 16px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: baseline;
}

.measure thead th {
  padding-bottom: 10px;
  color: var(--ink-faint);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.measure tbody th {
  font-size: 15px;
  font-weight: 500;
}

.measure td.num {
  /* 等宽只服务于真实测量值，让不同行的数字能竖着比 */
  color: var(--ink);
  font-family: var(--mono);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.measure td.note {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
}

.footnote {
  max-width: 70ch;
  margin: 22px 0 0;
  color: var(--ink-faint);
  font-size: 13px;
  line-height: 1.7;
}

/* ---------- 横向对照：不打勾，写事实 ---------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.compare-scroll {
  margin-top: 44px;
  overflow-x: auto;
}

.compare {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  text-align: left;
}

.compare caption {
  margin-bottom: 14px;
  color: var(--ink-faint);
  font-size: 13.5px;
  text-align: left;
}

.compare th,
.compare td {
  padding: 15px 22px 15px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
  line-height: 1.6;
  vertical-align: baseline;
}

.compare thead th {
  padding-bottom: 10px;
  color: var(--ink-faint);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.compare thead th.us { color: var(--brand); }

.compare tbody th {
  width: 15%;
  padding-right: 18px;
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
}

.compare td { width: 28.3%; color: var(--ink-soft); }

/* 自家一列只用一道品牌色细边抬起，不整列涂色 */
.compare td.us {
  padding-left: 14px;
  border-left: 2px solid var(--brand);
  color: var(--ink);
}

/* ---------- 收尾 ---------- */

.close {
  padding: 84px 0 96px;
  border-top: 1px solid var(--rule);
  text-align: center;
}

.close h2 {
  max-width: none;
  margin: 0 auto;
}

.close-note {
  margin: 14px 0 0;
  color: var(--ink-faint);
  font-size: 14.5px;
}

.close .actions { justify-content: center; margin-top: 30px; }

footer {
  padding: 26px 0 44px;
  border-top: 1px solid var(--rule);
  color: var(--ink-faint);
  font-size: 13px;
}

.foot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  justify-content: space-between;
}

footer a {
  color: var(--ink-faint);
  text-decoration: none;
  text-underline-offset: 4px;
}

footer a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- 收窄 ---------- */

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 44px; padding: 64px 0 72px; }
  h1 { max-width: 16ch; }
  .draw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .photo-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .import-map { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .import-note { max-width: 62ch; }
  .swap { grid-template-columns: minmax(0, 1fr); }
  .swap-arrow { justify-self: center; transform: rotate(90deg); }
  .read-grid { grid-template-columns: minmax(0, 1fr); }
  #bench-canvas { height: 280px; }
}

/* 画布两列在这个宽度以下各剩不到 300px，示意图会小到看不清结构：并成
   一列，文档预览让位——它在下面的章节里有完整篇幅。 */
@media (max-width: 620px) {
  .stage { grid-template-columns: minmax(0, 1fr); }
  .piece-doc { display: none; }
  /* 单列没有「跨列连线」和「列边对齐」可讲，这两拍收掉 */
  .link-arrow, .guide { display: none; }
  .drift { animation: none; }
}

@media (max-width: 560px) {
  .wrap { width: calc(100% - 34px); }
  .band { padding: 58px 0; }
  .draw-grid, .photo-row { grid-template-columns: minmax(0, 1fr); }
  .measure th, .measure td { padding-right: 12px; }
  .measure td.num { font-size: 16px; }
  .measure thead { display: none; }
  #bench-canvas { height: 240px; }
}

@media (prefers-reduced-motion: reduce) {
  /* 静态终局：元素齐整、箭头已连、流程图停在手绘版，选中过程不演 */
  .piece, .stage-note, .hero-steps li {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .swap-armed.is-live .mh { animation: none; }
  .marquee, .ring, .group-box, .guide, .replay { display: none; }
  .plot .mm-move, .plot .mm-up, .plot .mm-ring { transition: none; }
  .drift { animation: none; }
  .link-arrow .la-line { animation: none; stroke-dashoffset: 0; }
  .link-arrow .la-head { animation: none; opacity: 1; }
  .piece figure .neat { animation: none; opacity: 0; }
  .piece figure .sketch { animation: none; opacity: 1; }
  .ph-shade, .ph-crop, .ph-cut { animation: none; opacity: 1; }
  .ph-l { animation: none; transform: translateX(-4px); }
  .ph-r { animation: none; transform: translateX(7px); }
  .swap .src-line,
  .swap .swap-out .draw,
  .swap .swap-out .fade,
  .swap .ship-sel,
  .swap .drag-hint {
    transition: none;
  }
  .btn { transition: none; }
  .btn:active { transform: none; }
}
