/* ==========================================================================
   V21 — 墨玉编排系统 (Jade Editorial)

   官网唯一的视觉语言：深墨页眉 + 暖纸正文 + 青玉强调 + 宋体展示标题。
   它不是再加一层补丁，而是覆盖 V6 / V14 的排版决策：
   - 恢复宋体展示字，建立真正的字号层级（旧版把所有标题压成同一无衬线）
   - 用卡片、底色、留白和光晕建立节奏（旧版只有横线 + 竖线 + 空场）
   - 内页共用同一个深墨 hero，页脚共用同一块深墨收尾
   - 所有尺寸走 rem + clamp()，移动端降为单列，不靠 overflow 遮问题
   载入顺序：style.css → v6.css → v14.css → v21.css（本文件最后）
   ========================================================================== */

:root {
  color-scheme: light;

  /* —— 纸与墨 —— */
  --paper: #f5f2ea;
  --paper-2: #eeeae0;
  --surface: #fffcf6;
  --surface-2: #f0ece2;

  --ink: #121c18;
  --ink-2: #3b463f;
  --muted: #616c63;
  --faint: #7d877e;

  --line: #ddd9cd;
  --line-2: #cbc8ba;
  --line-soft: #e9e5da;

  /* —— 青玉：唯一主色；赤铜只做信号 —— */
  --accent: #1c6c5c;
  --accent-deep: #104a3f;
  --accent-soft: #7bb2a3;
  --accent-on-dark: #9ec9bc;
  --accent-wash: #e3efe9;

  --celadon: var(--accent);
  --celadon-deep: var(--accent-deep);
  --celadon-wash: var(--accent-wash);
  --celadon-light: var(--accent-soft);
  --coral: #b86542;
  --coral-deep: #8c4529;
  --coral-wash: #f7eae2;

  /* —— 字体：宋体负责气质，黑体负责阅读，Manrope 负责数字 —— */
  --display: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --serif: var(--display);
  --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font: var(--sans);
  --mono: "Manrope", "Noto Sans SC", system-ui, sans-serif;

  --fs-display: clamp(2.5rem, 1.7rem + 3.2vw, 4.25rem);
  --fs-h2: clamp(1.75rem, 1.3rem + 1.7vw, 2.5rem);
  --fs-lead: clamp(1rem, 0.94rem + 0.28vw, 1.125rem);
  --fs-body: 1rem;
  --fs-small: 0.9375rem;
  --fs-micro: 0.75rem;

  --r-s: 8px;
  --r-m: 14px;
  --r-l: 20px;
  --r-xl: 28px;

  --shadow-card: 0 18px 44px -32px rgba(18, 28, 24, 0.45);
  --shadow-float: 0 28px 70px -36px rgba(6, 16, 13, 0.65);
  --hero-ink: #111c18;
  --hero-paper: #fbf8f0;
}

html {
  scroll-padding-top: 5.25rem;
}

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

p, li, dd {
  overflow-wrap: break-word;
}

::selection {
  background: var(--accent-wash);
  color: var(--accent-deep);
}

/* --------------------------------------------------------------------------
   1. 排版层级：标题用宋体，正文用黑体，数字用等宽
   -------------------------------------------------------------------------- */
h1, .v5-h1, .page-title, .dl-title, .v9-faq-intro h2 {
  font-family: var(--display) !important;
  font-weight: 600 !important;
  font-size: var(--fs-display) !important;
  line-height: 1.18 !important;
  letter-spacing: -0.035em !important;
  text-wrap: balance;
}

h2, .sec-head h2, .v5-head h2, .card-title, .v5-cta-inner h2 {
  font-family: var(--display) !important;
  font-weight: 600 !important;
  font-size: var(--fs-h2) !important;
  line-height: 1.32 !important;
  letter-spacing: -0.025em !important;
  text-wrap: balance;
}

h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.45;
}

.page-title em, .v5-h1 em {
  font-style: normal;
  color: var(--accent-soft);
  font-weight: 500;
}

.page-lede, .v5-sub, .dl-lede, .sec-intro {
  font-size: var(--fs-lead) !important;
  line-height: 1.8 !important;
  text-wrap: pretty;
}

.page-lede {
  max-width: 48rem !important;
  margin-top: 1.5rem !important;
}

