/* ==========================================================================
   文档页样式（接入白皮书 / 使用指南）—— 复用 styles.css 的 token 与 nav/footer
   仅新增"文档排版"相关：侧栏目录、章节、提示框、参数表、步骤、清单、角色徽章
   ========================================================================== */

/* 文档头部 */
.doc-hero {
  border-bottom: 1px solid var(--hairline);
  background: var(--canvas);
}
.doc-hero__inner { padding-block: clamp(40px, 6vw, 72px); }
.doc-hero .eyebrow { margin-bottom: 14px; }
.doc-hero h1 {
  font-size: clamp(30px, 5vw, 48px);
  font-weight: 850; letter-spacing: -.03em; line-height: 1.12;
}
.doc-hero p {
  margin-top: 16px; max-width: 680px;
  color: var(--ink-2); font-size: clamp(15px, 2vw, 18px);
}
.doc-hero__meta {
  margin-top: 22px; display: flex; flex-wrap: wrap; gap: 10px 22px;
  font-size: 13.5px; color: var(--ink-mute);
}
.doc-hero__meta span { display: inline-flex; align-items: center; gap: 7px; }
.doc-hero__meta i { width: 5px; height: 5px; border-radius: 50%; background: var(--primary); }

/* 文档主体：侧栏目录 + 正文 */
.doc {
  width: 100%; max-width: var(--maxw); margin: 0 auto;
  padding-inline: var(--gutter);
  display: grid; grid-template-columns: 232px 1fr; gap: clamp(28px, 4vw, 56px);
  align-items: start;
}
.doc__toc {
  position: sticky; top: 82px;
  align-self: start;
  max-height: calc(100vh - 100px); overflow-y: auto;
  padding-bottom: 20px;
}
.doc__toc h4 {
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 700; margin: 0 0 12px;
}
.doc__toc a {
  display: block; padding: 7px 12px; margin-bottom: 2px;
  font-size: 14px; color: var(--ink-2); border-radius: 8px;
  border-left: 2px solid transparent; line-height: 1.35;
}
.doc__toc a:hover { color: var(--ink); background: var(--ink-05); }
.doc__toc a.active {
  color: var(--primary-strong); font-weight: 650;
  border-left-color: var(--primary); background: var(--primary-tint);
}
.doc__body { min-width: 0; padding-block: clamp(32px, 5vw, 56px); }

/* 章节 */
.chapter { scroll-margin-top: 90px; padding-bottom: clamp(36px, 5vw, 56px); }
.chapter + .chapter { border-top: 1px solid var(--hairline); padding-top: clamp(36px, 5vw, 56px); }
.chapter__num {
  font-size: 13px; font-weight: 800; letter-spacing: .06em;
  color: var(--ink-faint); margin-bottom: 10px;
}
.chapter h2 {
  font-size: clamp(22px, 3.4vw, 32px); font-weight: 800;
  letter-spacing: -.02em; line-height: 1.2;
}
.chapter h3 {
  margin-top: 34px; font-size: 18px; font-weight: 750; letter-spacing: -.01em;
}
.chapter p { margin-top: 14px; color: var(--ink-2); font-size: 15.5px; line-height: 1.7; }
.chapter p b, .chapter li b { color: var(--ink); font-weight: 700; }
.chapter a.link { color: var(--primary-strong); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.chapter ul.bullets { margin-top: 14px; }
.chapter ul.bullets li {
  position: relative; padding-left: 20px; margin-top: 10px;
  color: var(--ink-2); font-size: 15.5px; line-height: 1.7;
}
.chapter ul.bullets li::before {
  content: ""; position: absolute; left: 4px; top: 11px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--ink-mute);
}

/* 有序步骤 */
.steps-ol {
  margin-top: 20px;
  padding-left: 0;
  list-style: none;
  counter-reset: step;
}
.steps-ol > li {
  position: relative; padding-left: 46px; padding-bottom: 22px; margin-left: 2px;
  border-left: 1px solid var(--hairline);
}
.steps-ol > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps-ol > li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: -15px; top: -4px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--ink); color: var(--surface);
  font-size: 14px; font-weight: 800; display: grid; place-items: center;
}
.steps-ol > li h4 { font-size: 16px; font-weight: 750; margin: 2px 0 0; }
.steps-ol > li p { margin-top: 8px; font-size: 15px; }

