/* ==========================================================================
   故事研习社 · 全站样式
   风格：现代学术 + 青春校园；暖白纸感、靛蓝主色、衬线标题
   ========================================================================== */

/* ---------- 1. 设计令牌 ---------- */
:root {
  --bg: #FAF9F6;
  --bg-soft: #F3F1EB;
  --surface: #FFFFFF;
  --surface-2: #FBF9F4;
  --surface-3: #F6F3EC;

  --ink: #1D1B18;
  --ink-2: #3D3A34;
  --muted: #6E6A61;
  --faint: #969189;

  --line: #E7E2D8;
  --line-soft: #EFEBE2;
  --line-strong: #D8D1C4;

  --brand: #33477F;
  --brand-2: #253257;
  --brand-light: #5A6EA3;
  --brand-soft: #EDF0F9;
  --brand-line: #CBD3E8;

  --accent: #B96B3E;
  --accent-soft: #FBF0E7;

  --ok: #2E7458;
  --ok-soft: #EAF4EE;
  --ok-line: #C4E1D1;
  --bad: #AF4238;
  --bad-soft: #FBEDEB;
  --bad-line: #EDC9C5;
  --warn: #9A6F1F;
  --warn-soft: #FBF3E2;
  --warn-line: #EBDCB6;

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

  --radius-xs: 8px;
  --radius-s: 11px;
  --radius: 16px;
  --radius-l: 22px;
  --radius-xl: 28px;

  --shadow-xs: 0 1px 2px rgba(29, 27, 24, .05);
  --shadow-s: 0 1px 2px rgba(29, 27, 24, .05), 0 8px 20px -14px rgba(29, 27, 24, .22);
  --shadow-m: 0 2px 6px rgba(29, 27, 24, .05), 0 20px 38px -26px rgba(29, 27, 24, .32);
  --shadow-l: 0 30px 64px -34px rgba(29, 27, 24, .42);

  --ease: cubic-bezier(.22, .8, .24, 1);
  --header-h: 68px;
}

/* ---------- 2. 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at 88% -8%, #F2EDE1 0%, rgba(242, 237, 225, 0) 62%),
    radial-gradient(900px 460px at -8% 2%, #EDF0F8 0%, rgba(237, 240, 248, 0) 58%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.01em;
}

p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: #D8E0F3; color: var(--brand-2); }

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ico {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  display: inline-block;
  vertical-align: -.16em;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: clamp(18px, 4vw, 32px);
}

.site-main { min-height: 62vh; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }

.stack { display: grid; gap: 16px; }

/* ---------- 3. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  padding: .64em 1.15em;
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  background: transparent;
  font-size: .93rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: .005em;
  white-space: nowrap;
  transition: background .18s var(--ease), color .18s var(--ease),
              border-color .18s var(--ease), transform .18s var(--ease),
              box-shadow .18s var(--ease);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #3C5089 0%, #2C3E6E 100%);
  border-color: #2B3B66;
  box-shadow: 0 8px 18px -10px rgba(44, 62, 110, .85), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-primary:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #435A99 0%, #2F4378 100%);
  box-shadow: 0 12px 24px -12px rgba(44, 62, 110, .9), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  color: var(--ink-2);
  background: rgba(255, 255, 255, .55);
  border-color: var(--line-strong);
}
.btn-ghost:hover {
  background: #fff;
  border-color: var(--brand-line);
  color: var(--brand);
}

.btn-lg { padding: .82em 1.5em; font-size: 1rem; border-radius: 14px; }
.btn-sm { padding: .46em .85em; font-size: .84rem; border-radius: 9px; }
.btn-xs { padding: .3em .6em; font-size: .78rem; border-radius: 8px; }
.btn-block { width: 100%; }

.btn:disabled,
.btn.is-disabled {
  opacity: .5;
  pointer-events: none;
  transform: none;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  transition: background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
}
.icon-btn:hover { background: var(--brand-soft); color: var(--brand); }
.icon-btn.is-danger:hover { background: var(--bad-soft); color: var(--bad); }

.inline-form { display: inline-flex; margin: 0; }
.logout-form { display: inline-flex; margin: 0; }

/* ---------- 4. 表单 ---------- */
.field { display: grid; gap: 7px; min-width: 0; }
.field-label {
  font-size: .84rem;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: .01em;
}
.field-help { font-size: .78rem; color: var(--faint); line-height: 1.5; }
.field-wide { grid-column: 1 / -1; }
.field-grow { flex: 1 1 220px; }
.field-inline { gap: 4px; }

input[type="text"], input[type="password"], input[type="number"], input[type="search"],
input[type="email"], input[type="url"], input:not([type]), textarea, select {
  width: 100%;
  padding: .72em .9em;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: #fff;
  color: var(--ink);
  font-size: .94rem;
  line-height: 1.5;
  box-shadow: inset 0 1px 2px rgba(29, 27, 24, .03);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease);
}
input:hover, textarea:hover, select:hover { border-color: #C6BFB1; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(51, 71, 127, .12);
  background: #fff;
}
input:disabled, input[readonly], textarea:disabled {
  background: var(--surface-3);
  color: var(--muted);
  cursor: not-allowed;
}
textarea { resize: vertical; min-height: 72px; }
select {
  appearance: none;
  padding-right: 2.4em;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236E6A61' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .85em center;
  background-color: #fff;
}
input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.input-wrap { position: relative; display: block; }
.input-wrap input { padding-right: 2.8em; }
.pw-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--faint);
}
.pw-toggle:hover { background: var(--brand-soft); color: var(--brand); }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 22px;
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  position: relative;
  flex: none;
  width: 44px;
  height: 25px;
  margin-top: 2px;
  border-radius: 999px;
  background: #D9D3C6;
  transition: background .2s var(--ease);
}
.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(29, 27, 24, .25);
  transition: transform .2s var(--ease);
}
.switch input:checked + .switch-track { background: var(--brand); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(19px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--brand); outline-offset: 2px; }
.switch-text { display: grid; gap: 2px; font-size: .9rem; font-weight: 600; color: var(--ink-2); }
.switch-text small { font-weight: 400; color: var(--faint); font-size: .78rem; }

