/* ============================================================
   【样式层】css/style.css  —— 企业级 UI（三个版本共用结构）
   目录：
   0. 版本主题变量（v1 企业专业蓝 / v2 深色工作台 / v3 资料库编辑风）
   1. 基础重置与排版
   2. 顶栏导航
   3. 主体布局 / 侧栏目录
   4. 首页各区块（Hero / 数据 / 客服 / 类目卡片）
   5. 教程详情（面包屑 / Hero / 步骤 / 页内目录 / 翻页）
   6. 内容块（提示 / 表格 / 代码 / 图片视频）
   7. 按钮 / 弹层 / 提示 / 加载
   8. 动画与显现
   9. 响应式
   ============================================================ */

/* ---------- 0. 基础设计令牌（三版共用） ---------- */
:root {
  --font: "Inter", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --font-num: "Inter", "SF Pro Display", "Segoe UI", system-ui, sans-serif;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;

  --sidebar-w: 320px;
  --topbar-h: 64px;
  --content-max: 1180px;
  --gap: 28px;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --dur: .28s;

  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
}

/* ===== 版本一：企业专业蓝（蓝灰白，沉稳可信） ===== */
.variant-v1 {
  --bg: #f4f6fa;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #eef2f8;
  --text: #0f172a;
  --text-2: #4a5568;
  --text-3: #8a94a6;
  --border: #e3e8f0;
  --border-strong: #cfd8e5;
  --primary: #1e4fd8;
  --primary-hover: #1a44bd;
  --primary-soft: #ecf1fe;
  --primary-ink: #ffffff;
  --accent-2: #0f766e;
  --topbar-bg: rgba(255, 255, 255, .92);
  --topbar-text: #0f172a;
  --side-bg: #ffffff;
  --ring: 0 0 0 3px rgba(30, 79, 216, .16);
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 10px 28px -12px rgba(15, 23, 42, .18);
  --shadow-lg: 0 24px 60px -24px rgba(15, 23, 42, .28);
  --hero-bg: linear-gradient(120deg, #10307f 0%, #1e4fd8 58%, #2f6df6 100%);
  --hero-ink: #ffffff;
  --hero-ink-2: rgba(255, 255, 255, .74);
}

:is(.variant-v1[data-theme="dark"],
    [data-theme="dark"] .variant-v1) {
  --bg: #0b0f17;
  --bg-elev: #111725;
  --surface: #111725;
  --surface-2: #161e2e;
  --surface-3: #1c263a;
  --text: #e8eefb;
  --text-2: #a3aec3;
  --text-3: #6b778d;
  --border: #223049;
  --border-strong: #2f4160;
  --primary: #6d95ff;
  --primary-hover: #86a8ff;
  --primary-soft: #1a2743;
  --primary-ink: #ffffff;
  --topbar-bg: rgba(13, 18, 28, .9);
  --topbar-text: #e8eefb;
  --side-bg: #0e141f;
  --ring: 0 0 0 3px rgba(109, 149, 255, .22);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .4);
  --shadow-md: 0 12px 30px -12px rgba(0, 0, 0, .7);
  --shadow-lg: 0 28px 70px -26px rgba(0, 0, 0, .85);
  --hero-bg: linear-gradient(120deg, #0d1c40 0%, #12295e 58%, #17366f 100%);
}

/* ===== 版本二：深色精简工作台（深色外壳 + 浅色内容） ===== */
.variant-v2 {
  --bg: #f3f5f8;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --surface-3: #eaedf3;
  --text: #10151d;
  --text-2: #4b5563;
  --text-3: #8b94a3;
  --border: #e2e6ed;
  --border-strong: #ccd3de;
  --primary: #0f7b5f;
  --primary-hover: #0b6850;
  --primary-soft: #e7f5f0;
  --primary-ink: #ffffff;
  --accent-2: #1f2937;
  --topbar-bg: #0c1117;
  --topbar-text: #e7ecf3;
  --side-bg: #ffffff;
  --ring: 0 0 0 3px rgba(15, 123, 95, .18);
  --shadow-sm: 0 1px 2px rgba(16, 21, 29, .06);
  --shadow-md: 0 10px 26px -14px rgba(16, 21, 29, .24);
  --shadow-lg: 0 26px 60px -26px rgba(16, 21, 29, .36);
  --hero-bg: #0c1117;
  --hero-ink: #f2f6fa;
  --hero-ink-2: rgba(231, 236, 243, .64);
  --sidebar-w: 300px;
}

:is(.variant-v2[data-theme="dark"],
    [data-theme="dark"] .variant-v2) {
  --bg: #080b10;
  --bg-elev: #0e131a;
  --surface: #0e131a;
  --surface-2: #131923;
  --surface-3: #1a2230;
  --text: #e9eef6;
  --text-2: #9ea9ba;
  --text-3: #68748a;
  --border: #1d2634;
  --border-strong: #2a3547;
  --primary: #2ec59a;
  --primary-hover: #4bd6ad;
  --primary-soft: #0f2a25;
  --primary-ink: #04120e;
  --topbar-bg: #05080c;
  --topbar-text: #e9eef6;
  --side-bg: #0a0f15;
  --ring: 0 0 0 3px rgba(46, 197, 154, .24);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-md: 0 12px 30px -14px rgba(0, 0, 0, .8);
  --hero-bg: #05080c;
}

/* ===== 版本三：资料库编辑风（品牌蓝 + 暖白纸感） ===== */
.variant-v3 {
  --bg: #faf8f4;
  --bg-elev: #fffdfa;
  --surface: #fffdfa;
  --surface-2: #f6f2ea;
  --surface-3: #ede7db;
  --text: #1a1712;
  --text-2: #575044;
  --text-3: #8d857a;
  --border: #e8e1d5;
  --border-strong: #d6ccbc;
  --primary: #1479f0;
  --primary-hover: #0f63cc;
  --primary-soft: #e8f2fe;
  --primary-ink: #ffffff;
  --accent-2: #c2410c;
  --topbar-bg: #12417f;
  --topbar-text: #f3f8ff;
  --side-bg: #fffdfa;
  --ring: 0 0 0 3px rgba(20, 121, 240, .18);
  --shadow-sm: 0 1px 2px rgba(60, 46, 24, .06);
  --shadow-md: 0 12px 30px -16px rgba(60, 46, 24, .24);
  --shadow-lg: 0 28px 64px -28px rgba(60, 46, 24, .32);
  --hero-bg: linear-gradient(135deg, #0f3a73 0%, #12417f 46%, #1479f0 100%);
  --hero-ink: #ffffff;
  --hero-ink-2: rgba(255, 255, 255, .76);
  --radius: 12px;
  --radius-lg: 16px;
  --sidebar-w: 330px;
}

:is(.variant-v3[data-theme="dark"],
    [data-theme="dark"] .variant-v3) {
  --bg: #14120f;
  --bg-elev: #1a1714;
  --surface: #1a1714;
  --surface-2: #211d19;
  --surface-3: #292420;
  --text: #f3ede3;
  --text-2: #b8b0a3;
  --text-3: #857c70;
  --border: #2e2924;
  --border-strong: #403931;
  --primary: #5aa8ff;
  --primary-hover: #7cbcff;
  --primary-soft: #16263d;
  --primary-ink: #06152a;
  --topbar-bg: #16294a;
  --topbar-text: #eef5ff;
  --side-bg: #17140f;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-md: 0 12px 30px -14px rgba(0, 0, 0, .8);
  --hero-bg: linear-gradient(135deg, #0b2447 0%, #123566 46%, #1654a3 100%);
}

/* ---------- 1. 基础重置与排版 ---------- */
* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.72;
  color: var(--text);
  background: var(--bg);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding-left: 1.35em; }
li { margin: 5px 0; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--primary-hover); }
code, kbd { font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace; font-size: .92em; }
strong { font-weight: 700; color: var(--text); }
::selection { background: var(--primary-soft); color: var(--text); }

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

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ---------- 2. 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--topbar-bg);
  color: var(--topbar-text);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  transition: box-shadow .3s var(--ease), background var(--dur) var(--ease);
}
body.is-scrolled .topbar { box-shadow: var(--shadow-md); }

