/* ==========================================================================
   ChemVerse — 化学学习站
   配色：淡蓝 / 米白 / 墨蓝
   ========================================================================== */

:root {
  --paper:        #FFFFFF;
  --bg:           #FAF8F2;
  --bg-warm:      #F4F0E6;
  --bg-blue:      #EDF4F9;
  --blue-050:     #F2F8FC;
  --blue-100:     #DDEBF5;
  --blue-200:     #C2DAEA;
  --blue-300:     #9DBFD6;
  --blue-400:     #7FA8C4;
  --blue-500:     #5B87A6;
  --blue-600:     #3F6F8E;
  --blue-700:     #37637F;
  --blue-900:     #1F4257;

  --ink:          #21313A;
  --ink-2:        #45575F;
  --ink-3:        #77878E;
  --ink-4:        #9BA9AE;
  --line:         rgba(33, 49, 58, .10);
  --line-soft:    rgba(33, 49, 58, .06);

  --sand:         #C8A06A;
  --sand-soft:    #F6EEDF;

  --shadow-sm: 0 1px 2px rgba(31, 66, 87, .04), 0 4px 14px rgba(31, 66, 87, .04);
  --shadow-md: 0 2px 4px rgba(31, 66, 87, .04), 0 12px 32px rgba(31, 66, 87, .07);
  --shadow-lg: 0 4px 8px rgba(31, 66, 87, .05), 0 24px 60px rgba(31, 66, 87, .10);

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;

  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", monospace;

  --maxw: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: clip; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(194, 218, 234, .35), transparent 42%),
    radial-gradient(circle at 88% 2%, rgba(246, 238, 223, .70), transparent 38%),
    radial-gradient(circle at 50% 100%, rgba(221, 235, 245, .55), transparent 55%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

::selection { background: var(--blue-200); color: var(--blue-900); }

/* ---------- 通用 ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--blue-700);
  font-weight: 600;
}
.eyebrow::before {
  content: "";
  width: 18px; height: 1px;
  background: var(--blue-300);
}

.serif { font-family: var(--serif); }

/* ---------- 顶部导航 ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 60;
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  background: rgba(250, 248, 242, .82);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: .01em;
  font-weight: 600;
  color: var(--blue-900);
}
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: linear-gradient(150deg, var(--blue-700), var(--blue-900));
  display: grid;
  place-items: center;
  box-shadow: 0 3px 10px rgba(31, 66, 87, .22);
}
.brand-mark svg { width: 17px; height: 17px; }
.brand em {
  font-style: normal;
  color: var(--ink-3);
  font-size: 12px;
  font-family: var(--sans);
  letter-spacing: .12em;
  margin-left: 2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 13.5px;
  color: var(--ink-2);
}
.nav-links a {
  position: relative;
  padding: 6px 0;
  transition: color .2s;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--blue-500);
  transition: width .25s ease;
}
.nav-links a:hover { color: var(--blue-700); }
.nav-links a:hover::after { width: 100%; }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--blue-200);
  background: var(--paper);
  color: var(--blue-700);
  font-size: 13px;
  font-weight: 500;
  transition: all .2s ease;
}
.nav-cta:hover {
  background: var(--blue-050);
  border-color: var(--blue-300);
  transform: translateY(-1px);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 92px 0 68px;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: 56px;
  align-items: center;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(44px, 5.6vw, 74px);
  line-height: 1.06;
  letter-spacing: -.02em;
  margin: 20px 0 0;
  font-weight: 500;
  color: var(--ink);
}
.hero h1 .grad {
  background: linear-gradient(105deg, var(--blue-700) 10%, var(--blue-500) 55%, var(--sand) 105%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .sub {
  font-family: var(--serif);
  font-size: 19px;
  color: var(--blue-700);
  margin: 18px 0 0;
  letter-spacing: .02em;
}
.hero .lede {
  max-width: 46ch;
  margin: 18px 0 0;
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.85;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 46px;
  padding: 0 24px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .22s ease;
}
.btn-primary {
  background: linear-gradient(160deg, var(--blue-700), var(--blue-900));
  color: #fff;
  box-shadow: 0 8px 22px rgba(31, 66, 87, .22);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(31, 66, 87, .28); }
.btn-ghost {
  background: rgba(255, 255, 255, .7);
  border-color: var(--line);
  color: var(--ink-2);
}
.btn-ghost:hover { background: #fff; border-color: var(--blue-200); color: var(--blue-700); }

.hero-meta {
  display: flex;
  gap: 34px;
  margin-top: 46px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
}
.hero-meta div { display: flex; flex-direction: column; gap: 2px; }
.hero-meta b {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 500;
  color: var(--blue-900);
  line-height: 1.2;
}
.hero-meta span { font-size: 12px; color: var(--ink-3); letter-spacing: .06em; }

/* Hero 装饰 */
.hero-art {
  position: relative;
  aspect-ratio: 1 / .92;
  display: grid;
  place-items: center;
}
.orb {
  position: absolute;
  inset: 6% 8%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, rgba(255,255,255,.95), rgba(255,255,255,0) 55%),
    radial-gradient(circle at 62% 68%, rgba(157, 191, 214, .35), transparent 60%),
    linear-gradient(160deg, var(--blue-050), var(--bg-warm));
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: inset 0 0 60px rgba(255,255,255,.9), 0 30px 70px -30px rgba(31,66,87,.35);
}
.orbit {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.orbit svg { width: 100%; height: 100%; overflow: visible; }
.ring { fill: none; stroke: rgba(95, 137, 163, .30); stroke-width: 1; }
.ring.dash { stroke-dasharray: 3 7; stroke: rgba(95, 137, 163, .38); }
.node { fill: #fff; stroke: var(--blue-500); stroke-width: 1.2; }
.node.solid { fill: var(--blue-700); stroke: none; }
.node.sand { fill: var(--sand); stroke: none; }
.spin-a { animation: spin 46s linear infinite; transform-origin: 50% 50%; }
.spin-b { animation: spin 68s linear infinite reverse; transform-origin: 50% 50%; }
@keyframes spin { to { transform: rotate(360deg); } }

.art-card {
  position: absolute;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: var(--shadow-md);
  border-radius: 14px;
  padding: 11px 15px;
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.5;
}
.art-card b { display: block; font-size: 11px; color: var(--blue-700); letter-spacing: .1em; text-transform: uppercase; }
.art-card.c1 { left: -2%; top: 14%; }
.art-card.c2 { right: -3%; bottom: 20%; }
.art-card .katex { font-size: 1.05em; }

/* ---------- 模块区 ---------- */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}
.section-head h2 {
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 500;
  letter-spacing: -.01em;
  margin: 10px 0 0;
  color: var(--ink);
}
.section-head p {
  margin: 0;
  color: var(--ink-3);
  font-size: 13.5px;
  max-width: 44ch;
}

.modules-section { padding: 26px 0 30px; }

.module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.module-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px 28px 22px;
  min-height: 236px;
  background: linear-gradient(168deg, #fff 0%, #fff 62%, var(--blue-050) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .3s cubic-bezier(.2,.7,.3,1), box-shadow .3s, border-color .3s;
}
.module-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--mc, var(--blue-500)), transparent 78%);
  opacity: .9;
}
.module-card::after {
  content: "";
  position: absolute;
  width: 190px; height: 190px;
  right: -66px; top: -70px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--mc) 14%, transparent), transparent 70%);
  pointer-events: none;
}
.module-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--mc) 28%, var(--line));
}

