/* ============================================================
   Pipeway — 单色工程图纸
   字体：Archivo / IBM Plex Mono / 系统中文黑体
   颜色：只用墨黑、纸白与灰阶；强调靠反色
   ============================================================ */

/* 字体在 fonts.css（已内联 base64，file:// 直接打开也能加载） */

:root {
  --ink: #0b0b0b;
  --paper: #ffffff;
  --graphite: #4a4a4a;
  --ash: #6f6f6f;
  --hair: #e2e2e2;
  --hair-soft: #f0f0f0;
  --fog: #f6f6f6;
  --on-dark: #f4f4f4;
  --on-dark-mute: #a8a8a8;
  --on-dark-line: #2a2a2a;

  --sans: "Archivo", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC",
    "Source Han Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas,
    "Liberation Mono", monospace;

  --max: 1240px;
  --pad: clamp(20px, 4vw, 40px);
  --header-h: 68px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button { font-family: inherit; }
svg { display: block; }
img { max-width: 100%; }
[hidden] { display: none !important; }

::selection { background: var(--ink); color: var(--paper); }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
.band-dark :focus-visible { outline-color: var(--paper); }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--fog);
  border: 1px solid var(--hair);
  padding: 1px 4px;
  white-space: nowrap;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: fixed;
  top: 10px; left: 10px;
  z-index: 200;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}
.skip:focus { transform: none; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

section[id] { scroll-margin-top: calc(var(--header-h) + 16px); }

/* ============================================================
   Header
   ============================================================ */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hair);
  transition: background 0.25s var(--ease);
}
.site-header.is-scrolled { background: rgba(255, 255, 255, 0.98); }

.header-inner {
  height: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex: 0 0 auto;
}
.brand-mark {
  width: 27px; height: 27px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  border-radius: 6px;
}
.brand-mark svg { width: 17px; height: 17px; }
.brand-mark--sm { width: 20px; height: 20px; border-radius: 4px; background: #fff; color: #0b0b0b; }
.brand-mark--sm svg { width: 13px; height: 13px; }
.brand-name {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 26px;
}
.nav a {
  position: relative;
  padding: 4px 0;
  font-size: 13.5px;
  color: var(--graphite);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.nav a:hover,
.nav a.is-active { color: var(--ink); }
.nav a:hover::after,
.nav a.is-active::after { transform: scaleX(1); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}
.lang-switch {
  display: flex;
  align-items: stretch;
  height: 30px;
  border: 1px solid var(--hair);
  flex: 0 0 auto;
}
.lang-switch button {
  appearance: none;
  width: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ash);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.lang-switch button + button { border-left: 1px solid var(--hair); }
.lang-switch button:hover { color: var(--ink); }
.lang-switch button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}
.header-gh {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--graphite);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.header-gh svg { width: 15px; height: 15px; }
.header-gh:hover { color: var(--ink); }

.nav-toggle {
  display: none;
  width: 38px; height: 38px;
  border: 1px solid var(--hair);
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-toggle-lines {
  display: block;
  width: 16px;
  position: relative;
}
.nav-toggle-lines i {
  display: block;
  height: 1px;
  background: var(--ink);
  transition: transform 0.25s var(--ease);
}
.nav-toggle-lines i + i { margin-top: 6px; }
.nav-toggle[aria-expanded="true"] i:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] i:last-child { transform: translateY(-3.5px) rotate(-45deg); }

.mobile-nav {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
  padding: 8px var(--pad) 28px;
  overflow-y: auto;
  z-index: 99;
}
body.menu-open { overflow: hidden; }
.mobile-nav a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--hair);
  font-size: 16px;
  text-decoration: none;
}
.mobile-nav a:last-of-type { border-bottom: 0; }
.mobile-nav a span { font-family: var(--mono); font-size: 12px; color: var(--ash); }
.mobile-nav-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--hair);
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ash);
}

