/* =========================================================================
   科设工作室 · 站点样式
   配色：三套方案，切换 html[data-scheme] 即可；明暗由 html[data-theme] 控制
   方案 a = 铜绿（默认）  b = 琥珀  c = 石墨青
   ========================================================================= */

/* ---------- 方案 A · 铜绿（默认，浅色） ---------- */
:root {
  --bg: #f3f2ec;
  --bg-deep: #ebe9df;
  --panel: #fbfaf5;
  --panel-2: #f7f5ed;
  --ink: #1c2421;
  --ink-2: #404b46;
  --muted: #66726b;
  --faint: #98a29b;
  --line: #d9d6c9;
  --line-strong: #bfbbab;
  --accent: #3c6f62;
  --accent-2: #2d5a4e;
  --accent-fg: #f5faf7;
  --accent-soft: #e3ebe5;
  --accent-line: rgba(60, 111, 98, .38);
  --signal: #8a6a2f;
  --alert: #8c4a3f;
  --grid: rgba(28, 36, 33, .055);
  --glow: rgba(60, 111, 98, .11);
  --scrim: rgba(20, 27, 24, .42);
  --shadow: 0 18px 44px -28px rgba(28, 36, 33, .55);
  --shadow-hover: 0 26px 56px -30px rgba(28, 36, 33, .55);
  --noise-opacity: .28;
  color-scheme: light;
}

/* ---------- 方案 A · 铜绿（深色） ---------- */
html[data-theme="dark"] {
  --bg: #111513;
  --bg-deep: #0c0f0e;
  --panel: #171d1a;
  --panel-2: #1b211e;
  --ink: #e0e6df;
  --ink-2: #bfc8c1;
  --muted: #93a098;
  --faint: #6c7871;
  --line: #2b332e;
  --line-strong: #3b453f;
  --accent: #7fb5a4;
  --accent-2: #9ccbb9;
  --accent-fg: #0e1512;
  --accent-soft: #1c2a25;
  --accent-line: rgba(127, 181, 164, .34);
  --signal: #c9a25f;
  --alert: #cf8f80;
  --grid: rgba(160, 190, 178, .06);
  --glow: rgba(127, 181, 164, .09);
  --scrim: rgba(4, 7, 6, .58);
  --shadow: 0 18px 44px -26px rgba(0, 0, 0, .8);
  --shadow-hover: 0 26px 56px -28px rgba(0, 0, 0, .8);
  --noise-opacity: .18;
  color-scheme: dark;
}

/* ---------- 方案 B · 琥珀 ---------- */
html[data-scheme="b"] {
  --bg: #f4efe3;
  --bg-deep: #ece5d4;
  --panel: #fcf9f1;
  --panel-2: #f8f3e7;
  --ink: #231e16;
  --ink-2: #4a4238;
  --muted: #6f6657;
  --faint: #9c9384;
  --line: #dcd2bd;
  --line-strong: #c6b99c;
  --accent: #9b6a20;
  --accent-2: #7d5317;
  --accent-fg: #fdf8ee;
  --accent-soft: #ece0c8;
  --accent-line: rgba(155, 106, 32, .36);
  --signal: #8a5a2c;
  --alert: #8c4a3f;
  --grid: rgba(35, 30, 22, .055);
  --glow: rgba(155, 106, 32, .10);
  --scrim: rgba(31, 25, 17, .42);
}
html[data-scheme="b"][data-theme="dark"] {
  --bg: #15130f;
  --bg-deep: #0e0c09;
  --panel: #1c1914;
  --panel-2: #211d17;
  --ink: #e8dfcd;
  --ink-2: #c7bda9;
  --muted: #a09682;
  --faint: #776e5d;
  --line: #332c22;
  --line-strong: #443a2c;
  --accent: #d6a45c;
  --accent-2: #e8bc7d;
  --accent-fg: #171208;
  --accent-soft: #2a2318;
  --accent-line: rgba(214, 164, 92, .32);
  --signal: #d6a45c;
  --alert: #cf8f80;
  --grid: rgba(200, 175, 130, .06);
  --glow: rgba(214, 164, 92, .09);
  --scrim: rgba(5, 4, 3, .58);
  --noise-opacity: .18;
  color-scheme: dark;
}

