:root {
  --bg: #eadcc6;
  --paper: #fffaf1;
  --ink: #1c1917;
  --muted: #6b6258;
  --line: #e3d6c2;
  --accent: #1f4d4a;
  --accent-soft: #e4efee;
  --c5001: #1d4e89;
  --c5001-soft: #e6eef7;
  --c5004: #0f6b56;
  --c5004-soft: #e4f3ee;
  --c5006: #6b3fa0;
  --c5006-soft: #f1eaf8;
  --warn: #8a4b12;
  --warn-soft: #f7ecdf;
  --hl: rgba(255, 214, 10, 0.52);
  --hl-ink: #6a5200;
  --stamp: #c45c4a;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 12px 28px rgba(72, 48, 22, 0.12);
  --shadow-sm: 0 1px 0 rgba(255, 255, 255, 0.65) inset, 0 4px 12px rgba(72, 48, 22, 0.08);
  --radius: 16px;
  --header-h: 56px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --fiber: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.045'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Source Han Sans SC", system-ui, sans-serif;
  background:
    var(--fiber),
    radial-gradient(900px 420px at 8% -8%, rgba(31, 77, 74, 0.12), transparent 55%),
    radial-gradient(720px 360px at 100% 0%, rgba(107, 63, 160, 0.10), transparent 50%),
    radial-gradient(520px 280px at 70% 100%, rgba(240, 196, 25, 0.10), transparent 55%),
    repeating-linear-gradient(180deg, transparent 0 21px, rgba(90, 62, 28, 0.035) 22px),
    var(--bg);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100dvh;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }

