/* ==========================================================================
   ant — Zed × Factory × Lyber Serious Industrial Stylesheet
   Zero neon blue fog. Zero rounded AI pills. Zero gradient buttons.
   Flat high-contrast industrial precision + physical machine-shop authority.
   ========================================================================== */

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

html {
  background: var(--bg-base);
  color: var(--text-primary);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-splash-open {
  overflow: hidden;
}

canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--signal-yellow);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 28px;
}

/* ==========================================================================
   Official Top Navigation Bar (56px, Flat Zed/Lyber Precision)
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  height: var(--header-h);
  background: #090D14;
  border-bottom: 1px solid var(--border-hair);
}

.header-inner {
  height: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 5px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  color: var(--text-primary);
  transition: border-color 120ms, background-color 120ms;
}

.brand-trigger:hover {
  border-color: var(--border-strong);
  background: var(--bg-surface);
}

body.is-splash-open .brand-trigger {
  border-color: rgba(242, 183, 5, 0.55);
  background: rgba(242, 183, 5, 0.06);
}

.brand-badge-box {
  width: 36px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0D1422;
  border: 1px solid var(--border-strong);
}

.brand-badge-box canvas {
  width: 36px;
  height: 26px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.brand-ver {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

/* Official Top Navigation: 设计构想 / 文档 / 社群 */
.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--header-h);
  padding: 0 16px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  transition: color 120ms, background-color 120ms;
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.025);
}

.nav-item.is-active {
  color: var(--text-primary);
}

.nav-item.is-active::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 2px;
  background: var(--signal-yellow);
}

.nav-kbd {
  font-size: 9px;
  padding: 1px 4px;
  border: 1px solid var(--border-hair);
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Flat Industrial Buttons (Factory × Lyber Discipline — ZERO gradients!) */
.btn-solid-yellow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 18px;
  background: var(--signal-yellow);
  border: 1px solid var(--signal-yellow);
  border-radius: 2px;
  color: #090D14;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: background-color 110ms, transform 70ms;
}

.btn-solid-yellow:hover {
  background: #FFCA28;
  border-color: #FFCA28;
}

.btn-solid-yellow:active {
  transform: translateY(1px);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  transition: border-color 110ms, background-color 110ms;
}

.btn-outline:hover {
  border-color: var(--text-primary);
  background: var(--bg-surface);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid var(--border-hair);
  border-radius: 2px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  transition: border-color 110ms, color 110ms, background-color 110ms;
}

.btn-ghost:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
  background: var(--bg-surface);
}

.btn-ghost.is-live-active {
  border-color: var(--signal-yellow);
  color: var(--signal-yellow);
}

.live-dot {
  width: 6px;
  height: 6px;
  background: var(--signal-yellow);
}

.btn-header-install {
  height: 32px;
  padding: 0 14px;
  font-size: 11.5px;
}

/* ==========================================================================
   OPENING FULLSCREEN PHYSICAL ANT MACHINE-SHOP CURTAIN
   Clicking project name "ant" cleanly dismisses curtain -> formal Overview
   ========================================================================== */
.splash-curtain {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: var(--bg-base);
  transition: opacity 380ms cubic-bezier(0.22, 1, 0.36, 1), transform 380ms cubic-bezier(0.22, 1, 0.36, 1), visibility 380ms;
}

.splash-curtain.is-dismissed {
  opacity: 0;
  transform: translateY(-14px);
  visibility: hidden;
  pointer-events: none;
}

.splash-canvas-layer {
  position: relative;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.splash-canvas-layer canvas {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.splash-telemetry {
  position: absolute;
  top: 30px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 12px;
  background: rgba(9, 13, 20, 0.9);
  border: 1px solid var(--border-hair);
  border-radius: 9px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  pointer-events: none;
}

/* Cold-boot blackout immersion: HUD stays dark during first ~1.7s until broken lamps catch */
.splash-hud-chrome {
  transition: opacity 420ms ease, border-color 140ms, background-color 140ms, transform 120ms;
}

.splash-curtain.is-cold-boot .splash-hud-chrome {
  opacity: 0.08;
}

.splash-curtain.is-cold-boot .splash-hud-chrome:hover {
  opacity: 0.95;
}

.splash-telemetry b {
  color: var(--text-primary);
  margin-left: 4px;
}

.splash-telemetry b.is-mk3 {
  color: #4E9F8D;
}

.splash-status-pill {
  color: var(--signal-yellow);
  font-weight: 700;
}

.splash-status-pill.is-hunt {
  color: #FF536B;
}

.splash-status-pill.is-complete {
  color: var(--signal-teal);
}

/* Lyber × Factory Bottom-Left Anchored Project Name Portal */
.splash-name-portal {
  position: absolute;
  left: 32px;
  bottom: 28px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 16px 22px 15px;
  background: rgba(9, 13, 20, 0.92);
  border: 1px solid var(--border-hair);
  border-inline-start: 3px solid var(--signal-yellow);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(2, 5, 11, 0.25);
  text-align: left;
  color: var(--text-primary);
}

.splash-name-portal:is(:hover, :focus-visible) {
  border-color: var(--border-strong);
  border-inline-start-color: var(--signal-yellow);
  background: #0D1420;
}

.splash-name-portal:hover {
  transform: translateY(-2px);
}

.portal-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--text-secondary);
}