/* ---------- 方案 C · 石墨青 ---------- */
html[data-scheme="c"] {
  --bg: #edf0f1;
  --bg-deep: #e4e8ea;
  --panel: #f8fafb;
  --panel-2: #f2f5f6;
  --ink: #1a2024;
  --ink-2: #3d474d;
  --muted: #5e6a72;
  --faint: #8b979e;
  --line: #d2d8dc;
  --line-strong: #b8c2c8;
  --accent: #44606e;
  --accent-2: #324a57;
  --accent-fg: #f6fafb;
  --accent-soft: #e0e8eb;
  --accent-line: rgba(68, 96, 110, .36);
  --signal: #7a5a34;
  --alert: #8c4a3f;
  --grid: rgba(26, 32, 36, .05);
  --glow: rgba(68, 96, 110, .10);
  --scrim: rgba(19, 24, 27, .42);
}
html[data-scheme="c"][data-theme="dark"] {
  --bg: #101416;
  --bg-deep: #0a0d0e;
  --panel: #161b1e;
  --panel-2: #1a2024;
  --ink: #dde3e6;
  --ink-2: #bac5c9;
  --muted: #93a0a7;
  --faint: #6b777e;
  --line: #283034;
  --line-strong: #38434a;
  --accent: #91b1bd;
  --accent-2: #b0ccd6;
  --accent-fg: #0c1214;
  --accent-soft: #1b2529;
  --accent-line: rgba(145, 177, 189, .3);
  --signal: #cfa46a;
  --alert: #cf8f80;
  --grid: rgba(160, 185, 195, .06);
  --glow: rgba(145, 177, 189, .09);
  --scrim: rgba(4, 6, 7, .58);
  --noise-opacity: .18;
  color-scheme: dark;
}

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

:root {
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", Menlo, monospace;
  --wrap: 1160px;
  --pad: 28px;
  --radius: 3px;
  --ease: cubic-bezier(.22, .7, .2, 1);
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* 背景细网格 + 噪点（全部 CSS / 内联 SVG 生成，无外链） */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
body::before {
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 44px 44px;
  background-position: center top;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 0%, rgba(0, 0, 0, .55) 62%, transparent 100%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 0%, rgba(0, 0, 0, .55) 62%, transparent 100%);
}
body::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
  opacity: var(--noise-opacity);
  mix-blend-mode: multiply;
}
html[data-theme="dark"] body::after { mix-blend-mode: screen; }

.site-header, main, .site-footer, .boot, .cursor-light { position: relative; z-index: 1; }

img, svg { max-width: 100%; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 600; letter-spacing: .01em; text-wrap: balance; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 10000;
  padding: 8px 14px;
  background: var(--accent);
  color: var(--accent-fg);
  font-family: var(--font-mono);
  font-size: 12px;
  transform: translateY(-160%);
  transition: transform .2s var(--ease);
}
.skip-link:focus { transform: none; }

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 66px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.brand-mark { width: 36px; height: 36px; color: var(--accent); flex: none; }
.brand-mark svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: square; }
.brand-name { display: block; font-size: 16px; font-weight: 600; letter-spacing: .04em; line-height: 1.2; }
.brand-sub { display: block; margin-top: 3px; font-family: var(--font-mono); font-size: 9px; letter-spacing: .26em; color: var(--muted); }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  color: var(--ink-2);
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.nav a:hover { color: var(--accent); border-bottom-color: var(--accent-line); }
.nav a[aria-current="true"] { color: var(--accent); border-bottom-color: var(--accent); }

.header-tools { display: flex; align-items: center; gap: 8px; }

.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-2);
  transition: border-color .2s, color .2s, background .2s;
}
.tool-btn:hover { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
.tool-btn svg { width: 16px; height: 16px; }
.theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.nav-toggle { display: none; }

/* 顶栏数据条 */
.status-strip {
  border-top: 1px solid var(--line);
  background: var(--panel-2);
}
.status-strip .inner {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad);
  min-height: 30px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
.status-strip .inner::-webkit-scrollbar { display: none; }
.status-strip span { font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.status-strip span.sep { color: var(--line-strong); letter-spacing: 0; }
.status-strip .live { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); }

.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-line);
}
.dot--idle { background: var(--signal); box-shadow: 0 0 0 1px rgba(138, 106, 47, .35); }

