/* =====================================================================
   AERODECK · A330 系统知识库
   美学方向：复刻 helixcloud.ai —— 极简浅色 SaaS / 技术文档
   纯白底 · Inter 字体 · 近黑标题 · 蓝 #006FEE 主强调色
   液压三系统功能色：GREEN #17C964 · BLUE #006FEE · YELLOW #F5A524
   ===================================================================== */

:root {
  /* 背景 */
  --bg:        #FFFFFF;
  --bg-soft:   #FAFAFB;   /* 交替区块 */
  --bg-mute:   #F5F6F8;   /* 代码 / 输入 */
  --panel:     #FFFFFF;

  /* 描边 */
  --line:        #ECEDF1;
  --line-strong: #E0E2E8;

  /* 文字 */
  --ink:        #1F2933;  /* 正文 */
  --ink-strong: #101720;  /* 标题 */
  --ink-dim:    #5A6573;  /* 次要 */
  --ink-faint:  #939AA5;  /* 弱化 */

  /* 主强调色 — HeroUI 蓝 */
  --accent:      #006FEE;
  --accent-ink:  #0059C2;
  --accent-soft: #EAF2FF;

  /* 语义 / 液压系统功能色 */
  --hyd-green: #17C964;
  --hyd-blue:  #006FEE;
  --hyd-amber: #F5A524;
  --danger:    #F31260;

  /* 阴影（浅色） */
  --shadow-sm: 0 1px 2px rgba(16,24,40,0.05);
  --shadow:    0 4px 18px rgba(16,24,40,0.07);
  --shadow-lg: 0 16px 42px rgba(16,24,40,0.12);

  --radius:   14px;
  --radius-s: 10px;
  --maxw:     1200px;

  --font:      "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: rgba(0,111,238,0.16); color: var(--ink-strong); }
a { color: inherit; text-decoration: none; }

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D7DAE0; border-radius: 99px; border: 3px solid #fff; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #C2C6CE; background-clip: content-box; }

/* ============================ 顶栏 ============================ */
.topbar {
  position: sticky; top: 0; z-index: 100;
  height: 64px; display: flex; align-items: center; gap: 26px;
  padding: 0 28px;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; flex-direction: column; gap: 3px; cursor: pointer; line-height: 1.02; }
.brand__name { font-weight: 700; font-size: 16.5px; letter-spacing: -0.022em; color: var(--ink-strong); white-space: nowrap; }
.brand__name b { color: var(--accent); font-weight: 700; }
.brand__sub { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.2em; color: var(--ink-faint); text-transform: uppercase; }

.topnav { display: flex; gap: 24px; margin-left: 6px; }
.topnav a { font-size: 14.5px; font-weight: 500; color: var(--ink-dim); letter-spacing: -0.01em; transition: color 0.18s; }
.topnav a:hover { color: var(--ink-strong); }
.topnav a.is-active { color: var(--accent); }

.topbar__spacer { flex: 1; }

.searchbtn {
  display: flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 13px;
  background: var(--bg); border: 1px solid var(--line-strong);
  border-radius: 10px; color: var(--ink-faint);
  font-family: var(--font); font-size: 13.5px; cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s; min-width: 230px;
}
.searchbtn:hover { border-color: #CBD0D8; box-shadow: var(--shadow-sm); }
.searchbtn svg { width: 15px; height: 15px; }
.searchbtn kbd { margin-left: auto; font-family: var(--font-mono); font-size: 11px; padding: 2px 6px; border: 1px solid var(--line-strong); border-radius: 5px; color: var(--ink-faint); }

/* ============================ 容器 ============================ */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* ============================ HERO ============================ */
.hero { position: relative; padding: 78px 0 30px; overflow: hidden; }
.hero__bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(680px 420px at 50% 8%, rgba(0,111,238,0.05), transparent 70%),
    radial-gradient(520px 360px at 82% 22%, rgba(245,165,36,0.05), transparent 70%);
}
.hero__bg::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(16,24,40,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16,24,40,0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 20%, transparent 75%);
}
.hero__inner { position: relative; z-index: 1; text-align: center; max-width: 980px; margin: 0 auto; }