/* ============================================================
   Buttons / links
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 44px;
  padding: 0 20px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn svg { width: 15px; height: 15px; flex: 0 0 auto; }
.btn--solid { background: var(--ink); color: var(--paper); }
.btn--solid:hover { background: #2c2c2c; border-color: #2c2c2c; }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.btn--sm { height: 36px; padding: 0 15px; font-size: 12.5px; }
.btn--lg { height: 52px; padding: 0 22px; font-size: 14px; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  transition: opacity 0.2s var(--ease);
}
.text-link svg { width: 11px; height: 11px; }
.text-link:hover { opacity: 0.55; }

/* ============================================================
   Hero
   ============================================================ */

.hero {
  position: relative;
  padding-top: calc(var(--header-h) + clamp(48px, 7vw, 88px));
  padding-bottom: clamp(48px, 7vw, 84px);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, var(--hair-soft) 1px, transparent 1px),
    linear-gradient(var(--hair-soft) 1px, transparent 1px);
  background-size: 88px 88px;
  opacity: 0.75;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 82%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 82%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  gap: clamp(36px, 5vw, 72px);
  align-items: center;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--graphite);
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  flex: 0 0 auto;
}
.eyebrow .live-dot { margin-left: -2px; }

.live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink);
  position: relative;
  flex: 0 0 auto;
}
.live-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  opacity: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .live-dot::after { animation: ping 2.8s var(--ease) infinite; }
}
.live-dot--dark { background: var(--ink); }
@keyframes ping {
  0% { transform: scale(0.6); opacity: 0.7; }
  70% { transform: scale(1.5); opacity: 0; }
  100% { opacity: 0; }
}

.hero-copy { max-width: 620px; }

.hero h1 {
  margin: 22px 0 0;
  font-size: clamp(44px, 6.2vw, 84px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.045em;
}
.hero h1 span { display: block; white-space: nowrap; }
.hero h1 .h1-indent { padding-left: 0.38em; }

.hero-sub {
  max-width: 34em;
  margin-top: 28px;
  font-size: 16px;
  line-height: 1.85;
  color: var(--graphite);
}
.hero-sub code { background: var(--paper); }

.cta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}
.cta-row .text-link { margin-left: 8px; }

.cta-note {
  margin-top: 14px;
  font-size: 12px;
  color: var(--ash);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--hair);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--graphite);
}
.hero-meta li { display: flex; align-items: center; }
.hero-meta li + li::before {
  content: "/";
  margin: 0 12px;
  color: #c4c4c4;
}

/* ---- 首屏示意图 ---- */

.schematic {
  border: 1px solid var(--ink);
  background: var(--paper);
  min-width: 0;
}
.schematic-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--hair);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--graphite);
}
.schematic-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}
.schematic-canvas { padding: 4px 4px 0; }
.schematic-canvas svg { width: 100%; height: auto; }
.schematic-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid var(--hair);
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ash);
}

.flow { opacity: 0.9; }
@media (prefers-reduced-motion: no-preference) {
  .flow {
    stroke-dasharray: 2 10;
    animation: flow 2.4s linear infinite;
  }
  @keyframes flow {
    to { stroke-dashoffset: -24; }
  }
}

/* ============================================================
   数字条
   ============================================================ */

.stats {
  background: var(--ink);
  color: var(--paper);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.stat {
  padding: 34px clamp(16px, 2.6vw, 34px) 36px;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}
.stat:first-child { border-left: 0; padding-left: 0; }
.stat-num {
  font-family: var(--sans);
  font-size: clamp(44px, 4.6vw, 62px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  margin-top: 10px;
  font-size: 13.5px;
  font-weight: 600;
}
.stat-desc {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 10px;
  color: #9a9a9a;
}

/* ============================================================
   Section 通用
   ============================================================ */

.section {
  padding: clamp(72px, 9vw, 120px) 0;
  border-top: 1px solid var(--hair);
}

.sec-head {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: clamp(20px, 4vw, 52px);
  margin-bottom: clamp(42px, 6vw, 72px);
}
.sec-aside { padding-top: 8px; }
.sec-main h2 {
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.14;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.sec-main .lede {
  max-width: 36em;
  margin-top: 22px;
  font-size: 16px;
  line-height: 1.85;
  color: var(--graphite);
  text-wrap: pretty;
}
.sec-main .lede code { background: var(--paper); }

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.feature--rev .feature-copy { order: 1; }
.feature--rev .figure { order: 2; }

.figure {
  border: 1px solid var(--ink);
  background: var(--paper);
  min-width: 0;
}
.figure-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--hair);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ash);
}
.figure-body { padding: clamp(20px, 3vw, 28px); }
.figure-foot {
  border-top: 1px solid var(--hair);
  padding: 10px 16px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ash);
}
.figure-sub {
  margin-top: 8px;
  font-size: 12px;
  color: var(--ash);
}