.topbar-inner {
  max-width: calc(var(--content-max) + var(--sidebar-w) + var(--gap) + 64px);
  margin: 0 auto;
  height: var(--topbar-h);
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.icon-btn {
  width: 38px; height: 38px;
  flex: 0 0 38px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  color: var(--topbar-text);
  opacity: .78;
  transition: background .2s var(--ease), opacity .2s var(--ease), transform .2s var(--ease);
}
.icon-btn:hover { opacity: 1; background: color-mix(in srgb, var(--topbar-text) 10%, transparent); }
.icon-btn:active { transform: scale(.94); }
.menu-btn { display: none; }

.brand {
  display: flex; align-items: center; gap: 10px;
  flex: 0 0 auto;
  color: var(--topbar-text);
  user-select: none;
  -webkit-user-select: none;
}
.brand-logo {
  width: 34px; height: 34px;
  flex: 0 0 34px;
  display: grid; place-items: center;
  overflow: hidden;
  border-radius: 9px;
  background: #fff;
  font-size: 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
}
.brand-logo img {
  width: 84%;
  height: 84%;
  object-fit: contain;
}
.brand-text { font-size: 16px; font-weight: 700; letter-spacing: .01em; line-height: 1.2; }
.brand-sub {
  font-size: 12px;
  font-weight: 500;
  opacity: .62;
  padding-left: 10px;
  margin-left: 2px;
  border-left: 1px solid color-mix(in srgb, var(--topbar-text) 22%, transparent);
  white-space: nowrap;
}
.brand-lockup { display: flex; flex-direction: column; gap: 1px; }
.brand-lockup .brand-sub { padding-left: 0; margin-left: 0; border-left: 0; font-size: 11px; letter-spacing: .04em; }

.topnav { display: flex; align-items: center; gap: 2px; margin-left: 14px; }
.topnav-link {
  position: relative;
  padding: 7px 12px;
  font-size: 14px;
  font-weight: 500;
  color: inherit;
  opacity: .78;
  border-radius: var(--radius-xs);
  transition: opacity .2s var(--ease), background .2s var(--ease);
}
.topnav-link::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease-out);
}
.topnav-link:hover { opacity: 1; background: color-mix(in srgb, var(--topbar-text) 7%, transparent); }
.topnav-link:hover::after { transform: scaleX(1); }

