/*
 * Skill Inspector — Landing Page Stylesheet (v2)
 * ----------------------------------------------------------------------------
 * 模块作用 (why this file exists):
 *   按 .claude/skills/landing-page-guide-v2 的 "Design First" 原则, 把整页面的
 *   设计系统 (字体 / 颜色 / 间距 / 动效) 集中沉淀为 CSS Custom Properties.
 *
 * Aesthetic direction (v2): Strict Editorial — "Specification Manual"
 *   - v1 走深色 Editorial-Tech 与姐妹站 SkillsJars Helper 视觉雷同, 这一版彻底
 *     反方向 — 做成 "像一份正式 spec 文档的产品页", 利用 Skill Inspector 作为
 *     Lint 工具的天然严肃感.
 *   - 调性参考: Biome (biomejs.dev) / OXC (oxc.rs) / RFC 文档 / Stripe Press /
 *     NYT 排版.
 *   - 基底: 暖白 oat #F7F4ED + 近黑文字, 几乎不用阴影 (纸感而非屏幕感)
 *   - 主 accent: Pantone-style 严苛红 #C32F27 — 用于规则违规标记 / 编号
 *     ("MUST NOT" 的视觉语言); 链接走 ink blue #1E3A5F; 修复后用 forest green.
 *   - 字体: 全部使用 OS 原生 system font stack (display = body = sans-serif,
 *           跨平台直接呈现 macOS / Windows / Linux / 中文用户最熟悉的字体);
 *           代码字保留 JetBrains Mono (对开发者来说是熟悉的"品牌字体").
 *     衬线 + 无衬线反差很大, 形成 editorial 杂志感.
 *   - 章节用 §1/§2/§3 编号制, 像 spec 一样可引用.
 *   - 代码 diff 用真实 before/after 取代 IDE mockup — Lint 工具最有说服力的展示.
 *
 * 关键约束:
 *   - 0 网络依赖 (除 Google Fonts), 单文件 nginx 即可发布
 *   - 所有动效尊重 prefers-reduced-motion
 *   - 颜色对比度满足 WCAG AA (text vs background ≥ 4.5:1)
 *   - 纸感优先: 极少阴影 / 极少 border-radius / 大量 hairline 分隔
 */

/* ============================================================
 * 1. Design tokens
 * ============================================================ */
:root {
  /* Typography — 衬线 display + 无衬线 body + 等宽 code, 三种字体语义清晰分离 */
  /* System font stack: 每个 OS 都呈现系统原生字体, 视觉熟悉度最高.
   * - macOS:   -apple-system (San Francisco) / PingFang SC
   * - Windows: Segoe UI / Microsoft YaHei
   * - Android: Roboto / Noto Sans CJK
   * - Linux:   Cantarell / Source Han Sans
   * display 和 body 共用同一栈, 用字号 / 字重 / 字距制造层级, 不靠衬线区分. */
  --font-display: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Microsoft YaHei', 'Hiragino Sans GB', 'Source Han Sans SC', 'Helvetica Neue',
    Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Microsoft YaHei', 'Hiragino Sans GB', 'Source Han Sans SC', 'Helvetica Neue',
    Arial, sans-serif;
  /* 代码字保留 JetBrains Mono (JetBrains 自家字体, 是这个插件目标读者最熟悉的等宽字),
   * fallback 走 macOS SF Mono / Windows Consolas / Linux DejaVu Sans Mono. */
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', 'Menlo', 'Consolas',
    'DejaVu Sans Mono', monospace;

  /* Color palette — 暖白纸感 + 严苛红 + ink blue + forest green */
  --paper: #F7F4ED;             /* oat 暖白, 主基底 */
  --paper-deep: #EFEAE0;        /* 章节背景 / 表头 */
  --paper-darker: #E5DFD0;      /* hairline 强分隔 */

  --ink: #0E0E0E;               /* 近黑, 正文 */
  --ink-soft: #2C2A26;          /* 副标 */
  --ink-mid: #5A554E;           /* 次级文本 */
  --ink-muted: #8A857C;         /* 元数据 / 行号 */
  --ink-faint: #B5B0A6;         /* 装饰 */

  --rule: #C32F27;              /* Lint violation red — accent / 编号 / "MUST NOT" */
  --rule-soft: rgba(195, 47, 39, 0.10);
  --link: #1E3A5F;              /* ink blue, 链接 */
  --link-soft: rgba(30, 58, 95, 0.10);
  --pass: #3E6B47;              /* forest green, 修复后 / 通过 */
  --warn: #A0691A;              /* umber, warning */

  --hair: rgba(14, 14, 14, 0.12);
  --hair-strong: rgba(14, 14, 14, 0.24);

  /* Spacing — editorial 节奏: 大开大合 */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Motion (极简, 编辑物理感) */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 140ms;
  --dur: 260ms;
  --dur-slow: 520ms;

  /* Layout */
  --max-w: 1180px;
  --max-w-narrow: 760px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

/* ============================================================
 * 2. Reset & base
 * ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  font-feature-settings: 'kern' 1, 'liga' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* 微弱纸纹 — 让暖白基底有质感, 不至于像纯色块. 几乎不可见, 仅为消除塑料感. */
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.035 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.12;
  margin: 0;
  color: var(--ink);
}

