/* ═══════════════════════════════════════════════════════════════
   pdf-inspector — 排印技术文档风格
   palette: 暖纸 / 墨 / 校对红 / 蓝图蓝
   type: Fraunces (display) · Instrument Sans (body) · IBM Plex Mono (code)
   ═══════════════════════════════════════════════════════════════ */

:root {
  --paper:        #f6f1e6;
  --paper-deep:   #ece3d1;
  --card:         #fbf8f0;
  --ink:          #201d17;
  --ink-soft:     #57503f;
  --ink-faint:    #8d8470;
  --red:          #c2342a;
  --red-deep:     #a12920;
  --blue:         #2e4f86;
  --blue-soft:    #3d6aac;
  --hair:         rgba(32, 29, 23, .16);
  --hair-strong:  rgba(32, 29, 23, .38);
  --serif: 'Fraunces', Georgia, 'Songti SC', 'Noto Serif SC', serif;
  --sans:  'Instrument Sans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --mono:  'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Consolas, 'Courier New', monospace;

  --ease-snap: cubic-bezier(.16, 1, .3, 1);
  --ease-out:  cubic-bezier(.7, 0, .84, 0);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--red); color: #fff; }

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--red); }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 28px; }

/* ── 纸面噪点 ─────────────────────────────── */
.noise {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  opacity: .05; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ═══════════════════════ NAV ═══════════════ */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(246, 241, 230, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hair-strong);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }

.brand { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-weight: 600; font-size: 14px; letter-spacing: .02em; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { width: 15px; height: 15px; background: var(--red); position: relative; }
.brand-mark::after { content: ''; position: absolute; inset: 3px; background: var(--paper); }
.brand-name { text-transform: lowercase; }

.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { font-family: var(--mono); font-size: 12.5px; letter-spacing: .04em; color: var(--ink-soft); }
.nav-links a:hover { color: var(--red); }
.nav-links .nav-gh { border: 1px solid var(--hair-strong); padding: 6px 12px; }
.nav-links .nav-gh:hover { border-color: var(--red); color: var(--red); }

.nav-toggle { display: none; background: none; border: 0; width: 40px; height: 40px; cursor: pointer; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--ink); margin: 5px auto; transition: transform .25s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

/* 顶部阅读进度条（红色细线） */
.progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: var(--red); z-index: 200; pointer-events: none;
}

/* ═══════════════════════ KICKER / HEAD ═══════════════════════ */
.kicker {
  font-family: var(--mono); font-size: 13px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--red);
}
.kicker::before { content: '◈ '; }

h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(30px, 4.4vw, 46px); line-height: 1.12; letter-spacing: -.01em; }
h2 em.cm { font-style: italic; color: var(--red); }
.h2-rule { max-width: 20ch; }
.h2-rule::after, .h2::after { content: ''; display: block; width: 72px; height: 2px; background: var(--ink); margin-top: 18px; }

.dim { color: var(--ink-soft); max-width: 56ch; }
.dim a { text-decoration: underline; text-underline-offset: 3px; }

.page { padding: 88px 0 64px; border-top: 1px solid var(--hair); position: relative; }
.page-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.page-no { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); letter-spacing: .1em; }

/* 分栏（左 sticky 元信息 + 右内容） */
.split { display: grid; grid-template-columns: 340px 1fr; gap: 72px; align-items: start; }
.split-2 { grid-template-columns: 400px 1fr; }
.split-meta { position: sticky; top: 100px; }
.split-meta h2.side { font-size: clamp(26px, 3vw, 34px); margin: 14px 0; }
.split-meta .page-no { margin-top: 34px; }
.split-meta .dim { margin-top: 14px; }

@media (max-width: 900px) {
  .split, .split-2 { grid-template-columns: 1fr; gap: 40px; }
  .split-meta { position: static; }
}

