/* ════════════════════════════════════════════════════════════════
   bid.sundatas.com · 手册文档页公共样式 docs.css
   由 manual.html（用户手册）与 manual-tool.html（工具/控制台手册）共用。
   设计令牌与导航壳见 common.css；两页少量版式数值差异在各自 <style> 覆盖。
   ════════════════════════════════════════════════════════════════ */

/* ═══ 顶部导航内部结构（壳 / 悬停 / 菜单按钮见 common.css） ═══ */
nav .inner { max-width: var(--max-w); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 10px 24px; }
.nav-left { display: flex; align-items: center; gap: 12px; }
.nav-left .crumb { font-size: 14px; font-weight: 700; color: var(--text); }
.nav-left .crumb small { font-weight: 400; color: var(--text-secondary); font-size: 13px; margin-left: 10px; }
.nav-links { display: flex; gap: 22px; align-items: center; }
.nav-links a { text-decoration: none; color: var(--text-secondary); font-size: 14px; font-weight: 500; transition: all .25s; }
.nav-cta { background: var(--primary); color: #fff !important; padding: 7px 18px; border-radius: 20px; font-size: 13px !important; }

/* ═══ 布局：TOC + 正文 ═══ */
.page { max-width: var(--max-w); margin: 0 auto; padding: 96px 24px 40px; display: grid; grid-template-columns: 240px minmax(0,1fr); gap: 44px; align-items: start; }

/* 章节目录 */
.toc { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 110px); overflow: auto; padding-right: 4px; }
.toc h4 { font-size: 12px; letter-spacing: 1px; color: var(--text-weak); text-transform: uppercase; margin: 6px 6px 10px; font-weight: 700; }
.toc .grp { margin-top: 10px; font-size: 11px; color: var(--text-weak); padding: 0 10px; font-weight: 700; letter-spacing: .5px; }
.toc a { text-decoration: none; color: var(--text-secondary); font-size: 13px; padding: 7px 10px; border-radius: var(--radius-sm); border-left: 3px solid transparent; line-height: 1.4; transition: all .15s; }
.toc a:hover { color: var(--primary); background: var(--bg-secondary); }
.toc a.active { color: var(--primary); background: var(--primary-light); border-left-color: var(--primary); font-weight: 600; }
.toc a.sub { padding-left: 22px; }

/* 正文 */
article { min-width: 0; }

.doc-hero { padding: 8px 0 22px; border-bottom: 1px solid var(--border); margin-bottom: 34px; }
.doc-hero .tag-line { display: inline-block; background: var(--accent-light); color: var(--accent); font-size: 12px; font-weight: 700; padding: 4px 14px; border-radius: 20px; margin-bottom: 16px; }
.doc-hero h1 { font-size: 34px; font-weight: 800; letter-spacing: -.5px; line-height: 1.25; margin-bottom: 10px; }
.doc-hero p { color: var(--text-secondary); font-size: 15px; max-width: 860px; }
.doc-hero .meta { display: flex; gap: 18px; margin-top: 16px; font-size: 12.5px; color: var(--text-weak); flex-wrap: wrap; }
.doc-hero .meta b { color: var(--text); font-weight: 600; }

/* 模块快速入口卡 */
.quick-modules { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px; margin: 26px 0 8px; }
.quick-modules a { text-decoration: none; display: block; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 14px; transition: all .18s; }
.quick-modules a:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.quick-modules .ic { font-size: 20px; }
.quick-modules .nm { font-size: 13.5px; font-weight: 700; color: var(--text); margin-top: 4px; }
.quick-modules .ds { font-size: 11.5px; color: var(--text-secondary); margin-top: 2px; line-height: 1.5; }

/* 章节正文排版（各节顶部留白见 manual.html 页内样式；manual-tool 不需该留白） */
section.doc-sec > h2 { font-size: 24px; font-weight: 800; margin: 44px 0 6px; padding-bottom: 10px; border-bottom: 2px solid var(--border); scroll-margin-top: 92px; display: flex; align-items: center; gap: 10px; }
section.doc-sec:first-of-type > h2 { margin-top: 8px; }
section.doc-sec > h3 { font-size: 18px; font-weight: 700; margin: 30px 0 10px; scroll-margin-top: 92px; display: flex; align-items: center; gap: 8px; }
section.doc-sec > h4 { font-size: 15px; font-weight: 700; margin: 20px 0 8px; color: var(--text); }
section.doc-sec p { color: var(--text-secondary); font-size: 14.5px; margin: 8px 0; }
section.doc-sec strong { color: var(--text); }
section.doc-sec ul, section.doc-sec ol { margin: 8px 0 8px 4px; padding-left: 20px; color: var(--text-secondary); font-size: 14.5px; }
section.doc-sec li { margin: 5px 0; }
section.doc-sec a { color: var(--primary); }

