/* ==========================================================================
   xpyweb.com — 全站唯一样式表
   一切数值来自 DESIGN.md。改样式先改 DESIGN.md 再改这里。
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 设计令牌
   -------------------------------------------------------------------------- */
:root {
  /* 中性基底（Zinc / Slate 系，冷暖不混用） */
  --primary: #0f172a;
  --on-primary: #ffffff;
  --secondary: #334155;
  --on-secondary: #ffffff;

  /* 唯一强调色：深青蓝 */
  --accent: #0369a1;
  --accent-hover: #075985;
  --on-accent: #ffffff;
  --accent-soft: #e0f2fe;
  --accent-soft-fg: #075985;

  /* 表面与文字 */
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-sunken: #f1f5f9;
  --fg-strong: #0f172a;
  --fg: #1e293b;
  --fg-muted: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  /* 功能色 */
  --success: #047857;
  --warning: #b45309;
  --destructive: #dc2626;

  /* 字体：零 webfont 中文系统栈（Google Fonts 大陆不可达） */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC",
    "Noto Sans CJK SC", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", "Roboto Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  /* 字号：按中文调整（非技能默认值） */
  --fs-body: 17px;
  --lh-body: 1.8;
  --measure: 38em;

  /* 间距：VISUAL_DENSITY 3 → 24-96 主尺度 */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;
  --section-y: clamp(64px, 7vw, 112px);
  --container: 1200px;
  --gutter: clamp(20px, 4vw, 40px);

  /* 形状：SHAPE CONSISTENCY LOCK — 卡片/按钮/输入框统一 8px */
  --r-card: 8px;
  --r-pill: 999px;

  /* 阴影：着色，无纯黑 */
  --sh-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --sh-md: 0 4px 12px rgba(15, 23, 42, 0.07), 0 2px 4px rgba(15, 23, 42, 0.04);

  /* 动效：MOTION_INTENSITY 4 = Fluid CSS */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --d-fast: 150ms;
  --d-base: 240ms;
  --d-slow: 360ms;
  --stagger: 60ms;
  /* Split Text 的错开量比卡片入场大：短语数少（2-3 段），间隔太小会看不出来。
     70ms 仍在 emil 的 30-80ms 区间内 */
  --stagger-split: 70ms;

  /* z-index：只登记系统层 */
  --z-sticky: 100;
  --z-overlay: 200;
}

/* 暗色：只换变量值，不做第二套设计 */
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #f1f5f9;
    --on-primary: #0b1220;
    --secondary: #cbd5e1;
    --on-secondary: #0b1220;
    --accent: #38bdf8;
    --accent-hover: #7dd3fc;
    --on-accent: #082f49;
    --accent-soft: #0c4a6e;
    --accent-soft-fg: #7dd3fc;
    --bg: #0b1220;
    --surface: #131c2e;
    --surface-sunken: #0f172a;
    --fg-strong: #f1f5f9;
    --fg: #cbd5e1;
    --fg-muted: #94a3b8;
    --border: #26334a;
    --border-strong: #334155;
    --success: #34d399;
    --warning: #fbbf24;
    --destructive: #f87171;
    --sh-sm: none;
    --sh-md: none;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--d-fast) var(--ease-out);
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* --------------------------------------------------------------------------
   3. 排版
   -------------------------------------------------------------------------- */
h1,
h2,
h3,
h4 {
  color: var(--fg-strong);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(1.875rem, 1.2rem + 2.6vw, 3rem);
}

h2 {
  font-size: clamp(1.375rem, 1.1rem + 1.4vw, 1.875rem);
  line-height: 1.35;
  margin-top: 2.4em;
}

h3 {
  font-size: 1.1875rem;
  line-height: 1.5;
  font-weight: 600;
  margin-top: 1.8em;
}

h2:first-child,
h3:first-child {
  margin-top: 0;
}

p {
  margin: 0 0 1.5em;
}

p:last-child {
  margin-bottom: 0;
}

/* eyebrow：受「每 3 个区块最多 1 个」节制 */
.eyebrow {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s-3);
}

/* --------------------------------------------------------------------------
   4. 布局
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  padding-block: var(--section-y);
}

.section--tight {
  padding-block: var(--s-8);
}

.section--alt {
  background: var(--surface);
  border-block: 1px solid var(--border);
}

@media (prefers-color-scheme: dark) {
  .section--alt {
    border-block: 1px solid var(--border);
  }
}

.section-head {
  max-width: var(--measure);
  margin-bottom: var(--s-7);
}

.section-head p {
  color: var(--fg-muted);
  margin-top: var(--s-3);
  margin-bottom: 0;
}

/* 文章正文列 + 右侧目录 */
.prose-layout {
  display: grid;
  gap: var(--s-8);
  align-items: start;
}

