/* ============================================================
   ArityFlow TTS · 设计系统 v2（现代 SaaS 风格）
   亮暗双主题：html[data-theme="dark"] 覆盖令牌
   ============================================================ */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f2f3f6;
  --surface-3: #ebedf1;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;

  --text-1: #101828;
  --text-2: #475467;
  --text-3: #98a2b3;

  --brand: #4f46e5;
  --brand-strong: #4338ca;
  --brand-contrast: #ffffff;
  --brand-soft: #eef2ff;
  --brand-softer: #f5f7ff;
  --ring: rgba(79, 70, 229, 0.22);

  --success: #12805c;
  --success-bg: #e7f6ef;
  --warning: #b45309;
  --warning-bg: #fdf4e0;
  --danger: #d92d20;
  --danger-strong: #b42318;
  --danger-bg: #fdeceb;
  --info: #175cd3;
  --info-bg: #eaf1fd;

  --code-bg: #0c1020;
  --code-text: #dbe2f4;
  --code-border: rgba(255, 255, 255, 0.08);

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 6px 16px -6px rgba(16, 24, 40, 0.12);
  --shadow-lg: 0 20px 50px -12px rgba(16, 24, 40, 0.18);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --sidebar-w: 250px;
  --font-mono: ui-monospace, "Cascadia Code", Consolas, "Courier New", monospace;
}

[data-theme="dark"] {
  --bg: #0b0e15;
  --surface: #131722;
  --surface-2: #1a2030;
  --surface-3: #222939;
  --border: #232a3a;
  --border-strong: #333c52;

  --text-1: #f0f2f7;
  --text-2: #a3adc2;
  --text-3: #667085;

  --brand: #8b93f8;
  --brand-strong: #757cf5;
  --brand-contrast: #0b0e15;
  --brand-soft: rgba(139, 147, 248, 0.14);
  --brand-softer: rgba(139, 147, 248, 0.07);
  --ring: rgba(139, 147, 248, 0.28);

  --success: #47cd89;
  --success-bg: rgba(18, 183, 106, 0.13);
  --warning: #fdb022;
  --warning-bg: rgba(247, 144, 9, 0.12);
  --danger: #f97066;
  --danger-strong: #fda29b;
  --danger-bg: rgba(240, 68, 56, 0.13);
  --info: #84caff;
  --info-bg: rgba(46, 144, 250, 0.13);

  --code-bg: #090c17;
  --code-text: #c8d3ee;
  --code-border: rgba(255, 255, 255, 0.14);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 16px -6px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 50px -12px rgba(0, 0, 0, 0.6);
}

/* ---------- Reset & 基础 ---------- */
* { box-sizing: border-box; }
/* hidden 属性优先级最高：防止组件 display 规则覆盖导致隐藏元素可见 */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-1);
  font-family: "Inter", "HarmonyOS Sans SC", "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0 0 10px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.35; }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0 0 12px; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-strong); }
ul { margin: 0 0 12px; padding-left: 20px; }
li { margin: 4px 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
code { font-family: var(--font-mono); font-size: 0.92em; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }

/* 内联 SVG 图标默认尺寸（具体场景按需覆盖） */
svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn svg { width: 15px; height: 15px; }
.kpi .label svg { width: 15px; height: 15px; color: var(--text-3); }
.hero .eyebrow svg { width: 14px; height: 14px; }

.muted { color: var(--text-2); }
.faint { color: var(--text-3); font-size: 12.5px; }
.mono { font-family: var(--font-mono); }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack > * + * { margin-top: 14px; }
.grow { flex: 1; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- 顶部导航（公共站） ---------- */
.topnav {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 18px;
  height: 62px; padding: 0 clamp(16px, 4vw, 36px);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text-1); font-size: 15px; }
.brand img { width: 28px; height: 28px; border-radius: 8px; object-fit: cover; }
.brand:hover { color: var(--text-1); }
.topnav .links { display: flex; gap: 4px; margin-left: 8px; }
.topnav .links a {
  color: var(--text-2); font-weight: 500; padding: 7px 13px; border-radius: 999px;
  white-space: nowrap; flex-shrink: 0;
}
.topnav .links a:hover { color: var(--text-1); background: var(--surface-2); }
.topnav .links a.active { color: var(--brand); background: var(--brand-soft); }
.topnav .spacer { flex: 1; }
.topnav .btn, .topnav .theme-toggle { flex-shrink: 0; }

/* ---------- 侧栏布局（控制台 / 后台） ---------- */
.panel { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  position: fixed; inset: 0 auto 0 0; z-index: 70;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 14px;
  overflow-y: auto;
}
.sidebar .brand { padding: 4px 10px 16px; }
.nav-section { margin-top: 14px; }
.nav-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-3); padding: 0 12px; margin-bottom: 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; margin: 2px 0;
  border-radius: 10px; color: var(--text-2); font-weight: 500;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.85; }