p { margin: 0; }

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(30, 58, 95, 0.35);
  transition: color var(--dur-fast) var(--ease), text-decoration-color var(--dur-fast) var(--ease);
}

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

img { max-width: 100%; display: block; }

code, pre, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.88em;
}

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

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

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

/* ============================================================
 * 3. Editorial primitives
 *    spec 文档式的章节编号 / 标题 / lead / hairline 等基础元素
 * ============================================================ */

/* 章节编号 (§1, §2, ...) — 类似 RFC 文档的可引用编号 */
.section-num {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4em;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rule);
  font-feature-settings: 'tnum';
}

.section-num::before {
  content: '§';
  font-family: var(--font-display);
  font-size: 1.1em;
  font-style: italic;
  color: var(--rule);
}

/* 全宽分隔线 — 纸感, 不用 box-shadow */
.hairline {
  border: 0;
  border-top: 1px solid var(--hair);
  margin: 0;
}

.hairline-strong {
  border: 0;
  border-top: 1px solid var(--hair-strong);
  margin: 0;
}

/* 章节包裹: 上下大间距 + 顶部 hairline */
section {
  padding: var(--space-24) 0;
  border-top: 1px solid var(--hair);
  position: relative;
}

section:first-of-type { border-top: 0; }

.section-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-16);
}

@media (min-width: 880px) {
  .section-head {
    grid-template-columns: 1fr 2fr;
    gap: var(--space-12);
    align-items: baseline;
  }
}

.section-head .meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.section-head .meta-line {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  text-transform: uppercase;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  font-weight: 400;
  letter-spacing: -0.022em;
  line-height: 1.18;
  text-wrap: balance;
}

.section-title em {
  font-style: italic;
  color: var(--rule);
}

.section-lead {
  margin-top: var(--space-4);
  font-size: clamp(1.05rem, 1.4vw, 1.18rem);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 38em;
}

/* Reveal-on-scroll — 极简 fade-in, 无 translate 防止 paper 感被打破 */
.reveal {
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-out);
}

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

.reveal-stagger > * {
  opacity: 0;
  transition: opacity 500ms var(--ease-out);
}

.reveal-stagger.is-in > * { opacity: 1; }

.reveal-stagger.is-in > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger.is-in > *:nth-child(2) { transition-delay: 60ms; }
.reveal-stagger.is-in > *:nth-child(3) { transition-delay: 120ms; }
.reveal-stagger.is-in > *:nth-child(4) { transition-delay: 180ms; }
.reveal-stagger.is-in > *:nth-child(5) { transition-delay: 240ms; }
.reveal-stagger.is-in > *:nth-child(6) { transition-delay: 300ms; }
.reveal-stagger.is-in > *:nth-child(7) { transition-delay: 360ms; }
.reveal-stagger.is-in > *:nth-child(8) { transition-delay: 420ms; }