.hero-kicker, .sec-index, .v5-kicker, .v5-eyebrow,
.sponsor-kicker, .footer-col h2, .doc-toc-title {
  font-family: var(--sans) !important;
  font-size: var(--fs-micro) !important;
  font-weight: 700 !important;
  letter-spacing: 0.14em !important;
  color: var(--accent) !important;
}

.hero-kicker i {
  width: 7px !important;
  height: 7px !important;
  border-radius: 50%;
  background: var(--coral) !important;
  box-shadow: 0 0 0 4px rgba(184, 101, 66, 0.16);
}

.hero-edition, .v9-hero-meta, .v9-fact-no, .board-meta,
.release-foot, .footer-status .mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--accent-deep);
  background: var(--accent-wash);
  border: 0 !important;
  border-radius: var(--r-s);
  padding: 0.12em 0.42em;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   2. 导航与按钮
   -------------------------------------------------------------------------- */
.topbar {
  background: rgba(245, 242, 234, 0.92) !important;
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-inner {
  min-block-size: 76px;
}

.brand-name {
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink) !important;
}

.brand-sub {
  font-size: 0.6875rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.brand-mark svg {
  display: block;
  border-radius: 8px;
}

.topnav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-2) !important;
  padding: 0.5rem 0.75rem;
  border-radius: var(--r-s);
}

.topnav a:hover {
  color: var(--accent) !important;
  background: var(--accent-wash);
}

.topnav a[aria-current="page"] {
  color: var(--accent-deep) !important;
  font-weight: 700;
}

.topnav a[aria-current="page"]::after {
  left: 0.75rem;
  right: 0.75rem;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.btn {
  border-radius: var(--r-s) !important;
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 600;
  min-height: 44px;
  padding: 0.7rem 1.25rem;
  box-shadow: none !important;
  transition: background-color 180ms ease, border-color 180ms ease,
    color 180ms ease, transform 180ms ease;
}

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

.btn--primary, .topbar-cta .btn--primary, .hero .btn--primary,
.v5-actions .btn--primary {
  background: var(--accent) !important;
  color: #fff !important;
  border: 1px solid var(--accent) !important;
}

.btn--primary:hover, .topbar-cta .btn--primary:hover,
.hero .btn--primary:hover, .v5-actions .btn--primary:hover {
  background: var(--accent-deep) !important;
  border-color: var(--accent-deep) !important;
  color: #fff !important;
}

.btn--ghost {
  color: var(--accent) !important;
  border-color: var(--line-2) !important;
  background: transparent;
}

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

a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   3. 内页页眉：深墨 + 青玉光晕（全站统一的一张“封面”）
   -------------------------------------------------------------------------- */
.page-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--hero-ink) !important;
  color: var(--hero-paper);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
  padding-block: clamp(72px, 8vw, 112px) !important;
}

.page-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -40% -10% auto auto;
  inline-size: min(62vw, 760px);
  aspect-ratio: 1;
  background: radial-gradient(circle at 50% 50%,
      rgba(124, 190, 168, 0.22), rgba(28, 108, 92, 0.08) 46%, transparent 70%);
  pointer-events: none;
}

.page-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset-inline-start: -12%;
  inset-block-end: -120%;
  inline-size: min(48vw, 540px);
  aspect-ratio: 1;
  border: 1px solid rgba(158, 201, 188, 0.14);
  border-radius: 50%;
  pointer-events: none;
}

.page-hero > .shell {
  position: relative;
  z-index: 1;
}

.hero-masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-bottom: clamp(28px, 3.5vw, 48px);
  border-block-end: 0;
  padding-block-end: 0;
}

.page-hero .hero-kicker {
  color: var(--accent-on-dark) !important;
}

.page-hero .hero-edition {
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
  color: rgba(251, 248, 240, 0.58);
}

.page-hero .page-title {
  color: var(--hero-paper) !important;
  max-width: 24ch;
}

.page-hero .page-lede {
  color: rgba(251, 248, 240, 0.74) !important;
}

.page-hero .page-lede strong, .page-hero .page-lede b {
  color: var(--hero-paper);
}