/* ═══════════════════════ HERO ═══════════════════════ */
.hero { padding: 96px 0 40px; position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(32,29,23,.05) 27px 28px),
    repeating-linear-gradient(90deg, transparent 0 27px, rgba(32,29,23,.05) 27px 28px);
  -webkit-mask-image: linear-gradient(120deg, rgba(0,0,0,.7), transparent 60%);
          mask-image: linear-gradient(120deg, rgba(0,0,0,.7), transparent 60%);
}
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 64px; align-items: center; position: relative; }

.hero-copy h1 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(40px, 6vw, 72px); line-height: 1.06; letter-spacing: -.02em;
  margin: 22px 0 26px;
}
.hl { font-style: italic; font-weight: 400; color: var(--red); }

.lead { font-size: 18px; color: var(--ink-soft); max-width: 52ch; }
.strike { text-decoration: line-through; text-decoration-color: var(--red); text-decoration-thickness: 3px; color: var(--red); }

.hero-cta { display: flex; gap: 14px; margin: 34px 0 22px; flex-wrap: wrap; }
.btn-solid, .btn-line {
  font-family: var(--mono); font-size: 14px; letter-spacing: .02em;
  padding: 14px 26px; transition: transform .18s var(--ease-snap), background .18s, border-color .18s, color .18s;
}
.btn-solid { background: var(--red); color: #fff; border: 1px solid var(--red); }
.btn-solid:hover { background: var(--red-deep); color: #fff; transform: translateY(-2px); }
.btn-line { border: 1px solid var(--hair-strong); color: var(--ink); }
.btn-line:hover { border-color: var(--ink); color: var(--red); transform: translateY(-2px); }

.imprint { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); letter-spacing: .04em; }
.imprint a { color: var(--blue); border-bottom: 1px solid var(--hair); }

.hero-footnote {
  margin-top: 40px; font-family: var(--mono); font-size: 12.5px;
  color: var(--ink-faint); border-top: 1px solid var(--hair); padding-top: 14px;
  max-width: 1160px;
}

/* 规格卡 */
.spec-card {
  background: var(--card); border: 1px solid var(--hair-strong);
  box-shadow: 10px 10px 0 rgba(32, 29, 23, .08);
  position: relative;
}
.spec-card::after { content: '¶'; position: absolute; top: 10px; right: 14px; font-family: var(--serif); font-size: 22px; color: var(--ink-faint); }
.spec-card-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 18px; border-bottom: 1px solid var(--hair);
  font-family: var(--mono); font-size: 11px; letter-spacing: .16em; color: var(--ink-faint);
}
.spec-tag { background: var(--ink); color: var(--paper); padding: 3px 8px; letter-spacing: .08em; }
.spec-rows { padding: 6px 0; }
.spec-row { display: flex; justify-content: space-between; padding: 13px 18px; border-bottom: 1px dashed var(--hair); }
.spec-row:last-child { border-bottom: 0; }
.spec-row dt { font-size: 13.5px; color: var(--ink-soft); }
.spec-row dd { font-family: var(--mono); font-size: 15px; font-weight: 600; }
.spec-foot { padding: 11px 18px; font-family: var(--mono); font-size: 11px; color: var(--ink-faint); border-top: 1px solid var(--hair); letter-spacing: .04em; }

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

/* ═══════════════════════ 特性规格表 ═══════════════════════ */
.spec-list { border-top: 2px solid var(--ink); }
.spec-item {
  display: grid; grid-template-columns: 56px 1fr; gap: 20px;
  padding: 26px 0 30px; border-bottom: 1px solid var(--hair);
  transition: padding-left .25s var(--ease-snap);
}
.spec-item:hover { padding-left: 12px; }
.spec-num { font-family: var(--mono); font-size: 13px; color: var(--ink-faint); letter-spacing: .06em; padding-top: 6px; }
.spec-item h3 { font-family: var(--serif); font-size: 23px; font-weight: 600; letter-spacing: -.01em; margin-bottom: 6px; }
.spec-item h3::after { content: ' ↳'; color: var(--red); opacity: 0; transition: opacity .2s; }
.spec-item:hover h3::after { opacity: 1; }
.spec-item p { color: var(--ink-soft); max-width: 60ch; font-size: 15px; }
.spec-item code { font-family: var(--mono); font-size: 13px; background: var(--paper-deep); padding: 1px 6px; }

