/* =============================================================
   dsh-tree-task-flow · 发布页样式
   全部离线：无外部字体、图标、图片。图形由 CSS 与内联 SVG 绘制。
   ============================================================= */

/* ---------- 1. 设计令牌 ---------- */

:root {
  color-scheme: dark;

  --bg: #080a0a;
  --bg-elev: #0c0f0f;
  --panel: #101414;
  --panel-2: #141818;
  --ink: #edebe5;
  --ink-2: #b0b6b1;
  --ink-3: #7c847e;
  --line: rgba(237, 235, 229, 0.13);
  --line-soft: rgba(237, 235, 229, 0.07);
  --line-strong: rgba(237, 235, 229, 0.26);
  --accent: #c9f96b;
  --accent-ink: #0a0d05;
  --accent-dim: rgba(201, 249, 107, 0.13);
  --glow: rgba(201, 249, 107, 0.14);
  --warn: #f0c473;
  --code-bg: #0a0d0d;
  --shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.9);

  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC",
    "Source Han Sans SC", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Code", "Consolas",
    "Liberation Mono", "Menlo", monospace;

  --max: 1220px;
  --pad: clamp(20px, 4.4vw, 64px);
  --radius: 14px;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;

    --bg: #f4f1e8;
    --bg-elev: #faf7ef;
    --panel: #fffdf7;
    --panel-2: #f8f4ea;
    --ink: #151817;
    --ink-2: #4b524e;
    --ink-3: #7b827d;
    --line: rgba(21, 24, 23, 0.15);
    --line-soft: rgba(21, 24, 23, 0.08);
    --line-strong: rgba(21, 24, 23, 0.3);
    --accent: #4d6f00;
    --accent-ink: #f9f7ee;
    --accent-dim: rgba(77, 111, 0, 0.12);
  --glow: rgba(77, 111, 0, 0.05);
    --glow: rgba(77, 111, 0, 0.05);
    --warn: #8a5a05;
    --code-bg: #efeade;
    --shadow: 0 24px 50px -34px rgba(60, 52, 30, 0.45);
  }
}

:root[data-theme="light"] {
  color-scheme: light;

  --bg: #f4f1e8;
  --bg-elev: #faf7ef;
  --panel: #fffdf7;
  --panel-2: #f8f4ea;
  --ink: #151817;
  --ink-2: #4b524e;
  --ink-3: #7b827d;
  --line: rgba(21, 24, 23, 0.15);
  --line-soft: rgba(21, 24, 23, 0.08);
  --line-strong: rgba(21, 24, 23, 0.3);
  --accent: #4d6f00;
  --accent-ink: #f9f7ee;
  --accent-dim: rgba(77, 111, 0, 0.12);
  --warn: #8a5a05;
  --code-bg: #efeade;
  --shadow: 0 24px 50px -34px rgba(60, 52, 30, 0.45);
}

/* ---------- 2. 基础 ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

section[id],
[id="top"] {
  scroll-margin-top: 84px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.78;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: var(--accent);
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

code,
kbd,
pre {
  font-family: var(--font-mono);
  font-size: 12.9px;
  font-variant-ligatures: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
}

.skip:focus {
  left: 12px;
  top: 12px;
}

.wrap {
  width: min(var(--max), 100% - var(--pad) * 2);
  margin-inline: auto;
}

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.dim {
  color: var(--ink-3);
}

/* ---------- 3. 顶栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 1px;
  width: calc(var(--scroll, 0) * 100%);
  background: var(--accent);
  opacity: 0.85;
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 62px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
  flex: none;
}

.brand small {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-3);
  letter-spacing: 0;
}

.topnav {
  display: flex;
  gap: 22px;
  margin-left: auto;
  font-size: 13.5px;
}

.topnav a {
  color: var(--ink-2);
  text-decoration: none;
}

.topnav a:hover {
  color: var(--ink);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--ink-2);
  transition: border-color 0.2s, color 0.2s;
}

.theme-toggle:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.theme-toggle svg {
  width: 14px;
  height: 14px;
}

/* ---------- 4. 首屏 ---------- */

.hero {
  position: relative;
  padding-block: clamp(56px, 9vh, 108px) clamp(48px, 8vh, 96px);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto 40%;
  height: 90%;
  background: radial-gradient(
    60% 60% at 50% 40%,
    var(--glow),
    transparent 70%
  );
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  text-transform: uppercase;
}

.kicker::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-dim);
}

