:root {
  --bg: #f4f7f6;
  --panel: #ffffff;
  --text: #18211f;
  --muted: #65716f;
  --line: #dce5e2;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --primary-soft: #d9f3ef;
  --accent: #b45309;
  --good: #16803c;
  --good-soft: #ddf7e7;
  --bad: #be123c;
  --bad-soft: #ffe4e6;
  --shadow: 0 18px 45px rgba(20, 38, 35, 0.08);
  --surface-2: #f4f8f7;
  --warn-soft: #fff7df;
  --warn-text: #8a4b0f;
  --warn-line: #f0cf7a;
  --bg-translucent: rgba(244, 247, 246, 0.96);
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background: #102522;
  color: #eef8f5;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 26px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f7c948;
  color: #102522;
  font-weight: 900;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 4px;
  color: #a9c8c2;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-button {
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  text-align: left;
  color: inherit;
  background: transparent;
}

.nav-button.active,
.nav-button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.main {
  width: min(1180px, 100%);
  padding: 28px;
  min-width: 0;
}

.top-bar {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 14px;
}

.back-button,
.back-nav {
  color: var(--primary-dark);
}

.bank-select-page {
  min-height: 100vh;
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 34px 22px;
  display: grid;
  align-content: center;
  gap: 22px;
}

.bank-select-hero {
  padding: 34px;
  border-radius: 8px;
  color: #f8fffd;
  background: linear-gradient(120deg, #102522, #0f766e);
  box-shadow: var(--shadow);
}

.bank-select-hero h1 {
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.08;
}

.bank-select-hero p:last-child {
  max-width: 680px;
  margin: 16px 0 0;
  color: #d6ebe7;
  line-height: 1.8;
}

.bank-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.exam-card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.exam-card {
  min-height: 220px;
}

.exam-home-button {
  margin-top: 20px;
  color: #f8fffd;
  border-color: rgba(255, 255, 255, 0.45);
}

.exam-home-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.bank-card {
  min-height: 190px;
  display: grid;
  gap: 10px;
  align-content: start;
  text-align: left;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}

.bank-card:hover {
  border-color: #9dd7cf;
  transform: translateY(-1px);
}

.bank-card-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 900;
}

.bank-card strong {
  font-size: 24px;
}

.bank-card em,
.bank-card i {
  font-style: normal;
  color: var(--muted);
  line-height: 1.6;
}

.hero {
  min-height: 230px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  padding: 34px;
  border-radius: 8px;
  color: #f8fffd;
  background:
    linear-gradient(120deg, rgba(16, 37, 34, 0.92), rgba(15, 118, 110, 0.82)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='360' viewBox='0 0 900 360'%3E%3Crect width='900' height='360' fill='%230f766e'/%3E%3Cg fill='none' stroke='%23f7c948' stroke-opacity='.32' stroke-width='2'%3E%3Cpath d='M60 80h260M60 132h330M60 184h210M520 74h260M520 126h310M520 178h240M126 260h650'/%3E%3C/g%3E%3Cg fill='%23ffffff' fill-opacity='.14'%3E%3Crect x='70' y='222' width='150' height='48' rx='6'/%3E%3Crect x='240' y='222' width='150' height='48' rx='6'/%3E%3Crect x='410' y='222' width='150' height='48' rx='6'/%3E%3Crect x='580' y='222' width='150' height='48' rx='6'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: #f7c948;
  font-size: 14px;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
}

.hero h1 {
  max-width: 760px;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1.05;
}

.hero-copy {
  max-width: 640px;
  margin: 16px 0 0;
  color: #d6ebe7;
  line-height: 1.8;
}

.hero-actions,
.head-actions,
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary,
.secondary,
.ghost {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 16px;
  border: 1px solid transparent;
  font-weight: 700;
}

.primary {
  background: var(--primary);
  color: #fff;
}

.primary:hover {
  background: var(--primary-dark);
}

.secondary {
  background: var(--panel);
  color: var(--primary-dark);
  border-color: var(--line);
}

.ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
}

.danger {
  color: var(--bad);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.metric {
  padding: 18px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.metric span,
.compact-question span,
.source,
.question-footer,
.filter-count,
.chapter-card span,
.section-head p {
  color: var(--muted);
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin: 26px 0 14px;
}

.section-head p {
  margin: 8px 0 0;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.chapter-card,
.compact-question {
  position: relative;
  overflow: hidden;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  text-align: left;
  box-shadow: 0 8px 20px rgba(20, 38, 35, 0.04);
}

.chapter-card {
  min-height: 132px;
  padding: 16px;
}

.chapter-card strong,
.chapter-card span {
  display: block;
}

.chapter-card strong {
  min-height: 48px;
  margin: 10px 0;
  line-height: 1.45;
}

.chapter-card i,
.progress-line i,
.mini-bar i {
  display: block;
  height: 100%;
  background: var(--primary);
}

.chapter-card i {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
}

.mock-paper-card {
  min-height: 172px;
}

.mock-paper-card strong {
  min-height: auto;
  margin-bottom: 6px;
}

.mock-paper-meta {
  line-height: 1.5;
}

.mock-paper-score {
  display: block;
  margin: 7px 0;
  color: var(--primary-dark);
}

.mock-score-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  padding: 16px 18px;
  border: 1px solid #9dd7cf;
  border-radius: 8px;
  background: var(--surface-2);
}

.mock-score-panel span,
.mock-score-panel p {
  color: var(--muted);
  font-size: 14px;
}

.mock-score-panel strong {
  display: block;
  margin-top: 4px;
  color: var(--primary-dark);
  font-size: 26px;
}

.mock-score-panel p {
  margin: 0;
  text-align: right;
}

.chapter-index {
  color: var(--accent);
  font-weight: 800;
}

.recent-list {
  margin-top: 26px;
}

.practice-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  min-width: 0;
}

.filter-panel {
  position: sticky;
  top: 28px;
  align-self: start;
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  min-width: 0;
}

.filter-panel label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  min-width: 0;
}

select,
input,
textarea {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  background: var(--panel);
  color: var(--text);
}