/* 路径 / 按钮 高亮 */
.path { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 6px; padding: 1px 9px; font-size: 12.5px; color: var(--text); font-weight: 600; white-space: nowrap; }
kbd.btn { display: inline-block; background: var(--primary-light); color: var(--primary-dark); border: 1px solid var(--primary-border); border-radius: 6px; padding: 0 8px; font-size: 12.5px; font-weight: 600; font-family: inherit; line-height: 1.8; white-space: nowrap; }
/* .seg 与 section.doc-sec{padding-top} 属 manual 页特有（manual-tool 页面含 .seg 元素但原页未定义该规则），保留在 manual.html 页内样式 */
@media (prefers-color-scheme: dark) { kbd.btn { color: #bfdbfe; } }

/* 提示框 */
.callout { display: flex; gap: 12px; border-radius: var(--radius); padding: 14px 18px; margin: 16px 0; font-size: 14px; line-height: 1.7; }
.callout .co-ic { font-size: 18px; line-height: 1.5; }
.callout b { color: var(--text); }
.callout.tip { background: var(--green-light); border: 1px solid #6ee7b7; color: #065f46; }
.callout.note { background: var(--primary-light); border: 1px solid var(--primary-border); color: var(--primary-dark); }
.callout.warn { background: var(--orange-light); border: 1px solid #fdba74; color: #9a3412; }
.callout.danger { background: var(--red-light); border: 1px solid #fca5a5; color: #991b1b; }
@media (prefers-color-scheme: dark) {
  .callout.tip { color: #6ee7b7; }
  .callout.note { color: #93c5fd; }
  .callout.warn { color: #fdba74; }
  .callout.danger { color: #fca5a5; }
}

/* 步骤 */
.steps { list-style: none !important; padding-left: 0 !important; margin: 14px 0; }
.steps li { position: relative; padding: 0 0 18px 40px; margin: 0 !important; }
.steps li::before { content: attr(data-n); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.steps li .st-t { font-weight: 700; color: var(--text); font-size: 15px; }
.steps li .st-d { color: var(--text-secondary); font-size: 14px; margin-top: 3px; }

/* 表格 */
.tbl-wrap { overflow-x: auto; margin: 14px 0 6px; border-radius: var(--radius); border: 1px solid var(--border); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
table.tbl th { text-align: left; padding: 10px 14px; font-size: 12.5px; background: var(--bg-secondary); color: var(--text-secondary); border-bottom: 1px solid var(--border); white-space: nowrap; }
table.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: top; }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover td { background: var(--bg-secondary); }
table.tbl td .sub { color: var(--text-weak); font-size: 12.5px; }
table.tbl td code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; color: var(--text); }

/* 网格卡片（功能/模块） */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: 14px; margin: 16px 0; }
.card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 18px; box-shadow: var(--shadow); }
.card h5 { font-size: 14.5px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.card p { font-size: 13px; color: var(--text-secondary); margin: 0 !important; line-height: 1.65; }
.card .menu-line { margin-top: 8px; }

/* 表格标签 */
.tag { display: inline-block; padding: 1px 9px; border-radius: 10px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.tag.blue { background: var(--primary-light); color: var(--primary); }
.tag.purple { background: var(--accent-light); color: var(--accent); }
.tag.green { background: var(--green-light); color: var(--green); }
.tag.orange { background: var(--orange-light); color: var(--orange); }
.tag.red { background: var(--red-light); color: var(--red); }
.tag.gray { background: var(--bg-secondary); color: var(--text-secondary); border: 1px solid var(--border); }

.divider { height: 1px; background: var(--border); margin: 36px 0; }

footer { background: var(--bg-dark); color: rgba(255,255,255,.6); padding: 34px 24px; text-align: center; font-size: 13px; margin-top: 40px; }
footer a { color: rgba(255,255,255,.85); text-decoration: none; }
footer a:hover { color: #fff; }

/* 回到顶部 */
.to-top { position: fixed; right: 22px; bottom: 22px; width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: #fff; border: none; font-size: 18px; cursor: pointer; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: all .25s; z-index: 90; }
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { background: var(--primary-dark); transform: translateY(-2px); }

@media (max-width: 960px) {
  .page { grid-template-columns: 1fr; padding-top: 88px; }
  .toc { position: static; max-height: none; flex-direction: row; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
  .toc h4 { display: none; }
  .toc a { border-left: none; border-bottom: 2px solid transparent; padding: 6px 10px; }
  .toc a.sub { padding-left: 10px; }
  .toc a.active { border-bottom-color: var(--primary); }
}
@media (max-width: 768px) {
  nav .inner { padding: 10px 16px; }
  .nav-links { position: fixed; top: 55px; left: 0; right: 0; background: var(--bg); flex-direction: column; gap: 0; padding: 8px 0; border-bottom: 1px solid var(--border); transform: translateY(-120%); transition: transform .3s; z-index: 99; }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 11px 20px; width: 100%; }
  .nav-cta { margin: 6px 20px 10px; text-align: center; }
  .menu-toggle { display: block; }
  .doc-hero h1 { font-size: 27px; }
  section.doc-sec > h2 { font-size: 21px; }
}

/* ── 章节目录：整条描边卡片（manual.html / manual-tool.html 共用）
     置于文件末尾，使其级联顺序与两页页内覆盖一致，窄屏下同样为完整描边卡片 ── */
.toc { gap: 5px; }
.toc a {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  padding: 7px 11px;
}
.toc a:hover {
  border-color: var(--primary);
  background: var(--bg-secondary);
  color: var(--primary);
}
.toc a.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--primary);
}