.portal-eyebrow::before {
  content: "";
  width: 14px;
  height: 1px;
  background: var(--signal-yellow);
}

.portal-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.portal-title {
  font-family: var(--font-display);
  font-size: 62px;
  font-weight: 700;
  line-height: 0.88;
  letter-spacing: -0.055em;
  color: var(--text-primary);
}

.portal-highlight-block {
  padding: 5px 10px;
  background: var(--signal-yellow);
  color: #090D14;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.portal-cue {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: #B8C5D9;
}

.splash-name-portal:is(:hover, :focus-visible) .portal-cue {
  color: var(--signal-yellow);
}

/* Castes and scene actions use separate inset control groups. */
.splash-caste-bar,
.splash-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: rgba(9, 13, 20, 0.94);
  border: 1px solid var(--border-hair);
  border-radius: 10px;
}

.splash-caste-bar {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 5;
}

.caste-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 9px;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10.5px;
  white-space: nowrap;
  transition: color 120ms, background-color 120ms;
}

.caste-chip:hover,
.splash-micro-btn:hover {
  background: var(--bg-surface-2);
  color: var(--text-primary);
}

.caste-chip:focus-visible,
.splash-micro-btn:focus-visible {
  outline-offset: -2px;
}

.caste-chip.is-active,
.splash-micro-btn.is-on {
  background: rgba(242, 183, 5, 0.12);
  box-shadow: inset 0 0 0 1px rgba(242, 183, 5, 0.29);
  color: var(--signal-yellow);
  font-weight: 700;
}

.caste-chip b {
  color: #8191AE;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.caste-chip.is-active b {
  color: inherit;
}

.cc-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
}