/* grid 子项默认 min-width:auto（即 min-content）—— 表格/长 URL 会把列撑到
   视口外，触发横向滚动。min-width:0 允许列收缩到 1fr 之内。 */
.prose-layout > * {
  min-width: 0;
}

@media (min-width: 1080px) {
  .prose-layout {
    grid-template-columns: minmax(0, var(--measure)) 260px;
    gap: var(--s-9);
    justify-content: center;
  }
}

/* --------------------------------------------------------------------------
   5. 导航
   -------------------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--fg-strong);
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

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

.brand__mark {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0;
}

.nav__links {
  display: none;
  align-items: center;
  gap: var(--s-1);
  list-style: none;
  margin: 0;
  padding: 0;
}

/* 桌面单行完整导航（SOP ⑦ 铁律：B2B 尽调买家找不到入口是真实转化摩擦） */
@media (min-width: 900px) {
  .nav__links {
    display: flex;
  }
}

.nav__links a {
  display: block;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-card);
  font-size: 0.9375rem;
  color: var(--fg);
  white-space: nowrap;
}

.nav__links a:hover {
  color: var(--accent);
  background: var(--surface-sunken);
}

.nav__links a[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
}

.nav__cta {
  flex-shrink: 0;
}

/* 移动端只保留汉堡按钮，头部 CTA 与品牌名挤不下。
   CTA 本身在 hero 已重复，按钮在内容区多处出现，不会丢入口。 */
@media (max-width: 899px) {
  .nav__cta > .btn {
    display: none;
  }
}

/* 汉堡菜单只允许 < 900px（SOP ⑧ 机器可查项） */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
}

@media (min-width: 900px) {
  .nav-toggle {
    display: none;
  }
}

.nav-drawer {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  transition: grid-template-rows var(--d-base) var(--ease-out);
  border-top: 1px solid var(--border);
}

.nav-drawer[data-open="true"] {
  grid-template-rows: 1fr;
}

.nav-drawer__inner {
  min-height: 0;
  padding: 0;
}

.nav-drawer[data-open="true"] .nav-drawer__inner {
  padding: var(--s-4) 0 var(--s-5);
}

.nav-drawer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-drawer a {
  display: block;
  padding: var(--s-3) 0;
  color: var(--fg);
  border-bottom: 1px solid var(--border);
}

/* --------------------------------------------------------------------------
   6. 按钮
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: var(--r-card);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--d-fast) var(--ease-out),
    color var(--d-fast) var(--ease-out), border-color var(--d-fast) var(--ease-out),
    transform var(--d-fast) var(--ease-out);
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn--primary:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
}

.btn--ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--border-strong);
}

.btn--ghost:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.btn--sm {
  padding: 9px 16px;
  font-size: 0.875rem;
}

/* --------------------------------------------------------------------------
   7. Hero
   -------------------------------------------------------------------------- */
.hero {
  padding-block: clamp(56px, 6vw, 96px) var(--section-y);
}

.hero__grid {
  display: grid;
  gap: var(--s-7);
  align-items: center;
}

@media (min-width: 900px) {
  .hero__grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: var(--s-9);
  }
}

.hero h1 {
  margin-bottom: var(--s-4);
}

.hero__sub {
  max-width: 34em;
  font-size: 1.0625rem;
  color: var(--fg-muted);
  margin-bottom: var(--s-6);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}

.hero__visual {
  border-radius: var(--r-card);
  overflow: hidden;
  box-shadow: var(--sh-md);
  background: var(--surface-sunken);
}

.hero__visual img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* 编辑立场卡：替代 hero 配图。
   左侧 2px accent 竖线是唯一的竖向强调，不加大色块、不加阴影堆叠。 */
.hero__panel {
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: var(--r-card);
  padding: var(--s-6) var(--s-6) var(--s-6) var(--s-5);
  background: var(--surface);
}

.hero__panel-label {
  margin: 0 0 var(--s-4);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.hero__panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s-4);
}

.hero__panel li {
  position: relative;
  padding-left: 1.35em;
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--fg);
}