/* ---- 压缩图形 ---- */

.bignum {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--sans);
  font-size: clamp(34px, 4.2vw, 48px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}
.bignum .to { color: #c4c4c4; font-weight: 400; }
.bignum .delta {
  align-self: center;
  margin-left: 2px;
  padding: 3px 6px;
  border: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0;
}

.bar-row { margin-top: 20px; }
.bar-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ash);
}
.bar {
  height: 14px;
  background: var(--fog);
  border: 1px solid var(--hair);
}
.bar i {
  display: block;
  height: 100%;
  width: var(--w);
  background: var(--fill, var(--ink));
}

.saved-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--graphite);
}
.saved-swatch {
  width: 22px;
  height: 8px;
  background: repeating-linear-gradient(45deg, var(--ink) 0 1px, transparent 1px 4px);
  border: 1px solid var(--hair);
  flex: 0 0 auto;
}

.log {
  margin: 22px 0 0;
  padding: 14px;
  border: 1px solid var(--hair);
  background: var(--fog);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.9;
  color: var(--graphite);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---- 层列表 ---- */

.layers { border-top: 1px solid var(--ink); }
.layer {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  padding: 19px 0 20px;
  border-bottom: 1px solid var(--hair);
}
.layer-code {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--ash);
  padding-top: 3px;
}
.layer h3 {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.4;
}
.layer h3 em {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 400;
  font-style: normal;
  color: var(--ash);
}
.layer p {
  margin-top: 6px;
  font-size: 13.5px;
  line-height: 1.78;
  color: var(--graphite);
}
.guardrail {
  margin-top: 22px;
  padding: 14px 0 0;
  border-top: 1px solid var(--ink);
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--graphite);
}
.guardrail strong {
  display: inline-block;
  margin-right: 6px;
  color: var(--ink);
  font-weight: 600;
}

/* ---- 缓存图形 ---- */

.msg-groups {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 8px;
}
.msg-group {
  border-top: 1px solid var(--ink);
  padding-top: 5px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--graphite);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.g5 { grid-column: span 5; }
.g2 { grid-column: span 2; }
.g3 { grid-column: span 3; }

.msgs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 5px;
}
.msg {
  display: block;
  height: 84px;
  border: 1px solid var(--ink);
}
.msg--frozen { background: var(--ink); }
.msg--sealed {
  background: repeating-linear-gradient(45deg, var(--ink) 0 1px, transparent 1px 4px);
}
.msg--new {
  border-style: dashed;
  border-color: #9a9a9a;
  background: var(--paper);
}
.breakline {
  position: absolute;
  top: -6px;
  bottom: -6px;
  left: calc(70% - 2px);
  border-left: 1px dashed var(--ash);
  pointer-events: none;
}
.breakline span {
  position: absolute;
  top: 100%;
  left: 4px;
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 8.5px;
  color: var(--ash);
  white-space: nowrap;
}
.msg-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 6px;
  border-top: 1px solid var(--hair);
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ash);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 18px;
  font-size: 11px;
  color: var(--graphite);
}
.legend li { display: flex; align-items: center; gap: 7px; }
.legend i {
  width: 11px; height: 11px;
  border: 1px solid var(--ink);
  flex: 0 0 auto;
}
.sw-frozen { background: var(--ink); }
.sw-sealed { background: repeating-linear-gradient(45deg, var(--ink) 0 1px, transparent 1px 4px); }
.sw-new { border-style: dashed !important; border-color: var(--ash) !important; }