.mc-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.mc-no {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .16em;
  color: var(--ink-4);
}
.mc-glyph {
  width: 44px; height: 44px;
  border-radius: 13px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--mc) 10%, #fff);
  border: 1px solid color-mix(in srgb, var(--mc) 22%, #fff);
  color: var(--mc);
}
.mc-glyph svg { width: 22px; height: 22px; }

.mc-title {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  margin: 16px 0 2px;
  letter-spacing: .01em;
  color: var(--ink);
}
.mc-en {
  font-size: 11.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.mc-desc {
  margin: 14px 0 0;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.75;
  max-width: 40ch;
}

.mc-foot {
  margin-top: auto;
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.mc-stat {
  font-size: 12px;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--mc);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mc) 16%, transparent);
}
.dot.live { background: #4E9A7C; box-shadow: 0 0 0 3px rgba(78,154,124,.16); }
.mc-go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--mc);
  padding: 7px 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--mc) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--mc) 18%, #fff);
  transition: all .22s;
}
.module-card:hover .mc-go { background: var(--mc); color: #fff; border-color: var(--mc); }
.mc-go svg { width: 13px; height: 13px; }

/* ---------- 工具区 ---------- */
.tools-section { padding: 56px 0 90px; }
.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.tool-card {
  background: rgba(255,255,255,.72);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 24px;
  transition: all .25s;
}
.tool-card:hover { background: #fff; box-shadow: var(--shadow-md); transform: translateY(-2px); }
.tool-ico {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--blue-050);
  border: 1px solid var(--blue-100);
  display: grid; place-items: center;
  color: var(--blue-700);
  margin-bottom: 15px;
}
.tool-ico svg { width: 18px; height: 18px; }
.tool-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .01em;
}
.tool-card p { margin: 0; font-size: 13px; color: var(--ink-3); line-height: 1.7; }
.tool-card .mini-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 14px; font-size: 12.5px; color: var(--blue-700); font-weight: 500;
}
.tool-card .mini-link svg { width: 12px; height: 12px; }

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--line-soft);
  padding: 30px 0 44px;
  color: var(--ink-3);
  font-size: 12.5px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.footer .fnote { max-width: 58ch; line-height: 1.7; }