.login-gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    var(--fiber),
    radial-gradient(700px 360px at 20% 0%, rgba(31, 77, 74, 0.14), transparent 55%),
    var(--bg);
}
.login-gate[hidden] { display: none !important; }
.login-card {
  width: min(400px, 100%);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), transparent 42%),
    var(--paper);
  border: 1px solid rgba(227, 214, 194, 0.95);
  border-radius: 22px;
  padding: 24px 22px 20px;
  box-shadow: var(--shadow);
  position: relative;
}
.login-card::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 28%;
  width: 92px;
  height: 18px;
  background: repeating-linear-gradient(-18deg, #f2c94c, #f2c94c 7px, #f7e48a 7px, #f7e48a 14px);
  box-shadow: 0 3px 8px rgba(90, 60, 0, 0.16);
  transform: rotate(-3deg);
}
.login-card::after {
  content: "CARD  ·  5001 / 5004 / 5006";
  display: block;
  margin-top: 14px;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #b3a48d;
}
.login-mark {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  margin: 0 0 12px;
  background: #1f4d4a;
  color: #f6e27a;
  font-weight: 800;
  font-size: 22px;
  box-shadow: 0 10px 20px rgba(31, 77, 74, 0.3);
  transform: rotate(-4deg);
}
.login-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.login-card h2 { margin: 0 0 8px; font-size: 22px; font-weight: 650; }
.login-card p { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.login-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  margin: 0 0 10px;
  background: #fff;
  box-shadow: inset 0 1px 3px rgba(80, 50, 20, 0.05);
}
.login-card .open-page { width: 100%; margin: 4px 0 0; }
.login-err { min-height: 1.2em; color: #8a2b2b !important; }

.app {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100dvh;
  background:
    linear-gradient(180deg, rgba(255, 250, 241, 0.35), transparent 90px),
    transparent;
  position: relative;
}

.app.reading {
  max-width: none;
  min-height: 100dvh;
}

.study-pane { min-width: 0; }

.reader-pane[hidden] { display: none !important; }

.reader-pane {
  background:
    radial-gradient(80% 40% at 50% 0%, #3a312b, transparent 60%),
    #1c1917;
  color: #f5f0e8;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.reader-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(var(--safe-top) + 8px) 10px 8px;
  background: linear-gradient(180deg, #3a322c, #211c19);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}

.reader-bar .bar-btn {
  appearance: none;
  border: 0;
  background: linear-gradient(180deg, #fff8ea, #f3e6d0);
  color: #1c1917;
  font-weight: 750;
  font-size: 14px;
  height: 36px;
  padding: 0 12px;
  border-radius: 11px;
  flex: 0 0 auto;
  line-height: 1;
  box-shadow: 0 1px 0 #fff8ea inset, 0 2px 0 #d9c7a8, 0 6px 10px rgba(0, 0, 0, 0.18);
}
.reader-bar .bar-btn:active { transform: translateY(1px); box-shadow: 0 1px 0 #d9c7a8; }

.reader-bar .bar-btn:disabled {
  opacity: 0.38;
  color: #1c1917;
}

.reader-meta {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.35;
}

.reader-meta #readerLabel {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 650;
}

.reader-meta #readerPage { color: #c4b8a8; font-variant-numeric: tabular-nums; }

.reader-stage {
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  display: block;
  padding: 8px;
  position: relative;
  touch-action: pan-x pan-y;
}

.reader-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  flex: 0 0 auto;
  padding: 5px 12px calc(var(--safe-bottom) + 6px);
  background: #211c19;
  border-top: 1px solid rgba(255, 248, 234, 0.08);
}

.pager-btn {
  appearance: none;
  border: 0;
  height: 28px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: #1c1917;
  background: linear-gradient(180deg, #fff8ea, #f3e6d0);
  box-shadow: 0 1px 0 #fff8ea inset, 0 1px 0 #d9c7a8;
}

.pager-btn:active { transform: translateY(1px); }

.pager-btn:disabled {
  opacity: 0.38;
}

.pager-btn.is-stop,
.speak-stop-btn {
  color: #fff8f4;
  background: linear-gradient(180deg, #e05a4a, #c23b2e);
  box-shadow: 0 1px 0 rgba(255, 220, 210, 0.35) inset, 0 8px 18px rgba(160, 40, 28, 0.28);
}

.speak-stop-btn {
  appearance: none;
  position: fixed;
  top: 72px;
  right: 12px;
  z-index: 36;
  display: block;
  margin: 0;
  border: 0;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.speak-caption {
  position: fixed;
  z-index: 30;
  margin: 0;
  max-width: min(420px, calc(100vw - 24px));
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(22, 32, 30, 0.94);
  color: #f6f1e8;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
  pointer-events: none;
}

.speak-caption-zh {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 650;
}

.pager-pos {
  min-width: 4.5em;
  text-align: center;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: #c4b8a8;
}

.page-stack {
  position: relative;
  display: block;
  width: calc(var(--page-zoom, 1) * 100%);
  min-width: calc(var(--page-zoom, 1) * 100%);
  max-width: none;
  margin: 0 auto;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.page-stack img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  background: #fff;
  pointer-events: none;
  user-select: none;
}

.hl-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.hl-band {
  position: absolute;
  background: rgba(255, 214, 10, 0.46);
  border-radius: 3px;
  box-shadow: inset 0 -2px 0 rgba(230, 170, 0, 0.28);
}
.hl-band.live {
  background: transparent;
  box-shadow: inset 0 -2.5px 0 rgba(20, 90, 86, 0.78);
}
.hl-band.speak {
  background: rgba(56, 168, 148, 0.22);
  box-shadow: inset 0 -2px 0 rgba(20, 110, 98, 0.7);
}

.text-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 2;
  user-select: text;
  -webkit-user-select: text;
  -webkit-tap-highlight-color: transparent;
}

.text-layer span {
  position: absolute;
  color: rgba(0, 0, 0, 0.01);
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
  white-space: nowrap;
  overflow: hidden;
  line-height: 1.15;
  border-radius: 2px;
}
.text-layer::selection,
.text-layer span::selection,
.text-layer span::-moz-selection {
  background: transparent !important;
  color: transparent !important;
}
.text-layer span.hl-yellow {
  cursor: pointer;
}

.select-card,
.notes-panel,
.toc-panel {
  position: absolute;
  z-index: 6;
  background: #fffdf8;
  color: #1c1917;
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.3);
}

.select-card {
  position: fixed;
  left: 12px;
  top: 80px;
  right: auto;
  bottom: auto;
  width: min(288px, calc(100vw - 20px));
  max-width: calc(100vw - 20px);
  padding: 12px 12px 10px;
  z-index: 40;
  background: #1c1917;
  color: #f4efe6;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.36);
}

.select-quote[hidden],
.select-card textarea[hidden],
.select-btn[hidden] { display: none !important; }

.select-trans {
  margin: 0 0 10px;
  font-size: 14.5px;
  font-weight: 550;
  color: #f4efe6;
  max-height: min(42vh, 14em);
  overflow: auto;
  line-height: 1.45;
}

.select-card textarea {
  width: 100%;
  border: 1px solid #3d362f;
  border-radius: 10px;
  padding: 8px 10px;
  resize: vertical;
  background: #2a2521;
  color: #f4efe6;
  margin: 0 0 10px;
}

.select-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 6px;
}

.select-btn {
  border: 0;
  background: #2f2a26;
  color: #f4efe6;
  border-radius: 11px;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 650;
  box-shadow: none;
}
.select-btn.mark {
  background: #f0c419;
  color: #3a2800;
}
.select-btn:active { transform: translateY(1px); }

.ghost-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  box-shadow: var(--shadow-sm);
}

.notes-panel,
.toc-panel {
  top: 8px;
  bottom: calc(var(--safe-bottom) + 8px);
  width: min(380px, calc(100% - 16px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(227, 214, 194, 0.95);
}

.notes-panel { right: 8px; }
.toc-panel { left: 8px; right: auto; }

.notes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 10px 8px 14px;
  border-bottom: 1px dashed var(--line);
  background: linear-gradient(180deg, #fff6d8, #fffdf8);
}

.notes-list {
  overflow: auto;
  padding: 8px 12px 16px;
  -webkit-overflow-scrolling: touch;
}

.note-item {
  border-bottom: 1px dashed var(--line);
  padding: 10px 0;
}

.note-item .note-page {
  font-size: 12px;
  color: var(--accent);
  font-weight: 650;
}

.note-item .note-quote {
  margin: 4px 0;
  font-size: 13.5px;
  background: var(--hl);
  border-radius: 6px;
  padding: 4px 6px;
  box-decoration-break: clone;
}

.note-item .note-body {
  margin: 0;
  font-size: 13px;
  color: #3f3a34;
}

.note-item .note-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.note-item button {
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 0;
  font-size: 13px;
}

.notes-head .icon-btn {
  color: #1c1917;
  background: #fff;
  border-color: var(--line);
}

.select-card[hidden],
.notes-panel[hidden],
.toc-panel[hidden],
.speak-caption[hidden],
.speak-stop-btn[hidden] {
  display: none !important;
}

.toc-jump {
  display: flex;
  gap: 6px;
  padding: 8px 12px 0;
}

.toc-jump input,
#tocSearch {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  min-width: 0;
}

#tocSearch {
  margin: 8px 12px 0;
  width: auto;
}

.toc-kicker {
  margin: 12px 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.toc-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 10px;
  background: transparent;
  padding: 7px 8px;
  font-size: 13.5px;
  line-height: 1.35;
}

.toc-item span {
  flex: 0 0 auto;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.toc-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.toc-item.active span { color: var(--accent); }
.toc-item.toc-lesson { font-weight: 650; }

.reader-hint {
  position: absolute;
  top: 24px;
  left: 16px;
  right: 16px;
  text-align: center;
  color: #d7cbb8;
  margin: 0;
  pointer-events: none;
  z-index: 3;
}

.open-page {
  display: inline-block;
  border: 1px solid var(--accent);
  background: linear-gradient(180deg, #2b6763, var(--accent));
  color: #fff;
  text-decoration: none;
  border-radius: 11px;
  padding: 8px 12px;
  margin: 6px 0 8px;
  font-size: 14px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 8px 16px rgba(31, 77, 74, 0.22);
}
.open-page:active { transform: translateY(1px); }

@media (max-width: 979px) {
  .app.reading .study-pane { display: none; }
}

@media (min-width: 980px) {
  .app.reading {
    display: grid;
    grid-template-columns: minmax(320px, 420px) 1fr;
    height: 100dvh;
    overflow: hidden;
  }
  .app.reading .study-pane {
    height: 100dvh;
    overflow: auto;
    border-right: 1px solid var(--line);
    background: rgba(255, 250, 241, 0.28);
  }
  .app.reading .reader-pane {
    height: 100dvh;
  }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(234, 220, 198, 0.78);
  backdrop-filter: blur(16px);
  padding: calc(var(--safe-top) + 10px) 16px 10px;
  border-bottom: 1px solid rgba(227, 214, 194, 0.8);
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar h1 {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  line-height: 1.2;
}

.brand-en {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.brand-zh {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.04em;
  color: #2a2420;
}

.page-heading {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.brand[hidden],
.page-heading[hidden] { display: none; }

.who-chip {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--accent);
  flex: 0 0 auto;
  max-width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.who-chip[hidden] { display: none; }

.icon-btn {
  border: 1px solid var(--line);
  background: var(--paper);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  box-shadow: var(--shadow-sm);
}

.icon-btn[hidden] { display: none; }

.search-wrap { padding: 10px 16px 0; }
.search-wrap input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 14px;
  padding: 11px 12px;
  box-shadow: var(--shadow-sm);
}

.day-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 16px 4px;
  -webkit-overflow-scrolling: touch;
}
#monthTabs { padding-bottom: 0; }
.day-tabs[hidden] { display: none; }
.day-tabs::-webkit-scrollbar { display: none; }

.chip {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, var(--paper));
  border-radius: 999px;
  padding: 8px 12px;
  white-space: nowrap;
  font-size: 13px;
  box-shadow: var(--shadow-sm);
}
.chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 6px 14px rgba(31, 77, 74, 0.22);
}
.chip.c5001:not(.active) { color: var(--c5001); border-color: #b7c9e0; background: var(--c5001-soft); }
.chip.c5004:not(.active) { color: var(--c5004); border-color: #b3d9cc; background: var(--c5004-soft); }
.chip.c5006:not(.active) { color: var(--c5006); border-color: #d3c2e8; background: var(--c5006-soft); }
.chip.c5001.active { background: var(--c5001); border-color: var(--c5001); box-shadow: 0 6px 14px rgba(29, 78, 137, 0.24); }
.chip.c5004.active { background: var(--c5004); border-color: var(--c5004); box-shadow: 0 6px 14px rgba(15, 107, 86, 0.24); }
.chip.c5006.active { background: var(--c5006); border-color: var(--c5006); box-shadow: 0 6px 14px rgba(107, 63, 160, 0.24); }

.page { padding: 8px 16px calc(var(--safe-bottom) + 28px); }

.hero {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), transparent 46%),
    var(--paper);
  border: 1px solid rgba(227, 214, 194, 0.95);
  border-radius: 18px;
  padding: 22px 16px 16px;
  margin: 14px 0;
  box-shadow: var(--shadow);
  position: relative;
  overflow: visible;
}
.hero::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  border-width: 0 20px 20px 0;
  border-style: solid;
  border-color: #e8d9b8 var(--bg);
  filter: drop-shadow(-1px 1px 0 rgba(90, 60, 20, 0.06));
}
.hero-tape {
  position: absolute;
  top: -9px;
  left: 22%;
  width: 88px;
  height: 18px;
  pointer-events: none;
  background: repeating-linear-gradient(-18deg, #f2c94c, #f2c94c 7px, #f7e48a 7px, #f7e48a 14px);
  box-shadow: 0 3px 8px rgba(90, 60, 0, 0.16);
  transform: rotate(-2.5deg);
}
.hero-stamp {
  position: absolute;
  right: 18px;
  top: 16px;
  width: 54px;
  height: 54px;
  border: 2px solid var(--stamp);
  border-radius: 50%;
  color: var(--stamp);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  transform: rotate(12deg);
  opacity: 0.86;
  letter-spacing: 0.08em;
  background: rgba(255, 248, 240, 0.55);
  box-shadow: inset 0 0 0 3px rgba(196, 92, 74, 0.15);
}
.hero-lesson.c5001 { box-shadow: var(--shadow), -5px 0 0 var(--c5001); }
.hero-lesson.c5004 { box-shadow: var(--shadow), -5px 0 0 var(--c5004); }
.hero-lesson.c5006 { box-shadow: var(--shadow), -5px 0 0 var(--c5006); }
.hero p { margin: 8px 0 0; color: var(--muted); font-size: 13.5px; }
.hero .kicker { font-size: 12px; letter-spacing: 0.08em; color: var(--accent); font-weight: 600; }
.hero-title { margin: 6px 0 0; font-size: 20px; }
.hero-lesson .hero-title { font-size: 22px; margin-bottom: 8px; }
.hero-quiz { margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }

.account-card {
  background: var(--paper);
  border: 1px solid rgba(227, 214, 194, 0.95);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin: 0 0 12px;
}
.account-card strong { display: block; margin: 0 0 8px; }
.account-card p { margin: 0 0 12px; color: var(--muted); font-size: 13.5px; }
.account-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.account-row:last-child { border-bottom: 0; }
.account-row strong { flex: 1; margin: 0; }
.account-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  margin: 0 0 10px;
  background: #fff;
}
.account-form .open-page { width: 100%; }
.account-err { min-height: 1.2em; color: #8a2b2b; margin: 8px 0 0; font-size: 13.5px; }
.account-ok { min-height: 1.2em; color: var(--accent); margin: 4px 0 0; font-size: 13.5px; }

.shelf-grid {
  display: grid;
  gap: 12px;
}
.shelf-card {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(227, 214, 194, 0.95);
  background: var(--paper);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: 84px 1fr;
  column-gap: 14px;
  row-gap: 4px;
  align-items: start;
}
.shelf-cover {
  grid-column: 1;
  grid-row: 1 / span 6;
  width: 84px;
  height: 118px;
  object-fit: cover;
  object-position: top center;
  border-radius: 4px;
  background: #d7cbb8;
  box-shadow: 0 6px 14px rgba(40, 28, 16, 0.2);
}
.shelf-cover.lg {
  width: 110px;
  height: 154px;
}
.shelf-cover.miss {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
  font-size: 11px;
  font-weight: 750;
  color: #3a322c;
}
.shelf-hero {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  align-items: start;
}
.shelf-hero .hero-title { padding-right: 0; }
.shelf-card .badge,
.shelf-card strong,
.shelf-card .shelf-en,
.shelf-card p { grid-column: 2; }
.shelf-card strong {
  display: block;
  margin: 2px 0 0;
  font-size: 16px;
}
.shelf-en {
  display: block;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
  font-style: italic;
}
.shelf-card p { margin: 0; font-size: 13.5px; color: var(--ink); }
.shelf-use { margin-top: 4px !important; color: var(--muted) !important; font-size: 12.5px !important; }

.day-head {
  margin: 18px 0 8px;
  font-size: 14px;
  font-weight: 750;
  color: var(--ink);
}
.day-head:first-child { margin-top: 4px; }
.day-head span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.lesson-card {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(227, 214, 194, 0.95);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), transparent 42%),
    var(--paper);
  border-radius: var(--radius);
  padding: 12px 14px 12px 0;
  margin: 0 0 12px;
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 0;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.lesson-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: #cfc3b0;
}
.lesson-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 18px;
  width: 12px;
  height: 16px;
  background: #cfc3b0;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%);
}
.lesson-card.c5001::before,
.lesson-card.c5001::after { background: var(--c5001); }
.lesson-card.c5004::before,
.lesson-card.c5004::after { background: var(--c5004); }
.lesson-card.c5006::before,
.lesson-card.c5006::after { background: var(--c5006); }
.lesson-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.75) inset, 0 14px 28px rgba(72, 48, 22, 0.14);
}
.lesson-card:active { transform: translateY(1px); }
.lesson-card .time {
  padding: 2px 10px 0 14px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-weight: 600;
  border-right: 1px dashed #e3d6c2;
  margin-right: 10px;
}
.lesson-card .when-date {
  color: var(--ink);
  font-weight: 750;
  margin-bottom: 2px;
}
.lesson-card .title {
  font-size: 15.5px;
  font-weight: 650;
  margin: 0 0 4px;
  padding-right: 16px;
}
.lesson-card .meta {
  font-size: 12.5px;
  color: var(--muted);
}

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.02em;
  padding: 2px 7px;
  border-radius: 999px;
  margin-right: 6px;
}
.badge.c5001 { background: var(--c5001-soft); color: var(--c5001); }
.badge.c5004 { background: var(--c5004-soft); color: var(--c5004); }
.badge.c5006 { background: var(--c5006-soft); color: var(--c5006); }
.badge.skip { background: #eeeae2; color: var(--muted); }
.badge.role { background: var(--accent-soft); color: var(--accent); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }

.done-dot {
  display: inline-block;
  margin-left: 8px;
  vertical-align: middle;
  padding: 1px 6px;
  border: 1.5px solid var(--stamp);
  border-radius: 999px;
  background: rgba(196, 92, 74, 0.06);
  color: var(--stamp);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.5;
  transform: rotate(-8deg);
}
.done-dot::after { content: "已读"; }

.section { margin: 18px 0; }
.section h2 {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: none;
  color: var(--accent);
  margin: 0 0 8px;
  font-weight: 700;
}

.block {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent 36%),
    var(--paper);
  border: 1px solid rgba(227, 214, 194, 0.95);
  border-radius: var(--radius);
  padding: 14px;
  margin: 0 0 10px;
  box-shadow: var(--shadow-sm);
}
.block h3 {
  margin: 0 0 6px;
  font-size: 15px;
}
.block p { margin: 0 0 8px; }
.block p:last-child { margin-bottom: 0; }