/* ============================================================
 * 4. Buttons & badges
 * ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.4rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  border-radius: 0;             /* 方角, 纸感 */
  transition:
    transform var(--dur-fast) var(--ease),
    background-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
  white-space: nowrap;
}

.btn:hover {
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

/* Primary button: 实心黑底, 类似杂志封面的强调按钮 */
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  /* 类似活字印刷的纸面投影 */
  box-shadow: 4px 4px 0 0 var(--rule);
}

.btn-primary:hover {
  background: var(--rule);
  color: var(--paper);
  border-color: var(--rule);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 0 var(--ink);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--ink);
}

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

.btn-lg {
  padding: 1rem 1.7rem;
  font-size: 1rem;
}

/* Meta badge — eyebrow / 元数据丸 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  background: var(--paper-deep);
  border: 1px solid var(--hair-strong);
  border-radius: 0;
  text-transform: uppercase;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rule);
  display: inline-block;
}

/* ============================================================
 * 5. Header / Navigation
 * ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

.site-header[data-scrolled='true'] {
  background: rgba(247, 244, 237, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom-color: var(--hair);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.1rem;
  color: var(--ink);
  letter-spacing: -0.015em;
  text-decoration: none;
}

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

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: transparent;
}

.brand-mark img,
.brand-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-name {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.brand-version {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}

.nav-links {
  display: none;
  gap: var(--space-8);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-family: var(--font-mono);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.nav-links a:hover { color: var(--rule); }

.nav-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.95rem;
  font-size: 0.82rem;
  font-family: var(--font-body);
  font-weight: 500;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease);
}

.nav-cta:hover { background: var(--rule); border-color: var(--rule); color: var(--paper); }

.lang-switch {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  border: 1px solid var(--hair-strong);
}

.lang-switch a {
  display: inline-block;
  padding: 0.32rem 0.65rem;
  color: var(--ink-muted);
  text-decoration: none;
}

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

.lang-switch a[aria-current='true'] {
  background: var(--ink);
  color: var(--paper);
}

@media (min-width: 880px) {
  .nav-links { display: flex; }
}

/* ============================================================
 * 6. §1 Hero
 *
 *   左侧大标 (system sans 粗体 + italic 强调词) + 简短 lead + 双 CTA + inline 数据;
 *   右侧 marginalia (旁注) 列出关键 metadata, 像杂志页眉一样.
 * ============================================================ */
.hero {
  padding: var(--space-24) 0 var(--space-32);
  border-top: 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-12);
  align-items: start;
}

@media (min-width: 1024px) {
  .hero-grid {
    grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr);
    gap: var(--space-16);
  }
}

.hero-eyebrow {
  margin-bottom: var(--space-6);
}

.hero-title {
  font-family: var(--font-display);
  /* system sans-serif 没有 Fraunces 那么强的视觉重量, 字号略放大 + 字重提到 600
   * 才能撑住 hero 区的视觉体量. */
  font-size: clamp(2.4rem, 6.5vw, 5.4rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.12;
  text-wrap: balance;
  margin: 0;
}

.hero-title em {
  font-style: italic;
  color: var(--rule);
}

.hero-title .underdash {
  position: relative;
  font-style: normal;
  color: var(--ink);
}

.hero-title .underdash::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.08em;
  height: 4px;
  background: var(--rule);
}

