/* =========================================================
   言瑞达权益 · 帮助中心  —  前台样式
   ========================================================= */

:root {
  color-scheme: light;
  --brand: #2f5cff;
  --brand-600: #2346d8;
  --brand-soft: #eef2ff;
  --brand-line: #d8e2ff;
  --ink: #0f1729;
  --ink-2: #3b4657;
  --ink-3: #6b7688;
  --ink-4: #9aa3b2;
  --line: #e6e9ef;
  --line-soft: #f0f2f6;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-code: #f6f8fb;
  --radius: 14px;
  --radius-sm: 9px;
  --panel: #ffffff;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 8px 24px -8px rgba(16, 24, 40, .14);
  --shadow-lg: 0 24px 60px -24px rgba(16, 24, 40, .24);
  --topbar-h: 64px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
}

/* ---------- 暗色模式 ---------- */
html.dark {
  color-scheme: dark;
  --brand-soft: rgba(99, 130, 255, .16);
  --brand-line: rgba(99, 130, 255, .38);
  --ink: #e8ecf4;
  --ink-2: #c6cddc;
  --ink-3: #9aa4ba;
  --ink-4: #6d7893;
  --line: #2b3348;
  --line-soft: #232a3d;
  --bg: #141824;
  --bg-soft: #1b2130;
  --bg-code: #1c2333;
  --panel: #1b2130;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, .55);
  --shadow-lg: 0 24px 60px -24px rgba(0, 0, 0, .65);
}
html.dark .hero {
  background:
    radial-gradient(900px 320px at 50% -60px, rgba(47, 92, 255, .2) 0%, rgba(0, 0, 0, 0) 70%),
    linear-gradient(var(--bg), var(--bg));
}
html.dark .hero-search { box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .55); }
html.dark .search-item mark { background: rgba(255, 210, 90, .3); color: var(--ink); }
html.dark .markdown code { color: #ff9d9d; }
html.dark .markdown tbody tr:hover { background: var(--bg-soft); }
html.dark .doc-figure img { background: var(--bg-code); }
html.dark .skeleton { background: linear-gradient(90deg, #1d2331 25%, #252c3d 37%, #1d2331 63%); background-size: 400% 100%; }
html.dark .doc-sidebar::-webkit-scrollbar-thumb { background: var(--line); }

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 内容区撑满视口，页脚始终贴底 */
#homeView,
#allDocsView,
#docView {
  flex: 1 0 auto;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); }
img { max-width: 100%; }
button { font-family: inherit; }

::selection { background: #dbe4ff; }

/* ---------- 顶部进度条 ---------- */
.read-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 90;
  background: transparent;
}
.read-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--brand), #7c3aed);
  transition: width .1s linear;
}