.nav-item:hover { color: var(--text-1); background: var(--surface-2); }
.nav-item.active { color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.sidebar .foot { margin-top: auto; padding: 14px 6px 4px; border-top: 1px solid var(--border); }

.main {
  flex: 1;
  /* 在侧栏右侧的可用区域内水平居中：窄屏贴边铺满，宽屏两侧均分留白 */
  margin-left: calc(var(--sidebar-w) + max(0px, (100% - var(--sidebar-w) - 1240px) / 2));
  width: min(1240px, calc(100% - var(--sidebar-w)));
  padding: 30px clamp(18px, 3.5vw, 44px) 60px;
}
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head p { color: var(--text-2); margin: 4px 0 0; max-width: 640px; }
.backdrop {
  display: none; position: fixed; inset: 0; z-index: 65;
  background: rgba(9, 12, 20, 0.55); backdrop-filter: blur(2px);
}

/* ---------- 卡片 / 面板 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}
.card--flush { padding: 0; overflow: hidden; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 16px; }
.grid--kpi { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.grid--cards { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }

/* 操练场双栏（移动端折叠为单栏） */
.playground-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1024px) {
  .playground-grid { grid-template-columns: 1fr; }
}

.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 18px 20px; }
.kpi .label { color: var(--text-2); font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 7px; }
.kpi .value { font-size: 25px; font-weight: 700; letter-spacing: -0.02em; margin-top: 6px; word-break: break-all; }
.kpi .hint { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }
.kpi .value.small { font-size: 18px; }

.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 30px 0 14px; }
.section-title:first-child { margin-top: 0; }
.section-title h2, .section-title h3 { margin: 0; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 16px; border-radius: 10px;
  border: 1px solid transparent; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 13.5px; line-height: 1.4;
  color: var(--text-1); background: var(--surface-2);
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  text-decoration: none; user-select: none;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-3); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn--primary { background: var(--brand); color: var(--brand-contrast); }
.btn--primary:hover { background: var(--brand-strong); }
.btn--danger { background: var(--danger-bg); color: var(--danger); }
.btn--danger:hover { background: var(--danger); color: #fff; }
.btn--ghost { background: transparent; border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--sm { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }
.btn--lg { padding: 11px 22px; font-size: 14.5px; border-radius: 12px; }
.btn--block { width: 100%; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field .help { font-size: 12.5px; color: var(--text-3); margin-top: 5px; }
.input, select.input, textarea.input {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface); color: var(--text-1);
  font: inherit; font-size: 13.5px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea.input { resize: vertical; min-height: 84px; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
.input::placeholder { color: var(--text-3); }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-3); padding: 12px 16px; border-bottom: 1px solid var(--border);
  white-space: nowrap; background: var(--surface);
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--brand-softer); }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- 状态标签 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--surface-2); color: var(--text-2);
}
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag--success { background: var(--success-bg); color: var(--success); }
.tag--warning { background: var(--warning-bg); color: var(--warning); }
.tag--danger { background: var(--danger-bg); color: var(--danger); }
.tag--info { background: var(--info-bg); color: var(--info); }
.tag--brand { background: var(--brand-soft); color: var(--brand); }

.badge {
  display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em;
  background: var(--brand-soft); color: var(--brand);
}
.badge--muted { background: var(--surface-2); color: var(--text-3); }