/* 数据口径页：标题在左，计算轨迹卡在右 */
.pg-metrics .page-hero .shell {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  column-gap: clamp(32px, 5vw, 76px);
  row-gap: 0;
  align-items: center;
}

.pg-metrics .hero-masthead {
  grid-column: 1 / -1;
}

.pg-metrics .page-title,
.pg-metrics .page-lede,
.pg-metrics .mx-formula {
  grid-column: 1;
}

.pg-metrics .mx-hero-visual {
  grid-column: 2;
  grid-row: 2 / span 3;
}

.mx-formula {
  display: inline-flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45em;
  inline-size: fit-content;
  margin-block-start: clamp(28px, 3vw, 40px) !important;
  padding: 0.7rem 1.15rem !important;
  border: 1px solid rgba(158, 201, 188, 0.26) !important;
  border-top: 1px solid rgba(158, 201, 188, 0.26) !important;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(251, 248, 240, 0.75) !important;
  font-family: var(--mono);
  font-size: clamp(0.9375rem, 0.85rem + 0.4vw, 1.125rem);
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(8px);
}

.mx-formula span:last-child {
  color: var(--accent-on-dark) !important;
}

.mx-formula b {
  color: var(--coral) !important;
  font-weight: 600;
}

.mx-formula i {
  color: rgba(251, 248, 240, 0.5) !important;
}

/* 计算轨迹卡：只做装饰，屏幕阅读器跳过 */
.mx-hero-visual {
  position: relative;
  inline-size: 100%;
  max-inline-size: 420px;
  margin-inline-start: auto;
  padding: clamp(24px, 2.4vw, 32px);
  border: 1px solid rgba(158, 201, 188, 0.2);
  border-radius: var(--r-l);
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.025));
  box-shadow: var(--shadow-float);
  backdrop-filter: blur(12px);
  color: var(--hero-paper);
}

.mx-trace-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  font-family: var(--mono);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--accent-on-dark);
}

.mx-trace-top span:last-child {
  color: rgba(251, 248, 240, 0.45);
}