.search {
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  height: 38px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
  cursor: text;
}
.search-top { flex: 1 1 auto; min-width: 140px; max-width: 360px; margin-left: auto; }
.search:hover { border-color: var(--border-strong); }
.search:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.search-icon { display: inline-grid; place-items: center; color: var(--text-3); }
.search input {
  flex: 1; min-width: 0;
  height: 100%;
  border: none; outline: none; background: transparent;
  font: inherit; font-size: 13.5px;
  color: var(--text);
}
.search input::placeholder { color: var(--text-3); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-kbd {
  display: grid; place-items: center;
  min-width: 20px; height: 20px;
  padding: 0 5px;
  font-size: 11px;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: 4px; }
.theme-toggle .theme-icon-dark { display: none; }
html[data-theme="dark"] .theme-toggle .theme-icon-light { display: none; }
html[data-theme="dark"] .theme-toggle .theme-icon-dark { display: grid; }

.btn-help {
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--topbar-text);
  border: 1px solid color-mix(in srgb, var(--topbar-text) 26%, transparent);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.btn-help:hover { background: color-mix(in srgb, var(--topbar-text) 12%, transparent); border-color: color-mix(in srgb, var(--topbar-text) 40%, transparent); }

.scroll-progress {
  height: 2px;
  width: 0%;
  background: var(--primary);
  transition: width .1s linear;
}
.variant-v2 .scroll-progress { background: var(--primary); }
.variant-v3 .scroll-progress { background: #ffc857; }

/* ---------- 3. 主体布局 ---------- */
.layout {
  max-width: calc(var(--content-max) + var(--sidebar-w) + var(--gap) + 64px);
  margin: 0 auto;
  padding: 24px 32px 64px;
  display: flex;
  gap: var(--gap);
  align-items: flex-start;
}

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  position: sticky;
  top: calc(var(--topbar-h) + 24px);
  max-height: calc(100vh - var(--topbar-h) - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 14px 18px;
  background: var(--side-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  scrollbar-width: thin;
}

.sidebar-mobile-head { display: none; }

/* 移动端主导航（教程总览 / 设备目录 / 客服支持）
   仅出现在手机端目录抽屉顶部，桌面端保持原有顶栏导航 */
.mobile-nav { display: none; }

.sidebar-head {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: nowrap;
  padding: 0 4px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.sidebar-title { font-weight: 700; font-size: 13px; letter-spacing: .04em; color: var(--text-2); text-transform: uppercase; }

.badge {
  min-width: 26px; height: 21px; padding: 0 7px;
  display: inline-grid; place-items: center;
  font-family: var(--font-num);
  font-size: 11.5px; font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 99px;
  transition: transform .3s var(--ease-out);
}
.badge.pop { transform: scale(1.2); }

/* 目录显示方式切换（版本一） */
.tree-mode-switch {
  display: inline-flex;
  padding: 2px;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  flex: 1;
}
.tree-mode-btn {
  flex: 1;
  height: 26px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  border-radius: 7px;
  transition: all .2s var(--ease);
}
.tree-mode-btn:hover { color: var(--text); }
.tree-mode-btn.active { color: var(--text); background: var(--surface); box-shadow: var(--shadow-xs); }

.group-label {
  padding: 12px 8px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--text-3);
}
.group-label:first-child { padding-top: 4px; }

/* ---- 目录：树形 / 列表 ---- */
.category-bar { display: flex; flex-direction: column; gap: 3px; }

.cat-home-btn {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  height: 42px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  border-radius: 9px;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.cat-home-btn:hover { background: var(--surface-2); color: var(--text); }
.cat-home-btn.active { color: var(--primary); background: var(--primary-soft); }
.cat-home-icon { font-size: 15px; line-height: 1; }

.cat-toolbar {
  display: flex;
  gap: 4px;
  padding: 12px 2px 10px;
  margin: 6px 0 4px;
  border-top: 1px dashed var(--border);
}
.cat-toolbar:first-child { border-top: 0; padding-top: 2px; }
.cat-tool {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  height: 30px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  border-radius: 7px;
  transition: all .18s var(--ease);
}
.cat-tool:hover { color: var(--primary); background: var(--primary-soft); }
.cat-tool-icon { font-size: 12px; line-height: 1; }

.cat-group { width: 100%; }
.cat-parent-row {
  display: flex; align-items: center; gap: 4px;
  border-radius: 10px;
  transition: background .18s var(--ease);
}
.cat-group.open .cat-parent-row,
.cat-parent-row:hover { background: var(--surface-2); }

.cat-btn { min-width: 0; text-align: left; }

.cat-parent {
  flex: 1 1 auto;
  display: flex; align-items: center; gap: 11px;
  min-height: 44px;
  padding: 7px 6px 7px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  border-radius: 9px;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.cat-parent:hover { color: var(--primary); }
.cat-group.open > .cat-parent-row > .cat-parent { color: var(--primary); }
.cat-parent.active { color: var(--primary); background: var(--primary-soft); }

/* 侧边目录线条图标 */
.ico-line { display: block; flex: 0 0 auto; }
.cat-parent-icon-wrap {
  width: 26px; height: 26px;
  flex: 0 0 26px;
  display: inline-grid; place-items: center;
  color: var(--text-2);
  border-radius: 7px;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.cat-parent:hover .cat-parent-icon-wrap { color: var(--text); }
.cat-parent.active .cat-parent-icon-wrap { color: var(--primary); background: var(--surface); }
.cat-group.open .cat-parent-icon-wrap { color: var(--text); }
.cat-group.open .cat-parent .cat-parent-icon-wrap { color: var(--primary); }
.cat-parent-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cat-parent-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cat-parent-sub { font-size: 11px; font-weight: 500; color: var(--text-3); }
.cat-parent-count {
  flex: 0 0 auto;
  min-width: 22px; height: 20px;
  display: inline-grid; place-items: center;
  padding: 0 6px;
  font-family: var(--font-num);
  font-size: 11px; font-weight: 600;
  color: var(--text-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
}
.cat-parent.active .cat-parent-count { color: var(--primary); background: var(--surface); border-color: transparent; }

.cat-caret {
  width: 28px; height: 28px;
  flex: 0 0 28px;
  display: grid; place-items: center;
  margin-right: 2px;
  padding: 0;
  color: var(--text-3);
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  transition: transform .25s var(--ease-out), color .18s var(--ease), background .18s var(--ease);
}
.cat-caret::before {
  content: "";
  width: 6px; height: 6px;
  border-right: 1.7px solid currentColor;
  border-bottom: 1.7px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform .25s var(--ease-out);
}
.cat-caret:hover,
.cat-caret:focus-visible { color: var(--primary); background: var(--surface-3); outline: none; }
.cat-caret:active { background: var(--primary-soft); }
.cat-parent-row:hover .cat-caret { color: var(--text-2); }
/* 展开状态：箭头朝上（同时兼容 .is-open 与父级 .cat-group.open） */
.cat-caret.is-open,
.cat-group.open .cat-caret { transform: rotate(180deg); color: var(--text-2); }
.cat-caret.is-open:hover,
.cat-group.open .cat-caret:hover { color: var(--primary); }

.cat-children {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 3px 0 8px 22px;
  padding: 3px 0 3px 12px;
  border-left: 1px solid var(--border);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: max-height .3s var(--ease), opacity .2s var(--ease), transform .3s var(--ease), margin .3s var(--ease), visibility 0s linear .3s;
}
.cat-group.open .cat-children {
  max-height: 460px;
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.cat-btn.cat-child {
  display: flex; align-items: center; gap: 9px;
  min-height: 36px;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text-2);
  border-radius: 7px;
  transition: all .16s var(--ease);
}
.cat-child-icon { flex: 0 0 20px; width: 20px; height: 20px; display: inline-grid; place-items: center; color: var(--text-3); transition: color .16s var(--ease); }
.cat-child-icon .ico-line { width: 15px; height: 15px; stroke-width: 1.5; }
.cat-btn.cat-child:hover .cat-child-icon { color: var(--text-2); }
.cat-btn.cat-child.active .cat-child-icon { color: var(--primary); }
.cat-child-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-btn.cat-child:hover { color: var(--text); background: var(--surface-2); }
.cat-btn.cat-child.active { color: var(--primary); background: var(--primary-soft); font-weight: 600; }

/* ---- 卡片列表模式（只列类目） ---- */
.cat-card {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 10px 9px 12px;
  text-align: left;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: 11px;
  opacity: 0;
  animation: fadeUp .35s var(--ease) both;
  transition: background .18s var(--ease), border-color .18s var(--ease), box-shadow .2s var(--ease);
}
.cat-card:hover,
.cat-card:focus-visible {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
  outline: none;
}
.cat-card.active {
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 26%, transparent);
}
.cat-card-icon {
  flex: 0 0 34px; width: 34px; height: 34px;
  display: grid; place-items: center;
  color: var(--text-2);
  background: var(--surface-2);
  border-radius: 9px;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.cat-card:hover .cat-card-icon { color: var(--primary); }
.cat-card.active .cat-card-icon { color: var(--primary); background: var(--surface); }
.cat-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cat-card-name {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cat-card-meta { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-card .cat-caret { flex: 0 0 22px; width: 22px; height: 22px; pointer-events: none; transform: rotate(-90deg); }
.cat-card:hover .cat-caret { color: var(--primary); }

/* ---- 列表模式（版本二） ---- */
.variant-v2 .mode-list .cat-parent { min-height: 50px; padding: 8px 6px 8px 12px; }
.mode-list .cat-children { max-height: 520px; }
.cat-group:not(.open) .cat-children { max-height: 0; }

/* ---- 侧栏型号清单：一个型号 = 一篇教程 ---- */
.card-list { display: flex; flex-direction: column; }
.card-list:empty { display: none; }
.side-list-wrap { display: flex; flex-direction: column; gap: 6px; }
.side-list-hint {
  padding: 4px 8px 6px;
  font-size: 11.5px;
  color: var(--text-3);
}
.side-list-group { display: flex; flex-direction: column; gap: 1px; }
.side-list-group + .side-list-group { margin-top: 2px; }
.side-list-head {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--text-3);
}
.side-list-head .ico-line { width: 15px; height: 15px; stroke-width: 1.6; color: var(--text-3); }
.side-list-group.active .side-list-head { color: var(--text-2); }
.side-list-group.active .side-list-head .ico-line { color: var(--primary); }
.side-list-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-list-count { font-family: var(--font-num); font-size: 10.5px; font-weight: 600; opacity: .8; }

/* 型号清单默认收起，悬停或选中时展开，避免侧栏过长 */
.side-list-group .side-item {
  display: none;
  align-items: center; gap: 9px;
  width: 100%;
  min-height: 32px;
  padding: 5px 8px 5px 32px;
  text-align: left;
  font-size: 12.5px;
  color: var(--text-2);
  border-radius: 7px;
  border-left: 2px solid transparent;
  transition: background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
}
.side-list-group.active .side-item,
.side-list-group:hover .side-item,
.side-list-group.open .side-item,
.side-list-group:has(.side-item.active) .side-item { display: flex; }
.side-item-dot {
  flex: 0 0 4px; width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--border-strong);
  transition: background .16s var(--ease), box-shadow .16s var(--ease);
}
.side-item-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item:hover { color: var(--text); background: var(--surface-2); }
.side-item.active {
  color: var(--primary);
  font-weight: 600;
  background: var(--primary-soft);
  border-left-color: var(--primary);
}
.side-item.active .side-item-dot { background: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }

.card-group { width: 100%; }
.card-group-main {
  flex: 1 1 auto;
  display: flex; align-items: center; gap: 9px;
  min-height: 38px;
  padding: 6px 8px 6px 10px;
  text-align: left;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  border-radius: 9px;
}
.card-group-main.active { color: var(--primary); }
.card-group-toggle {
  width: 26px; height: 26px;
  flex: 0 0 26px;
  display: grid; place-items: center;
  border-radius: 7px;
  color: var(--text-3);
  transition: all .18s var(--ease);
}
.card-group-toggle::before {
  content: "";
  width: 6px; height: 6px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
}
.card-group-toggle:hover { background: var(--surface-3); color: var(--text); }
.card-group.open .card-group-toggle { transform: rotate(180deg); }

.card-group-body {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  margin-left: 20px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
  transition: grid-template-rows .32s var(--ease), opacity .2s var(--ease), visibility 0s linear .32s, margin .3s var(--ease), padding .3s var(--ease);
}
.card-group.open .card-group-body {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

.card {
  position: relative;
  overflow: hidden;
  display: flex; align-items: flex-start; gap: 10px;
  width: 100%;
  padding: 10px 10px;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  opacity: 0;
  animation: cardIn .4s var(--ease) forwards;
  transition: background .18s var(--ease), border-color .18s var(--ease), box-shadow .2s var(--ease);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.card:hover { background: var(--surface-2); }
.card.active {
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 26%, transparent);
}
.card.active::before {
  content: "";
  position: absolute;
  left: 0; top: 10px; bottom: 10px;
  width: 2px;
  border-radius: 2px;
  background: var(--primary);
  animation: barIn .3s var(--ease);
}
@keyframes barIn { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.card-icon {
  flex: 0 0 30px; height: 30px;
  display: grid; place-items: center;
  font-size: 15px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.card-icon-img { width: 22px; height: 22px; object-fit: contain; }
.card.active .card-icon { border-color: transparent; background: var(--surface); }

.card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.card-name {
  font-size: 13px; font-weight: 600; line-height: 1.45; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-desc {
  font-size: 11.5px; color: var(--text-3); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.card-arrow {
  flex: 0 0 auto;
  display: grid; place-items: center;
  width: 20px; height: 20px;
  margin-top: 4px;
  color: var(--text-3);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.card:hover .card-arrow, .card.active .card-arrow { opacity: 1; transform: none; color: var(--primary); }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  white-space: nowrap;
}
.chip-brand { color: var(--primary); background: var(--primary-soft); border-color: transparent; }
.chip-hot { color: #9a3412; background: #fff4ea; border-color: #fde0c8; }
html[data-theme="dark"] .chip-hot { color: #fdba74; background: #2c1b10; border-color: #4a2c17; }
.chip-plain { background: transparent; }

.ripple {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: color-mix(in srgb, var(--primary) 20%, transparent);
  transform: scale(0);
  animation: rippleOut .6s var(--ease) forwards;
}
@keyframes rippleOut { to { transform: scale(1); opacity: 0; } }

.no-result {
  padding: 48px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
  line-height: 2;
}
.no-result-icon { display: block; font-size: 26px; margin-bottom: 8px; opacity: .5; }
.no-result span { font-size: 12px; }

/* ---------- 4. 首页 ---------- */
.content { flex: 1; min-width: 0; padding-bottom: 40px; }

.home[hidden] { display: none; }
.home:not([hidden]) { display: block; }

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  padding: 36px 40px;
  margin-bottom: 20px;
  color: var(--hero-ink);
  background: var(--hero-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  animation: heroIn .6s var(--ease-out) both;
}
@keyframes heroIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hero::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto auto;
  width: 460px; height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .14), transparent 62%);
  pointer-events: none;
  animation: floaty 14s ease-in-out infinite alternate;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(120deg, #000 10%, transparent 62%);
  -webkit-mask-image: linear-gradient(120deg, #000 10%, transparent 62%);
  pointer-events: none;
}
@keyframes floaty { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-28px, 22px, 0); } }
.hero-main { position: relative; z-index: 1; min-width: 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 11px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--hero-ink);
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 99px;
  backdrop-filter: blur(6px);
}
.eyebrow::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #7dffb0;
  box-shadow: 0 0 0 3px rgba(125, 255, 176, .2);
  animation: dotPulse 2.4s ease-in-out infinite;
}
@keyframes dotPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.home-title {
  margin-top: 14px;
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--hero-ink);
}
.home-subtitle {
  margin-top: 10px;
  max-width: 560px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--hero-ink-2);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* 版本一 Hero 右侧：快速指引 */
.hero-panel {
  position: relative;
  z-index: 1;
  padding: 18px 20px;
  background: linear-gradient(160deg, rgba(8, 18, 42, .42), rgba(8, 18, 42, .3));
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.hero-panel-title { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; color: var(--hero-ink-2); text-transform: uppercase; }
.hero-tips { list-style: none; padding: 0; margin: 10px 0 0; counter-reset: tip; }
.hero-tips li {
  counter-increment: tip;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 7px 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--hero-ink);
  border-top: 1px solid rgba(255, 255, 255, .1);
}
.hero-tips li::before {
  content: counter(tip, decimal-leading-zero);
  flex: 0 0 auto;
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 700;
  color: var(--hero-ink-2);
  padding-top: 1px;
}

/* 统计条 */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 28px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat {
  display: flex; flex-direction: column; gap: 2px;
  padding: 16px 20px;
  background: var(--surface);
  transition: background .2s var(--ease);
}
.stat:hover { background: var(--surface-2); }
.stat-value {
  font-family: var(--font-num);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 12px; color: var(--text-3); }

/* 区块标题 */
.block { margin-bottom: 32px; }
.block-head {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.block-head > div { min-width: 0; }
.block-title { font-size: 18px; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; }
.block-desc { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }
.block-tools { margin-left: auto; display: inline-flex; padding: 2px; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; }
.block-index {
  font-family: var(--font-num);
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  padding: 2px 8px;
  background: var(--primary-soft);
  border-radius: 6px;
  line-height: 1.6;
}
.seg-btn {
  height: 26px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  border-radius: 7px;
  transition: all .18s var(--ease);
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active { color: var(--text); background: var(--surface); box-shadow: var(--shadow-xs); }

/* 客服卡片 */
.home-services {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.home-service-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .2s var(--ease), box-shadow .25s var(--ease), transform .25s var(--ease);
}
.home-service-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.service-dot {
  position: absolute;
  top: 16px; right: 16px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent);
}
.home-service-copy { min-width: 0; }
.home-service-title { font-size: 15px; font-weight: 700; }
.home-service-hours { margin-top: 4px; font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.home-service-qr { flex: 0 0 84px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.home-service-qr img {
  width: 84px; height: 84px;
  padding: 3px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: zoom-in;
  transition: transform .25s var(--ease), border-color .2s var(--ease), box-shadow .25s var(--ease);
}
.home-service-qr img:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: scale(1.05); }
.home-service-qr span { font-size: 11px; color: var(--text-3); text-align: center; line-height: 1.4; }

/* 类目卡片 */
.home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;       /* 同一行卡片等高 */
}

/* 设备目录卡片：大留白 + 类目色点缀，信息层级更清晰 */
.home-card {
  --home-color: var(--primary);
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  opacity: 0;
  animation: cardRise .55s var(--ease-out) both;
  transition: border-color .22s var(--ease), box-shadow .32s var(--ease), transform .32s var(--ease-out);
}
@keyframes cardRise {
  from { opacity: 0; transform: translateY(18px) scale(.99); }
  to { opacity: 1; transform: none; }
}
/* 顶部类目色条 */
.home-card::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--home-color), color-mix(in srgb, var(--home-color) 35%, transparent));
  transform: scaleX(.28);
  transform-origin: left;
  transition: transform .45s var(--ease-out);
}
.home-card:hover {
  border-color: color-mix(in srgb, var(--home-color) 34%, var(--border));
  box-shadow: 0 22px 44px -26px rgba(15, 23, 42, .45), 0 2px 8px -4px rgba(15, 23, 42, .1);
  transform: translateY(-4px);
}
.home-card:hover::before { transform: scaleX(1); }

/* 图标区：类目色淡底，尺寸加大 */
.home-card-main {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) auto;
  align-items: center;
  align-content: center;
  gap: 16px;
  width: 100%;
  flex: 1 1 auto;
  padding: 22px 22px 18px;
  text-align: left;
  color: var(--text);
}
.home-card-art {
  width: 60px; height: 60px;
  flex: 0 0 60px;
  display: grid; place-items: center;
  overflow: hidden;
  border-radius: 16px;
  background: color-mix(in srgb, var(--home-color) 9%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--home-color) 20%, var(--border));
  transition: transform .4s var(--ease-out), background .3s var(--ease), border-color .3s var(--ease);
}
.home-card:hover .home-card-art {
  transform: scale(1.06) rotate(-2deg);
  background: color-mix(in srgb, var(--home-color) 15%, var(--surface));
  border-color: color-mix(in srgb, var(--home-color) 40%, var(--border));
}
.home-card-art img { width: 100%; height: 100%; object-fit: cover; }
.home-card-art .home-card-icon-image,
.home-card-art .home-card-emoji,
.home-card-art > svg { width: 34px; height: 34px; }
.home-card-art .home-card-icon-image { object-fit: contain; padding: 0; }
.home-card-art .home-card-emoji { display: grid; place-items: center; font-size: 26px; line-height: 1; }

.home-card-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.home-card-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  font-family: var(--font-num);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--home-color);
}
.home-card-brand::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.home-card-title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.015em;
}
.home-card-title-more {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-3);
}
.home-card-desc {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 右侧：篇数 + 进入箭头 */
.home-card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
}
.home-card-count {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-family: var(--font-num);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--home-color);
  font-variant-numeric: tabular-nums;
}
.home-card-count i { font-style: normal; font-size: 11px; font-weight: 600; color: var(--text-3); letter-spacing: 0; }
.home-card-enter {
  display: grid; place-items: center;
  width: 30px; height: 30px;
  font-size: 14px;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  transition: color .25s var(--ease-out), background .25s var(--ease-out),
              border-color .25s var(--ease-out), transform .25s var(--ease-out);
}
.home-card:hover .home-card-enter {
  color: var(--primary-ink);
  background: var(--home-color);
  border-color: var(--home-color);
  transform: translateX(3px);
}