textarea {
  min-height: 132px;
  padding: 12px;
  resize: vertical;
  font: inherit;
  line-height: 1.7;
}

.question-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  min-width: 0;
}

.question-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 0 6px 8px 0;
  padding: 0 10px;
  border-radius: 99px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
}

.tag.muted {
  background: var(--surface-2);
  color: var(--muted);
}

.star {
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 42px;
  height: 38px;
  background: var(--panel);
  color: var(--accent);
  font-size: 22px;
}

.star.active {
  background: var(--warn-soft);
  border-color: var(--warn-line);
}

.progress-line {
  height: 5px;
  margin: 10px 0 22px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.question-stem {
  font-size: 18px;
  line-height: 1.85;
}

.question-stem p,
.answer-panel p {
  margin: 0 0 10px;
}

.study-block {
  margin: 18px 0;
  padding: 0 0 0 14px;
  border-left: 3px solid #9dd7cf;
}

.study-block h3 {
  margin: 0 0 9px;
  font-size: 16px;
}

.subjective-draft-label {
  display: grid;
  gap: 8px;
  margin: 20px 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.subjective-draft {
  color: var(--text);
  font-weight: 400;
}

.subjective-steps {
  display: grid;
  gap: 12px;
}

.reveal-step,
.reveal-law {
  justify-self: start;
}

.study-status {
  margin-top: 14px;
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 800;
}

.law-recall {
  margin: 20px 0;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.law-recall span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.law-recall h2 {
  margin: 8px 0;
  font-size: 24px;
  line-height: 1.4;
}

.law-recall p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.choices {
  display: grid;
  gap: 10px;
  margin: 22px 0;
}

.choices.judge {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  width: 100%;
  min-height: 52px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  text-align: left;
}

.choice span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 28px;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--primary-dark);
  font-weight: 900;
}

.choice b {
  line-height: 1.7;
  font-weight: 600;
}

.choice.picked {
  border-color: var(--primary);
  background: var(--surface-2);
}

.choice.correct {
  border-color: #78c998;
  background: var(--good-soft);
}

.choice.wrong {
  border-color: #f0a2b5;
  background: var(--bad-soft);
}

.actions {
  margin-top: 18px;
}

.question-actions {
  align-items: stretch;
}

.question-actions > button {
  min-width: 112px;
}

.hint,
.answer-panel,
.empty {
  margin-top: 18px;
  border-radius: 8px;
  padding: 16px;
}

.hint {
  background: #f6f1e8;
  color: var(--warn-text);
}

.hint.warning {
  background: var(--warn-soft);
  color: #9a3412;
  border: 1px solid #fed7aa;
}

.answer-panel {
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.answer-panel.ok {
  border-color: #9bd8b2;
  background: var(--good-soft);
}

.answer-panel.bad {
  border-color: #f0a2b5;
  background: var(--bad-soft);
}

.answer-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-weight: 800;
}

.explain,
.answer-text {
  line-height: 1.85;
}

.answer-table-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 12px 0 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  -webkit-overflow-scrolling: touch;
}

.answer-table {
  min-width: min(680px, 100%);
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.answer-table.compact {
  min-width: min(460px, 100%);
}

.answer-table.medium {
  min-width: 560px;
}

.answer-table.wide {
  min-width: 760px;
}

.answer-table th,
.answer-table td {
  white-space: normal;
  vertical-align: top;
  line-height: 1.65;
  word-break: normal;
  overflow-wrap: break-word;
}

.answer-table th {
  color: var(--text);
  font-weight: 800;
}

.question-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.question-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
  gap: 7px;
  max-height: 156px;
  margin-top: 18px;
  padding: 12px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.question-number {
  aspect-ratio: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.question-number.done {
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-color: #9dd7cf;
}

.question-number.has-wrong {
  color: var(--bad);
  background: var(--bad-soft);
  border-color: #f2a4b5;
}

.question-number.current {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.18);
}

.access-gate {
  min-height: calc(100vh - 56px);
  display: grid;
  place-items: center;
  padding: 24px 0;
}

.gate-card {
  width: min(560px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  text-align: center;
}

.gate-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  border-radius: 8px;
  background: var(--warn-soft);
  color: var(--warn-text);
  font-size: 24px;
  font-weight: 900;
}

.gate-card h1 {
  font-size: 28px;
  line-height: 1.25;
}

.gate-card p {
  margin: 12px auto 18px;
  color: var(--muted);
  line-height: 1.7;
}

.buy-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin-bottom: 14px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--warn-soft);
  color: var(--warn-text);
  border: 1px solid var(--warn-line);
  font-weight: 800;
  text-decoration: none;
}

.share-purchase-steps {
  margin: 18px 0;
  text-align: left;
}

.share-purchase-steps h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
}

.share-purchase-steps ol {
  margin: 10px 0 12px;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

.share-copy {
  padding: 12px;
  border: 1px solid var(--warn-line);
  border-radius: 8px;
  background: var(--warn-soft);
  color: var(--text);
  line-height: 1.65;
  font-size: 13px;
  overflow-wrap: anywhere;
  user-select: text;
}

.share-copy-button {
  width: 100%;
  margin: 10px 0 2px;
}

.bank-card.locked {
  border-style: dashed;
}

.password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.password-error {
  margin-top: 10px;
  color: var(--bad);
  font-weight: 700;
}

.purchase-done,
.purchase-required {
  margin: 0 auto 12px;
  font-size: 13px;
  font-weight: 700;
}

.purchase-done {
  color: var(--good);
}

.purchase-required {
  color: var(--accent);
}

.book-note {
  grid-column: 1 / -1;
  padding: 12px;
  border-radius: 8px;
  background: #f6f1e8;
  color: var(--warn-text);
  line-height: 1.6;
  font-size: 13px;
}

.review-list {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.review-block {
  min-width: 0;
}

.question-area,
.answer-panel,
.answer-text,
.explain {
  min-width: 0;
}

.compact-question {
  display: grid;
  gap: 8px;
  margin: 10px 0;
  padding: 14px;
}

.compact-question strong {
  line-height: 1.55;
}

.compact-question em {
  color: var(--accent);
  font-style: normal;
  font-size: 13px;
}

.empty {
  background: var(--panel);
  border: 1px dashed var(--line);
  color: var(--muted);
}

.empty.large {
  min-height: 260px;
  display: grid;
  place-items: center;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.compact-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  background: var(--surface-2);
  font-size: 14px;
}

.mini-bar {
  width: 140px;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.calculator-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 28px;
  font-weight: 900;
  box-shadow: 0 16px 34px rgba(15, 118, 110, 0.28);
}

.calculator-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  width: min(340px, calc(100vw - 24px));
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 22px 55px rgba(20, 38, 35, 0.2);
}

.calculator-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.calculator-head strong {
  font-size: 14px;
}

.calculator-close {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 20px;
  font-weight: 800;
}

.calculator-input {
  height: 34px;
  font-size: 16px;
  font-weight: 700;
  text-align: left;
}

.calculator-result {
  min-height: 22px;
  padding: 3px 2px 5px;
  color: var(--primary-dark);
  font-size: 15px;
  font-weight: 900;
  text-align: right;
  word-break: break-all;
}

.calculator-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  grid-auto-flow: row;
}

