/* ============================================================
   产品使用手册 — 样式表
   ============================================================ */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --border: #e5e8ee;
  --border-strong: #d3d8e2;

  --text: #171b23;
  --text-2: #4e5666;
  --text-3: #868e9e;

  --primary: #2f5bf6;
  --primary-dark: #1c46d6;
  --primary-soft: #eef3ff;
  --accent: #7a5cf6;
  --success: #12a678;
  --success-soft: #e8f8f2;
  --warning: #d98008;
  --warning-soft: #fdf4e5;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(20, 26, 40, .06);
  --shadow: 0 4px 16px rgba(20, 26, 40, .08);
  --shadow-lg: 0 12px 40px rgba(20, 26, 40, .16);

  --sidebar-w: 288px;
  --topbar-h: 60px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

a { color: var(--primary); text-decoration: none; }

/* ---------- 顶部栏 ---------- */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--topbar-h);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: .2px;
  color: var(--text);
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 3px 10px rgba(47, 91, 246, .32);
}

.topbar .divider {
  width: 1px;
  height: 20px;
  background: var(--border);
}

.topbar .doc-title { color: var(--text-2); font-size: 13.5px; }

.topbar .spacer { flex: 1; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 600;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: color .18s ease, border-color .18s ease, background-color .18s ease;
}

.back-link:hover {
  color: var(--primary-dark);
  border-color: var(--primary);
  background: var(--primary-soft);
}

.menu-toggle {
  display: none;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}
.menu-toggle span {
  display: block;
  width: 16px;
  height: 1.6px;
  background: var(--text-2);
  border-radius: 2px;
}

/* ---------- 阅读进度条 ---------- */
.progress {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  height: 2px;
  width: 0;
  z-index: 61;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width .1s linear;
}

/* ---------- 布局 ---------- */
.layout {
  display: flex;
  padding-top: var(--topbar-h);
}

/* ---------- 侧边目录 ---------- */
.sidebar {
  position: fixed;
  top: var(--topbar-h);
  bottom: 0;
  left: 0;
  width: var(--sidebar-w);
  z-index: 50;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.sidebar-search {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}
.search-box svg { position: absolute; left: 11px; pointer-events: none; }
.search-box input {
  width: 100%;
  height: 36px;
  padding: 0 32px 0 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search-box input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(47, 91, 246, .12);
}
.search-clear {
  position: absolute;
  right: 8px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--text-3);
  font-size: 16px;
  line-height: 1;
  display: none;
}
.search-clear.show { display: block; }

.toc {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px 24px;
  scrollbar-width: thin;
}
.toc::-webkit-scrollbar { width: 6px; }
.toc::-webkit-scrollbar-thumb { background: #d8dde6; border-radius: 3px; }

.toc-group-label {
  padding: 12px 10px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-3);
  text-transform: uppercase;
}

.toc a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  margin-bottom: 2px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 13.8px;
  line-height: 1.4;
  transition: background .14s, color .14s;
}

.toc a .num {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  transition: all .14s;
}

.toc a:hover { background: var(--surface-2); color: var(--text); }

.toc a.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 600;
}
.toc a.active .num {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.toc a.hidden { display: none; }
.toc-empty {
  display: none;
  padding: 18px 12px;
  color: var(--text-3);
  font-size: 13px;
  text-align: center;
}

/* ---------- 主内容 ---------- */
.content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  padding: 0 40px 80px;
}

.wrap { max-width: 900px; margin: 0 auto; }

/* ---------- 封面 ---------- */
.cover {
  position: relative;
  margin: 0 -40px 8px;
  padding: 56px 40px 44px;
  background:
    radial-gradient(1000px 320px at 12% -10%, rgba(122, 92, 246, .12), transparent 60%),
    radial-gradient(800px 300px at 88% 0%, rgba(47, 91, 246, .14), transparent 60%),
    #fff;
  border-bottom: 1px solid var(--border);
}
.cover .wrap { max-width: 900px; }

