/* ============================================================
   智能开发大师 · 操作指南（文档页）
   复用 site.css 的设计令牌，只补充文档页所需的排版与组件
   ============================================================ */

/* 长文档里长距离平滑滚动太慢，目录跳转改成瞬移 */
html { scroll-behavior: auto; }

.page-guide { scroll-padding-top: 0; }

/* ---------- 顶部阅读进度 ---------- */
.g-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 80;
  background: transparent;
  pointer-events: none;
}
.g-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--brand), var(--brand-2) 60%, var(--cyan));
  box-shadow: 0 0 14px rgba(46, 107, 255, 0.55);
  transition: width 0.08s linear;
}

/* ---------- 导航当前项 ---------- */
.nav-links a.is-on {
  color: var(--brand);
  background: rgba(46, 107, 255, 0.09);
  font-weight: 600;
}

/* ---------- 文档头部 ---------- */
.g-hero { padding: 132px 0 40px; }

.g-crumb {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 26px;
}
.g-crumb a { transition: color 0.25s; }
.g-crumb a:hover { color: var(--brand); }
.g-crumb em { font-style: normal; color: var(--ink-2); font-weight: 600; }

.g-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 48px;
  align-items: center;
}

.g-hero-copy h1 {
  margin: 16px 0 14px;
  font-size: clamp(38px, 4.6vw, 56px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 800;
}
.g-hero-copy h1::after {
  content: "";
  display: block;
  width: 62px;
  height: 5px;
  margin-top: 18px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.g-sub {
  margin: 0;
  max-width: 620px;
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink-2);
}

.g-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 22px;
  font-size: 13px;
  color: var(--muted);
}
.g-meta span { display: inline-flex; align-items: center; gap: 7px; }
.g-meta svg { color: var(--brand); }

.g-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
.g-jump a {
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  border-radius: 11px;
  transition: transform 0.25s var(--ease), color 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.g-jump a:hover {
  color: var(--brand);
  border-color: rgba(46, 107, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px -16px rgba(46, 107, 255, 0.7);
}

/* ---------- 快速上手卡 ---------- */
.g-quick {
  position: relative;
  padding: 26px 26px 24px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
}
.g-quick::before {
  content: "";
  position: absolute;
  top: -80px; right: -80px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(46, 107, 255, 0.18), transparent 70%);
}
.g-quick-head { position: relative; display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.g-quick-head b { font-size: 16px; letter-spacing: 0.01em; }
.g-quick-head span { font-size: 12.5px; color: var(--muted); }

.g-quick-list { position: relative; list-style: none; margin: 0 0 18px; padding: 0; }
.g-quick-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line-soft);
}
.g-quick-list li:last-child { border-bottom: 0; }
.g-quick-list i {
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--brand);
  background: rgba(46, 107, 255, 0.09);
  border-radius: 7px;
  padding: 3px 7px;
}
.g-quick-list b { display: block; font-size: 14px; }
.g-quick-list small { font-size: 12px; color: var(--muted); }

.g-quick-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--brand);
}

/* ---------- 两栏布局 ---------- */
.g-layout {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: 44px;
  align-items: start;
  padding-top: 12px;
  padding-bottom: 88px;
}

/* ---------- 侧边目录 ---------- */
.g-toc {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  padding: 20px 16px 20px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line-soft);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.g-toc::-webkit-scrollbar { width: 5px; }
.g-toc::-webkit-scrollbar-thumb { background: rgba(46, 107, 255, 0.22); border-radius: 3px; }

.g-toc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}
.g-toc-head b { font-size: 13px; letter-spacing: 0.06em; }
.g-toc-head span { font-size: 11.5px; color: var(--muted); }

.g-toc-list, .g-toc-list ul { list-style: none; margin: 0; padding: 0; }

.g-toc-chap {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink-2);
  border-radius: 9px;
  transition: color 0.2s, background 0.2s;
}
.g-toc-chap i {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--muted);
  min-width: 18px;
}
.g-toc-chap:hover { color: var(--brand); background: rgba(46, 107, 255, 0.06); }
.g-toc-chap.on { color: var(--brand); background: rgba(46, 107, 255, 0.1); }
.g-toc-chap.on i { color: var(--brand); }