.cc-queen   { background: #FFD34D; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.cc-scout   { background: #37CBFF; border-radius: 50%; }
.cc-worker  { background: #FF8B36; }
.cc-soldier { background: #FF536B; clip-path: polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%); }
.cc-nurse   { background: #A4F452; clip-path: polygon(33% 0, 67% 0, 67% 33%, 100% 33%, 100% 67%, 67% 67%, 67% 100%, 33% 100%, 33% 67%, 0 67%, 0 33%, 33% 33%); }
.cc-army    { background: #B684FF; clip-path: polygon(0 0, 50% 24%, 100% 0, 100% 74%, 50% 100%, 0 74%); }

.splash-controls {
  position: absolute;
  right: 32px;
  bottom: 28px;
  z-index: 5;
}

@media (max-width: 1220px) {
  .splash-caste-bar {
    bottom: 70px;
    left: auto;
    right: 32px;
    transform: none;
  }
}

.splash-micro-btn {
  height: 32px;
  padding: 0 11px;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  transition: color 120ms, background-color 120ms;
}

/* ==========================================================================
   FORMAL PAGES (Zed × Factory × Lyber Architectural Seriousness)
   ========================================================================== */
.pages-root {
  padding-top: var(--header-h);
  min-height: 100vh;
  background-color: var(--bg-base);
  /* Subtle Zed-inspired drafting grid lines (zero blue fog!) */
  background-image:
    linear-gradient(to right, rgba(136, 158, 194, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(136, 158, 194, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
}

.page-section {
  display: none;
}

.page-section.is-active {
  display: block;
  animation: crispIn 220ms ease both;
}

@keyframes crispIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- PAGE 1: FORMAL OVERVIEW (Shown after clicking "ant") ---------- */
.overview-hero {
  position: relative;
  padding: 84px 0 68px;
  border-bottom: 1px solid var(--border-hair);
}

.overview-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.overview-kicker::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--signal-yellow);
}

/* Lyber signature high-contrast solid highlight block headline */
.overview-title {
  margin: 22px 0 22px;
  max-width: 880px;
  font-family: var(--font-display);
  font-size: clamp(38px, 5vw, 62px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.035em;
  color: var(--text-primary);
}

.hl-block {
  display: inline-block;
  padding: 0 12px 2px;
  background: var(--signal-yellow);
  color: #090D14;
}

.overview-subtitle {
  margin: 0 0 34px;
  max-width: 650px;
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.overview-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 42px;
}

.install-bar {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  height: 38px;
  padding: 0 6px 0 14px;
  background: var(--bg-code);
  border: 1px solid var(--border-strong);
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.install-bar code {
  color: var(--text-primary);
  font-variant-ligatures: none;
}

.install-bar code span {
  color: var(--signal-yellow);
  margin-right: 8px;
}

/* Lyber-style bottom spec strip under Hero */
.hero-meta-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-hair);
  font-family: var(--font-mono);
}

.hms-item span {
  display: block;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.hms-item strong {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

/* Architectural 4-Cell Feature Matrix */
.pillars-section {
  padding: 68px 0;
  border-bottom: 1px solid var(--border-hair);
}

.section-kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--signal-yellow);
  text-transform: uppercase;
}

.section-h2 {
  margin: 10px 0 12px;
  font-family: var(--font-display);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.section-lead {
  margin: 0 0 34px;
  max-width: 640px;
  font-size: 15px;
  color: var(--text-secondary);
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--border-hair);
  border-radius: 12px;
  background: var(--bg-surface);
  overflow: hidden;
}

.pillar-cell {
  padding: 28px 30px;
  border-right: 1px solid var(--border-hair);
  border-bottom: 1px solid var(--border-hair);
  transition: background-color 140ms;
}

.pillar-cell:nth-child(2n) { border-right: none; }
.pillar-cell:nth-last-child(-n+2) { border-bottom: none; }
.pillar-cell:hover { background: var(--bg-surface-2); }

.pillar-index {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.pillar-cell h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.pillar-cell p {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* Spec & Trace Windows */
.spec-preview-section {
  padding: 68px 0 84px;
}

.dual-code-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 20px;
}

.code-window {
  background: var(--bg-code);
  border: 1px solid var(--border-hair);
  border-radius: 10px;
  overflow: hidden;
}

.code-window-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-hair);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.code-window-bar strong { color: var(--text-primary); font-weight: 600; }

.code-pre {
  margin: 0;
  padding: 18px 20px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.72;
  color: #CBD5E1;
  overflow-x: auto;
  font-variant-ligatures: none;
}

.tok-sec { color: var(--signal-yellow); font-weight: 700; }
.tok-key { color: #B8C7DE; }
.tok-str { color: var(--signal-teal); }
.tok-num { color: var(--signal-amber); }
.tok-com { color: #5C6B82; }
.tok-ok  { color: var(--signal-teal); font-weight: 700; }
.tok-wrn { color: var(--signal-yellow); font-weight: 700; }

/* ==========================================================================
   PAGE 2: 设计构想 (Serious Architecture + Embedded Physical Labs)
   ========================================================================== */
.page-header-band {
  padding: 64px 0 42px;
  border-bottom: 1px solid var(--border-hair);
}

.page-title {
  margin: 10px 0 12px;
  font-family: var(--font-display);
  font-size: clamp(32px, 3.8vw, 46px);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.page-desc {
  margin: 0;
  max-width: 680px;
  font-size: 15.5px;
  color: var(--text-secondary);
}

.design-block {
  padding: 56px 0;
  border-bottom: 1px solid var(--border-hair);
}

.lab-frame {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  overflow: hidden;
}

.bench-split { display: grid; grid-template-columns: 1fr 1fr; }
.bench-pane:first-child { border-right: 1px solid var(--border-hair); }

.bench-pane-head {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-hair);
  font-family: var(--font-mono);
  font-size: 11px;
}

.bp-title { display: flex; align-items: center; gap: 8px; }
.bp-pill { padding: 2px 7px; font-size: 10px; font-weight: 700; border: 1px solid; }
.bp-pill.is-bad { color: #F58A8A; border-color: rgba(201, 59, 59, 0.55); background: rgba(201, 59, 59, 0.14); }
.bp-pill.is-good { color: #7FD1BF; border-color: rgba(78, 159, 141, 0.55); background: rgba(78, 159, 141, 0.14); }

.bp-stats { display: flex; gap: 14px; color: var(--text-muted); }
.bp-stats b { color: var(--text-primary); margin-left: 4px; }

.bench-canvas-wrap { height: 330px; background: var(--bg-base); }
.bench-canvas-wrap canvas { width: 100%; height: 100%; }

.bench-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  background: var(--bg-code);
  border-top: 1px solid var(--border-hair);
}

.bench-knobs { display: flex; flex-wrap: wrap; gap: 24px; }
.bench-knob { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); }
.bench-knob b { color: var(--signal-yellow); min-width: 38px; display: inline-block; }

.knob-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 130px;
  height: 4px;
  background: #1F2B3E;
}

.knob-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 16px;
  background: var(--signal-yellow);
  border: 1px solid #090D14;
  cursor: ew-resize;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  background: var(--signal-crimson);
  border: 1px solid var(--signal-crimson);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
}

.btn-danger:hover { filter: brightness(1.1); }

/* Castes CAD Inspector */
.castes-grid { display: grid; grid-template-columns: 204px minmax(0, 1fr) 340px; }

.caste-vertical-list {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-hair);
  background: var(--bg-code);
}

.caste-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 16px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-hair);
  border-left: 3px solid transparent;
  text-align: left;
  color: var(--text-secondary);
}

.caste-tab:last-child { border-bottom: none; }
.caste-tab:hover { background: var(--bg-surface); color: var(--text-primary); }
.caste-tab.is-active { background: var(--bg-surface-2); border-left-color: var(--signal-yellow); color: var(--text-primary); }

.caste-tab-dot { width: 7px; height: 7px; flex-shrink: 0; }
.caste-tab-meta { display: flex; flex-direction: column; }
.caste-tab-code { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); }
.caste-tab.is-active .caste-tab-code { color: var(--signal-yellow); }
.caste-tab-name { font-size: 14px; font-weight: 600; }

.caste-stage-col { display: flex; flex-direction: column; border-right: 1px solid var(--border-hair); }
.caste-canvas-wrap { height: 410px; background: var(--bg-base); }
.caste-canvas-wrap canvas { width: 100%; height: 100%; }

.caste-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-code);
  border-top: 1px solid var(--border-hair);
}