/* ═══════════════════════ 表格 ═══════════════════════ */
.table-wrap { overflow-x: auto; margin-top: 34px; border-top: 2px solid var(--ink); }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
th {
  text-align: left; font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-faint); font-weight: 500;
  padding: 12px 16px; border-bottom: 1px solid var(--hair-strong); white-space: nowrap;
}
td { padding: 14px 16px; border-bottom: 1px solid var(--hair); white-space: nowrap; font-family: var(--mono); }
tbody tr { transition: background .18s; }
tbody tr:hover { background: rgba(46, 79, 134, .06); }
td.name { font-family: var(--sans); font-weight: 600; }
td.best { color: var(--red); font-weight: 700; position: relative; }
.winner-row { background: rgba(194, 52, 42, .04); }
.winner-row td.name { color: var(--red); }
.tag {
  display: inline-block; font-family: var(--mono); font-size: 10px; letter-spacing: .06em;
  background: var(--red); color: #fff; padding: 1px 7px; margin-left: 8px; vertical-align: 1px;
}

/* 注解（脚注） */
.note { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); margin-top: 18px; max-width: 90ch; line-height: 1.8; }
.note a { text-decoration: underline; text-underline-offset: 3px; color: var(--ink-faint); }
.note a:hover { color: var(--red); }

/* 编辑按 */
.editors-note {
  margin-top: 40px; border: 1px solid var(--hair-strong); border-left: 4px solid var(--red);
  padding: 20px 24px; background: var(--card);
  display: flex; gap: 16px; max-width: 860px;
}
.en-label { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; color: var(--red); white-space: nowrap; }
.editors-note p { font-size: 15px; color: var(--ink-soft); }

/* ═══════════════════════ 代码区 ═══════════════════════ */
.tabs { display: flex; gap: 6px; margin: 34px 0 0; flex-wrap: wrap; }
.tab {
  font-family: var(--mono); font-size: 13px; letter-spacing: .03em;
  padding: 10px 18px; background: none; border: 1px solid var(--hair);
  color: var(--ink-soft); cursor: pointer; transition: all .2s;
}
.tab:hover { border-color: var(--ink); color: var(--ink); }
.tab.active { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.code-panel { display: none; margin-top: 0; border-top: 2px solid var(--ink); }
.code-panel.on { display: block; animation: drop .3s var(--ease-snap); }
@keyframes drop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.code-head {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px; background: var(--paper-deep); border-bottom: 1px solid var(--hair);
  font-family: var(--mono); font-size: 12px; color: var(--ink-soft);
}
.code-head .dot { width: 9px; height: 9px; background: var(--red); border-radius: 50%; flex: none; }
.code-head .doc { width: 9px; height: 9px; border: 1.5px solid var(--ink-soft); flex: none; }
.code-head .about { margin-left: auto; color: var(--ink-faint); font-size: 11px; letter-spacing: .04em; }

.code-body {
  background: var(--card); padding: 22px 24px; overflow-x: auto;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.8;
}
.code-body code { font-family: var(--mono); }

/* 浅色代码语法色 */
.c  { color: var(--ink-faint); font-style: italic; }
.k  { color: #7d3c6b; font-weight: 600; }
.s  { color: var(--blue-soft); }
.f  { color: var(--red); }
.dim { color: var(--ink-faint); }

/* ═══════════════════════ 架构图 / 流程图 ═══════════════════════ */
.diagram { margin-top: 40px; }
.pipe {
  background: var(--card); border: 1px solid var(--hair-strong);
  padding: 28px 30px; overflow-x: auto;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.85; color: var(--ink-soft);
}
.pipe b { color: var(--ink); font-weight: 600; }
.pipe .red { color: var(--red); font-weight: 600; }
.pipe .dim { color: var(--ink-faint); }

/* ═══════════════════════ 使用场景块 ═══════════════════════ */
.stack { display: flex; flex-direction: column; gap: 44px; }
.block-kicker { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--blue); margin-bottom: 16px; }
.block { border-top: 1px solid var(--hair); padding-top: 22px; }

.steps { list-style: none; }
.steps li { display: flex; gap: 20px; padding: 15px 0; border-bottom: 1px solid var(--hair); font-size: 15px; color: var(--ink-soft); }
.steps .n { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); padding-top: 4px; flex: none; }
.steps code { font-family: var(--mono); font-size: 13px; background: var(--paper-deep); padding: 1px 6px; }