/* ---------- 首屏 ---------- */
.hero { padding: 84px 0 64px; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(300px, .82fr);
  gap: 64px;
  align-items: center;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
}
.kicker::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--accent-line);
}

.hero h1 {
  margin: 26px 0 0;
  font-size: clamp(44px, 7.2vw, 82px);
  line-height: 1.02;
  letter-spacing: .03em;
  font-weight: 650;
}
.hero-latin {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .4em;
  color: var(--muted);
  text-transform: uppercase;
}
.hero-lead {
  margin-top: 30px;
  max-width: 46ch;
  font-size: 17px;
  line-height: 1.9;
  color: var(--ink-2);
}
.hero-lead strong { font-weight: 600; color: var(--ink); }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 22px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 14px;
  letter-spacing: .02em;
  color: var(--ink);
  background: transparent;
  transition: border-color .2s, background .2s, color .2s, transform .2s var(--ease);
}
.btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.btn svg { width: 15px; height: 15px; }
.btn--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-fg);
}
.btn--primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--accent-fg); }
.btn--primary .arrow { color: currentColor; }

.hero-note {
  margin-top: 26px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--faint);
}
.hero-note::before {
  content: "";
  width: 1px;
  height: 14px;
  background: var(--accent-line);
}

/* ---------- 仪器面板（首屏右侧） ---------- */
.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.panel-head .leds { display: inline-flex; gap: 5px; }
.panel-head .led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-strong);
}
.panel-head .led.on { background: var(--accent); box-shadow: 0 0 0 1px var(--accent-line); }
.panel-head .title {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

.corner::before,
.corner::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--accent-line);
  border-style: solid;
  pointer-events: none;
}
.corner::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.corner::after { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }

.instrument-stage {
  position: relative;
  display: grid;
  place-items: center;
  padding: 34px 20px 26px;
  overflow: hidden;
  background:
    linear-gradient(to right, var(--grid) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px) 0 0 / 22px 22px;
}
.instrument-stage::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: var(--accent-line);
  opacity: .65;
  animation: scan 7.5s linear infinite;
}
.instrument-mark {
  width: 168px;
  height: 168px;
  color: var(--accent);
}
.instrument-mark svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: square; stroke-linejoin: miter; }
.instrument-coord {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .12em;
  color: var(--faint);
  text-transform: uppercase;
}
.instrument-coord.tl { top: 12px; left: 14px; }
.instrument-coord.br { bottom: 12px; right: 14px; }

.readout { display: grid; border-top: 1px solid var(--line); }
.readout-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  align-items: baseline;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.readout-row:last-child { border-bottom: 0; }
.readout-row dt {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
}
.readout-row dd {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
}
.readout-row dd .accent { color: var(--accent); }
.panel-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  border-top: 1px solid var(--line);
  background: var(--panel-2);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---------- 章节骨架 ---------- */
.section { padding: 76px 0; border-top: 1px solid var(--line); }
.section--tight { padding-top: 60px; }

.section-head {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 28px;
  margin-bottom: 40px;
}
.section-index {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  padding-top: 6px;
}
.section-index span { display: block; margin-top: 8px; color: var(--faint); letter-spacing: .12em; }
.section-title { font-size: clamp(27px, 3.4vw, 36px); font-weight: 620; }
.section-lede {
  margin-top: 14px;
  max-width: 62ch;
  color: var(--muted);
  font-size: 15.5px;
}

/* ---------- 正文块 ---------- */
.prose { max-width: 68ch; }
.prose p { color: var(--ink-2); }
.prose p:last-child { margin-bottom: 0; }

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 56px;
  align-items: start;
}

/* 对比面板 */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.compare--stack { grid-template-columns: 1fr; }
.compare + .note { margin-top: 16px; }
.compare-card { border: 1px solid var(--line); background: var(--panel); padding: 22px; }
.compare-card h3 {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.compare-card ul { display: grid; gap: 9px; }
.compare-card li { position: relative; padding-left: 18px; font-size: 14px; color: var(--ink-2); }
.compare-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: 7px;
  height: 7px;
  border: 1px solid var(--line-strong);
  transform: rotate(45deg);
}
.compare-card--yes { border-color: var(--accent-line); background: var(--accent-soft); }
.compare-card--yes h3 { color: var(--accent); }
.compare-card--yes li::before { border-color: var(--accent); background: var(--accent); }
.compare-card--no li { color: var(--muted); }