/* 型号清单：分隔线 + 双行排布，编号感更强 */
.home-sub-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: auto;           /* 同排卡片等高时，型号清单贴底对齐 */
  padding: 0;
  background: var(--border);
  border-top: 1px solid var(--border);
}
.home-sub-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 11px 12px;
  text-align: left;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface);
  transition: color .18s var(--ease), background .18s var(--ease);
}
.home-card .home-sub-btn:nth-child(odd):last-child { grid-column: 1 / -1; }
.home-sub-btn:hover {
  color: var(--home-color);
  background: color-mix(in srgb, var(--home-color) 7%, var(--surface));
}
.home-sub-icon, .home-sub-icon-img {
  width: 16px; height: 16px;
  flex: 0 0 16px;
  object-fit: contain;
  display: inline-grid;
  place-items: center;
  font-size: 13px;
  opacity: .9;
}
.home-sub-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  letter-spacing: -.01em;
}
/* 型号名特别长的类目（微单四支镜头），清单改用单列，确保名称完整可读 */
.home-card.is-long-names .home-sub-list { grid-template-columns: 1fr; }
.home-card.is-long-names .home-sub-btn { padding: 10px 14px; }
.home-sub-arrow {
  opacity: 0;
  font-size: 13px;
  color: currentColor;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
  transform: translateX(-3px);
}
.home-sub-btn:hover .home-sub-arrow { opacity: 1; transform: none; }

/* 深色模式：类目色淡底更深一点，避免发灰 */
html[data-theme="dark"] .home-card-art,
:is(.variant-v1, .variant-v2, .variant-v3)[data-theme="dark"] .home-card-art {
  background: color-mix(in srgb, var(--home-color) 16%, var(--surface));
}

/* 窄列（方案三双栏大卡片，单列宽约 420px）时，型号清单改用单列，避免名称截断 */
@media (min-width: 901px) {
  .variant-v3 .home-sub-list { grid-template-columns: 1fr; }
  .variant-v3 .home-card-main { grid-template-columns: 54px minmax(0, 1fr) auto; gap: 14px; }
  .variant-v2 .home-sub-list { grid-template-columns: 1fr; }
  .variant-v2 .home-card-title { font-size: 17px; }
}