.calculator-grid button {
  aspect-ratio: auto;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.calculator-tool {
  background: var(--surface-2);
  color: var(--primary-dark);
}

.calculator-operator,
.calculator-equals {
  background: var(--primary);
  color: #fff;
}

.calculator-zero {
  grid-column: span 2;
}

.bottom-nav {
  display: none;
}

@media (max-width: 880px) {
  .app-shell {
    display: block;
    padding-bottom: 70px;
  }

  .sidebar {
    display: none;
  }

  .main {
    padding: 12px;
  }

  .top-bar {
    position: sticky;
    top: 0;
    z-index: 5;
    margin: -2px 0 10px;
    padding: 6px 0;
    background: var(--bg-translucent);
  }

  .back-button {
    width: 100%;
    min-height: 40px;
    background: var(--panel);
  }

  .hero {
    min-height: 250px;
    display: grid;
    align-items: end;
    padding: 22px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .hero-copy {
    line-height: 1.65;
  }

  .metric-grid,
  .practice-layout {
    grid-template-columns: 1fr;
  }

  .filter-panel {
    position: static;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .filter-panel label {
    font-size: 12px;
  }

  .filter-panel label:last-of-type,
  .filter-count {
    grid-column: 1 / -1;
  }

  .section-head,
  .answer-head {
    display: grid;
  }

  .mock-score-panel {
    display: grid;
    gap: 6px;
  }

  .mock-score-panel p {
    text-align: left;
  }

  .choices.judge {
    grid-template-columns: 1fr;
  }

  .question-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .question-actions > button {
    min-width: 0;
    padding: 0 8px;
    white-space: nowrap;
  }

  .question-actions .action-redo {
    grid-column: 1 / -1;
  }

  .subjective-actions,
  .law-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .subjective-actions .action-prev,
  .subjective-actions .action-next,
  .law-actions .action-prev,
  .law-actions .action-next {
    grid-column: auto;
  }

  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--line);
  }

  .bottom-nav .nav-button {
    text-align: center;
    color: var(--muted);
  }

  .bottom-nav .nav-button.active {
    color: var(--primary-dark);
    background: var(--primary-soft);
  }

  .calculator-fab {
    right: 14px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    width: 52px;
    height: 52px;
    font-size: 26px;
  }

  .calculator-panel {
    right: 12px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    width: calc(100vw - 24px);
    max-width: 360px;
    padding: 8px;
  }

  .calculator-grid {
    gap: 5px;
  }

  .calculator-grid button {
    min-height: 30px;
    font-size: 13px;
  }

  .gate-card {
    padding: 22px;
  }

  .gate-card h1 {
    font-size: 24px;
  }
}

@media (max-width: 520px) {
  .bank-select-page {
    padding: 18px 14px;
    align-content: start;
  }

  .bank-select-hero {
    padding: 24px 18px;
  }

  .bank-card-grid {
    grid-template-columns: 1fr;
  }

  .bank-card {
    min-height: 150px;
    padding: 20px;
  }

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

  .metric {
    padding: 14px;
  }

  .metric strong {
    font-size: 24px;
  }

  .chapter-grid {
    grid-template-columns: 1fr;
  }

  .chapter-card {
    min-height: 112px;
  }

  .question-card {
    padding: 14px;
    box-shadow: 0 10px 26px rgba(20, 38, 35, 0.07);
  }

  .question-nav-grid {
    grid-template-columns: repeat(auto-fill, minmax(30px, 1fr));
    gap: 6px;
    max-height: 142px;
    padding: 10px;
  }

  .question-number {
    font-size: 11px;
    border-radius: 5px;
  }

  .question-stem {
    font-size: 16px;
    line-height: 1.75;
  }

  .law-recall h2 {
    font-size: 20px;
  }

  .study-block {
    padding-left: 11px;
  }

  .choice {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
    padding: 11px;
  }

  .choice span {
    width: 30px;
    height: 28px;
  }

  .actions > button {
    flex: 1 1 42%;
  }

  .password-row {
    grid-template-columns: 1fr;
  }

  .compact-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .answer-table {
    font-size: 13px;
  }

  .answer-table.wide {
    min-width: 720px;
  }

  th,
  td {
    padding: 10px;
  }
}
/* Original PDF crops keep mathematical diagrams and tables readable on demand. */
.source-figure {
  margin: 16px 0;
}
.source-figure a {
  display: block;
}
.source-figure img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid #dbe6e3;
  border-radius: 8px;
  background: var(--panel);
}
.source-figure figcaption {
  margin-top: 6px;
  color: #64748b;
  font-size: 12px;
}
.source-original-toggle {
  margin: 12px 0;
}
.source-original-toggle > summary {
  color: #0f766e;
  cursor: pointer;
  line-height: 1.6;
}

/* ---------- Offer, author proof, update log ---------- */
.offer-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--warn-line);
  border-radius: 8px;
  background: var(--warn-soft);
}