/* 列表标记用 accent 短横，不用圆点（圆点太小，中文行高下显得碎） */
.hero__panel li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 0.7em;
  height: 2px;
  background: var(--accent-soft);
}

/* 右栏为空时（既无图也无立场卡），左栏占满并收窄 measure，
   避免单行文字拉到 1200px 宽 */
.hero__grid > :only-child {
  max-width: 46em;
}

/* --------------------------------------------------------------------------
   8. 卡片与网格
   -------------------------------------------------------------------------- */
.grid {
  display: grid;
  gap: var(--s-5);
}

@media (min-width: 700px) {
  .grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* 非等宽网格：1 主 + 2 次，避开「三等分卡片行」 */
@media (min-width: 1000px) {
  .grid--lede {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--sh-sm);
  overflow: hidden;
  transition: border-color var(--d-base) var(--ease-out),
    transform var(--d-base) var(--ease-out);
}

/* Spotlight（reactbits Spotlight Card 的零 JS 改造版）
   原组件是光标跟随的径向渐变，需要监听 mousemove：
   - 鼠标扫卡片是「一天几十次」的高频交互，emil 决策框架要求 drastic reduce
   - 触屏无光标，效果直接失效
   - 纯装饰，不承载信息
   改造为固定左上光源，只做 opacity 过渡。accent 压到 5% 透明度：
   再高就会在白底上发脏，对 30-50 岁制造业决策人反而掉信任。 */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(115% 85% at 0% 0%, var(--accent) 0%, transparent 58%);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--d-base) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .card:hover::before {
    opacity: 0.05;
  }
}

/* 光源在上方，正文必须重新确立层叠上下文，否则会被渐变盖住 */
.card > * {
  position: relative;
}

@media (prefers-color-scheme: dark) {
  .card {
    box-shadow: none;
  }
}

.card__kicker {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-transform: uppercase;
}

.card__title {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--fg-strong);
}

.card__title a {
  color: inherit;
}

.card__title a:hover {
  color: var(--accent);
}

.card__meta {
  font-size: 0.875rem;
  color: var(--fg-muted);
  margin-top: auto;
}

.card p {
  font-size: 0.9375rem;
  color: var(--fg-muted);
  margin: 0;
}

/* --------------------------------------------------------------------------
   9. 文章正文
   -------------------------------------------------------------------------- */
.prose {
  max-width: var(--measure);
}

.prose > p,
.prose > ul,
.prose > ol {
  max-width: var(--measure);
}

.prose ul,
.prose ol {
  padding-left: 1.4em;
  margin: 0 0 1.5em;
}

.prose li {
  margin-bottom: 0.5em;
}

.prose li::marker {
  color: var(--accent);
  font-weight: 600;
}

.prose strong {
  color: var(--fg-strong);
  font-weight: 600;
}

.prose a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--s-7) 0;
}

/* 引用块：左侧竖线，无引号装饰 */
.prose blockquote {
  margin: var(--s-6) 0;
  padding: var(--s-2) 0 var(--s-2) var(--s-5);
  border-left: 3px solid var(--border-strong);
  color: var(--fg-muted);
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

/* 代码块 */
.prose pre {
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: var(--s-4);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.7;
  margin: 0 0 1.5em;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-sunken);
  padding: 2px 6px;
  border-radius: 4px;
}

.prose pre code {
  background: none;
  padding: 0;
  font-size: 1em;
}

/* 表格：表头 2px 下框 + 行间 1px，禁止每行上下双线
   ⚠️ 必须同时设 max-width:100% + overflow-x:auto，否则 wrap 会被表格自然宽度撑开
   （这是文章页移动端横向溢出的真实 bug —— 桌面看不出来，因容器被设了宽才生效） */
.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  margin: 0 0 1.5em;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.prose th,
.prose td {
  padding: var(--s-3) var(--s-4);
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.prose th {
  font-weight: 600;
  color: var(--fg-strong);
  border-bottom: 2px solid var(--border-strong);
  white-space: nowrap;
}

/* 步骤块：大号数字，不用「步骤 1」标签 */
.steps {
  list-style: none;
  counter-reset: step;
  margin: 0 0 1.5em;
  padding: 0;
  max-width: var(--measure);
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 3rem;
  margin-bottom: var(--s-6);
}

.steps li:last-child {
  margin-bottom: 0;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.1em;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-soft-fg);
  border-radius: var(--r-pill);
  font-size: 0.9375rem;
  font-weight: 700;
}