.mx-trace-formula {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 0.3em;
  margin-block: 1.5rem 1.75rem;
  font-family: var(--mono);
  font-size: clamp(1.125rem, 0.95rem + 0.7vw, 1.5rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.mx-trace-formula .tk-name {
  font-weight: 700;
}

.mx-trace-formula .tk-op {
  color: rgba(251, 248, 240, 0.45);
}

.mx-trace-formula .tk-var {
  color: var(--accent-on-dark);
  font-weight: 600;
}

.mx-trace-rows {
  display: grid;
  gap: 1rem;
}

.mx-trace-rows > div {
  display: grid;
  grid-template-columns: 5.25rem 2.5rem minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
}

.mx-trace-rows span {
  font-family: var(--mono);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.1em;
  color: rgba(251, 248, 240, 0.55);
}

.mx-trace-rows b {
  font-family: var(--mono);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  text-align: end;
  color: var(--hero-paper);
}

.mx-trace-rows i {
  display: block;
  height: 6px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.mx-trace-rows i::before {
  content: "";
  display: block;
  width: var(--w);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(to right, var(--accent-soft), var(--accent-on-dark));
}

.mx-trace-rows > div:nth-child(1) i { --w: 75%; }
.mx-trace-rows > div:nth-child(2) i { --w: 25%; }
.mx-trace-rows > div:nth-child(3) i { --w: 100%; }

.mx-trace-foot {
  margin-block-start: 1.75rem;
  padding-block-start: 1rem;
  border-block-start: 1px solid rgba(158, 201, 188, 0.18);
  font-size: 0.8125rem;
  line-height: 1.7;
  color: rgba(251, 248, 240, 0.6);
}

/* --------------------------------------------------------------------------
   4. 章节头：编号成为胶囊标签，不再是一根横线
   -------------------------------------------------------------------------- */
.section {
  padding-block: clamp(64px, 6vw, 88px);
}

.section--flush {
  padding-block-start: clamp(64px, 6vw, 88px);
}

.sec-head {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: end;
  margin-block-end: clamp(36px, 4.5vw, 64px);
  padding-block-start: 0;
  border-block-start: 0;
}

.sec-index {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  inline-size: fit-content;
  margin-block-end: 1.15rem !important;
  padding: 0.35rem 0.8rem;
  border-radius: 100px;
  background: var(--accent-wash);
  font-family: var(--sans) !important;
  font-size: var(--fs-micro) !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  color: var(--accent-deep) !important;
}

.sec-index::before {
  content: "";
  inline-size: 6px;
  block-size: 6px;
  border-radius: 50%;
  background: currentColor;
}

.sec-head-main h2 {
  max-inline-size: 22ch;
}

.sec-intro {
  max-inline-size: 34rem;
  padding-block-end: 0;
  padding-inline-start: 1.25rem;
  border-inline-start: 2px solid var(--accent-soft);
  color: var(--muted) !important;
}

/* --------------------------------------------------------------------------
   5. 数据口径 · 01 战绩与时长
   -------------------------------------------------------------------------- */
.mx-specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 1.6vw, 22px);
  border-block-start: 0;
}

.mx-spec {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(16px, 1.6vw, 22px);
  padding: clamp(24px, 2.4vw, 34px);
  border: 1px solid var(--line) !important;
  border-radius: var(--r-l) !important;
  background: var(--surface) !important;
  box-shadow: var(--shadow-card);
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.mx-spec:hover {
  transform: translateY(-3px);
  border-color: var(--accent-soft) !important;
  box-shadow: 0 26px 52px -32px rgba(18, 28, 24, 0.5);
}

.mx-no {
  display: grid;
  place-items: center;
  inline-size: 42px;
  block-size: 42px;
  padding-block-start: 0;
  border-radius: 12px;
  background: var(--accent-wash);
  color: var(--accent-deep) !important;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0;
}

.mx-spec h3 {
  margin-block-end: 0.8rem;
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  letter-spacing: -0.02em;
  color: var(--ink);
}

.mx-spec p {
  max-inline-size: 58ch;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--ink-2);
}

.mx-spec p + p {
  margin-block-start: 0.85rem;
  padding-inline-start: 0.9rem;
  border-inline-start: 2px solid var(--accent-wash);
}

.mx-spec b {
  color: var(--accent-deep);
  font-weight: 700;
}

.mx-note {
  font-size: 0.875rem !important;
  color: var(--muted) !important;
}

/* --------------------------------------------------------------------------
   6. 数据覆盖：深墨双卡
   -------------------------------------------------------------------------- */
.mx-dark {
  background: #16241f !important;
  color: var(--hero-paper);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding-block-end: clamp(72px, 7vw, 100px) !important;
  position: relative;
  overflow: hidden;
}

.mx-dark::before {
  content: "";
  position: absolute;
  inset: auto -10% -60% auto;
  inline-size: min(52vw, 620px);
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(123, 178, 163, 0.14), transparent 68%);
  pointer-events: none;
}

.mx-dark > .shell {
  position: relative;
}

.mx-dark .sec-head h2 {
  color: var(--hero-paper) !important;
}

.mx-dark .sec-index {
  background: rgba(158, 201, 188, 0.12);
  color: var(--accent-on-dark) !important;
}

.mx-dark .sec-intro {
  color: rgba(251, 248, 240, 0.68) !important;
  border-inline-start-color: rgba(158, 201, 188, 0.5);
}

.mx-split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 1.6vw, 22px);
  margin-block-start: 0;
  border: 0;
  background: transparent;
}

.mx-block {
  position: relative;
  padding: clamp(26px, 2.6vw, 38px);
  border: 1px solid rgba(158, 201, 188, 0.2) !important;
  border-radius: var(--r-l);
  background: rgba(255, 255, 255, 0.045) !important;
  box-shadow: none;
}

.mx-block::before {
  content: "";
  position: absolute;
  inset-block-start: clamp(26px, 2.6vw, 38px);
  inset-inline-start: 0;
  inline-size: 3px;
  block-size: 36px;
  border-radius: 0 3px 3px 0;
  background: var(--accent-soft);
}

.mx-block h3 {
  font-family: var(--display);
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem) !important;
  color: var(--hero-paper) !important;
}

.mx-block p {
  max-inline-size: 52ch;
  font-size: 1rem;
  line-height: 1.8;
  color: rgba(251, 248, 240, 0.72) !important;
}

.mx-block b {
  color: var(--accent-on-dark) !important;
}

