/* Monta HD 帮助中心 —— 设计令牌与布局
   深色为默认，浅色可切换（跟随系统 / 手动） */

:root {
  --bg: #0a0c10;
  --bg-glow: rgba(255, 176, 32, 0.08);
  --surface: #10141b;
  --surface-2: #151a23;
  --surface-3: #1b212c;
  --line: #232b38;
  --line-soft: #1a212b;
  --text: #e9edf5;
  --text-2: #c3ccda;
  --muted: #8d99ac;
  --accent: #ffb020;
  --accent-ink: #ffcb6b;
  --accent-soft: rgba(255, 176, 32, 0.11);
  --accent-line: rgba(255, 176, 32, 0.32);
  --ok: #3ddc97;
  --warn: #ff7a6b;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  --radius: 12px;
  --topbar-h: 60px;
  --font: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

[data-theme="light"] {
  --bg: #fbfbfc;
  --bg-glow: rgba(255, 176, 32, 0.16);
  --surface: #ffffff;
  --surface-2: #f5f6f8;
  --surface-3: #eef0f4;
  --line: #e3e6ec;
  --line-soft: #edeff3;
  --text: #11151c;
  --text-2: #333c4a;
  --muted: #626d7e;
  --accent: #b4700a;
  --accent-ink: #8a5505;
  --accent-soft: rgba(255, 176, 32, 0.16);
  --accent-line: rgba(180, 112, 10, 0.3);
  --ok: #0f8a5f;
  --warn: #c0392b;
  --shadow: 0 18px 48px rgba(17, 21, 28, 0.12);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 520px;
  background:
    radial-gradient(680px 320px at 22% -10%, var(--bg-glow), transparent 70%),
    radial-gradient(520px 260px at 82% -18%, rgba(120, 160, 255, 0.07), transparent 70%);
  pointer-events: none;
  z-index: -1;
}

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── 顶栏 ───────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-inner {
  max-width: 1480px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; flex: none; }
.brand-text {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.brand-divider { width: 1px; height: 16px; background: var(--line); margin: 0 2px; }
.brand-sub { font-size: 13px; color: var(--muted); letter-spacing: 0.02em; }

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.search-box { position: relative; width: 260px; }
.search-input {
  width: 100%;
  height: 34px;
  padding: 0 12px 0 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.search-input::placeholder { color: var(--muted); }
.search-input:focus { border-color: var(--accent-line); background: var(--surface); }
.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--muted);
  pointer-events: none;
}
.search-kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  pointer-events: none;
}
.search-results {
  position: absolute;
  top: 42px;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 6px;
  max-height: 60vh;
  overflow: auto;
  display: none;
}
.search-results.open { display: block; }
.sr-item {
  display: block;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--text-2);
}
.sr-item:hover, .sr-item.active { background: var(--accent-soft); text-decoration: none; }
.sr-title { font-size: 13px; color: var(--text); font-weight: 600; }
.sr-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.sr-empty { padding: 12px 10px; font-size: 13px; color: var(--muted); }

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn svg { width: 16px; height: 16px; }
.menu-btn { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--surface-2);
  cursor: pointer;
  transition: all 0.15s;
}
.btn:hover { text-decoration: none; background: var(--surface-3); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #171207;
}
.btn-primary:hover { background: #ffc14d; }

/* ── 三栏骨架 ───────────────────────────────────────── */
.layout {
  position: relative;
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 208px;
  gap: 0;
}

.sidebar {
  position: sticky;
  top: var(--topbar-h);
  align-self: start;
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 28px 20px 40px 4px;
  scrollbar-width: thin;
}
.nav-group + .nav-group { margin-top: 22px; }
.nav-group-title {
  font-size: 10.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px 10px;
  font-weight: 700;
}
.nav-link {
  display: block;
  position: relative;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.4;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.main { min-width: 0; padding: 34px 44px 80px; }
.content { max-width: 768px; }

.toc {
  position: sticky;
  top: var(--topbar-h);
  align-self: start;
  max-height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 38px 4px 40px 12px;
  font-size: 12.5px;
}
.toc-title {
  font-size: 10.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 10px;
}
.toc a {
  display: block;
  padding: 4px 0 4px 10px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.45;
}
.toc a:hover { color: var(--text); text-decoration: none; border-left-color: var(--accent-line); }
.toc a.lv3 { padding-left: 22px; font-size: 12px; }
.toc a.active { color: var(--accent-ink); border-left-color: var(--accent); }

/* ── 正文 ───────────────────────────────────────────── */
.page-head { margin-bottom: 26px; }
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 10px;
}
.page-title {
  font-size: 32px;
  line-height: 1.22;
  letter-spacing: -0.015em;
  margin: 0 0 10px;
  font-weight: 700;
}
.page-desc { font-size: 15px; line-height: 1.75; color: var(--muted); margin: 0; }

.doc { font-size: 14.5px; line-height: 1.82; color: var(--text-2); }
.doc h2 {
  font-size: 20px;
  color: var(--text);
  letter-spacing: -0.01em;
  margin: 42px 0 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  scroll-margin-top: 80px;
}
.doc h2:first-child { margin-top: 8px; border-top: 0; padding-top: 0; }
.doc h3 {
  font-size: 15.5px;
  color: var(--text);
  margin: 26px 0 10px;
  scroll-margin-top: 80px;
}
.doc p { margin: 0 0 14px; }
.doc strong { color: var(--text); font-weight: 600; }
.doc ul, .doc ol { margin: 0 0 16px; padding-left: 22px; }
.doc li { margin: 5px 0; }
.doc li::marker { color: var(--accent); }
.doc hr { border: 0; border-top: 1px solid var(--line-soft); margin: 32px 0; }

.table-wrap { overflow-x: auto; border-radius: 10px; }
.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 6px 0 20px;
  font-size: 13px;
  line-height: 1.6;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.doc th {
  text-align: left;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-2);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.doc td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.doc tr:last-child td { border-bottom: 0; }
.doc tbody tr:hover { background: var(--surface-2); }

.doc code {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--surface-3);
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--text);
}
.doc pre {
  margin: 0 0 18px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow-x: auto;
}
.doc pre code { background: none; border: 0; padding: 0; font-size: 12.5px; color: var(--text-2); }