h1 {
  margin-top: 22px;
  font-size: clamp(2.45rem, 6vw, 4.85rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 700;
}

h1 .line-2 {
  display: block;
  color: var(--ink-3);
  font-weight: 600;
}

h1 .hl {
  color: var(--accent);
}

.lede {
  margin-top: 24px;
  max-width: 34em;
  font-size: clamp(1rem, 1.35vw, 1.12rem);
  color: var(--ink-2);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--solid {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn--solid:hover {
  background: color-mix(in srgb, var(--accent) 88%, white);
}

.btn--ghost {
  color: var(--ink);
  background: transparent;
}

.btn--ghost:hover {
  border-color: var(--ink-3);
}

.btn svg {
  width: 15px;
  height: 15px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 26px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
}

.hero-meta span::before {
  content: "· ";
  color: var(--accent);
}

.hero-meta span:first-child::before {
  content: "";
}

/* --- 首屏演示：一次完成的形状 --- */

.tape {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), var(--bg-elev));
  box-shadow: var(--shadow);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 12.4px;
}

.hero-demo {
  min-width: 0;
}

.tape[data-phase="reset"] * {
  transition: none !important;
}

.tape-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-3);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tape-head b {
  color: var(--ink-2);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.tape-body {
  padding: 10px 14px;
}

.row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: baseline;
  gap: 10px;
  max-height: 40px;
  padding-block: 5px;
  opacity: 0;
  overflow: hidden;
  transform: translateY(6px);
  transition: opacity 0.45s ease, transform 0.45s ease,
    max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease;
}

.tape[data-phase="run"] .row {
  opacity: 1;
  transform: none;
}

.row .op {
  color: var(--ink-3);
  font-size: 11.4px;
  text-align: right;
  white-space: nowrap;
}

.row code {
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row--edit code {
  color: var(--ink);
}

.tape[data-phase="fold"] .row.is-fold {
  max-height: 0;
  padding-block: 0;
  opacity: 0;
  transform: translateY(-6px);
}

.notice {
  margin: 0 14px;
  max-height: 0;
  padding: 0 14px;
  overflow: hidden;
  border-left: 2px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: var(--accent-dim);
  opacity: 0;
  font-family: var(--font-sans);
  font-size: 12.8px;
  line-height: 1.7;
  transition: max-height 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.4s ease 0.12s, padding 0.4s ease;
}

.tape[data-phase="fold"] .notice {
  max-height: 220px;
  padding: 11px 14px;
  opacity: 1;
}

.notice .nt {
  color: var(--ink);
  font-weight: 600;
}

.notice ul {
  margin-top: 4px;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 11.4px;
}

.tape-tail {
  padding: 10px 14px 14px;
  border-top: 1px solid var(--line-soft);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.5s ease 0.3s, transform 0.5s ease 0.3s;
}

.tape[data-phase="fold"] .tape-tail {
  opacity: 1;
  transform: none;
}

.tape-tail .row {
  opacity: 1;
  transform: none;
  max-height: none;
}

.tape-tail .res {
  margin-top: 2px;
  padding-left: 86px;
  color: var(--ink-3);
  font-family: var(--font-sans);
  font-size: 12.6px;
}

.tape-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  border-top: 1px solid var(--line-soft);
  font-size: 11px;
  color: var(--ink-3);
}

.replay {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-2);
  border-bottom: 1px dashed var(--line-strong);
  padding-bottom: 1px;
}

.replay:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.replay svg {
  width: 12px;
  height: 12px;
}

/* ---------- 5. 章节骨架 ---------- */

.chapter {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 72px);
  padding-block: clamp(64px, 10vh, 128px);
  padding-inline: max(var(--pad), calc((100% - var(--max)) / 2));
  border-bottom: 1px solid var(--line);
}