/* ---------- 顶栏（导航） ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--topbar-h);
  background: linear-gradient(90deg, #2549e8, var(--brand));
  box-shadow: 0 2px 12px -4px rgba(37, 73, 232, .45);
}
.topbar-inner {
  max-width: 1180px;
  height: 100%;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 36px;
}
.brand { display: flex; align-items: center; gap: 11px; color: #fff; flex: none; }
.brand:hover { color: #fff; }
.brand-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .5px;
  overflow: hidden;
  flex: none;
}
.brand-mark img {
  display: block;
  width: auto;
  height: auto;
  max-height: 38px;
  max-width: 170px;
  object-fit: contain;
}
.brand-mark.has-logo { background: none; width: auto; height: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 16px; font-weight: 700; letter-spacing: .3px; }
.brand-text small { font-size: 11px; color: rgba(255, 255, 255, .72); letter-spacing: 1.2px; }

/* 导航链接 */
.topbar-nav { display: flex; align-items: center; gap: 30px; flex: 1; }
.nav-link {
  color: rgba(255, 255, 255, .82);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 2px;
  position: relative;
  transition: color .15s;
}
.nav-link:hover { color: #fff; }
.nav-link.active { color: #fff; font-weight: 600; }
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; flex: none; margin-left: auto; }
.theme-toggle {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 8px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: all .15s;
}
.theme-toggle:hover { background: rgba(255, 255, 255, .18); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-moon { display: none; }
.theme-toggle.dark .icon-sun { display: none; }
.theme-toggle.dark .icon-moon { display: block; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,.4);
  background: transparent;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}
.btn:hover { background: rgba(255,255,255,.14); color: #fff; }
.btn-primary { background: #fff; border-color: #fff; color: var(--brand); }
.btn-primary:hover { background: #f0f4ff; border-color: #f0f4ff; color: var(--brand); }
.btn-icon { width: 36px; padding: 0; display: none; justify-content: center; }
.btn-icon svg { width: 19px; height: 19px; }

/* =========================================================
   首页
   ========================================================= */
.home { display: block; }

.hero {
  position: relative;
  z-index: 10;
  padding: 72px 28px 56px;
  text-align: center;
  background:
    radial-gradient(900px 320px at 50% -60px, #e8eeff 0%, rgba(255,255,255,0) 70%),
    linear-gradient(#fff, #fdfdff);
}
.hero-inner { position: relative; max-width: 880px; margin: 0 auto; }
.hero h1 {
  margin: 0;
  font-size: 40px;
  line-height: 1.22;
  font-weight: 700;
  letter-spacing: -.8px;
  color: var(--ink);
}
.hero-desc {
  max-width: 780px;
  margin: 18px auto 0;
  font-size: 15px;
  color: var(--ink-3);
  line-height: 1.85;
}
.hero-search {
  position: relative;
  max-width: 620px;
  margin: 32px auto 0;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 8px 0 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  transition: box-shadow .18s, border-color .18s;
}
.hero-search:focus-within { border-color: var(--brand-line); box-shadow: 0 0 0 4px rgba(47,92,255,.1), var(--shadow-md); }
.hero-search > svg { width: 18px; height: 18px; color: var(--ink-4); flex: none; }
.hero-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14.5px;
  color: var(--ink);
}
.hero-search input::placeholder { color: var(--ink-4); }
.hero-search input::-webkit-search-cancel-button { display: none; }
.hero-search-btn {
  flex: none;
  height: 38px;
  padding: 0 22px;
  border: 0;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}
.hero-search-btn:hover { background: var(--brand-600); }
.hero-meta {
  margin-top: 22px;
  display: flex;
  justify-content: center;
  gap: 26px;
  font-size: 12.5px;
  color: var(--ink-4);
}
.hero-meta b { color: var(--ink-2); font-weight: 600; }

/* 搜索结果 / 热门推荐面板 */
.search-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 50;
  max-height: 64vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  text-align: left;
}
.search-empty { padding: 22px 16px; color: var(--ink-3); font-size: 13.5px; text-align: center; }
.hot-head {
  padding: 9px 12px 5px;
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--ink-4);
  font-weight: 600;
}
.search-item {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--ink);
}
.search-item:hover, .search-item.active { background: var(--brand-soft); color: var(--ink); }
.search-item .si-title { font-size: 13.5px; font-weight: 600; display: flex; gap: 8px; align-items: baseline; }
.search-item .si-chapter { font-size: 11px; color: var(--ink-4); font-weight: 400; }
.search-item .si-snippet {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--ink-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-item mark { background: #fff2ae; color: inherit; padding: 0 1px; border-radius: 3px; }

/* 大分类卡片 */
.categories {
  max-width: 1080px;
  margin: 0 auto;
  padding: 8px 28px 80px;
}
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}
.cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 20px 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.cat-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand-line);
  box-shadow: var(--shadow-md);
}
.cat-fig { width: 128px; height: 104px; margin-bottom: 14px; }
.cat-fig svg { width: 100%; height: 100%; display: block; }
.cat-name { font-size: 15.5px; font-weight: 650; color: var(--ink); letter-spacing: -.2px; }
.cat-count { margin-top: 5px; font-size: 12px; color: var(--ink-4); }

/* =========================================================
   全部文档页
   ========================================================= */
.all-docs { padding: 44px 28px 80px; }
.all-inner { max-width: 1080px; margin: 0 auto; }
.all-head { text-align: center; margin-bottom: 34px; }
.all-head h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -.6px;
  color: var(--ink);
}
.all-sub { margin: 10px 0 0; font-size: 13.5px; color: var(--ink-4); }

.all-cat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.all-cat:hover { border-color: var(--brand-line); box-shadow: var(--shadow-sm); }