.pill {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 13px; font-weight: 500; color: var(--ink-dim);
  padding: 7px 15px 7px 12px; border: 1px solid var(--line-strong);
  border-radius: 99px; background: var(--bg); box-shadow: var(--shadow-sm);
  margin-bottom: 30px;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--hyd-green); box-shadow: 0 0 0 3px rgba(23,201,100,0.18); }
.pill b { color: var(--ink-strong); font-weight: 600; }

.hero__title {
  font-weight: 700; font-size: clamp(38px, 5.8vw, 70px);
  line-height: 1.04; letter-spacing: -0.035em; color: var(--ink-strong);
  white-space: nowrap;
}
.hero__title .grad {
  background: linear-gradient(96deg, #0a7bf5 0%, #4a73f0 52%, #6d5cf0 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero__lede {
  margin: 26px auto 0; max-width: 50ch;
  font-size: clamp(17px, 1.8vw, 21px); line-height: 1.6; color: var(--ink-dim);
}
.hero__cta { margin-top: 34px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  height: 50px; padding: 0 24px; border-radius: 14px;
  font-family: var(--font); font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  cursor: pointer; border: 1.5px solid transparent; transition: transform 0.16s, box-shadow 0.22s, background 0.18s, border-color 0.18s;
}
.btn svg { width: 17px; height: 17px; }
.btn--primary { background: #0B0B0D; color: #fff; box-shadow: var(--shadow); }
.btn--primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); background: #18181B; }
.btn--ghost { background: var(--bg); border-color: var(--line-strong); color: var(--ink-strong); }
.btn--ghost:hover { border-color: #CBD0D8; background: var(--bg-soft); }
.btn:disabled { background: var(--bg-mute); color: var(--ink-faint); box-shadow: none; cursor: not-allowed; pointer-events: none; border-color: var(--line); }

/* HERO 机型选择器（复刻 Helix 三产品卡；点击联动下方系统目录）*/
.actypes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 54px; text-align: left; }
.actype {
  position: relative; background: var(--panel); border: 1.5px solid var(--line);
  border-radius: 16px; padding: 22px; cursor: pointer;
  transition: transform 0.2s, box-shadow 0.25s, border-color 0.2s, background 0.2s; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; min-height: 184px;
}
.actype:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.actype.is-active { border-color: var(--accent); background: linear-gradient(180deg, #F6FAFF, #fff); box-shadow: 0 0 0 3px rgba(0,111,238,0.12), var(--shadow); transform: none; }
.actype__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.actype__badge { font-weight: 800; font-size: 30px; letter-spacing: -0.04em; color: var(--ink-strong); line-height: 1; }
.actype.is-active .actype__badge { color: var(--accent); }
.actype__status { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.04em; padding: 4px 9px; border-radius: 99px; }
.actype__status.st-live { color: #0E8C46; background: rgba(23,201,100,0.10); }
.actype__status.st-live .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--hyd-green); }
.actype__status.st-soon { color: var(--ink-faint); background: var(--bg-mute); border: 1px solid var(--line); }
.actype__role { font-weight: 700; font-size: 15px; color: var(--ink-strong); margin-bottom: 6px; letter-spacing: -0.01em; }
.actype__desc { font-size: 13.5px; color: var(--ink-dim); line-height: 1.55; }
.actype__foot { margin-top: auto; padding-top: 14px; display: flex; align-items: center; justify-content: space-between; }
.actype__cta { font-size: 13px; font-weight: 600; color: var(--ink-faint); }
.actype__cta::after { content: "View systems"; }
.actype.is-active .actype__cta { color: var(--accent); }
.actype.is-active .actype__cta::after { content: "Now viewing ↓"; }
.actype__arrow { width: 22px; height: 22px; display: grid; place-items: center; color: var(--ink-faint); transition: transform 0.2s, color 0.2s; }
.actype:hover .actype__arrow { transform: translateX(3px); color: var(--accent); }
.actype.is-active .actype__arrow { color: var(--accent); transform: rotate(90deg); }

/* 统计条 */
.stats { display: flex; gap: 0; margin: 30px auto 0; max-width: 920px; padding: 22px 0; border-top: 1px solid var(--line); }
.stat { flex: 1; text-align: center; border-right: 1px solid var(--line); padding: 0 16px; }
.stat:last-child { border-right: none; }
.stat__num { font-weight: 700; font-size: 30px; letter-spacing: -0.02em; color: var(--ink-strong); }
.stat__num span { color: var(--accent); font-size: 17px; }
.stat__label { font-size: 12.5px; color: var(--ink-dim); margin-top: 4px; }

/* ============================ 区块 ============================ */
.section { padding: 72px 0; }
.section--soft { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section__head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.section__kicker { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; color: var(--accent); text-transform: uppercase; margin-bottom: 14px; }
.section__title { font-weight: 700; font-size: clamp(28px, 3.6vw, 40px); line-height: 1.1; letter-spacing: -0.03em; color: var(--ink-strong); }
.section__desc { color: var(--ink-dim); font-size: 17px; line-height: 1.6; margin-top: 14px; }

/* ATA 章节网格 */
.ata-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 16px; }
.ata-card {
  position: relative; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); padding: 22px; transition: transform 0.2s, box-shadow 0.25s, border-color 0.2s;
  min-height: 150px; display: flex; flex-direction: column; box-shadow: var(--shadow-sm);
}
.ata-card--live { cursor: pointer; }
.ata-card--live:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.ata-card--soon { opacity: 0.62; background: var(--bg-soft); box-shadow: none; }
.ata-card__code { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; color: var(--accent); }
.ata-card--soon .ata-card__code { color: var(--ink-faint); }
.ata-card__title { font-weight: 700; font-size: 18px; color: var(--ink-strong); margin-top: 12px; letter-spacing: -0.01em; line-height: 1.3; }
.ata-card__en { color: var(--ink-faint); font-size: 13px; margin-top: 4px; }
.ata-card__foot { margin-top: auto; padding-top: 16px; display: flex; align-items: center; justify-content: space-between; }
.ata-card__count { font-family: var(--font-mono); font-size: 11px; color: var(--ink-dim); letter-spacing: 0.04em; }
.tag-soon { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; color: var(--ink-faint); border: 1px solid var(--line-strong); border-radius: 99px; padding: 3px 9px; text-transform: uppercase; }
.tag-live { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; color: #0E8C46; background: rgba(23,201,100,0.10); border-radius: 99px; padding: 3px 9px 3px 8px; text-transform: uppercase; display: inline-flex; align-items: center; gap: 6px; }
.tag-live .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--hyd-green); }
.ata-card__arrow { width: 24px; height: 24px; display: grid; place-items: center; color: var(--accent); opacity: 0; transform: translateX(-5px); transition: 0.2s; }
.ata-card--live:hover .ata-card__arrow { opacity: 1; transform: translateX(0); }

