/* ============================================================
   manual.css —— 使用教程页独有样式
   公共部分（顶栏 / 目录框架 / callout / 设计变量）复用 marketing.css；
   本文件只定义教程内容块：hero 三步卡、章节排版、快捷操作分组、
   搜索框与结果、FAQ 折叠、键帽等。
   ============================================================ */

/* ============ 工具类（marketing.css 无通用 .hidden，本页自带） ============ */
.hidden { display: none !important; }

/* ============ 章节（区别于 /guide /tutorial 的单章切换，本页为连续滚动） ============ */
.m-chapter {
  display: block;
  margin-bottom: 64px;
  scroll-margin-top: 90px; /* sticky 顶栏 72px + 余量 */
}
.m-chapter > h2 {
  font-size: 26px; font-weight: 700; margin-bottom: 6px;
  display: flex; align-items: center; gap: 12px;
}
.m-chapter > h2 .num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent); color: #fff; font-size: 16px;
  padding: 0 8px;
}
.m-chapter .tagline { color: var(--muted); font-size: 15px; margin-bottom: 22px; }
.m-chapter h3 {
  font-size: 18px; font-weight: 600; margin: 28px 0 10px;
  padding-left: 12px; border-left: 4px solid var(--accent);
}
.m-chapter p { margin-bottom: 12px; color: var(--ink-soft); }
.m-chapter ul, .m-chapter ol { margin: 0 0 14px 22px; color: var(--ink-soft); }
.m-chapter ul li, .m-chapter ol li { margin-bottom: 6px; }
.m-chapter li::marker { color: var(--accent); }
.m-chapter strong { color: var(--ink); }
.m-chapter code {
  background: var(--code-bg); border-radius: 5px;
  padding: 1px 6px; font-size: .88em; color: var(--ink);
}
.muted-note { color: var(--muted); font-size: 14px; }
.m-cmd-example code {
  display: inline-block; padding: 6px 14px; font-size: 15px;
  background: var(--code-bg); border: 1px solid var(--line); border-radius: 8px;
}

/* ============ 分部横幅（循序递进的节奏感） ============ */
.m-part {
  margin: 48px 0 40px; padding: 14px 18px;
  border-left: 4px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 10px 10px 0;
  scroll-margin-top: 90px;
}
.m-part span { display: block; font-weight: 700; font-size: 17px; color: var(--ink); }
.m-part p { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); }

/* ============ Hero 三步上手 ============ */
.m-hero { scroll-margin-top: 90px; margin-bottom: 24px; }
.m-hero h2 { font-size: 30px; font-weight: 700; margin-bottom: 8px; }
.m-hero .tagline { color: var(--ink-soft); font-size: 15.5px; margin-bottom: 22px; }
.m-steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  margin-bottom: 20px;
}
.m-step {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 18px 16px 14px; position: relative;
}
.m-step-num {
  position: absolute; top: -12px; left: 14px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.m-step h3 {
  margin: 6px 0 6px; padding: 0; border: none;
  font-size: 16px; font-weight: 700; color: var(--ink);
}
.m-step p { font-size: 14px; margin-bottom: 0; line-height: 1.75; }

/* 「我想直接…」锚点直达 */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; }
.chip-row-label { font-size: 14px; color: var(--muted); }
.chip {
  display: inline-block; padding: 5px 13px; border-radius: 999px;
  font-size: 13.5px; color: var(--accent);
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color .15s, background .15s;
}
.chip:hover { border-color: var(--accent); background: var(--accent-soft); text-decoration: none; }

