/* AI超绘 · 使用帮助站 · 样式
   配色与品牌变量全部复用 ../assets/css/style.css（:root 与 [data-theme="dark"] 两组）
   本文件只放帮助站专属版式：侧栏目录、正文排版、步骤条、参数表、截图占位

   规则沿用主页：硬编码颜色一律走变量，新增色值须在两套主题里都补齐 */

html { scroll-behavior: smooth; scroll-padding-top: 78px; }

/* ---------- 顶部导航 ---------- */
.nav-in { gap: 20px; }
.nav-links a { font-size: 14px; }
.nav-links a[aria-current="page"] { color: var(--brand-text); font-weight: 500; }

.site-search { position: relative; flex: none; width: 220px; }
.site-search input {
  width: 100%; height: 36px; padding: 0 12px 0 32px;
  font-size: 14px; font-family: inherit; color: var(--ink);
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-sm);
}
.site-search input:focus { outline: 2px solid var(--brand-100); outline-offset: 0; border-color: var(--brand-200); background: var(--surface); }
.site-search .ico { position: absolute; left: 10px; top: 9px; width: 15px; height: 15px; color: var(--ink-3); pointer-events: none; }

.search-res {
  position: absolute; top: 42px; left: 0; right: 0; z-index: 60;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  box-shadow: var(--shadow); max-height: 340px; overflow: auto; display: none;
}
.search-res.open { display: block; }
.search-res a { display: block; padding: 9px 12px; font-size: 14px; color: var(--ink); border-bottom: 1px solid var(--line); }
.search-res a:last-child { border-bottom: 0; }
.search-res a:hover, .search-res a:focus-visible { background: var(--brand-50); color: var(--brand-text); outline: none; }
.search-res .r-t { display: block; }
.search-res .r-p { display: block; font-size: 12px; color: var(--ink-3); }
.search-res .empty { padding: 12px; font-size: 13px; color: var(--ink-3); cursor: default; }
.search-res .empty:hover { background: none; }

/* ---------- 页面骨架：左侧目录 + 右侧正文 ---------- */
.doc-hero { padding: 44px 0 36px; background: var(--hero-grad); border-bottom: 1px solid var(--line); }
.doc-hero h1 { font-size: 32px; margin: 0 0 10px; }
.doc-hero p { margin: 0; color: var(--ink-2); font-size: 16px; max-width: 720px; }
.crumb { font-size: 13px; color: var(--ink-3); margin-bottom: 14px; }
.crumb a { color: var(--ink-3); }
.crumb a:hover { color: var(--brand-text); }

.doc { padding: 40px 0 72px; }
.doc-grid { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 48px; align-items: start; }

.toc { position: sticky; top: 84px; font-size: 14px; }
.toc h4 { font-size: 12px; color: var(--ink-3); font-weight: 500; margin: 0 0 10px; letter-spacing: .3px; }

/* 窄屏目录折叠按钮（宽屏隐藏，目录常驻） */
.toc-toggle { display: none; }
.toc a { display: block; padding: 5px 10px; color: var(--ink-2); border-left: 2px solid var(--line); }
.toc a:hover { color: var(--brand-text); border-left-color: var(--brand-200); }
.toc a.on { color: var(--brand-text); border-left-color: var(--brand); font-weight: 500; }
.toc .sep { height: 1px; background: var(--line); margin: 12px 0; }

/* ---------- 正文排版 ---------- */
.doc-body { min-width: 0; max-width: 780px; }
.doc-body h2 { font-size: 23px; font-weight: 500; margin: 44px 0 14px; letter-spacing: -.2px; scroll-margin-top: 78px; }
.doc-body h2:first-child { margin-top: 0; }
.doc-body h3 { font-size: 17px; font-weight: 500; margin: 26px 0 10px; }
.doc-body p { margin: 0 0 14px; color: var(--ink-2); }
.doc-body ul, .doc-body ol { margin: 0 0 16px; padding-left: 22px; color: var(--ink-2); }
.doc-body li { margin-bottom: 7px; }
.doc-body strong { color: var(--ink); font-weight: 500; }
.doc-body code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px; background: var(--bg-3); color: var(--ink);
  padding: 1px 6px; border-radius: 4px;
}
.doc-body a { text-decoration: none; border-bottom: 1px solid var(--brand-200); }
.doc-body a:hover { border-bottom-color: var(--brand); }

.lead { font-size: 16px; color: var(--ink-2); margin: 0 0 22px; }

/* 提示条：注意 / 关键 */
.note { border-left: 3px solid var(--brand); background: var(--brand-50); border-radius: 0 var(--r-sm) var(--r-sm) 0; padding: 13px 16px; margin: 0 0 20px; font-size: 14px; color: var(--ink-2); }
.note b { color: var(--brand-900); font-weight: 500; }
.note-warn { border-left-color: var(--accent); background: var(--accent-50); }
.note-warn b { color: var(--accent-700); }