.offer-banner div {
  display: grid;
  gap: 4px;
}

.offer-banner strong {
  color: var(--warn-text);
  font-size: 17px;
}

.offer-banner span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.offer-banner.unlocked {
  display: grid;
  gap: 4px;
  border-color: #b7e4c7;
  background: var(--good-soft);
}

.offer-banner.unlocked strong {
  color: var(--good);
}

.offer-banner .primary {
  flex: none;
}

.info-section {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.info-section h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.4;
}

.author-home-entry {
  margin: 16px 0;
}

.cross-bank-card {
  margin: 16px 0;
  padding: 10px 16px;
  background: #eef7f4;
  border: 1px solid #d5e9e1;
  border-radius: 12px;
}

.cross-bank-link {
  color: #0f665c;
  text-underline-offset: 3px;
}

.cross-bank-card a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.author-home-entry a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}

.info-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.score-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 8px;
  background: var(--primary-soft);
}

.score-card span {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
}

.score-card strong {
  font-size: 16px;
  line-height: 1.45;
}

.score-card em {
  color: var(--accent);
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

.info-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.season-promise {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 14px;
  border-left: 4px solid var(--primary);
  border-radius: 4px 8px 8px 4px;
  background: var(--surface-2);
}

.season-promise span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.update-log {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.update-log li {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 10px;
  font-size: 14px;
  line-height: 1.6;
}

.update-log b {
  color: var(--primary-dark);
}

.update-log span {
  color: var(--muted);
}

.proof-list {
  display: grid;
  gap: 16px;
}

.proof-figure {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.proof-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

.proof-figure figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ---------- Purchase card ---------- */
.gate-card {
  position: relative;
  text-align: left;
}

.gate-card h1 {
  text-align: center;
}

.gate-close {
  margin-bottom: 8px;
}

.trial-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.trial-summary div {
  display: grid;
  gap: 2px;
  padding: 12px 6px;
  border-radius: 8px;
  background: var(--primary-soft);
  text-align: center;
}

.trial-summary b {
  font-size: 22px;
  color: var(--primary-dark);
}

.trial-summary span {
  color: var(--muted);
  font-size: 13px;
}

.gate-card .trial-summary + p {
  text-align: center;
}

.benefit-list {
  display: grid;
  gap: 8px;
  margin: 4px 0 14px;
  padding: 0;
  list-style: none;
}

.benefit-list li {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.benefit-list b {
  display: block;
  color: var(--text);
}

.trust-strip {
  width: 100%;
  min-height: 0;
  padding: 10px 12px;
  border: 1px dashed var(--warn-line);
  border-radius: 8px;
  background: var(--warn-soft);
  color: var(--warn-text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
}

.purchase-options {
  display: grid;
  gap: 12px;
  margin: 14px 0;
}

.purchase-option {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.purchase-option.recommended {
  border: 2px solid var(--primary);
}

.purchase-option-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.purchase-option-head b {
  color: var(--bad);
  font-size: 24px;
}

.purchase-option p,
.purchase-option ol {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.purchase-option ol {
  padding-left: 20px;
}

.purchase-option .buy-link {
  margin-bottom: 0;
}

.redeem-box h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.purchase-faq {
  margin-top: 16px;
  font-size: 14px;
}

.purchase-faq summary {
  cursor: pointer;
  font-weight: 700;
}

.purchase-faq dt {
  margin-top: 10px;
  font-weight: 700;
}

.purchase-faq dd {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

@media (max-width: 760px) {
  .offer-banner {
    flex-direction: column;
    align-items: stretch;
  }

  .score-grid {
    grid-template-columns: 1fr;
  }

  .update-log li {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .info-section {
    padding: 16px;
  }
}

.proof-page .bank-select-hero .ghost {
  border-color: rgba(255, 255, 255, 0.6);
  color: #ffffff;
}

/* ---------- Daily question ---------- */
.daily-card {
  padding: 20px;
  border: 2px solid var(--primary);
  border-radius: 10px;
  background: var(--panel);
}

.daily-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.daily-badge {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

.daily-stem {
  margin: 12px 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.7;
}

.daily-options {
  display: grid;
  gap: 8px;
}

.daily-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-weight: 500;
  text-align: left;
  line-height: 1.55;
}

.daily-option b {
  flex: none;
  color: var(--primary);
}

.daily-option.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.daily-option.correct {
  border-color: var(--good);
  background: var(--good-soft);
}

.daily-option.wrong {
  border-color: var(--bad);
  background: var(--bad-soft);
}

.daily-option:disabled {
  opacity: 1;
  cursor: default;
}

.daily-result {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 12px;
  border-radius: 8px;
}

.daily-result.ok {
  background: var(--good-soft);
  color: var(--good);
}

.daily-result.bad {
  background: var(--bad-soft);
  color: var(--bad);
}

.daily-result span {
  color: var(--muted);
  font-size: 13px;
}

.daily-explain {
  margin-top: 10px;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
}

.daily-explain b {
  display: block;
  margin-bottom: 2px;
  color: var(--primary-dark);
}

.daily-explain.trap {
  background: var(--warn-soft);
}

.daily-explain.trap b {
  color: var(--warn-text);
}

.daily-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.daily-actions button {
  flex: 1;
  min-width: 140px;
}

.daily-foot {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.daily-cta {
  margin: 12px 0 0;
}

.share-image {
  display: block;
  width: 100%;
  height: auto;
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.share-page .share-copy {
  display: block;
  font-size: 14px;
}

.seller-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 14px;
}

.seller-search span {
  grid-column: 1 / -1;
  color: var(--muted);
}

.seller-search strong {
  font-size: 17px;
  color: var(--text);
}

.seller-search em {
  grid-column: 1 / -1;
  color: var(--good);
  font-size: 13px;
  font-style: normal;
}

/* ---------- Study notes ---------- */
.notes-entry {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  gap: 2px 12px;
  align-items: center;
  width: 100%;
  min-height: 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.notes-entry-tag {
  grid-row: 1 / 3;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--warn-soft);
  color: var(--warn-text);
  font-size: 13px;
  font-weight: 800;
}

.notes-entry strong {
  font-size: 17px;
}

.notes-entry em {
  grid-column: 2;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.5;
}

.notes-entry b {
  grid-column: 3;
  grid-row: 1 / 3;
  color: var(--muted);
  font-size: 22px;
}

.notes-tabs {
  display: flex;
  gap: 6px;
  margin: 14px 0 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.notes-tabs button {
  flex: none;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.notes-tabs button.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.note-group {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.note-group summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 700;
  cursor: pointer;
}

.note-group summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.note-group ol {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.7;
}

.past-stem {
  margin: 10px 0 6px;
  font-size: 14px;
  line-height: 1.7;
}

.past-options {
  margin: 0;
  padding-left: 0;
  list-style: none;
  font-size: 14px;
  line-height: 1.8;
}

.past-options b {
  color: var(--primary);
}

.past-answer {
  margin: 8px 0 4px;
  color: var(--good);
  font-weight: 700;
}

.past-explain {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.past-explain.trap {
  color: var(--warn-text);
}

.note-links {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.note-links li {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.note-links a {
  color: var(--primary);
  font-weight: 700;
}

.note-links span {
  color: var(--muted);
  font-size: 13px;
}

.notes-page .offer-banner {
  margin-top: 14px;
}

.seller-search.token {
  background: var(--warn-soft);
}

.score-card.pending {
  background: var(--surface-2);
}

.score-card.pending strong {
  color: var(--muted);
  font-weight: 600;
}

.score-card.pending em {
  color: var(--muted);
}

.honest-note {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--warn-soft);
  color: var(--warn-text);
  font-size: 14px;
  line-height: 1.7;
}

/* ---------- Practice: collapsible filters, compact chrome ---------- */
.filter-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  cursor: pointer;
  list-style: none;
}

.filter-summary::-webkit-details-marker {
  display: none;
}

.filter-summary span {
  flex: none;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
}

.filter-summary span::after {
  content: " ▾";
}

.filter-panel[open] .filter-summary span::after {
  content: " ▴";
}

.filter-summary em {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.filter-body {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.auto-next-toggle {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px !important;
  color: var(--text) !important;
  font-size: 14px !important;
}

.auto-next-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

@media (max-width: 880px) {
  .top-bar {
    margin: -4px 0 8px;
    padding: 4px 0;
  }

  .back-button {
    width: auto;
    min-height: 34px;
    padding: 0 14px;
    font-size: 14px;
  }

  .back-button::before {
    content: "‹ ";
    font-weight: 900;
  }

  .filter-panel {
    display: block;
    padding: 10px 12px;
  }

  .filter-body {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    margin-top: 12px;
  }

  .filter-body label:has(input[data-action="search"]),
  .filter-body .filter-count,
  .filter-body .auto-next-toggle,
  .filter-body .book-note {
    grid-column: 1 / -1;
  }

  .calculator-fab {
    right: 12px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    width: 44px;
    height: 44px;
    font-size: 22px;
    opacity: 0.92;
  }

  .calculator-panel {
    right: 12px;
    bottom: calc(76px + env(safe-area-inset-bottom));
  }

  /* Chapter overview: compact rows instead of tall cards */
  .chapter-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .chapter-card:not(.mock-paper-card) {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 2px 10px;
    align-items: center;
    min-height: 0;
    padding: 12px 14px 14px;
  }

  .chapter-card:not(.mock-paper-card) .chapter-index {
    grid-row: 1 / 3;
    color: var(--primary);
    font-weight: 800;
  }

  .chapter-card:not(.mock-paper-card) strong {
    min-height: 0;
    margin: 0;
    font-size: 15px;
  }

  .chapter-card:not(.mock-paper-card) span:not(.chapter-index) {
    font-size: 12px;
  }

  /* Home: compact hero so the offer and daily question show on the first screen */
  .exam-select-hero {
    padding: 20px 18px;
  }

  .exam-select-hero h1 {
    font-size: 28px;
  }

  .exam-select-hero p:last-child {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.65;
  }
}


/* ---------- Dark mode (follows the phone's system setting) ---------- */
@media (prefers-color-scheme: dark) {
  :root {
  --bg: #0f1716;
  --panel: #172220;
  --text: #e4edeb;
  --muted: #9aaba8;
  --line: #2b3a37;
  --primary: #13958a;
  --primary-dark: #7fd8cc;
  --primary-soft: #183c38;
  --accent: #f59e0b;
  --good: #4ade80;
  --good-soft: #15321f;
  --bad: #fb7185;
  --bad-soft: #3b1820;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  --surface-2: #1c2927;
  --warn-soft: #2d2513;
  --warn-text: #f2c86b;
  --warn-line: #6a5422;
  --bg-translucent: rgba(15, 23, 22, 0.94);
  color-scheme: dark;
  }

  body {
    background: var(--bg);
    color: var(--text);
  }

  input,
  select,
  textarea {
    background: var(--panel);
    color: var(--text);
    border-color: var(--line);
  }

  .score-card.pending,
  .daily-explain {
    background: var(--surface-2);
  }
}

/* ---------- Countdown & buyers ---------- */
.countdown-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bad-soft);
  color: var(--bad);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.exam-card {
  position: relative;
}

.countdown-line {
  display: inline-block;
  margin: 10px 0 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 14px;
}

.countdown-line b {
  color: #facc15;
  font-size: 18px;
}

.buyer-line {
  margin: 10px 0 4px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.buyer-line b {
  color: var(--primary);
  font-size: 18px;
}

/* ---------- Mobile density pass ---------- */
@media (max-width: 760px) {
  .bank-card-grid {
    gap: 10px;
  }

  .bank-card {
    grid-template-columns: 44px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    gap: 2px 14px;
    align-content: center;
    min-height: 0;
    padding: 14px 16px;
    box-shadow: none;
  }

  .bank-card .bank-card-mark {
    grid-row: 1 / 4;
    align-self: center;
  }

  .bank-card strong {
    font-size: 18px;
  }

  .bank-card em,
  .bank-card i {
    font-size: 13px;
  }

  .exam-card .countdown-badge {
    top: 12px;
    right: 12px;
    font-size: 12px;
  }

  .hero {
    min-height: 0;
    padding: 18px;
  }

  .hero h1 {
    font-size: 26px;
    line-height: 1.2;
  }

  .hero-copy {
    margin-top: 8px;
    font-size: 14px;
  }

  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .metric {
    padding: 10px 12px;
  }

  .metric span {
    font-size: 12px;
  }

  .metric strong {
    margin-top: 2px;
    font-size: 20px;
  }
}

@media (prefers-color-scheme: dark) {
  .bottom-nav {
    background: var(--bg-translucent) !important;
  }

  .bank-card:hover {
    border-color: var(--primary);
  }
}

.daily-switch {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 12px;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface-2);
}

.daily-switch button {
  min-height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.daily-switch button.active {
  background: var(--primary);
  color: #fff;
}

.early-bird {
  margin: 12px 0 4px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bad-soft);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.early-bird b {
  display: block;
  color: var(--bad);
}

.last-subject-entry .notes-entry-tag {
  background: var(--bad-soft);
  color: var(--bad);
}

.last-subject-tip {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 14px;
  line-height: 1.7;
}

.last-subject-steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.last-subject-steps li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.step-index {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

.last-subject-steps strong {
  display: block;
  font-size: 15px;
}

.last-subject-steps em {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  line-height: 1.5;
}

.last-subject-steps .primary {
  min-height: 34px;
  padding: 0 12px;
  font-size: 14px;
}

/* ---------- Study today: streak & spaced review ---------- */
.study-today {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.study-today-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.study-today-head div {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--primary-soft);
}

.study-today-head b {
  color: var(--primary-dark);
  font-size: 24px;
}

.study-today-head span {
  color: var(--muted);
  font-size: 13px;
}

.study-due-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
}

.study-due-row em {
  color: var(--bad);
  font-size: 13px;
  font-style: normal;
}

.study-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.review-note {
  margin: 10px 0 0;
  color: var(--warn-text);
  font-size: 13px;
  font-weight: 700;
}

.review-note.ok {
  color: var(--good);
}

.due-button {
  background: var(--bad) !important;
  border-color: var(--bad) !important;
}

/* 题库由来（折叠） */
.origin-section summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.origin-section summary::-webkit-details-marker { display: none; }
.origin-section summary span { color: var(--muted, #65716f); font-size: 13px; }
.origin-section[open] summary span { visibility: hidden; }
.origin-section p { margin: 10px 0 0; line-height: 1.75; }
.update-section summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.update-section summary::-webkit-details-marker { display: none; }
.update-section summary span { color: var(--muted, #65716f); font-size: 13px; }
.update-section:not([open]) .season-promise, .update-section:not([open]) .update-log { display: none; }
.update-section[open] summary { margin-bottom: 10px; }
.origin-tip { color: var(--muted, #65716f); font-size: 13px; }
.origin-item { border-top: 1px solid var(--line, #e3e7e6); }
.origin-item summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; cursor: pointer; list-style: none; }
.origin-item summary::-webkit-details-marker { display: none; }
.origin-item summary b::before { content: "▸ "; color: var(--accent, #1f7a6d); }
.origin-item[open] summary b::before { content: "▾ "; }
.origin-item summary span { color: var(--muted, #65716f); font-size: 13px; text-align: right; }
.origin-item ul { list-style: none; padding: 0 0 12px; margin: 0; display: grid; gap: 8px; }
.origin-item li { line-height: 1.7; }
.origin-item li b { margin-right: 2px; }
@media (max-width: 560px) { .origin-item summary { flex-direction: column; align-items: flex-start; gap: 2px; } .origin-item summary span { text-align: left; } }
.kp-section { margin: 18px 0; }
.kp-head h2 { margin: 0 0 4px; }
.kp-head p { margin: 0 0 10px; color: var(--muted, #65716f); font-size: 14px; line-height: 1.6; }
.kp-card { border: 1px solid var(--line, #e3e7e6); border-radius: 10px; padding: 0 14px; margin-bottom: 8px; background: var(--panel, #fff); }
.kp-card summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; cursor: pointer; list-style: none; }
.kp-card summary::-webkit-details-marker { display: none; }
.kp-card summary span { color: var(--muted, #65716f); font-size: 13px; white-space: nowrap; }
.kp-list { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 8px; }
.kp-list li { line-height: 1.7; }
.kp-list b { display: block; }
.kp-list span { color: var(--text, #23302e); font-size: 14px; }
.kp-card .primary { margin-bottom: 12px; }
.kp-practice { margin-bottom: 12px; }
.exam-preview-card { margin: 0 0 14px; padding: 14px 16px; border-radius: 12px; border: 1px dashed var(--accent, #1f7a6d); background: var(--panel, #fff); }
.exam-preview-card p { margin: 6px 0 0; line-height: 1.7; color: var(--muted, #65716f); }
@media (max-width: 560px) { .kp-card summary { flex-direction: column; align-items: flex-start; gap: 2px; } }
.notes-level { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 12px; }
.notes-level button { padding: 10px; border-radius: 10px; border: 1px solid var(--line, #e3e7e6); background: var(--panel, #fff); font-weight: 600; cursor: pointer; }
.notes-level button.active { background: var(--accent, #1f7a6d); border-color: var(--accent, #1f7a6d); color: #fff; }
/* ---- 首页瘦身：继续上次练习、折叠条、初级路线 ---- */
.resume-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; padding: 14px 16px; border-radius: 14px; background: var(--panel, #fff); border: 1px solid var(--accent, #1f7a6d); }
.resume-card div { display: grid; gap: 2px; }
.resume-card span { color: var(--muted, #65716f); font-size: 13px; }
.resume-card em { font-style: normal; color: var(--muted, #65716f); font-size: 13px; }
.fold-card { margin: 12px 0; padding: 0 16px; border: 1px solid var(--line, #e3e7e6); border-radius: 14px; background: var(--panel, #fff); }
.fold-card > summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 0; cursor: pointer; list-style: none; }
.fold-card > summary::-webkit-details-marker { display: none; }
.fold-card > summary span { color: var(--muted, #65716f); font-size: 13px; text-align: right; }
.fold-card[open] { padding-bottom: 12px; }
.fold-card .info-section, .fold-card .study-today, .fold-card .notes-entry { margin-top: 0; }
.path-card { margin: 0 0 14px; padding: 16px; border-radius: 14px; background: var(--panel, #fff); border: 1px solid var(--line, #e3e7e6); }
.path-card h2 { margin: 0 0 10px; font-size: 18px; }
.path-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.path-steps button { width: 100%; display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line, #e3e7e6); border-radius: 12px; background: transparent; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.path-index { flex: 0 0 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent, #1f7a6d); color: #fff; font-weight: 700; }
.path-steps li.done .path-index { background: #2e9b5f; }
.path-text { display: grid; gap: 3px; flex: 1; }
.path-text em { font-style: normal; color: var(--muted, #65716f); font-size: 13px; }
.path-text small { color: var(--muted, #65716f); font-size: 12px; }
.path-bar { display: block; height: 6px; border-radius: 3px; background: var(--line, #e3e7e6); overflow: hidden; }
.path-bar b { display: block; height: 100%; background: var(--accent, #1f7a6d); }
@media (max-width: 560px) { .fold-card > summary { flex-direction: column; align-items: flex-start; gap: 2px; } .fold-card > summary span { text-align: left; } }

/* 置顶：初中级考试新增考点 */
.pinned-exam-card {
  display: grid;
  gap: 4px;
  width: 100%;
  margin: 0 0 14px;
  padding: 16px 18px;
  text-align: left;
  border: 2px solid var(--warn-line);
  border-radius: 10px;
  background: var(--warn-soft);
  color: var(--text);
  cursor: pointer;
  font: inherit;
}
.pinned-exam-card:hover { border-color: var(--accent); }
.pinned-exam-card:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.pinned-tag { justify-self: start; padding: 2px 10px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; }
.pinned-exam-card strong { font-size: 18px; }
.pinned-exam-card em { font-style: normal; color: var(--warn-text); font-weight: 600; }
.pinned-exam-card i { font-style: normal; color: var(--muted); font-size: 13px; }

/* 购买页：哪些情况要填邀请码 */
.price-rule-note { margin: 10px 0 6px; padding: 8px 10px; border-radius: 8px; background: var(--warn-soft); color: var(--warn-text); font-size: 13px; line-height: 1.6; }

/* 品牌徽标 + 演示视频 */
.brand-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.author-badge { display: inline-flex; border-radius: 50%; }
.author-badge img { display: block; border-radius: 50%; }
.demo-btn { margin-left: auto; padding: 4px 12px; border: 1px solid var(--primary); border-radius: 999px; background: var(--panel); color: var(--primary); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.video-dialog { padding: 10px; width: min(420px, calc(100vw - 32px)); border: 0; border-radius: 14px; background: var(--panel); }
.video-dialog form { text-align: right; }
.video-dialog video { display: block; width: 100%; aspect-ratio: 9 / 16; max-height: calc(100vh - 120px); border-radius: 10px; background: #000; }
/* 中级早鸟自测卷入口 */
.selftest-card { display: grid; gap: 6px; width: 100%; margin: 0 0 14px; padding: 16px 18px; text-align: left; border: 0; border-radius: 14px; color: #fff; background: linear-gradient(135deg, #c2410c, #9a3412); box-shadow: 0 6px 18px #9a341233; }
.selftest-card strong { font-size: 1.12rem; }
.selftest-card em { font-style: normal; opacity: .92; font-size: .92rem; line-height: 1.55; }
.selftest-card b { font-size: .95rem; color: #fde68a; }
.selftest-badge { justify-self: start; padding: 2px 8px; border-radius: 999px; background: #ffffff2b; font-size: .78rem; }
.selftest-tip { margin: 6px 0 0; font-size: .88rem; opacity: .85; }
.selftest-result { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; font-size: .92rem; line-height: 1.55; }
.selftest-result.pass { background: #dcfce7; color: #14532d; }
.selftest-result.fail { background: #fef3c7; color: #78350f; }
.selftest-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 6px; }
.selftest-actions button { display: grid; gap: 2px; padding: 10px 12px; border: 0; border-radius: 10px; background: #fff; color: #9a3412; font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.selftest-actions button small { font-weight: 400; color: #7c2d12; font-size: .82rem; }
.selftest-actions button:hover { background: #ffedd5; }

.promise-line { margin-top: 8px; padding: 6px 10px; border-radius: 8px; background: #ffffff26; font-weight: 700; line-height: 1.55; }

/* ---------- 整卷计时 ---------- */
/* 顶栏（返回上一级）也是 sticky、高 42px，计时条贴在它下面，不挡返回按钮 */
.exam-timer { position: sticky; top: 48px; z-index: 4; box-shadow: var(--shadow); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-weight: 700; font-variant-numeric: tabular-nums; }
.exam-timer.running { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); }
.exam-timer.over { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.exam-timer.paused { background: var(--surface-2); }
.exam-timer.done { border-color: var(--good); background: var(--good-soft); color: var(--good); font-weight: 600; }
.exam-timer-actions { display: flex; gap: 6px; }
.exam-timer button { min-height: 34px; padding: 0 12px; font-size: 14px; }

/* ---------- 备考计划 ---------- */
.plan-entry { margin-top: 12px; }
.plan-entry-saved { border-color: var(--primary); }
.plan-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.plan-row > span { flex: none; min-width: 64px; color: var(--muted); font-size: 14px; }
.plan-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.plan-chip { min-height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--text); font-size: 14px; font-weight: 600; }
.plan-chip.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.plan-warn { color: var(--bad); }
.plan-row.plan-custom { flex-wrap: nowrap; }
.plan-row.plan-custom em { flex: none; color: var(--muted); font-size: 14px; font-style: normal; font-weight: 400; }
.plan-row.plan-custom .plan-minutes { flex: 0 0 120px; width: 120px; margin: 0; }
.plan-minutes { width: 120px; min-height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); font-size: 15px; }
.plan-minutes.active { border-color: var(--primary); background: var(--primary-soft); }
.plan-date { min-height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); font-size: 15px; }
.plan-hint { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.plan-days { margin: 0; font-size: 16px; }
.plan-days b { color: var(--primary); font-size: 26px; }
.plan-status { margin: 8px 0 12px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); font-size: 14px; line-height: 1.6; }
.plan-status.ok { background: var(--good-soft); }
.plan-status.tight { background: var(--warn-soft); color: var(--warn-text); }
.plan-steps li { grid-template-columns: 28px minmax(0, 1fr); align-items: start; }
.plan-steps strong small { display: block; margin-top: 2px; color: var(--primary); font-size: 13px; font-weight: 600; }
.plan-steps p { margin: 6px 0 0; font-size: 13px; line-height: 1.6; }
.plan-steps .primary { grid-column: 2; justify-self: start; }
.plan-daily { display: grid; gap: 4px; margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 8px; font-size: 13px; line-height: 1.6; }
.plan-share-btn { width: 100%; margin-top: 12px; min-height: 40px; white-space: normal; line-height: 1.5; }
.plan-share { margin-top: 12px; }
.selftest-plan { width: 100%; margin-top: 8px; min-height: 40px; white-space: normal; }

/* ---------- 首页整理：统一间距 ---------- */
.exam-select-page { gap: 16px; }
.exam-select-page > * { margin-top: 0 !important; margin-bottom: 0 !important; }
.origin-fold .origin-item:first-of-type { border-top: 1px solid var(--line); }
#sprintTeaser > *, #referralPanel > * { margin-top: 0; margin-bottom: 0; }
#sprintTeaser:empty, #referralPanel:empty { display: none; }

/* 手机上题库栏目卡片紧凑一些（一页能看到更多栏目） */
@media (max-width: 640px) {
  .bank-card-grid { gap: 10px; }
  .bank-card-grid .bank-card { min-height: 0; padding: 12px 14px; gap: 2px 12px; box-shadow: none; }
  .bank-card-grid .bank-card strong { font-size: 18px; }
  .bank-card-grid .bank-card-mark { width: 38px; height: 38px; }
}
.exam-home-button, .exam-home-button:visited { color: #fff !important; border-color: rgba(255, 255, 255, 0.7) !important; opacity: 1; }
.referral-fold { margin-top: 10px; }
.referral-fold > summary { color: var(--muted); font-size: 14px; cursor: pointer; }
.referral-fold[open] > summary { margin-bottom: 6px; }

/* ---------- 题库可以免费拿 ---------- */
.free-way { border-color: #f0cf7a; background: var(--warn-soft); }
.free-way > summary { display: grid; gap: 3px; }
.free-way > summary b { color: var(--warn-text); font-size: 16px; }
.free-way > summary span { color: var(--text); text-align: left; font-size: 14px; line-height: 1.5; }
.free-way ol { margin: 4px 0 0; padding-left: 1.3em; display: grid; gap: 6px; font-size: 14px; line-height: 1.6; }
.free-way ol b { color: var(--warn-text); }
.free-note { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.gate-card .free-way { margin-top: 12px; text-align: left; }

/* 做题页：答完后选项保持清楚，正确 / 选错的选项字母变实心 */
.question-tags { min-width: 0; }
.question-top .source { display: block; margin-top: 2px; font-size: 13px; line-height: 1.5; }
.question-top .star { flex: 0 0 auto; }
.choice:disabled { opacity: 1; cursor: default; color: var(--text); }
.choices.answered .choice:not(.correct):not(.wrong) b { color: var(--muted); }
.choice.correct span { background: #2e9d5b; color: #fff; }
.choice.wrong span { background: #d9466b; color: #fff; }
.question-actions.answered .action-submit { flex: 2 1 0; }
@media (max-width: 880px) {
  .question-actions.answered .action-submit { grid-column: span 2; }
}
.set-done { margin-top: 14px; padding: 14px 16px; border: 1px solid var(--primary); border-radius: 8px; background: var(--primary-soft); }
.set-done strong { display: block; color: var(--primary-dark); font-size: 16px; }
.set-done p { margin: 6px 0 10px; line-height: 1.65; }
.set-done-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.set-done-actions:empty { display: none; }
.set-done-actions button { flex: 1 1 160px; min-height: 42px; }

/* 错题页 */
.review-summary { margin: 10px 0 4px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.review-more { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.review-fold > summary { display: flex; align-items: baseline; gap: 10px; cursor: pointer; list-style: none; }
.review-fold > summary::-webkit-details-marker { display: none; }
.review-fold > summary h2 { margin: 0; }
.review-fold > summary h2::after { content: " ▾"; font-size: 14px; color: var(--muted); }
.review-fold[open] > summary h2::after { content: " ▴"; }
.review-fold > summary span { color: var(--muted); font-size: 13px; }
.review-fold .head-actions { margin: 10px 0 4px; }

/* 统计页：先补这几章 */
.weak-chapters { margin: 6px 0 4px; padding: 14px 16px; border: 1px solid var(--warn-line, #ecd3a7); border-radius: 8px; background: var(--warn-soft, #fff7e8); }
.weak-chapters strong { display: block; font-size: 16px; }
.weak-chapters p { margin: 4px 0 10px; color: var(--muted); font-size: 13px; }
.weak-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; width: 100%; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); text-align: left; color: inherit; font: inherit; }
.weak-row span { font-weight: 700; }
.weak-row em { grid-row: 2; font-style: normal; font-size: 12px; color: var(--muted); }
.weak-row b { grid-row: 1 / 3; grid-column: 2; align-self: center; color: var(--primary-dark); font-size: 13px; }

/* 购买页：顶部跳到兑换码 */
.redeem-jump { display: block; margin: 6px 0 2px; text-align: center; color: var(--primary-dark); font-size: 14px; font-weight: 700; }
.gate-cross { margin: 14px 0 0; font-size: 13px; text-align: center; }
#redeemBox { scroll-margin-top: 70px; }
