/* ============================================================
   fushu.net v2 · 设计系统「域着色坐标系」
   颜色即角度：--hue 代表复数辐角，全站强调色由它推导
   §1 复数 222° · §2 复变函数 276° · §3 分形 158°
   ============================================================ */

:root {
  /* 纸面与墨色 */
  --paper: #F1F4F9;
  --paper-grid: rgba(22, 33, 58, 0.055);
  --paper-raise: #FBFCFE;
  --ink: #16213A;
  --ink-soft: #47566F;
  --ink-faint: #8B97AB;
  --line: rgba(22, 33, 58, 0.16);
  --line-soft: rgba(22, 33, 58, 0.09);

  /* 演算室（深色画布区） */
  --vault: #0C1322;
  --vault-2: #141E33;
  --vault-line: rgba(159, 178, 208, 0.16);
  --vault-text: #C6D3E8;

  /* 动态辐角色相：默认 §1 蓝 */
  --hue: 222;
  --accent: hsl(var(--hue) 68% 42%);
  --accent-deep: hsl(var(--hue) 70% 32%);
  --accent-soft: hsl(var(--hue) 62% 92%);
  --accent-wash: hsl(var(--hue) 55% 96%);

  /* 定理卡强调 */
  --gold: #A9832E;

  /* 字体 */
  --f-display: "Songti SC", "STSong", "SimSun", "Noto Serif SC", serif;
  --f-kai: "KaiTi", "STKaiti", "Kaiti SC", "Songti SC", serif;
  --f-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --f-math: "STIX Two Text", "Cambria Math", "Times New Roman", Georgia, serif;
  --f-mono: "Cascadia Mono", "JetBrains Mono", "SF Mono", Consolas, monospace;

  --w-page: 1080px;
  --w-narrow: 760px;
  --radius: 3px;
  /* 语义化令牌：小控件用 --radius（3px）；卡片/面板/画布用 --radius-panel（6px） */
  --radius-panel: 6px;
  --dur-fast: 0.15s;
  --dur-base: 0.22s;
  --shadow-card: 0 16px 36px rgba(22, 33, 58, 0.14);
}

/* ---------- 基础 ---------- */

* { box-sizing: border-box; }

/* 恢复 [hidden] 标准语义：任何作者 CSS 的 display（如 .btn 的 inline-flex）
   都会覆盖 UA 层的 [hidden]{display:none}，导致隐藏失效（M40 qz-next 案例） */
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background-color: var(--paper);
  /* 坐标纸网格 + 主轴线 + 顶部辐角色晕：数学作业本的隐喻，随章节 --hue 变色 */
  background-image:
    radial-gradient(1200px 480px at 50% -200px, hsl(var(--hue) 62% 90% / 0.6), transparent 70%),
    url("../img/grid-paper.svg"),
    linear-gradient(var(--paper-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--paper-grid) 1px, transparent 1px);
  background-size: auto, 56px 56px, 28px 28px, 28px 28px;
  background-repeat: no-repeat, repeat, repeat, repeat;
  -webkit-tap-highlight-color: rgba(22, 33, 58, 0.08);
}

::selection {
  background: hsl(var(--hue) 68% 88%);
  color: var(--ink);
}

a { color: var(--accent-deep); }
a:hover { color: var(--accent); }

img, canvas { max-width: 100%; }

h1, h2, h3 {
  font-family: var(--f-display);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.015em;
  text-wrap: balance;
}

h1 { font-size: clamp(30px, 4.6vw, 46px); margin: 0.4em 0; }
h2 { font-size: clamp(22px, 3vw, 30px); margin: 1.6em 0 0.6em; }
h3 { font-size: 19px; margin: 1.4em 0 0.5em; }

p { margin: 0.8em 0; }

small, .tnum { font-variant-numeric: tabular-nums; }

/* 焦点态：只在键盘导航时出现 */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theater :focus-visible,
.vault :focus-visible {
  outline-color: #EAF0FA;
}