.all-cat-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.all-cat-fig { width: 34px; height: 27px; flex: none; display: block; }
.all-cat-fig svg { width: 100%; height: 100%; display: block; }
.all-cat-name {
  font-size: 16.5px;
  font-weight: 680;
  letter-spacing: -.2px;
  color: var(--ink);
  flex: 1;
  min-width: 0;
}
.all-cat-count { font-size: 12px; color: var(--ink-4); flex: none; }
.all-cat-head .chev {
  width: 16px; height: 16px;
  color: var(--ink-4);
  flex: none;
  transition: transform .18s;
  transform: rotate(-90deg);
}
.all-cat:not(.collapsed) .all-cat-head .chev { transform: none; }

.all-cat-body { padding: 0 22px 18px; }
.all-cat.collapsed .all-cat-body { display: none; }

.all-chapter { border-top: 1px solid var(--line-soft); }
.all-chapter:first-child { border-top: 0; }
.all-ch-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 8px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink-2);
  transition: background .13s;
}
.all-ch-head:hover { background: var(--bg-soft); }
.all-ch-name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 620; }
.all-ch-count { font-size: 11.5px; color: var(--ink-4); flex: none; }
.all-ch-head .chev {
  width: 14px; height: 14px;
  color: var(--ink-4);
  flex: none;
  transition: transform .18s;
  transform: rotate(-90deg);
}
.all-chapter:not(.collapsed) .all-ch-head .chev { transform: none; }
.all-chapter.collapsed .all-doc-list { display: none; }
.all-doc-list { list-style: none; margin: 0; padding: 0 0 6px 12px; }
.all-doc-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 13.5px;
  transition: background .13s, color .13s;
}
.all-doc-list a:hover { background: var(--brand-soft); color: var(--brand); }
.all-doc-list a::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--line);
  flex: none;
  margin-left: 4px;
  transition: background .13s;
}
.all-doc-list a:hover::before { background: var(--brand); }
.all-doc-list .ad-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.all-doc-list .ad-date { flex: none; font-size: 11.5px; color: var(--ink-4); }
.all-empty { padding: 14px 4px; font-size: 13px; color: var(--ink-4); }

/* =========================================================
   文档页
   ========================================================= */
.doc-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 28px;
  display: grid;
  grid-template-columns: 274px minmax(0, 1fr) 224px;
  gap: 44px;
  align-items: start;
}

/* 侧栏 */
.doc-sidebar {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 26px 14px 60px 0;
  border-right: 1px solid var(--line-soft);
  scrollbar-width: thin;
}
.doc-sidebar::-webkit-scrollbar { width: 6px; }
.doc-sidebar::-webkit-scrollbar-thumb { background: #e0e4ec; border-radius: 3px; }
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 12px;
  font-size: 11.5px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--ink-4);
  font-weight: 600;
}
.btn-collapse { display: none; border: 0; background: transparent; font-size: 22px; line-height: 1; color: var(--ink-3); cursor: pointer; }

.sidebar-nav { display: grid; gap: 2px; }
.nav-cat { margin-bottom: 10px; }
.nav-cat-title {
  padding: 6px 10px 4px;
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink-4);
  font-weight: 600;
}
.nav-chapter { margin-bottom: 6px; }
.nav-chapter-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 620;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  line-height: 1.4;
}
.nav-chapter-btn:hover { background: var(--bg-soft); }
.nav-chapter-btn .chev {
  width: 14px; height: 14px;
  color: var(--ink-4);
  transition: transform .16s;
  flex: none;
  margin-left: auto;
}
.nav-chapter.collapsed .chev { transform: rotate(-90deg); }
.nav-chapter.collapsed .nav-docs { display: none; }
.nav-chapter-btn .idx {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-4);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 4px;
  flex: none;
}
.nav-docs { list-style: none; margin: 2px 0 8px; padding: 0 0 0 12px; display: grid; gap: 1px; }
.nav-docs a {
  display: block;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--ink-2);
  border-radius: 7px;
  border-left: 2px solid transparent;
  line-height: 1.5;
  transition: background .13s, color .13s;
}
.nav-docs a:hover { background: var(--bg-soft); color: var(--ink); }
.nav-docs a.active {
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 600;
  border-left-color: var(--brand);
}