/* ---------- 卡片 / 方向 ---------- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card-grid--2 { grid-template-columns: repeat(2, 1fr); }
.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 24px;
  transition: transform .28s var(--ease), border-color .28s, box-shadow .28s, background .28s;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-line);
  box-shadow: var(--shadow-hover);
}
.card::after {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 16px;
  height: 16px;
  border-top: 1px solid var(--accent);
  border-left: 1px solid var(--accent);
  opacity: 0;
  transition: opacity .28s;
}
.card:hover::after { opacity: 1; }
.card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-idx {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .16em;
  color: var(--faint);
  text-transform: uppercase;
}
.card h3 { font-size: 18px; margin-bottom: 10px; }
.card p { font-size: 14px; line-height: 1.75; color: var(--muted); margin: 0; }
.card .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }

.tag {
  display: inline-block;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .1em;
  color: var(--muted);
  text-transform: uppercase;
}

.card--placeholder { border-style: dashed; background: transparent; }
.card--placeholder h3 { color: var(--muted); }
.card--placeholder .card-idx { color: var(--signal); }

/* ---------- 信号面板 / canvas ---------- */
.signal-wrap { margin-top: 16px; }
.signal {
  position: relative;
  height: 268px;
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
}
.signal canvas { display: block; width: 100%; height: 100%; }
.signal-hud {
  position: absolute;
  left: 14px;
  top: 12px;
  display: grid;
  gap: 4px;
  pointer-events: none;
}
.signal-hud .k { font-family: var(--font-mono); font-size: 9px; letter-spacing: .16em; color: var(--accent); text-transform: uppercase; }
.signal-hud .v { font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; color: var(--faint); text-transform: uppercase; }
.signal-ctl {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--panel-2);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .12em;
  color: var(--muted);
  text-transform: uppercase;
}
.signal-ctl:hover { border-color: var(--accent-line); color: var(--accent); }
.signal-ctl svg { width: 10px; height: 10px; }

/* ---------- 流程 ---------- */
.flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  background: var(--panel);
}
.flow-step { position: relative; padding: 24px 22px 26px; border-left: 1px solid var(--line); }
.flow-step:first-child { border-left: 0; }
.flow-step::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--line);
  transition: background .3s;
}
.flow-step:hover::before { background: var(--accent); }
.flow-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--accent);
  margin-bottom: 10px;
}
.flow-step h3 { font-size: 15.5px; margin-bottom: 8px; }
.flow-step p { font-size: 13.5px; line-height: 1.7; color: var(--muted); margin: 0; }

/* ---------- 仓库 ---------- */
.repo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.repo {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 26px 24px;
  border: 1px solid var(--line);
  background: var(--panel);
  position: relative;
  transition: transform .28s var(--ease), border-color .28s, box-shadow .28s;
}
.repo:hover { transform: translateY(-3px); border-color: var(--accent-line); box-shadow: var(--shadow-hover); }
.repo-top { display: flex; align-items: center; gap: 10px; }
.repo-name {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: .02em;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.repo-top .dot { margin-left: auto; flex: none; }
.repo-desc { font-size: 14px; line-height: 1.75; color: var(--muted); margin: 0; min-height: 3.5em; }
.repo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
}
.repo-meta b { color: var(--ink-2); font-weight: 400; }
.repo-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--accent);
  align-self: flex-start;
}
.repo-link svg { width: 12px; height: 12px; transition: transform .2s var(--ease); }
.repo:hover .repo-link svg { transform: translate(2px, -2px); }
.repo-link::after { content: ""; position: absolute; inset: 0; }
.repo--placeholder { border-style: dashed; background: transparent; }
.repo--placeholder .repo-name { color: var(--muted); }
.repo--placeholder .repo-link { color: var(--faint); }