/* ---------- 5. 提示条 ---------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
  font-size: .9rem;
  line-height: 1.6;
  margin-bottom: 18px;
}
.alert .ico { margin-top: .18em; }
.alert ul { margin: 0; padding-left: 1.1em; }
.alert-error { background: var(--bad-soft); border-color: var(--bad-line); color: #7E2F28; }
.alert-ok { background: var(--ok-soft); border-color: var(--ok-line); color: #255F49; }
.alert-warn { background: var(--warn-soft); border-color: var(--warn-line); color: #7C5A19; }
.alert-link { margin-left: auto; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: .25em; }
.alert-list { margin-top: 6px; }
.alert-list li { margin: 2px 0; }

/* ---------- 6. 顶部导航 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(250, 249, 246, .84);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2.4vw, 26px);
  height: var(--header-h);
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: clamp(18px, 4vw, 32px);
}

.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, #4A5F9B 0%, #2A3A66 100%);
  box-shadow: 0 6px 14px -8px rgba(42, 58, 102, .9), inset 0 1px 0 rgba(255, 255, 255, .22);
  font-size: 1.15rem;
}
.brand-text { display: grid; line-height: 1.12; }
.brand-text strong { font-family: var(--serif); font-size: 1.06rem; letter-spacing: .01em; }
.brand-text small { font-size: .56rem; letter-spacing: .2em; color: var(--faint); margin-top: 3px; }

.topnav { display: flex; align-items: center; gap: 2px; margin-right: auto; }
.topnav-link {
  padding: 7px 13px;
  border-radius: 9px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--muted);
  transition: background .16s var(--ease), color .16s var(--ease);
}
.topnav-link:hover { background: rgba(51, 71, 127, .07); color: var(--brand); }
.topnav-link.is-active { color: var(--brand); background: var(--brand-soft); font-weight: 600; }

.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  transition: border-color .16s var(--ease), background .16s var(--ease);
}
.user-chip:hover { border-color: var(--brand-line); background: #fff; }
.avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(145deg, #E7E2D5, #D6CDBB);
  color: var(--brand-2);
  font-family: var(--serif);
  font-weight: 700;
  font-size: .82rem;
}
.avatar.xl { width: 76px; height: 76px; font-size: 1.9rem; border-radius: 22px; flex: none; box-shadow: var(--shadow-s); }
.user-name { font-size: .86rem; font-weight: 500; max-width: 8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 7. 页脚 ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: clamp(48px, 8vw, 96px); background: rgba(255, 255, 255, .35); }
.footer-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  max-width: 1240px;
  margin-inline: auto;
  padding: 26px clamp(18px, 4vw, 32px);
  font-size: .82rem;
  color: var(--faint);
}
.footer-brand { display: inline-flex; align-items: center; gap: 6px; font-family: var(--serif); color: var(--ink-2); font-size: .92rem; }
.footer-note { flex: 1 1 auto; }
.footer-ver { font-family: var(--mono); font-size: .74rem; letter-spacing: .04em; }

/* ---------- 8. 首页 Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: center;
  padding-block: clamp(44px, 7vw, 84px) clamp(34px, 5vw, 56px);
  overflow: clip;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .45em;
  margin: 0 0 14px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--brand-light);
}
.eyebrow .ico { width: 1em; height: 1em; }
.hero h1 {
  font-size: clamp(2.6rem, 5.4vw, 4.15rem);
  line-height: 1.1;
  letter-spacing: -.025em;
}
.hero h1 em {
  font-style: normal;
  color: var(--brand);
  position: relative;
  white-space: nowrap;
}
.hero h1 em::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: .06em;
  height: .18em;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(201, 154, 75, .45), rgba(201, 154, 75, .12));
}
.hero-lead {
  margin-top: 20px;
  max-width: 34em;
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--muted);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-stats {
  display: flex;
  gap: clamp(18px, 3.4vw, 34px);
  margin-top: clamp(30px, 4vw, 44px);
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.hero-stats div { display: grid; gap: 1px; }
.hero-stats strong { font-family: var(--serif); font-size: 1.55rem; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.hero-stats span { font-size: .76rem; color: var(--faint); letter-spacing: .06em; }

.hero-art { position: relative; min-height: 430px; }
.art-orbit {
  position: absolute;
  inset: 6% 0 0 8%;
  border: 1px dashed var(--line-strong);
  border-radius: 50%;
  transform: rotate(-8deg);
  opacity: .7;
}
.art-story {
  position: relative;
  width: min(356px, 88%);
  margin: 26px auto 0;
  padding: 24px 26px 20px;
  background: linear-gradient(180deg, #FFFEFB, #FFFDF8);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-l);
  transform: rotate(-2.4deg);
}
.art-story::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  width: 86px;
  height: 20px;
  transform: translateX(-50%) rotate(1.4deg);
  background: rgba(216, 205, 178, .55);
  border-radius: 3px;
}
.art-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.art-badge {
  display: inline-flex;
  align-items: center;
  gap: .35em;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .05em;
}
.art-index { font-family: var(--serif); font-size: 1.1rem; color: var(--faint); }
.art-story h3 { font-size: 1.3rem; margin-bottom: 10px; }
.art-text { font-size: .87rem; line-height: 1.8; color: var(--muted); }
.art-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.art-tags span {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-3);
  border: 1px solid var(--line-soft);
  font-size: .68rem;
  color: var(--muted);
}
.art-progress { height: 4px; margin-top: 18px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; }
.art-progress span { display: block; width: 62%; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #7A8CB8, var(--brand)); }
.art-foot { display: flex; justify-content: space-between; margin-top: 8px; font-size: .68rem; color: var(--faint); }

.art-note {
  position: absolute;
  left: -6px;
  bottom: 12px;
  display: flex;
  gap: 11px;
  align-items: flex-start;
  width: min(284px, 78%);
  padding: 16px 18px;
  background: linear-gradient(180deg, #FFFDF5, #FBF6E9);
  border: 1px solid #EADFC6;
  border-radius: var(--radius);
  box-shadow: var(--shadow-m);
  transform: rotate(2.2deg);
}
.art-note-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #F3EAD6;
  color: #9A7B3F;
}
.art-note strong { display: block; font-family: var(--serif); font-size: .92rem; }
.art-note p { margin-top: 2px; font-size: .78rem; line-height: 1.6; color: var(--muted); }

.art-float {
  position: absolute;
  top: 6px;
  right: 2px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-m);
  transform: rotate(2deg);
}
.art-float-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
}
.art-float div { display: grid; line-height: 1.25; }
.art-float strong { font-family: var(--serif); font-size: .9rem; }
.art-float span { font-size: .68rem; color: var(--faint); }

/* 继续阅读 */
.continue-wrap { margin-bottom: clamp(8px, 2vw, 18px); }
.continue-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 22px;
  background: linear-gradient(100deg, #FFFDF7 0%, #FFFEFB 60%, #F7F8FD 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-s);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.continue-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-m); border-color: var(--brand-line); }
.continue-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 1.15rem;
}
.continue-main { display: grid; gap: 1px; min-width: 0; }
.continue-label { font-size: .7rem; letter-spacing: .12em; color: var(--brand-light); font-weight: 600; }
.continue-main strong { font-family: var(--serif); font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.continue-main small { color: var(--faint); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.continue-cta { margin-left: auto; display: inline-flex; align-items: center; gap: .35em; color: var(--brand); font-weight: 600; font-size: .88rem; white-space: nowrap; }

/* ---------- 9. 首页区块 ---------- */
.section { padding-block: clamp(34px, 6vw, 60px); }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: clamp(22px, 3.4vw, 34px);
}
.section-head h2 { font-size: clamp(1.5rem, 2.6vw, 1.95rem); }
.section-sub { max-width: 32em; font-size: .9rem; color: var(--muted); line-height: 1.75; }

.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 20px;
}
.subject-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}
.subject-card::after {
  content: "";
  position: absolute;
  right: -56px;
  bottom: -70px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(51, 71, 127, .07), rgba(51, 71, 127, 0) 68%);
  pointer-events: none;
}
.subject-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand-line);
  box-shadow: var(--shadow-m);
}
.subject-card-top { display: flex; align-items: center; justify-content: space-between; }
.subject-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 50px;
  height: 50px;
  border-radius: 15px;
  background: linear-gradient(150deg, #EDF0F9, #E2E8F6);
  color: var(--brand);
  font-size: 1.4rem;
  border: 1px solid rgba(51, 71, 127, .08);
}
.subject-icon.is-alt { background: linear-gradient(150deg, #FBF0E5, #F6E5D4); color: var(--accent); border-color: rgba(185, 107, 62, .1); }
.subject-icon.xl { width: 74px; height: 74px; border-radius: 21px; font-size: 2rem; }
.subject-arrow {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: .9rem;
  transition: transform .2s var(--ease), background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.subject-card:hover .subject-arrow { background: var(--brand); border-color: var(--brand); color: #fff; transform: translateX(2px); }
.subject-card h3 { font-size: 1.32rem; margin-top: 2px; }
.subject-desc {
  font-size: .88rem;
  line-height: 1.75;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.subject-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: .8rem;
  color: var(--faint);
}
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }
.subject-progress { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; }
.subject-progress .bar { width: 54px; height: 4px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; }
.subject-progress .bar span { display: block; height: 100%; background: var(--brand-light); border-radius: 99px; }
.subject-progress small { font-size: .7rem; color: var(--faint); }

.method-section { padding-top: 0; }
.method-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.method-card {
  position: relative;
  padding: 26px 24px;
  background: rgba(255, 255, 255, .62);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  overflow: hidden;
}
.method-num {
  position: absolute;
  top: 16px;
  right: 20px;
  font-family: var(--serif);
  font-size: 2.4rem;
  color: rgba(51, 71, 127, .08);
  line-height: 1;
}
.method-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  margin-bottom: 14px;
}
.method-card h3 { font-size: 1.08rem; margin-bottom: 6px; }
.method-card p { font-size: .85rem; line-height: 1.8; color: var(--muted); }

/* 空状态 */
.empty-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: clamp(32px, 6vw, 56px) 24px;
  text-align: center;
  background: rgba(255, 255, 255, .6);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-l);
}
.empty-card.compact { padding: 28px 20px; }
.empty-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 4px;
  border-radius: 16px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 1.5rem;
}
.empty-card h3 { font-size: 1.15rem; }
.empty-card p { max-width: 34em; font-size: .88rem; color: var(--muted); line-height: 1.8; }
.empty-card .btn { margin-top: 8px; }