.chapter-side {
  position: sticky;
  top: 104px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chapter-side .num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.chapter-side .label {
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.6;
  max-width: 12em;
}

.chapter-body {
  min-width: 0;
}

h2 {
  font-size: clamp(1.7rem, 3.3vw, 2.75rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 680;
  max-width: 22em;
}

h2 em {
  font-style: normal;
  color: var(--accent);
}

.sub {
  margin-top: 18px;
  max-width: 38em;
  color: var(--ink-2);
  font-size: 16px;
}

/* ---------- 6. 痛点 ---------- */

.pain-list {
  margin-top: 44px;
  border-top: 1px solid var(--line);
}

.pain-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 20px;
  padding-block: 26px;
  border-bottom: 1px solid var(--line);
}

.pain-item .idx {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  padding-top: 6px;
}

.pain-item h3 {
  font-size: 1.16rem;
  font-weight: 640;
  letter-spacing: -0.01em;
}

.pain-item p {
  margin-top: 6px;
  color: var(--ink-2);
  max-width: 44em;
  font-size: 15.4px;
}

.pain-item p b {
  color: var(--ink);
  font-weight: 600;
}

/* 上下文堆叠示意 */

.stack {
  margin-top: 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 168px;
  gap: 28px;
  align-items: end;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.stack-bars {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.stack-bars i {
  display: block;
  height: 9px;
  border-radius: 2px;
  background: var(--line);
  transform-origin: left center;
  animation: grow 1.2s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

.stack-bars i.hot {
  background: color-mix(in srgb, var(--accent) 55%, transparent);
}

.stack-bars i:nth-child(1) {
  width: 46%;
  animation-delay: 0.05s;
}
.stack-bars i:nth-child(2) {
  width: 58%;
  animation-delay: 0.1s;
}
.stack-bars i:nth-child(3) {
  width: 71%;
  animation-delay: 0.15s;
}
.stack-bars i:nth-child(4) {
  width: 83%;
  animation-delay: 0.2s;
}
.stack-bars i:nth-child(5) {
  width: 92%;
  animation-delay: 0.25s;
}
.stack-bars i:nth-child(6) {
  width: 100%;
  animation-delay: 0.3s;
}

@keyframes grow {
  from {
    transform: scaleX(0);
    opacity: 0;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

.stack-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}

.stack-legend b {
  color: var(--ink);
  font-weight: 500;
}

.stack-legend .divider {
  height: 1px;
  background: var(--line);
  margin-block: 4px;
}

/* ---------- 7. 结构 ---------- */

.model {
  margin-top: 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 44px);
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.panel-body {
  padding: 18px 16px;
}

/* 树 */

.tree,
.tree ul {
  display: grid;
  gap: 2px;
}

.tree ul {
  position: relative;
  margin-left: 13px;
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.tree li {
  position: relative;
}

.tree ul > li::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 17px;
  width: 14px;
  height: 1px;
  background: var(--line);
}

.node {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 0;
  font-size: 14.2px;
  min-width: 0;
}

.node .tag {
  flex: none;
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
  color: var(--ink-3);
}

.node--req .tag {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: var(--accent-dim);
  color: var(--accent);
}

.node .txt {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node .state {
  margin-left: auto;
  flex: none;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
}

.node .state.done {
  color: var(--accent);
}

.node .state.doing {
  color: var(--warn);
}

/* 代码 */

pre.code {
  margin: 0;
  padding: 4px 0;
  background: transparent;
  color: var(--ink-2);
  overflow-x: auto;
  line-height: 1.85;
  tab-size: 2;
}

pre.code .k {
  color: var(--ink-3);
}

pre.code .s {
  color: var(--accent);
}

pre.code .c {
  color: var(--ink-3);
  opacity: 0.75;
}

pre.code .n {
  color: var(--ink);
}

/* 边界小注 */

.boundaries {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}

.boundary {
  padding: 20px 22px 20px 0;
  border-right: 1px solid var(--line-soft);
}

.boundary:last-child {
  border-right: 0;
}

.boundary .step {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
}

.boundary h4 {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 500;
}

.boundary p {
  margin-top: 4px;
  font-size: 13.6px;
  color: var(--ink-3);
  line-height: 1.7;
}

/* ---------- 8. 折叠 ---------- */

.chapter--fold {
  background: var(--bg-elev);
}

.surface-fig {
  margin-top: 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
}

.fig-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  min-width: 0;
}

.fig-card-head {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--ink-3);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.fig-card-body {
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 11.8px;
  line-height: 1.85;
  overflow: hidden;
}

.fig-card-body .l {
  display: flex;
  gap: 8px;
  color: var(--ink-3);
  white-space: nowrap;
}

.fig-card-body .l .op {
  width: 74px;
  flex: none;
  text-align: right;
  opacity: 0.8;
}

.fig-card-body .l.strike {
  color: var(--ink-3);
  opacity: 0.72;
  text-decoration: line-through;
  text-decoration-color: var(--line-strong);
}

.fig-mid {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: var(--ink-3);
}

.fig-mid::before {
  content: "";
  position: absolute;
  top: 16%;
  bottom: 16%;
  width: 1px;
  background: var(--line);
}

.fig-mid span {
  position: relative;
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-2);
  background: var(--bg-elev);
  padding: 8px 0;
}

.tape-note {
  margin-top: 16px;
  max-width: 30em;
  font-size: 12.8px;
  line-height: 1.75;
  color: var(--ink-3);
}

.tape-note b {
  color: var(--ink-2);
  font-weight: 500;
}

.fig-card--after .fig-card-body {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.75;
}

.fig-notice {
  border-left: 2px solid var(--accent);
  background: var(--accent-dim);
  border-radius: 0 8px 8px 0;
  padding: 10px 12px;
  font-size: 12.8px;
  line-height: 1.7;
}

.fig-notice b {
  font-weight: 620;
}

.fig-notice ul {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 11.2px;
  color: var(--ink-2);
}

.fig-result {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  color: var(--ink-2);
  font-size: 12.8px;
}

.fig-result code {
  color: var(--accent);
}

/* 实测表 */

.measured {
  margin-top: 44px;
  display: block;
  border-top: 1px solid var(--line);
  font-size: 14.6px;
}

.measured > div {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.measured dt {
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 400;
}

.measured dd {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13.2px;
}

.measured dd small {
  font-family: var(--font-sans);
  font-size: 12.2px;
  color: var(--ink-3);
  margin-left: 10px;
}

.fig-note {
  margin-top: 14px;
  font-size: 12.6px;
  color: var(--ink-3);
}

/* ---------- 9. 引言带 ---------- */

.pull {
  padding-block: clamp(64px, 10vh, 118px);
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

.pull::before {
  content: "“";
  position: absolute;
  left: calc(50% - min(var(--max), 100% - var(--pad) * 2) / 2);
  top: 8px;
  font-size: 220px;
  line-height: 1;
  color: var(--accent);
  opacity: 0.14;
  font-family: Georgia, serif;
  pointer-events: none;
}

.pull blockquote {
  position: relative;
  max-width: 22em;
  font-size: clamp(1.5rem, 3.4vw, 2.5rem);
  line-height: 1.42;
  letter-spacing: -0.02em;
  font-weight: 620;
}

.pull blockquote em {
  font-style: normal;
  color: var(--accent);
}

.pull cite {
  display: block;
  margin-top: 26px;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: 0.03em;
}

/* ---------- 10. 三条依据 ---------- */

.pillars {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}

.pillar {
  padding: 26px 28px 30px 0;
  border-right: 1px solid var(--line-soft);
}

.pillar:last-child {
  border-right: 0;
  padding-right: 0;
}

.pillar .no {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.pillar h3 {
  margin-top: 14px;
  font-size: 1.12rem;
  font-weight: 640;
  letter-spacing: -0.01em;
}

.pillar p {
  margin-top: 8px;
  font-size: 14.2px;
  color: var(--ink-2);
  line-height: 1.75;
}

.pillar code {
  font-size: 11.8px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--code-bg);
  border: 1px solid var(--line-soft);
}

/* 数据边界小表 */

.facts {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.fact {
  background: var(--panel);
  padding: 18px 20px;
}

.fact .fk {
  font-family: var(--font-mono);
  font-size: 10.8px;
  letter-spacing: 0.05em;
  color: var(--ink-3);
  text-transform: uppercase;
}

.fact .fv {
  margin-top: 6px;
  font-size: 14px;
  color: var(--ink);
}

.fact .fv b {
  color: var(--accent);
  font-weight: 600;
}

/* ---------- 11. 边界（可折叠） ---------- */

.limits {
  margin-top: 40px;
  border-top: 1px solid var(--line);
}

details.limit {
  border-bottom: 1px solid var(--line);
}

details.limit summary {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 0;
  cursor: pointer;
  list-style: none;
  font-size: 15.6px;
  font-weight: 560;
}

details.limit summary::-webkit-details-marker {
  display: none;
}

details.limit summary .mk {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 4px;
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  transition: background 0.2s, border-color 0.2s;
}

details.limit summary .mk::before,
details.limit summary .mk::after {
  content: "";
  position: absolute;
  background: var(--ink-3);
  transition: transform 0.22s, opacity 0.22s;
}

details.limit summary .mk::before {
  left: 4px;
  right: 4px;
  top: 8px;
  height: 1px;
}

details.limit summary .mk::after {
  top: 4px;
  bottom: 4px;
  left: 8px;
  width: 1px;
}

details.limit[open] summary .mk {
  background: var(--accent-dim);
  border-color: var(--accent);
}

details.limit[open] summary .mk::before {
  background: var(--accent);
}

details.limit[open] summary .mk::after {
  transform: scaleY(0);
  opacity: 0;
}

details.limit summary .st {
  margin-left: auto;
  flex: none;
  font-family: var(--font-mono);
  font-size: 10.8px;
  color: var(--ink-3);
  padding-top: 4px;
}

.limit-body {
  padding: 0 0 26px 34px;
  max-width: 52em;
  color: var(--ink-2);
  font-size: 14.6px;
}

.limit-body p + p {
  margin-top: 12px;
}

.limit-body code {
  font-size: 12.4px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--code-bg);
  border: 1px solid var(--line-soft);
}

.limit-body .warn {
  color: var(--warn);
}

/* ---------- 12. 安装 ---------- */

.install-grid {
  margin-top: 40px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(20px, 3vw, 44px);
  align-items: start;
}

.term {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--code-bg);
  overflow: hidden;
}

.term-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.term-head i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line-strong);
}

.term-head span {
  margin-left: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}

.term pre {
  margin: 0;
  padding: 18px 16px;
  overflow-x: auto;
  line-height: 1.95;
  color: var(--ink-2);
}

.term .prompt {
  color: var(--accent);
  user-select: none;
}

.term .out {
  color: var(--ink-3);
}

.term .cm {
  color: var(--ink-3);
  opacity: 0.8;
}

.cmd-list {
  border-top: 1px solid var(--line);
}

.cmd-list div {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.6px;
  color: var(--ink-2);
  align-items: baseline;
}

.cmd-list code {
  color: var(--ink);
  font-size: 12.4px;
}

.cmd-list .note {
  grid-column: 2;
  font-size: 12.4px;
  color: var(--ink-3);
  margin-top: -4px;
}

.settings {
  margin-top: 26px;
  font-size: 13.4px;
  color: var(--ink-3);
  line-height: 1.75;
}

.settings b {
  color: var(--ink-2);
  font-weight: 500;
}

/* ---------- 13. 页脚 ---------- */

.site-foot {
  padding-block: 48px 64px;
  font-size: 13px;
  color: var(--ink-3);
}

.foot-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 48px;
  justify-content: space-between;
  align-items: flex-start;
}

.foot-grid p {
  max-width: 46em;
  line-height: 1.7;
}

.foot-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-2);
  font-weight: 600;
}

