/* Albedo · 三束光：黑底，红绿蓝三束色光，安静克制 */

@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: #070709;
  --bg-2: #0c0c10;
  --ink: #fff;
  --dim: rgba(255, 255, 255, 0.66);
  --faint: rgba(255, 255, 255, 0.46);
  --line: rgba(255, 255, 255, 0.14);
  --line-2: rgba(255, 255, 255, 0.3);

  --r: #ff3b3b;
  --g: #35f06a;
  --b: #3d7bff;

  --paper: #e9e7e2;
  --p-ink: #17171b;
  --p-dim: #55555d;

  --ease: cubic-bezier(0.65, 0, 0.3, 1);
  --t: 0.82s;

  --sans: "Inter", "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
  --serif: "Noto Serif SC", "Songti SC", serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  /* canvas 上的字（albedo.js 读这两个） */
  --cv-sans: Inter, "PingFang SC", sans-serif;
  --cv-serif: "Noto Serif SC", "Songti SC", serif;

  --pad: clamp(20px, 4.4vw, 64px);
  --max: 1280px;

  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
.shot html, html.shot { scroll-behavior: auto; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main, .end { overflow-x: clip; }
p, h1, h2, h3, dl, dd, figure, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 1px solid #fff; outline-offset: 4px; }
canvas:focus-visible { outline-offset: 2px; }

.wrap, .ch, .hero, .end {
  max-width: calc(var(--max) + 2 * var(--pad));
  margin-left: auto; margin-right: auto;
  padding-left: var(--pad); padding-right: var(--pad);
}

/* ———— 页头的两个小东西 ———— */

.bar {
  position: absolute; inset: 0 0 auto 0; z-index: 6;
  max-width: calc(var(--max) + 2 * var(--pad)); margin: 0 auto;
  padding: 26px var(--pad) 0;
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; letter-spacing: 0.14em;
}
.home {
  font-weight: 600; font-size: 12px; letter-spacing: 0.2em;
  text-decoration: none; color: var(--dim);
  transition: color 0.2s;
}
.home:hover { color: #fff; }
.lang { display: flex; gap: 1.1em; color: var(--faint); }
.lang a { text-decoration: none; transition: color 0.2s; }
.lang a:hover { color: #fff; }
.lang [aria-current] { color: #fff; }

/* ———— 跟着滚动的小目录：右边一列点 ———— */

.toc {
  position: fixed; right: 18px; top: 50%; z-index: 5;
  transform: translateY(-50%);
  mix-blend-mode: difference;
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s;
}
.toc.on { opacity: 1; pointer-events: auto; }
.toc ol { display: flex; flex-direction: column; gap: 4px; }
.toc a {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 5px 0;
  font-size: 11.5px; letter-spacing: 0.12em; text-decoration: none;
  color: #fff;
}
.toc a span { opacity: 0; transform: translateX(4px); transition: opacity 0.25s, transform 0.25s; }
.toc a::after {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transition: background-color 0.25s, transform 0.25s;
}
.toc a[aria-current="true"]::after { background: #fff; transform: scale(1.5); }
.toc a[aria-current="true"] span, .toc a:hover span, .toc a:focus-visible span { opacity: 1; transform: none; }
@media (max-width: 1199px) { .toc { display: none; } }
/* 版心右边留的空不够时（1600 宽以下），当前那项的字只在指着或聚焦时显示，免得压到正文和图上 */
@media (max-width: 1599px) {
  .toc a[aria-current="true"]:not(:hover):not(:focus-visible) span { opacity: 0; transform: translateX(4px); }
}
/* 看不见的字也占着地方，会挡住正文右边的按钮：目录本身不接点击，只有右边的点接，点的可点范围放大一圈 */
.toc.on { pointer-events: none; }
.toc.on a::after {
  pointer-events: auto; cursor: pointer;
  padding: 7px; margin: -7px; background-clip: content-box;
}

/* ———— 首屏 ———— */

.hero {
  --H: min(100vh, 56rem);
  position: relative;
  min-height: max(var(--H), 46rem);
  padding-top: 96px; padding-bottom: clamp(56px, 8vh, 84px);
  display: flex; align-items: center;
}
.hero-art {
  --f: 1;
  --aw: calc(var(--H) * 1.5 * var(--f));
  position: absolute; top: 0;
  height: calc(var(--H) * var(--f));
  width: var(--aw);
  left: calc(var(--pad) + (100% - 2 * var(--pad)) * 0.76 - var(--aw) * 0.692);
  mix-blend-mode: lighten;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 12%, #000 86%, transparent 100%);
          mask-image: linear-gradient(to right, transparent 0, #000 12%, #000 86%, transparent 100%);
}
.hero-art img {
  display: block; width: 100%; height: 100%;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 78%, transparent 98%);
          mask-image: linear-gradient(to bottom, #000 0, #000 78%, transparent 98%);
}

.hero-text { position: relative; z-index: 2; width: min(35rem, 46%); }

.kicker {
  display: flex; align-items: baseline; gap: 18px;
  font-size: 12.5px; letter-spacing: 0.2em; color: var(--dim);
  margin-bottom: 14px;
}
.kicker .kind { letter-spacing: 0.16em; color: var(--faint); }

.title {
  position: relative;
  isolation: isolate;
  font-family: "Inter", var(--sans);
  font-weight: 600;
  font-size: clamp(6.5rem, 10.4vw, 10.5rem);
  line-height: 0.9;
  letter-spacing: -0.055em;
  margin: 0 0 0 -0.06em;
  padding-bottom: 0.06em;
  white-space: nowrap;
}
.t { display: block; mix-blend-mode: screen; transition: transform var(--t) var(--ease); }
.t + .t { position: absolute; left: 0; top: 0; }
.t-r { color: var(--r); }
.t-g { color: var(--g); transform: translate(0.026em, -0.018em); }
.t-b { color: var(--b); transform: translate(-0.022em, 0.024em); }
.sync-g .t-g, .sync-b .t-b { transform: none; }

.lede {
  margin-top: clamp(22px, 3.4vh, 34px);
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(1.45rem, 1.9vw, 1.8rem);
  line-height: 1.5; letter-spacing: 0.02em;
}
.intro {
  margin-top: 18px;
  max-width: 30em;
  font-family: var(--serif);
  font-size: clamp(1rem, 1.12vw, 1.08rem);
  line-height: 1.95;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.84);
  text-wrap: pretty;
}
.intro-2 { margin-top: 14px; color: rgba(255, 255, 255, 0.7); }
.hero-links { margin-top: clamp(26px, 4vh, 38px); display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; }

.btn {
  display: inline-flex; align-items: center; gap: 0.6em;
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  font-size: 13.5px; font-weight: 500; letter-spacing: 0.06em;
  text-decoration: none; color: #fff;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.btn span { transition: transform 0.25s var(--ease); }
.btn:hover {
  border-color: #fff;
  box-shadow: -2px 0 0 -1px rgba(255, 59, 59, 0.75), 2px 0 0 -1px rgba(61, 123, 255, 0.85);
}
.btn:hover span { transform: translate(2px, -2px); }
.btn-quiet {
  font-size: 13.5px; letter-spacing: 0.06em; color: var(--dim); text-decoration: none;
  transition: color 0.2s;
}
.btn-quiet:hover { color: #fff; }

/* ———— 章节的公共部分 ———— */

.ch { padding-top: clamp(80px, 9.5vh, 112px); padding-bottom: clamp(64px, 8vh, 92px); position: relative; }
.ch-head { max-width: 46rem; }
.ch-n {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; letter-spacing: 0.2em; color: var(--faint);
  margin-bottom: 18px;
}
.ch-n::before { content: ""; width: 18px; height: 1px; background: currentColor; }
/* 标题按短语换行（逗号、句号后面才断）。只在宽屏这么做：窄了以后一个短语可能比一行还长，那时按普通的规矩断。
   不用 overflow-wrap: anywhere 兜底：短语正好和一行一样宽时，它会让标点单独掉成一行（看点那一排在 2240 宽时出过）。 */
@media (min-width: 1000px) { .ch h2, .lede, .step-h { word-break: keep-all; } }
.ch h2 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(1.9rem, 3vw, 2.75rem);
  line-height: 1.38; letter-spacing: 0.01em;
  text-wrap: balance;
}
.ch-p {
  margin-top: 22px;
  max-width: 40em;
  font-size: 16px; line-height: 1.85; color: var(--dim);
  text-wrap: pretty;
}
.ch-p + .ch-p { margin-top: 14px; }
.ch-head > .ch-p:first-child { margin-top: 0; }

/* 正文里的标识符和加粗 */
main code {
  font-family: var(--mono); font-size: 0.88em; letter-spacing: 0;
  padding: 0 0.12em;
  color: rgba(255, 255, 255, 0.86);
  overflow-wrap: anywhere; /* 带空格的在空格处换行；不带空格的标识符只在一行放不下时才拆 */
}
main strong { font-weight: 600; color: inherit; }
.ch-paper code { color: var(--p-ink); }

/* 滚到了才出现 */
.rv { opacity: 0; transform: translateY(18px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.rv.in { opacity: 1; transform: none; }
.shot .rv { opacity: 1; transform: none; }

/* ———— 1. 同步视角 ———— */

.room {
  margin-top: clamp(48px, 7vh, 72px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 312px);
  grid-template-areas: "stage views" "wire wire";
  column-gap: clamp(32px, 4.4vw, 72px);
}
.stage-wrap { grid-area: stage; position: relative; }
.views { grid-area: views; align-self: center; display: grid; gap: 18px; }
.wire { grid-area: wire; }

.stage {
  display: block; width: 100%; height: auto; aspect-ratio: 900 / 640;
  cursor: grab; touch-action: pan-y;
}
.stage.drag { cursor: grabbing; }
.stage-tip { position: absolute; left: 0; bottom: 0; font-size: 12.5px; color: var(--faint); letter-spacing: 0.02em; }

.view { --c: var(--r); }
.view[data-who="g"] { --c: var(--g); }
.view[data-who="b"] { --c: var(--b); }
.vf {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9;
  border: 1px solid color-mix(in srgb, var(--c) 70%, transparent);
  background: #040405;
  cursor: grab; touch-action: pan-y;
}
.vf.drag { cursor: grabbing; }
.ctl {
  display: flex; align-items: center; gap: 12px;
  min-height: 34px; padding-top: 6px;
  font-size: 12.5px; letter-spacing: 0.04em;
}
.who {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--serif); font-weight: 600; font-size: 13.5px; color: #fff;
}
.who::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.fov { color: var(--faint); }

.sync {
  margin-left: auto;
  appearance: none; border: 0; background: none; padding: 4px 0;
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--dim); letter-spacing: 0.04em; cursor: pointer;
}
.sync:hover { color: #fff; }
.sync em { font-style: normal; font-family: var(--serif); font-weight: 600; color: var(--r); }
.track {
  position: relative; width: 28px; height: 14px;
  border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 7px;
  transition: border-color 0.3s;
}
.knob {
  position: absolute; top: 2px; left: 2px;
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  transition: transform 0.35s var(--ease), background-color 0.3s;
}
.sync[aria-checked="true"] { color: #fff; }
.sync[aria-checked="true"] .track { border-color: var(--c); }
.sync[aria-checked="true"] .knob { transform: translateX(14px); background: var(--c); }

.wire {
  margin-top: 40px; padding-top: 28px;
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 312px);
  column-gap: clamp(32px, 4.4vw, 72px);
}
.mat-cap, .split-h { font-size: 12.5px; letter-spacing: 0.08em; color: var(--faint); margin-bottom: 12px; }
.mat {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 400px;
  border-left: 1px solid var(--r); border-right: 1px solid var(--r);
  padding: 4px 14px;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.85;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.9);
}
.mat span { text-align: right; white-space: nowrap; }
.split li {
  position: relative; padding-left: 16px;
  font-size: 14.5px; line-height: 1.7; color: rgba(255, 255, 255, 0.86);
}
.split li + li { margin-top: 6px; }
.split li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 6px; height: 6px; border-radius: 50%; background: #fff; }


/* ———— 2. 截图：浅色的纸 ———— */

.ch-paper {
  color: var(--p-ink);
  background: var(--paper);
  border-image: linear-gradient(var(--paper), var(--paper)) fill 0 / 0 / 0 100vw;
}
.ch-paper .ch-n { color: var(--p-dim); }
.ch-paper .ch-p { color: var(--p-dim); }
.ch-paper :focus-visible { outline-color: var(--p-ink); }
.paper-pair {
  margin-top: clamp(44px, 6vh, 64px);
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 3.4vw, 52px); align-items: start;
}
.paper-fig img {
  display: block; width: 100%; height: auto; aspect-ratio: 1944 / 1050; object-fit: cover;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 18px 50px -20px rgba(0, 0, 0, 0.35);
}
.paper-fig figcaption { margin-top: 18px; font-size: 14.5px; line-height: 1.8; color: var(--p-dim); }

/* ———— 4. 流程 ———— */

.ch-flow {
  background: var(--bg-2);
  border-image: linear-gradient(var(--bg-2), var(--bg-2)) fill 0 / 0 / 0 100vw;
}

.flow {
  margin-top: clamp(44px, 6vh, 64px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  grid-template-areas: "map panel" "ctl ctl";
  column-gap: clamp(28px, 4vw, 64px);
}
.flow-map { grid-area: map; }
.flow-panel { grid-area: panel; align-self: start; padding-top: 6px; min-height: 30rem; }
.flow-ctl { grid-area: ctl; }

.map { display: block; width: 100%; height: auto; overflow: visible; }
.map text { font-family: var(--sans); }
.map .e { stroke: rgba(255, 255, 255, 0.16); stroke-width: 1; fill: none; transition: stroke 0.4s, opacity 0.4s; }
.map .e.local { stroke-dasharray: 3 5; }
.map .e.on { stroke: rgba(255, 255, 255, 0.75); }
.map .n circle { fill: #0c0c10; stroke: rgba(255, 255, 255, 0.42); stroke-width: 1; transition: stroke 0.4s, fill 0.4s; }
.map .n .lab { fill: rgba(255, 255, 255, 0.56); font-family: var(--serif); font-weight: 600; font-size: 17px; letter-spacing: 0.06em; transition: fill 0.4s; }
.map .n .sub { fill: rgba(255, 255, 255, 0.34); font-size: 13.5px; letter-spacing: 0.04em; transition: fill 0.4s; }
.map .n.on circle { stroke: #fff; fill: #fff; }
.map .n.on .lab { fill: #fff; }
.map .n.on .sub { fill: rgba(255, 255, 255, 0.66); }
.map .n.on.c-r circle { fill: var(--r); stroke: var(--r); }
.map .n.on.c-g circle { fill: var(--g); stroke: var(--g); }
.map .lane { fill: rgba(255, 255, 255, 0.5); font-size: 13px; letter-spacing: 0.12em; }
.map .lane-r { fill: var(--r); } .map .lane-g { fill: var(--g); }
.map .zone { fill: none; stroke: rgba(255, 255, 255, 0.07); stroke-width: 1; }
.map .zone-t { fill: rgba(255, 255, 255, 0.32); font-size: 12.5px; letter-spacing: 0.14em; }
.map .pk { fill: #fff; opacity: 0; transition: opacity 0.4s; }
.map .pk.rest { opacity: 1; }
.map .pk.c-r { fill: var(--r); } .map .pk.c-g { fill: var(--g); }

.step-n { font-family: var(--serif); font-size: 15px; color: var(--faint); letter-spacing: 0.06em; }
.step-n [data-step-i] { font-size: 30px; font-weight: 600; color: #fff; margin-right: 6px; }
.step-h { margin-top: 6px; font-family: var(--serif); font-weight: 600; font-size: 1.45rem; line-height: 1.45; letter-spacing: 0.02em; }
.step-p { margin-top: 12px; font-size: 15px; line-height: 1.8; color: var(--dim); text-wrap: pretty; }
.msgs { margin-top: 22px; display: grid; gap: 14px; }

.m { border-top: 1px solid var(--line); padding-top: 12px; }
.m-dir { display: flex; align-items: center; gap: 8px; font-size: 12.5px; letter-spacing: 0.04em; color: var(--faint); margin-bottom: 8px; }
.m-dir b { font-weight: 500; color: rgba(255, 255, 255, 0.86); }
.m-dir .via { margin-left: auto; font-size: 11.5px; letter-spacing: 0.08em; }
.m-line { display: flex; align-items: stretch; min-height: 34px; font-size: 13px; }
.m-hdr { flex: 0 0 auto; display: flex; border: 1px solid rgba(255, 255, 255, 0.5); }
.m-hdr span { display: flex; align-items: center; padding: 0 9px; color: rgba(255, 255, 255, 0.9); white-space: nowrap; }
.m-hdr span + span { border-left: 1px solid rgba(255, 255, 255, 0.25); color: var(--faint); }
.m-body { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; padding: 6px 10px; border: 1px solid rgba(255, 255, 255, 0.22); border-left: 0; color: rgba(255, 255, 255, 0.86); line-height: 1.55; }
.m-plain .m-body { border-left: 1px solid rgba(255, 255, 255, 0.22); border-style: dashed; }
.m-name { display: block; margin-top: 6px; font-family: var(--mono); font-size: 12px; color: var(--faint); }

.flow-ctl { display: flex; align-items: center; gap: 18px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.nav-btn {
  flex: 0 0 auto;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.45); background: none; cursor: pointer;
  font-size: 16px; transition: border-color 0.2s, background-color 0.2s, opacity 0.2s;
}
.nav-btn:hover { border-color: #fff; background: rgba(255, 255, 255, 0.06); }
.nav-btn:disabled { opacity: 0.3; cursor: default; }
.ticks { flex: 1 1 auto; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.ticks button {
  width: 100%; padding: 14px 0 0; border: 0; background: none; cursor: pointer; text-align: left;
  position: relative;
  font-size: 12px; letter-spacing: 0.04em; color: var(--faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color 0.2s;
}
.ticks button::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: rgba(255, 255, 255, 0.16); transition: background-color 0.3s;
}
.ticks button.done::before { background: rgba(255, 255, 255, 0.5); }
.ticks button[aria-current="step"] { color: #fff; }
.ticks button[aria-current="step"]::before { background: #fff; }
.ticks button:hover { color: #fff; }
.flow-note { margin-top: 26px; font-size: 13px; color: var(--faint); max-width: 52em; }

/* ———— 3. ASIO 和一条消息 ———— */

.asio { margin-top: clamp(44px, 6vh, 64px); }
.as {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(150px, 1fr) minmax(0, 2fr);
  gap: clamp(20px, 2.6vw, 40px);
  align-items: stretch;
}
.as-lane { padding: 22px 24px 24px; border: 1px solid var(--line-2); }
.as-io { border-color: rgba(61, 123, 255, 0.6); }
.as-work { border-color: rgba(255, 255, 255, 0.5); }
.as-h { display: flex; align-items: center; gap: 10px; font-size: 13px; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.86); }
.as-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--b); }
.as-work .as-dot { background: #fff; }
.as-chain { margin-top: 18px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 28px; }
.as-chain li { position: relative; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.3); }
.as-chain li + li::before {
  content: ""; position: absolute; top: -4px; left: -22px;
  width: 7px; height: 7px; border-top: 1px solid rgba(255, 255, 255, 0.6); border-right: 1px solid rgba(255, 255, 255, 0.6);
  transform: rotate(45deg);
}
.as-t { font-family: var(--mono); font-size: 14px; color: #fff; }
.as-t[data-copy] { font-family: var(--sans); font-weight: 500; font-size: 14.5px; }
.as-s { margin-top: 4px; font-size: 13px; line-height: 1.6; color: var(--faint); }
.as-q {
  position: relative;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px;
  text-align: center;
}
.as-q::before, .as-q::after {
  content: ""; position: absolute; top: 50%; height: 1px; width: clamp(20px, 2.6vw, 40px); background: rgba(255, 255, 255, 0.4);
}
.as-q::before { right: 100%; }
.as-q::after { left: 100%; }
.as-slots { display: flex; gap: 5px; padding: 8px 10px; border-left: 1px solid rgba(255, 255, 255, 0.55); border-right: 1px solid rgba(255, 255, 255, 0.55); }
.as-slots i { width: 18px; height: 26px; border: 1px solid rgba(255, 255, 255, 0.45); }
.as-slots i:nth-child(1) { background: rgba(61, 123, 255, 0.55); border-color: var(--b); }
.as-slots i:nth-child(2) { background: rgba(61, 123, 255, 0.3); border-color: rgba(61, 123, 255, 0.7); }
.as-q .as-h { justify-content: center; }
.msg-grid {
  margin-top: clamp(56px, 7vh, 72px);
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(40px, 6vw, 100px); align-items: start;
}
.msg-text .ch-p { margin-top: 0; }
.pkt { padding-top: 8px; }
.pkt-in { display: block; }
.pkt-lab { display: block; font-size: 12.5px; letter-spacing: 0.08em; color: var(--faint); margin-bottom: 8px; }
.pkt-in input {
  width: 100%; padding: 12px 14px;
  background: transparent; border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 0;
  font-family: var(--sans); font-size: 16px; color: #fff; letter-spacing: 0.01em;
  outline: none; transition: border-color 0.2s;
}
.pkt-in input:focus { border-color: #fff; }

.row { margin-top: 26px; }
.row-h { font-size: 12.5px; letter-spacing: 0.08em; color: var(--faint); margin-bottom: 8px; }
.hdr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid rgba(255, 255, 255, 0.55); }
.row[data-side="recv"] .hdr { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.cell { padding: 10px 12px; min-width: 0; }
.cell + .cell, .verdict { border-left: 1px solid rgba(255, 255, 255, 0.25); }
.c-k { display: block; font-size: 12px; color: var(--faint); letter-spacing: 0.04em; }
.c-v { display: block; margin-top: 2px; font-family: var(--mono); font-size: 15px; color: #fff; font-variant-numeric: tabular-nums; }
.c-x { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--faint); letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.verdict { display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-size: 14px; color: rgba(255, 255, 255, 0.9); }
.verdict::before { content: ""; flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--g); }
.verdict.bad::before { background: var(--r); }
.body {
  display: flex; flex-wrap: wrap; gap: 3px;
  padding: 10px 12px; min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.22); border-top: 0;
  font-family: var(--mono); font-size: 12px; line-height: 1.5;
  color: rgba(255, 255, 255, 0.62);
}
.body b { font-weight: 400; width: 2.2em; text-align: center; }
.body b.x { color: #fff; background: var(--r); }
.pkt-ctl { margin-top: 20px; display: flex; gap: 12px; flex-wrap: wrap; }
.pill {
  padding: 9px 16px; border: 1px solid rgba(255, 255, 255, 0.45); border-radius: 999px; background: none; cursor: pointer;
  font-size: 13.5px; letter-spacing: 0.04em;
  transition: border-color 0.2s, background-color 0.2s, opacity 0.2s;
}
.pill:hover { border-color: #fff; background: rgba(255, 255, 255, 0.06); }
.pill:disabled { opacity: 0.32; cursor: default; background: none; border-color: rgba(255, 255, 255, 0.45); }
.pkt-note { margin-top: 18px; font-size: 13px; line-height: 1.75; color: var(--faint); }

/* ———— 第二章：渲染（稍亮的底，和前后的黑底分开） ———— */

.ch-render {
  background: var(--bg-2);
  border-image: linear-gradient(var(--bg-2), var(--bg-2)) fill 0 / 0 / 0 100vw;
}

.frame { margin-top: clamp(48px, 7vh, 68px); }
.fsteps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(24px, 3vw, 48px); counter-reset: fs; }
.fsteps li { position: relative; counter-increment: fs; }
.fsteps li + li::before {
  content: ""; position: absolute; top: 0; margin-top: 30%; left: calc(-1 * clamp(24px, 3vw, 48px) + 6px);
  width: calc(clamp(24px, 3vw, 48px) - 12px); height: 1px; background: rgba(255, 255, 255, 0.4);
}
.fs-pic { display: block; width: 100%; height: auto; }
.fs-scr { fill: #040405; stroke: rgba(255, 255, 255, 0.35); }
.fs-tex { fill: #040405; stroke: rgba(255, 255, 255, 0.35); stroke-dasharray: 4 4; }
.fs-out { stroke: rgba(255, 255, 255, 0.8); }
.fs-pan { fill: rgba(255, 255, 255, 0.06); stroke: rgba(255, 255, 255, 0.2); }
.fs-main { fill: #000; stroke: rgba(61, 123, 255, 0.7); }
.cb-o { fill: #b8b8c0; }
.cb-t { fill: #f4f4f7; }
.cb-l { fill: #d6d6dc; }
.fs-t { margin-top: 14px; font-size: 15px; font-weight: 500; color: #fff; }
.fs-t::before { content: counter(fs); font-family: var(--serif); color: var(--faint); margin-right: 10px; }
.fs-s { margin-top: 2px; font-size: 13.5px; line-height: 1.65; color: var(--faint); }
.frame figcaption { margin-top: 26px; max-width: 52em; font-size: 14px; line-height: 1.8; color: var(--dim); }

/* AlbedoRHI：一句引子，第 1 条文字和反推图并排，第 2、3 条两小块 */
.rhi { margin-top: clamp(72px, 10vh, 112px); }
.rhi-lead {
  max-width: 48em;
  font-family: var(--serif); font-size: clamp(1.15rem, 1.4vw, 1.3rem);
  line-height: 1.75; letter-spacing: 0.02em; color: rgba(255, 255, 255, 0.92);
}
.rhi-one {
  margin-top: clamp(32px, 4.4vh, 44px); padding-top: 26px;
  border-top: 1px solid var(--line-2);
  display: grid; grid-template-columns: minmax(0, 34em) minmax(0, 1fr);
  column-gap: clamp(48px, 5.4vw, 88px); align-items: center;
}
.f-h { font-family: var(--serif); font-weight: 600; font-size: 1.16rem; line-height: 1.5; letter-spacing: 0.02em; color: #fff; }
.rhi-text p, .fact p { margin-top: 12px; font-size: 15.5px; line-height: 1.85; color: var(--dim); }
.facts2 {
  margin-top: clamp(40px, 5.4vh, 56px);
  display: grid; grid-template-columns: minmax(0, 34em) minmax(0, 1fr); column-gap: clamp(48px, 5.4vw, 88px);
}
.fact { padding-top: 26px; border-top: 1px solid var(--line-2); }
.fact p { max-width: 34em; }

.rf {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) 40px auto 40px minmax(0, 1.5fr) 40px auto;
  align-items: center;
}
.rf-col { display: grid; gap: 14px; }
.rf-box { padding: 14px 18px; border: 1px solid rgba(255, 255, 255, 0.3); }
.rf-t { font-size: 15px; font-weight: 500; color: #fff; letter-spacing: 0.02em; }
.rf-s { font-size: 13px; color: var(--faint); margin-top: 2px; }
.rf-pill { padding: 16px 20px; border: 1px solid #fff; border-radius: 999px; text-align: center; }
.rf-out .rf-box { border-left: 2px solid var(--c); }
.o-r { --c: var(--r); } .o-g { --c: var(--g); } .o-b { --c: var(--b); }
.rf-arrow { position: relative; height: 1px; background: rgba(255, 255, 255, 0.4); margin: 0 10px; }
.rf-arrow::after {
  content: ""; position: absolute; right: -1px; top: -4px;
  width: 8px; height: 8px; border-top: 1px solid rgba(255, 255, 255, 0.6); border-right: 1px solid rgba(255, 255, 255, 0.6);
  transform: rotate(45deg);
}
.rf-end { justify-items: center; gap: 10px; }
.rf-dot { width: 12px; height: 12px; border-radius: 50%; background: #fff; }

/* ———— 结尾 ———— */

/* 结尾回到黑底，和稍亮的流程那一章分开 */
.end {
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  padding-top: clamp(104px, 14vh, 150px); padding-bottom: clamp(96px, 13vh, 136px);
}
.dots { position: relative; width: 30px; height: 26px; isolation: isolate; }
.dots i { position: absolute; width: 14px; height: 14px; border-radius: 50%; mix-blend-mode: screen; }
.dots i:nth-child(1) { background: var(--r); left: 4px; top: 2px; }
.dots i:nth-child(2) { background: var(--g); left: 12px; top: 2px; }
.dots i:nth-child(3) { background: var(--b); left: 8px; top: 9px; }
.end-name { font-weight: 600; font-size: 2.2rem; letter-spacing: -0.04em; }
.end-links { display: flex; align-items: center; gap: 26px; margin-top: 6px; }

/* ———— 不在中间断开的短语 ———— */
.nw { white-space: nowrap; }

/* ———— 窄一些的屏幕 ———— */

@media (max-width: 1300px) {
  .hero-art { --f: 0.9; }
  .hero-text { width: min(34rem, 44%); }
}
@media (max-width: 1240px) {
  .rhi-one { grid-template-columns: 1fr; row-gap: 36px; }
  .rhi-text { max-width: 40em; }
}
@media (max-width: 1100px) {
  .facts2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .as { grid-template-columns: 1fr; gap: 0; }
  .as-q { flex-direction: row; justify-content: flex-start; padding: 26px 0 26px 24px; gap: 16px; text-align: left; }
  .as-q::before { right: auto; left: 30px; top: 0; width: 1px; height: 18px; }
  .as-q::after { left: 30px; top: auto; bottom: 0; width: 1px; height: 18px; }
  .room { grid-template-columns: 1fr; grid-template-areas: "stage" "views" "wire"; }
  .views { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 28px; gap: 14px; }
  .ctl { flex-wrap: wrap; row-gap: 0; }
  .flow { grid-template-columns: 1fr; grid-template-areas: "map" "panel" "ctl"; }
  .flow-panel { min-height: 0; margin-top: 28px; }
  .msg-grid { grid-template-columns: 1fr; }
  .paper-pair { grid-template-columns: 1fr; gap: 48px; }
  .rf { grid-template-columns: 1fr; justify-items: stretch; gap: 0; }
  .rf-arrow { width: 1px; height: 34px; margin: 10px auto; }
  .rf-arrow::after { right: -4px; top: auto; bottom: -1px; transform: rotate(135deg); }
  .rf-pill { justify-self: center; }
  .rf-src { grid-template-columns: 1fr 1fr; }
  .rf-out .rf-box { padding: 12px 16px; }
  .fsteps { grid-template-columns: 1fr 1fr; row-gap: 36px; }
  .fsteps li + li::before { display: none; }
}

@media (max-width: 760px) {
  .hero { min-height: 0; padding-top: 0; display: block; }
  .hero-art {
    position: relative; left: auto; top: auto;
    width: calc(100% + 2 * var(--pad)); height: auto; aspect-ratio: 3 / 2;
    margin: 0 calc(-1 * var(--pad));
    -webkit-mask-image: none; mask-image: none;
  }
  .hero-art img { -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 70%, transparent 100%); mask-image: linear-gradient(to bottom, #000 0, #000 70%, transparent 100%); }
  .hero-text { width: auto; }
  .title { font-size: clamp(4.6rem, 25vw, 6.5rem); }
  .lede { font-size: 1.3rem; }
  .intro { font-size: 1rem; }
  .as-lane { padding: 18px 18px 20px; }
  .as-chain { grid-auto-flow: row; gap: 22px; }
  .as-chain li + li::before { top: -17px; left: 2px; transform: rotate(135deg); }
  .ch { padding-top: 88px; padding-bottom: 80px; }
  .ch h2 { font-size: 1.62rem; }
  .ch-p { font-size: 15px; }
  .stage-tip { position: static; margin-top: 8px; }
  .views { grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
  .ctl { font-size: 11.5px; gap: 2px 8px; }
  .fov { width: 100%; order: 3; font-size: 11px; }
  .sync { margin-left: 0; order: 4; }
  .sync-label { font-size: 11.5px; }
  .wire { grid-template-columns: 1fr; gap: 28px; }
  .mat { font-size: 12px; padding: 4px 10px; }
  .flow-ctl { gap: 10px; }
  .ticks button { font-size: 0; padding-top: 10px; }
  .nav-btn { width: 40px; height: 40px; }
  .m-line { flex-direction: column; }
  .m-body { border-left: 1px solid rgba(255, 255, 255, 0.22); border-top: 0; }
  .m-plain .m-body { border-top: 1px dashed rgba(255, 255, 255, 0.22); }
  .hdr { grid-template-columns: 1fr 1fr 1fr; }
  .c-v { font-size: 13px; }
  .fsteps { grid-template-columns: 1fr 1fr; gap: 28px 16px; }
  .rhi-lead { font-size: 1.1rem; }
  .rhi-text p, .fact p { font-size: 15px; }
  .facts2 { grid-template-columns: 1fr; margin-top: 36px; row-gap: 36px; }
  .end-links { flex-direction: column; gap: 16px; }
}

/* ———— 截图 & 减少动效 ———— */

.shot *, .shot *::before, .shot *::after { animation: none !important; transition: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
  .rv { opacity: 1; transform: none; }
}

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

/* ———— 各语言的排版：英文页 lang="en"，日文页 lang="ja"；中文页不受影响 ———— */

/* 日文：日文字体排在中文字体前面（自托管的 Noto Serif SC 和 PingFang SC 会把汉字显示成中文字形） */
:root:lang(ja) {
  --sans: "Inter", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  --cv-sans: Inter, "Hiragino Sans", "Yu Gothic", sans-serif;
  --cv-serif: "Hiragino Mincho ProN", "Yu Mincho", serif;
}
/* 日文的标题按词组换行（各种宽度都这样，日文的词组很短）；keep-all 在日文里会让整句不断行 */
:lang(ja) .ch h2, :lang(ja) .lede, :lang(ja) .step-h { word-break: normal; word-break: auto-phrase; }

/* 英文：去掉为中文调的字距，小标签收一点 */
:lang(en) .bar, :lang(en) .ch-n, :lang(en) .kicker { letter-spacing: 0.08em; }
:lang(en) .lede, :lang(en) .intro, :lang(en) .rhi-lead,
:lang(en) .ch h2, :lang(en) .step-h, :lang(en) .f-h, :lang(en) .who, :lang(en) .map .n .lab,
:lang(en) .toc a, :lang(en) .mat-cap, :lang(en) .split-h, :lang(en) .pkt-lab, :lang(en) .row-h, :lang(en) .as-h,
:lang(en) .map .lane, :lang(en) .map .zone-t, :lang(en) .btn, :lang(en) .btn-quiet, :lang(en) .pill, :lang(en) .ctl,
:lang(en) .sync, :lang(en) .ticks button, :lang(en) .m-dir, :lang(en) .c-k, :lang(en) .step-n { letter-spacing: 0; }
/* 思源宋体（Noto Serif SC）里的弯引号是全角的，英文标题里的 person’s 会被撑开：引号单独借用站里自托管的 Cormorant Garamond */
@font-face { font-family: "Albedo Latin Quotes"; src: url("/assets/fonts/cormorant/n-latin.woff2") format("woff2"); font-weight: 300 700; font-display: swap; unicode-range: U+2018-201F; }
:root:lang(en) {
  --serif: "Albedo Latin Quotes", "Noto Serif SC", "Songti SC", serif;
  --cv-serif: "Albedo Latin Quotes", "Noto Serif SC", "Songti SC", serif;
}
/* 日文：小标签的字距是给汉字设的，假名收紧一些；短的说明也按词组换行 */
:lang(ja) .ch-n, :lang(ja) .toc a { letter-spacing: 0.08em; }
:lang(ja) .as-t, :lang(ja) .as-s, :lang(ja) .fs-t, :lang(ja) .fs-s, :lang(ja) .rf-s, :lang(ja) .f-h { word-break: normal; word-break: auto-phrase; }
/* 日文：手机上竖排的连接图里，节点名比中文长，缩小一点免得左右两列撞在一起（脚本在这种摆法下给 .lab 写了行内的 14px） */
@media (max-width: 760px) {
  :lang(ja) .map .n .lab { font-size: 12px !important; letter-spacing: 0; }
}
:lang(ja) .lede { font-size: clamp(1.3rem, 1.65vw, 1.6rem); }
@media (max-width: 760px) { :lang(ja) .lede { font-size: 1.2rem; } }
/* 流程演示里「谁 → 谁」：发出方的名字比中文长，不让它在中间断开 */
:lang(en) .m-dir b:first-child, :lang(ja) .m-dir b:first-child { flex: none; white-space: nowrap; }

/* 英文、日文：AlbedoRHI 第 1 条的说明和反推图上下排（和 1240 宽以下一样），反推图拿到整个版心的宽，译文的框里放得下；下面两小块等分 */
:lang(en) .rhi-one, :lang(ja) .rhi-one { grid-template-columns: 1fr; row-gap: 40px; }
:lang(en) .rhi-text, :lang(ja) .rhi-text { max-width: 40em; }
:lang(en) .facts2, :lang(ja) .facts2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* 英文：正文行宽收到每行七十来个字母；首屏导语比中文长得多，字号和行高收一点，让按钮留在第一屏里 */
:lang(en) .ch-p, :lang(en) .rhi-text, :lang(en) .fact p { max-width: 36em; }
:lang(en) .intro { font-size: clamp(0.98rem, 1.06vw, 1.02rem); line-height: 1.72; max-width: 32em; }
:lang(en) .intro-2 { margin-top: 12px; }
:lang(en) .lede { margin-top: clamp(16px, 2.6vh, 26px); }
:lang(en) .hero-links { margin-top: clamp(22px, 3.2vh, 32px); }
/* 日文：引子是一句大字，按词组换行，不在「ライブラリ」中间断开 */
:lang(ja) .rhi-lead { word-break: normal; word-break: auto-phrase; }