.hero-lead {
  margin-top: var(--space-8);
  font-size: clamp(1.1rem, 1.55vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 32em;
  font-family: var(--font-body);
}

.hero-cta {
  margin-top: var(--space-8);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* Marginalia (右侧旁注) — 像 NYT 文章左侧的 byline / 杂志页眉的元数据栏 */
.marginalia {
  border-top: 1px solid var(--ink);
  padding-top: var(--space-3);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-mid);
}

.marginalia dt {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 4px;
}

.marginalia dd {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  letter-spacing: -0.005em;
}

.marginalia dd strong {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.4rem;
  color: var(--ink);
  line-height: 1;
  display: inline-block;
  margin-right: 0.4em;
}

.marginalia .em {
  color: var(--rule);
  font-family: var(--font-display);
  font-style: italic;
}

/* ============================================================
 * 7. §2 Rules Manifest — 真实表格, 比卡片更 "spec"
 *
 *   严肃表格: 编号 / Rule ID / Severity / Quick Fix / 描述
 * ============================================================ */
.rules-table-wrap {
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  overflow-x: auto;
}

.rules-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 0.92rem;
  table-layout: auto;
  min-width: 720px;
}

.rules-table thead th {
  background: var(--paper-deep);
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink-mid);
  text-transform: uppercase;
  white-space: nowrap;
}

.rules-table tbody td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--hair);
  vertical-align: top;
  line-height: 1.5;
}

.rules-table tbody tr:hover {
  background: rgba(195, 47, 39, 0.04);
}

.rules-table .col-num {
  font-family: var(--font-mono);
  color: var(--ink-muted);
  font-size: 0.8rem;
  width: 1%;
  white-space: nowrap;
}

.rules-table .col-id {
  font-family: var(--font-mono);
  color: var(--ink);
  font-size: 0.88rem;
  white-space: nowrap;
}

.rules-table .col-fix {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-muted);
  white-space: nowrap;
}

.rules-table .col-fix.has-fix { color: var(--pass); }

.rules-table .col-desc {
  color: var(--ink-soft);
}

.sev {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border: 1px solid currentColor;
}

.sev::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.sev-error    { color: var(--rule); }
.sev-warning  { color: var(--warn); }

/* 表格下方的 5 类规则统计行 — 像 spec 的 "Total" 行 */
.rules-tally {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-8);
  padding-top: var(--space-6);
}

@media (min-width: 720px) { .rules-tally { grid-template-columns: repeat(5, 1fr); } }

.tally-item {
  border-top: 2px solid var(--ink);
  padding-top: var(--space-3);
}

.tally-item .tally-cat {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}

.tally-item .tally-num {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.02em;
}

.tally-item .tally-num em {
  font-style: italic;
  color: var(--rule);
}

.tally-item .tally-label {
  margin-top: var(--space-2);
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.rules-cta {
  margin-top: var(--space-8);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-mid);
}

.rules-cta a { font-family: inherit; }

/* ============================================================
 * 8. §3 Features — 编号大数字 + 段落
 *
 *   不用卡片, 用编辑物理感的 "编号 / 标题 / 段落" 三段式, 像 spec 的 sub-section.
 * ============================================================ */
.features-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.feature {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-6);
  padding: var(--space-12) 0;
  border-bottom: 1px solid var(--hair);
  align-items: baseline;
}

.feature:first-child { padding-top: 0; }
.feature:last-child { border-bottom: 0; }

@media (min-width: 880px) {
  .feature {
    grid-template-columns: 100px 1fr 1.3fr;
    gap: var(--space-8);
    padding: var(--space-16) 0;
  }
}

.feature-num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 600;
  color: var(--rule);
  line-height: 1;
  letter-spacing: -0.02em;
}

.feature-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  font-weight: 500;
  letter-spacing: -0.018em;
  line-height: 1.12;
  color: var(--ink);
}

.feature-title em {
  font-style: italic;
  color: var(--rule);
}

.feature-body {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

.feature-body p + p { margin-top: var(--space-3); }

.feature-body code,
.rules-table code,
.faq-body code,
.usecase-body code,
.hero-lead code {
  background: var(--paper-deep);
  border: 1px solid var(--hair);
  padding: 0.05rem 0.35rem;
  font-size: 0.85em;
  color: var(--ink);
}

.feature-body .read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: var(--space-4);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--link);
  padding-bottom: 2px;
  color: var(--link);
}

