/* ============================================================
   诸葛涨涨 · 帮助中心（izhangzhang.com/help）
   token 与官网 index.html 的 :root 对齐：纸白蓝底 + 蓝→薄荷渐变
   + 金色点缀 + 大圆角柔和阴影。官网 CSS 是内联的，这里自带一份。
   由 tools/build-help.mjs 复制到 help/help.css，勿直接改产物。
   ============================================================ */
:root {
  --blue: #176cff;
  --blue-light: #4ea1ff;
  --mint: #19c37d;
  --aqua: #35d3c7;
  --gold: #f4b740;
  --gold-deep: #c98918;
  --risk: #e24b4b;
  --ink: #10213f;
  --text-mid: #40516f;
  --dim: #66758f;
  --paper: #f6faff;
  --paper-2: #eaf3ff;
  --line: rgba(23, 108, 255, 0.14);
  --line-strong: rgba(23, 108, 255, 0.32);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --shadow-sm: 0 10px 30px rgba(16, 33, 63, 0.06);
  --shadow: 0 18px 48px rgba(16, 33, 63, 0.08);
  --shadow-lg: 0 28px 70px rgba(16, 33, 63, 0.12);
  --grad-brand: linear-gradient(120deg, var(--blue), var(--mint));
  --grad-hairline: linear-gradient(90deg, var(--blue), var(--aqua), var(--mint));
  --maxw: 1160px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body.help-body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(900px 500px at 85% -10%, rgba(23, 108, 255, 0.1), transparent 60%),
    radial-gradient(760px 430px at -12% 28%, rgba(25, 195, 125, 0.09), transparent 62%);
  background-attachment: fixed;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ---------- 顶栏 ---------- */
.help-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 34px rgba(16, 33, 63, 0.05);
}
.help-topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.help-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; }
/* overflow:hidden 是防御性的：logo 万一取不到，alt 文本不会把整条顶栏撑变形 */
.help-brand-badge { width: 40px; height: 40px; display: grid; place-items: center; flex-shrink: 0; overflow: hidden; }
.help-brand-badge img { width: 100%; height: 100%; object-fit: contain; }
.help-brand-name { display: flex; flex-direction: column; line-height: 1.2; }
.help-brand-name small { font-size: 10px; font-weight: 700; letter-spacing: 0.05em; color: var(--dim); }
.help-topnav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: 8px; }
.help-topnav a {
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-mid);
  transition: 0.2s;
}
.help-topnav a:hover { color: var(--blue); background: #f0f7ff; }
.help-topnav a.active { color: #fff; background: var(--grad-brand); box-shadow: 0 8px 20px rgba(23, 108, 255, 0.24); }
.help-back { color: var(--dim) !important; font-weight: 600 !important; }
.help-account { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.help-role-chip {
  font-size: 11.5px;
  font-weight: 800;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.help-role-chip.full { color: #0f4fb8; background: #e8f1ff; border: 1px solid rgba(23, 108, 255, 0.24); }
.help-role-chip.customer { color: #0d6b45; background: #e6f8f0; border: 1px solid rgba(25, 195, 125, 0.28); }
.help-signout {
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  color: var(--dim);
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  cursor: pointer;
  transition: 0.2s;
}
.help-signout:hover { color: var(--risk); border-color: rgba(226, 75, 75, 0.4); }

.eyebrow {
  display: inline-block;
  font-size: 11.5px;
  letter-spacing: 0.18em;
  color: var(--blue);
  text-transform: uppercase;
  font-weight: 800;
  margin-bottom: 6px;
  position: relative;
  padding-left: 24px;
}
.eyebrow::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 16px;
  height: 2px;
  background: var(--grad-brand);
  border-radius: var(--radius-pill);
  transform: translateY(-50%);
}

.help-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 800;
  font-family: inherit;
  color: #fff;
  background: var(--grad-brand);
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(23, 108, 255, 0.22);
  transition: 0.2s;
}
.help-btn:hover { transform: translateY(-1px); }
.help-btn.ghost { color: var(--text-mid); background: #fff; border: 1px solid var(--line-strong); box-shadow: var(--shadow-sm); }
.help-btn.ghost:hover { color: var(--blue); border-color: var(--blue); }

/* ---------- 登录 ---------- */
.help-login-shell { min-height: 100vh; display: grid; place-items: center; padding: 48px 20px; }
.help-login-box {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px 32px 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.help-login-box::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--grad-hairline); }
/* <a> 默认 inline，会和下面的 eyebrow 挤在同一行——必须转块级独占一行 */
.help-login-brand { display: block; margin-bottom: 10px; }
.help-login-brand img { width: 56px; height: 56px; object-fit: contain; }
.help-login-box h1 { font-size: 24px; margin-bottom: 8px; }
.help-login-hint { font-size: 13px; color: var(--dim); line-height: 1.7; }
.help-login-box form { margin-top: 20px; display: grid; gap: 10px; text-align: left; }
.help-login-box input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: #fbfdff;
  outline: none;
  transition: 0.2s;
}
.help-login-box input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23, 108, 255, 0.12); }
.help-login-box button {
  width: 100%;
  padding: 11px;
  margin-top: 4px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 800;
  font-family: inherit;
  color: #fff;
  background: var(--grad-brand);
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(23, 108, 255, 0.24);
  transition: 0.2s;
}
.help-login-box button:disabled { opacity: 0.6; cursor: progress; box-shadow: none; }
.help-login-error { margin-top: 12px; font-size: 13px; font-weight: 700; color: var(--risk); }
.help-login-foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--dim);
  line-height: 1.7;
}