.caste-bar-group { display: flex; gap: 6px; }

.caste-spec-col { padding: 20px; display: flex; flex-direction: column; gap: 14px; background: var(--bg-surface); }
.spec-top-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.spec-code { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.spec-badge { font-family: var(--font-mono); font-size: 10px; padding: 2px 7px; border: 1px solid; }
.spec-title { margin: 0; font-family: var(--font-display); font-size: 21px; }
.spec-summary { margin: 0; font-size: 13px; color: var(--text-secondary); }

.spec-kv-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--border-hair);
  border-bottom: 1px solid var(--border-hair);
  font-family: var(--font-mono);
}

.spec-kv-pair span { display: block; font-size: 9px; color: var(--text-muted); margin-bottom: 3px; }
.spec-kv-pair strong { font-size: 11px; color: var(--text-primary); }

.spec-bars { display: flex; flex-direction: column; gap: 8px; }
.spec-bar-head { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10px; color: var(--text-secondary); margin-bottom: 3px; }
.spec-bar-track { height: 4px; background: #1C273A; overflow: hidden; }
.spec-bar-fill { height: 100%; transition: width 240ms ease; }

.spec-terminal {
  margin-top: auto;
  padding: 10px 12px;
  background: var(--bg-code);
  border: 1px solid var(--border-hair);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #9FB4D1;
  line-height: 1.6;
}

/* Swarm Hunt Stage */
.hunt-steps { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--border-hair); background: var(--bg-code); }

.hunt-step {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  background: transparent;
  border: none;
  border-right: 1px solid var(--border-hair);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.hunt-step:last-child { border-right: none; }
.hunt-step:hover { color: var(--text-primary); background: var(--bg-surface); }
.hunt-step.is-active { color: var(--text-primary); background: var(--bg-surface-2); }

.hs-num { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.hunt-step.is-active .hs-num { color: var(--signal-yellow); }
.hs-line { position: absolute; left: 0; bottom: 0; height: 2px; width: 0%; background: var(--signal-yellow); }

.hunt-canvas-wrap { height: 420px; background: var(--bg-base); }
.hunt-canvas-wrap canvas { width: 100%; height: 100%; }

.hunt-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  background: var(--bg-code);
  border-top: 1px solid var(--border-hair);
  font-size: 13px;
  color: var(--text-secondary);
}

.hunt-foot-copy { display: flex; align-items: center; gap: 12px; }
.hunt-foot-copy strong { color: var(--text-primary); }

/* ==========================================================================
   PAGE 3: 文档 (Clean Zed/Factory Two-Column Docs)
   ========================================================================== */
.docs-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 48px;
  padding: 48px 0 88px;
}