/* 紧凑仓库卡片 */
.repo-grid--3 { grid-template-columns: repeat(3, 1fr); }
.repo--compact { padding: 20px 18px; gap: 12px; }
.repo--compact .repo-name { font-size: 12.5px; }
.repo--compact .repo-desc { font-size: 12.5px; line-height: 1.7; min-height: 5.1em; }
.repo--compact .repo-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding-top: 11px; font-size: 9px; }
.repo--compact .repo-link { font-size: 12px; }

.source-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 20px;
  font-size: 12.5px;
  color: var(--faint);
}
.source-note::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  margin-top: .55em;
  border: 1px solid var(--signal);
  transform: rotate(45deg);
}

/* ---------- 参与 ---------- */
.join-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  margin-top: 32px;
}
.note {
  border-left: 2px solid var(--accent);
  background: var(--accent-soft);
  padding: 16px 18px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-2);
}
.note strong { color: var(--ink); font-weight: 600; }
.note--warn { border-left-color: var(--signal); background: transparent; border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.note--warn strong { color: var(--signal); }

.check-list { display: grid; gap: 12px; }
.check-list li {
  position: relative;
  padding-left: 26px;
  font-size: 14px;
  color: var(--ink-2);
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: 12px;
  height: 12px;
  border: 1px solid var(--line-strong);
}
.check-list li::after {
  content: "";
  position: absolute;
  left: 4px;
  top: .82em;
  width: 5px;
  height: 5px;
  background: var(--accent);
}

/* ---------- 联系 ---------- */
.contact {
  border: 1px solid var(--line);
  background: var(--panel);
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
}
.contact-main { padding: 34px 30px; border-right: 1px solid var(--line); }
.contact-foot { margin-top: 26px; }
.contact-side { padding: 34px 30px; display: grid; gap: 14px; align-content: center; }
.contact h2 { font-size: clamp(24px, 3vw, 32px); }
.contact p { margin: 12px 0 0; color: var(--muted); font-size: 14px; }

.contact-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  transition: color .2s;
}
.contact-link:last-child { border-bottom: 0; }
.contact-link:hover { color: var(--accent); }
.contact-link .ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  color: var(--accent);
}
.contact-link .ico svg { width: 16px; height: 16px; }
.contact-link .t { display: block; font-size: 14px; line-height: 1.3; }
.contact-link .u { display: block; margin-top: 3px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .04em; color: var(--muted); overflow-wrap: anywhere; }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 44px 0 34px; background: var(--bg-deep); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; align-items: start; }
.footer-brand { display: flex; align-items: flex-start; gap: 14px; }
.footer-brand .brand-mark { width: 30px; height: 30px; }
.footer-name { font-size: 15px; font-weight: 600; letter-spacing: .04em; }
.footer-sub { margin-top: 6px; font-family: var(--font-mono); font-size: 9px; letter-spacing: .22em; color: var(--faint); text-transform: uppercase; }
.footer-line { margin-top: 18px; font-size: 12.5px; line-height: 1.85; color: var(--muted); max-width: 34ch; }
.footer-col h3 { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); margin-bottom: 14px; }
.footer-col ul { display: grid; gap: 8px; }
.footer-col a { font-size: 13px; color: var(--ink-2); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  color: var(--faint);
  text-transform: uppercase;
}
.footer-bottom--bare { margin-top: 0; padding-top: 0; border-top: 0; }

/* ---------- 启动动画 ---------- */
.boot {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  place-items: center;
  background: var(--bg);
  cursor: pointer;
}
html.booting { overflow: hidden; }
html.booting .boot { display: grid; }
.boot-inner { width: min(480px, 78vw); }
.boot-head {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .18em;
  color: var(--faint);
  text-transform: uppercase;
  margin-bottom: 18px;
}
.boot-log { display: grid; gap: 7px; margin-bottom: 22px; }
.boot-line {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted);
  opacity: 0;
  animation: bootLine .16s steps(2, end) forwards;
}
.boot-line b { color: var(--accent); font-weight: 400; }
.boot-line:nth-child(1) { animation-delay: .06s; }
.boot-line:nth-child(2) { animation-delay: .18s; }
.boot-line:nth-child(3) { animation-delay: .3s; }
.boot-line:nth-child(4) { animation-delay: .42s; }
.boot-line:nth-child(5) { animation-delay: .54s; }
.boot-bar { height: 2px; background: var(--line); position: relative; overflow: hidden; }
.boot-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  animation: bootBar .42s cubic-bezier(.2, .8, .2, 1) .22s forwards;
}
.boot-scan {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: var(--accent-line);
  animation: bootScan .9s linear forwards;
}
.boot-hint {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .14em;
  color: var(--faint);
  text-transform: uppercase;
}
html.boot-out .boot { opacity: 0; transition: opacity .22s ease; }
html.boot-out .boot * { animation-play-state: paused; }