/* 跳转到正文（无障碍） */
.skip-link {
  position: fixed;
  top: -48px;
  left: 12px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  text-decoration: none;
  /* 用 transform 代替 top：位移改由合成层处理，避免每次触发 layout 回流
     （-48px + 60px = 12px，与原先 focus 时的 top:12px 视觉等价） */
  transform: translateY(0);
  transition: transform var(--dur-fast) ease;
}
.skip-link:focus-visible { transform: translateY(60px); color: #fff; }

/* 锚点不被粘性导航遮住 */
[id] { scroll-margin-top: 84px; }

/* ---------- 页面容器 ---------- */

.page {
  max-width: var(--w-page);
  margin: 0 auto;
  padding: 0 24px;
}
.narrow {
  max-width: var(--w-narrow);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 顶部导航 ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(241, 244, 249, 0.9);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  backdrop-filter: blur(10px) saturate(150%);
  border-bottom: 1px solid var(--line-soft);
}

.nav-inner {
  max-width: var(--w-page);
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--f-math);
  font-size: 21px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.brand .mark {
  font-size: 24px;
  color: var(--accent);
  transition: color 0.2s ease;
}
.brand:hover .mark { color: hsl(var(--hue) 68% 55%); }
.brand small {
  font-family: var(--f-kai);
  font-size: 13px;
  color: var(--ink-faint);
  letter-spacing: 2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  list-style: none;
  padding: 0;
}
.nav-links a {
  display: inline-block;
  padding: 6px 6px;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 12.5px;
  border-radius: var(--radius);
  transition: color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.nav-links a:hover { color: var(--ink); background: var(--accent-wash); }
.nav-links a.active {
  color: var(--accent-deep);
  background: var(--accent-soft);
}
.nav-links .sec {
  font-family: var(--f-math);
  font-size: 11px;
  color: var(--accent);
  margin-right: 3px;
}

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raise);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

/* ---------- 首页 Hero（深色视觉带：域着色的夜空） ---------- */

.hero {
  position: relative;
  max-width: none;
  margin: 0 0 48px;
  padding: 76px max(24px, calc(50vw - 516px)) 96px;
  color: #EAF0FA;
  background: linear-gradient(178deg, #101A2E 0%, #0C1322 62%, #0A101C 100%);
  border-bottom: 1px solid rgba(228, 184, 76, 0.22);
  overflow: hidden;
  isolation: isolate;
}
/* 域着色色环：锥形渐变跟随 --hue，拖动色环时整个视觉带随之流转 */
.hero::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: conic-gradient(
    from calc(var(--hue) * 1deg + 24deg) at 82% 22%,
    hsl(0 62% 56% / 0.13), hsl(60 62% 56% / 0.11), hsl(120 62% 56% / 0.10),
    hsl(180 62% 56% / 0.13), hsl(240 62% 56% / 0.11), hsl(300 62% 56% / 0.10),
    hsl(0 62% 56% / 0.13));
  filter: blur(46px);
  pointer-events: none;
}
/* 颗粒（防色带）与底部金线分界 */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../img/grain.svg");
  background-size: 160px 160px;
  opacity: 0.4;
  pointer-events: none;
}
.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(300px, 460px) 1fr;
  gap: 56px;
  align-items: center;
}
.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--f-kai);
  font-size: 15px;
  letter-spacing: 4px;
  color: #93A3C2;
  margin-bottom: 12px;
}
.hero-eyebrow::before {
  content: "";
  width: 34px;
  height: 1px;
  background: linear-gradient(90deg, hsl(var(--hue) 62% 62% / 0.9), transparent);
}
.hero-title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(58px, 9vw, 108px);
  line-height: 1.05;
  margin: 0;
  color: #F4F8FF;
  text-shadow: 0 2px 30px rgba(12, 19, 34, 0.6);
}
.hero-title .accent-dot {
  color: hsl(var(--hue) 72% 66%);
  transition: color 0.25s ease;
}
.hero-formula {
  font-family: var(--f-math);
  font-size: clamp(18px, 2.4vw, 24px);
  color: #C6D3E8;
  margin: 18px 0 10px;
}
.hero-sub {
  max-width: 34em;
  color: #A9B8D0;
  font-size: 16.5px;
}
.hero-sub strong, .hero-sub b { color: #EAF0FA; font-weight: 600; }
.hero-sub em {
  font-family: var(--f-math);
  font-style: italic;
  color: hsl(var(--hue) 70% 70%);
}
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 34px;
  margin-top: 24px;
  font-size: 13px;
  color: #7787A5;
}
.hero-stats span { display: inline-flex; align-items: baseline; gap: 7px; }
.hero-stats b {
  font-family: var(--f-math);
  font-size: 24px;
  font-weight: 400;
  color: hsl(var(--hue) 72% 68%);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 24px hsl(var(--hue) 70% 60% / 0.35);
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.hero-stage {
  position: relative;
}
.hero-stage canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  touch-action: none;
  cursor: grab;
  box-shadow:
    0 0 0 1px rgba(198, 211, 232, 0.14),
    0 0 60px -12px hsl(var(--hue) 65% 55% / 0.5),
    0 30px 60px -20px rgba(6, 10, 20, 0.8);
}
.hero-stage canvas:active { cursor: grabbing; }
.hero-hint {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #7787A5;
  font-size: 13.5px;
  flex-wrap: wrap;
}
.hero-hint .range { flex: 1 1 160px; min-width: 120px; accent-color: hsl(var(--hue) 65% 62%); }
.hero-hint label { color: #93A3C2; }
.hero-hint output {
  white-space: nowrap;
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
  color: #C6D3E8;
  flex: 0 0 auto;
}
/* hero 里的按钮：深底上更亮 */
.hero .btn {
  padding: 12px 24px;
  font-size: 15.5px;
  background: hsl(var(--hue) 66% 50%);
  border-color: hsl(var(--hue) 60% 58%);
  box-shadow: 0 8px 24px -8px hsl(var(--hue) 70% 50% / 0.55);
}
.hero .btn:hover:not(:disabled) {
  background: hsl(var(--hue) 68% 58%);
  box-shadow: 0 10px 30px -8px hsl(var(--hue) 72% 55% / 0.7);
}
.hero .btn--ghost {
  background: rgba(20, 30, 51, 0.5);
  color: #C6D3E8;
  border-color: rgba(159, 178, 208, 0.35);
}
.hero .btn--ghost:hover:not(:disabled) {
  background: rgba(30, 44, 74, 0.7);
  color: #EAF0FA;
  border-color: hsl(var(--hue) 60% 60%);
}

/* ---------- 板块 § 头 ---------- */

.board {
  position: relative;
  margin: 92px 0 24px;
}
.board-head {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 14px;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 10px;
  margin-bottom: 22px;
}
/* 章头右侧：金色阻尼正弦装饰（自制 ornament-curve.svg） */
.board-head::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 8px;
  width: min(220px, 34%);
  height: 56px;
  background: url("../img/ornament-curve.svg") right center / contain no-repeat;
  pointer-events: none;
}
/* 章节公式水印（data-formula 属性提供内容；上提避开章头分隔线） */
.board[data-formula]::before {
  content: attr(data-formula);
  position: absolute;
  right: 0;
  top: -46px;
  max-width: 58%;
  overflow: hidden;
  font-family: var(--f-math);
  font-style: italic;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1;
  color: hsl(var(--hue) 55% 46% / 0.07);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}