.table-scroll { overflow-x: auto; }
table.plain { min-width: 0; }
table.plain td { white-space: normal; font-family: var(--sans); font-size: 14px; color: var(--ink-soft); }
table.plain td.mono { font-family: var(--mono); font-size: 13px; }
table.two-col-t { min-width: 0; }
table.two-col-t td { font-family: var(--sans); }
table.two-col-t td:first-child { font-family: var(--mono); font-size: 13px; color: var(--ink); font-weight: 500; width: 34%; }

/* 路由卡 */
.route-card {
  margin-top: 34px; border: 1px solid var(--hair-strong); border-top: 3px solid var(--ink);
  background: var(--card); padding: 22px 24px;
}
.rc-title { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; color: var(--red); margin-bottom: 14px; text-transform: uppercase; }
.route-card .pipe { border: 0; padding: 0 0 14px; background: none; }
.route-card .dim { font-size: 13.5px; }

/* ═══════════════════════ 版权页 ═══════════════════════ */
.colophon { background: var(--paper-deep); }
.colophon-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; margin-top: 30px; }
@media (max-width: 900px) { .colophon-grid { grid-template-columns: 1fr; gap: 40px; } }

.catalog { list-style: none; }
.catalog .row {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 16px 2px; border-bottom: 1px solid var(--hair);
  font-size: 15px; color: var(--ink);
}
.catalog .row span:last-child { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); }
.catalog .row:hover { color: var(--red); }
.catalog .row:hover span:last-child { color: var(--red); }

.meta { margin-top: 4px; }
.meta > div { display: flex; gap: 20px; padding: 11px 2px; border-bottom: 1px solid var(--hair); }
.meta dt { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); width: 70px; flex: none; letter-spacing: .05em; }
.meta dd { font-size: 14.5px; }
.meta a { text-decoration: underline; text-underline-offset: 3px; }
.colophon-tip { margin-top: 26px; font-size: 14px; }

/* ═══════════════════════ FOOTER ═══════════════════════ */
.site-footer { border-top: 2px solid var(--ink); padding: 22px 0 30px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; font-family: var(--mono); font-size: 12px; color: var(--ink-faint); }
.footer-inner a { color: var(--ink-soft); }
.footer-inner a:hover { color: var(--red); }
.foot-page { letter-spacing: .14em; }

/* ═══════════════════════ 滚动揭示 ═══════════════════════ */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease-snap), transform .7s var(--ease-snap); }
.reveal.in { opacity: 1; transform: none; }
.reveal-d2 { transition-delay: .08s; }
.reveal-d3 { transition-delay: .16s; }
.reveal-d4 { transition-delay: .24s; }
.reveal-d5 { transition-delay: .32s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation: none !important; transition: none !important; }
}

/* ═══════════════════════ 移动端导航 ═══════════════════════ */
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed; top: 62px; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--hair-strong);
    padding: 8px 28px 18px; transform: translateY(-12px); opacity: 0;
    pointer-events: none; transition: all .25s var(--ease-snap);
  }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links a { padding: 12px 0; width: 100%; border-bottom: 1px solid var(--hair); }
  .nav-links .nav-gh { border: 0; padding: 12px 0; }
  .page { padding: 64px 0 44px; }
}