.empty-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 22px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: .88rem;
}
.empty-note .ico { color: var(--faint); margin-top: .2em; }

/* ---------- 10. 通用页面头 ---------- */
.page-wrap { padding-top: clamp(20px, 3vw, 32px); padding-bottom: 24px; }
.crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: .8rem;
  color: var(--faint);
  margin-bottom: 22px;
}
.crumbs a { color: var(--muted); transition: color .16s var(--ease); }
.crumbs a:hover { color: var(--brand); }
.crumbs .ico { width: .85em; height: .85em; opacity: .6; }

.page-hero {
  display: flex;
  align-items: flex-start;
  gap: clamp(16px, 3vw, 26px);
  flex-wrap: wrap;
  padding-bottom: clamp(22px, 3.4vw, 34px);
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(22px, 3.4vw, 34px);
}
.page-hero-main { flex: 1 1 380px; min-width: 0; }
.page-hero h1 { font-size: clamp(1.85rem, 3.4vw, 2.7rem); line-height: 1.2; }
.page-lead { margin-top: 10px; max-width: 44em; font-size: .96rem; line-height: 1.85; color: var(--muted); }
.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin-top: 16px;
  font-size: .82rem;
  color: var(--muted);
}
.meta-row span { display: inline-flex; align-items: center; gap: .4em; }
.meta-row .ico { color: var(--faint); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: .3em;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.pill-ok { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.pill-brand { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand); }
.tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 6px;
  background: var(--surface-3);
  border: 1px solid var(--line-soft);
  font-size: .7rem;
  color: var(--muted);
  white-space: nowrap;
}
.badge-soon {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px dashed var(--line-strong);
  font-size: .68rem;
  color: var(--faint);
  white-space: nowrap;
}

/* ---------- 11. 章节树 ---------- */
.layout-split {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  gap: clamp(22px, 3.6vw, 38px);
  align-items: start;
}
.content-col { min-width: 0; display: grid; gap: 22px; }

.tree-panel {
  position: sticky;
  top: calc(var(--header-h) + 18px);
  padding: 16px 14px 12px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  max-height: calc(100vh - var(--header-h) - 40px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.tree-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; padding-inline: 4px; }
.tree-panel-title { display: inline-flex; align-items: center; gap: .4em; font-size: .78rem; font-weight: 700; letter-spacing: .1em; color: var(--faint); text-transform: uppercase; }
.drawer-close { display: none; }

.tree { display: grid; gap: 6px; }
.tree-group { display: grid; gap: 2px; }
.tree-head { display: flex; align-items: center; gap: 2px; }
.tree-caret {
  display: grid;
  place-items: center;
  width: 22px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--faint);
  font-size: .8rem;
  transition: transform .18s var(--ease), color .16s var(--ease), background .16s var(--ease);
}
.tree-caret .ico { transition: transform .18s var(--ease); }
.tree-caret[aria-expanded="true"] .ico { transform: rotate(90deg); }
.tree-caret:hover:not(:disabled) { background: var(--brand-soft); color: var(--brand); }
.tree-caret.is-disabled { opacity: .28; cursor: default; }
.tree-top-link {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 9px;
  font-size: .88rem;
  font-weight: 600;
  color: var(--ink-2);
  transition: background .16s var(--ease), color .16s var(--ease);
}
.tree-top-link:hover { background: rgba(51, 71, 127, .06); color: var(--brand); }
.tree-top-link.is-active { background: var(--brand-soft); color: var(--brand); }
.tree-top-link.is-soon { color: var(--faint); font-weight: 500; }
.tree-index { font-family: var(--mono); font-size: .68rem; color: var(--faint); flex: none; }
.tree-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-soon { font-size: .62rem; color: var(--faint); border: 1px dashed var(--line-strong); border-radius: 999px; padding: 0 6px; margin-left: auto; flex: none; }

.tree-children {
  display: grid;
  gap: 1px;
  margin-left: 12px;
  padding-left: 9px;
  border-left: 1px dashed var(--line-strong);
}
.tree-children[hidden] { display: none; }
.tree-link {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: .83rem;
  color: var(--muted);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.tree-link:hover { background: rgba(51, 71, 127, .05); color: var(--ink); }
.tree-link.is-active { background: #fff; color: var(--brand); font-weight: 600; box-shadow: var(--shadow-xs); }
.tree-link.is-child { padding-left: 7px; }
.tree-link-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); flex: none; }
.tree-dot.is-read { background: var(--ok); }
.tree-dot.is-reading { background: var(--accent); }

.tree-sub { display: grid; gap: 1px; margin: 3px 0 4px 4px; }
.tree-sublink {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 7px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--ink-2);
}
.tree-sublink:hover { color: var(--brand); }
.tree-sublink.is-active { color: var(--brand); background: rgba(51, 71, 127, .05); }
.tree-sublink.is-soon { color: var(--faint); font-weight: 500; }
.tree-sublink-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tree-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 12px;
  padding: 10px 6px 2px;
  border-top: 1px dashed var(--line);
  font-size: .68rem;
  color: var(--faint);
}
.tree-legend span { display: inline-flex; align-items: center; gap: 5px; }
.tree-empty { padding: 14px 6px; font-size: .83rem; color: var(--faint); }

.tree-trigger { display: none; }
.tree-overlay { display: none; }

/* ---------- 12. 科目页章节卡片 ---------- */
.chapter-card {
  padding: clamp(20px, 3vw, 28px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-xs);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.chapter-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-s); }
.chapter-card.is-soon { background: rgba(255, 255, 255, .55); }
.chapter-card.is-soon h2 a { color: var(--faint); }
.chapter-card.is-soon .chapter-num { opacity: .3; }
.chapter-card.is-soon .chapter-desc { color: var(--faint); }
.chapter-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.chapter-head-main { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.chapter-num {
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--brand-light);
  opacity: .55;
  padding-top: 3px;
  flex: none;
}
.chapter-card h2 { font-size: clamp(1.12rem, 2vw, 1.3rem); line-height: 1.4; }
.chapter-card h2 a:hover { color: var(--brand); }
.chapter-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 5px; font-size: .76rem; color: var(--faint); }
.chapter-desc { margin-top: 14px; font-size: .9rem; line-height: 1.85; color: var(--muted); }

.story-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.story-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: .84rem;
  color: var(--ink-2);
  transition: border-color .16s var(--ease), background .16s var(--ease), color .16s var(--ease), transform .16s var(--ease);
}
.story-chip:hover { background: #fff; border-color: var(--brand-line); color: var(--brand); transform: translateY(-1px); }
.story-chip-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-chip-q { font-size: .7rem; color: var(--faint); padding-left: 7px; border-left: 1px solid var(--line); flex: none; }

.child-block { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--line); }
.child-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.child-head a { font-family: var(--serif); font-size: 1rem; font-weight: 600; color: var(--ink-2); }
.child-head a:hover { color: var(--brand); }
.child-count { font-size: .72rem; color: var(--faint); }
.child-block .story-chips { margin-top: 10px; }
.child-block > .muted { margin-top: 8px; }