/* ==========================================================================
   阅读页
   ========================================================================== */
.read-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--blue-500), var(--sand));
  z-index: 100;
  transition: width .1s linear;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(250, 248, 242, .88);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-inner {
  height: 62px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--ink-2);
  padding: 7px 12px 7px 9px;
  border-radius: 999px;
  transition: all .2s;
}
.back-link:hover { background: var(--blue-050); color: var(--blue-700); }
.back-link svg { width: 14px; height: 14px; }

.tb-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--serif);
  font-size: 17px;
  color: var(--ink);
}
.tb-title span {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.tb-spacer { flex: 1; }

/* 搜索 */
.search-box {
  position: relative;
  width: 268px;
}
.search-box input {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.85);
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: all .2s;
  font-family: var(--sans);
}
.search-box input::placeholder { color: var(--ink-4); }
.search-box input:focus {
  border-color: var(--blue-300);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(157, 191, 214, .18);
}
.search-box > svg {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  color: var(--ink-4);
  pointer-events: none;
}
.search-panel {
  position: absolute;
  right: 0; top: 46px;
  width: 430px;
  max-height: 60vh;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: none;
  z-index: 90;
}
.search-panel.open { display: block; }
.sr-item {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s;
}
.sr-item:hover, .sr-item.active { background: var(--blue-050); }
.sr-path {
  font-size: 11px;
  color: var(--blue-700);
  letter-spacing: .04em;
  margin-bottom: 2px;
}
.sr-text {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sr-empty { padding: 18px; text-align: center; color: var(--ink-4); font-size: 13px; }

/* 布局 */
.layout {
  display: grid;
  grid-template-columns: 264px minmax(0, 772px);
  gap: 56px;
  align-items: start;
  justify-content: center;
  padding: 36px 0 100px;
}

.sidebar {
  position: sticky;
  top: 86px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--blue-100); border-radius: 4px; }