/* ---------- 提示条 ---------- */
.notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 16px; border-radius: var(--radius-md);
  font-size: 13.5px; margin-bottom: 16px;
  background: var(--info-bg); color: var(--info);
  border: 1px solid color-mix(in srgb, var(--info) 22%, transparent);
}
.notice strong { font-weight: 650; }
.notice a { color: inherit; text-decoration: underline; }
.notice--success { background: var(--success-bg); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.notice--error { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.notice--warning { background: var(--warning-bg); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--text-3); }
.empty svg { width: 40px; height: 40px; opacity: 0.5; margin-bottom: 10px; }
.empty p { margin: 0; font-size: 13.5px; }

/* ---------- 分页 ---------- */
.pagination { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.pagination .btn { min-width: 34px; }
.pagination span { color: var(--text-3); font-size: 13px; padding: 0 4px; }

/* ---------- 代码块 ---------- */
.code-block {
  background: var(--code-bg); color: var(--code-text);
  border-radius: var(--radius-md); overflow: hidden;
  margin: 12px 0; border: 1px solid var(--code-border);
  position: relative;
}
.code-block pre {
  margin: 0; padding: 14px 16px; overflow-x: auto;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7;
  color: inherit;
}
/* 代码块内的 code 不继承行内 code 样式（修复深色模式下背景色块渗入） */
.code-block pre code {
  background: transparent; padding: 0; border-radius: 0;
  color: inherit; font-size: inherit;
}
.code-block .copy-btn {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  background: rgba(255, 255, 255, 0.08); color: #aab4d4;
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 7px;
  padding: 3px 9px; font-size: 11.5px; cursor: pointer; opacity: 0;
  transition: opacity 0.15s;
}
.code-block:hover .copy-btn { opacity: 1; }
.copy-btn.copied { color: #47cd89 !important; }

/* ---------- 模态 ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(9, 12, 20, 0.55); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  max-width: 480px; width: 100%; padding: 24px;
}
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ---------- 首页 Hero ---------- */
.hero {
  padding: clamp(48px, 8vw, 96px) clamp(18px, 5vw, 48px) 40px;
  max-width: 1080px; margin: 0 auto; text-align: center;
}
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand-soft); color: var(--brand);
  font-size: 13px; font-weight: 600; border-radius: 999px; padding: 6px 16px; margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(32px, 5.5vw, 54px); font-weight: 750; letter-spacing: -0.03em;
  line-height: 1.15; margin-bottom: 18px;
  background: linear-gradient(120deg, var(--text-1) 30%, var(--brand));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero .sub { font-size: clamp(15px, 2vw, 17.5px); color: var(--text-2); max-width: 640px; margin: 0 auto 30px; }
.hero .cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.feature-card { transition: transform 0.18s, box-shadow 0.18s; }
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.feature-card .icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--brand); margin-bottom: 14px;
}
.feature-card .icon svg { width: 21px; height: 21px; }
.steps { counter-reset: step; }
.step { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px dashed var(--border); }
.step:last-child { border-bottom: 0; }
.step .num {
  counter-increment: step; flex-shrink: 0;
  width: 30px; height: 30px; border-radius: 10px;
  background: var(--brand-soft); color: var(--brand);
  font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 13.5px;
}
.step .num::before { content: counter(step); }

/* ---------- 认证页 ---------- */
.auth-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(600px 320px at 15% 0%, var(--brand-soft), transparent 65%),
    radial-gradient(600px 320px at 85% 100%, var(--brand-softer), transparent 65%),
    var(--bg);
}
.auth-card { width: 100%; max-width: 400px; }
.auth-card .card { padding: 30px; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 18px; }
.auth-logo img { width: 52px; height: 52px; border-radius: 14px; }