.docs-sidebar { position: sticky; top: 84px; align-self: start; display: flex; flex-direction: column; gap: 22px; }

.docs-group-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.docs-nav-list { display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--border-hair); }

.docs-nav-btn {
  padding: 7px 14px;
  background: transparent;
  border: none;
  border-left: 2px solid transparent;
  margin-left: -1px;
  text-align: left;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.docs-nav-btn:hover { color: var(--text-primary); }
.docs-nav-btn.is-active {
  color: var(--signal-yellow);
  border-left-color: var(--signal-yellow);
  background: rgba(242, 183, 5, 0.06);
  font-weight: 600;
}

.docs-article { min-width: 0; }
.doc-pane { display: none; }
.doc-pane.is-active { display: block; }
.doc-pane h1 { margin: 0 0 12px; font-family: var(--font-display); font-size: 32px; letter-spacing: -0.025em; }
.doc-pane .doc-intro { margin: 0 0 28px; font-size: 15.5px; color: var(--text-secondary); }
.doc-pane h2 { margin: 32px 0 12px; padding-top: 20px; border-top: 1px solid var(--border-hair); font-family: var(--font-display); font-size: 20px; }
.doc-pane p { font-size: 14.5px; color: var(--text-secondary); }

.doc-table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 13px; border: 1px solid var(--border-strong); }
.doc-table th, .doc-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border-hair); }
.doc-table th { background: var(--bg-surface); font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; }
.doc-table td code { font-family: var(--font-mono); font-size: 12px; color: var(--signal-yellow); }

/* ==========================================================================
   PAGE 4: 社群 (Open-Source Community)
   ========================================================================== */
.community-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding: 48px 0; }

.community-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 26px 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hair);
  transition: border-color 140ms, background-color 140ms;
}

.community-card:hover { border-color: var(--signal-yellow); background: var(--bg-surface-2); }
.cc-meta { display: flex; align-items: center; justify-content: space-between; font-family: var(--font-mono); font-size: 10.5px; color: var(--signal-yellow); }
.community-card h3 { margin: 8px 0 6px; font-family: var(--font-display); font-size: 20px; }
.community-card p { margin: 0; font-size: 14px; color: var(--text-secondary); }
.cc-link { font-family: var(--font-mono); font-size: 12px; color: var(--text-primary); }

.rfc-band {
  margin-bottom: 84px;
  padding: 26px 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--signal-yellow);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.rfc-band h3 { margin: 0 0 6px; font-family: var(--font-display); font-size: 20px; }
.rfc-band p { margin: 0; font-size: 14px; color: var(--text-secondary); }

/* ==========================================================================
   Footer & CLI Popover
   ========================================================================== */
.site-footer { border-top: 1px solid var(--border-hair); padding: 28px 0 36px; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.footer-links { display: flex; gap: 20px; }
.footer-links button { padding: 0; background: none; border: none; color: var(--text-muted); font-family: var(--font-mono); font-size: 11px; }
.footer-links button:hover { color: var(--signal-yellow); }

.cli-modal {
  position: fixed;
  top: 66px;
  right: 24px;
  z-index: 90;
  width: 400px;
  padding: 16px;
  background: #0D1420;
  border: 1px solid var(--signal-yellow);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.72);
}

.cli-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--signal-yellow);
}

@media (max-width: 1024px) {
  .pillars-grid, .dual-code-grid, .bench-split, .castes-grid, .docs-shell, .community-grid, .hero-meta-strip {
    grid-template-columns: 1fr;
  }
  .caste-vertical-list { flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border-hair); }
  .docs-sidebar { position: static; }
  .nav-kbd, .brand-ver { display: none; }
  .pillars-grid .pillar-cell { border-right: 0; border-bottom: 1px solid var(--border-hair); }
  .pillars-grid .pillar-cell:last-child { border-bottom: 0; }
}