.feature-body .read-more:hover {
  color: var(--rule);
  border-bottom-color: var(--rule);
}

/* ============================================================
 * 9. §4 Code Diff Gallery — 真实 before/after, 取代 IDE mockup
 *
 *   每个 example 是一对 "原 SKILL.md" + "修复后" 代码块, 中间一条 hairline,
 *   左侧 caption 说明问题 + 应用了哪条 Quick Fix.
 * ============================================================ */
.diff-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.diff-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 880px) {
  .diff-item {
    grid-template-columns: 280px 1fr;
    gap: var(--space-8);
    align-items: start;
  }
}

.diff-caption {
  border-top: 2px solid var(--ink);
  padding-top: var(--space-3);
}

.diff-rule {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--rule);
  margin-bottom: var(--space-2);
}

.diff-h {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin-bottom: var(--space-2);
}

.diff-h em { font-style: italic; color: var(--rule); }

.diff-cap-body {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.diff-cap-body .fix {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: var(--space-3);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--pass);
  padding: 0.15rem 0.5rem;
  background: rgba(62, 107, 71, 0.08);
  border: 1px solid rgba(62, 107, 71, 0.3);
}

.diff-cap-body .fix::before {
  content: '✓';
  font-weight: 700;
}

.diff-blocks {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 720px) {
  .diff-blocks { grid-template-columns: 1fr 1fr; gap: 0; }
}

.diff-block {
  background: var(--paper-deep);
  border: 1px solid var(--hair-strong);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.65;
  overflow: hidden;
  position: relative;
}

@media (min-width: 720px) {
  .diff-block.before { border-right: 0; }
}

.diff-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.8rem;
  background: var(--paper-darker);
  border-bottom: 1px solid var(--hair-strong);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mid);
}

.diff-block-head .tag {
  font-family: var(--font-mono);
  font-weight: 500;
}

.diff-block.before .diff-block-head .tag { color: var(--rule); }
.diff-block.after  .diff-block-head .tag { color: var(--pass); }

.diff-block-body {
  padding: var(--space-3) 0;
  overflow-x: auto;
}

.diff-line {
  display: grid;
  grid-template-columns: 28px 12px 1fr;
  align-items: baseline;
  padding: 0 var(--space-3);
  white-space: nowrap;
  color: var(--ink-soft);
}

.diff-line .ln {
  color: var(--ink-faint);
  font-size: 0.72rem;
  text-align: right;
  padding-right: 0.5rem;
  user-select: none;
}

.diff-line .marker {
  text-align: center;
  user-select: none;
  color: var(--ink-faint);
}

.diff-line.del {
  background: rgba(195, 47, 39, 0.07);
  color: var(--ink);
}

.diff-line.del .marker { color: var(--rule); }
.diff-line.del .marker::before { content: '−'; }

.diff-line.add {
  background: rgba(62, 107, 71, 0.07);
  color: var(--ink);
}

.diff-line.add .marker { color: var(--pass); }
.diff-line.add .marker::before { content: '+'; }

.diff-line .code .k  { color: #5A554E; }
.diff-line .code .v  { color: var(--ink); }
.diff-line .code .vr { color: var(--rule); }
.diff-line .code .vg { color: var(--pass); }
.diff-line .code .c  { color: var(--ink-muted); }

/* ============================================================
 * 10. §5 Who it's for (Personas) — blockquote 风
 *
 *   不用卡片, 用 editorial 引述: 大引号 + 引用主体 + cite 行.
 * ============================================================ */
.personas {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-12);
}

@media (min-width: 880px) {
  .personas { grid-template-columns: 1fr 1fr; gap: var(--space-16) var(--space-12); }
}