@keyframes bootLine {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: none; }
}
@keyframes bootBar { to { transform: scaleX(1); } }
@keyframes bootScan {
  from { top: 0; opacity: .9; }
  to { top: 100%; opacity: 0; }
}
@keyframes scan {
  0% { top: 0; opacity: 0; }
  8% { opacity: .6; }
  92% { opacity: .6; }
  100% { top: 100%; opacity: 0; }
}

/* ---------- 进场 ---------- */
html.has-anim .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
  transition-delay: var(--delay, 0ms);
}
html.has-anim .reveal.in { opacity: 1; transform: none; }

/* ---------- 鼠标跟随 ---------- */
.cursor-light {
  position: fixed;
  top: 0;
  left: 0;
  width: 430px;
  height: 430px;
  margin: -215px 0 0 -215px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  background: radial-gradient(circle, var(--glow) 0%, transparent 66%);
  transition: opacity .35s ease;
  will-change: transform;
}
.cursor-light.on { opacity: 1; }

/* ---------- 404 ---------- */
.notfound { min-height: calc(100vh - 66px); display: grid; align-content: center; padding: 80px 0; }
.notfound-code {
  font-family: var(--font-mono);
  font-size: clamp(64px, 14vw, 150px);
  line-height: .9;
  letter-spacing: -.04em;
  color: var(--accent);
}
.notfound h1 { margin-top: 24px; font-size: clamp(24px, 4vw, 38px); }
.notfound p { margin-top: 14px; color: var(--muted); max-width: 46ch; }
.notfound-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1040px) {
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .hero .instrument-wrap { max-width: 520px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .section-head { grid-template-columns: 76px minmax(0, 1fr); gap: 20px; }
  .two-col { gap: 36px; }
  .repo-grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 880px) {
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--pad) 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  body.nav-open .nav { display: flex; }
  .nav a { height: 44px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav a:last-child { border-bottom: 0; }
  .nav-toggle { display: inline-flex; }
  .flow { grid-template-columns: repeat(2, 1fr); }
  .flow-step:nth-child(3) { border-left: 0; }
  .flow-step:nth-child(n+3) { border-top: 1px solid var(--line); }
  .repo-grid { grid-template-columns: 1fr; }
  .contact { grid-template-columns: 1fr; }
  .contact-main { border-right: 0; border-bottom: 1px solid var(--line); }
  .join-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  :root { --pad: 18px; }
  .hero { padding: 56px 0 44px; }
  .hero h1 { font-size: clamp(38px, 11vw, 52px); }
  .hero-lead { font-size: 15.5px; }
  .status-strip .inner {
    gap: 14px;
    -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent);
    mask-image: linear-gradient(90deg, #000 88%, transparent);
  }
  .section { padding: 56px 0; }
  .section-head { grid-template-columns: 1fr; gap: 10px; margin-bottom: 28px; }
  .section-index { display: flex; gap: 12px; padding-top: 0; }
  .section-index span { margin: 0; }
  .two-col { grid-template-columns: 1fr; gap: 28px; }
  .card-grid { grid-template-columns: 1fr; }
  .compare { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; }
  .flow-step { border-left: 0; }
  .flow-step + .flow-step { border-top: 1px solid var(--line); }
  .repo { padding: 22px 18px; }
  .contact-main, .contact-side { padding: 26px 20px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { display: block; line-height: 2; }
  .instrument-mark { width: 132px; height: 132px; }
  .readout-row { grid-template-columns: 92px minmax(0, 1fr); }
  .signal { height: 220px; }
}

/* ---------- 动效减弱 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  html.has-anim .reveal { opacity: 1; transform: none; }
  .cursor-light { display: none; }
  .instrument-stage::after { display: none; }
  .boot { display: none !important; }
}