.points { margin: 0; padding-left: 1.15em; }
.points li { margin: 0 0 8px; }
.points li:last-child { margin-bottom: 0; }

.book-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
  margin-bottom: 8px;
}
.book-name { font-weight: 700; font-size: 15px; }
.file-hint { font-size: 12px; color: var(--muted); }

.chapter {
  border-top: 1px dashed var(--line);
  padding: 10px 0 2px;
}
.chapter:first-of-type { border-top: 0; padding-top: 0; }
.chapter .ch-title { font-weight: 650; margin: 0 0 4px; font-size: 14.5px; }
.chapter .pages { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.sections {
  margin: 0;
  padding-left: 1.1em;
  font-size: 13.5px;
  color: #3f3a34;
}
.sections li { margin: 0 0 3px; }

.note {
  background: var(--warn-soft);
  border: 1px dashed #ead7be;
  color: #5c3a16;
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13.5px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 16px;
  font-weight: 600;
}
.check-row input { width: 18px; height: 18px; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 16px;
}
.empty-mark {
  display: block;
  font-size: 28px;
  color: #c9a227;
  margin-bottom: 8px;
  transform: rotate(-8deg);
}

.footer-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 22px;
}

.progress-bar {
  height: 9px;
  background: #e6dccb;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 12px;
  box-shadow: inset 0 1px 3px rgba(80, 60, 30, 0.12);
}
.progress-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #1f4d4a, #3d8a74 62%, #f0c419);
  width: 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0 12px;
}

@media (prefers-reduced-motion: reduce) {
  .lesson-card,
  .open-page,
  .reader-bar .bar-btn {
    transition: none;
  }
  .lesson-card:hover,
  .login-mark,
  .hero-stamp,
  .select-card,
  .done-dot,
  .empty-mark,
  .hero-tape,
  .login-card::before {
    transform: none;
  }
}