.sb-head {
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-4);
  padding: 0 0 12px 12px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 10px;
}
.toc-item {
  display: flex;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all .18s;
  line-height: 1.5;
}
.toc-item:hover { background: rgba(255,255,255,.8); color: var(--blue-700); }
.toc-item .n {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
  padding-top: 3px;
  flex: none;
}
.toc-item.active {
  background: #fff;
  color: var(--blue-900);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.toc-item.active .n { color: var(--blue-500); }
.toc-sub {
  display: none;
  padding: 4px 0 8px 30px;
}
.toc-item.active + .toc-sub { display: block; }
.toc-sub a {
  display: block;
  font-size: 12.5px;
  color: var(--ink-3);
  padding: 4px 0;
  transition: color .15s;
}
.toc-sub a:hover { color: var(--blue-700); }

/* 内容 */
.content { min-width: 0; }

.mod-head { padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.mod-head .eyebrow { margin-bottom: 12px; }
.mod-head h1 {
  font-family: var(--serif);
  font-size: clamp(34px, 4vw, 46px);
  font-weight: 500;
  letter-spacing: -.01em;
  margin: 0;
  color: var(--ink);
}
.mod-head .mh-en {
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-top: 8px;
}
.mod-head .mh-desc {
  margin: 14px 0 0;
  color: var(--ink-2);
  font-size: 14.5px;
  max-width: 60ch;
}
.mh-stats {
  display: flex;
  gap: 28px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.mh-stats div { display: flex; align-items: baseline; gap: 7px; }
.mh-stats b { font-family: var(--serif); font-size: 20px; font-weight: 500; color: var(--blue-900); }
.mh-stats span { font-size: 12px; color: var(--ink-3); }

.chapter { padding-top: 46px; scroll-margin-top: 84px; }
.chapter-head {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 8px;
}
.ch-no {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .1em;
  color: #fff;
  background: linear-gradient(155deg, var(--blue-600, #3F6F8E), var(--blue-900));
  width: 38px; height: 38px;
  border-radius: 11px;
  display: grid; place-items: center;
  flex: none;
  margin-top: 6px;
  box-shadow: 0 6px 16px -6px rgba(31,66,87,.5);
}
.ch-title-wrap { min-width: 0; }
.chapter-head h2 {
  font-family: var(--serif);
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 500;
  letter-spacing: .01em;
  margin: 0;
  color: var(--ink);
  line-height: 1.35;
}
.ch-intro {
  margin: 8px 0 0;
  font-size: 13.5px;
  color: var(--ink-3);
  line-height: 1.75;
}
.ch-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--blue-700);
  background: var(--blue-050);
  border: 1px solid var(--blue-100);
  flex: none;
  margin-top: 8px;
}

/* 节 */
.sec { padding: 30px 0 6px; scroll-margin-top: 84px; }
.sec-title {
  display: flex;
  align-items: baseline;
  gap: 11px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--blue-900);
  margin: 0 0 14px;
  letter-spacing: .015em;
}
.sec-title .sid {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--blue-400, #7FA8C4);
  letter-spacing: .04em;
}

.block { margin: 0 0 13px; }
.p {
  margin: 0 0 13px;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.92;
  text-align: justify;
}
.p strong, .li strong, .tip strong {
  color: var(--ink);
  font-weight: 600;
}
.h {
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--blue-900);
  margin: 28px 0 10px;
  padding-left: 11px;
  border-left: 2px solid var(--blue-400);
  line-height: 1.55;
  letter-spacing: .01em;
}

.ul { margin: 0 0 14px; padding: 0; list-style: none; }
.ul li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.85;
}
.ul li::before {
  content: "";
  position: absolute;
  left: 4px; top: .72em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--blue-200);
}
.ol { counter-reset: li; }
.ol li { padding-left: 26px; }
.ol li::before {
  counter-increment: li;
  content: counter(li);
  width: auto; height: auto;
  background: none;
  left: 0; top: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--blue-400, #7FA8C4);
  border-radius: 0;
  padding-top: .32em;
}

/* 公式 */
.formula {
  margin: 15px 0 18px;
  padding: 15px 20px;
  background: linear-gradient(168deg, #fff, var(--blue-050));
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--blue-300);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  overflow-x: auto;
  overflow-y: hidden;
  text-align: center;
}
.formula .katex-display { margin: 2px 0; }
.formula .katex { font-size: 1.06em; }

.katex { color: var(--ink); }
.katex-display > .katex { color: var(--ink); }

/* 定义块 */
.def {
  margin: 14px 0;
  padding: 15px 18px;
  background: rgba(255,255,255,.72);
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--blue-200);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.def .dt {
  font-size: 13.5px;
  letter-spacing: .02em;
  color: var(--blue-900);
  font-weight: 600;
  margin-bottom: 6px;
}
.def .dd { font-size: 14.5px; color: var(--ink-2); line-height: 1.85; }

/* 提示 */
.tip {
  display: flex;
  gap: 12px;
  margin: 16px 0;
  padding: 14px 18px;
  background: var(--sand-soft);
  border: 1px solid rgba(200, 160, 106, .22);
  border-radius: var(--r-sm);
  font-size: 14px;
  color: #7A5B33;
  line-height: 1.8;
}
.tip::before {
  content: "!";
  flex: none;
  width: 18px; height: 18px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--sand);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: grid; place-items: center;
  font-family: var(--mono);
}