.board-sec {
  font-family: var(--f-math);
  font-size: 30px;
  color: var(--accent);
  line-height: 1;
  transition: color 0.2s ease;
}
.board-title {
  font-family: var(--f-display);
  font-size: clamp(24px, 3.4vw, 34px);
  margin: 0;
}
.board-new {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--paper-raise);
  background: var(--accent);
  border-radius: 99px;
  padding: 3px 10px;
  transform: translateY(-8px);
}
.board-desc {
  color: var(--ink-soft);
  max-width: 46em;
  margin: 0 0 24px;
}

/* ---------- 模块卡片 ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.card {
  position: relative;
  display: block;
  background: var(--paper-raise);
  border: 1px solid var(--line-soft);
  border-top: 3px solid hsl(var(--hue) 68% 42%);
  border-radius: var(--radius-panel);
  padding: 20px 22px 18px;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  overflow: hidden;
}
/* 顶部扫光：hover 时点亮 */
.card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -3px;
  height: 3px;
  background: linear-gradient(90deg, transparent 8%, hsl(var(--hue) 68% 58%) 50%, transparent 92%);
  opacity: 0;
  transition: opacity var(--dur-base) ease;
  pointer-events: none;
}
/* 右上角淡光晕 */
.card::after {
  content: "";
  position: absolute;
  top: -46px;
  right: -46px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, hsl(var(--hue) 70% 60% / 0.10), transparent 70%);
  pointer-events: none;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
  border-color: hsl(var(--hue) 45% 70%);
}
.card:hover::before { opacity: 1; }
.card-tag {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: hsl(var(--hue) 40% 34%);
  text-transform: uppercase;
  background: hsl(var(--hue) 52% 94%);
  border: 1px solid hsl(var(--hue) 40% 86%);
  border-radius: 3px;
  padding: 2px 8px;
  margin-bottom: 10px;
}
.card-title {
  font-family: var(--f-display);
  font-size: 21px;
  font-weight: 700;
  margin: 6px 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.card-desc {
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.65;
  margin: 0 0 12px;
}
.card-go {
  display: inline-block;
  font-size: 14px;
  color: var(--accent-deep);
  font-weight: 600;
  transition: transform 0.2s ease, color 0.2s ease;
}
.card:hover .card-go { color: var(--accent); transform: translateX(5px); }

.chip {
  display: inline-block;
  font-size: 12.5px;
  padding: 2px 10px;
  border-radius: 99px;
  background: var(--accent-wash);
  color: var(--accent-deep);
  border: 1px solid hsl(var(--hue) 50% 85%);
  margin-right: 6px;
}

.card-soon {
  border-top-color: var(--line);
  background: transparent;
  color: var(--ink-faint);
  cursor: default;
}
.card-soon .card-title { color: var(--ink-faint); }
.card-soon:hover { transform: none; box-shadow: none; border-color: var(--line-soft); }

/* ---------- 定义 / 定理卡（教材体例） ---------- */

.theorem {
  position: relative;
  margin: 22px 0;
  padding: 16px 20px 16px 64px;
  background: var(--paper-raise);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
}
.theorem::before {
  content: attr(data-kind);
  position: absolute;
  left: 14px;
  top: 18px;
  writing-mode: vertical-rl;
  font-family: var(--f-kai);
  font-size: 14px;
  letter-spacing: 4px;
  color: var(--gold);
}
.theorem p:first-child { margin-top: 0; }
.theorem p:last-child { margin-bottom: 0; }
.theorem .math { font-size: 1.06em; }

/* ---------- 演算室（深色交互面板） ---------- */

.theater {
  margin: 30px 0;
  background: var(--vault);
  border-radius: var(--radius-panel);
  border: 1px solid var(--vault-line);
  overflow: hidden;
  box-shadow:
    0 0 0 1px hsl(var(--hue) 50% 45% / 0.10),
    0 26px 60px -18px rgba(10, 16, 28, 0.45);
}
.theater-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--vault-line);
  background: linear-gradient(180deg, #111B30, var(--vault));
  color: var(--vault-text);
  font-size: 13.5px;
  flex-wrap: wrap;
}
.theater-head .module-code {
  font-family: var(--f-mono);
  letter-spacing: 2px;
  color: hsl(var(--hue) 65% 68%);
  font-size: 12px;
}
.theater-head .tip { margin-left: auto; color: #A9B8D0; font-size: 12.5px; }

.theater-body { padding: 14px; }
.theater-body canvas.stage {
  display: block;
  width: 100%;
  border-radius: var(--radius-panel);
  background: #0A101C;
  touch-action: none;
  cursor: crosshair;
}
.theater-body canvas.stage.draggable { cursor: grab; }
.theater-body canvas.stage.draggable:active { cursor: grabbing; }

/* 双画布演算室：主画布 + 侧画布（M43 波形/相平面、M44 摆/能量条） */
.theater-body.duo {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.theater-body.duo .duo-main,
.theater-body.duo .duo-side { min-width: 0; }

.theater-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  padding: 12px 18px;
  border-top: 1px solid var(--vault-line);
  color: var(--vault-text);
}
.ctl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  min-width: 0;
}
.ctl .lbl, .ctl > label { color: #93A3C2; white-space: nowrap; }
.ctl output, .ctl .val {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
  color: #E8EEF9;
  min-width: 4.5em;
  text-align: left;
}

.readout {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  padding: 12px 18px;
  border-top: 1px solid var(--vault-line);
  font-family: var(--f-mono);
  font-size: 13.5px;
}
.readout-item { color: #93A3C2; white-space: nowrap; }
.readout-item b {
  font-weight: 400;
  color: #EAF0FA;
  font-variant-numeric: tabular-nums;
  margin-left: 6px;
}
.readout-item b.warn { color: #E5484D; }

/* 深色区里的控件 */

.theater .btn {
  background: var(--vault-2);
  color: var(--vault-text);
  border: 1px solid var(--vault-line);
}
.theater .btn:hover:not(:disabled) {
  background: #1B2740;
  color: #fff;
  border-color: hsl(var(--hue) 50% 55%);
}

.theater input[type="range"],
.theater input[type="checkbox"] { accent-color: hsl(var(--hue) 65% 60%); }

.theater select {
  background-color: var(--vault-2);
  color: var(--vault-text);
  border: 1px solid var(--vault-line);
}

.theater .seg .seg-btn {
  background: transparent;
  color: #93A3C2;
  border: 1px solid var(--vault-line);
}
.theater .seg .seg-btn[aria-pressed="true"] {
  background: hsl(var(--hue) 60% 26%);
  color: #fff;
  border-color: hsl(var(--hue) 55% 50%);
}

/* ---------- 通用控件 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 15px;
  font-family: var(--f-body);
  border-radius: var(--radius);
  border: 1px solid var(--accent-deep);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease, border-color var(--dur-fast) ease, transform var(--dur-fast) ease;
}
.btn:hover:not(:disabled) {
  background: var(--accent-deep);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -10px hsl(var(--hue) 68% 40% / 0.55);
}
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn--ghost {
  background: transparent;
  color: var(--accent-deep);
}
.btn--ghost:hover:not(:disabled) { background: var(--accent-soft); }

.btn--small { padding: 7px 14px; font-size: 13.5px; }

.range { accent-color: var(--accent); }

select {
  font-family: var(--f-body);
  font-size: 14px;
  padding: 7px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background-color: var(--paper-raise);
  color: var(--ink);
  cursor: pointer;
}
label { user-select: none; }

.seg { display: inline-flex; border-radius: var(--radius); overflow: hidden; }
.seg-btn {
  padding: 7px 14px;
  font-size: 13.5px;
  border: 1px solid var(--line);
  background: var(--paper-raise);
  color: var(--ink-soft);
  cursor: pointer;
  touch-action: manipulation;
}
.seg-btn + .seg-btn { margin-left: -1px; }
.seg-btn[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 600;
}

/* ---------- 正文与公式 ---------- */

.article {
  font-size: 16.5px;
  color: var(--ink);
}
.article p, .article li { max-width: 72ch; }
/* 正文内链：淡色下划，悬停点亮（可读性 + 现代排版惯例） */
.article a {
  text-decoration: underline;
  text-decoration-color: hsl(var(--hue) 55% 55% / 0.45);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.article a:hover { text-decoration-color: var(--accent); }
.article h2 {
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}

.math {
  font-family: var(--f-math);
  font-size: 1.03em;
  white-space: nowrap;
}
.math i, i.math { font-style: italic; font-family: var(--f-math); }
.frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: middle;
  line-height: 1.25;
  font-size: 0.92em;
  margin: 0 3px;
}
.frac > span:first-child { border-bottom: 1px solid currentColor; padding: 0 4px; }

.formula-hero {
  font-family: var(--f-math);
  font-size: clamp(20px, 3vw, 30px);
  text-align: center;
  margin: 28px 0;
  color: var(--ink);
}
.formula-hero .live {
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
}

blockquote {
  font-family: var(--f-kai);
  font-size: 1.1em;
  color: var(--ink-soft);
  margin: 26px 0;
  padding: 6px 22px;
  border-left: 3px solid hsl(var(--hue) 45% 70%);
  background: var(--accent-wash);
  border-radius: 0 var(--radius) var(--radius) 0;
}
blockquote p { margin: 0.5em 0; }

/* ---------- 面包屑 ---------- */

.crumbs {
  font-size: 13.5px;
  color: var(--ink-faint);
  margin: 26px 0 6px;
}
.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.crumbs a { color: var(--ink-faint); text-decoration: none; }
.crumbs a:hover { color: var(--accent-deep); }
.crumbs .sep { color: var(--line); }
.crumbs [aria-current="page"] { color: var(--ink-soft); }

/* ---------- 上下页 / 相关模块 ---------- */

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 56px 0 8px;
}
.pager a {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  background: var(--paper-raise);
  transition: border-color var(--dur-fast) ease, transform var(--dur-fast) ease;
  min-width: 0;
}
.pager a:hover { border-color: hsl(var(--hue) 45% 65%); transform: translateY(-2px); }
.pager .dir {
  font-size: 12.5px;
  color: var(--ink-faint);
  letter-spacing: 1px;
}
.pager .to {
  font-family: var(--f-display);
  font-size: 18px;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pager .next { text-align: right; }

.related {
  margin: 30px 0 10px;
  color: var(--ink-soft);
  font-size: 14.5px;
}

/* ---------- 简史时间线 ---------- */

.timeline {
  position: relative;
  margin: 40px 0;
  padding-left: 26px;
  border-left: 2px solid hsl(var(--hue) 40% 78%);
}
.tl-item {
  position: relative;
  margin: 26px 0;
  max-width: 72ch;
}
.tl-item::before {
  content: "";
  position: absolute;
  left: -32px;
  top: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--accent);
}
.tl-year {
  font-family: var(--f-math);
  font-size: 15px;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
}
.tl-item h3 { margin: 2px 0 6px; font-size: 20px; }
.tl-item p { color: var(--ink-soft); margin: 0; }

/* ---------- 页脚（深色收尾，与 hero 呼应） ---------- */

.site-footer {
  position: relative;
  margin-top: 110px;
  border-top: 3px solid hsl(var(--hue) 55% 46% / 0.65);
  background:
    linear-gradient(180deg, rgba(20, 30, 51, 0.55), rgba(10, 16, 28, 0.95)),
    url("../img/field-rings.svg") right -110px top -70px / 620px no-repeat,
    linear-gradient(180deg, #0E1626, #0C1322);
  color: var(--vault-text);
  overflow: hidden;
}
.site-footer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../img/grain.svg");
  background-size: 160px 160px;
  opacity: 0.3;
  pointer-events: none;
}
.footer-inner {
  position: relative;
  z-index: 1;
  max-width: var(--w-page);
  margin: 0 auto;
  padding: 40px 24px 32px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 30px;
}
.footer-brand {
  font-family: var(--f-math);
  font-size: 20px;
  color: #EAF0FA;
}
.footer-brand .mark { color: hsl(var(--hue) 70% 66%); }
.footer-note {
  color: #7787A5;
  font-size: 13.5px;
  margin-top: 8px;
  max-width: 40ch;
}
.footer-col h4 {
  font-family: var(--f-body);
  font-size: 13px;
  letter-spacing: 2px;
  color: #7787A5;
  font-weight: 600;
  margin: 0 0 10px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col a {
  display: inline-block;
  color: #9FB0D0;
  text-decoration: none;
  font-size: 14px;
  padding: 3px 0;
  transition: color var(--dur-fast) ease, transform var(--dur-fast) ease;
}
.footer-col a:hover { color: #EAF0FA; transform: translateX(3px); }
.footer-base {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--vault-line);
  padding: 14px 24px;
  text-align: center;
  color: #7787A5;
  font-size: 12.5px;
}

/* ---------- 响应式 ---------- */

@media (max-width: 900px) {
  .hero { padding: 56px 24px 76px; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { text-align: left; }
}

@media (max-width: 1023px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper-raise);
    border-bottom: 1px solid var(--line);
    padding: 8px 20px 14px;
    margin-left: 0;
    max-height: 72vh;
    overflow-y: auto;
    scrollbar-width: thin;
  }
  .nav-links[data-open="true"] { display: flex; }
  .nav-links a { padding: 12px 6px; border-bottom: 1px dashed var(--line-soft); }
}

@media (max-width: 640px) {
  .footer-inner { grid-template-columns: 1fr; gap: 20px; }
  .theorem { padding-left: 52px; }
  .board-head { flex-wrap: wrap; }
  /* 双画布演算室在窄屏堆叠为单栏 */
  .theater-body.duo { grid-template-columns: 1fr; }
  /* 长公式在窄屏允许折行，防止横向溢出（短公式不受影响） */
  .math { white-space: normal; }
}

/* ---------- 动效 ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .btn, .pager a, .card-go, .fx-card, .qz-opt, .ca-key { transition: none; }
  .card:hover, .btn:hover:not(:disabled), .pager a:hover, .fx-card:hover { transform: none; }
  .card:hover .card-go { transform: none; }
  .card:hover::before { opacity: 0; }
  .skip-link { transition: none; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* 滚动入场：nav.js 负责加 .reveal / .is-in（无 JS 时内容直接可见，渐进增强） */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.is-in { opacity: 1; transform: none; }
.card-grid .card:nth-child(2) { transition-delay: 0.06s; }
.card-grid .card:nth-child(3) { transition-delay: 0.12s; }
.card-grid .card:nth-child(4) { transition-delay: 0.18s; }
.card-grid .card:nth-child(5) { transition-delay: 0.24s; }
.card-grid .card:nth-child(6) { transition-delay: 0.30s; }

/* ---------- 工具页输入 ---------- */

.tf {
  font-family: var(--f-body);
  font-size: 14px;
  padding: 7px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--paper-raise);
  color: var(--ink);
  width: 100%;
}
textarea.tf { resize: vertical; min-height: 64px; }
.tf:focus { border-color: hsl(var(--hue) 50% 55%); }
.theater .tf {
  background-color: var(--vault-2);
  color: var(--vault-text);
  border-color: var(--vault-line);
}
.data-table { border-collapse: collapse; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { border: 1px solid var(--vault-line); padding: 5px 8px; font-size: 13px; color: var(--vault-text); text-align: center; }
.data-table input {
  width: 52px;
  font-family: var(--f-mono);
  text-align: center;
  background: var(--vault-2);
  color: #EAF0FA;
  border: 1px solid var(--vault-line);
  border-radius: 3px;
  padding: 4px;
  font-size: 13px;
}
.stat-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  padding: 12px 18px;
  border-top: 1px solid var(--vault-line);
  font-family: var(--f-mono);
  font-size: 13.5px;
}
.stat-list span { color: #93A3C2; white-space: nowrap; }
.stat-list b { font-weight: 400; color: #EAF0FA; font-variant-numeric: tabular-nums; margin-left: 6px; }
.err-inline {
  padding: 6px 18px;
  border-top: 1px solid var(--vault-line);
  color: #E8A0A0;
  font-size: 13px;
  min-height: 0;
}
.err-inline:empty { display: none; }

/* 进入动效（仅一次性、可被系统偏好关闭） */
.fade-in {
  animation: fadeIn 0.5s ease both;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .fade-in { animation: none; }
}

/* ============================================================
   视觉增强层（2026-11 视觉升级追加）
   hero 深色视觉带 / 章节公式水印 / 章头曲线装饰 /
   卡片扫光徽章 / 演算室外发光 / 深色页脚 / 滚动入场
   ——主要规则已并入上方对应段落，此处为小屏微调与补充
   ============================================================ */

@media (max-width: 640px) {
  .hero { padding: 46px 20px 62px; }
  .hero-stats { gap: 8px 22px; }
  .hero-stats b { font-size: 20px; }
  .board[data-formula]::before { top: -34px; max-width: 66%; }
  .board-head::after { width: 120px; opacity: 0.7; }
}

/* 演算室悬停时边框轻微点亮（模块页的焦点感） */
.theater:hover {
  box-shadow:
    0 0 0 1px hsl(var(--hue) 55% 50% / 0.22),
    0 26px 60px -18px rgba(10, 16, 28, 0.5);
}

/* 面包屑下的首屏标题带一道淡金下划（模块页版式层级） */
.article > h1:first-child {
  padding-bottom: 0.35em;
  border-bottom: 1px solid hsl(var(--hue) 45% 80%);
  margin-bottom: 0.2em;
}

/* ============================================================
   模块专属样式：M34 科学计算器（演算室内的显示区与键盘）
   ============================================================ */

.ca-display {
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--vault-line);
  background: linear-gradient(180deg, #0A101C, #0C1322);
}
.ca-expr {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #C6D3E8;
  font-family: var(--f-mono);
  font-size: 20px;
  text-align: right;
  padding: 2px 0 6px;
  caret-color: hsl(var(--hue) 70% 66%);
}
.ca-expr::placeholder { color: #55627F; }
.ca-out {
  min-height: 34px;
  font-family: var(--f-mono);
  font-size: 27px;
  line-height: 34px;
  color: hsl(var(--hue) 75% 68%);
  text-align: right;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
  text-shadow: 0 0 22px hsl(var(--hue) 70% 60% / 0.30);
}
.ca-out.is-err {
  color: #E8A0A0;
  font-size: 14.5px;
  line-height: 20px;
  min-height: 20px;
  text-shadow: none;
  text-align: left;
}

/* 函数键行：14 键 = 7 列 × 2 行，任何视口下都满行对齐、不留尾空 */
.ca-fns {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
  padding: 12px 18px 6px;
  border-bottom: 1px solid var(--vault-line);
}
.ca-key {
  padding: 9px 4px;
  font-family: var(--f-mono);
  font-size: 15px;
  background: var(--vault-2);
  color: var(--vault-text);
  border: 1px solid var(--vault-line);
  border-radius: var(--radius);
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.12s ease, transform 0.12s ease;
  user-select: none;
}
.ca-key:hover:not(:disabled) { background: #1B2740; color: #fff; }
.ca-key:active { transform: translateY(1px); }
.ca-key--fn { padding: 7px 11px; font-size: 13px; }

/* 主键盘 4×6 */
.ca-keys {
  display: grid;
  grid-template-columns: repeat(4, minmax(56px, 1fr));
  gap: 7px;
  padding: 12px 18px 8px;
}
.ca-key--eq {
  background: hsl(var(--hue) 60% 34%);
  border-color: hsl(var(--hue) 55% 48%);
  color: #fff;
  font-weight: 600;
}
.ca-key--eq:hover:not(:disabled) { background: hsl(var(--hue) 62% 42%); }

/* 计算历史 */
.ca-hist {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 176px;
  overflow-y: auto;
  padding: 8px 18px 12px;
  border-top: 1px solid var(--vault-line);
}
.ca-hist:empty { display: none; }
.ca-hist button {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  color: #93A3C2;
  font-family: var(--f-mono);
  font-size: 13px;
  padding: 4px 8px;
  cursor: pointer;
  text-align: left;
  min-width: 0;
}
.ca-hist button:hover { background: var(--vault-2); color: #EAF0FA; }
.ca-hist button .hs {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ca-hist button .hv {
  color: hsl(var(--hue) 70% 66%);
  white-space: nowrap;
  flex: 0 0 auto;
}

@media (max-width: 640px) {
  .ca-expr { font-size: 17px; }
  .ca-out { font-size: 23px; }
  .ca-keys { grid-template-columns: repeat(4, 1fr); }
  .ca-fns { gap: 5px; }
  .ca-key--fn { padding: 6px 2px; font-size: 12px; }
}

/* ============================================================
   模块专属样式：M37 图着色（调色板图例）
   ============================================================ */

.gc-palette {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  padding: 10px 4px 0;
  color: #93A3C2;
  font-size: 12.5px;
}
.gc-palette span { display: inline-flex; align-items: center; gap: 6px; }
.gc-palette i {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px rgba(234, 240, 250, 0.18);
}
.gc-palette .gc-note { color: #6B7A99; }

/* ============================================================
   全站体验升级（渐进增强，nav.js 注入）
   ============================================================ */

/* 阅读进度条：颜色随章节 --hue 流转 */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 60;
  pointer-events: none;
  background: linear-gradient(90deg, hsl(var(--hue, 222) 70% 46%), hsl(var(--hue, 222) 82% 64%));
  box-shadow: 0 1px 10px hsl(var(--hue, 222) 70% 55% / 0.35);
}

/* 键盘翻页提示：仅指针精细设备显示 */
.pager-keyhint {
  display: none;
  margin: 10px 2px 0;
  text-align: right;
  color: var(--ink-faint);
  font-size: 12px;
  letter-spacing: 1px;
}
@media (hover: hover) and (pointer: fine) {
  .pager-keyhint { display: block; }
}

/* ============================================================
   模块专属样式：M39–M41 学习中心（检索 / 练习 / 数据表）
   ============================================================ */

/* —— 检索工具行（M39/M41 共用） —— */
.fx-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
  padding: 14px 18px 4px;
}
.fx-search {
  flex: 1 1 240px;
  min-width: 0;
  background: #0A101C;
  border: 1px solid var(--vault-line);
  border-radius: var(--radius);
  color: #C6D3E8;
  font-size: 14px;
  padding: 9px 12px;
  outline: none;
  transition: border-color var(--dur-fast) ease;
  text-overflow: ellipsis;   /* 占位符过长时以 … 截断，不露半字符 */
}
.fx-search::placeholder { color: #55627F; }
.fx-search:focus { border-color: hsl(var(--hue) 55% 55%); }

/* —— 章节圆片（带每章 --hue，激活时随章色发光） —— */
.fx-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 18px 14px;
  border-bottom: 1px solid var(--vault-line);
}
.fx-chip {
  padding: 5px 12px;
  font-size: 12.5px;
  border-radius: 999px;
  border: 1px solid var(--vault-line);
  background: transparent;
  color: #93A3C2;
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease, background-color 0.12s ease;
}
.fx-chip:hover { color: #EAF0FA; }
.fx-chip[aria-pressed="true"] {
  background: hsl(var(--hue) 34% 22%);
  border-color: hsl(var(--hue) 48% 52%);
  color: #EAF0FA;
  box-shadow: 0 0 0 1px hsl(var(--hue) 42% 38% / 0.4);
}

/* —— M39 公式卡片 —— */
.fx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 10px;
  padding: 14px 18px 18px;
}
.fx-card {
  background: var(--vault-2);
  border: 1px solid var(--vault-line);
  border-radius: var(--radius-panel);
  padding: 12px 14px 10px;
  transition: border-color var(--dur-fast) ease, transform var(--dur-fast) ease;
}
.fx-card:hover { border-color: hsl(var(--hue) 45% 52%); transform: translateY(-1px); }
.fx-name { font-family: var(--f-display); color: #EAF0FA; font-size: 15px; }
.fx-formula { font-family: var(--f-math); color: hsl(var(--hue) 72% 66%); font-size: 15.5px; margin: 6px 0 4px; }
.fx-note { color: #8B99B8; font-size: 12.5px; line-height: 1.55; }
.fx-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; }
.fx-badge {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 999px;
  color: hsl(var(--hue) 75% 70%);
  border: 1px solid hsl(var(--hue) 45% 42%);
  background: hsl(var(--hue) 32% 14%);
  white-space: nowrap;
}
.fx-actions { display: inline-flex; align-items: center; gap: 10px; }
.fx-go { color: hsl(var(--hue) 68% 66%); font-size: 12.5px; text-decoration: none; white-space: nowrap; }
.fx-go:hover { text-decoration: underline; }
.fx-star {
  background: transparent;
  border: none;
  color: #8E9DBA;
  font-size: 15px;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
}
.fx-star:hover { color: #E4B84C; }
.fx-star.on { color: #E4B84C; text-shadow: 0 0 10px rgba(228, 184, 76, 0.5); }
.fx-empty { grid-column: 1 / -1; padding: 30px 16px; text-align: center; color: #7787A5; font-size: 13.5px; }

/* —— M40 挑战练习 —— */
.qz-board { padding: 16px 18px 6px; min-height: 240px; }
.qz-intro { color: var(--vault-text); font-size: 14.5px; }
.qz-intro b { color: #EAF0FA; }
.qz-best-line { color: #93A3C2; font-size: 13px; }
.qz-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.qz-count { color: #7787A5; font-family: var(--f-mono); font-size: 12.5px; }
.qz-q { font-family: var(--f-display); color: #EAF0FA; font-size: 17.5px; line-height: 1.6; margin: 12px 0 14px; }
.qz-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qz-opt {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-align: left;
  background: var(--vault-2);
  border: 1px solid var(--vault-line);
  border-radius: var(--radius-panel);
  color: #C6D3E8;
  padding: 11px 14px;
  cursor: pointer;
  font-size: 14.5px;
  line-height: 1.5;
  transition: border-color 0.13s ease, background-color 0.13s ease;
}
.qz-opt .qz-key { color: #7787A5; font-family: var(--f-mono); font-size: 12.5px; flex: 0 0 auto; }
.qz-opt:hover:not(:disabled) { border-color: hsl(var(--hue) 45% 55%); }
.qz-opt:disabled { cursor: default; }
.qz-opt.correct { border-color: hsl(150 55% 46%); background: rgba(38, 106, 76, 0.22); color: #DDF3E4; }
.qz-opt.correct .qz-key { color: #7BD3A0; }
.qz-opt.wrong { border-color: hsl(0 60% 55%); background: rgba(122, 54, 54, 0.20); color: #F2D8D8; }
.qz-opt.wrong .qz-key { color: #E08C8C; }
.qz-why {
  margin-top: 12px;
  padding: 10px 14px;
  border-left: 3px solid hsl(var(--hue) 55% 50%);
  background: rgba(159, 178, 208, 0.06);
  color: #A9B8D0;
  font-size: 13.5px;
  line-height: 1.6;
  border-radius: 0 4px 4px 0;
}
.qz-why b { color: #EAF0FA; }
.qz-result { text-align: center; padding: 26px 0 12px; }
.qz-score-big {
  font-family: var(--f-math);
  font-size: 54px;
  color: hsl(var(--hue) 72% 66%);
  text-shadow: 0 0 26px hsl(var(--hue) 70% 55% / 0.35);
}
.qz-score-big small { font-size: 26px; color: #7787A5; }
.qz-rating { font-family: var(--f-display); font-size: 19px; color: #EAF0FA; margin: 10px 0 4px; }
.qz-sub { color: #93A3C2; font-size: 13.5px; margin: 2px 0; }

/* —— M41 常数表 —— */
.ct-scroll { padding: 6px 18px 16px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: rgba(159, 178, 208, 0.35) transparent; }
.ct-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 560px; }
.ct-table th {
  text-align: left;
  padding: 9px 10px;
  color: #93A3C2;
  font-weight: 400;
  border-bottom: 1px solid var(--vault-line);
  white-space: nowrap;
  user-select: none;
}
.ct-table th.sortable { cursor: pointer; }
.ct-table th.sortable:hover { color: #EAF0FA; }
.ct-table th .ct-arr { color: hsl(var(--hue) 75% 66%); margin-left: 4px; font-size: 11px; }
.ct-table td { padding: 9px 10px; border-bottom: 1px solid rgba(159, 178, 208, 0.09); color: #C6D3E8; vertical-align: top; }
.ct-val { font-family: var(--f-mono); font-variant-numeric: tabular-nums; color: hsl(var(--hue) 70% 68%); white-space: nowrap; text-align: right; }
.ct-sym { font-family: var(--f-math); color: #EAF0FA; white-space: nowrap; }
.ct-note { color: #8B99B8; font-size: 12.5px; line-height: 1.55; }
.ct-cat { white-space: nowrap; }
.ct-empty { text-align: center; color: #7787A5; padding: 26px 0; }

@media (max-width: 640px) {
  .qz-opts { grid-template-columns: 1fr; }
  .ct-scroll { overflow-x: visible; padding: 6px 14px 12px; }
  .ct-table, .ct-table tbody, .ct-table tr, .ct-table td { display: block; min-width: 0; }
  .ct-table thead { display: none; }
  .ct-table tr {
    border: 1px solid var(--vault-line);
    border-radius: var(--radius-panel);
    background: var(--vault-2);
    margin: 8px 0;
    padding: 4px 12px;
  }
  .ct-table td { display: flex; justify-content: space-between; gap: 14px; border: none; padding: 5px 0; }
  .ct-table td::before {
    content: attr(data-label);
    color: #7787A5;
    font-size: 11.5px;
    flex: 0 0 auto;
    padding-top: 2px;
  }
}