/* --------------------------------------------------------------------------
   7. BP 手序：四张规则卡 + 一块数据铭牌
   -------------------------------------------------------------------------- */
.mx-rules {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: clamp(20px, 2.4vw, 32px);
  align-items: start;
  margin-block-start: 0;
}

.mx-rules dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 1.6vw, 22px);
  border-block-start: 0;
}

.mx-rules dl > div {
  display: block;
  padding: clamp(22px, 2.2vw, 30px);
  border: 1px solid var(--line) !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: var(--r-l);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.mx-rules dt {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: var(--r-s);
  background: var(--accent-wash);
  color: var(--accent-deep);
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.mx-rules dd {
  margin-block-start: 1rem;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--ink-2);
}

.mx-fact {
  position: relative;
  overflow: hidden;
  padding: clamp(26px, 2.6vw, 36px);
  border: 1px solid rgba(158, 201, 188, 0.18) !important;
  border-radius: var(--r-l);
  background: linear-gradient(155deg, #1a3b32, #10241e) !important;
  color: var(--hero-paper);
  box-shadow: var(--shadow-card);
}

.mx-fact::after {
  content: "";
  position: absolute;
  inset: -30% -40% auto auto;
  inline-size: 260px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(123, 178, 163, 0.22), transparent 70%);
  pointer-events: none;
}

.mx-fact > b {
  display: block;
  font-family: var(--mono);
  font-size: clamp(3rem, 2rem + 3.2vw, 4.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.055em;
  color: var(--hero-paper);
}

.mx-fact p {
  margin-block: 1.25rem 1rem;
  font-size: var(--fs-small);
  line-height: 1.8;
  color: rgba(251, 248, 240, 0.78) !important;
}

.mx-fact p b {
  color: var(--accent-on-dark) !important;
}

.mx-fact small {
  font-size: 0.8125rem;
  line-height: 1.75;
  color: rgba(251, 248, 240, 0.56);
}

/* --------------------------------------------------------------------------
   8. 边界：四张原则卡
   -------------------------------------------------------------------------- */
.faq-grid.mx-limits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 1.6vw, 22px);
  margin-block-start: 0;
}

.mx-limits .faq-cell {
  padding: clamp(24px, 2.4vw, 32px);
  border: 1px solid var(--line) !important;
  border-radius: var(--r-l) !important;
  background: var(--surface) !important;
  box-shadow: var(--shadow-card);
}

.mx-limits .faq-cell h3 {
  margin-block-end: 0.85rem;
  font-size: 1.25rem;
  color: var(--accent-deep);
}

.mx-limits .faq-cell h3::before {
  content: "";
  display: inline-block;
  inline-size: 8px;
  block-size: 8px;
  margin-inline-end: 0.6rem;
  vertical-align: 0.15em;
  border-radius: 50%;
  background: var(--coral);
}

.mx-limits .faq-cell p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--ink-2);
}

.mx-source {
  margin-block-start: clamp(28px, 3vw, 40px) !important;
  font-size: 0.875rem;
}

.mx-source a {
  color: var(--accent) !important;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

/* --------------------------------------------------------------------------
   9. 收尾 CTA + 页脚
   -------------------------------------------------------------------------- */
.page-tail {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--hero-ink) !important;
  color: var(--hero-paper);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  border-block-start: 0;
  padding-block: clamp(64px, 7vw, 96px);
}

.page-tail::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -60% auto auto -10%;
  inline-size: min(60vw, 700px);
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(124, 190, 168, 0.18), transparent 68%);
  pointer-events: none;
}

.page-tail-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(28px, 4vw, 56px);
  align-items: end;
  border-block-start: 0;
  padding-block-start: 0;
}

.page-tail .sec-index {
  background: rgba(158, 201, 188, 0.12);
  color: var(--accent-on-dark) !important;
}

.page-tail-inner h2 {
  color: var(--hero-paper) !important;
}

.page-tail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
}

.page-tail .text-link,
.page-tail a:not(.btn) {
  color: var(--accent-on-dark) !important;
}

.footer {
  background: #0e1714 !important;
  color: rgba(251, 248, 240, 0.82);
  border-block-start: 1px solid rgba(158, 201, 188, 0.14);
  padding-block-start: clamp(64px, 7vw, 96px);
}