/* ============ 快捷操作章：分组色条与条目卡 ============ */
.m-qa-group {
  display: flex; align-items: center; gap: 8px;
  margin: 34px 0 6px; padding: 9px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  font-weight: 700; font-size: 15px; color: var(--ink);
}
.m-qa-group .qdot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.m-qa-group[data-accent="primary"] .qdot { background: #0f766e; }
.m-qa-group[data-accent="violet"] .qdot { background: #7c3aed; }
.m-qa-group[data-accent="blue"]   .qdot { background: #2563eb; }
.qa-block {
  margin: 12px 0 20px; padding: 16px 18px 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  scroll-margin-top: 90px;
}
.qa-block h3 { margin-top: 4px; }
.qa-block p b { color: var(--ink); }

/* ============ 通用表格 ============ */
.m-table {
  width: 100%; border-collapse: collapse; margin: 10px 0 18px;
  background: var(--surface); font-size: 14.5px;
}
.m-table th, .m-table td {
  border: 1px solid var(--line); padding: 8px 12px;
  text-align: left; vertical-align: top; color: var(--ink-soft);
}
.m-table th { background: var(--accent-soft); color: var(--ink); font-weight: 600; white-space: nowrap; }
.m-table td strong, .m-table td b { color: var(--ink); }
.tbl-scroll { overflow-x: auto; }

/* ============ 键帽 ============ */
.kbd {
  display: inline-block; padding: 1px 7px; font-size: 12.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px;
  white-space: nowrap;
}

/* ============ FAQ 折叠 ============ */
.m-faq {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 0 16px; margin-bottom: 10px;
}
.m-faq summary {
  cursor: pointer; font-weight: 600; color: var(--ink);
  padding: 12px 0; list-style-position: outside;
}
.m-faq[open] summary { color: var(--accent); }
.m-faq p { padding-bottom: 12px; margin-bottom: 0; }

/* ============ 搜索框（目录顶部） ============ */
.m-search { position: relative; margin: 4px 0 10px; }
.m-search input {
  width: 100%; padding: 8px 30px 8px 12px;
  font-size: 13.5px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.m-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.m-search-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; border: none; border-radius: 50%;
  background: var(--line); color: var(--ink-soft);
  font-size: 13px; line-height: 1; cursor: pointer;
}
.m-search-clear:hover { background: var(--danger-line); color: var(--danger); }

/* 搜索结果（替换目录列表显示） */
.m-search-results { display: block; }
.m-search-results.hidden { display: none; }
.m-search-results .msr-hint { font-size: 12px; color: var(--muted); margin: 8px 4px; }
.m-search-results a {
  display: block; padding: 8px 10px; margin-bottom: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
}
.m-search-results a:hover { border-color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.m-search-results a .msr-title { display: block; font-weight: 600; font-size: 13.5px; color: var(--ink); }
.m-search-results a .msr-snip {
  display: block; margin-top: 3px; font-size: 12.5px; color: var(--muted); line-height: 1.6;
}
.m-search-results mark, .m-chapter mark, .m-hero mark {
  background: #fef08a; color: inherit; padding: 0 1px; border-radius: 3px;
}

/* 目录子项（快捷操作章的二级入口） */
.toc a.toc-sub { padding-left: 22px; font-size: 13px; color: var(--muted); }

/* ============ 教程截图（单击放大，配合 lightbox.js?v=2 的 .m-shot 委托） ============ */
.m-shot { margin: 14px 0 20px; }
.m-shot img {
  display: block; width: 100%; max-width: 100%;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 2px 10px rgba(15, 25, 35, .07);
  cursor: zoom-in;
}
.m-shot.narrow { text-align: center; }   /* 窄截图按原始尺寸居中，不拉伸模糊 */
.m-shot.narrow img { display: inline-block; width: auto; max-width: 100%; }
.m-shot figcaption {
  margin-top: 7px; font-size: 13.5px; color: var(--muted); text-align: center;
}
.m-shot .shot-num {  /* 图内编号标注的颜色说明 */
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; border-radius: 50%; margin: 0 2px;
  background: var(--accent); color: #fff; font-size: 12.5px; vertical-align: -4px;
}

/* ── 截图放大查看（lightbox，样式与图解统计页一致，本页自包含） ── */
.shot-lightbox {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(15, 25, 35, 0.86);
  display: flex; align-items: center; justify-content: center;
  padding: 28px; cursor: zoom-out;
}
.shot-lightbox[hidden] { display: none; }
.shot-lightbox figure {
  margin: 0; max-width: 94vw; max-height: 92vh;
  display: flex; flex-direction: column;
  background: #fff; border-radius: 10px; overflow: hidden; cursor: default;
}
.shot-lightbox img { max-width: 94vw; max-height: 82vh; width: auto; height: auto; object-fit: contain; }
.shot-lightbox figcaption {
  padding: 9px 14px; font-size: 13px; color: #33414e;
  background: #f7fafc; border-top: 1px solid #eef2f6;
}
.shot-lightbox-close {
  position: absolute; top: 18px; right: 22px;
  width: 40px; height: 40px; border: none; border-radius: 50%;
  background: rgba(255, 255, 255, 0.92); color: #1f4e79;
  font-size: 18px; cursor: pointer;
}
.shot-lightbox-close:hover { background: #fff; }

/* ============ 页脚 ============ */
.m-footer {
  margin-top: 8px; padding-top: 20px; border-top: 1px solid var(--line);
  font-size: 14px; color: var(--muted);
}

/* ============ 响应式（marketing.css 已把 .layout 收成单列，这里补内容块） ============ */
@media (max-width: 960px) {
  .m-steps { grid-template-columns: 1fr; gap: 18px; }
  .m-chapter > h2 { font-size: 22px; }
  .m-hero h2 { font-size: 25px; }
  .toc a.toc-sub { display: none; }
}
@media (max-width: 640px) {
  /* 窄屏顶栏：标题不换行挤成竖排，按钮换行到下一行 */
  .site-header .inner { flex-wrap: wrap; row-gap: 8px; }
  .site-header .to-assistant { margin-left: 0; }
}