.note {
  margin-top: 24px;
  padding: 14px 0 0 16px;
  border-left: 2px solid var(--ink);
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--graphite);
}
.note-label {
  display: block;
  margin-bottom: 3px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ash);
}

/* ---- 要点列表 ---- */

.points { border-top: 1px solid var(--ink); }
.points li {
  padding: 18px 0 20px;
  border-bottom: 1px solid var(--hair);
}
.points h3 {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.4;
}
.points p {
  margin-top: 6px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--graphite);
}

/* ============================================================
   协议表格 + 代码
   ============================================================ */

.protocol-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(28px, 4vw, 48px);
  align-items: start;
}

.table-wrap {
  border-top: 1px solid var(--ink);
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}
th {
  padding: 10px 14px 10px 0;
  border-bottom: 1px solid var(--hair);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 400;
  color: var(--ash);
  white-space: nowrap;
}
td {
  padding: 15px 14px 15px 0;
  border-bottom: 1px solid var(--hair);
  vertical-align: top;
  line-height: 1.7;
  color: var(--graphite);
}
td:first-child { white-space: nowrap; }
td code { font-size: 10.5px; color: var(--ink); }
th:last-child, td:last-child { padding-right: 0; }

.table-note {
  margin-top: 18px;
  padding-left: 14px;
  border-left: 2px solid var(--ink);
  font-size: 12px;
  line-height: 1.8;
  color: var(--graphite);
}