.footer .brand-name {
  color: var(--hero-paper) !important;
}

.footer .brand-sub,
.footer-brand p,
.footer-legal,
.footer-status,
.footer-gh-repo,
.footer-gh-meta,
.footer-gh-kicker {
  color: rgba(251, 248, 240, 0.6) !important;
}

.footer-brand p {
  max-inline-size: 38ch;
  margin-block-start: 1.25rem;
  font-size: var(--fs-small);
  line-height: 1.8;
}

.footer-col h2 {
  color: var(--accent-on-dark) !important;
}

.footer-col a,
.footer-link-btn {
  color: rgba(251, 248, 240, 0.76) !important;
  font-size: var(--fs-small);
  line-height: 2.1;
}

.footer-col a:hover,
.footer-link-btn:hover {
  color: var(--accent-on-dark) !important;
}

.footer-gh {
  border-block-start: 1px solid rgba(158, 201, 188, 0.14);
}

.footer-gh-title a {
  color: var(--hero-paper) !important;
  font-family: var(--display);
  font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  font-weight: 600;
}

.footer-gh-kicker b {
  color: var(--hero-paper) !important;
}

.footer-gh-avatar {
  border-radius: 50%;
}

.footer-legal {
  border-block-start: 1px solid rgba(158, 201, 188, 0.14);
  font-size: 0.8125rem;
}

/* --------------------------------------------------------------------------
   9b. 深色内容带：v6 把 .section--black 的背景与文字全清成了透明，
       这里按 V21 的深墨语言重新点亮（隐私 / 安装 / 下载页共用）
   -------------------------------------------------------------------------- */
.section--black {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #16241f !important;
  color: var(--hero-paper) !important;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  margin-block: 0;
}

.section--black::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -40% -8% auto auto;
  inline-size: min(50vw, 600px);
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(123, 178, 163, 0.14), transparent 68%);
  pointer-events: none;
}

.section--black > .shell {
  position: relative;
}

.section--black h2,
.section--black h3,
.section--black h4,
.section--black b,
.section--black strong {
  color: var(--hero-paper) !important;
}

.section--black p,
.section--black li,
.section--black dd,
.section--black .sec-intro {
  color: rgba(251, 248, 240, 0.76) !important;
}

.section--black .sec-index {
  background: rgba(158, 201, 188, 0.12);
  color: var(--accent-on-dark) !important;
}

.section--black code {
  background: rgba(158, 201, 188, 0.14);
  border-color: rgba(158, 201, 188, 0.2) !important;
  color: var(--accent-on-dark) !important;
}

.section--black .privacy-grid > div,
.section--black .data-card {
  border: 1px solid rgba(158, 201, 188, 0.2) !important;
  border-radius: var(--r-l) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  box-shadow: none;
}

.section--black .data-head .mono {
  color: var(--hero-paper) !important;
}

.section--black .checks li {
  border-block-start-color: rgba(158, 201, 188, 0.18);
}

.section--black .check-no {
  color: var(--accent-on-dark) !important;
}

.section--black .checks .check-no,
.section--black .cta-copy code {
  color: var(--accent-on-dark) !important;
}

/* 页眉紧接深色分区时不做圆角收口，避免出现纸色缺口 */
.pg-product .page-hero,
.pg-privacy .page-hero {
  border-radius: 0;
}

/* --------------------------------------------------------------------------
   10. 首页：同样一套色彩与字阶，封面增加青玉光晕
   -------------------------------------------------------------------------- */
.v5-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--paper) !important;
}

.v5-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -40% -8% auto auto;
  inline-size: min(58vw, 720px);
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(123, 178, 163, 0.2), transparent 68%);
  pointer-events: none;
}

.v5-h1 {
  color: var(--ink) !important;
  max-inline-size: 18ch;
}

.v9-fact {
  border: 1px solid var(--line) !important;
  border-radius: var(--r-m) !important;
  background: var(--surface) !important;
  padding: 1.25rem !important;
  box-shadow: var(--shadow-card);
}

.v9-fact b {
  font-family: var(--display);
  font-size: 1.0625rem;
}

.v9-fact p {
  font-size: 0.875rem;
  color: var(--muted);
}

.v9-fact-no {
  color: var(--accent);
}

