:root {
    --bg: #0d0d0f;
    --bg-elev: #16161a;
    --bg-elev-2: #1e1e24;
    --ink: #e8e8ea;
    --ink-soft: #a8a8b0;
    --ink-mute: #70707a;
    --line: #2a2a32;
    --line-soft: #1f1f26;
    --accent: #5b8cff;
    --accent-soft: rgba(91, 140, 255, 0.12);
    --accent-ink: #fff;
    --warn: #f0b429;
    --warn-soft: rgba(240, 180, 41, 0.1);
    --success: #44c48a;
    --success-soft: rgba(68, 196, 138, 0.1);
    --radius: 10px;
    --radius-sm: 6px;
    --content-max: 760px;
    --nav-width: 240px;
    --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }

  html { scroll-behavior: smooth; }

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

  /* 顶部条 */
  .topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: rgba(13, 13, 15, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0 clamp(20px, 4vw, 40px);
  }
  .topbar-logo {
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.01em;
  }
  .topbar-logo span {
    color: var(--accent);
  }
  .topbar-tag {
    margin-left: 12px;
    font-size: 12px;
    color: var(--ink-mute);
    padding: 2px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
  }

  /* 主体布局 */
  .layout {
    display: grid;
    grid-template-columns: var(--nav-width) 1fr;
    gap: 60px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 96px clamp(20px, 4vw, 40px) 80px;
  }

  /* 左侧目录 */
  .sidebar {
    position: sticky;
    top: 96px;
    align-self: start;
    height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 12px;
  }
  .sidebar::-webkit-scrollbar { width: 4px; }
  .sidebar::-webkit-scrollbar-track { background: transparent; }
  .sidebar::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

  .sidebar-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-mute);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
  }

  .toc {
    list-style: none;
    border-left: 2px solid var(--line-soft);
  }
  .toc li {
    position: relative;
  }
  .toc a {
    display: block;
    padding: 6px 0 6px 16px;
    margin-left: -2px;
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 14px;
    line-height: 1.5;
    border-left: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
  }
  .toc a:hover {
    color: var(--ink);
  }
  .toc a.active {
    color: var(--accent);
    border-left-color: var(--accent);
  }
  .toc .toc-sub {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
  }
  .toc .toc-sub a {
    font-size: 13px;
    padding-left: 32px;
    color: var(--ink-mute);
  }
  .toc .toc-sub a:hover { color: var(--ink-soft); }
  .toc .toc-sub a.active { color: var(--accent); }

  /* 移动端菜单按钮 */
  .menu-toggle {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: none;
    font-size: 20px;
    cursor: pointer;
    z-index: 99;
    box-shadow: 0 4px 20px rgba(91, 140, 255, 0.4);
  }

  /* 正文 */
  .content {
    min-width: 0;
    max-width: var(--content-max);
  }

  /* Hero */
  .hero {
    margin-bottom: 64px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--line);
  }
  .hero h1 {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
  }
  .hero h1 .accent { color: var(--accent); }
  .hero p {
    font-size: 17px;
    color: var(--ink-soft);
    line-height: 1.7;
    max-width: 620px;
  }
  .hero-meta {
    display: flex;
    gap: 16px;
    margin-top: 24px;
    flex-wrap: wrap;
  }
  .hero-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--ink-mute);
  }
  .hero-meta-item::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
  }

  /* 章节 */
  section {
    margin-bottom: 72px;
    scroll-margin-top: 80px;
  }

  .section-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font-mono);
    margin-bottom: 16px;
  }

  h2 {
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.015em;
    margin-bottom: 20px;
  }

  h3 {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    margin-top: 32px;
    margin-bottom: 12px;
    color: var(--ink);
  }

  p {
    margin-bottom: 16px;
    color: var(--ink-soft);
  }

  p strong {
    color: var(--ink);
    font-weight: 600;
  }

  ul, ol {
    margin-bottom: 20px;
    padding-left: 22px;
    color: var(--ink-soft);
  }
  li {
    margin-bottom: 8px;
  }
  li::marker {
    color: var(--accent);
  }

  /* 步骤列表 */
  .steps {
    list-style: none;
    padding: 0;
    counter-reset: step;
    margin: 24px 0;
  }
  .steps li {
    counter-increment: step;
    position: relative;
    padding: 16px 16px 16px 52px;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 12px;
    color: var(--ink-soft);
    line-height: 1.6;
  }
  .steps li::before {
    content: counter(step);
    position: absolute;
    left: 16px;
    top: 16px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-mono);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .steps li strong {
    color: var(--ink);
    font-weight: 600;
  }

  /* 提示框 */
  .tip {
    padding: 16px 18px;
    background: var(--accent-soft);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 20px 0;
    color: var(--ink-soft);
    font-size: 14.5px;
    line-height: 1.65;
  }
  .tip strong {
    color: var(--ink);
  }

  .warn {
    padding: 16px 18px;
    background: var(--warn-soft);
    border-left: 3px solid var(--warn);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 20px 0;
    color: var(--ink-soft);
    font-size: 14.5px;
    line-height: 1.65;
  }
  .warn strong {
    color: var(--warn);
  }

  /* 平台卡片网格 */
  .platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin: 24px 0;
  }
  .platform-card {
    padding: 18px;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: border-color 0.15s;
  }
  .platform-card:hover {
    border-color: var(--accent);
  }
  .platform-card h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--ink);
  }
  .platform-card p {
    font-size: 13.5px;
    color: var(--ink-mute);
    margin-bottom: 10px;
    line-height: 1.6;
  }
  .platform-tag {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--success-soft);
    color: var(--success);
    font-weight: 500;
  }
  .platform-tag.warn-tag {
    background: var(--warn-soft);
    color: var(--warn);
  }
  .platform-tag.accent-tag {
    background: var(--accent-soft);
    color: var(--accent);
  }

  /* FAQ 手风琴 */
  .faq {
    margin-top: 32px;
  }
  .faq details {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 8px;
    overflow: hidden;
  }
  .faq summary {
    padding: 16px 18px;
    cursor: pointer;
    font-weight: 500;
    color: var(--ink);
    font-size: 15px;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .faq summary::-webkit-details-marker { display: none; }
  .faq summary::after {
    content: "+";
    font-size: 20px;
    color: var(--ink-mute);
    transition: transform 0.2s;
    font-weight: 300;
  }
  .faq details[open] summary::after {
    transform: rotate(45deg);
  }
  .faq details[open] summary {
    border-bottom: 1px solid var(--line);
  }
  .faq .faq-body {
    padding: 16px 18px;
    color: var(--ink-soft);
    font-size: 14.5px;
    line-height: 1.7;
  }

  /* 代码/命令行样式 */
  code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--bg-elev-2);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent);
  }

  /* 分隔线 */
  .divider {
    height: 1px;
    background: var(--line);
    margin: 40px 0;
  }

  /* 底部 */
  footer {
    margin-top: 80px;
    padding-top: 32px;
    border-top: 1px solid var(--line);
    font-size: 13px;
    color: var(--ink-mute);
    line-height: 1.7;
  }

  /* 响应式 */
  @media (max-width: 900px) {
    .layout {
      grid-template-columns: 1fr;
      gap: 0;
      padding-top: 80px;
    }
    .sidebar {
      display: none;
      position: fixed;
      top: 56px;
      left: 0;
      right: 0;
      bottom: 0;
      height: auto;
      background: var(--bg);
      z-index: 90;
      padding: 24px;
      border-bottom: 1px solid var(--line);
    }
    .sidebar.open {
      display: block;
    }
    .menu-toggle {
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .content {
      max-width: 100%;
    }
  }

  /* 打印 */
  @media print {
    .topbar, .sidebar, .menu-toggle { display: none; }
    .layout {
      display: block;
      padding: 0;
      max-width: 100%;
    }
    .content { max-width: 100%; }
    body { background: #fff; color: #000; }
    .tip, .warn { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    section { page-break-inside: avoid; }
  }

/* 图片展示 */
.content-img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin: 20px 0;
  display: block;
}
.content-img-wrap {
  margin: 24px 0;
}
.content-img-wrap figcaption {
  font-size: 13px;
  color: var(--ink-mute);
  text-align: center;
  margin-top: 8px;
}