.kbd {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--text-2);
}

/* 提示块 */
.callout {
  position: relative;
  margin: 18px 0;
  padding: 13px 16px 13px 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-2);
}
.callout::before {
  position: absolute;
  left: 14px;
  top: 12px;
  font-size: 14px;
  line-height: 1;
}
.callout-note { border-color: var(--accent-line); background: var(--accent-soft); }
.callout-note::before { content: "◆"; color: var(--accent); font-size: 11px; top: 15px; }
.callout-tip { border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 9%, transparent); }
.callout-tip::before { content: "✓"; color: var(--ok); font-weight: 700; }
.callout-warn { border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 9%, transparent); }
.callout-warn::before { content: "!"; color: var(--warn); font-weight: 800; }
.callout p:last-child { margin-bottom: 0; }

/* 复制块 */
.copyline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 8px 8px 8px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text);
}
.copyline span { flex: 1; overflow-x: auto; white-space: nowrap; }
.copyline button {
  flex: none;
  height: 26px;
  padding: 0 10px;
  font-size: 11.5px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  font-family: var(--font);
}
.copyline button:hover { color: var(--text); border-color: var(--accent-line); }

/* 卡片 */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin: 18px 0 8px; }
.card {
  display: block;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-2);
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.card:hover { text-decoration: none; border-color: var(--accent-line); background: var(--surface-2); transform: translateY(-1px); }
.card-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.card-desc { font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  border: 1px solid var(--accent-line);
}