/* 清单式类目（版本一 seg 切换） */
/* 清单式类目（版本一 seg 切换）：一行一类，左侧图标 + 中间信息 + 右侧篇数 */
.home-grid.as-table {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.home-grid.as-table .home-card {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: var(--surface);
  animation: none;
  opacity: 1;
}
.home-grid.as-table .home-card::before { display: none; }
.home-grid.as-table .home-card:hover {
  transform: none;
  background: color-mix(in srgb, var(--home-color) 5%, var(--surface));
  box-shadow: none;
}
.home-grid.as-table .home-card-main {
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 16px;
  padding: 14px 20px;
}
.home-grid.as-table .home-card-art {
  width: 44px; height: 44px;
  flex-basis: 44px;
  border-radius: 12px;
}
.home-grid.as-table .home-card-art .home-card-icon-image,
.home-grid.as-table .home-card-art .home-card-emoji,
.home-grid.as-table .home-card-art > svg { width: 26px; height: 26px; }
.home-grid.as-table .home-card-art .home-card-emoji { font-size: 20px; }
/* 中间信息：主标题与描述同一行，副标题独立一行 */
.home-grid.as-table .home-card-copy {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 2px 14px;
}
.home-grid.as-table .home-card-brand {
  grid-column: 1 / -1;
  order: -1;
  margin-bottom: 2px;
}
.home-grid.as-table .home-card-title {
  font-size: 15.5px;
  white-space: nowrap;
}
.home-grid.as-table .home-card-title-more {
  display: inline;
  margin: 0 0 0 8px;
  font-size: 12.5px;
  color: var(--home-color);
  opacity: .75;
}
.home-grid.as-table .home-card-desc {
  margin: 0 0 0 4px;
  font-size: 12.5px;
  -webkit-line-clamp: 1;
  align-self: baseline;
  color: var(--text-3);
}
.home-grid.as-table .home-card-meta { flex-direction: row; align-items: center; gap: 12px; }
.home-grid.as-table .home-card-count { font-size: 19px; }
.home-grid.as-table .home-card-enter { width: 26px; height: 26px; font-size: 12px; }
.home-grid.as-table .home-sub-list { display: none; }

/* 版本二：搜索优先首页 */
.variant-v2 .hero {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 48px 40px 32px;
  text-align: center;
  border-radius: var(--radius-lg);
}
.variant-v2 .hero::after { background-size: 36px 36px; mask-image: radial-gradient(ellipse at 50% 0%, #000 10%, transparent 70%); -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 10%, transparent 70%); }
.variant-v2 .hero-brand {
  display: inline-flex; align-self: center;
  padding: 3px 10px;
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  color: #7bf0c8;
  background: rgba(123, 240, 200, .08);
  border: 1px solid rgba(123, 240, 200, .22);
  border-radius: 99px;
}
.variant-v2 .home-title { margin-top: 16px; font-size: clamp(26px, 3vw, 38px); }
.variant-v2 .home-subtitle { max-width: none; margin-top: 8px; color: var(--hero-ink-2); }
.variant-v2 .search-hero {
  align-self: center;
  width: min(100%, 560px);
  height: 50px;
  margin-top: 24px;
  padding: 0 16px;
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .18);
  border-radius: 12px;
  color: var(--hero-ink);
}
.variant-v2 .search-hero:hover { border-color: rgba(255, 255, 255, .32); }
.variant-v2 .search-hero:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(46, 197, 154, .22); background: rgba(255, 255, 255, .09); }
.variant-v2 .search-hero .search-icon { color: var(--hero-ink-2); }
.variant-v2 .search-hero input { color: var(--hero-ink); font-size: 14.5px; }
.variant-v2 .search-hero input::placeholder { color: var(--hero-ink-2); }
.variant-v2 .hero-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, .1);
}
.variant-v2 .stat { background: transparent; align-items: center; padding: 0; }
.variant-v2 .stat:hover { background: transparent; }
.variant-v2 .stat-value { color: var(--hero-ink); font-size: 22px; }
.variant-v2 .stat-label { color: var(--hero-ink-2); }
.variant-v2 .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.variant-v2 .home-card { padding: 16px; }
.variant-v2 .home-card-main { flex-wrap: wrap; }
.variant-v2 .home-card-meta { width: 100%; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--border); justify-content: space-between; }
.variant-v2 .home-card::before { display: none; }
.variant-v2 .home-card:hover { border-color: var(--home-color); }

/* 版本三：编辑风 Hero 与侧栏数据卡 */
.variant-v3 .hero { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); padding: 40px 44px; }
.variant-v3 .home-title { font-size: clamp(28px, 3vw, 40px); font-weight: 600; letter-spacing: -.02em; }
.variant-v3 .hero-aside {
  position: relative;
  z-index: 1;
  padding: 20px;
  background: linear-gradient(160deg, rgba(8, 18, 42, .4), rgba(8, 18, 42, .28));
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.aside-label { font-size: 11px; font-weight: 600; letter-spacing: .12em; color: var(--hero-ink-2); text-transform: uppercase; }
.aside-figure { display: flex; align-items: baseline; gap: 8px; margin: 8px 0 14px; }
.aside-num { font-family: var(--font-num); font-size: 40px; font-weight: 600; line-height: 1; letter-spacing: -.03em; color: var(--hero-ink); font-variant-numeric: tabular-nums; }
.aside-unit { font-size: 12.5px; color: var(--hero-ink-2); }
.aside-list { list-style: none; padding: 0; margin: 0; }
.aside-list li { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; font-size: 12.5px; color: var(--hero-ink-2); border-top: 1px solid rgba(255, 255, 255, .12); }
.aside-list b { font-family: var(--font-num); font-weight: 600; color: var(--hero-ink); }
.variant-v3 .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.variant-v3 .home-card { padding: 20px 20px 16px; }
.variant-v3 .home-card-title { font-size: 16.5px; }
.variant-v3 .block-title { font-size: 20px; }

/* ---------- 5. 教程详情 ---------- */
.empty {
  padding: 80px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}
.empty-icon { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 16px; font-size: 24px; color: var(--primary); background: var(--primary-soft); border-radius: 50%; }
.empty h2 { font-size: 17px; margin-bottom: 6px; }
.empty p { font-size: 13px; color: var(--text-3); }

.crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); margin-bottom: 14px; }
.crumb a { color: var(--text-2); font-weight: 500; }
.crumb a:hover { color: var(--primary); }
.crumb-sep { opacity: .5; }
.crumb-current { color: var(--text); font-weight: 600; }

.detail.enter { animation: fadeUp .45s var(--ease-out); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.detail-hero {
  --accent-color: var(--primary);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 26px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.detail-hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent-color);
}
.detail-hero::after {
  content: "";
  position: absolute;
  top: -90px; right: -70px;
  width: 230px; height: 230px;
  border-radius: 50%;
  background: var(--accent-color);
  opacity: .06;
  pointer-events: none;
}
.hero-icon {
  position: relative;
  flex: 0 0 88px; height: 88px;
  display: grid; place-items: center;
  font-size: 28px;
  color: var(--accent-color, var(--primary));
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--accent-color) 14%, var(--surface)) 0%, var(--surface) 72%);
  border: 1px solid color-mix(in srgb, var(--accent-color) 22%, var(--border));
  border-radius: var(--radius);
  animation: heroPop .5s var(--ease-out);
}
.hero-icon::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 8px;
  border: 1px dashed color-mix(in srgb, var(--accent-color) 16%, transparent);
  pointer-events: none;
}
@keyframes heroPop { from { opacity: 0; transform: scale(.86); } to { opacity: 1; transform: none; } }
.hero-icon-img { width: 64px; height: 64px; object-fit: contain; position: relative; z-index: 1; }
.hero-illustration {
  position: relative;
  z-index: 1;
  width: 62px;
  height: 62px;
  display: block;
  overflow: visible;
}
.hero-illustration * { vector-effect: non-scaling-stroke; }
.hero-emoji { position: relative; z-index: 1; font-size: 32px; line-height: 1; }
.hero-text { min-width: 0; position: relative; z-index: 1; }
.hero-brand {
  display: inline-block;
  margin-bottom: 4px;
  font-family: var(--font-num);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-color);
}
.hero-text h1 { font-size: 22px; line-height: 1.35; font-weight: 700; letter-spacing: -.01em; }
.hero-text > p { margin-top: 5px; font-size: 13.5px; color: var(--text-2); }
.hero-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 236px; gap: 24px; align-items: start; margin-top: 20px; }
.steps-col { min-width: 0; }
.steps { display: flex; flex-direction: column; gap: 10px; }