.foot-brand svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.foot-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: right;
}

/* ---------- 14. 入场 ---------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.3, 1),
    transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

.reveal[data-d="1"] {
  transition-delay: 0.08s;
}
.reveal[data-d="2"] {
  transition-delay: 0.16s;
}
.reveal[data-d="3"] {
  transition-delay: 0.24s;
}

/* ---------- 15. 响应式 ---------- */

@media (max-width: 1080px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .hero::before {
    inset: -10% -30% auto 20%;
  }

  .tape {
    max-width: 560px;
  }

  .surface-fig {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .fig-mid {
    height: 26px;
  }

  .fig-mid::before {
    top: 50%;
    bottom: auto;
    left: 0;
    right: 0;
    width: auto;
    height: 1px;
  }

  .fig-mid span {
    writing-mode: horizontal-tb;
    letter-spacing: 0.16em;
    padding: 0 12px;
  }
}

@media (max-width: 900px) {
  .chapter {
    grid-template-columns: 1fr;
    gap: 26px;
    padding-block: clamp(52px, 9vh, 84px);
  }

  .chapter-side {
    position: static;
    flex-direction: row;
    align-items: baseline;
    gap: 12px;
  }

  .chapter-side .label {
    max-width: none;
  }

  .chapter-side .label br {
    display: none;
  }

  .model,
  .install-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .pillars {
    grid-template-columns: minmax(0, 1fr);
  }

  .pillar {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    padding: 22px 0 24px;
  }

  .boundaries {
    grid-template-columns: 1fr;
  }

  .boundary {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    padding: 18px 0;
  }

  .measured > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .facts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  .topnav {
    display: none;
  }

  .topbar-inner {
    gap: 12px;
    height: 58px;
  }

  .brand small {
    display: none;
  }

  .theme-toggle {
    margin-left: auto;
  }

  .theme-toggle .theme-label {
    display: none;
  }

  .tape {
    font-size: 11.6px;
  }

  .row {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 8px;
  }

  .row .op {
    font-size: 10.6px;
  }

  .tape-tail .res {
    padding-left: 70px;
  }

  .pain-item {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
  }

  .stack {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .stack-legend {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px 14px;
  }

  .cmd-list div {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .foot-meta {
    text-align: left;
  }

  .pull::before {
    font-size: 150px;
  }

  .limit-body {
    padding-left: 0;
  }

  .hero-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