/* 步骤 */
.steps { counter-reset: step; margin: 18px 0 10px; padding: 0; list-style: none; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 22px 44px;
  margin: 0;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
}
.steps li::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 31px;
  bottom: 4px;
  width: 1px;
  background: var(--line);
}
.steps li:last-child { padding-bottom: 4px; }
.steps li:last-child::after { display: none; }
.steps b { display: block; color: var(--text); font-weight: 600; margin-bottom: 3px; font-size: 14.5px; }
.steps span { color: var(--muted); font-size: 13.5px; line-height: 1.7; }

/* 首页 hero */
.hero { padding: 18px 0 6px; }
.hero h1 {
  font-size: 40px;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 14px 0 14px;
  font-weight: 700;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { font-size: 15.5px; line-height: 1.8; color: var(--muted); max-width: 560px; margin: 0 0 22px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.hero-actions .btn { height: 38px; padding: 0 18px; font-size: 13.5px; }
.hero-meta { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 18px; font-size: 12.5px; color: var(--muted); }
.hero-meta b { color: var(--text-2); font-weight: 600; }

/* 上一页 / 下一页 */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 46px; }
.pager-card {
  display: block;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s;
}
.pager-card:hover { text-decoration: none; border-color: var(--accent-line); background: var(--surface-2); }
.pager-card.next { text-align: right; }
.pager-dir { font-size: 11px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.pager-title { font-size: 13.5px; color: var(--text); font-weight: 600; margin-top: 3px; }

.site-footer {
  margin-top: 56px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

/* 遮罩与移动端 */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.overlay.show { opacity: 1; pointer-events: auto; }

@media (max-width: 1180px) {
  .layout { grid-template-columns: 220px minmax(0, 1fr); }
  .toc { display: none; }
  .main { padding: 30px 36px 72px; }
}

@media (max-width: 860px) {
  .topbar-inner { padding: 0 14px; gap: 10px; }
  .brand-sub, .brand-divider { display: none; }
  .search-box { display: none; }
  .menu-btn { display: inline-flex; }
  .btn-top { display: none; }
  .layout { display: block; padding: 0 16px; }
  .sidebar {
    position: fixed;
    z-index: 50;
    top: 0;
    left: 0;
    bottom: 0;
    width: 272px;
    height: 100vh;
    padding: 18px 16px 32px;
    background: var(--surface);
    border-right: 1px solid var(--line);
    transform: translateX(-102%);
    transition: transform 0.24s ease;
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow); }
  .sidebar-close { display: inline-flex; margin: 0 0 12px auto; }
  .main { padding: 24px 2px 64px; }
  .page-title { font-size: 27px; }
  .hero h1 { font-size: 32px; }
  .doc { font-size: 14px; }
  .doc table { min-width: 560px; }
  .pager { grid-template-columns: 1fr; }
  .pager-card.next { text-align: left; }
}

@media (min-width: 861px) { .sidebar-close { display: none; } }

::selection { background: rgba(255, 176, 32, 0.28); color: var(--text); }

/* 滚动条 */
.sidebar::-webkit-scrollbar, .toc::-webkit-scrollbar, .search-results::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb, .toc::-webkit-scrollbar-thumb, .search-results::-webkit-scrollbar-thumb {
  background: var(--line); border-radius: 3px;
}

mark { background: rgba(255, 176, 32, 0.35); color: inherit; border-radius: 2px; padding: 0 1px; }

/* ── 侧栏补充：抽屉头、移动搜索、底部链接 ───────────── */
.drawer-head, .sidebar-search { display: none; }

.sidebar-foot {
  margin-top: 30px;
  padding: 16px 10px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.sidebar-foot a { color: var(--muted); }
.sidebar-foot a:hover { color: var(--accent-ink); }

@media (max-width: 860px) {
  .drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
  }
  .drawer-title {
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
  }
  .sidebar-close { width: 30px; height: 30px; }
  .sidebar-search { display: block; margin-bottom: 16px; }
  .sidebar-search .search-box { display: block; width: 100%; }
  .sidebar-search .search-results { top: 40px; max-height: 46vh; }
  .sidebar-foot { display: none; }
}