.soon-block {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
}
.soon-block.compact { margin-top: 0; padding: 14px 16px; }
.soon-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; background: #fff; border: 1px solid var(--line); color: var(--faint); }
.soon-block strong { font-size: .9rem; }
.soon-block p { margin-top: 2px; font-size: .8rem; color: var(--faint); }

/* ---------- 13. 章节页篇目 ---------- */
.chapter-hero .page-hero-main { max-width: 840px; }
.group-block { display: grid; gap: 14px; }
.group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.group-index { font-family: var(--mono); font-size: .72rem; color: var(--faint); }
.group-head h2 { font-size: 1.08rem; flex: 1; min-width: 0; }
.group-head h2 a:hover { color: var(--brand); }
.group-count { font-size: .76rem; color: var(--faint); }

.story-list {
  display: grid;
  gap: 10px;
}
.story-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 17px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.story-row:hover { transform: translateY(-2px); border-color: var(--brand-line); box-shadow: var(--shadow-s); }
.story-num {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--faint);
  width: 30px;
  flex: none;
}
.story-main { flex: 1; min-width: 0; display: grid; gap: 7px; }
.story-title-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.story-title-line h3 { font-size: 1.02rem; font-weight: 600; }
.story-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.story-meta-item { display: inline-flex; align-items: center; gap: .3em; font-size: .74rem; color: var(--faint); }
.story-meta-item.is-good { color: var(--ok); }
.story-meta-item.is-low { color: var(--bad); }
.story-go {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  color: var(--faint);
  transition: color .18s var(--ease), background .18s var(--ease), transform .18s var(--ease);
}
.story-row:hover .story-go { background: var(--brand-soft); color: var(--brand); transform: translateX(2px); }

.chapter-nav, .story-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 8px;
}
.chapter-nav-card, .story-nav-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  background: rgba(255, 255, 255, .6);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .18s var(--ease), background .18s var(--ease), transform .18s var(--ease);
  min-width: 0;
}
.chapter-nav-card:hover, .story-nav-card:hover { background: #fff; border-color: var(--brand-line); transform: translateY(-2px); }
.chapter-nav-card .ico, .story-nav-card .ico { color: var(--faint); flex: none; }
.chapter-nav-card span, .story-nav-card span { display: grid; min-width: 0; }
.chapter-nav-card small, .story-nav-card small { font-size: .7rem; color: var(--faint); }
.chapter-nav-card strong, .story-nav-card strong { font-family: var(--serif); font-size: .92rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chapter-nav-card.is-next, .story-nav-card.is-next { text-align: right; justify-content: flex-end; }
.chapter-nav-card.is-next span, .story-nav-card.is-next span { justify-items: end; }

/* ---------- 14. 阅读页 ---------- */
.read-progress {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  height: 3px;
  z-index: 55;
  pointer-events: none;
}
.read-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #7C8DB5, var(--brand));
  border-radius: 0 99px 99px 0;
  transition: width .18s linear;
}
.reader-wrap { max-width: 812px; padding-top: clamp(18px, 3vw, 30px); }
.reader { display: grid; gap: clamp(28px, 4vw, 44px); }

.story-header { display: grid; gap: 14px; }
.story-kicker { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.kicker-label {
  display: inline-flex;
  align-items: center;
  gap: .35em;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .1em;
}
.story-header h1 {
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  line-height: 1.28;
  letter-spacing: -.015em;
}
.story-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; font-size: .8rem; color: var(--faint); }
.story-meta > span { display: inline-flex; align-items: center; gap: .38em; }

/* 正文排版 */
.prose {
  max-width: 42em;
  font-size: 1.0625rem;
  line-height: 1.92;
  color: var(--ink-2);
  overflow-wrap: break-word;
}
.prose > *:first-child { margin-top: 0; }
.prose p { margin: 0 0 1.12em; }
.prose h2, .prose h3, .prose h4 { color: var(--ink); scroll-margin-top: 90px; }
.prose h2 {
  position: relative;
  margin: 1.9em 0 .72em;
  padding-left: .78em;
  font-size: 1.46rem;
  line-height: 1.45;
}
.prose h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: .24em;
  bottom: .24em;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--brand), #8896BE);
}
.prose h3 { margin: 1.6em 0 .55em; font-size: 1.18rem; }
.prose h4 { margin: 1.4em 0 .45em; font-size: 1.04rem; }
.prose ul, .prose ol { margin: 0 0 1.15em; padding-left: 1.45em; }
.prose li { margin: .34em 0; }
.prose li::marker { color: var(--brand-light); }
.prose blockquote {
  margin: 1.5em 0;
  padding: 1em 1.25em;
  background: var(--surface-2);
  border-left: 3px solid var(--brand-line);
  border-radius: 0 12px 12px 0;
  font-family: var(--serif);
  font-size: 1.02em;
  color: var(--ink-2);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose em { color: var(--accent); }
.prose a { color: var(--brand); text-decoration: underline; text-decoration-color: var(--brand-line); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--brand); }
.prose hr { margin: 2.2em 0; border: 0; border-top: 1px dashed var(--line-strong); }
.prose code {
  padding: .14em .38em;
  border-radius: 5px;
  background: var(--surface-3);
  border: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: .86em;
  color: #6B4B2A;
}
.prose pre {
  margin: 1.4em 0;
  padding: 16px 18px;
  border-radius: 12px;
  background: #272B36;
  color: #E7E9EF;
  overflow-x: auto;
  font-size: .86em;
  line-height: 1.65;
}
.prose pre code { padding: 0; border: 0; background: transparent; color: inherit; font-size: 1em; }
.prose table {
  width: 100%;
  margin: 1.4em 0;
  border-collapse: collapse;
  font-size: .9em;
  line-height: 1.6;
}
.prose th, .prose td { padding: .6em .75em; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); font-weight: 600; color: var(--ink); }
.prose tr:last-child td { border-bottom: 0; }
.prose img { border-radius: 12px; height: auto; }
.prose-slim { font-size: .95rem; line-height: 1.85; }