/* 例题（可展开） */
.ex {
  margin: 18px 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.ex:hover { border-color: var(--blue-200); box-shadow: var(--shadow-sm); }
.ex[open] { border-color: var(--blue-200); box-shadow: var(--shadow-sm); }

.ex-sum {
  list-style: none;
  display: block;
  padding: 17px 20px 16px;
  cursor: pointer;
  user-select: none;
}
.ex-sum::-webkit-details-marker { display: none; }
.ex-sum::marker { content: ""; }

.ex-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 9px;
}
.ex-no {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 6px;
  background: linear-gradient(155deg, var(--blue-700), var(--blue-900));
  color: #fff;
  font-size: 11.5px;
  letter-spacing: .06em;
  font-weight: 500;
  flex: none;
}
.ex-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--blue-600);
  font-weight: 500;
  flex: none;
}
.ex-toggle-txt::before { content: "查看解答"; }
.ex[open] .ex-toggle-txt::before { content: "收起解答"; }
.ex-toggle svg { width: 14px; height: 14px; transition: transform .25s ease; }
.ex[open] .ex-toggle svg { transform: rotate(180deg); }

.ex-text {
  font-size: 15px;
  line-height: 1.88;
  color: var(--ink-2);
}
.ex-a {
  border-top: 1px dashed var(--line);
  background: linear-gradient(180deg, var(--blue-050), rgba(255, 255, 255, .45));
  padding: 4px 20px 16px;
}
.ex-a-inner > *:first-child { margin-top: 12px; }
.ex-a .p { font-size: 14.5px; }
.ex-a .formula {
  background: rgba(255, 255, 255, .9);
  margin: 12px 0;
}
.ex-a .h { margin-top: 18px; }

/* 表格 */
.table-wrap {
  margin: 18px 0 22px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
}
table.ct {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 420px;
}
table.ct th {
  background: var(--blue-050);
  color: var(--blue-900);
  font-weight: 600;
  text-align: left;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  font-size: 13px;
}
table.ct td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-2);
  vertical-align: middle;
}
table.ct tr:last-child td { border-bottom: none; }
table.ct tbody tr:hover { background: #FCFBF7; }
.tbl-cap {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--ink-4);
  text-align: center;
}

/* 章节结束 */
.ch-end {
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
  margin: 34px 0 0;
}

/* 建设中 */
.build-notice {
  margin: 34px 0 0;
  padding: 30px;
  border: 1px dashed var(--blue-200);
  border-radius: var(--r-md);
  background: rgba(255,255,255,.55);
  text-align: center;
}
.build-notice h3 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  margin: 0 0 8px;
  color: var(--blue-900);
}
.build-notice p { margin: 0 auto; max-width: 46ch; font-size: 13.5px; color: var(--ink-3); line-height: 1.8; }
.outline-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}
.outline-list li {
  font-size: 13px;
  color: var(--ink-3);
  padding: 8px 12px;
  background: rgba(255,255,255,.7);
  border-radius: 8px;
  border: 1px solid var(--line-soft);
}

/* 移动端 */
.mobile-toc-btn {
  display: none;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12.5px;
  color: var(--ink-2);
}