.code-panel {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #ededed;
  min-width: 0;
}
.code-bar {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid #2a2a2a;
}
.code-tabs {
  display: flex;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.code-tabs::-webkit-scrollbar { display: none; }
.code-tabs button {
  appearance: none;
  border: 0;
  border-right: 1px solid #2a2a2a;
  background: transparent;
  color: #8a8a8a;
  padding: 12px 13px;
  font-family: var(--mono);
  font-size: 10px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.code-tabs button:hover { color: #fff; }
.code-tabs button[aria-selected="true"] {
  background: #1a1a1a;
  color: #fff;
  box-shadow: inset 0 -1px 0 #fff;
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 13px;
  border: 0;
  background: transparent;
  color: #a8a8a8;
  font-family: var(--mono);
  font-size: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s var(--ease);
}
.copy-btn:hover { color: #fff; }
.copy-btn svg { width: 12px; height: 12px; }

.code-panel pre {
  margin: 0;
  padding: 22px 20px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.95;
  color: #e8e8e8;
  tab-size: 2;
}
.code-panel pre code {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  white-space: pre;
}
.tok-c { color: #7f7f7f; }
.tok-s { color: #d6d6d6; }
.tok-k { color: #ffffff; font-weight: 500; }
.code-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-top: 1px solid #2a2a2a;
  font-family: var(--mono);
  font-size: 9px;
  color: #8a8a8a;
}
.code-foot code {
  background: #1a1a1a;
  border-color: #333;
  color: #c8c8c8;
}

/* ============================================================
   供应商切换示意
   ============================================================ */

.switchboard-wrap { min-width: 0; }
.switchboard { border: 1px solid var(--ink); }
.sb-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 15px;
  border-bottom: 1px solid var(--hair);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ash);
}
.sb-head span:last-child { color: var(--ink); }
.sb-list { display: flex; flex-direction: column; }
.sb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 15px;
  border: 0;
  border-bottom: 1px solid var(--hair);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.sb-row:hover { background: var(--fog); }
.sb-row.is-active { background: var(--ink); color: var(--paper); }
.sb-row.is-active:hover { background: #1e1e1e; }
.sb-dot {
  width: 8px; height: 8px;
  border: 1px solid currentColor;
  border-radius: 50%;
  flex: 0 0 auto;
}
.sb-row.is-active .sb-dot { background: #fff; border-color: #fff; }
.sb-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
}
.sb-name small {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
  color: var(--ash);
}
.sb-row.is-active .sb-name small { color: #a8a8a8; }
.sb-tag {
  margin-left: auto;
  flex: 0 0 auto;
  padding: 2px 5px;
  border: 1px solid var(--hair);
  font-family: var(--mono);
  font-size: 8px;
  color: var(--ash);
}
.sb-row.is-active .sb-tag { border-color: #555; color: #d8d8d8; }
.sb-override {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  border-bottom: 1px solid var(--hair);
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--graphite);
}
.sb-arrow { color: var(--ash); }
.sb-override .sb-tag { margin-left: auto; }
.sb-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 15px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ash);
}
.sb-foot code { background: var(--paper); color: var(--graphite); font-size: 9px; }
.sb-foot #sbResult { color: var(--ink); }
.figure-caption {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ash);
}

/* ============================================================
   Agent
   ============================================================ */

.agents { border-top: 1px solid var(--ink); }
.agent {
  display: grid;
  grid-template-columns: minmax(140px, 190px) minmax(0, 1fr) auto;
  gap: 24px;
  align-items: baseline;
  padding: 15px 0;
  border-bottom: 1px solid var(--hair);
}
.agent--head {
  padding: 9px 0;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ash);
  border-bottom-color: var(--hair);
}
.agent-name { font-size: 15px; font-weight: 600; }
.agent-what {
  font-size: 12.5px;
  color: var(--graphite);
}
.agent-path {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--graphite);
  text-align: right;
  overflow-wrap: anywhere;
}
.agents-note {
  max-width: 72em;
  margin-top: 20px;
  padding-left: 14px;
  border-left: 2px solid var(--ink);
  font-size: 12px;
  line-height: 1.8;
  color: var(--graphite);
}

/* ============================================================
   深色区块 / 仪表盘
   ============================================================ */

.band-dark {
  background: var(--ink);
  color: var(--on-dark);
  border-top-color: #222;
}
.band-dark .eyebrow { color: #a3a3a3; }
.band-dark .sec-main h2 { color: #fff; }
.band-dark .sec-main .lede { color: var(--on-dark-mute); }
.band-dark code {
  background: #1a1a1a;
  border-color: #333;
  color: #e6e6e6;
}

.dash {
  border: 1px solid var(--on-dark-line);
  background: #0e0e0e;
  font-variant-numeric: tabular-nums;
}
.dash-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  padding: 11px 16px;
  border-bottom: 1px solid var(--on-dark-line);
  font-family: var(--mono);
  font-size: 9.5px;
  color: #8a8a8a;
}
.dash-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}
.dash-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--on-dark-line);
}
.dash-kpi {
  padding: 16px 18px 18px;
  border-left: 1px solid var(--on-dark-line);
}
.dash-kpi:first-child { border-left: 0; }
.dkp-label {
  font-family: var(--mono);
  font-size: 9px;
  color: #8a8a8a;
}
.dkp-value {
  margin-top: 6px;
  font-size: clamp(19px, 2.2vw, 25px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #fff;
}
.dkp-sub {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 8.5px;
  color: #8a8a8a;
}
.dash-body {
  display: grid;
  grid-template-columns: minmax(0, 2.15fr) minmax(220px, 1fr);
}
.dash-chart {
  padding: 16px 18px 10px;
  border-right: 1px solid var(--on-dark-line);
  min-width: 0;
}
.dash-chart-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-family: var(--mono);
  font-size: 9px;
  color: #8a8a8a;
}
.dash-legend { display: inline-flex; align-items: center; gap: 6px; }
.dash-legend i { display: inline-block; width: 14px; height: 1px; margin-left: 8px; }
.dl-solid { background: #fff; }
.dl-dash { background: repeating-linear-gradient(90deg, #8a8a8a 0 3px, transparent 3px 6px); }
.dash-chart svg { width: 100%; height: auto; }

.dash-side { padding: 16px 18px 18px; }
.dash-side-title {
  font-family: var(--mono);
  font-size: 9px;
  color: #8a8a8a;
  margin-bottom: 12px;
}
.proto-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 9px;
  color: #c8c8c8;
}
.proto-row > span:last-child { text-align: right; color: #8a8a8a; }
.proto-bar { display: block; height: 5px; background: #222; }
.proto-bar i { display: block; height: 100%; width: var(--w); background: #fff; }
.dash-side-foot {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--on-dark-line);
}
.dash-side-foot div { display: flex; flex-direction: column; gap: 2px; }
.dash-side-foot span { font-family: var(--mono); font-size: 8px; color: #8a8a8a; }
.dash-side-foot b { font-size: 13px; font-weight: 500; color: #fff; }
.dash-caption {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: #8a8a8a;
}
.dash-notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--on-dark-line);
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--on-dark-mute);
}
.dash-notes span {
  display: block;
  margin-bottom: 3px;
  font-family: var(--mono);
  font-size: 9px;
  color: #8a8a8a;
}

/* ============================================================
   工程细节
   ============================================================ */

.details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
}
.detail {
  padding: 22px 26px 30px;
  border-top: 1px solid var(--hair);
}
.detail:nth-child(3n + 1) { padding-left: 0; border-left: 0; }
.detail:not(:nth-child(3n + 1)) { border-left: 1px solid var(--hair); }
.detail:nth-child(-n + 3) { border-top: 0; }
.detail h3 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}
.detail p {
  margin-top: 7px;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--graphite);
}
.detail code { font-size: 10.5px; }