.step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  opacity: 0;
  animation: fadeUp .45s var(--ease-out) forwards;
  transition: border-color .2s var(--ease), box-shadow .25s var(--ease);
}
.step:hover { border-color: var(--border-strong); }
.step.open { box-shadow: var(--shadow-sm); }

.step-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  cursor: pointer;
  user-select: none;
  transition: background .2s var(--ease);
}
.step-head:hover { background: var(--surface-2); }
.step-head:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }

.step-no {
  flex: 0 0 34px; height: 34px;
  display: grid; place-items: center;
  font-family: var(--font-num);
  font-size: 13px; font-weight: 700;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  font-variant-numeric: tabular-nums;
  transition: all .25s var(--ease-out);
}
.step.open .step-no { color: var(--primary-ink); background: var(--primary); border-color: transparent; }

.step-title-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.step-sub { font-family: var(--font-num); font-size: 10px; font-weight: 700; letter-spacing: .12em; color: var(--text-3); }
.step-title { font-size: 15px; font-weight: 600; line-height: 1.45; color: var(--text); }
.step.open .step-title { color: var(--text); }

.step-icon { flex: 0 0 auto; font-size: 15px; opacity: .55; transition: opacity .2s var(--ease); }
.step.open .step-icon { opacity: .9; }

.step-toggle {
  flex: 0 0 24px; height: 24px;
  position: relative;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.step-toggle::before, .step-toggle::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 9px; height: 1.6px;
  background: var(--text-2);
  border-radius: 2px;
  transform: translate(-50%, -50%);
  transition: transform .3s var(--ease-out), background .2s var(--ease);
}
.step.open .step-toggle::after { transform: translate(-50%, -50%) rotate(90deg) scaleX(0); }
.step.open .step-toggle { background: var(--primary-soft); border-color: transparent; }
.step.open .step-toggle::before { background: var(--primary); }

.step-body {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows .38s var(--ease), opacity .3s var(--ease);
}
.step.open .step-body { grid-template-rows: 1fr; opacity: 1; }
.step-body-inner {
  overflow: hidden;
  padding: 0 20px 0 66px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-2);
}
.step.open .step-body-inner { padding-bottom: 20px; }
.step-body-inner > * + * { margin-top: 12px; }
.step-body-inner p { color: var(--text-2); }
.step-body-inner li { color: var(--text-2); }
.step-body-inner li::marker { color: var(--text-3); }
.step-body-inner ol { list-style: none; counter-reset: ol; padding-left: 0; }
.step-body-inner ol > li {
  counter-increment: ol;
  position: relative;
  padding-left: 30px;
  margin: 8px 0;
}
.step-body-inner ol > li::before {
  content: counter(ol, decimal-leading-zero);
  position: absolute;
  left: 0; top: 2px;
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 5px;
  padding: 0 5px;
  line-height: 1.6;
}
.step-body-inner ul { padding-left: 1.1em; }
.step-body-inner ul > li::marker { color: var(--border-strong); }

/* 页内目录 */
.onpage { position: sticky; top: calc(var(--topbar-h) + 20px); }
.onpage-card {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.onpage-head { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin-bottom: 10px; }
.toc { display: flex; flex-direction: column; gap: 1px; }
.toc-item {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 7px 8px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-2);
  border-radius: 7px;
  border-left: 2px solid transparent;
  transition: all .18s var(--ease);
}
.toc-item:hover { color: var(--text); background: var(--surface-2); }
.toc-item.current { color: var(--primary); background: var(--primary-soft); border-left-color: var(--primary); font-weight: 600; }
.toc-no { font-family: var(--font-num); font-size: 10.5px; font-weight: 700; opacity: .6; padding-top: 1px; }
.toc-text { min-width: 0; }
.onpage-meta { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-3); }