/* 步骤条 */
.steps { counter-reset: st; margin: 0 0 22px; }
.step { position: relative; padding: 0 0 22px 44px; counter-increment: st; }
.step::before {
  content: counter(st); position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.step::after { content: ""; position: absolute; left: 13px; top: 32px; bottom: 4px; width: 2px; background: var(--line); }
.step:last-child { padding-bottom: 0; }
.step:last-child::after { display: none; }
.step h4 { font-size: 16px; font-weight: 500; margin: 3px 0 7px; }
.step p { margin: 0 0 8px; }
.step .where { font-size: 13px; color: var(--ink-3); margin: 0 0 8px; }
.step .where b { color: var(--brand-text); font-weight: 500; }

/* 卡片组（文档内） */
.dgrid { display: grid; gap: 14px; margin: 0 0 22px; }
.dgrid.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dgrid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.dcard h4 { font-size: 15px; font-weight: 500; margin: 0 0 8px; }
.dcard p { margin: 0; font-size: 14px; color: var(--ink-2); }
.dcard ul { margin: 8px 0 0; padding-left: 18px; font-size: 13px; }
.dcard .go { display: inline-block; margin-top: 12px; font-size: 14px; }

/* 参数表
   min-width:max-content 是关键：只写 width:100% 相当于给表格设了上限，
   窄屏时它永远不会超出容器，overflow-x:auto 也就永远不生效，
   CJK 的 min-content 又只有一个字 → 整表被压成竖排「豆腐块」。 */
.ptable { width: 100%; min-width: max-content; border-collapse: collapse; font-size: 14px; margin: 0 0 22px; }
.ptable th, .ptable td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.ptable th { background: var(--bg-2); color: var(--ink); font-weight: 500; white-space: nowrap; }
.ptable td { color: var(--ink-2); }
.ptable td:first-child { color: var(--ink); white-space: nowrap; }
.ptable code { font-size: 12px; }
.tablewrap { overflow-x: auto; }

/* 真实截图（2560×1515 全屏，按容器等比缩放）
   max-height 防止超宽截图把页面撑得过长；background 让尚未加载时也有底色 */
.shot-img {
  display: block; width: 100%; height: auto;
  margin: 0 0 8px; border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--bg-2);
}
.shot-cap { font-size: 13px; color: var(--ink-3); margin: 0 0 22px; line-height: 1.6; }

/* 截图占位（等比缩放 + 替换提示） */
.shot {
  position: relative; margin: 0 0 20px;
  border: 1px dashed var(--line-2); border-radius: var(--r);
  background: var(--bg-2); min-height: 190px;
  display: flex; align-items: center; justify-content: center;
}
.shot::before {
  content: "界面截图位"; position: absolute; top: 12px; left: 14px;
  font-size: 12px; color: var(--ink-3); background: var(--surface);
  border: 1px solid var(--line); border-radius: 4px; padding: 2px 8px;
}
.shot .hint { font-size: 13px; color: var(--ink-3); text-align: center; padding: 0 24px; }
.shot figcaption { display: none; }
.shot.tall { min-height: 300px; }
.shot.short { min-height: 130px; }

/* 前后对比占位 */
.cmp2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 20px; }
.cmp2 figure { margin: 0; }
.cmp2 .shot { min-height: 150px; margin: 0; }
.cmp2 figcaption { font-size: 13px; color: var(--ink-3); text-align: center; margin-top: 7px; }

/* 目录页卡片网格 */
.cards { display: grid; gap: 16px; }
.cards.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hcard { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.hcard:hover { border-color: var(--brand-200); box-shadow: var(--shadow); color: var(--ink); }
.hcard .k { font-size: 12px; color: var(--brand-text); font-weight: 500; }
.hcard h3 { font-size: 16px; font-weight: 500; margin: 6px 0 8px; }
.hcard p { margin: 0; font-size: 14px; color: var(--ink-2); }

/* 上下篇导航 */
.pager { display: flex; gap: 12px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.pager a { flex: 1; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; color: var(--ink); text-decoration: none; }
.pager a:hover { border-color: var(--brand-200); }
.pager .dir { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.pager .t { font-size: 15px; font-weight: 500; }
.pager .next { text-align: right; }

/* 面包屑 + 页脚复用主页 */
.foot-links h4 { font-size: 13px; font-weight: 500; margin: 0 0 10px; }

/* 响应式 */
@media (max-width: 980px) {
  .doc-grid { grid-template-columns: 1fr; gap: 28px; }
  .toc { position: static; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
  .toc-toggle {
    display: block; width: 100%; height: 38px;
    background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm);
    font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; margin-bottom: 12px;
  }
  .toc.collapsed a, .toc.collapsed .sep, .toc.collapsed h4 { display: none; }
  .toc a { display: inline-block; border-left: 0; border-bottom: 2px solid var(--line); padding: 4px 0; margin-right: 16px; }
  .toc a.on { border-left: 0; border-bottom-color: var(--brand); }
  .dgrid.g3, .cards.g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-search { width: 160px; }
}
@media (max-width: 620px) {
  .doc-hero h1 { font-size: 26px; }
  .dgrid.g2, .dgrid.g3, .cards.g2, .cards.g3, .cmp2 { grid-template-columns: 1fr; }
  .site-search { display: none; }
  .step { padding-left: 38px; }
  .pager { flex-direction: column; }
  .pager .next { text-align: left; }
}