/* ---------- 帮助中心首页 ---------- */
.help-home { max-width: var(--maxw); margin: 0 auto; padding: 40px 24px 72px; }
.help-denied-banner {
  display: block;
  margin-bottom: 22px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: #fff8ec;
  border: 1px solid rgba(244, 183, 64, 0.42);
  border-left: 4px solid var(--gold);
}
.help-denied-banner b { display: block; font-size: 14px; color: var(--gold-deep); margin-bottom: 3px; }
.help-denied-banner span { font-size: 13px; color: var(--text-mid); line-height: 1.75; }
.help-denied-banner[hidden] { display: none; }

.help-home-hero h1 { font-size: 34px; margin-bottom: 12px; }
.help-home-lead { font-size: 15px; color: var(--text-mid); line-height: 1.85; max-width: 760px; }
.help-home-lead b { color: var(--ink); }
.help-card-grid { margin-top: 32px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.help-guide-card {
  position: relative;
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 26px 26px 22px;
  overflow: hidden;
  transition: 0.22s;
}
.help-guide-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--grad-brand); opacity: 0.85; }
.help-guide-card.accent-mint::before { background: linear-gradient(120deg, var(--mint), var(--aqua)); }
.help-guide-card:not(.locked):hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.help-guide-card.locked { opacity: 0.86; background: #fbfcfe; }
.help-guide-card.locked::before { background: linear-gradient(90deg, #c9d3e4, #e4eaf4); }
.help-guide-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--blue);
  background: #eef5ff;
  border-radius: var(--radius-pill);
  padding: 3px 11px;
  margin-bottom: 10px;
}
.accent-mint .help-guide-tag { color: #0d6b45; background: #e6f8f0; }
.locked .help-guide-tag { color: var(--dim); background: #eef1f6; }
.help-guide-card h2 { font-size: 21px; margin-bottom: 8px; }
.help-guide-sub { font-size: 13.5px; color: var(--text-mid); line-height: 1.75; min-height: 46px; }
.help-guide-facts { display: flex; gap: 18px; list-style: none; margin: 14px 0 10px; }
.help-guide-facts li { font-size: 12.5px; color: var(--dim); }
.help-guide-facts b { font-size: 20px; font-weight: 900; color: var(--ink); margin-right: 4px; }
.help-guide-audience { font-size: 12px; color: var(--dim); padding-top: 12px; border-top: 1px dashed var(--line); line-height: 1.7; }
.help-guide-cta { display: inline-block; margin-top: 14px; font-size: 13.5px; font-weight: 800; color: var(--blue); }
.accent-mint .help-guide-cta { color: #0d8f5d; }
.help-guide-locked-note {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: #f4f6fa;
  border-left: 3px solid #c9d3e4;
  font-size: 12.5px;
  color: var(--text-mid);
  line-height: 1.75;
}

.help-flow { margin-top: 44px; }
.help-flow h2 { font-size: 22px; margin-bottom: 6px; }
.help-flow-sub { font-size: 13px; color: var(--dim); margin-bottom: 18px; }
/* ---------- 演练主线图 ---------- */
/* 图宽 1680，窄屏不缩字、改为可横向拖动；min-width 保证不被挤扁。 */
.journey { margin: 0; }
.journey-canvas {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.journey-canvas img { display: block; width: 100%; min-width: 900px; height: auto; }
.journey-foot {
  margin-top: 12px;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--dim);
}
.journey-foot b { color: var(--text-mid); font-weight: 800; }

.help-note {
  margin-top: 36px;
  background: linear-gradient(180deg, #fffdf7, #fff);
  border: 1px solid rgba(244, 183, 64, 0.32);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.help-note h2 { font-size: 17px; margin-bottom: 10px; color: var(--gold-deep); }
.help-note p { font-size: 13.5px; color: var(--text-mid); line-height: 1.85; }
.help-note p + p { margin-top: 10px; }
.help-note-dim { color: var(--dim) !important; font-size: 12.5px !important; }

/* ---------- 手册阅读器 ---------- */
.help-doc-layout {
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 24px 80px;
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.help-toc-inner {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 116px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px 12px;
}
.help-toc-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 6px 10px; }
.help-toc-title { font-size: 13px; font-weight: 900; letter-spacing: 0.08em; }
.help-toc-count { font-size: 11px; color: var(--dim); }
.help-toc-filter {
  width: 100%;
  padding: 7px 11px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-family: inherit;
  background: #fbfdff;
  outline: none;
}
.help-toc-filter:focus { border-color: var(--blue); }
.help-toc-list { overflow-y: auto; display: flex; flex-direction: column; gap: 1px; padding-right: 4px; }
.help-toc-list a {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-mid);
  border-left: 2px solid transparent;
  transition: 0.15s;
}
.help-toc-list a.lv3 { padding-left: 22px; font-size: 12px; color: var(--dim); }
.help-toc-list a:hover { background: #f2f7ff; color: var(--blue); }
.help-toc-list a.active { background: #eaf3ff; color: var(--blue); font-weight: 800; border-left-color: var(--blue); }
.help-toc-list a[hidden] { display: none; }

.help-doc-hero {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 30px 32px 26px;
  position: relative;
  overflow: hidden;
}
.help-doc-hero::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--grad-brand); }
.help-doc-hero.accent-mint::before { background: linear-gradient(120deg, var(--mint), var(--aqua)); }
.help-doc-hero h1 { font-size: 28px; margin-bottom: 8px; }
.help-doc-sub { font-size: 13.5px; color: var(--text-mid); line-height: 1.75; }
.help-doc-facts { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); }
.help-doc-facts span { font-size: 12.5px; color: var(--text-mid); }
.help-doc-facts b { display: block; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; color: var(--dim); margin-bottom: 2px; }
.help-doc-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

.help-doc {
  margin-top: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 8px 36px 40px;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--text-mid);
}
.help-doc .help-heading { position: relative; color: var(--ink); scroll-margin-top: 96px; }
.help-doc h2.help-heading { font-size: 22px; margin: 44px 0 14px; padding-bottom: 10px; border-bottom: 2px solid var(--paper-2); }
.help-doc h2.help-heading:first-child { margin-top: 24px; }
.help-doc h3.help-heading { font-size: 17.5px; margin: 30px 0 10px; }
.help-doc h4.help-heading { font-size: 15px; margin: 22px 0 8px; }
.help-anchor { position: absolute; left: -20px; color: var(--line-strong); font-weight: 400; opacity: 0; transition: 0.15s; }
.help-heading:hover .help-anchor { opacity: 1; }

.help-doc p { margin: 12px 0; }
.help-doc ul, .help-doc ol { margin: 12px 0 12px 22px; }
.help-doc li { margin: 5px 0; }
.help-doc li::marker { color: var(--blue); }
.help-doc strong { color: var(--ink); font-weight: 800; }
.help-doc a { color: var(--blue); font-weight: 600; border-bottom: 1px solid rgba(23, 108, 255, 0.28); }
.help-doc a:hover { border-bottom-color: var(--blue); }
.help-doc hr { border: none; border-top: 1px solid var(--line); margin: 34px 0; }
.help-doc blockquote {
  margin: 16px 0;
  padding: 12px 18px;
  background: #f4f9ff;
  border-left: 3px solid var(--blue-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13.5px;
}
.help-doc blockquote p { margin: 4px 0; }
.help-doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  padding: 1.5px 6px;
  border-radius: 5px;
  background: #eef3fb;
  color: #0f4fb8;
}
.help-doc pre { margin: 16px 0; padding: 16px 18px; border-radius: var(--radius-sm); background: #0f1b30; overflow-x: auto; }
.help-doc pre code { background: none; padding: 0; color: #cfe0ff; font-size: 12.5px; line-height: 1.7; white-space: pre; }

.help-table-scroll { overflow-x: auto; margin: 16px 0; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.help-doc table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
.help-doc th, .help-doc td { padding: 9px 13px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.help-doc th { background: #f4f8ff; font-weight: 800; color: var(--ink); white-space: nowrap; }
.help-doc tbody tr:last-child td { border-bottom: none; }
.help-doc tbody tr:hover { background: #fafcff; }

/* 截图。单页 40+ 张 2000px 级截图，视口外的连布局/绘制/解码都跳过，
   contain-intrinsic-size 先占位，避免滚动条长度反复跳动。 */
.help-shot { margin: 20px 0 26px; content-visibility: auto; contain-intrinsic-size: auto 880px; }
.help-shot-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  cursor: zoom-in;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: 0.2s;
}
.help-shot-btn:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.help-shot-btn img { display: block; width: 100%; height: auto; }
.help-shot figcaption { margin-top: 8px; font-size: 12px; color: var(--dim); text-align: center; }

.help-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10, 20, 38, 0.86);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 28px;
  cursor: zoom-out;
}
.help-lightbox img {
  max-width: min(1400px, 100%);
  max-height: calc(100vh - 130px);
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  cursor: default;
}
.help-lightbox-cap { color: #d7e3f7; font-size: 13px; text-align: center; }
.help-lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}
.help-lightbox-close:hover { background: rgba(255, 255, 255, 0.2); }

@media (max-width: 1080px) {
  .help-doc-layout { grid-template-columns: 1fr; }
  .help-toc-inner { position: static; max-height: 340px; }
  .help-card-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .help-topbar-inner { padding: 8px 14px; flex-wrap: wrap; gap: 8px; }
  .help-topnav { width: 100%; order: 3; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .help-topnav::-webkit-scrollbar { display: none; }
  .help-topnav a { white-space: nowrap; padding: 6px 11px; font-size: 12.5px; }
  .help-brand-name small { display: none; }
  .help-account { margin-left: auto; }
  .help-home { padding: 28px 16px 56px; }
  .help-home-hero h1 { font-size: 26px; }
  .help-doc-layout { padding: 20px 14px 60px; gap: 20px; }
  .help-doc-hero { padding: 22px 18px; }
  .help-doc-hero h1 { font-size: 22px; }
  .help-doc { padding: 6px 18px 30px; font-size: 14px; }
  .help-doc h2.help-heading { font-size: 19px; }
}

@media print {
  .help-topbar, .help-toc, .help-doc-actions, .help-lightbox { display: none !important; }
  .help-doc-layout { display: block; padding: 0; }
  .help-doc, .help-doc-hero { border: none; box-shadow: none; padding: 0; }
  .help-shot { content-visibility: visible; break-inside: avoid; }
  .journey-canvas { overflow: visible; border: none; box-shadow: none; padding: 0; }
  .help-doc h2.help-heading { break-before: page; }
}