/* 笔记页 */
.notes-card {
  position: relative;
  margin-left: -4px;
  margin-right: -4px;
  padding: 4px 22px 6px 26px;
  background:
    linear-gradient(180deg, #FFFDF6 0%, #FBF7EA 100%);
  border: 1px solid #EADFC7;
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-s);
  overflow: hidden;
}
.notes-card::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 5px;
  background: repeating-linear-gradient(180deg, #D9C7A2 0 11px, transparent 11px 20px);
  opacity: .85;
}
.notes-card::after {
  content: "";
  position: absolute;
  top: -12px;
  right: 46px;
  width: 74px;
  height: 26px;
  background: rgba(216, 203, 172, .45);
  border-radius: 3px;
  transform: rotate(3deg);
  pointer-events: none;
}
.notes-card[open] { padding-bottom: 20px; }
.notes-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 0 14px;
  cursor: pointer;
  list-style: none;
}
.notes-summary::-webkit-details-marker { display: none; }
.notes-head { display: flex; align-items: center; gap: 12px; }
.notes-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 10px;
  background: #F3E8D2;
  color: #96763C;
}
.notes-head strong { display: block; font-family: var(--serif); font-size: 1rem; }
.notes-head small { font-size: .74rem; color: #9A8A6B; }
.notes-toggle { color: #9A8A6B; font-size: .9rem; transition: transform .2s var(--ease); }
.notes-card[open] .notes-toggle { transform: rotate(180deg); }
.notes-body { padding-top: 4px; border-top: 1px dashed #E4D8BD; color: #4A4234; }
.notes-body h2::before { background: linear-gradient(180deg, #B08D4C, #D3BC8D); }
.notes-body h2, .notes-body h3, .notes-body h4 { color: #3B3427; }
.notes-body strong { color: #3B3427; }
.notes-body blockquote { background: rgba(255, 255, 255, .55); border-left-color: #D9C7A2; }
.notes-body code { background: rgba(255, 255, 255, .7); border-color: #E4D8BD; }
.notes-body p:last-child { margin-bottom: 0; }

.reader-mark {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 20px 22px;
  background: rgba(255, 255, 255, .66);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.reader-mark-text { display: grid; gap: 2px; }
.reader-mark-text strong { font-family: var(--serif); font-size: 1rem; }
.reader-mark-text span { font-size: .8rem; color: var(--faint); }

/* ---------- 15. 练习区 ---------- */
.practice { display: grid; gap: 20px; margin-top: 6px; }
.practice-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}
.practice-head h2 { font-size: clamp(1.35rem, 2.6vw, 1.7rem); }
.practice-head .section-sub { margin-top: 6px; }
.practice-past { margin-top: 8px; font-size: .8rem; color: var(--faint); }
.practice-score {
  flex: none;
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  justify-items: center;
  gap: 0 2px;
  padding: 12px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}
.score-num { font-family: var(--serif); font-size: 2rem; line-height: 1; color: var(--brand); }
.score-den { font-size: .9rem; color: var(--faint); }
.practice-score small { grid-column: 1 / -1; font-size: .68rem; color: var(--faint); margin-top: 2px; letter-spacing: .08em; }

.quiz-list { display: grid; gap: 18px; }
.quiz {
  padding: clamp(18px, 3vw, 28px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-xs);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.quiz:has(.quiz-result.is-open) { border-color: var(--line-strong); box-shadow: var(--shadow-s); }
.quiz-head { display: flex; gap: 14px; align-items: flex-start; }
.quiz-index {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-top: 2px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 700;
}
.quiz-head-main { min-width: 0; display: grid; gap: 7px; }
.quiz-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: .7rem; color: var(--faint); }
.quiz-meta > span:not(.pill) {
  padding-left: 8px;
  border-left: 1px solid var(--line);
}
.quiz-meta > span:first-child:not(.pill) { padding-left: 0; border-left: 0; }
.quiz-stem { font-family: var(--sans); font-size: 1rem; font-weight: 600; line-height: 1.75; }

.options { display: grid; gap: 9px; margin: 16px 0 0 48px; }
.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink-2);
  transition: border-color .16s var(--ease), background .16s var(--ease), box-shadow .16s var(--ease), transform .16s var(--ease);
}
.option:hover { border-color: var(--brand-line); background: #FCFDFF; }
.option-key {
  flex: none;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  font-size: .8rem;
  font-weight: 700;
  color: var(--muted);
  transition: all .16s var(--ease);
}
.option-text { flex: 1; font-size: .93rem; line-height: 1.65; padding-top: 2px; }
.option-mark { display: none; flex: none; margin-top: 3px; color: inherit; }
.option.is-selected { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(51, 71, 127, .08); }
.option.is-selected .option-key { background: var(--brand); border-color: var(--brand); color: #fff; }
.option.is-correct { border-color: var(--ok-line); background: var(--ok-soft); color: #24513E; }
.option.is-correct .option-key { background: var(--ok); border-color: var(--ok); color: #fff; }
.option.is-correct .option-mark { display: block; color: var(--ok); }
.option.is-wrong { border-color: var(--bad-line); background: var(--bad-soft); color: #7E2F28; }
.option.is-wrong .option-key { background: var(--bad); border-color: var(--bad); color: #fff; }
.option.is-wrong .option-mark { display: block; color: var(--bad); }
.option:disabled { cursor: default; transform: none; }

.quiz-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 0 0 48px; }
.quiz-hint { font-size: .74rem; color: var(--faint); }

.quiz-result {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows .38s var(--ease), opacity .24s var(--ease);
}
.quiz-result.is-open { grid-template-rows: 1fr; opacity: 1; }
.quiz-result-inner { overflow: hidden; min-height: 0; }
.quiz-result.is-open .quiz-result-inner { padding-top: 18px; }

.result-banner {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.result-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  font-size: .95rem;
}
.result-title { display: block; font-family: var(--serif); font-size: .98rem; }
.result-sub { margin-top: 1px; font-size: .78rem; opacity: .8; }
.quiz.is-correct .result-banner { background: var(--ok-soft); border-color: var(--ok-line); color: #255F49; }
.quiz.is-correct .result-icon { color: var(--ok); }
.quiz.is-wrong .result-banner { background: var(--bad-soft); border-color: var(--bad-line); color: #7E2F28; }
.quiz.is-wrong .result-icon { color: var(--bad); }

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.analysis-card {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--brand-line);
}
.analysis-card h4 {
  display: flex;
  align-items: center;
  gap: .35em;
  margin-bottom: 6px;
  font-family: var(--sans);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--brand);
}
.analysis-card p { font-size: .84rem; line-height: 1.8; color: var(--ink-2); white-space: pre-line; }
.analysis-card.is-story { border-left-color: #D9C7A2; background: #FDFAF2; }
.analysis-card.is-story h4 { color: #8D6D2E; }
.analysis-card.is-pitfall { border-left-color: var(--bad-line); background: #FEFAFA; }
.analysis-card.is-pitfall h4 { color: var(--bad); }
.result-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.result-id { font-family: var(--mono); font-size: .7rem; color: var(--faint); }

/* ---------- 16. 登录注册 ---------- */
.auth-wrap { padding-block: clamp(30px, 6vw, 60px); max-width: 980px; }
.auth-card {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-m);
  overflow: hidden;
}
.auth-side {
  position: relative;
  padding: clamp(30px, 4vw, 44px) clamp(26px, 3.6vw, 38px);
  color: #EDEFF7;
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(120, 139, 190, .38), transparent 60%),
    linear-gradient(160deg, #2F4070 0%, #232F52 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}
.auth-side::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -90px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, .22);
}
.auth-side.is-register { background:
    radial-gradient(600px 300px at 100% 0%, rgba(201, 154, 75, .28), transparent 60%),
    linear-gradient(160deg, #3A3350 0%, #262033 100%); }
.auth-logo {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 1.35rem;
}
.auth-side h2 { color: #fff; font-size: 1.6rem; line-height: 1.35; }
.auth-side > p { font-size: .86rem; line-height: 1.8; color: rgba(237, 239, 247, .72); }
.auth-points { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.auth-points li { display: flex; align-items: center; gap: 9px; font-size: .84rem; color: rgba(237, 239, 247, .86); }
.auth-points .ico { color: #C9D4EE; }
.auth-quote { margin-top: auto; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .14); }
.auth-quote p { font-family: var(--serif); font-size: .92rem; line-height: 1.8; color: rgba(237, 239, 247, .7); }

.auth-form { padding: clamp(30px, 4.4vw, 48px); display: flex; flex-direction: column; }
.auth-form h1 { font-size: clamp(1.6rem, 2.6vw, 2rem); }
.auth-sub { margin: 6px 0 24px; font-size: .88rem; color: var(--muted); }
.auth-form .btn-block { margin-top: 6px; }
.auth-alt { margin-top: 20px; font-size: .84rem; color: var(--muted); text-align: center; }
.auth-alt a { color: var(--brand); font-weight: 600; }
.auth-alt a:hover { text-decoration: underline; text-underline-offset: 3px; }

.admin-login-body .site-footer { display: none; }
.admin-login-body .topbar { display: none; }
.admin-login-body .site-main { min-height: 100vh; display: grid; align-items: center; }
.admin-login-body .auth-wrap { width: 100%; }
.admin-login-card {
  max-width: 440px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 42px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-m);
}
.admin-login-head { display: grid; justify-items: center; gap: 6px; margin-bottom: 22px; text-align: center; }
.admin-login-head .auth-logo { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand); }
.admin-login-head h1 { font-size: 1.5rem; }
.admin-login-head p { font-size: .84rem; color: var(--muted); }
.admin-login-hint { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); font-size: .76rem; color: var(--faint); text-align: center; line-height: 1.7; }
.admin-login-hint code { font-family: var(--mono); font-size: .72rem; background: var(--surface-3); border: 1px solid var(--line-soft); border-radius: 5px; padding: 1px 5px; }
.admin-login-back { display: inline-flex; align-items: center; gap: .3em; margin: 16px auto 0; font-size: .8rem; color: var(--muted); }
.admin-login-back:hover { color: var(--brand); }
.admin-login-card { display: grid; }
.admin-login-card .admin-login-back { justify-self: center; }

/* ---------- 17. 个人中心 ---------- */
.me-hero { align-items: center; }
.me-continue {
  flex: none;
  display: grid;
  gap: 2px;
  min-width: 210px;
  padding: 14px 18px;
  background: linear-gradient(120deg, #FFFDF7, #F7F8FD);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.me-continue:hover { border-color: var(--brand-line); transform: translateY(-2px); box-shadow: var(--shadow-s); }
.me-continue-label { font-size: .68rem; letter-spacing: .12em; color: var(--brand-light); font-weight: 600; }
.me-continue strong { font-family: var(--serif); font-size: .96rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-continue-go { position: absolute; opacity: 0; }
.welcome-alert { max-width: 100%; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  position: relative;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}
.stat-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  margin-bottom: 14px;
}
.stat-icon.is-ok { background: var(--ok-soft); color: var(--ok); }
.stat-icon.is-warm { background: var(--accent-soft); color: var(--accent); }
.stat-value { font-family: var(--serif); font-size: 2rem; line-height: 1.05; letter-spacing: -.02em; }
.stat-value small { font-family: var(--sans); font-size: .8rem; color: var(--faint); font-weight: 400; margin-left: 3px; }
.stat-label { margin-top: 3px; font-size: .8rem; color: var(--muted); }
.stat-bar { height: 5px; margin-top: 12px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; }
.stat-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #7C8DB5, var(--brand)); }
.stat-bar.is-ok span { background: linear-gradient(90deg, #7DB79C, var(--ok)); }
.stat-foot { margin-top: 9px; font-size: .72rem; color: var(--faint); line-height: 1.5; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 20px; }
.panel {
  padding: clamp(18px, 2.6vw, 26px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-xs);
  min-width: 0;
}
.panel + .panel, .panel { margin-bottom: 20px; }
.dash-grid .panel { margin-bottom: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.panel-head h2 { font-size: 1.1rem; }
.panel-note { font-size: .74rem; color: var(--faint); }
.panel-head-actions { display: flex; align-items: center; gap: 10px; }
.panel-link { display: inline-flex; align-items: center; gap: .3em; font-size: .8rem; color: var(--brand); font-weight: 600; }
.panel-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.acc-bars { display: grid; gap: 16px; }
.acc-bar-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.acc-bar-title { font-size: .86rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-bar-value { font-family: var(--serif); font-size: .95rem; font-weight: 600; }
.acc-bar-value.is-good { color: var(--ok); }
.acc-bar-value.is-low { color: var(--bad); }
.acc-track { height: 7px; margin-top: 6px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; }
.acc-track span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #8BAF9C, var(--ok)); }
.acc-track span.is-low { background: linear-gradient(90deg, #D9A099, var(--bad)); }
.acc-bar-foot { display: block; margin-top: 4px; font-size: .7rem; color: var(--faint); }

.recent-list { list-style: none; margin: 0; padding: 0; display: grid; }
.recent-item { display: flex; align-items: flex-start; gap: 11px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.recent-item:last-child { border-bottom: 0; padding-bottom: 0; }
.recent-status {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  margin-top: 2px;
  border-radius: 50%;
  font-size: .72rem;
}
.recent-status.is-ok { background: var(--ok-soft); color: var(--ok); }
.recent-status.is-bad { background: var(--bad-soft); color: var(--bad); }
.recent-main { min-width: 0; flex: 1; display: grid; gap: 2px; }
.recent-stem {
  font-size: .85rem;
  line-height: 1.6;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.recent-stem:hover { color: var(--brand); }
.recent-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: .7rem; color: var(--faint); }
.recent-time { flex: none; font-size: .68rem; color: var(--faint); white-space: nowrap; }

/* ---------- 18. 错误页 ---------- */
.error-page { display: grid; justify-items: center; gap: 10px; padding: clamp(48px, 10vw, 110px) 20px; text-align: center; }
.error-code { font-family: var(--serif); font-size: clamp(4rem, 12vw, 7rem); line-height: 1; color: var(--brand-line); letter-spacing: -.04em; }
.error-page h1 { font-size: clamp(1.3rem, 3vw, 1.8rem); }
.error-page p { font-size: .9rem; color: var(--muted); }
.error-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }

/* ---------- 19. 后台布局 ---------- */
.admin-body { background: #F7F5F0; }
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 70;
  background: rgba(255, 255, 255, .88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.admin-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 62px;
  padding-inline: clamp(16px, 3vw, 28px);
}
.admin-topbar .brand-mark { width: 34px; height: 34px; border-radius: 10px; font-size: 1rem; }
.admin-topbar .brand-text strong { font-size: .98rem; }
.admin-topbar-actions { display: flex; align-items: center; gap: 10px; }
.admin-user { display: inline-flex; align-items: center; gap: .35em; font-size: .82rem; color: var(--muted); }
.admin-user .ico { color: var(--faint); }

.admin-shell { display: flex; align-items: flex-start; min-height: calc(100vh - 62px); }
.admin-side {
  position: sticky;
  top: 62px;
  width: 226px;
  flex: none;
  height: calc(100vh - 62px);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, .5);
}
.admin-nav { display: grid; gap: 3px; }
.admin-nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: .86rem;
  font-weight: 500;
  color: var(--muted);
  transition: background .16s var(--ease), color .16s var(--ease);
}
.admin-nav a .ico { font-size: 1rem; color: var(--faint); transition: color .16s var(--ease); }
.admin-nav a:hover { background: rgba(51, 71, 127, .06); color: var(--ink); }
.admin-nav a:hover .ico { color: var(--brand); }
.admin-nav a.is-active { background: var(--brand); color: #fff; box-shadow: 0 6px 14px -10px rgba(51, 71, 127, .9); }
.admin-nav a.is-active .ico { color: #fff; }
.admin-side-foot { margin-top: auto; padding: 14px 12px 4px; border-top: 1px dashed var(--line); font-size: .7rem; color: var(--faint); font-family: var(--mono); }

.admin-main {
  flex: 1;
  min-width: 0;
  padding: clamp(20px, 3vw, 34px) clamp(18px, 3.4vw, 40px) 60px;
}
.admin-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.admin-page-head h1 { font-size: clamp(1.5rem, 2.6vw, 1.95rem); }
.admin-page-sub { margin-top: 6px; font-size: .84rem; color: var(--muted); line-height: 1.7; }
.admin-page-sub a { color: var(--brand); }
.admin-page-sub code { font-family: var(--mono); font-size: .76rem; background: var(--surface-3); border: 1px solid var(--line-soft); padding: 1px 5px; border-radius: 5px; }
.admin-head-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

.admin-stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.compact-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.admin-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  transition: transform .16s var(--ease), border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.admin-stat:hover { transform: translateY(-2px); border-color: var(--brand-line); box-shadow: var(--shadow-s); }
.admin-stat.is-static:hover { transform: none; }
.admin-stat-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 1.05rem;
}
.admin-stat div { display: grid; line-height: 1.2; }
.admin-stat strong { font-family: var(--serif); font-size: 1.42rem; font-weight: 600; }
.admin-stat span:not(.admin-stat-icon) { font-size: .72rem; color: var(--faint); }

.admin-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.admin-grid-2 .panel { margin-bottom: 20px; }
.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.quick-card {
  display: grid;
  gap: 3px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  transition: border-color .16s var(--ease), background .16s var(--ease), transform .16s var(--ease);
}
.quick-card:hover { background: #fff; border-color: var(--brand-line); transform: translateY(-2px); }
.quick-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 8px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
}
.quick-card strong { font-size: .9rem; }
.quick-card p { font-size: .78rem; color: var(--faint); line-height: 1.7; }
.simple-list { list-style: none; margin: 0; padding: 0; display: grid; }
.simple-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.simple-list li:last-child { border-bottom: 0; }
.simple-list-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.simple-list-main strong { font-size: .86rem; font-weight: 600; }
.simple-list-main small { font-size: .7rem; color: var(--faint); }

/* 表格 */
.table-wrap { width: 100%; overflow-x: auto; border-radius: 10px; }
.data-table { width: 100%; border-collapse: collapse; font-size: .84rem; min-width: 640px; }
.data-table.compact { min-width: 480px; }
.data-table th {
  padding: 9px 12px;
  text-align: left;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--faint);
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: var(--surface-2);
}
.data-table td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.data-table tbody tr { transition: background .14s var(--ease); }
.data-table tbody tr:hover { background: rgba(51, 71, 127, .025); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.table-link { font-weight: 600; color: var(--ink-2); }
.table-link:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.table-code { display: block; font-family: var(--mono); font-size: .68rem; color: var(--faint); margin-top: 1px; }
.table-desc { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-stem { max-width: 380px; }
.table-stem .table-link { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 500; }
.table-actions { display: flex; align-items: center; gap: 2px; white-space: nowrap; }
.table-actions form { display: inline-flex; margin: 0; }
.table-title-with-icon { display: flex; align-items: center; gap: 9px; }
.table-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); font-size: .9rem; flex: none; }
.code-chip { font-family: var(--mono); font-size: .72rem; background: var(--surface-3); border: 1px solid var(--line-soft); border-radius: 5px; padding: 2px 6px; white-space: nowrap; }
.row-top td { background: rgba(255, 255, 255, .5); }
.row-child td:first-child { padding-left: 26px; }
.tree-label { display: flex; align-items: center; gap: 8px; }
.tree-label.is-child { padding-left: 6px; }
.tree-badge { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 7px; background: var(--brand-soft); color: var(--brand); font-family: var(--mono); font-size: .66rem; font-weight: 700; }
.tree-branch { width: 14px; height: 1px; background: var(--line-strong); flex: none; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.pager-info { font-size: .76rem; color: var(--faint); }
.pager-buttons { display: flex; gap: 8px; }

.filter-bar { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px dashed var(--line); }
.filter-bar .field-inline { min-width: 160px; }
.filter-bar .field-grow { min-width: 200px; flex: 1 1 240px; }
.filter-actions { display: flex; gap: 8px; padding-bottom: 1px; }

/* 编辑器 */
.editor-card { position: relative; display: grid; gap: 10px; }
.editor-textarea {
  min-height: 300px;
  font-family: var(--mono);
  font-size: .84rem;
  line-height: 1.75;
  background: #FDFCF9;
  tab-size: 2;
}
.editor-preview {
  min-height: 120px;
  max-width: none;
  padding: 18px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: #FFFEFB;
}
.editor-preview[hidden] { display: none; }
.editor-tools { display: flex; justify-content: flex-end; }
.editor-tools .btn.is-active { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-line); }

.sticky-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 4px 0 0;
}

/* 选项编辑 */
.option-editor { display: grid; gap: 8px; }
.option-edit-row { display: flex; align-items: center; gap: 10px; }
.option-edit-key {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
  font-size: .8rem;
}
.answer-row { margin-top: 16px; }

/* 导入 */
.file-drop {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color .16s var(--ease), background .16s var(--ease);
}
.file-drop:hover { border-color: var(--brand-line); background: #fff; }
.file-drop > .ico { width: 30px; height: 30px; color: var(--brand-light); flex: none; }
.file-drop-text { display: grid; gap: 1px; }
.file-drop-text strong { font-size: .88rem; }
.file-drop-text small { font-size: .74rem; color: var(--faint); }
.file-name { margin-left: auto; font-size: .74rem; color: var(--brand); font-family: var(--mono); max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-textarea { font-family: var(--mono); font-size: .8rem; line-height: 1.7; background: #FDFCF9; }
.code-block {
  margin: 12px 0 0;
  padding: 16px;
  border-radius: 12px;
  background: #272B36;
  color: #E7E9EF;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: .74rem;
  line-height: 1.7;
}
.schema-details summary {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .4em;
  font-size: .85rem;
  font-weight: 600;
  color: var(--brand);
  list-style: none;
}
.schema-details summary::-webkit-details-marker { display: none; }
.schema-details summary::before { content: "＋"; font-family: var(--sans); }
.schema-details[open] summary::before { content: "－"; }

.segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.segmented label { position: relative; display: block; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; width: 0; height: 0; }
.segmented label > span {
  display: grid;
  gap: 2px;
  padding: 12px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  transition: border-color .16s var(--ease), background .16s var(--ease), box-shadow .16s var(--ease);
}
.segmented label > span strong { font-size: .86rem; }
.segmented label > span small { font-size: .73rem; color: var(--faint); line-height: 1.5; }
.segmented input:checked + span { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(51, 71, 127, .08); }
.segmented input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

.import-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.import-stat { display: grid; gap: 1px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.import-stat span { font-size: .74rem; color: var(--faint); }
.import-stat strong { font-family: var(--serif); font-size: 1.4rem; }
.import-stat small { font-size: .68rem; color: var(--muted); }

.info-list { margin: 0; display: grid; gap: 0; }
.info-list > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.info-list > div:last-child { border-bottom: 0; }
.info-list dt { font-size: .78rem; color: var(--faint); }
.info-list dd { margin: 0; font-size: .86rem; font-weight: 500; text-align: right; }
.info-list code { font-family: var(--mono); font-size: .76rem; }

/* ---------- 20. Toast 与确认框 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 36px);
  padding: 11px 18px;
  border-radius: 12px;
  background: #26231F;
  color: #F7F4ED;
  font-size: .85rem;
  line-height: 1.5;
  box-shadow: var(--shadow-l);
  opacity: 0;
  transform: translate(-50%, 14px);
  pointer-events: none;
  transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.toast.is-ok { background: #24523F; }
.toast.is-bad { background: #7C2F28; }
.toast .ico { color: currentColor; }

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(29, 27, 24, .42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.modal-root.is-open { display: grid; }
.modal-card {
  width: 100%;
  max-width: 420px;
  padding: 26px;
  background: var(--surface);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-l);
  animation: modal-pop .2s var(--ease);
}
@keyframes modal-pop {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.modal-title { font-family: var(--serif); font-size: 1.18rem; }
.modal-text { margin-top: 8px; font-size: .87rem; line-height: 1.7; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.modal-actions .btn-danger {
  color: #fff;
  background: linear-gradient(180deg, #BF5147, #A03A31);
  border-color: #97362E;
}
.modal-actions .btn-danger:hover { background: linear-gradient(180deg, #C95A50, #A83F36); }

/* ---------- 21. 响应式 ---------- */
@media (max-width: 1080px) {
  .hero { gap: 36px; }
  .hero-art { min-height: 390px; }
  .art-note { left: -14px; }
  .admin-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .hero-art { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: clamp(36px, 7vw, 64px); }
  .hero-lead { max-width: 38em; }
  .method-grid { grid-template-columns: 1fr; }
  .layout-split { grid-template-columns: 1fr; }
  .tree-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: sticky;
    top: calc(var(--header-h) + 10px);
    z-index: 45;
    width: fit-content;
    margin-bottom: 4px;
    padding: 9px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    box-shadow: var(--shadow-s);
    font-size: .84rem;
    font-weight: 600;
    color: var(--ink-2);
    backdrop-filter: blur(8px);
  }
  .tree-trigger .ico { color: var(--brand); }
  .tree-trigger-hint { padding-left: 8px; margin-left: 2px; border-left: 1px solid var(--line); font-size: .7rem; color: var(--faint); font-weight: 400; }
  .tree-panel {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 120;
    width: min(86vw, 340px);
    max-height: none;
    height: 100dvh;
    padding: 18px 16px 28px;
    border-radius: 0 20px 20px 0;
    border-left: 0;
    background: var(--bg);
    box-shadow: var(--shadow-l);
    transform: translateX(-104%);
    transition: transform .28s var(--ease);
    overflow-y: auto;
  }
  .tree-panel.is-open { transform: none; }
  .drawer-close { display: inline-grid; }
  .tree-panel-head { position: sticky; top: -4px; padding: 4px 4px 10px; background: var(--bg); z-index: 2; }
  .tree-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 110;
    background: rgba(29, 27, 24, .38);
    opacity: 0;
    pointer-events: none;
    transition: opacity .24s var(--ease);
    backdrop-filter: blur(2px);
  }
  .tree-overlay.is-open { opacity: 1; pointer-events: auto; }
  body.drawer-open { overflow: hidden; }

  .dash-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-shell { display: block; }
  .admin-side {
    position: sticky;
    top: 62px;
    z-index: 50;
    width: 100%;
    height: auto;
    padding: 9px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(247, 245, 240, .94);
    backdrop-filter: blur(10px);
    overflow-x: auto;
  }
  .admin-nav { display: flex; gap: 4px; width: max-content; }
  .admin-nav a { white-space: nowrap; padding: 7px 12px; }
  .admin-side-foot { display: none; }
  .admin-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-grid-2 { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .auth-card { grid-template-columns: 1fr; }
  .auth-side { padding: 28px; }
  .auth-points, .auth-quote { display: none; }
  .auth-side h2 { font-size: 1.3rem; }
  .auth-form { padding: 28px; }
  .admin-topbar .brand-text small { display: none; }
  .admin-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .import-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .segmented { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .subject-grid { grid-template-columns: 1fr; }
  .section-head { align-items: flex-start; }
  .chapter-card-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .chapter-card-head .btn { display: none; }
  .story-row { padding: 14px 15px; gap: 11px; }
  .story-num { width: 24px; font-size: .95rem; }
  .story-title-line h3 { font-size: .97rem; }
  .chapter-nav, .story-nav { grid-template-columns: 1fr; }
  .page-hero { gap: 16px; }
  .subject-icon.xl { width: 60px; height: 60px; border-radius: 17px; font-size: 1.6rem; }
  .me-continue { width: 100%; min-width: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .admin-page-head { align-items: flex-start; }
  .filter-bar .field-inline, .filter-bar .field-grow { min-width: 0; flex: 1 1 100%; }
  .sticky-actions { width: 100%; bottom: 8px; }
  .notes-card { margin-left: 0; margin-right: 0; }
  .reader-mark { padding: 16px 18px; }
  .quiz-result.is-open .quiz-result-inner { padding-top: 14px; }
  .analysis-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  :root { --header-h: 60px; }
  body { font-size: 16px; }
  .topbar-inner { height: 60px; gap: 8px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; font-size: 1rem; }
  .brand-text strong { font-size: .98rem; }
  .brand-text small { display: none; }
  .topnav { display: none; }
  .user-name { display: none; }
  .user-chip { padding: 3px; border: 0; background: transparent; }
  .admin-entry span { display: none; }
  .admin-entry { padding: .46em .6em; }

  .hero { padding-top: 28px; }
  .hero h1 { font-size: clamp(2.3rem, 11vw, 3rem); }
  .hero-lead { font-size: .98rem; }
  .hero-stats { flex-wrap: wrap; gap: 14px 26px; }
  .hero-stats strong { font-size: 1.35rem; }
  .hero-actions .btn { flex: 1 1 auto; }
  .continue-card { padding: 13px 16px; gap: 12px; }
  .continue-cta { font-size: 0; gap: 0; }
  .continue-cta .ico { font-size: 1.1rem; }

  .page-hero h1 { font-size: clamp(1.6rem, 7vw, 2rem); }
  .meta-row { gap: 6px 12px; font-size: .78rem; }
  .chapter-card { padding: 18px 16px; border-radius: var(--radius); }
  .chapter-head-main { gap: 10px; }
  .chapter-num { font-size: 1.2rem; }
  .story-chip { font-size: .8rem; padding: 6px 9px; }
  .story-chip-q { display: none; }

  .reader-wrap { padding-inline: 16px; }
  .prose { font-size: 16px; line-height: 1.88; }
  .prose h2 { font-size: 1.28rem; }
  .prose h3 { font-size: 1.1rem; }
  .prose table { display: block; overflow-x: auto; white-space: nowrap; }
  .story-header h1 { font-size: clamp(1.65rem, 7vw, 2.1rem); }
  .story-meta { gap: 6px 13px; font-size: .76rem; }
  .notes-card { padding-left: 20px; padding-right: 16px; }
  .notes-summary { padding: 13px 0 11px; }
  .notes-head small { display: none; }
  .reader-mark-text span { font-size: .74rem; }

  .practice-head { flex-direction: column; gap: 14px; padding-top: 24px; }
  .practice-score { align-self: flex-start; padding: 8px 14px; grid-template-columns: auto auto auto; align-items: baseline; gap: 0 4px; }
  .practice-score small { grid-column: auto; margin: 0 0 0 2px; }
  .score-num { font-size: 1.5rem; }
  .quiz { padding: 16px 14px; border-radius: var(--radius); }
  .quiz-head { gap: 10px; }
  .quiz-index { width: 28px; height: 28px; border-radius: 8px; font-size: .7rem; }
  .quiz-stem { font-size: .97rem; }
  .options { margin-left: 0; gap: 8px; }
  .option { padding: 10px 11px; gap: 9px; }
  .option-key { width: 24px; height: 24px; border-radius: 7px; font-size: .74rem; }
  .option-text { font-size: .89rem; }
  .quiz-actions { margin-left: 0; }
  .analysis-grid { gap: 9px; }
  .analysis-card { padding: 12px 13px; }
  .result-banner { padding: 11px 13px; }
  .reader-mark { flex-direction: column; align-items: stretch; gap: 12px; }
  .reader-mark .btn { justify-content: center; }

  .auth-wrap { padding-inline: 14px; }
  .auth-card { border-radius: var(--radius-l); }
  .auth-side { padding: 22px 22px 20px; }
  .auth-side h2 { font-size: 1.2rem; }
  .auth-side > p { font-size: .8rem; }
  .auth-form { padding: 24px 22px 26px; }

  .stat-grid { gap: 10px; }
  .stat-card { padding: 15px; }
  .stat-value { font-size: 1.6rem; }
  .stat-icon { width: 30px; height: 30px; margin-bottom: 10px; }
  .panel { padding: 16px; border-radius: var(--radius); }
  .panel-head { margin-bottom: 12px; }
  .recent-time { display: none; }

  .admin-topbar-inner { height: 56px; }
  .admin-topbar .brand-text { display: none; }
  .admin-user span:not(.ico) { display: none; }
  .admin-main { padding: 16px 14px 48px; }
  .admin-side { top: 56px; padding: 8px 12px; }
  .admin-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .admin-stat { padding: 12px; gap: 9px; }
  .admin-stat-icon { width: 32px; height: 32px; }
  .admin-stat strong { font-size: 1.2rem; }
  .panel { padding: 15px; }
  .admin-page-head { margin-bottom: 16px; }
  .admin-head-actions .btn { font-size: .8rem; }
  .import-summary { gap: 8px; }
  .pager { align-items: flex-start; }
  .modal-card { padding: 22px; }
  .toast { bottom: 18px; font-size: .82rem; }
}

@media (max-width: 420px) {
  .hero-stats { justify-content: space-between; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .subject-icon { width: 44px; height: 44px; font-size: 1.2rem; }
  .page-hero h1 { font-size: 1.5rem; }
  .quiz-stem { font-size: .94rem; }
  .stat-grid { grid-template-columns: 1fr; }
  .admin-stat-grid { grid-template-columns: 1fr; }
  .stat-card { display: grid; grid-template-columns: auto 1fr; gap: 0 12px; align-items: center; }
  .stat-icon { grid-row: span 2; margin: 0; }
  .stat-bar, .stat-foot { grid-column: 2; }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