/* 提示条 */
.callout {
  display: grid;
  gap: var(--s-2);
  padding: var(--s-4) var(--s-5);
  margin: 0 0 1.5em;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r-card) var(--r-card) 0;
  max-width: var(--measure);
}

.callout--warn {
  background: color-mix(in srgb, var(--warning) 10%, transparent);
  border-left-color: var(--warning);
}

.callout__label {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent-soft-fg);
}

.callout--warn .callout__label {
  color: var(--warning);
}

.callout p {
  margin: 0;
  font-size: 0.9375rem;
}

/* --------------------------------------------------------------------------
   10. 目录（TOC）
   -------------------------------------------------------------------------- */
.toc {
  display: none;
  position: sticky;
  top: 96px;
  font-size: 0.875rem;
}

@media (min-width: 1080px) {
  .toc {
    display: block;
  }
}

.toc__title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: var(--s-3);
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--border);
}

.toc a {
  display: block;
  padding: 6px 0 6px var(--s-4);
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--fg-muted);
  line-height: 1.5;
}

.toc a:hover {
  color: var(--accent);
}

.toc a.is-active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   11. 文章元信息 / 相关阅读
   -------------------------------------------------------------------------- */
.article-head {
  padding-block: var(--s-8) var(--s-7);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s-7);
}

.article-head h1 {
  max-width: 24em;
  margin-bottom: var(--s-4);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  font-size: 0.875rem;
  color: var(--fg-muted);
}

.article-lead {
  max-width: var(--measure);
  font-size: 1.1875rem;
  line-height: 1.75;
  color: var(--fg-muted);
  margin-top: var(--s-5);
}

.related {
  margin-top: var(--s-9);
  padding-top: var(--s-7);
  border-top: 1px solid var(--border);
}

/* --------------------------------------------------------------------------
   12. CTA 条（全站唯一主 CTA 文案）
   -------------------------------------------------------------------------- */
.cta-band {
  background: var(--primary);
  color: var(--on-primary);
  border-radius: var(--r-card);
  padding: clamp(32px, 5vw, 56px);
}

.cta-band h2 {
  color: var(--on-primary);
  margin-top: 0;
}

.cta-band p {
  color: color-mix(in srgb, var(--on-primary) 78%, transparent);
  max-width: 40em;
  margin-bottom: var(--s-5);
}

.cta-band .btn--primary {
  background: var(--on-primary);
  color: var(--primary);
}

.cta-band .btn--primary:hover {
  background: color-mix(in srgb, var(--on-primary) 88%, transparent);
  color: var(--primary);
}

.cta-band .btn--ghost {
  color: var(--on-primary);
  border-color: color-mix(in srgb, var(--on-primary) 35%, transparent);
}

.cta-band .btn--ghost:hover {
  color: var(--on-primary);
  border-color: var(--on-primary);
  background: color-mix(in srgb, var(--on-primary) 12%, transparent);
}

/* 文内 CTA（长文自然停顿点）
   刻意不用 .cta-band 那种深色整块：在阅读流里深色块太抢，会打断阅读节奏，
   读者会当成广告跳过。改成浅底 + 左侧 accent 竖线 —— 既从正文里跳出来，
   又保持是文章的一部分。竖线与 callout 同一语言，视觉上不引入新元素。 */
.inline-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4) var(--s-6);
  margin: var(--s-7) 0;
  padding: var(--s-5) var(--s-6);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-card);
}

.inline-cta__text {
  flex: 1 1 22em;
  min-width: 0;
}

.inline-cta h3 {
  margin: 0 0 var(--s-2);
  font-size: 1.0625rem;
  color: var(--fg-strong);
}

.inline-cta p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--fg-muted);
}

.inline-cta .btn {
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   13. 表单
   -------------------------------------------------------------------------- */
.form {
  display: grid;
  gap: var(--s-5);
  max-width: 34em;
}

.field {
  display: grid;
  gap: var(--s-2);
}

.field label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--fg-strong);
}

.field .req {
  color: var(--destructive);
  margin-left: 2px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-card);
  transition: border-color var(--d-fast) var(--ease-out),
    box-shadow var(--d-fast) var(--ease-out);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--destructive);
}

.field__hint {
  font-size: 0.8125rem;
  color: var(--fg-muted);
}

.field__error {
  font-size: 0.8125rem;
  color: var(--destructive);
  min-height: 1.2em;
}

.form__note {
  font-size: 0.875rem;
  color: var(--fg-muted);
}