/* 特性区 */
.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feat { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 26px; box-shadow: var(--shadow-sm); }
.feat__icon { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 18px; }
.feat__icon svg { width: 22px; height: 22px; }
.feat__title { font-weight: 700; font-size: 18px; color: var(--ink-strong); margin-bottom: 9px; letter-spacing: -0.01em; }
.feat__text { color: var(--ink-dim); font-size: 15px; line-height: 1.6; }

/* 页脚 */
.footer { border-top: 1px solid var(--line); padding: 46px 0 60px; background: var(--bg-soft); }
.footer__grid { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer__note { font-size: 13.5px; color: var(--ink-dim); line-height: 1.8; max-width: 42ch; margin-top: 14px; }
.footer__cols { display: flex; gap: 56px; }
.footer__col h5 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; color: var(--ink-faint); text-transform: uppercase; margin-bottom: 14px; }
.footer__col a { display: block; font-size: 14px; color: var(--ink-dim); padding: 5px 0; transition: color 0.18s; }
.footer__col a:hover { color: var(--accent); }

/* =====================================================================
   阅读器
   ===================================================================== */
.reader { display: grid; grid-template-columns: 280px minmax(0,1fr) 224px; max-width: 1440px; margin: 0 auto; align-items: start; }

.docnav { position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; padding: 30px 20px 60px; border-right: 1px solid var(--line); }
.docnav__back { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--ink-dim); margin-bottom: 24px; transition: color 0.18s; white-space: nowrap; }
.docnav__back svg { width: 15px; height: 15px; flex: none; }
.docnav__back:hover { color: var(--accent); }
.docnav__module { display: flex; align-items: center; gap: 11px; margin-bottom: 5px; }
.docnav__module .chip { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; padding: 4px 9px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); }
.docnav__module h3 { font-weight: 700; font-size: 18px; color: var(--ink-strong); letter-spacing: -0.01em; }
.docnav__sys { color: var(--ink-faint); font-size: 13px; margin-bottom: 24px; }
.docnav__group { margin-bottom: 22px; }
.docnav__grouptitle { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; color: var(--ink-faint); text-transform: uppercase; margin-bottom: 9px; padding-left: 4px; display: flex; align-items: center; gap: 8px; }
.docnav__grouptitle::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.docnav__item { display: block; padding: 9px 12px; border-radius: 9px; font-size: 14px; color: var(--ink-dim); line-height: 1.4; transition: background 0.16s, color 0.16s; margin-bottom: 2px; position: relative; }
.docnav__item:hover { background: var(--bg-mute); color: var(--ink-strong); }
.docnav__item.is-active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 500; }
.docnav__item.is-active::before { content: ""; position: absolute; left: -20px; top: 50%; transform: translateY(-50%); width: 3px; height: 20px; background: var(--accent); border-radius: 99px; }
.docnav__item .num { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); margin-right: 8px; }
.docnav__item.is-active .num { color: var(--accent); }