.persona {
  position: relative;
  padding-top: var(--space-8);
  border-top: 1px solid var(--hair-strong);
}

.persona::before {
  content: '"';
  position: absolute;
  top: -0.4rem;
  left: -0.1rem;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 4rem;
  color: var(--rule);
  line-height: 1;
}

.persona-quote {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 1.8vw, 1.5rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink);
  letter-spacing: -0.012em;
  margin: 0 0 var(--space-6) 0;
}

.persona-cite {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: var(--space-3);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mid);
}

.persona-cite::before { content: '—'; color: var(--rule); }

.persona-body {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink-soft);
}

/* ============================================================
 * 11. §6 FAQ — spec 风, §6.1 / §6.2 编号
 * ============================================================ */
.faq-list {
  display: flex;
  flex-direction: column;
}

.faq-item {
  border-top: 1px solid var(--hair-strong);
  padding: var(--space-6) 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

.faq-item:last-child { border-bottom: 1px solid var(--hair-strong); }

@media (min-width: 880px) {
  .faq-item {
    grid-template-columns: 90px 1fr;
    gap: var(--space-8);
  }
}

.faq-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--rule);
  letter-spacing: 0.04em;
  font-feature-settings: 'tnum';
}

.faq-content summary {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.8vw, 1.4rem);
  font-weight: 500;
  letter-spacing: -0.012em;
  line-height: 1.35;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 2rem;
  transition: color var(--dur-fast) var(--ease);
}

.faq-content summary:hover { color: var(--rule); }

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

.faq-content summary::after {
  content: '+';
  position: absolute;
  top: 0;
  right: 0;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 1.6rem;
  color: var(--rule);
  line-height: 0.9;
  transition: transform var(--dur) var(--ease);
}

.faq-content[open] summary::after { transform: rotate(45deg); }

.faq-body {
  margin-top: var(--space-4);
  color: var(--ink-soft);
  line-height: 1.7;
  font-size: 1rem;
  max-width: 42em;
}

/* ============================================================
 * 12. §7 Final CTA — 严肃横幅, 不用渐变
 * ============================================================ */
.final-cta {
  padding: var(--space-32) 0;
  background: var(--ink);
  color: var(--paper);
  border-top: 0;
  border-bottom: 0;
  position: relative;
}

/* 加左右 1px 红边作为印刷裁切感装饰 */
.final-cta::before,
.final-cta::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--rule);
}

.final-cta::before { left: 0; }
.final-cta::after  { right: 0; }

.final-cta-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  align-items: end;
}

@media (min-width: 880px) {
  .final-cta-inner {
    grid-template-columns: 2fr 1fr;
    gap: var(--space-16);
  }
}

.final-cta-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.6rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--paper);
  text-wrap: balance;
}

.final-cta-title em {
  font-style: italic;
  color: var(--rule);
}

.final-cta-sub {
  margin-top: var(--space-6);
  font-size: 1.05rem;
  line-height: 1.55;
  color: rgba(247, 244, 237, 0.8);
  max-width: 32em;
}

.final-cta-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.final-cta .btn-primary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
  box-shadow: 4px 4px 0 0 var(--rule);
}

.final-cta .btn-primary:hover {
  background: var(--rule);
  color: var(--paper);
  border-color: var(--rule);
  box-shadow: 6px 6px 0 0 var(--paper);
}

.final-cta .btn-ghost {
  background: transparent;
  color: var(--paper);
  border-color: var(--paper);
}

.final-cta .btn-ghost:hover {
  background: var(--paper);
  color: var(--ink);
}

.final-cta-meta {
  margin-top: var(--space-8);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(247, 244, 237, 0.7);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.final-cta-meta span::before {
  content: '·';
  margin-right: var(--space-3);
  color: var(--rule);
}

.final-cta-meta span:first-child::before { content: ''; margin-right: 0; }

/* ============================================================
 * 13. Footer
 *
 *   学术 / 出版物风的页脚: 多列链接 + 底部版权 + 受众价值主张.
 * ============================================================ */
.site-footer {
  padding: var(--space-16) 0 var(--space-8);
  background: var(--paper);
  border-top: 1px solid var(--ink);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-12);
}