.form__status {
  padding: var(--s-4);
  border-radius: var(--r-card);
  font-size: 0.9375rem;
  background: var(--accent-soft);
  color: var(--accent-soft-fg);
}

.form__status[data-state="error"] {
  background: color-mix(in srgb, var(--destructive) 10%, transparent);
  color: var(--destructive);
}

/* --------------------------------------------------------------------------
   14. 页脚
   -------------------------------------------------------------------------- */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-block: var(--s-8) var(--s-6);
  margin-top: var(--s-9);
  font-size: 0.9375rem;
}

.footer__grid {
  display: grid;
  gap: var(--s-7);
}

@media (min-width: 760px) {
  .footer__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.footer h3 {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 0 0 var(--s-4);
}

.footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s-2);
}

.footer a {
  color: var(--fg);
}

.footer a:hover {
  color: var(--accent);
}

.footer__legal {
  margin-top: var(--s-7);
  padding-top: var(--s-5);
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--fg-muted);
}

/* --------------------------------------------------------------------------
   15. 面包屑
   -------------------------------------------------------------------------- */
.breadcrumb {
  font-size: 0.875rem;
  color: var(--fg-muted);
  margin-bottom: var(--s-4);
}

.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin: 0;
  padding: 0;
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: var(--s-2);
  color: var(--border-strong);
}

.breadcrumb a {
  color: var(--fg-muted);
}

/* --------------------------------------------------------------------------
   16. 动效
   -------------------------------------------------------------------------- */
/* 无 JS 回退：默认可见。JS 接管后加 html.js 才隐藏（SOP 附录坑 7） */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
  transition: opacity var(--d-slow) var(--ease-out),
    transform var(--d-slow) var(--ease-out);
}

/* 入场 stagger（CSS 级联，不用 JS 计时器） */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal].is-visible {
    transition-delay: calc(var(--i, 0) * var(--stagger));
  }
}

/* hover 门控：触屏防误触（SOP ⑧ 机器可查项）
   pointer: fine 是 emil 的额外要求 —— 只排除触屏还不够，
   触控笔 / 混合输入设备同样会误触发 hover 态 */
@media (hover: hover) and (pointer: fine) {
  .card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
  }
}

/* Split Text（reactbits Split Text 的中文改造版）
   中文不按「字」切 —— 逐字飞入是典型的 AI 味动效，读起来会碎。
   按标点切短语，首页 h1 只切出 2-3 段，70ms 错开，效果是「标题被组装出来」
   而不是「蹦出来」。切不出 2 段以上时 JS 会跳过，保持原样。 */
.hero h1 .st,
.article-head h1 .st {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.32em);
}

.hero h1.is-split .st,
.article-head h1.is-split .st {
  opacity: 1;
  transform: none;
  transition: opacity 520ms var(--ease-out), transform 520ms var(--ease-out);
  transition-delay: calc(var(--si, 0) * var(--stagger-split));
}

/* --------------------------------------------------------------------------
   reduced-motion 降级
   emil：reduced motion 是「更少更轻」，不是「全关」。
   透明度与颜色过渡要保留 —— 它们帮助理解状态变化；
   位移与缩放要移除 —— 它们是前庭不适的来源。
   （本站全部 transform 都是装饰性的，无结构性依赖，故可安全置 none）
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transform: none !important;
  }

  .js [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }

  .hero h1 .st,
  .article-head h1 .st {
    opacity: 1 !important;
    transform: none !important;
  }

  /* 颜色 / 边框 / 光源的过渡保留，但压到 120ms：
     状态变化仍可感知，不产生运动感 */
  .card,
  .card::before,
  .btn,
  a,
  .nav__link {
    transition-duration: 120ms !important;
  }
}

/* --------------------------------------------------------------------------
   17. 无障碍与工具类
   -------------------------------------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: var(--s-4);
  z-index: 300;
  padding: var(--s-3) var(--s-4);
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--r-card);
  transition: top var(--d-fast) var(--ease-out);
}

.skip-link:focus {
  top: var(--s-3);
  color: var(--on-accent);
}

.tag {
  display: inline-block;
  padding: 3px 11px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent-soft-fg);
  background: var(--accent-soft);
  border-radius: var(--r-pill);
}

.stack > * + * {
  margin-top: var(--s-4);
}

/* 404 */
.error-page {
  min-height: 60vh;
  display: grid;
  place-items: center;
  text-align: center;
}