.v5-cta, .v5-cta-inner {
  background: var(--hero-ink) !important;
}

.v5-cta h2, .v5-cta .v5-eyebrow {
  color: var(--hero-paper) !important;
}

/* --------------------------------------------------------------------------
   11. 自适应：布局降列，不留横向滚动，不靠裁切遮问题
   -------------------------------------------------------------------------- */
@media (max-width: 980px) {
  .pg-metrics .page-hero .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .pg-metrics .hero-masthead,
  .pg-metrics .page-title,
  .pg-metrics .page-lede,
  .pg-metrics .mx-formula,
  .pg-metrics .mx-hero-visual {
    grid-column: 1;
    grid-row: auto;
  }

  .mx-hero-visual {
    max-inline-size: 480px;
    margin-inline-start: 0;
    margin-block-start: 2.5rem;
  }

  .mx-specs,
  .mx-rules dl,
  .mx-split,
  .faq-grid.mx-limits {
    grid-template-columns: minmax(0, 1fr);
  }

  .mx-rules {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .topbar-inner {
    min-block-size: 64px;
  }

  .topnav {
    display: none;
  }

  .sec-head {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .sec-head-main h2 {
    max-inline-size: none;
  }

  .page-tail-inner {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-gh {
    flex-wrap: wrap;
    gap: 1.5rem;
  }
}

@media (max-width: 520px) {
  .page-hero, .mx-dark, .page-tail {
    border-radius: 0 0 var(--r-l) var(--r-l);
  }

  .mx-dark, .page-tail {
    border-radius: var(--r-l) var(--r-l) 0 0;
  }

  .hero-masthead {
    align-items: flex-start;
    flex-direction: column;
  }

  .mx-spec {
    grid-template-columns: minmax(0, 1fr);
  }

  .mx-trace-rows > div {
    grid-template-columns: 4.75rem 2.25rem minmax(0, 1fr);
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

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

  .mx-spec,
  .btn {
    transition: none;
  }

  .mx-spec:hover,
  .btn:active {
    transform: none;
  }
}

/* ==========================================================================
   V21b — 动态层：渐进增强，默认静态，只有 no-preference 才启动动画
   ========================================================================== */

/* 滚动进度：CSS scroll-driven，无需 JS 监听器 */
body::before {
  content: "";
  display: block;
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  block-size: 3px;
  z-index: 70;
  pointer-events: none;
  background: linear-gradient(to right, var(--accent), var(--accent-soft));
  transform: scaleX(0);
  transform-origin: 0 50%;
}

@keyframes v21-scroll-progress {
  to { transform: scaleX(1); }
}

@media (prefers-reduced-motion: no-preference) {
  body::before {
    animation: v21-scroll-progress linear both;
    animation-timeline: scroll(root block);
  }
}

/* 顶栏：滚动向下收起、向上回来；方向由 site.js 的 is-tucked 统一控制，
   键盘焦点在栏内时保持显示 */
html {
  container-type: scroll-state;
}

.topbar {
  transition: translate 280ms ease-out, box-shadow 280ms ease-out;
}

.topbar.is-tucked:not(:focus-within) {
  translate: 0 -100%;
}

.topbar:focus-within {
  translate: 0 0;
}

:target {
  scroll-margin-top: 5.25rem;
}

/* 导航 SVG 图标：CSS mask + currentColor，装饰性图标不进无障碍树 */
:where(.topnav a, .menu-nav a) {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

:where(.topnav a, .menu-nav a)::before {
  content: "";
  inline-size: 15px;
  block-size: 15px;
  flex: none;
  background-color: currentColor;
  mask: var(--nav-icon, none) no-repeat center / contain;
  opacity: 0.62;
  transition: opacity 180ms ease-out, scale 180ms ease-out;
  pointer-events: none;
}

:where(.topnav a, .menu-nav a):is(:hover, :focus-visible, [aria-current="page"])::before {
  opacity: 1;
  scale: 1.08;
}

.topnav a[href="index.html"],
.menu-nav a[href="index.html"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10.5 12 3l9 7.5'/%3E%3Cpath d='M5.5 9.5V21h13V9.5'/%3E%3C/svg%3E");
}

.topnav a[href="product.html"],
.menu-nav a[href="product.html"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1.5'/%3E%3C/svg%3E");
}

.topnav a[href="metrics.html"],
.menu-nav a[href="metrics.html"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M4 20V11'/%3E%3Cpath d='M10 20V4'/%3E%3Cpath d='M16 20v-6'/%3E%3Cpath d='M22 20H2'/%3E%3C/svg%3E");
}

.topnav a[href="privacy.html"],
.menu-nav a[href="privacy.html"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2 20 5v6c0 5-3.4 8.6-8 11-4.6-2.4-8-6-8-11V5l8-3Z'/%3E%3C/svg%3E");
}

.topnav a[href="opensource.html"],
.menu-nav a[href="opensource.html"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m8 8-4 4 4 4'/%3E%3Cpath d='m16 8 4 4-4 4'/%3E%3C/svg%3E");
}

.topnav a[href="guide.html"],
.menu-nav a[href="guide.html"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h6a3 3 0 0 1 3 3v13a2.5 2.5 0 0 0-2.5-2.5H4z'/%3E%3Cpath d='M20 4h-3a3 3 0 0 0-3 3v13a2.5 2.5 0 0 1 2.5-2.5H20z'/%3E%3C/svg%3E");
}

.topnav a[href="changelog.html"],
.menu-nav a[href="changelog.html"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3.5 2'/%3E%3C/svg%3E");
}

/* 交互反馈：悬停、按下、键盘焦点各自可见 */
:where(a, button, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

:where(.page-hero, .mx-dark, .section--black, .page-tail, .footer, .menu) :focus-visible {
  outline-color: var(--accent-on-dark);
}

.btn {
  transition: background-color 180ms ease, border-color 180ms ease,
    box-shadow 220ms ease-out, scale 260ms ease-out;
}

.btn:hover {
  box-shadow: 0 12px 24px -14px rgba(28, 108, 92, 0.55);
}

.btn:active {
  transform: none;
  scale: 0.97;
}

@supports (animation-timing-function: linear(0, 1)) {
  @media (prefers-reduced-motion: no-preference) {
    .btn {
      transition-timing-function: ease, ease, ease-out,
        linear(0, 0.92 45%, 1.06 72%, 1);
    }
  }
}

/* 首屏入场：错峰上浮，只动 opacity / translate */
@keyframes v21-hero-rise {
  from { opacity: 0; translate: 0 18px; }
}

@keyframes v21-trace-fill {
  from { scale: 0 1; }
}

@keyframes v21-glow-drift {
  to { translate: 0 60px; }
}

@keyframes v21-card-rise {
  from { opacity: 0; translate: 0 16px; }
}

@media (prefers-reduced-motion: no-preference) {
  .page-hero .hero-masthead,
  .page-hero .page-title,
  .page-hero .page-lede,
  .mx-formula,
  .mx-hero-visual {
    animation: v21-hero-rise 720ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .page-hero .page-title { animation-delay: 80ms; }
  .page-hero .page-lede { animation-delay: 160ms; }
  .mx-formula { animation-delay: 240ms; }
  .mx-hero-visual { animation-delay: 180ms; }

  .mx-trace-rows i::before {
    transform-origin: 0 50%;
    animation: v21-trace-fill 900ms 620ms ease-out both;
  }

  .page-hero::before {
    animation: v21-glow-drift linear both;
    animation-timeline: scroll(root block);
    animation-range: 0 620px;
  }

  :where(.mx-spec, .mx-block, .mx-rules dl > div, .mx-limits .faq-cell,
         .faq-grid .faq-cell, .v9-fact) {
    animation: v21-card-rise 620ms ease-out both;
    animation-timeline: view();
    animation-range: entry 0% cover 28%;
  }

  .mx-spec:nth-child(2n),
  .mx-limits .faq-cell:nth-child(2n),
  .faq-grid .faq-cell:nth-child(2n) {
    animation-range: entry 4% cover 32%;
  }
}

/* 卡片用 translate 而不是 transform，悬停与滚动动画互不覆盖 */
.mx-spec {
  transition: translate 260ms ease-out, border-color 180ms ease-out,
    box-shadow 260ms ease-out;
}

.mx-spec:hover {
  transform: none;
  translate: 0 -3px;
}