@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; } }

.footer-brand p {
  margin-top: var(--space-4);
  color: var(--ink-mid);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 30em;
}

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: var(--space-4);
  font-weight: 500;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-col a {
  color: var(--ink);
  font-size: 0.95rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
}

.footer-col a:hover {
  color: var(--rule);
  border-bottom-color: var(--rule);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: space-between;
  align-items: baseline;
  padding-top: var(--space-6);
  border-top: 1px solid var(--hair);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-mid);
}

/* ============================================================
 * 14. A11y: reduced motion
 * ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal,
  .reveal-stagger > * {
    opacity: 1;
  }
}

/* ============================================================
 * 15. Utilities
 * ============================================================ */
.mono { font-family: var(--font-mono); }
.serif { font-family: var(--font-display); }
.muted { color: var(--ink-muted); }
.center { text-align: center; }

/* Inline code in body text (when not inside a special component) */
p code, li code {
  background: var(--paper-deep);
  border: 1px solid var(--hair);
  padding: 0.05rem 0.35rem;
  font-size: 0.85em;
  color: var(--ink);
}

/* ============================================================
 * 16. CJK 适配
 *
 * 为什么需要这一节:
 *   英文版的 .hero-title / .section-title 行高是按 system sans 拉丁字符
 *   (-apple-system / Segoe UI) 的 cap-height + x-height 调的, 偏紧凑.
 *   但 CJK 字符 (PingFang SC / Microsoft YaHei / 苹方等 fallback)
 *   的字身框 (em-box) 几乎贴满 font-size, 同样的 line-height 在中文下
 *   会导致:
 *     (1) 相邻行 ink 区域几乎贴在一起, 阅读不舒服;
 *     (2) .underdash::after (bottom: -0.08em 的红色下划线) 直接侵入下一行
 *         顶部 - 这是用户反馈截图里出现的实际问题.
 *
 * 修复策略:
 *   :lang(zh-Hans/Hant/ja) 下统一把大字号标题的 line-height 放宽,
 *   并稍微放松 letter-spacing (CJK 不需要拉丁字那种紧字距).
 *   英文版 (<html lang="en">) 不命中, 行高保持原设计.
 * ============================================================ */

:lang(zh-Hans) .hero-title,
:lang(zh-Hant) .hero-title,
:lang(ja) .hero-title {
  line-height: 1.22;
  letter-spacing: -0.012em;
}

/* 给 .underdash 的红色下划线和下一行之间额外留呼吸空间 */
:lang(zh-Hans) .hero-title .underdash::after,
:lang(zh-Hant) .hero-title .underdash::after,
:lang(ja) .hero-title .underdash::after {
  bottom: -0.14em;
  height: 3px;
}

:lang(zh-Hans) .section-title,
:lang(zh-Hant) .section-title,
:lang(ja) .section-title {
  line-height: 1.28;
  letter-spacing: -0.008em;
}

:lang(zh-Hans) .feature-title,
:lang(zh-Hant) .feature-title,
:lang(ja) .feature-title {
  line-height: 1.32;
  letter-spacing: -0.005em;
}

:lang(zh-Hans) .final-cta-title,
:lang(zh-Hant) .final-cta-title,
:lang(ja) .final-cta-title {
  line-height: 1.22;
  letter-spacing: -0.01em;
}

/* persona 引语 / diff caption 等中等字号 display 标题, 行高也需要补偿 */
:lang(zh-Hans) .persona-quote,
:lang(zh-Hant) .persona-quote,
:lang(ja) .persona-quote,
:lang(zh-Hans) .diff-h,
:lang(zh-Hant) .diff-h,
:lang(ja) .diff-h {
  line-height: 1.35;
}
