/* 微积分学习站 —— 样式 */
:root {
  --paper: #faf8f3;
  --paper-2: #f3efe6;
  --ink: #1b2126;
  --ink-2: #3d4750;
  --muted: #6f7883;
  --line: #e2dccd;
  --nav: #131e26;
  --nav-2: #1b2a34;
  --teal: #0d6e6e;
  --teal-soft: #e6f2f1;
  --red: #b93a2b;
  --blue: #2b4c9b;
  --amber: #a56712;
  --green: #1f6b4a;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(27, 33, 38, .05), 0 8px 24px -12px rgba(27, 33, 38, .18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 24px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", -apple-system, "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15.5px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 侧边栏 ---------- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 268px;
  background: var(--nav);
  color: #c3ced8;
  padding: 22px 0 16px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 40;
  border-right: 1px solid #0b141a;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 20px 18px;
  color: #fff;
  text-decoration: none;
}
.brand-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: linear-gradient(150deg, #167d7d, #0c4f52);
  font-family: "Cambria Math", Georgia, serif;
  font-size: 24px;
  color: #eafcf8;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}
.brand-text b { display: block; font-size: 16px; letter-spacing: .06em; line-height: 1.3; }
.brand-text small { display: block; font-size: 10.5px; letter-spacing: .16em; color: #7f929f; text-transform: uppercase; }

.searchbox { position: relative; padding: 0 16px 14px; }
.searchbox input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid #2b3b46;
  background: #0d171d;
  color: #e8eef2;
  font-size: 13px;
  outline: none;
  transition: border-color .15s;
}
.searchbox input::placeholder { color: #6c7c88; }
.searchbox input:focus { border-color: #2f7f7c; }

.qres {
  display: none;
  position: absolute;
  left: 16px; right: 16px; top: 46px;
  max-height: 60vh;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 18px 40px -18px rgba(0,0,0,.5);
  padding: 6px;
  z-index: 50;
}
.qres.on { display: block; }
.qres a {
  display: block;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.5;
}
.qres a:hover { background: var(--paper-2); }
.qres a small { display: block; color: var(--muted); font-size: 11.5px; }
.qres .none { padding: 10px; color: var(--muted); font-size: 13px; }

nav { flex: 1; }
.navgroup { padding: 4px 0 10px; }
.navlabel {
  padding: 8px 20px 6px;
  font-size: 10.5px;
  letter-spacing: .18em;
  color: #5f7180;
  text-transform: uppercase;
}
.navlink {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  color: #b7c4cf;
  text-decoration: none;
  font-size: 13.5px;
  border-left: 2px solid transparent;
  transition: background .12s, color .12s;
}
.navlink:hover { background: var(--nav-2); color: #fff; }
.navlink.active {
  background: linear-gradient(90deg, rgba(22,125,125,.28), rgba(22,125,125,0));
  border-left-color: #2f9a94;
  color: #fff;
  font-weight: 600;
}
.nb {
  margin-left: auto;
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 20px;
  background: #2a3a45;
  color: #9fb1bd;
  letter-spacing: .02em;
}
.nb.hot { background: #3a1d18; color: #e8a396; }
.nb.key { background: #1b2540; color: #9db2e6; }

.sidebar-foot {
  margin: 10px 16px 0;
  padding-top: 12px;
  border-top: 1px solid #24323c;
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: #63747f;
  letter-spacing: .04em;
}

/* ---------- 主体 ---------- */
main {
  margin-left: 268px;
  padding: 46px 54px 40px;
  max-width: 1080px;
}

.pagefoot {
  margin-top: 64px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

/* ---------- 页头 ---------- */
.crumbs {
  font-size: 11.5px;
  letter-spacing: .14em;
  color: var(--teal);
  text-transform: uppercase;
  margin-bottom: 10px;
}
h1 {
  font-family: Cambria, Georgia, "SimSun", serif;
  font-size: 33px;
  line-height: 1.3;
  letter-spacing: .01em;
  margin: 0 0 12px;
  font-weight: 600;
}
.lead {
  color: var(--ink-2);
  font-size: 15px;
  max-width: 62ch;
  margin: 0 0 16px;
}
.meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  background: var(--teal);
  color: #fff;
  font-size: 11.5px;
  letter-spacing: .04em;
}
.pill.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }

/* ---------- 本页目录 ---------- */
.pagetoc {
  margin: 26px 0 8px;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.toclabel {
  font-size: 10.5px;
  letter-spacing: .18em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.pagetoc ol { margin: 0; padding-left: 18px; columns: 2; column-gap: 28px; }
.pagetoc li { font-size: 13.5px; padding: 2px 0; break-inside: avoid; }
.pagetoc a { color: var(--ink-2); text-decoration: none; }
.pagetoc a:hover { color: var(--teal); text-decoration: underline; }

/* ---------- 正文 ---------- */
.prose { max-width: 74ch; }

.prose h2 {
  font-family: Cambria, Georgia, "SimSun", serif;
  font-size: 23px;
  font-weight: 600;
  margin: 46px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.prose h2::before {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  width: 46px; height: 2px;
  background: var(--teal);
}
.prose h3 {
  font-size: 16.5px;
  margin: 28px 0 8px;
  color: var(--ink);
}
.prose p { margin: 0 0 12px; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose li > ul { margin: 4px 0 2px; }
.prose strong { color: #101619; font-weight: 650; }
.prose a { color: var(--teal); text-underline-offset: 3px; }

.anchor {
  margin-left: 8px;
  color: var(--line);
  text-decoration: none;
  font-size: .7em;
  opacity: 0;
  transition: opacity .15s;
}
h2:hover .anchor { opacity: 1; color: var(--muted); }

blockquote {
  margin: 16px 0;
  padding: 10px 16px;
  border-left: 3px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-size: 14.5px;
}
blockquote p { margin: 4px 0; }

hr { border: 0; border-top: 1px solid var(--line); margin: 30px 0; }

code {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: .88em;
  background: #efeadd;
  padding: 1px 5px;
  border-radius: 4px;
}
pre {
  background: #16212a;
  color: #d7e3ec;
  padding: 14px 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 13px;
}
pre code { background: none; padding: 0; color: inherit; }

/* ---------- 表格 ---------- */
.tablewrap { overflow-x: auto; margin: 16px 0 20px; }
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
thead th {
  background: #efeade;
  text-align: left;
  font-weight: 650;
  font-size: 13px;
  letter-spacing: .03em;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td { padding: 9px 12px; border-bottom: 1px solid #f0ece1; vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: #fdfcf9; }

/* ---------- 提示框 ---------- */
.callout {
  margin: 18px 0;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--muted);
  border-radius: 8px;
  padding: 12px 16px 6px;
  box-shadow: var(--shadow);
}
.callout-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  letter-spacing: .06em;
  margin-bottom: 6px;
}
.callout-head .ico { font-size: 14px; }
.callout-head .label {
  font-weight: 700;
  letter-spacing: .12em;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 4px;
  color: #fff;
  background: var(--muted);
}
.callout-title { color: var(--ink); font-size: 14.5px; font-weight: 650; letter-spacing: 0; }
.callout-body > :last-child { margin-bottom: 10px; }

.callout.key { border-left-color: var(--blue); background: linear-gradient(180deg, #f7f9fe, #fff 90px); }
.callout.key .label { background: var(--blue); }
.callout.warn { border-left-color: var(--red); background: linear-gradient(180deg, #fdf6f4, #fff 90px); }
.callout.warn .label { background: var(--red); }
.callout.hot { border-left-color: #b8551f; background: linear-gradient(180deg, #fdf5ef, #fff 90px); }
.callout.hot .label { background: #b8551f; }
.callout.ex { border-left-color: var(--green); background: linear-gradient(180deg, #f5faf7, #fff 90px); }
.callout.ex .label { background: var(--green); }
.callout.tip { border-left-color: var(--teal); background: linear-gradient(180deg, #f4faf9, #fff 90px); }
.callout.tip .label { background: var(--teal); }
.callout.note .label { background: #5b6670; }

/* ---------- 数学 ---------- */
math {
  font-family: "Cambria Math", "STIX Two Math", "Latin Modern Math", "Times New Roman", serif;
  font-size: 1.06em;
}
math[display="block"] { font-size: 1.12em; }
.mathblock {
  margin: 16px 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0;
}
.mathblock math[display="block"] { margin: 0 auto; }
.math-fail { color: var(--red); background: #fdecea; }

/* ---------- 首页 ---------- */
.hero {
  display: flex;
  gap: 40px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 18px 0 40px;
  border-bottom: 1px solid var(--line);
}
.kicker {
  font-size: 11.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 12px;
}
.hero h1 { font-size: 38px; line-height: 1.32; margin-bottom: 16px; }
.hero-sub { color: var(--ink-2); max-width: 46ch; margin: 0 0 22px; }
.hero-actions { display: flex; gap: 10px; }
.btn {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-size: 13.5px;
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }

.hero-side {
  display: grid;
  grid-template-columns: repeat(2, 88px);
  gap: 10px;
  flex-shrink: 0;
}
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 8px;
  text-align: center;
}
.stat b { display: block; font-family: Cambria, Georgia, serif; font-size: 22px; color: var(--teal); line-height: 1.2; }
.stat span { font-size: 11px; color: var(--muted); letter-spacing: .06em; }

.sec-head { display: flex; align-items: baseline; gap: 14px; margin: 46px 0 18px; }
.sec-head h2 { font-family: Cambria, Georgia, "SimSun", serif; font-size: 22px; margin: 0; font-weight: 600; }
.sec-head p { margin: 0; color: var(--muted); font-size: 13px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 14px;
  text-decoration: none;
  color: inherit;
  transition: transform .14s, box-shadow .14s, border-color .14s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #cfc6b2; }
.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.num { font-family: Cambria, Georgia, serif; font-size: 13px; color: #b9b0a0; letter-spacing: .1em; }
.badge {
  font-size: 10.5px;
  padding: 1px 8px;
  border-radius: 20px;
  background: #eef0f4;
  color: var(--muted);
  letter-spacing: .04em;
}
.badge.hot { background: #fbeae5; color: var(--red); }
.badge.key { background: #eaeefb; color: var(--blue); }
.card h3 { margin: 0 0 6px; font-size: 16.5px; line-height: 1.45; }
.card p { margin: 0 0 12px; font-size: 13px; color: var(--ink-2); line-height: 1.7; flex: 1; }
.card-foot { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 11px; color: var(--muted); background: var(--paper-2); padding: 1px 7px; border-radius: 4px; }

.notice {
  margin: 46px 0 0;
  padding: 20px 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.notice h3 { margin: 0 0 8px; font-size: 15px; }
.notice p { margin: 0 0 8px; color: var(--ink-2); font-size: 14px; }

/* ---------- 进度条 ---------- */
.prog {
  margin: 30px 0 0;
  padding: 18px 22px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  border-radius: var(--radius);
}
.prog-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 10px;
}
.prog-label {
  font-size: 10.5px;
  letter-spacing: .18em;
  color: var(--muted);
  text-transform: uppercase;
  margin-right: 10px;
}
.prog-head b { font-size: 15px; }
.prog-page { color: var(--muted); font-size: 12.5px; margin-left: 6px; }
.prog-pct {
  font-family: Cambria, Georgia, serif;
  font-size: 26px;
  color: var(--teal);
  line-height: 1;
}
.prog .bar {
  height: 6px;
  background: #ece7da;
  border-radius: 6px;
  overflow: hidden;
}
.prog .bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #0d6e6e, #2f9a94);
  border-radius: 6px;
}
.prog-foot {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.prog-foot b {
  font-size: 10.5px;
  letter-spacing: .12em;
  color: var(--muted);
  margin-right: 8px;
  font-weight: 600;
}

/* ---------- 错题本 ---------- */
.chipbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 20px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-size: 12.5px;
  cursor: pointer;
  font-family: inherit;
}
.chip span { color: var(--muted); font-size: 11px; }
.chip:hover { border-color: #c8bfa9; }
.chip.on { background: var(--nav); border-color: var(--nav); color: #fff; }
.chip.on span { color: #9fb1bd; }

.mcards { display: flex; flex-direction: column; gap: 16px; }
.mcard {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.mcard > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  background: #f5f1e7;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 8px;
}
.mid { font-family: Cambria, Georgia, serif; color: var(--ink); font-size: 13px; margin-right: 10px; letter-spacing: .06em; }
.mchap { color: var(--teal); margin-right: 10px; }
.mbody { padding: 6px 18px 14px; }
.mfield { padding: 10px 0; border-bottom: 1px dashed #eee7d8; }
.mfield:last-child { border-bottom: 0; }
.mfield h4 {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
}
.mfield.wrong h4 { color: var(--red); }
.mfield.right h4 { color: var(--green); }
.reason {
  display: inline-block;
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 4px;
  background: var(--red);
  color: #fff;
  margin-right: 6px;
}
.mcard[data-reason] { }
.mcard.hide { display: none; }

.empty {
  padding: 26px;
  border: 1px dashed #d8d0bf;
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink-2);
}
.empty b { display: block; margin-bottom: 6px; }
.empty p { margin: 0; font-size: 14px; }

/* ---------- 题库 ---------- */
.muted { color: var(--muted); font-size: 13px; }

.plinks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.plinks li {
  display: flex; gap: 10px; align-items: baseline;
  padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px;
}
.pid { font-family: Cambria, Georgia, serif; font-size: 12px; color: var(--muted); letter-spacing: .06em; flex: 0 0 auto; }
.ptext { color: inherit; text-decoration: none; flex: 1; }
.ptext:hover { color: var(--teal); }
.ptype { font-size: 11px; color: var(--muted); background: var(--paper-2); padding: 1px 7px; border-radius: 4px; flex: 0 0 auto; }

.pcards { display: flex; flex-direction: column; gap: 14px; }
.pcard {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px 12px;
}
.pcard > header {
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
  font-size: 12px; color: var(--muted); margin-bottom: 8px; flex-wrap: wrap;
}
.ph-left { display: flex; gap: 10px; align-items: center; }
.stars { color: #c58a2c; letter-spacing: 2px; font-size: 11px; }
.pstem { font-size: 15px; }
.psol { margin-top: 10px; border-top: 1px dashed #eee7d8; padding-top: 8px; }
.psol summary { cursor: pointer; font-size: 13px; color: var(--teal); }
.psol summary:hover { text-decoration: underline; }
.psol[open] summary { margin-bottom: 6px; }
.psolbody p { margin: 6px 0; }
.pnote {
  margin-top: 10px; font-size: 13px; color: var(--ink-2);
  background: var(--paper-2); border-radius: 8px; padding: 8px 12px;
}
.pnote b { font-size: 10.5px; letter-spacing: .14em; color: var(--muted); margin-right: 8px; }
.pfoot {
  display: flex; justify-content: space-between; gap: 12px; margin-top: 10px;
  font-size: 12px; color: var(--muted); flex-wrap: wrap;
}
.pfoot a { color: var(--teal); }
.chipbar.sub { margin-top: -8px; }
.chip.redo { margin-left: auto; border-color: #c8bfa9; color: var(--teal); }
.chip.redo.on { background: var(--teal); color: #fff; border-color: var(--teal); }
body.redo .psol,
body.redo .pnote { display: none; }

/* ---------- 作业批改 ---------- */
.week { margin: 30px 0 10px; }
.week-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 20px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.week-head h2 { margin: 0 0 4px; font-size: 22px; font-family: Cambria, Georgia, "SimSun", serif; font-weight: 600; }
.wdate { font-size: 12px; color: var(--muted); margin-left: 10px; font-family: inherit; font-weight: 400; }
.week-head p { margin: 0; font-size: 13px; color: var(--muted); }
.week-stat { text-align: right; }
.week-stat b { font-family: Cambria, Georgia, serif; font-size: 30px; color: var(--teal); line-height: 1; }
.week-stat b small { font-size: 15px; color: var(--muted); }
.week-stat span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.bar.thin { height: 4px; margin: 10px 0 6px; background: #ece7da; border-radius: 4px; overflow: hidden; }
.bar.thin i { display: block; height: 100%; background: linear-gradient(90deg, #0d6e6e, #2f9a94); }
.week-note { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }

.hwcards { display: flex; flex-direction: column; gap: 12px; }
.hwcard {
  background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--line);
  border-radius: var(--radius); padding: 13px 18px 12px;
}
.hwcard.ok { border-left-color: #2f8f62; }
.hwcard.half { border-left-color: #c58a2c; }
.hwcard.no { border-left-color: var(--red); }
.hwcard > header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 12px; }
.hno { font-family: Cambria, Georgia, serif; letter-spacing: .04em; color: var(--ink-2); }
.hmark { font-weight: 700; font-size: 14px; width: 18px; text-align: center; }
.hwcard.ok .hmark { color: #2f8f62; }
.hwcard.half .hmark { color: #c58a2c; }
.hwcard.no .hmark { color: var(--red); }
.hlabel { font-size: 10.5px; letter-spacing: .1em; color: #fff; padding: 1px 8px; border-radius: 20px; background: #2f8f62; }
.hwcard.half .hlabel { background: #c58a2c; }
.hwcard.no .hlabel { background: var(--red); }
.hstem { font-size: 15px; margin-bottom: 10px; }
.hmine, .hcomment, .hfix, .hwhy { font-size: 13.5px; color: var(--ink-2); margin: 8px 0; line-height: 1.75; }
.hmine b, .hcomment b, .hfix b, .hwhy b {
  font-size: 10.5px; letter-spacing: .14em; color: var(--muted);
  margin-right: 8px; font-weight: 600;
}
.hmine { background: #f7f5ef; border-radius: 8px; padding: 8px 12px; }
.hfix { background: #f2f8f4; border-radius: 8px; padding: 8px 12px; }
.hfix b { color: #1f6b4a; }
.hwhy { background: #fdf3f1; border-radius: 8px; padding: 8px 12px; }
.hwhy b { color: var(--red); }
.hcomment { padding-left: 2px; }

/* ---------- 试卷 ---------- */
.block { margin: 34px 0 8px; }
.paper { margin: 40px 0 10px; }
.paper-head { border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 16px; }
.paper-head h2 {
  margin: 0 0 4px; font-size: 21px;
  font-family: Cambria, Georgia, "SimSun", serif; font-weight: 600;
}
.paper-head p { margin: 0; font-size: 13px; color: var(--muted); }
table.stat { max-width: 640px; }
table.stat td.num { text-align: right; font-family: Cambria, Georgia, serif; }
tr.done td { background: #f3f8f6; }
.tablewrap td a { color: var(--teal); }
.pcard .ph-left .tag { background: #eef0f4; }

/* ---------- 响应式 ---------- */
.navbtn {
  display: none;
  position: fixed;
  top: 14px; left: 14px;
  z-index: 60;
  width: 38px; height: 38px;
  border-radius: 8px;
  background: var(--nav);
  color: #fff;
  place-items: center;
  font-size: 18px;
  cursor: pointer;
}

@media (max-width: 960px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: 30px 0 60px -30px rgba(0,0,0,.5);
  }
  #navtoggle:checked ~ .sidebar { transform: translateX(0); }
  .navbtn { display: grid; }
  main { margin-left: 0; padding: 64px 20px 30px; }
  .hero { flex-direction: column; align-items: stretch; gap: 24px; }
  .hero h1 { font-size: 29px; }
  .pagetoc ol { columns: 1; }
}

/* ---------- 响应式：抽屉 ---------- */
.navscrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(12, 20, 26, .48);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

@media (max-width: 960px) {
  .sidebar { width: min(82vw, 320px); }
  .navscrim { display: block; }
  #navtoggle:checked ~ .navscrim { opacity: 1; pointer-events: auto; }
  .navlink { padding: 11px 20px; font-size: 14px; }
  .searchbox input[type="search"] { font-size: 16px; }
}

/* ---------- 响应式：手机 ---------- */
@media (max-width: 640px) {
  html { -webkit-text-size-adjust: 100%; }
  body { font-size: 15px; line-height: 1.78; overflow-x: hidden; }

  .navbtn {
    top: calc(10px + env(safe-area-inset-top));
    left: 12px;
    width: 42px; height: 42px;
    font-size: 19px;
  }

  main {
    padding: calc(58px + env(safe-area-inset-top)) 15px calc(26px + env(safe-area-inset-bottom));
    max-width: none;
  }

  h1 { font-size: 25px; line-height: 1.36; margin-bottom: 10px; }
  .hero { padding: 6px 0 26px; gap: 20px; }
  .hero h1 { font-size: 24px; }
  .hero-sub { font-size: 14px; margin-bottom: 16px; }
  .hero-actions { flex-wrap: wrap; }
  .hero-actions .btn { flex: 1 1 100%; text-align: center; }
  .hero-side { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .stat { padding: 8px 4px; }
  .stat b { font-size: 18px; }
  .stat span { font-size: 10px; letter-spacing: 0; }

  .prose { max-width: none; }
  .prose h2 { font-size: 20px; margin: 34px 0 12px; }
  .prose h3 { font-size: 15.5px; margin: 22px 0 6px; }
  .prose p, .prose li { overflow-wrap: anywhere; }

  .pagetoc { padding: 12px 14px; margin: 20px 0 6px; }
  .pagetoc li { font-size: 13px; }

  .cards { grid-template-columns: 1fr; gap: 12px; }
  .card { padding: 14px 15px 12px; }
  .card h3 { font-size: 15.5px; }
  .sec-head { margin: 34px 0 14px; flex-wrap: wrap; gap: 6px; }

  .tablewrap { -webkit-overflow-scrolling: touch; box-shadow: inset -14px 0 14px -14px rgba(27,33,38,.35); }
  table { font-size: 13px; }
  /* 三列以上的表不再压缩，改为横向滚动 */
  .tablewrap table.wide { min-width: 0; }
  math[display="block"] { display: block; width: 100%; max-width: 100%; overflow-x: auto; overflow-y: hidden; }
  math { font-size: 0.9em; }
  thead th { padding: 7px 9px; font-size: 12px; }
  tbody td { padding: 7px 9px; }

  .mathblock { margin: 12px 0; }

  .callout { padding: 10px 12px 4px; }
  .callout-head { flex-wrap: wrap; }

  .chipbar { gap: 7px; margin: 18px 0 14px; }
  .chip { min-height: 40px; padding: 7px 13px; font-size: 13px; }
  .chip.redo { margin-left: 0; }

  .psol summary { min-height: 44px; display: flex; align-items: center; }
  .pcard { padding: 12px 14px 10px; }
  .hwcard { padding: 12px 14px 10px; }
  .mcard > header { padding: 10px 14px; }
  .mbody { padding: 4px 14px 12px; }

  .week-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .week-stat { text-align: left; }
  .week-stat b { font-size: 24px; }

  .prog { padding: 14px 15px; }
  .prog-head { flex-wrap: wrap; gap: 6px; }
  .prog-pct { font-size: 22px; }
  .prog-foot { gap: 10px 18px; font-size: 12px; }

  .notice { padding: 16px; margin-top: 30px; }
  .pagefoot { flex-direction: column; gap: 4px; margin-top: 40px; }
  table.stat { max-width: none; }
}

/* ---------- 打印 ---------- */
@media print {
  .sidebar, .navbtn, .pagefoot, .qres, .pagetoc { display: none !important; }
  main { margin: 0; padding: 0; max-width: none; }
  body { font-size: 11pt; background: #fff; }
  .callout, .card, .mcard { box-shadow: none; break-inside: avoid; }
  .prose h2 { break-after: avoid; }
}

/* ===================== 主题 v2：纸面 · 宋体 · 赭石 ===================== */
:root{
  --paper:#faf9f7; --paper-2:#f3f0e9; --ink:#1c1c1c; --ink-2:#3a3a3a;
  --muted:#6b6b6b; --line:#e6e2da;
  --teal:#b5651d; --teal-soft:#f7ede1;
  --amber:#a25a12; --green:#3f6b3a; --red:#a8392a; --blue:#2f4f7f;
  --nav:#fcfbf8; --nav-2:#f2ede3;
  --radius:10px;
  --shadow:0 0 0 1px rgba(28,28,28,.02);
}
body{
  font-family:"Songti SC","SimSun","Noto Serif SC",Georgia,serif;
  font-size:16px; line-height:1.82; color:var(--ink); background:var(--paper);
}
h1,h2,h3,h4,.brand-text b{ font-family:"Songti SC","SimSun",Georgia,serif; letter-spacing:0; }
.sidebar{ background:#fcfbf8; color:#4a423a; border-right:1px solid var(--line); }
.brand-mark{ background:var(--teal) !important; color:#fff !important; }
.brand-text b{ color:#2a241e; }
.brand-text small{ color:#a2968a; }
.searchbox input{ background:#fff; border:1px solid var(--line); color:#2a241e; }
.searchbox input::placeholder{ color:#a89c8e; }
.searchbox input:focus{ border-color:var(--teal); }
.navlabel{ color:#a89c88; letter-spacing:.12em; }
.navlink{ color:#4a423a; border-radius:8px; }
.navlink:hover{ background:#f2ede3; color:#1c1c1c; }
.navlink.active{ background:#f7ede1; color:#8a4b12; font-weight:600; }
.nb{ background:#efe8db; color:#7a6a55; }
.nb.hot{ background:#f6e2dc; color:#a8392a; }
.nb.key{ background:#e6e9f2; color:#2f4f7f; }
.sidebar-foot{ color:#a89c88; border-top:1px solid var(--line); }
.qres a{ color:#3a3a3a; }
.qres a:hover{ background:#f2ede3; }
main{ padding-top:40px; }
h1{ font-size:32px; font-weight:600; }
.crumbs{ color:#a2968a; letter-spacing:.14em; font-size:11.5px; }
.lead{ color:#4d4d4d; }
.pill{ background:#f2ede3; color:#6b5b45; }
.pill.ghost{ background:transparent; }
.prose h2{ border:0; font-size:23px; margin:42px 0 14px; padding-left:14px; position:relative; }
.prose h2::before{ content:""; position:absolute; left:0; top:.35em; bottom:.35em; width:3px; background:var(--teal); border-radius:2px; }
.prose h3{ font-size:16.5px; color:#2a241e; margin:26px 0 8px; }
.prose strong{ color:#111; }
.prose a{ color:var(--teal); }
.card,.pcard,.hwcard,.week,.paper{ background:#fff; border:1px solid var(--line); box-shadow:none; border-radius:10px; }
.pagetoc{ background:#fff; border:1px solid var(--line); border-radius:10px; }
.callout{ background:#fbf8f2 !important; border-color:#efe6d6 !important; }
.callout[data-tag="warn"]{ background:#fdf5f3 !important; border-color:#f0dcd6 !important; }
.callout[data-tag="key"]{ background:#f6f4fb !important; border-color:#e4e0f0 !important; }
thead th{ background:#f6f2ea; }
table{ font-family:"Songti SC","SimSun",Georgia,serif; }
.week-stat b,.stat b{ font-family:"Songti SC","SimSun",Georgia,serif; color:var(--teal); }
.btn{ background:#fff; border:1px solid #dcd3c4; color:#6b5b45; }
.btn:hover{ background:#f7ede1; border-color:var(--teal); color:#8a4b12; }
.chip{ background:#fff; border:1px solid var(--line); color:#5f5f5f; }
.chip.on{ background:var(--teal); border-color:var(--teal); color:#fff; }
.bar i{ background:var(--teal); }

/* 小测题卡 */
.qopts{ display:grid; grid-template-columns:1fr 1fr; gap:6px 14px; margin:12px 0 10px; }
.qopt{ display:flex; gap:8px; align-items:baseline; padding:7px 12px; border:1px solid var(--line);
  border-radius:8px; background:#fdfcfa; font-size:15px; }
.qopt b{ font-family:"Heiti SC","Microsoft YaHei",sans-serif; font-size:12px; color:#a2968a; min-width:12px; }
.qopt.hit{ background:#f1f7f0; border-color:#cfe3ca; }
.qopt.miss{ background:#fdf3f1; border-color:#eed6d0; }
.qans{ display:flex; gap:22px; margin:6px 0 10px; font-size:13.5px; color:#6b6b6b;
  font-family:"Heiti SC","Microsoft YaHei",sans-serif; }
.qans b{ font-size:15px; color:#1c1c1c; letter-spacing:.06em; }
.qans .qc b{ color:var(--teal); }
.quiznote{ color:#7a6a55; font-size:13.5px; background:#fbf8f2; border:1px solid #efe6d6;
  border-radius:8px; padding:10px 14px; }
@media (max-width:640px){ .qopts{ grid-template-columns:1fr; } }

/* 折叠式小节（参考 ansy 交互版） */
.secbar{ display:flex; justify-content:flex-end; margin:8px 0 0; }
.btn-sm{ font-size:12.5px; padding:5px 14px; border-radius:999px; }
.secdet{ border-top:1px solid var(--line); }
.secdet:last-of-type{ border-bottom:1px solid var(--line); }
.secdet>summary{ display:flex; align-items:baseline; gap:14px; padding:17px 6px 17px 18px;
  cursor:pointer; list-style:none; position:relative; }
.secdet>summary::-webkit-details-marker{ display:none; }
.secdet>summary::before{ content:""; position:absolute; left:0; top:15px; bottom:15px; width:1px; background:var(--line); }
.secdet[open]>summary::before{ background:var(--teal); }
.secdet>summary::after{ content:"›"; margin-left:10px; color:#b3a897; font-size:16px;
  transform:rotate(90deg); transition:transform .18s ease; }
.secdet[open]>summary::after{ transform:rotate(-90deg); color:var(--teal); }
.secno{ font-family:"Heiti SC","Microsoft YaHei",sans-serif; font-size:11px; color:#b3a897;
  letter-spacing:.16em; min-width:22px; }
.secttl{ font-size:17.5px; color:#2a241e; }
.secdet[open] .secttl{ color:var(--teal); }
.seccnt{ margin-left:auto; font-size:12.5px; color:#a89c88; font-family:"Heiti SC","Microsoft YaHei",sans-serif; }
.secbody{ padding:2px 0 30px 18px; }
@media (max-width:640px){ .secdet>summary{ gap:8px; padding:14px 4px 14px 12px; }
  .secbody{ padding-left:12px; } .seccnt{ display:none; } }

.secbody>h2:first-child{ display:none; }  /* 标题已在 summary 中，标题元素保留给检索 */

.qopts.one{ grid-template-columns:1fr; }


/* 教材导读 */
.rchap{ margin:44px 0 0; }
.rchaphead{ display:flex; align-items:baseline; gap:16px; padding:0 0 6px 14px;
  border-left:3px solid var(--teal); margin-bottom:6px; }
.rchapno{ font-family:"Heiti SC","Microsoft YaHei",sans-serif; font-size:11px; letter-spacing:.18em; color:#a89c88; }
.rchaptitle{ font-size:22px; color:#2a241e; }
.rsec>summary{ align-items:baseline; flex-wrap:wrap; }
.rfrom{ font-size:12.5px; color:#a89c88; font-family:"Heiti SC","Microsoft YaHei",sans-serif; }
.rbody{ padding-top:10px; }
.rgroup{ border:1px solid var(--line); border-radius:10px; background:#fff;
  padding:4px 22px 16px; margin:0 0 14px; }
.rgroup>h4{ margin:14px 0 10px; font-size:13px; letter-spacing:.14em; color:#a2968a;
  font-family:"Heiti SC","Microsoft YaHei",sans-serif; font-weight:400; }
.ritem{ padding:2px 0 10px; }
.ritem+.ritem{ border-top:1px dashed var(--line); padding-top:14px; }
.rlabel{ font-size:13.5px; color:#8a4b12; margin-bottom:6px; font-weight:600; }
.rtext{ font-size:15.5px; line-height:1.95; color:#262626; }
.rtext p{ margin:0 0 10px; }
.rmath{ margin:12px 0; overflow-x:auto; text-align:center; }
.ritem.flash{ background:#f7ede1; transition:background .3s; }
.qref{ position:fixed; right:22px; bottom:22px; z-index:40; border:1px solid var(--line);
  background:#fff; color:#6b5b45; border-radius:999px; padding:9px 16px; font-size:13px;
  box-shadow:0 2px 10px rgba(0,0,0,.06); cursor:pointer; }
.qref:hover{ border-color:var(--teal); color:#8a4b12; }
.qrefpanel{ position:fixed; right:22px; bottom:70px; width:320px; max-height:60vh; overflow:auto;
  background:#fff; border:1px solid var(--line); border-radius:12px; padding:14px 16px;
  box-shadow:0 10px 30px rgba(0,0,0,.1); display:none; z-index:41; }
.qrefpanel.on{ display:block; }
.qrefpanel h5{ margin:0 0 10px; font-size:12px; letter-spacing:.14em; color:#a2968a;
  font-family:"Heiti SC","Microsoft YaHei",sans-serif; font-weight:400; }
.qrefpanel a{ display:block; padding:7px 0; border-bottom:1px dashed var(--line); font-size:13.5px;
  color:#3a3a3a; text-decoration:none; }
.qrefpanel a:hover{ color:var(--teal); }
@media (max-width:640px){ .qref{ right:12px; bottom:12px; padding:8px 13px; }
  .qrefpanel{ right:12px; left:12px; width:auto; } .rgroup{ padding:4px 14px 14px; } }

/* 统一题库 */
.bank{ list-style:none; margin:0; padding:0; }
.bkrow{ position:relative; padding:12px 14px; border-bottom:1px solid var(--line); }
.bkrow:hover{ background:#fcfaf6; }
.bkrow.bad{ background:#fdf7f2; }
.bkrow .bsrc{ display:inline-block; font-size:11px; padding:1px 7px; border:1px solid var(--line);
  border-radius:999px; color:#6b6157; margin-right:8px; vertical-align:2px; }
.bkrow .bno{ font-size:12px; color:var(--accent); text-decoration:none; margin-right:10px; }
.bkrow .bstem{ margin-top:6px; font-size:15px; line-height:1.75; }
.bkrow .bnote{ margin-top:6px; font-size:13px; color:#7a7266; }
.bkrow .bsol{ margin-top:8px; }
.bkrow .bsol summary{ cursor:pointer; font-size:13px; color:var(--accent); }
.banksearch{ margin:10px 0 4px; }
.banksearch input{ width:100%; max-width:420px; padding:9px 12px; font-size:14px;
  border:1px solid var(--line); border-radius:8px; background:#fff; }

/* 已掌握勾选 */
.kd{ float:right; font-size:12px; color:#7a7266; display:flex; align-items:center; gap:5px;
  margin-left:12px; cursor:pointer; }
.kd input{ width:15px; height:15px; accent-color:var(--accent); }

.mkbar{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin:14px 0 10px; }
.mkstat{ font-size:13px; color:#6b6157; }
.mkstat b{ color:var(--accent); font-size:16px; }
.mkcard{ background:#fff; border:1px solid var(--line); border-radius:10px; padding:16px 18px; margin:14px 0; }
.mkcard.done{ opacity:.62; }
.mkhead{ display:flex; align-items:center; gap:10px; font-size:12px; color:#8a8175; }
.mkhead .src{ padding:1px 8px; border:1px solid var(--line); border-radius:999px; }
.mkhead .no{ color:var(--accent); font-weight:600; font-size:13px; }
.mkhead .done-lab{ margin-left:auto; font-size:12px; color:#6b6157; display:flex; gap:5px; align-items:center; }
.mkhead .done-lab input{ width:15px; height:15px; accent-color:var(--accent); }
.mksec{ margin-top:12px; }
.mksec h5{ margin:0 0 4px; font-size:12px; font-weight:600; color:#8a8175; letter-spacing:.04em; }
.mksec .body{ font-size:15px; line-height:1.8; }
.mksec.mine .body{ background:#fbf6f1; border-radius:6px; padding:8px 10px; }
.mksec.ok .body{ background:#f4f8f4; border-radius:6px; padding:8px 10px; }
.mksec.why .body{ color:#8a4b12; }

/* ---------- 错题卡 v2：紧凑两段式 ---------- */
.mkcard{ background:#fff; border:1px solid var(--line); border-radius:8px; padding:16px 18px 14px; margin:0 0 14px; }
.mkhead{ display:flex; align-items:center; gap:10px; margin:0 0 10px; }
.mkno{ font-family:var(--mono, ui-monospace, monospace); font-size:12px; letter-spacing:.05em; color:#8a4b12; font-weight:600; }
.mktags{ display:flex; gap:6px; flex-wrap:wrap; }
.mktag{ font-size:11.5px; line-height:1.6; color:#7a6a55; background:#f6f1e9; border-radius:999px; padding:1px 8px; }
.mkdone{ margin-left:auto; display:flex; align-items:center; gap:5px; font-size:12px; color:#8a7a66; cursor:pointer; }
.mkdone input{ width:14px; height:14px; accent-color:#b5651d; }
.mkq{ font-size:15px; line-height:1.8; color:#1c1c1c; margin:0 0 11px; }
.mkq .mathblock, .mkq math{ display:inline; }
.mkcmp{ border:1px solid #ece7df; border-radius:6px; overflow:hidden; margin:0 0 4px; }
.mkrow{ display:flex; gap:9px; padding:10px 13px; align-items:flex-start; }
.mkrow.bad{ background:#fdf7f6; }
.mkrow.good{ background:#f5f9f4; border-top:1px dashed #e4ded4; }
.mkico{ flex:0 0 14px; text-align:center; font-size:12px; line-height:1.9; }
.mkrow.bad .mkico{ color:#b3432b; }
.mkrow.good .mkico{ color:#3d7a4f; }
.mkttl{ flex:0 0 62px; font-size:12px; color:#8a7a66; line-height:1.9; white-space:nowrap; }
.mkbody{ flex:1; font-size:14px; line-height:1.8; color:#2a2a2a; min-width:0; }
.mksec{ font-size:14px; line-height:1.8; color:#2a2a2a; margin:10px 0 0; }
.mkb{ display:inline-block; font-size:11.5px; color:#8a4b12; background:#f7ede1; border-radius:3px; padding:0 6px; margin-right:8px; line-height:1.9; }
.mksim{ font-size:13.5px; line-height:1.8; color:#4a423a; margin:10px 0 0; padding-top:9px; border-top:1px dashed #ece7df; }
.mkcard.done{ opacity:.5; }
@media (max-width:640px){
  .mkcard{ padding:13px 13px 12px; }
  .mkrow{ flex-wrap:wrap; }
  .mkttl{ flex:0 0 auto; }
  .mkbody{ flex:1 1 100%; }
}

/* 原题行里的公式：强制行内，避免被撑成整行 */
.mkq math{ display:inline-block; width:auto; max-width:100%; vertical-align:baseline; }
.mkq .mathblock{ display:inline-block; width:auto; margin:0; vertical-align:baseline; }

/* ---------- 错题卡 v3：色块分区 ---------- */
.mkcard{ background:#fff; border:1px solid var(--line); border-radius:8px; padding:0; margin:0 0 16px; overflow:hidden; }
.mkhead{ display:flex; align-items:center; gap:10px; padding:10px 16px; background:#faf7f2; border-bottom:1px solid #efe9df; }
.mkno{ font-size:12px; letter-spacing:.05em; color:#8a4b12; font-weight:600; }
.mktags{ display:flex; gap:6px; flex-wrap:wrap; }
.mktag{ font-size:11.5px; line-height:1.7; color:#7a6a55; background:#fff; border:1px solid #ece4d6; border-radius:999px; padding:1px 8px; }
.mkdone{ margin-left:auto; display:flex; align-items:center; gap:5px; font-size:12px; color:#8a7a66; cursor:pointer; }
.mkdone input{ width:14px; height:14px; accent-color:#b5651d; }
.mkq{ font-size:15px; line-height:1.85; color:#1c1c1c; padding:14px 16px 12px; background:#fffdf9; border-bottom:1px solid #f2ece2; }
.mkcmp{ margin:0; }
.mkrow{ display:flex; gap:9px; padding:11px 16px; align-items:flex-start; }
.mkrow.bad{ background:#fdf4f2; border-bottom:1px solid #f6e4e0; }
.mkrow.good{ background:#f2f8f1; }
.mkico{ flex:0 0 14px; text-align:center; font-size:12px; line-height:1.95; }
.mkrow.bad .mkico{ color:#b3432b; }
.mkrow.good .mkico{ color:#3d7a4f; }
.mkttl{ flex:0 0 64px; font-size:12px; line-height:1.95; white-space:nowrap; }
.mkrow.bad .mkttl{ color:#a4584a; }
.mkrow.good .mkttl{ color:#4b7a58; }
.mkbody{ flex:1; font-size:14px; line-height:1.85; color:#2a2a2a; min-width:0; }
.mksec{ font-size:14px; line-height:1.85; color:#2a2a2a; padding:11px 16px; }
.mksec.why{ background:#fdf9ee; border-top:1px solid #f3ead2; }
.mksec.note{ background:#f4f6fa; border-top:1px solid #e6eaf2; }
.mkb{ display:inline-block; font-size:11.5px; border-radius:3px; padding:0 6px; margin-right:8px; line-height:1.9; }
.mksec .mkb{ color:#8a4b12; background:#f6e8d6; }
.mksec.why .mkb{ color:#8a6a12; background:#f6ecc8; }
.mksec.note .mkb{ color:#3d5673; background:#e2e9f4; }
.mksim{ font-size:13.5px; line-height:1.85; color:#4a423a; padding:11px 16px; background:#f7f6f3; border-top:1px solid #ece7df; }
.mksim .mkb{ color:#5f574c; background:#e9e4da; }
.mkcard.done{ opacity:.5; }
.mkq math{ display:inline-block; width:auto; max-width:100%; vertical-align:baseline; }
@media (max-width:640px){
  .mkrow{ flex-wrap:wrap; padding:10px 13px; }
  .mkttl{ flex:0 0 auto; }
  .mkbody{ flex:1 1 100%; }
  .mkq,.mksec,.mksim{ padding-left:13px; padding-right:13px; }
}

/* 导读：节标题（§x 函数） */
.rsecgrp{ margin:0 0 6px; }
.rsechd{ font-size:12.5px; font-weight:400; letter-spacing:.06em; color:#8a7a66;
  margin:18px 0 4px; padding:0 0 6px; border-bottom:1px solid #efe9df; }
.rsechd span{ display:inline-block; margin-right:8px; color:#b5651d; font-weight:600; }

/* 导读：知识分组折叠卡片 */
.rgrp{ background:#fff; border:1px solid #ece7df; border-radius:8px; margin:10px 0; overflow:hidden; }
.rgrp summary{ display:flex; align-items:center; gap:10px; padding:11px 16px; cursor:pointer;
  list-style:none; font-size:13.5px; color:#4a423a; }
.rgrp summary::-webkit-details-marker{ display:none; }
.rgname{ flex:1; }
.rgplus{ font-size:15px; color:#b5651d; line-height:1; }
.rgrp[open] .rgplus{ transform:rotate(45deg); }
.rgrp[open] summary{ border-bottom:1px dashed #ece7df; background:#fcfaf6; }
.rgbody{ padding:4px 16px 10px; }
.rex{ background:#fdf9f0; border:1px solid #f0e5cf; border-radius:8px; margin:12px 0 4px; padding:0 16px 8px; }
.rex h4{ font-size:12.5px; font-weight:400; color:#8a6a35; margin:10px 0 6px; letter-spacing:.04em; }

/* 导读：章节目录栏 */
.rgrid{ display:grid; grid-template-columns:minmax(0,1fr) 190px; gap:30px; align-items:start; }
.rtoc{ position:sticky; top:24px; font-size:12.5px; line-height:1.5; padding-top:6px;
  border-left:1px solid #efe9df; padding-left:16px; max-height:calc(100vh - 60px); overflow:auto; }
.rtoc-h{ font-size:11.5px; letter-spacing:.1em; color:#a99b86; margin:0 0 10px; }
.rtoc-ch{ color:#8a7a66; font-size:12px; margin:14px 0 6px; letter-spacing:.03em; }
.rtoc-ch:first-of-type{ margin-top:0; }
.rtoc-sec{ display:block; color:#4a423a; text-decoration:none; padding:3px 0 3px 8px;
  border-left:2px solid transparent; margin-left:-10px; }
.rtoc-sec b{ font-weight:400; color:#b5651d; margin-right:5px; }
.rtoc-sec:hover{ color:#8a4b12; border-left-color:#e6c9a8; }
@media (max-width:1080px){ .rgrid{ grid-template-columns:1fr; } .rtoc{ display:none; } }

/* 导读：例题行（星级 + 题型 + 考点） */
.rex{ background:#fdf9f0; border:1px solid #f0e5cf; border-radius:8px; margin:12px 0 4px; padding:8px 12px 10px; }
.rex h4{ font-size:12.5px; font-weight:400; color:#8a6a35; margin:6px 0 8px; letter-spacing:.04em; }
.rexrow{ border-top:1px dashed #eee0c6; }
.rexrow:first-of-type{ border-top:0; }
.rexrow summary{ display:flex; align-items:center; gap:10px; padding:9px 4px; cursor:pointer;
  list-style:none; font-size:13px; color:#4a423a; }
.rexrow summary::-webkit-details-marker{ display:none; }
.rexno{ color:#8a4b12; }
.rexstars{ color:#c98a2b; letter-spacing:1px; font-size:11.5px; }
.rextype{ font-size:11.5px; color:#7a6a55; background:#fff; border:1px solid #ece4d6;
  border-radius:999px; padding:0 8px; line-height:1.8; }
.rextopic{ color:#6b6157; font-size:12px; }
.rexmore{ margin-left:auto; font-size:11.5px; color:#a99b86; }
.rexrow[open] .rexmore{ color:#b5651d; }
.rexbody{ padding:4px 4px 10px; }
.rexbody h5{ font-size:13px; font-weight:400; color:#2a2a2a; margin:6px 0 8px; }
.rtoc-sec.on{ color:#8a4b12; border-left-color:#b5651d; background:#fbf5ec; }
.rtoc-sec.on b{ color:#8a4b12; }
.rtodo{ border:1px dashed var(--line); border-radius:10px; margin:10px 0; background:#fcfbf8; }
.rtodohead{ display:flex; align-items:center; gap:10px; padding:12px 14px; color:#9a9086; }
.rtodohead .secttl{ color:#6b6157; }
.rtodobadge{ margin-left:auto; font-size:12px; color:#8a6a45; background:#f7ecdd; border-radius:999px; padding:2px 10px; }

/* 分组级「已掌握」 */
.rgrp summary .kdb{ margin-left:auto; }
.kdb{ display:inline-flex; align-items:center; gap:6px; font-size:12.5px; color:#8a8076;
      cursor:pointer; user-select:none; white-space:nowrap; }
.kdb input{ width:15px; height:15px; accent-color:#b5651d; margin:0; cursor:pointer; }
.kdb input:checked + span{ color:#8a4b12; }
.rgroup.rex h4{ display:flex; align-items:center; gap:10px; }
.rgroup.rex h4 .kdb{ margin-left:auto; font-weight:400; }

/* 导读目录：右侧固定，窄屏折叠到顶部 */
.rtoc{ position:sticky; top:84px; align-self:start; max-height:calc(100vh - 110px); overflow:auto; }
.rtoc-sec{ display:block; padding:5px 8px 5px 10px; border-left:2px solid transparent;
           border-radius:0 6px 6px 0; color:#6b6157; text-decoration:none; }
.rtoc-sec b{ display:inline-block; min-width:22px; color:#a4978a; font-weight:400; }
.rtoc-sec:hover{ background:#f7f3ec; }
.rtoc-sec.on{ background:#f7ede1; border-left-color:#b5651d; color:#8a4b12; }
.rtoc-sec.on b{ color:#b5651d; }
.rtoc-m{ display:none; margin:0 0 12px; border:1px solid #ece7df; border-radius:10px; background:#fff; }
.rtoc-m>summary{ padding:11px 14px; cursor:pointer; color:#8a4b12; font-size:14px; list-style:none; }
.rtoc-m>summary::-webkit-details-marker{ display:none; }
.rtoc-mb{ padding:4px 10px 12px; border-top:1px dashed #ece7df; }

@media (max-width: 1080px){
  .rgrid{ display:block; }
  .rtoc{ display:none; }
  .rtoc-m{ display:block; }
}

/* 导读：目录移到内容左侧，贴近样板站 */
.rgrid{ display:grid; grid-template-columns:186px minmax(0,1fr); gap:34px; align-items:start; }
.rtoc{ order:0; } .rmain{ order:1; min-width:0; }

/* 章节目录放进左栏时的样式 */
.rgrid{ display:block; }
.rtoc-in-nav{ position:static; max-height:none; margin:14px 0 0; padding:10px 6px 6px;
              border-top:1px solid #ece7df; overflow:visible; }
.rtoc-in-nav .rtoc-h{ font-size:12px; letter-spacing:.08em; color:#a4978a; margin:0 0 6px 8px; }

/* 目录放在侧栏导航之上 */
.rtoc-in-nav{ margin:12px 0 10px; padding-top:0; border-top:0; border-bottom:1px solid #ece7df; padding-bottom:10px; }

/* 侧栏内的章节目录（构建期注入） */
.rtoc-in-nav{ position:static; max-height:none; margin:0 0 4px; padding:12px 8px 10px;
              border-bottom:1px solid #ece7df; overflow:visible; }
.rtoc-in-nav .rtoc-h{ font-size:11px; letter-spacing:.12em; color:#a4978a; margin:0 0 8px 6px; }
.rtoc-in-nav .rtoc-ch{ margin:10px 0 2px 6px; font-size:13px; color:#3d3730; }
.rtoc-in-nav .rtoc-sec{ padding:4px 8px 4px 10px; font-size:13.5px; }

/* 侧栏「课程章节」折叠 */
.navfold>summary{ list-style:none; cursor:pointer; font-size:11px; letter-spacing:.1em;
                  color:#a4978a; padding:8px 0 4px; }
.navfold>summary::-webkit-details-marker{ display:none; }
.navfold>summary::before{ content:"▸ "; color:#c0b3a4; }
.navfold[open]>summary::before{ content:"▾ "; }
.navfold .navlink{ padding-left:8px; }

/* ===== 母站（数苑 / Study Atlas） ===== */
body.mother{ background:#faf8f3; }
.mother-main{ max-width:1000px; margin:0 auto; padding:64px 28px 40px; }
.mother-head .kicker{ letter-spacing:.18em; font-size:12px; color:#b5651d; text-transform:uppercase; margin:0 0 10px; }
.mother-head h1{ font-family:"Songti SC","Noto Serif SC",serif; font-size:56px; letter-spacing:.12em; margin:0 0 14px; }
.mother-head .lead{ color:#6b6257; font-size:16px; margin:0 0 44px; }
.subjects{ display:grid; grid-template-columns:repeat(auto-fit,minmax(320px,1fr)); gap:22px; }
.subjcard{ display:block; position:relative; padding:26px 26px 22px; border:1px solid #e6e2da;
  border-radius:14px; background:#fffdf9; text-decoration:none; color:inherit;
  transition:box-shadow .18s ease, transform .18s ease, border-color .18s ease; }
.subjcard:hover{ box-shadow:0 8px 26px rgba(120,90,50,.12); transform:translateY(-2px); border-color:#dcc9ad; }
.subjcard.off{ opacity:.55; }
.subjcard.off:hover{ transform:none; box-shadow:none; }
.subj-top{ display:flex; justify-content:space-between; align-items:center; margin-bottom:14px; }
.subj-mark{ width:44px; height:44px; border-radius:11px; background:linear-gradient(160deg,#ce7e3a,#964e1a);
  color:#fff8ef; font-size:24px; display:flex; align-items:center; justify-content:center; }
.subjcard:nth-child(2) .subj-mark{ background:linear-gradient(160deg,#4a7fb0,#2f5d8a); }
.subj-state{ font-size:12px; padding:3px 9px; border-radius:20px; background:#f3efe7; color:#8a7f70; }
.subj-state.doing{ background:#f7ede1; color:#a15f1c; }
.subj-state.done{ background:#e8f1e8; color:#4a7a4a; }
.subjcard h2{ font-family:"Songti SC","Noto Serif SC",serif; font-size:26px; margin:0 0 6px; display:flex; align-items:baseline; gap:10px; }
.subjcard h2 small{ font-size:12px; letter-spacing:.12em; color:#a89b8a; font-family:inherit; }
.subj-book{ font-size:13px; color:#7b7264; margin:0 0 18px; }
.subj-bar{ height:5px; border-radius:3px; background:#eee8de; overflow:hidden; }
.subj-bar i{ display:block; height:100%; background:#b5651d; }
.subj-meta{ display:flex; justify-content:space-between; font-size:12px; color:#8a7f70; margin-top:8px; }
.subj-go{ position:absolute; right:24px; bottom:20px; font-size:13px; color:#b5651d; }
@media (max-width:560px){
  .mother-main{ padding:36px 18px; }
  .mother-head h1{ font-size:38px; }
}

.subj-meta{ display:flex; align-items:baseline; gap:10px; margin-top:9px; }
.subj-meta .m1{ font-variant-numeric:tabular-nums; color:#8a7f70; }
.subj-meta .m2{ flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#a89b8a; }
.subj-meta .subj-go{ position:static; margin-left:auto; flex:0 0 auto; color:#b5651d; }

.subjcard.off .subj-go{ display:none; }