/* 正文 */
.doc-main { min-width: 0; padding: 26px 0 80px; }
.doc-inner { max-width: 800px; margin: 0 auto; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-4);
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--ink-3); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb .sep { color: #cfd6e2; }
.breadcrumb .current { color: var(--ink-2); }

/* Markdown 排版 */
.markdown { font-size: 15.5px; color: var(--ink-2); line-height: 1.85; }
.markdown > *:first-child { margin-top: 0; }

.markdown h1 {
  font-size: 30px;
  line-height: 1.3;
  letter-spacing: -.6px;
  color: var(--ink);
  margin: 0 0 22px;
  font-weight: 700;
}
.markdown h2 {
  position: relative;
  margin: 44px 0 16px;
  padding-bottom: 10px;
  font-size: 21px;
  line-height: 1.45;
  font-weight: 680;
  letter-spacing: -.3px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.markdown h3 {
  margin: 32px 0 12px;
  font-size: 17px;
  font-weight: 650;
  color: var(--ink);
  letter-spacing: -.1px;
}
.markdown h4 {
  margin: 26px 0 10px;
  font-size: 15.5px;
  font-weight: 650;
  color: var(--ink);
}
.markdown h5 {
  margin: 22px 0 8px;
  font-size: 14.5px;
  font-weight: 650;
  color: var(--ink-2);
}
.markdown p { margin: 14px 0; }
.markdown strong { color: var(--ink); font-weight: 650; }
.markdown ul, .markdown ol { margin: 14px 0; padding-left: 22px; }
.markdown li { margin: 6px 0; }
.markdown li::marker { color: var(--ink-4); }
.markdown a { border-bottom: 1px solid rgba(47, 92, 255, .25); }
.markdown a:hover { border-bottom-color: var(--brand); }
.markdown hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.markdown blockquote {
  margin: 18px 0;
  padding: 12px 18px;
  border-left: 3px solid var(--brand);
  background: var(--brand-soft);
  border-radius: 0 8px 8px 0;
  color: var(--ink-2);
}
.markdown blockquote p { margin: 4px 0; }
.markdown code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--bg-code);
  border: 1px solid var(--line-soft);
  padding: 1px 5px;
  border-radius: 5px;
  color: #b3261e;
}
.markdown pre {
  background: #0f1729;
  color: #e6edf7;
  padding: 18px 20px;
  border-radius: 12px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.7;
}
.markdown pre code { background: transparent; border: 0; color: inherit; padding: 0; }

.heading-anchor {
  float: left;
  margin-left: -20px;
  width: 20px;
  color: #c6cddb;
  opacity: 0;
  font-weight: 400;
  border: 0 !important;
  transition: opacity .15s;
}
.markdown h2:hover .heading-anchor,
.markdown h3:hover .heading-anchor,
.markdown h4:hover .heading-anchor { opacity: 1; }

/* 表格 */
.table-wrap {
  margin: 20px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.markdown table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.markdown thead th {
  background: var(--bg-soft);
  text-align: left;
  font-weight: 650;
  color: var(--ink);
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.markdown tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-2);
  vertical-align: top;
}
.markdown tbody tr:last-child td { border-bottom: 0; }
.markdown tbody tr:hover { background: #fbfcfe; }

/* 图片 */
.doc-figure {
  margin: 22px 0;
  padding: 0;
  text-align: center;
}
.doc-figure img {
  display: block;
  max-width: 100%;
  margin: 0 auto;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fafbfd;
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
}
.img-cap {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-4);
}

/* 文末 */
.doc-foot {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--ink-4);
}
.rate { display: inline-flex; gap: 6px; margin-left: 8px; }
.rate button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-3);
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all .14s;
}
.rate button:hover { border-color: var(--brand-line); color: var(--brand); }
.rate button.done { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand); }