.cover h1 {
  margin: 0 0 10px;
  font-size: 38px;
  line-height: 1.25;
  letter-spacing: -.5px;
  font-weight: 800;
}
.cover h1 em {
  font-style: normal;
  background: linear-gradient(120deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cover .sub {
  margin: 0 0 22px;
  color: var(--text-2);
  font-size: 16px;
  max-width: 660px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  padding-top: 18px;
  border-top: 1px dashed var(--border-strong);
  color: var(--text-3);
  font-size: 13px;
}
.meta-row b { color: var(--text-2); font-weight: 600; }

/* ---------- 功能速览卡片 ---------- */
.overview {
  padding: 34px 0 6px;
}
.overview-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .6px;
  color: var(--text-3);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
}

.card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: #c9d6ff;
}
.card .ico {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 15px;
  background: var(--primary-soft);
}
.card .txt { min-width: 0; }
.card .t { font-size: 14px; font-weight: 600; line-height: 1.4; }
.card .d { font-size: 12px; color: var(--text-3); line-height: 1.5; }

/* ---------- 章节 ---------- */
.doc-section {
  padding: 40px 0 8px;
  border-top: 1px solid var(--border);
  scroll-margin-top: calc(var(--topbar-h) + 18px);
}
.doc-section:first-of-type { border-top: 0; }

.sec-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 16px;
}
.sec-index {
  flex: none;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
  color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  opacity: .55;
}
.sec-head h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.2px;
  position: relative;
}
.sec-head h2 .anchor {
  position: absolute;
  left: -20px;
  opacity: 0;
  color: var(--text-3);
  font-weight: 400;
  transition: opacity .15s;
}
.sec-head h2:hover .anchor { opacity: 1; }

h3.sub {
  margin: 26px 0 10px;
  font-size: 16.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 9px;
}
h3.sub::before {
  content: "";
  width: 3px;
  height: 15px;
  border-radius: 2px;
  background: var(--primary);
}

.doc-section p { margin: 0 0 14px; color: var(--text-2); }
.doc-section p.lead { font-size: 15.5px; color: var(--text-2); }

/* ---------- 截图网格 ---------- */
.shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
  margin: 16px 0 20px;
}
.shot-grid.single { grid-template-columns: minmax(0, 230px); }
.shot-grid.duo { grid-template-columns: repeat(2, minmax(0, 230px)); }
.shot-grid.trio { grid-template-columns: repeat(3, minmax(0, 1fr)); }

figure.shot { margin: 0; }

.shot-frame {
  position: relative;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.shot-frame:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: #b9cdf8;
}
.shot-frame img {
  width: 100%;
  height: auto;
  display: block;
}
.shot-frame .zoom-hint {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(23, 27, 35, .68);
  color: #fff;
  font-size: 11px;
  opacity: 0;
  transition: opacity .18s;
}
.shot-frame:hover .zoom-hint { opacity: 1; }

figure.shot figcaption {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.55;
}
figure.shot figcaption b {
  display: block;
  color: var(--text-2);
  font-weight: 600;
  font-size: 13px;
}

/* ---------- 步骤 ---------- */
ol.steps {
  margin: 14px 0 20px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
ol.steps li {
  position: relative;
  counter-increment: step;
  padding: 0 0 16px 38px;
  color: var(--text-2);
}
ol.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
ol.steps li::after {
  content: "";
  position: absolute;
  left: 11.5px;
  top: 28px;
  bottom: 2px;
  width: 1px;
  background: var(--border);
}
ol.steps li:last-child { padding-bottom: 0; }
ol.steps li:last-child::after { display: none; }
ol.steps li b { color: var(--text); }

/* ---------- 列表 / 标签 ---------- */
ul.plain { margin: 0 0 16px; padding-left: 20px; color: var(--text-2); }
ul.plain li { margin-bottom: 6px; }
ul.plain li b { color: var(--text); }

ul.bullets { margin: 12px 0 18px; padding: 0; list-style: none; }
ul.bullets li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 7px;
  color: var(--text-2);
}
ul.bullets li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 11px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  opacity: .55;
}
ul.bullets li b { color: var(--text); font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 18px; }
.chip {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-2);
}
.chip.on {
  background: var(--primary-soft);
  border-color: #c5d5ff;
  color: var(--primary-dark);
  font-weight: 600;
}