@media (max-width: 980px) {
  .hero { padding: 60px 0 40px; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-art { max-width: 380px; margin: 0 auto; width: 100%; }
  .module-grid { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: 1fr; }
  .layout { grid-template-columns: 1fr; gap: 0; padding-top: 22px; }
  .sidebar {
    position: fixed;
    left: 0; top: 62px; bottom: 0;
    width: 290px;
    max-height: none;
    background: var(--bg);
    border-right: 1px solid var(--line);
    padding: 18px 14px 40px;
    transform: translateX(-102%);
    transition: transform .28s cubic-bezier(.2,.7,.3,1);
    z-index: 80;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .mobile-toc-btn { display: inline-flex; flex: none; }
  .topbar-inner { gap: 10px; }
  .tb-title { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .search-box { width: auto; flex: 1 1 auto; min-width: 84px; max-width: 180px; }
  .search-panel { width: min(430px, calc(100vw - 36px)); right: -6px; }
  .nav-links { display: none; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 10px; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .hero h1 { font-size: 40px; }
  .hero-meta { gap: 22px; }
  .hero-meta b { font-size: 21px; }
  .tb-title span { display: none; }
  .tb-title { display: none; }
  .search-box { max-width: 160px; min-width: 0; flex: 1 1 auto; }
  .search-box input { padding-left: 30px; font-size: 12.5px; }
  .search-box > svg { left: 10px; }
  .outline-list { grid-template-columns: 1fr; }
  .module-card { padding: 22px; }
  .formula { padding: 12px 10px; }
  table.ct { min-width: 300px; font-size: 12.5px; }
  table.ct th, table.ct td { padding: 9px 11px; }
  .ch-no { width: 32px; height: 32px; font-size: 11px; }
  .chapter-head { gap: 12px; }
  .p { font-size: 14.5px; text-align: left; }
  .ul li { font-size: 14px; }
  .mh-stats { gap: 18px; }
}

/* ============ 章节索引（模块首屏） ============ */
.sb-home {
  display: block;
  color: inherit;
  cursor: pointer;
  transition: color .18s;
}
.sb-home:hover, .sb-home.active { color: var(--blue-700); }
.toc-sub a.cur { color: var(--blue-700); font-weight: 600; }

.ch-index { padding-top: 34px; }
.ch-index-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.ch-index-head h2 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  color: var(--blue-900);
  margin: 0;
  letter-spacing: .02em;
}
.ch-index-head span { font-size: 12px; color: var(--ink-4); letter-spacing: .04em; }

.ch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.ch-card {
  position: relative;
  display: block;
  padding: 22px 22px 16px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  overflow: hidden;
}
.ch-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--blue-400), var(--blue-600));
  opacity: 0;
  transition: opacity .22s ease;
}
.ch-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--blue-200);
}
.ch-card:hover::before { opacity: 1; }
.cc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.cc-no {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--blue-700);
  background: var(--blue-050);
  border: 1px solid var(--blue-100);
  border-radius: 8px;
  padding: 4px 8px;
  line-height: 1;
}
.cc-tag {
  font-size: 11px;
  letter-spacing: .06em;
  color: #8A6A3B;
  background: var(--sand-soft);
  border-radius: 999px;
  padding: 3px 9px;
  line-height: 1.4;
}
.ch-card h3 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.42;
  color: var(--ink);
  margin: 0 0 8px;
  letter-spacing: .01em;
}
.ch-card p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--ink-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cc-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 11px;
  border-top: 1px dashed var(--line-soft);
  font-size: 11.5px;
  color: var(--ink-4);
  letter-spacing: .03em;
}
.cc-foot .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4); opacity: .5; }
.cc-go {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--blue-600);
  font-size: 12px;
}
.cc-go svg { width: 13px; height: 13px; transition: transform .22s ease; }
.ch-card:hover .cc-go svg { transform: translateX(3px); }

/* ============ 单章正文页 ============ */
.ch-view .chapter { padding-top: 24px; }
.ch-crumb {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}
.crumb-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-3);
  padding: 5px 10px 5px 6px;
  border-radius: 8px;
  margin-left: -6px;
  transition: all .18s;
}
.crumb-back:hover { background: var(--blue-050); color: var(--blue-700); }
.crumb-back svg { width: 13px; height: 13px; }
.crumb-pos {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--ink-4);
}

.ch-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 56px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.ch-nav-item {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  background: #fff;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.ch-nav-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--blue-200); }
.ch-nav-item.is-empty { border: none; background: transparent; pointer-events: none; box-shadow: none; }
.cn-label { display: block; font-size: 11px; letter-spacing: .1em; color: var(--ink-4); margin-bottom: 6px; }
.cn-title { display: block; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.cn-title b { font-family: var(--mono); font-size: 11px; font-weight: 400; color: var(--blue-500); margin-right: 8px; }
.ch-nav-item.next { text-align: right; }

@media (max-width: 980px) {
  .ch-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .ch-index { padding-top: 26px; }
  .ch-index-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .ch-card { padding: 18px 18px 14px; }
  .ch-card h3 { font-size: 17.5px; }
  .ch-nav { grid-template-columns: 1fr; margin-top: 40px; }
  .ch-nav-item.is-empty { display: none; }
}