.pager {
  margin-top: 26px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.pager a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  transition: border-color .16s, box-shadow .16s, transform .16s;
}
.pager a:hover { border-color: var(--brand-line); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.pager .pg-label { font-size: 11.5px; color: var(--ink-4); }
.pager .pg-title { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.pager a.next { text-align: right; align-items: flex-end; }
.pager .placeholder { border: 1px dashed var(--line); border-radius: 12px; }

/* 右侧页内目录 */
.doc-toc {
  position: sticky;
  top: var(--topbar-h);
  max-height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 30px 0 40px;
  scrollbar-width: none;
}
.doc-toc::-webkit-scrollbar { display: none; }
.toc-inner { border-left: 1px solid var(--line-soft); padding-left: 16px; }
.toc-head {
  font-size: 11.5px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink-4);
  font-weight: 600;
  margin-bottom: 10px;
}
.toc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.toc-list li a {
  display: block;
  padding: 5px 0 5px 10px;
  margin-left: -17px;
  border-left: 2px solid transparent;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.5;
  transition: color .13s, border-color .13s;
}
.toc-list li a:hover { color: var(--ink); }
.toc-list li.lv3 a { padding-left: 22px; font-size: 12px; }
.toc-list li.lv4 a { padding-left: 34px; font-size: 12px; color: var(--ink-4); }
.toc-list li a.active { color: var(--brand); border-left-color: var(--brand); font-weight: 600; }

/* 页脚 */
.site-footer {
  border-top: 1px solid var(--line-soft);
  background: var(--bg-soft);
  margin-top: auto;
  flex: none;
}
.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px 28px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-4);
  flex-wrap: wrap;
}
.friend-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 18px;
  line-height: 1.6;
}
.friend-links .fl-label { color: var(--ink-4); }
.friend-links a { color: var(--ink-3); font-size: 12.5px; }
.friend-links a:hover { color: var(--brand); }

/* 图片放大 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(9, 14, 25, .82);
  display: grid;
  place-items: center;
  padding: 4vw;
  cursor: zoom-out;
  backdrop-filter: blur(4px);
}
.lightbox img {
  max-width: 100%;
  max-height: 92vh;
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}

/* 骨架屏 */
.skeleton { background: linear-gradient(90deg, #f2f4f8 25%, #e9edf4 37%, #f2f4f8 63%); background-size: 400% 100%; animation: sk 1.3s infinite; border-radius: 8px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 1240px) {
  .doc-shell { grid-template-columns: 258px minmax(0, 1fr); gap: 36px; }
  .doc-toc { display: none; }
}
@media (max-width: 1024px) {
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero h1 { font-size: 34px; }
  .topbar-nav { gap: 20px; }
}
@media (max-width: 900px) {
  .topbar-nav { display: none; }
  .btn-icon { display: inline-flex; }
  .doc-shell { grid-template-columns: minmax(0, 1fr); padding: 0 20px; }
  .doc-sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    width: 288px;
    height: calc(100vh - var(--topbar-h));
    background: var(--panel);
    z-index: 80;
    padding: 18px 16px 60px;
    border-right: 1px solid var(--line);
    transform: translateX(-102%);
    transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  .doc-sidebar.open { transform: none; }
  .btn-collapse { display: block; }
  .sidebar-mask { position: fixed; inset: var(--topbar-h) 0 0; background: rgba(15, 23, 41, .35); z-index: 70; }
  .sidebar-mask[hidden] { display: none; }
  .doc-main { padding-top: 20px; }
  .read-progress { display: none; }
}
@media (max-width: 720px) {
  .topbar-inner { padding: 0 12px; gap: 12px; }
  .brand-text small { display: none; }
  .theme-toggle { width: 31px; height: 31px; }
  .hero { padding: 44px 18px 38px; }
  .hero h1 { font-size: 27px; }
  .hero-desc { font-size: 14px; }
  .hero-search { height: 46px; }
  .hero-search-btn { height: 34px; padding: 0 16px; }
  .cat-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .categories { padding: 4px 18px 56px; }
  .all-docs { padding: 30px 16px 56px; }
  .all-head h1 { font-size: 26px; }
  .all-cat { padding: 0; }
  .all-cat-head { padding: 14px 16px; gap: 10px; }
  .all-cat-body { padding: 0 16px 14px; }
  .all-doc-list .ad-date { display: none; }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .footer-inner { padding: 18px; }
  .markdown h2 { font-size: 19px; }
  .markdown h1 { font-size: 23px; letter-spacing: -.3px; }
  .doc-inner { overflow-wrap: break-word; }
  .markdown { font-size: 15px; }
}