/* ---------- 提示框 ---------- */
.callout {
  display: flex;
  gap: 12px;
  margin: 16px 0 20px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 14px;
}
.callout .ci { flex: none; font-size: 15px; line-height: 1.6; }
.callout .cb { color: var(--text-2); }
.callout .cb b { color: var(--text); }
.callout.info { background: var(--primary-soft); border-color: #d3e0ff; }
.callout.tip { background: var(--success-soft); border-color: #c6ecdd; }
.callout.warn { background: var(--warning-soft); border-color: #f4e2c2; }

/* ---------- 表格 ---------- */
.table-wrap {
  margin: 14px 0 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
table { width: 100%; border-collapse: collapse; font-size: 13.8px; }
thead th {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: top;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
tbody td b { color: var(--text); }

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: rgba(15, 18, 25, .82);
  backdrop-filter: blur(6px);
}
.lightbox.open { display: flex; }

.lightbox img {
  max-width: min(420px, 90vw);
  max-height: 86vh;
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  background: #fff;
}
.lightbox .lb-close,
.lightbox .lb-nav {
  position: absolute;
  border: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: background .15s;
}
.lightbox .lb-close:hover,
.lightbox .lb-nav:hover { background: rgba(255, 255, 255, .28); }
.lightbox .lb-close { top: 20px; right: 24px; width: 38px; height: 38px; font-size: 20px; }
.lightbox .lb-nav { top: 50%; transform: translateY(-50%); width: 42px; height: 42px; font-size: 22px; }
.lightbox .lb-prev { left: 22px; }
.lightbox .lb-next { right: 22px; }
.lightbox .lb-cap {
  position: absolute;
  bottom: 22px;
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255, 255, 255, .9);
  font-size: 13.5px;
  padding: 0 20px;
}
.lightbox .lb-count {
  position: absolute;
  top: 26px;
  left: 26px;
  color: rgba(255, 255, 255, .8);
  font-size: 13px;
}

/* ---------- 回到顶部 ---------- */
.to-top {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 70;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--text-2);
  font-size: 17px;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all .2s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { color: var(--primary); border-color: #c5d5ff; }

/* ---------- 页脚 ---------- */
.footer {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: 12.5px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
}

/* ---------- 遮罩（移动端抽屉） ---------- */
.scrim {
  position: fixed;
  inset: var(--topbar-h) 0 0 0;
  z-index: 45;
  background: rgba(15, 18, 25, .35);
  display: none;
}
.scrim.show { display: block; }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .shot-grid.trio { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

@media (max-width: 900px) {
  .menu-toggle { display: flex; }
  .topbar .divider, .topbar .doc-title { display: none; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform .24s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }

  .content { margin-left: 0; padding: 0 20px 60px; }
  .cover { margin: 0 -20px 8px; padding: 40px 20px 32px; }
  .cover h1 { font-size: 28px; }
  .shot-grid.duo, .shot-grid.trio { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

@media (max-width: 560px) {
  .cover h1 { font-size: 24px; }
  .shot-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .shot-grid.single { grid-template-columns: minmax(0, 200px); }
  .lightbox .lb-nav { display: none; }
  .topbar .badge { display: none; }
  .topbar .back-link { padding: 0 9px; font-size: 12px; }
}

/* ---------- 打印 ---------- */
@media print {
  .topbar, .sidebar, .to-top, .progress, .scrim, .lightbox, .zoom-hint { display: none !important; }
  .layout { display: block; padding-top: 0; }
  .content { margin: 0; padding: 0; }
  body { background: #fff; font-size: 11pt; }
  .cover { margin: 0; padding: 0 0 16px; background: none; }
  .doc-section { break-inside: avoid-page; page-break-inside: avoid; }
  .sec-head h2 { break-after: avoid; }
  .shot-frame { box-shadow: none; }
  .card { break-inside: avoid; }
}