/* ============================================================
   下载
   ============================================================ */

.dl-section { padding-bottom: clamp(72px, 9vw, 120px); }
.dl-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: start;
}
.dl-copy h2 {
  margin-top: 18px;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.06;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #fff;
}
.dl-copy .lede {
  max-width: 32em;
  margin-top: 20px;
  font-size: 15px;
  line-height: 1.85;
  color: var(--on-dark-mute);
}
.dl-links { margin-top: 32px; display: flex; flex-direction: column; gap: 10px; }
.dl-tile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  padding: 15px 18px;
  border: 1px solid #3a3a3a;
  color: #fff;
  text-decoration: none;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.dl-tile:hover { border-color: #fff; background: #151515; }
.dl-tile > svg { width: 21px; height: 21px; }
.dl-tile--primary {
  background: #fff;
  border-color: #fff;
  color: var(--ink);
}
.dl-tile--primary:hover { background: #e8e8e8; border-color: #e8e8e8; }
.dl-tile b { display: block; font-size: 15px; font-weight: 600; line-height: 1.4; }
.dl-tile small {
  display: block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 9px;
  color: #9a9a9a;
}
.dl-tile--primary small { color: #666; }
.dl-arrow { font-family: var(--mono); font-size: 17px; line-height: 1; }
.dl-gh {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 8px;
  padding: 13px 0;
  border-top: 1px solid #333;
  border-bottom: 1px solid #333;
  color: #d6d6d6;
  font-size: 12.5px;
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.dl-gh:hover { color: #fff; }
.dl-gh > svg:first-child { width: 15px; height: 15px; flex: 0 0 auto; }
.dl-gh .ext { width: 11px; height: 11px; margin-left: auto; color: #8a8a8a; }

.dl-steps { padding-top: 8px; }
.dl-steps-title {
  font-family: var(--mono);
  font-size: 10px;
  color: #8a8a8a;
  padding-bottom: 10px;
}
.steps { border-top: 1px solid #3a3a3a; }
.step {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 12px;
  padding: 16px 0 17px;
  border-bottom: 1px solid #2a2a2a;
}
.step-num {
  font-family: var(--mono);
  font-size: 9.5px;
  color: #8a8a8a;
  padding-top: 4px;
}
.step p {
  font-size: 13px;
  line-height: 1.75;
  color: #d0d0d0;
}
.step code {
  background: #1a1a1a;
  border-color: #333;
  color: #ededed;
}
.dl-fine {
  margin-top: 18px;
  font-size: 11.5px;
  line-height: 1.8;
  color: #7f7f7f;
}
.dl-fine code { background: #1a1a1a; border-color: #333; color: #c8c8c8; }

.dl-spec {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 26px;
  padding-top: 14px;
  border-top: 1px solid #333;
}
.dl-spec div { display: flex; flex-direction: column; gap: 2px; }
.dl-spec span {
  font-family: var(--mono);
  font-size: 8.5px;
  color: #7f7f7f;
}
.dl-spec b {
  font-size: 12px;
  font-weight: 500;
  color: #ededed;
}
.dl-proxy {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #2a2a2a;
  font-size: 11px;
  line-height: 1.8;
  color: #8a8a8a;
}
.dl-proxy code { background: #1a1a1a; border-color: #333; color: #d0d0d0; }

/* ============================================================
   Footer
   ============================================================ */

.footer {
  border-top: 1px solid var(--hair);
  padding: clamp(42px, 6vw, 64px) 0 26px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 32px;
}
.footer-brand p {
  margin-top: 14px;
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--graphite);
}
.footer-col h3 {
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
  color: var(--ash);
}
.footer-col a {
  display: block;
  padding: 4px 0;
  font-size: 12.5px;
  color: var(--graphite);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.footer-col a:hover { color: var(--ink); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
  margin-top: clamp(32px, 5vw, 52px);
  padding-top: 16px;
  border-top: 1px solid var(--hair);
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ash);
}

/* ============================================================
   Toast
   ============================================================ */

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 150;
  max-width: calc(100vw - 40px);
  padding: 11px 16px;
  background: var(--ink);
  border: 1px solid #3a3a3a;
  color: #fff;
  font-size: 12.5px;
  line-height: 1.6;
  opacity: 0;
  transform: translate(-50%, 14px);
  pointer-events: none;
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================
   Reveal
   ============================================================ */

.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}
.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1120px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr); gap: 36px; }
  .hero h1 { font-size: clamp(44px, 6.4vw, 76px); }
  .header-inner { gap: 20px; }
  .nav { gap: 20px; }
}

@media (max-width: 980px) {
  .nav { display: none; }
  .header-actions { margin-left: auto; gap: 14px; }
  .nav-toggle { display: inline-flex; }
  .header-gh span { display: none; }
  .header-gh svg { width: 17px; height: 17px; }

  .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .hero-copy { max-width: 680px; }
  .hero h1 { font-size: clamp(48px, 8.2vw, 74px); }
  .schematic { max-width: 620px; width: 100%; }

  .sec-head { grid-template-columns: 140px minmax(0, 1fr); }
  .feature { gap: 40px; }
  .protocol-grid { grid-template-columns: minmax(0, 1fr); }
  .code-panel { position: static; }
  .dl-grid { grid-template-columns: minmax(0, 1fr); gap: 42px; }
  .dl-steps { max-width: 680px; }
}

@media (max-width: 820px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 26px 14px 28px; }
  .stat:nth-child(odd) { border-left: 0; padding-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid rgba(255, 255, 255, 0.14); }

  .sec-head { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .sec-aside { padding-top: 0; }
  .feature,
  .feature--rev { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .feature--rev .feature-copy { order: 1; }
  .feature--rev .figure { order: 2; }
  .figure { max-width: 620px; }

  .details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail { padding: 20px 22px 26px; border-left: 0; }
  .detail:nth-child(2n + 1) { padding-left: 0; border-left: 0; }
  .detail:nth-child(2n) { border-left: 1px solid var(--hair); }
  .detail:nth-child(-n + 3) { border-top: 1px solid var(--hair); }
  .detail:nth-child(-n + 2) { border-top: 0; }

  .dash-body { grid-template-columns: minmax(0, 1fr); }
  .dash-chart { border-right: 0; border-bottom: 1px solid var(--on-dark-line); }
  .dash-notes { grid-template-columns: minmax(0, 1fr); gap: 12px; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  body { font-size: 15px; }
  :root { --header-h: 62px; }

  .header-actions { gap: 10px; }
  .header-gh { display: none; }
  .lang-switch { height: 28px; }
  .lang-switch button { width: 26px; }

  .hero { padding-top: calc(var(--header-h) + 40px); }
  .hero h1 { font-size: clamp(42px, 12vw, 64px); letter-spacing: -0.035em; }
  .hero h1 .h1-indent { padding-left: 0.3em; }
  .hero-sub { font-size: 14.5px; margin-top: 22px; }
  .cta-row { gap: 10px; margin-top: 28px; }
  .cta-row .btn { flex: 1 1 calc(50% - 5px); padding: 0 12px; font-size: 13px; }
  .cta-row .text-link { flex: 0 0 auto; margin-left: 0; margin-top: 6px; }
  .hero-meta { margin-top: 30px; font-size: 9.5px; flex-direction: column; gap: 3px; }
  .hero-meta li + li::before { display: none; }
  .hero-meta li { padding: 1px 0; }

  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-num { font-size: 42px; }
  .stat-label { font-size: 12.5px; }
  .stat-desc { font-size: 8.5px; }

  .section { padding: 62px 0; }
  .sec-main h2 { font-size: clamp(28px, 8vw, 38px); }
  .sec-main .lede { font-size: 14.5px; margin-top: 16px; }
  .sec-head { margin-bottom: 34px; }

  .bignum { font-size: 32px; gap: 8px; }
  .bignum .delta { font-size: 9.5px; }
  .figure-body { padding: 18px; }
  .layer { grid-template-columns: 32px minmax(0, 1fr); gap: 10px; }
  .layer p, .points p { font-size: 13px; }
  .log { font-size: 9.5px; }
  .msg { height: 62px; }
  .msg-group { font-size: 8px; }

  .protocol-grid { gap: 26px; }
  table { font-size: 12px; }
  td { padding: 12px 12px 12px 0; }
  td code { font-size: 9.5px; }
  .code-panel pre { padding: 18px 15px; font-size: 10.5px; }

  .agent { grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 13px 0; }
  .agent--head { display: none; }
  .agent-what { font-size: 12px; }
  .agent-path { text-align: left; }

  .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-kpi { padding: 13px 14px 15px; }
  .dash-kpi:nth-child(odd) { border-left: 0; }
  .dash-kpi:nth-child(n + 3) { border-top: 1px solid var(--on-dark-line); }
  .dkp-value { font-size: 19px; }
  .dash-bar { font-size: 8.5px; }
  .dash-side { padding: 14px; }
  .dash-notes { margin-top: 24px; }

  .details { grid-template-columns: minmax(0, 1fr); }
  .detail { padding: 18px 0 22px; border-left: 0 !important; }
  .detail:nth-child(n) { border-top: 1px solid var(--hair); }
  .detail:first-child { border-top: 0; }

  .dl-copy h2 { font-size: clamp(34px, 10vw, 46px); }
  .dl-tile { padding: 13px 14px; gap: 12px; }
  .dl-tile b { font-size: 14px; }
  .dl-tile small { font-size: 8.5px; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-bottom { font-size: 9px; }
}

@media (max-width: 340px) {
  .header-actions > .btn { display: none; }
}

/* ---------- English typography ---------- */
html[lang="en"] .hero h1 {
  font-size: clamp(36px, 5.2vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.05em;
}
html[lang="en"] .hero h1 .h1-indent { padding-left: 0.16em; }
html[lang="en"] .hero-sub { max-width: 36em; }
html[lang="en"] .sb-override { flex-wrap: wrap; }

@media (max-width: 980px) {
  html[lang="en"] .hero h1 { font-size: clamp(44px, 7.4vw, 66px); }
}
@media (max-width: 620px) {
  html[lang="en"] .hero h1 { font-size: clamp(36px, 8vw, 56px); letter-spacing: -0.045em; }
  html[lang="en"] .cta-row .btn { flex: 1 1 100%; }
  html[lang="en"] .cta-row .text-link { flex: 0 0 auto; margin-left: 0; margin-top: 6px; }
}
@media (max-width: 340px) {
  html[lang="en"] .hero h1 { font-size: 34px; }
}

@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;
  }
  .js .reveal { opacity: 1; transform: none; }
}