/* 翻页 */
.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.pager-btn {
  display: flex; flex-direction: column; gap: 3px;
  padding: 14px 18px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all .2s var(--ease);
}
.pager-btn:hover { border-color: var(--primary); background: var(--primary-soft); transform: translateY(-1px); }
.pager-next { text-align: right; }
.pager-dir { font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--text-3); }
.pager-name { font-size: 13.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.detail-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

/* ---------- 6. 内容块 ---------- */
.note {
  display: flex;
  gap: 11px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid;
  font-size: 13.5px;
  line-height: 1.7;
}
.note-icon {
  flex: 0 0 18px; height: 18px;
  margin-top: 2px;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 800; font-style: normal;
  border-radius: 50%;
}
.note-body { min-width: 0; }
.note-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; margin-bottom: 1px; }
.note p { color: inherit; }
.note-tip { background: color-mix(in srgb, var(--primary) 5%, var(--surface)); border-color: color-mix(in srgb, var(--primary) 16%, var(--border)); color: var(--text); }
.note-tip .note-icon { background: var(--primary); color: var(--primary-ink); }
.note-tip .note-label { color: var(--primary); }
.note-warn { background: color-mix(in srgb, var(--warn) 6%, var(--surface)); border-color: color-mix(in srgb, var(--warn) 20%, var(--border)); color: var(--text); }
.note-warn .note-icon { background: var(--warn); color: #fff; }
.note-warn .note-label { color: var(--warn); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table-wrap th, .table-wrap td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.table-wrap th {
  font-weight: 600;
  font-size: 12.5px;
  color: var(--text-2);
  background: var(--surface-2);
  white-space: nowrap;
  letter-spacing: .01em;
}
.table-wrap td:first-child { font-weight: 600; color: var(--text); white-space: nowrap; }
.table-wrap tr:last-child td { border-bottom: none; }
.table-wrap tbody tr { transition: background .18s var(--ease); }
.table-wrap tbody tr:hover { background: var(--surface-2); }

.code { border: 1px solid #1e2632; border-radius: var(--radius-sm); overflow: hidden; background: #0d1117; }
.code-bar { display: flex; align-items: center; justify-content: space-between; padding: 7px 12px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #7d8590; background: #161b22; border-bottom: 1px solid #21262d; }
.code-copy { padding: 2px 9px; font-size: 11px; color: #c9d1d9; background: #21262d; border-radius: 5px; transition: background .2s var(--ease); }
.code-copy:hover { background: #30363d; }
.code pre { margin: 0; padding: 14px; overflow-x: auto; }
.code code { color: #79c0ff; font-size: 12.5px; line-height: 1.7; white-space: pre; }

.fig {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
}
/* 图片：默认按原始比例，过宽/过窄图自动限制在合理范围 */
.fig img {
  display: block;
  margin: 0 auto;
  width: auto;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 0;
  cursor: zoom-in;
  transition: transform .35s var(--ease-out);
}
.fig img:hover { transform: scale(1.012); }
/* 竖图（如手机截图、参数参考图）：限制高度，避免一屏只看到一张图 */
.fig img[data-orient="portrait"] { max-height: 62vh; width: auto; }
/* 超宽图：等比缩小并居中 */
.fig img[data-orient="wide"] { width: 100%; max-height: 60vh; object-fit: contain; }
.fig figcaption { padding: 9px 14px; font-size: 12px; color: var(--text-3); text-align: center; border-top: 1px solid var(--border); background: var(--surface); }
/* 视频：保持 16:9，不撑满整屏 */
.video-figure { width: 100%; max-width: 760px; margin-inline: auto; }
.video-figure video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 62vh;
  object-fit: contain;
  background: #000;
}
/* 竖屏视频：按 9:16 限制宽度，居中显示 */
.video-figure.video-portrait video {
  aspect-ratio: 9 / 16;
  width: auto;
  max-width: min(100%, 360px);
  max-height: 70vh;
  margin: 0 auto;
}

/* 图片放大查看 */
.img-zoom {
  position: fixed; inset: 0;
  z-index: 150;
  display: grid; place-items: center;
  padding: 24px;
  background: rgba(8, 12, 20, .82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .25s var(--ease), visibility .25s;
}
.img-zoom.show { opacity: 1; visibility: visible; pointer-events: auto; }
.img-zoom img {
  max-width: min(92vw, 1100px);
  max-height: 84vh;
  object-fit: contain;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  transform: scale(.94);
  transition: transform .3s var(--ease-out);
}
.img-zoom.show img { transform: none; }
.img-zoom-hint {
  position: absolute; bottom: 20px; left: 50%;
  transform: translateX(-50%);
  padding: 6px 14px;
  font-size: 12px; color: #fff;
  background: rgba(17, 24, 39, .8);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 99px;
}
body.img-zoom-open { overflow: hidden; }

/* ---------- 7. 按钮 / 弹层 / 提示 / 加载 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px;
  padding: 0 18px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), box-shadow .25s var(--ease), transform .2s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { color: var(--primary-ink); background: var(--primary); box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--primary) 70%, transparent); }
.btn-primary:hover { color: var(--primary-ink); background: var(--primary-hover); box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--primary) 80%, transparent); }
.btn-outline { color: var(--hero-ink); background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .28); }
.btn-outline:hover { color: var(--hero-ink); background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .5); }
.btn-ghost { color: var(--text-2); background: var(--surface); border-color: var(--border); }
.btn-ghost:hover { color: var(--primary); border-color: var(--primary); }
.detail .btn-primary { color: var(--primary-ink); }

.variant-v2 .hero .btn-outline,
.home-service-card .btn-outline,
.block .btn-outline { color: var(--text); border-color: var(--border-strong); background: var(--surface); }

.mask {
  position: fixed; inset: 0;
  z-index: 70;
  background: rgba(8, 12, 20, .5);
  backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden;
  transition: opacity .3s var(--ease), visibility .3s;
}
.mask.show { opacity: 1; visibility: visible; }

.toast {
  position: fixed;
  left: 50%; bottom: 36px;
  z-index: 120;
  display: inline-flex; align-items: center; gap: 9px;
  transform: translate(-50%, 20px);
  padding: 11px 18px;
  font-size: 13px; font-weight: 500;
  color: #f4f7fb;
  background: #111827;
  border-radius: var(--radius-sm);
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .6);
  opacity: 0; visibility: hidden;
  transition: opacity .25s var(--ease), transform .3s var(--ease-out), visibility .25s;
}
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.toast-dot { width: 6px; height: 6px; border-radius: 50%; background: #34d399; }

/* 回到顶部：全站统一按钮（悬浮右下角，滚过 420px 出现） */
.to-top {
  position: fixed;
  right: 24px; bottom: 28px;
  z-index: 90;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  color: var(--primary);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 26px -12px rgba(15, 23, 42, .35), 0 2px 6px -2px rgba(15, 23, 42, .12);
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  opacity: 0; visibility: hidden;
  transform: translateY(12px) scale(.96);
  transition: opacity .28s var(--ease-out), transform .28s var(--ease-out),
              visibility .28s, color .2s var(--ease), border-color .2s var(--ease),
              background .2s var(--ease), box-shadow .2s var(--ease);
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover {
  color: var(--primary-ink, #fff);
  background: var(--primary);
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 16px 32px -14px color-mix(in srgb, var(--primary) 70%, transparent);
}
.to-top:active { transform: translateY(-1px) scale(.97); }
.to-top:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.to-top svg { transition: transform .25s var(--ease-out); }
.to-top:hover svg { transform: translateY(-2px); }

/* 悬停时显示文字气泡 */
.to-top::after {
  content: "回到顶部";
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  color: #fff;
  background: rgba(15, 23, 42, .86);
  border-radius: 7px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease-out);
}
.to-top:hover::after, .to-top:focus-visible::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.qr-preview {
  position: fixed; inset: 0;
  z-index: 140;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(8, 12, 20, .76);
  backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .25s var(--ease), visibility .25s;
}
.qr-preview.show { opacity: 1; visibility: visible; pointer-events: auto; }
.qr-preview-image {
  width: min(78vw, 480px);
  height: min(78vw, 480px);
  max-height: 80vh;
  padding: 12px;
  object-fit: contain;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  transform: scale(.92);
  transition: transform .3s var(--ease-out);
}
.qr-preview.show .qr-preview-image { transform: none; }
.qr-preview-hint {
  position: absolute;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  padding: 6px 14px;
  font-size: 12px;
  color: #fff;
  background: rgba(17, 24, 39, .8);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 99px;
}
body.qr-open { overflow: hidden; }

.site-foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-3);
}

.page-loader {
  position: fixed; inset: 0;
  z-index: 200;
  background: var(--bg);
  display: grid; place-items: center;
  transition: opacity .35s var(--ease), visibility .35s;
}
.page-loader.done { opacity: 0; visibility: hidden; }
.page-loader span {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  border-top-color: var(--primary);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 顶栏跳转后的区块高亮 */
.section-flash { animation: sectionFlash 1.6s var(--ease-out); }
@keyframes sectionFlash {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 0%, transparent); }
  22%  { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 26%, transparent); }
  100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 0%, transparent); }
}
.block.section-flash, #services.section-flash { border-radius: var(--radius); }

/* ---------- 交互反馈：按压 / 玻璃质感 ---------- */
.btn, .icon-btn, .cat-card, .home-card, .cat-tool, .pager-btn, .seg-btn,
.tree-mode-btn, .home-sub-btn, .cat-btn {
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.btn:active, .icon-btn:active, .cat-tool:active, .pager-btn:active,
.seg-btn:active, .tree-mode-btn:active, .home-sub-btn:active { transform: scale(.97); }
.cat-card:active, .cat-btn:active { transform: scale(.99); }
.home-card:active { transform: translateY(-1px) scale(.995); }

/* 玻璃质感：顶栏 / 侧栏 / 页内目录 / 浮层 */
.topbar {
  background: color-mix(in srgb, var(--topbar-bg) 88%, transparent);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}
.variant-v3 .topbar { background: color-mix(in srgb, var(--topbar-bg) 92%, transparent); }
body.is-tutorial .onpage-card {
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}
.sidebar {
  background: color-mix(in srgb, var(--side-bg) 94%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.hero-panel, .hero-aside {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 12px 30px -18px rgba(0, 0, 0, .5);
}

/* 教程页内图片、表格出现时的柔和上浮 */
.detail .fig, .detail .table-wrap, .detail .note { animation: softIn .45s var(--ease-out) both; }
@keyframes softIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 8. 动画 ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .55s var(--ease-out), transform .55s var(--ease-out); }
.reveal.in-view { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .home-card, .card, .step { opacity: 1 !important; }
}

/* ---------- 9. 响应式 ---------- */
@media (min-width: 1440px) {
  :root { --sidebar-w: 344px; --gap: 32px; }
}

@media (max-width: 1280px) {
  :root { --sidebar-w: 286px; --gap: 22px; }
  .topbar-inner, .layout { padding-left: 22px; padding-right: 22px; }
  .variant-v2 .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1120px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .onpage { display: none; }
  .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .variant-v2 .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-sub { display: none; }
}

@media (max-width: 900px) {
  :root { --topbar-h: 58px; }
  .menu-btn { display: grid; }
  .topnav { display: none; }
  .brand-text { font-size: 15px; }
  .search-top { max-width: none; }
  .search-kbd, .btn-help { display: none; }
  .topbar-inner { gap: 10px; padding: 0 14px; }
  .layout { padding: 16px 14px 48px; gap: 16px; }

  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 80;
    width: min(86vw, 330px);
    max-height: none;
    flex: none;
    padding: 16px 12px;
    border: 0;
    border-right: 1px solid var(--border);
    border-radius: 0;
    box-shadow: var(--shadow-lg);
    transform: translateX(-102%);
    transition: transform .35s var(--ease-out);
  }
  .sidebar.open { transform: none; }
  .sidebar-head .sidebar-title { display: none; }
  .sidebar-head { border-bottom: 0; padding-bottom: 6px; margin-bottom: 6px; }
  .sidebar-mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 2px 12px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    font-weight: 700;
  }
  .sidebar-close {
    width: 40px; height: 40px;
    flex: 0 0 40px;
    display: grid; place-items: center;
    font-size: 21px;
    line-height: 1;
    color: var(--text-2);
    border-radius: 8px;
    transition: background .18s var(--ease), color .18s var(--ease);
  }
  .sidebar-close:hover { background: var(--surface-2); color: var(--text); }

  /* 目录抽屉顶部的移动端主导航：三段式胶囊，当前页高亮 */
  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin: 0 0 12px;
    padding: 4px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
  }
  .mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    height: 40px;
    padding: 0 4px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1;
    color: var(--text-2);
    white-space: nowrap;
    border-radius: 9px;
    -webkit-tap-highlight-color: transparent;
    transition: color .2s var(--ease), background .2s var(--ease),
                box-shadow .25s var(--ease), transform .15s var(--ease);
  }
  .mobile-nav-link svg { flex: 0 0 auto; width: 14px; height: 14px; opacity: .68; transition: opacity .2s var(--ease); }
  .mobile-nav-link:hover { color: var(--text); background: color-mix(in srgb, var(--surface) 76%, transparent); }
  .mobile-nav-link:hover svg { opacity: 1; }
  .mobile-nav-link:active { transform: scale(.97); }
  .mobile-nav-link.active {
    color: var(--primary-ink);
    background: var(--primary);
    box-shadow: 0 8px 18px -12px color-mix(in srgb, var(--primary) 80%, transparent);
  }
  .mobile-nav-link.active svg { opacity: 1; }
  html[data-theme="dark"] .mobile-nav-link.active {
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 20%, var(--surface));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 32%, transparent);
  }

  .hero { grid-template-columns: 1fr; gap: 20px; padding: 28px 22px; }
  .hero-panel { display: none; }
  .variant-v3 .hero { padding: 30px 22px; }
  .variant-v2 .hero { padding: 34px 22px 26px; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-services { grid-template-columns: 1fr; }
  .detail-hero { flex-direction: column; align-items: flex-start; gap: 14px; padding: 22px; }
  .hero-icon { flex: 0 0 52px; height: 52px; }
  .hero-text h1 { font-size: 19px; }
  .step-head { padding: 13px 14px; gap: 11px; }
  .step-body-inner { padding-left: 14px; padding-right: 14px; }
  .step.open .step-body-inner { padding-bottom: 16px; }
  .step-no { flex-basis: 30px; height: 30px; font-size: 12px; }
  .pager { grid-template-columns: 1fr; }
  .to-top { right: 14px; bottom: 16px; }

  /* ---- 手机端细节适配（原独立 900px 块合并于此） ---- */
  /* 顶栏：搜索占满剩余宽度，图标按钮保持 40px 触控尺寸 */
  .topbar-inner { gap: 8px; }
  .search-top { flex: 1 1 auto; min-width: 0; height: 40px; padding: 0 12px; }
  .search input { font-size: 16px; } /* iOS 聚焦不放大页面 */
  .icon-btn { width: 40px; height: 40px; flex-basis: 40px; }
  .brand-logo { width: 32px; height: 32px; flex-basis: 32px; }
  .brand { gap: 8px; }

  /* 方案三：概览面板在手机上改为横排统计，避免被挤成竖条 */
  .variant-v3 .hero { display: flex; flex-direction: column; gap: 18px; }
  .variant-v3 .hero-aside { width: 100%; padding: 14px 16px; }
  .variant-v3 .aside-label { display: none; }
  .variant-v3 .aside-figure {
    display: flex; align-items: baseline; gap: 8px;
    margin: 0 0 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
  }
  .variant-v3 .aside-num { font-size: 30px; }
  .variant-v3 .aside-list { display: flex; gap: 8px; }
  .variant-v3 .aside-list li {
    flex: 1; min-width: 0;
    flex-direction: column; align-items: flex-start; gap: 2px;
    padding: 0;
    border-top: 0;
    font-size: 11.5px;
    white-space: nowrap;
  }
  .variant-v3 .aside-list b { font-size: 16px; }
  .variant-v3 .home-title { font-size: 24px; }

  /* 首页首屏：按钮撑满一行，统计两列 */
  .hero { padding: 26px 20px; border-radius: var(--radius); }
  .hero-actions { gap: 8px; }
  .hero-actions .btn { flex: 1 1 0; height: 42px; }
  .home-title { font-size: 23px; }
  .home-subtitle { font-size: 13px; line-height: 1.8; }
  .eyebrow { font-size: 11px; }

  /* 类目卡片：紧凑化，型号清单单列显示 */
  .home-grid { gap: 12px; }
  .home-card { border-radius: var(--radius); }
  .home-card-main {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 16px 16px 14px;
  }
  .home-card-art { width: 48px; height: 48px; flex-basis: 48px; border-radius: 13px; }
  .home-card-art .home-card-icon-image,
  .home-card-art .home-card-emoji,
  .home-card-art > svg { width: 27px; height: 27px; }
  .home-card-title { font-size: 16px; }
  .home-card-desc { font-size: 12px; -webkit-line-clamp: 2; }
  .home-card-count { font-size: 20px; }
  .home-sub-list { grid-template-columns: 1fr; }
  .home-sub-btn { padding: 10px 16px; }
  .home-sub-label { max-width: 100%; }

  /* 清单模式：小屏隐藏描述，只保留标题与篇数 */
  .home-grid.as-table .home-card-main { grid-template-columns: 40px minmax(0, 1fr) auto; padding: 12px 14px; }
  .home-grid.as-table .home-card-copy { grid-template-columns: 1fr; }
  .home-grid.as-table .home-card-desc { display: none; }

  /* 统计条：字号略小但保持呼吸 */
  .stat-value { font-size: 22px; }

  /* 侧栏抽屉：贴近手机宽度，行高适合手指点击 */
  .sidebar {
    width: min(88vw, 360px);
    padding: calc(14px + env(safe-area-inset-top, 0px)) 12px calc(20px + env(safe-area-inset-bottom, 0px));
  }
  .cat-parent { min-height: 46px; font-size: 14.5px; }
  .cat-btn.cat-child { min-height: 40px; padding: 8px 10px; font-size: 13.5px; }
  .cat-card { padding: 11px 12px; }
  .cat-card-icon { width: 36px; height: 36px; flex-basis: 36px; }
  .cat-caret { width: 36px; height: 36px; flex-basis: 36px; border-radius: 9px; }
  .tree-mode-btn { height: 34px; font-size: 13px; }
  .cat-tool { height: 38px; font-size: 12.5px; border-radius: 9px; }
  /* 网格 / 清单切换：加大触控区 */
  .seg-btn { height: 36px; padding: 0 14px; font-size: 13px; }

  /* 教程页：标题与步骤 */
  .crumb { font-size: 11.5px; gap: 5px; margin-bottom: 10px; }
  /* 手机端：插图与标题同行，信息更紧凑 */
  .detail-hero { flex-direction: row; align-items: flex-start; padding: 18px; gap: 14px; }
  .detail-hero .hero-icon { flex: 0 0 64px; height: 64px; }
  .hero-icon { flex: 0 0 72px; height: 72px; }
  .hero-illustration { width: 52px; height: 52px; }
  .hero-text h1 { font-size: 19px; line-height: 1.4; }
  .hero-text > p { font-size: 13px; }
  .hero-chips { margin-top: 10px; }
  .detail-grid { margin-top: 14px; }
  .steps { gap: 8px; }
  .step-head { padding: 14px; gap: 10px; }
  .step-title { font-size: 14.5px; }
  .step-body-inner { font-size: 13.5px; line-height: 1.78; }
  .step-body-inner ol > li { padding-left: 26px; }
  .detail-foot { gap: 8px; }
  .detail-foot .btn { flex: 1 1 40%; height: 42px; }
  .pager-btn { padding: 12px 14px; }
  .table-wrap { font-size: 13px; }

  /* 浮层与提示贴合手机 */
  .toast { max-width: calc(100vw - 32px); bottom: 86px; font-size: 12.5px; }
  .to-top { width: 42px; height: 42px; border-radius: 12px; }
  .to-top::after { display: none; }
  .qr-preview-image { border-radius: 14px; }
}