.g-toc-list ul { margin: 2px 0 10px; }
.g-toc-list ul a {
  display: block;
  padding: 5px 8px 5px 34px;
  font-size: 12.5px;
  color: var(--muted);
  border-left: 2px solid transparent;
  border-radius: 0 7px 7px 0;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  line-height: 1.5;
}
.g-toc-list ul a:hover { color: var(--brand); background: rgba(46, 107, 255, 0.05); }
.g-toc-list ul a.on {
  color: var(--brand);
  font-weight: 650;
  border-left-color: var(--brand);
  background: rgba(46, 107, 255, 0.06);
}

/* ---------- 正文卡片 ---------- */
.g-main { min-width: 0; }

.g-doc {
  position: relative;
  padding: 54px 58px 58px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.g-doc p {
  margin: 0 0 16px;
  font-size: 15.5px;
  line-height: 1.95;
  color: var(--ink-2);
}
.g-doc strong { color: var(--ink); font-weight: 700; }

/* 章节 */
.g-chap + .g-chap {
  margin-top: 54px;
  padding-top: 48px;
  border-top: 1px dashed rgba(46, 107, 255, 0.22);
}

.g-chap-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}
.g-chap-no {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  padding: 6px 11px;
  border-radius: 11px;
  box-shadow: 0 10px 22px -12px rgba(46, 107, 255, 0.9);
}
.g-chap-head h2 {
  margin: 0;
  font-size: clamp(24px, 2.4vw, 30px);
  font-weight: 800;
  letter-spacing: -0.01em;
}
.g-chap-lead {
  margin: 0 0 30px !important;
  padding-left: 16px;
  border-left: 3px solid rgba(46, 107, 255, 0.28);
  font-size: 14px !important;
  color: var(--muted) !important;
  line-height: 1.85 !important;
}

.g-chap, .g-doc h2, .g-doc h3, .g-doc h4 { scroll-margin-top: 92px; }

.g-doc h3 {
  position: relative;
  margin: 40px 0 16px;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.005em;
}
.g-doc h3::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 0.34em;
  width: 4px;
  height: 0.86em;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--brand), var(--cyan));
}

.g-doc h4 {
  margin: 28px 0 12px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
.g-doc h4::before {
  content: "#";
  margin-right: 6px;
  color: rgba(46, 107, 255, 0.45);
  font-weight: 800;
}

/* 列表 */
.g-list {
  margin: 4px 0 20px;
  padding: 0;
  list-style: none;
}
.g-list li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 9px;
  font-size: 15px;
  line-height: 1.9;
  color: var(--ink-2);
}
.g-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.78em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--cyan));
}

/* 表格 */
.g-table-wrap {
  margin: 6px 0 26px;
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.g-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 520px;
}
.g-table th, .g-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  line-height: 1.7;
}
.g-table thead th {
  background: linear-gradient(180deg, rgba(46, 107, 255, 0.08), rgba(46, 107, 255, 0.03));
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}
.g-table tbody tr:last-child td { border-bottom: 0; }
.g-table tbody tr:hover td { background: rgba(46, 107, 255, 0.03); }
.g-table td:first-child { color: var(--ink); font-weight: 600; white-space: nowrap; width: 1%; }

/* 截图 */
.g-fig {
  margin: 20px 0 26px;
  padding: 12px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-sm);
}
.g-fig a { position: relative; display: block; }
.g-fig a::after {
  content: "查看原图";
  position: absolute;
  right: 10px; bottom: 10px;
  padding: 4px 11px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #fff;
  background: rgba(10, 26, 60, 0.62);
  backdrop-filter: blur(6px);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s, transform 0.25s var(--ease);
  pointer-events: none;
}
.g-fig a:hover::after { opacity: 1; transform: none; }
.g-fig img {
  width: 100%;
  height: auto;
  border-radius: 11px;
  display: block;
  background: var(--bg-soft);
  transition: transform 0.4s var(--ease);
}
.g-fig:hover img { transform: scale(1.006); }

/* 竖版弹窗截图按比例收窄，避免整屏过高 */
.g-fig.tall { max-width: 520px; margin-left: auto; margin-right: auto; }
.g-fig figcaption {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 6px 2px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.7;
}
.g-fig-no {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand);
  background: rgba(46, 107, 255, 0.09);
  border-radius: 6px;
  padding: 2px 7px;
}