/* 提示框 */
.callout {
  margin-top: 22px; padding: 16px 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--hairline); background: var(--surface);
  font-size: 14.5px; color: var(--ink-2); line-height: 1.65;
}
.callout b { color: var(--ink); }
.callout__tag {
  display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .04em;
  margin-right: 8px; padding: 1px 0;
}
.callout--tip { border-color: #cfe3b8; background: var(--status-success-tint); }
.callout--tip .callout__tag { color: var(--status-success); }
.callout--warn { border-color: #f0d9a8; background: var(--status-warning-tint); }
.callout--warn .callout__tag { color: var(--status-warning); }
.callout--danger { border-color: #f0c2c2; background: var(--status-danger-tint); }
.callout--danger .callout__tag { color: var(--status-danger); }
.callout--who { border-color: var(--hairline); background: var(--canvas); }
.callout--who .callout__tag { color: var(--ink-mute); }

/* 表格（参数表 / 报错表 / 权限矩阵） */
.table-scroll { margin-top: 22px; overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--radius-sm); }
table.doc-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 520px; }
.doc-table th, .doc-table td {
  text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--hairline-soft);
  vertical-align: top; line-height: 1.55;
}
.doc-table thead th {
  background: var(--surface); color: var(--ink);
  font-weight: 700; font-size: 13px; letter-spacing: .02em;
  position: sticky; top: 0;
}
.doc-table tbody tr:last-child td { border-bottom: 0; }
.doc-table td b { color: var(--ink); }
.doc-table code { font-size: 12.5px; }

/* 行内代码 / 参数 */
code {
  font-family: "SF Mono", "Cascadia Code", Consolas, "Courier New", monospace;
  background: var(--ink-05); border: 1px solid var(--hairline-soft);
  border-radius: 5px; padding: 1px 6px; font-size: 13px; color: var(--ink);
}

/* 清单（验收 checklist） */
.checklist { margin-top: 20px; }
.checklist li {
  display: flex; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--hairline-soft);
  font-size: 15px; color: var(--ink-2); line-height: 1.55;
}
.checklist li:last-child { border-bottom: 0; }
.checklist .box {
  flex: none; margin-top: 1px; width: 18px; height: 18px;
  border: 1.5px solid var(--ink-mute); border-radius: 5px;
}

/* 角色徽章 + 权限矩阵 */
.role-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  border: 1px solid transparent;
}
.role-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.role-admin   { color: #1a73e8; background: #e8f0fe; }
.role-operator{ color: #5e2ec2; background: #efe8fb; }
.role-teacher { color: #c97b00; background: #fbeedd; }
.role-service { color: #167c67; background: #e2f1ec; }

.matrix .doc-table td.center, .matrix .doc-table th.center { text-align: center; }
.matrix .yes { color: var(--status-success); font-weight: 800; }
.matrix .no  { color: var(--ink-faint); }

/* 角色卡（使用指南分角色） */
.role-card {
  scroll-margin-top: 90px;
  border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 26px; margin-top: 22px; background: var(--canvas);
}
.role-card__head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.role-card__head h3 { margin: 0; font-size: 20px; font-weight: 800; }
.role-card__head .lvl { font-size: 13px; color: var(--ink-mute); }
.role-card__lead { margin-top: 14px; color: var(--ink-2); font-size: 15px; line-height: 1.7; }

/* 上一页/下一页 */
.doc-more {
  margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--hairline);
  display: flex; gap: 14px; flex-wrap: wrap;
}
.doc-more a {
  flex: 1 1 240px; border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 18px 20px; transition: border-color .15s ease;
}
.doc-more a:hover { border-color: var(--ink); }
.doc-more small { color: var(--ink-mute); font-size: 12.5px; }
.doc-more b { display: block; margin-top: 4px; font-size: 16px; font-weight: 750; }

/* 移动端目录：折叠到顶部 */
.doc__toc-toggle { display: none; }

@media (max-width: 860px) {
  .doc { grid-template-columns: 1fr; gap: 0; }
  .doc__toc {
    position: static; max-height: none; overflow: visible;
    border: 1px solid var(--hairline); border-radius: var(--radius);
    padding: 14px 16px; margin-top: 24px;
  }
  .doc__toc[data-collapsed="true"] .doc__toc-list { display: none; }
  .doc__toc-toggle {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; background: none; border: 0; cursor: pointer;
    font: inherit; font-size: 14px; font-weight: 700; color: var(--ink);
    padding: 0;
  }
  .doc__toc h4 { display: none; }
}