/* ---------- 手机端细节适配 ---------- */

@media (max-width: 600px) {
  .hero { padding: 22px 16px; }
  .hero-actions .btn { flex: 1 1 calc(50% - 4px); padding: 0 10px; font-size: 13px; }
  .home-card-main { gap: 10px; }
  .block-head { flex-wrap: wrap; gap: 8px; }
  .block-desc { flex-basis: 100%; }
  .detail-hero { padding: 16px 14px; gap: 12px; }
  .detail-hero .hero-icon { flex: 0 0 58px; height: 58px; }
  .hero-illustration { width: 46px; height: 46px; }
  .hero-text h1 { font-size: 18px; }
  .step-title { font-size: 14px; }
  .step-no { flex-basis: 28px; height: 28px; font-size: 11.5px; }
  .step-toggle { flex-basis: 22px; width: 22px; height: 22px; }
  .side-list-hint { font-size: 12px; }
}

@media (max-width: 380px) {
  .brand-sub { display: none; }
  .search input { font-size: 15px; }
  .home-card { padding: 12px; }
  .stat { padding: 11px 12px; }
}

@media (max-width: 600px) {
  body { font-size: 14.5px; }
  .home-grid, .variant-v2 .home-grid, .variant-v3 .home-grid { grid-template-columns: 1fr; }
  .home-title { font-size: 22px; }
  .home-subtitle { font-size: 13px; }
  .stat-value { font-size: 22px; }
  .stat { padding: 13px 14px; }
  .block-title { font-size: 16px; }
  .qr-preview { padding: 16px; }
  .qr-preview-image { width: min(86vw, 380px); height: min(86vw, 380px); }
  .home-service-card { flex-direction: row; padding: 14px; }
  .home-service-qr { flex-basis: 72px; }
  .home-service-qr img { width: 72px; height: 72px; }
  .site-foot { flex-direction: column; }
  .detail-foot .btn { flex: 1 1 auto; }
  .table-wrap th, .table-wrap td { padding: 9px 11px; }
}