/* ---------- 文档 ---------- */
.docs-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 34px; max-width: 1120px; margin: 0 auto; padding: 34px clamp(16px, 4vw, 40px) 80px; }
.docs-toc { position: sticky; top: 86px; align-self: start; display: flex; flex-direction: column; gap: 2px; }
.docs-toc a {
  color: var(--text-2); font-size: 13px; padding: 7px 12px; border-radius: 9px;
  border-left: 2px solid transparent;
}
.docs-toc a:hover { color: var(--text-1); background: var(--surface-2); }
.docs-toc a.active { color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.docs-mobile-bar { display: none; }
.docs-body { min-width: 0; }
.docs-body section { margin-bottom: 34px; }
.docs-body h2 { font-size: 16.5px; padding-top: 6px; }
.method-pill {
  display: inline-flex; padding: 3px 10px; border-radius: 7px;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 700;
  background: var(--success-bg); color: var(--success); vertical-align: middle;
}
.method-pill.post { background: var(--brand-soft); color: var(--brand); }

/* ---------- 设置分组 ---------- */
.settings-group { margin-bottom: 26px; }
.secret-preview {
  font-family: var(--font-mono); font-size: 12.5px;
  background: var(--surface-2); border-radius: 8px; padding: 7px 11px;
  color: var(--text-2); margin-bottom: 8px; word-break: break-all;
}

/* ---------- 音色预览 ---------- */
.audio-preview audio { width: 100%; margin-top: 8px; }

/* ---------- 主题切换按钮 ---------- */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
}
.theme-toggle:hover { color: var(--text-1); background: var(--surface-2); }
.theme-toggle svg { width: 17px; height: 17px; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: none; }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 26px clamp(16px, 4vw, 40px);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  color: var(--text-3); font-size: 13px;
  max-width: 1080px; margin: 40px auto 0;
}
.site-footer nav { display: flex; gap: 16px; }
.site-footer a { color: var(--text-2); }
.site-footer a:hover { color: var(--text-1); }

/* ---------- 面板顶栏（移动端显示，含汉堡菜单） ---------- */
.panel-topbar {
  display: none;
  position: sticky; top: 0; z-index: 60;
  align-items: center; gap: 12px;
  height: 58px; padding: 0 16px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.panel-topbar .brand { font-size: 14.5px; }
.panel-topbar .brand img { width: 26px; height: 26px; }
.sidebar-close { display: none; }

/* ---------- 移动端 ---------- */
@media (max-width: 1024px) {
  .panel-topbar { display: flex; }
  .sidebar-close { display: inline-flex; }
  .topnav { gap: 10px; padding: 0 14px; }
  .topnav .brand span {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 38vw; font-size: 13.5px;
  }
  .topnav .spacer { display: none; }
  .topnav .links {
    display: flex; margin-left: 0;
    flex: 1 1 auto; min-width: 0;
    overflow-x: auto; scrollbar-width: none; white-space: nowrap;
  }
  .topnav .links::-webkit-scrollbar { display: none; }
  .topnav .btn { padding: 6px 11px; font-size: 12.5px; }
  .sidebar { transform: translateX(-105%); transition: transform 0.22s ease; box-shadow: var(--shadow-lg); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .backdrop { display: block; }
  .main { margin-left: 0; width: 100%; }
}

/* 文档目录：手机端折叠为汉堡抽屉 */
@media (max-width: 860px) {
  .docs-layout { grid-template-columns: 1fr; padding-top: 0; gap: 0; }
  .docs-mobile-bar {
    display: flex; align-items: center; gap: 10px;
    position: sticky; top: 62px; z-index: 50;
    padding: 10px 2px; margin-bottom: 14px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
  }
  .docs-toc {
    position: fixed; inset: 0 auto 0 0; width: 256px; z-index: 70;
    align-self: unset; padding: 18px 14px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateX(-105%); transition: transform 0.22s ease;
    overflow-y: auto;
  }
  body.docs-toc-open .docs-toc { transform: translateX(0); }
  body.docs-toc-open .backdrop { display: block; }
}
@media (max-width: 640px) {
  h1 { font-size: 22px; }
  .page-head { margin-bottom: 18px; }
  .card { padding: 17px; }
  .table th, .table td { padding: 10px 12px; }
}

/* ---------- 工具动画 ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fade-up { animation: fadeUp 0.35s ease both; }