/* 中央文章 */
.article { padding: 46px 64px 120px; min-width: 0; }
.article__top { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.article__code { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; color: var(--accent); padding: 5px 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--accent-soft); }
.article__meta { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); display: inline-flex; align-items: center; gap: 6px; }
.article__meta svg { width: 14px; height: 14px; }
.kind-pill { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; padding: 4px 10px; border-radius: 99px; }
.kind-teaching { color: #0E8C46; background: rgba(23,201,100,0.10); }
.kind-deep { color: #C9821A; background: rgba(245,165,36,0.12); }
.kind-qa { color: var(--accent); background: var(--accent-soft); }

.article__title { font-weight: 700; font-size: clamp(30px, 4vw, 44px); line-height: 1.1; letter-spacing: -0.03em; color: var(--ink-strong); margin-bottom: 10px; }
.article__en { font-size: 17px; color: var(--ink-faint); margin-bottom: 30px; }
.article__hr { height: 1px; background: var(--line); margin-bottom: 34px; }

/* ---- Markdown 正文 ---- */
.md { font-size: 17px; line-height: 1.75; color: #2B3640; }
.md h1 { display: none; }
.md h2 { font-weight: 700; font-size: 26px; color: var(--ink-strong); margin: 50px 0 16px; letter-spacing: -0.02em; scroll-margin-top: 88px; position: relative; padding-left: 18px; }
.md h2::before { content: ""; position: absolute; left: 0; top: 13px; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.md h3 { font-weight: 700; font-size: 20px; color: var(--ink-strong); margin: 34px 0 13px; letter-spacing: -0.01em; scroll-margin-top: 88px; }
.md h4 { font-weight: 600; font-size: 16px; color: var(--accent-ink); margin: 24px 0 10px; }
.md p { margin: 15px 0; }
.md strong { color: var(--ink-strong); font-weight: 700; }
.md em { color: var(--ink-dim); }
.md ul, .md ol { margin: 15px 0 15px 2px; padding-left: 24px; }
.md li { margin: 7px 0; padding-left: 3px; }
.md li::marker { color: var(--accent); }
.md hr { border: none; height: 1px; background: var(--line); margin: 40px 0; }
.md a { color: var(--accent); font-weight: 500; border-bottom: 1px solid rgba(0,111,238,0.25); transition: border-color 0.18s; }
.md a:hover { border-color: var(--accent); }

/* wikilink */
.wikilink { color: var(--accent); font-weight: 500; border-bottom: 1px dashed rgba(0,111,238,0.4); padding: 0 1px; }
.wikilink:hover { border-bottom-style: solid; }
.wikilink--future { color: var(--ink-faint); border-bottom: 1px dashed var(--line-strong); cursor: help; }
.wikilink--future::after { content: "○"; font-size: 0.7em; vertical-align: super; margin-left: 2px; opacity: 0.6; }
.wikilink--concept { color: #C9821A; border-bottom: 1px dashed rgba(245,165,36,0.5); }

/* 引用块 — 手册原文 + 中译 */
.md blockquote { margin: 20px 0; padding: 16px 20px; border-left: 3px solid var(--accent); background: var(--bg-soft); border-radius: 0 var(--radius-s) var(--radius-s) 0; font-size: 15.5px; color: #475260; }
.md blockquote p { margin: 5px 0; }
.md blockquote em { color: #3A4654; }
.md blockquote strong { color: var(--accent-ink); }

/* 引用源 chip */
code.cite { font-family: var(--font-mono); font-size: 12px; color: #9A6206; background: rgba(245,165,36,0.10); border: 1px solid rgba(245,165,36,0.28); border-radius: 6px; padding: 2px 8px 2px 21px; position: relative; white-space: normal; }
code.cite::before { content: "§"; position: absolute; left: 8px; top: 50%; transform: translateY(-50%); color: #C9821A; font-weight: 700; }

/* 行内代码 */
.md :not(pre) > code { font-family: var(--font-mono); font-size: 0.85em; background: var(--bg-mute); color: #344452; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); }

/* 代码块 / 原理图 */
.md pre { margin: 22px 0; padding: 20px 22px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; position: relative; font-size: 13px; line-height: 1.0; }
.md pre::before { content: "SCHEMATIC"; position: absolute; top: 0; right: 0; font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.18em; color: var(--ink-faint); background: var(--bg-mute); padding: 4px 10px; border-radius: 0 var(--radius) 0 8px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.md pre code { font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, "Cascadia Code", Consolas, monospace; font-size: 13px; line-height: 1.0; color: #28303B; background: none; border: none; padding: 0; white-space: pre; letter-spacing: 0; -webkit-font-smoothing: auto; }

/* 表格 */
.md .table-wrap { overflow-x: auto; margin: 22px 0; border: 1px solid var(--line); border-radius: var(--radius); }
.md table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.md thead th { background: var(--bg-soft); color: var(--ink-strong); font-weight: 600; text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.md tbody td { padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--ink-dim); vertical-align: top; }
.md tbody tr:last-child td { border-bottom: none; }
.md tbody tr:hover td { background: var(--bg-soft); }
.md tbody strong { color: var(--ink-strong); }

/* details / 自测题 */
.md details { margin: 15px 0; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--panel); overflow: hidden; box-shadow: var(--shadow-sm); }
.md details summary { cursor: pointer; padding: 14px 18px; list-style: none; font-weight: 600; font-size: 14px; color: var(--accent); display: flex; align-items: center; gap: 10px; transition: background 0.18s; }
.md details summary::-webkit-details-marker { display: none; }
.md details summary::before { content: "▸"; color: var(--accent); font-size: 12px; transition: transform 0.2s; }
.md details[open] summary::before { transform: rotate(90deg); }
.md details summary::after { content: "Show answer"; margin-left: auto; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; color: var(--ink-faint); text-transform: uppercase; font-weight: 400; }
.md details[open] summary { background: var(--accent-soft); border-bottom: 1px solid var(--line); }
.md details[open] summary::after { content: "Hide"; }
.md details > *:not(summary) { padding: 0 18px; }
.md details > p:first-of-type { padding-top: 14px; }
.md details > *:last-child { padding-bottom: 16px; }

/* 文章底部导航 */
.article__nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 56px; }
.article__nav a { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; transition: border-color 0.18s, box-shadow 0.22s; background: var(--panel); box-shadow: var(--shadow-sm); }
.article__nav a:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.article__nav .dir { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; color: var(--ink-faint); text-transform: uppercase; }
.article__nav .name { font-weight: 700; font-size: 16px; margin-top: 7px; color: var(--ink-strong); letter-spacing: -0.01em; }
.article__nav .next { text-align: right; }

/* 右侧 TOC */
.toc { position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; padding: 46px 20px 60px; }
.toc__title { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; color: var(--ink-faint); text-transform: uppercase; margin-bottom: 15px; }
.toc a { display: block; font-size: 13px; color: var(--ink-faint); padding: 5px 0 5px 14px; line-height: 1.4; border-left: 1.5px solid var(--line); transition: color 0.16s, border-color 0.16s; }
.toc a.lvl-3 { padding-left: 28px; font-size: 12.5px; }
.toc a:hover { color: var(--ink-dim); }
.toc a.is-active { color: var(--accent); border-left-color: var(--accent); font-weight: 500; }

/* 阅读进度条 */
.progress { position: fixed; top: 64px; left: 0; height: 2px; background: linear-gradient(90deg, var(--accent), #6d5cf0); z-index: 90; width: 0; }

/* ============================ 搜索面板 ============================ */
.search-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(16,24,40,0.28); backdrop-filter: blur(4px); display: none; align-items: flex-start; justify-content: center; padding-top: 13vh; }
.search-overlay.is-open { display: flex; }
.search-box { width: min(620px, 92vw); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; }
.search-box__input { display: flex; align-items: center; gap: 11px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.search-box__input svg { width: 18px; height: 18px; color: var(--ink-faint); }
.search-box__input input { flex: 1; background: none; border: none; outline: none; color: var(--ink-strong); font-family: var(--font); font-size: 16.5px; }
.search-box__input input::placeholder { color: var(--ink-faint); }
.search-box__input kbd { font-family: var(--font-mono); font-size: 11px; padding: 2px 7px; border: 1px solid var(--line-strong); border-radius: 5px; color: var(--ink-faint); }
.search-results { max-height: 52vh; overflow-y: auto; padding: 8px; }
.search-results__empty { padding: 30px; text-align: center; color: var(--ink-faint); font-size: 14px; }
.search-result { display: block; padding: 11px 14px; border-radius: 9px; cursor: pointer; transition: background 0.14s; }
.search-result:hover, .search-result.is-active { background: var(--bg-mute); }
.search-result__code { font-family: var(--font-mono); font-size: 11px; color: var(--accent); letter-spacing: 0.06em; }
.search-result__title { font-size: 15px; color: var(--ink-strong); margin-top: 3px; font-weight: 500; }
.search-result__title mark { background: rgba(0,111,238,0.16); color: var(--accent-ink); border-radius: 3px; padding: 0 2px; }

/* 入场动画 */
.reveal { opacity: 0; transform: translateY(18px); }
.reveal.in { opacity: 1; transform: none; transition: opacity 0.6s cubic-bezier(.2,.7,.2,1), transform 0.6s cubic-bezier(.2,.7,.2,1); }

/* 子页（机型目录 / 章节列表）通用 */
.pagewrap { min-height: calc(100vh - 64px); }
.wrap--narrow { max-width: 860px; }
.section__head--left { text-align: left; max-width: none; margin: 0 0 38px; }
.crumb { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; color: var(--ink-faint); margin-bottom: 22px; display: flex; align-items: center; gap: 9px; }
.crumb a { color: var(--ink-dim); transition: color 0.18s; }
.crumb a:hover { color: var(--accent); }
.crumb span { color: var(--line-strong); }
.crumb b { color: var(--ink-strong); font-weight: 600; }

/* 章节文章列表 */
.doc-list { display: flex; flex-direction: column; gap: 10px; }
.doc-row { display: flex; align-items: center; gap: 16px; padding: 18px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow-sm); transition: border-color 0.18s, box-shadow 0.22s, transform 0.18s; }
.doc-row:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateX(3px); }
.doc-row__num { font-family: var(--font-mono); font-size: 13px; color: var(--ink-faint); flex: none; }
.doc-row__title { font-weight: 600; font-size: 16px; color: var(--ink-strong); flex: 1; letter-spacing: -0.01em; line-height: 1.4; }
.doc-row__meta { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); flex: none; }
.doc-row__arrow { width: 20px; height: 20px; display: grid; place-items: center; color: var(--ink-faint); flex: none; transition: color 0.18s, transform 0.18s; }
.doc-row:hover .doc-row__arrow { color: var(--accent); transform: translateX(2px); }
.empty-note { padding: 40px 28px; text-align: center; color: var(--ink-dim); font-size: 15px; line-height: 1.8; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--bg-soft); }
.empty-note code { font-family: var(--font-mono); font-size: 0.85em; background: var(--bg-mute); padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line); color: #344452; }

/* 响应式 */
@media (max-width: 1180px) { .reader { grid-template-columns: 256px minmax(0,1fr); } .toc { display: none; } }
@media (max-width: 860px) {
  .actypes { grid-template-columns: 1fr; }
  .feat-grid { grid-template-columns: 1fr; }
  .stats { flex-wrap: wrap; } .stat { min-width: 50%; flex: none; padding: 12px; }
  .reader { grid-template-columns: 1fr; }
  .docnav { display: none; }
  .article { padding: 32px 22px 80px; }
  .topnav { display: none; }
  .searchbtn { min-width: 0; } .searchbtn span { display: none; }
  .hero__title { white-space: normal; }
}