/* 提示块 */
.g-note {
  margin: 6px 0 26px;
  padding: 18px 22px;
  border-radius: 14px;
  background: linear-gradient(120deg, rgba(46, 107, 255, 0.07), rgba(0, 204, 208, 0.05));
  border: 1px solid rgba(46, 107, 255, 0.16);
}
.g-note b {
  display: block;
  font-size: 13.5px;
  color: var(--brand);
  margin-bottom: 6px;
}
.g-note p { margin: 0 !important; font-size: 14px !important; line-height: 1.85 !important; }

/* 问答 */
.g-qa {
  margin: 0 0 14px;
  padding: 18px 22px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line-soft);
  box-shadow: 0 10px 26px -22px rgba(23, 58, 140, 0.4);
}
.g-q, .g-a { margin: 0 !important; display: flex; gap: 10px; align-items: flex-start; }
.g-q { font-size: 15px !important; font-weight: 700; color: var(--ink) !important; }
.g-a { margin-top: 9px !important; font-size: 14.5px !important; color: var(--ink-2) !important; }
.g-q span, .g-a span {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 800;
  transform: translateY(2px);
}
.g-q span { color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.g-a span { color: var(--mint); background: rgba(18, 184, 134, 0.13); }

.g-end {
  margin: 46px 0 0 !important;
  text-align: center;
  font-size: 13px !important;
  color: var(--muted) !important;
  letter-spacing: 0.08em;
}

/* 文末 CTA */
.g-doc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 26px;
  padding: 28px 34px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}
.g-doc-foot b { display: block; font-size: 16px; margin-bottom: 4px; }
.g-doc-foot span { font-size: 13.5px; color: var(--muted); }

/* 回到顶部 */
.g-top {
  position: fixed;
  right: 26px; bottom: 26px;
  width: 46px; height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  box-shadow: 0 16px 34px -18px rgba(23, 58, 140, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s var(--ease), visibility 0.3s;
  z-index: 50;
}
.g-top.show { opacity: 1; visibility: visible; transform: none; }
.g-top:hover { background: #fff; transform: translateY(-3px); }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .g-hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .g-layout { grid-template-columns: 1fr; gap: 24px; }
  .g-toc {
    position: static;
    max-height: none;
    padding: 14px 16px;
  }
  .g-toc-list { display: none; }
  .g-toc.open .g-toc-list { display: block; }
  .g-toc-head { border-bottom: 0; padding-bottom: 2px; margin-bottom: 0; cursor: pointer; }
  .g-toc-head::after {
    content: "展开";
    font-size: 12px;
    color: var(--brand);
  }
  .g-toc.open .g-toc-head::after { content: "收起"; }
  .g-doc { padding: 38px 30px 42px; border-radius: 22px; }
}

@media (max-width: 680px) {
  .g-hero { padding: 112px 0 28px; }
  .g-hero-copy h1 { font-size: 34px; }
  .g-sub { font-size: 14.5px; }
  .g-jump a { padding: 8px 13px; font-size: 12.5px; }
  .g-quick { padding: 22px 20px; }
  .g-doc { padding: 30px 20px 34px; }
  .g-doc p, .g-list li { font-size: 15px; }
  .g-chap-head { gap: 11px; }
  .g-chap-head h2 { font-size: 22px; }
  .g-doc h3 { font-size: 18px; }
  .g-doc h3::before { left: -12px; }
  .g-qa { padding: 15px 16px; }
  .g-doc-foot { padding: 22px 20px; }
  .g-top { right: 16px; bottom: 16px; width: 42px; height: 42px; }
}

/* ---------- 打印 ---------- */
@media print {
  .nav, .g-toc, .g-top, .g-bar, .bg-layer, .g-doc-foot, footer, .g-quick, .g-jump { display: none !important; }
  body { background: #fff; }
  .g-hero { padding: 0 0 20px; }
  .g-layout { display: block; padding: 0; }
  .g-doc {
    padding: 0;
    border: 0;
    box-shadow: none;
    background: #fff;
  }
  .g-chap { page-break-inside: auto; }
  .g-fig, .g-table-wrap, .g-qa { page-break-inside: avoid; }
  .g-chap-head h2 { font-size: 20pt; }
  .g-doc p { font-size: 10.5pt; line-height: 1.75; }
}
