:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-soft: #fbfbfc;
  --border: #e1e5eb;
  --text: #1d2430;
  --muted: #727b8b;
  --accent: #4b5563;
  --accent-dark: #374151;
  --danger: #b42318;
  --warning: #b45309;
  --success: #15803d;
  --study-bar: #4f8291;
  --review-bar: #b87355;
  --shadow: 0 16px 42px rgba(32, 41, 56, 0.06);
  --radius: 12px;
  --font-sans: "Century Gothic", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: "Century Gothic", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
body { line-height: 1.5; }
body.modal-open { overflow: hidden; }
body[data-theme="dark"] {
  --bg: #111722;
  --panel: #1b2431;
  --panel-soft: #202b3a;
  --border: #344153;
  --text: #edf2f7;
  --muted: #a8b3c1;
  --shadow: 0 18px 42px rgba(0, 0, 0, .24);
}
button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }
input[type="checkbox"] {
  appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 auto;
  border: 1px solid #9aa3ad;
  border-radius: 3px;
  background: #fff;
  display: inline-grid;
  place-content: center;
  cursor: pointer;
}
input[type="checkbox"]::before {
  content: "";
  width: 8px;
  height: 4px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) scale(0);
  transform-origin: center;
  transition: transform .12s ease;
}
input[type="checkbox"]:checked {
  border-color: #737373;
  background: #737373;
}
input[type="checkbox"]:checked::before { transform: rotate(-45deg) scale(1); }
input[type="checkbox"]:focus-visible { outline: 2px solid rgba(115, 115, 115, .3); outline-offset: 2px; }
[hidden] { display: none !important; }
.app-shell { max-width: 1540px; margin: 0 auto; padding: 24px; }
.app-shell.theme-blank { --accent: #73547f; --accent-dark: #5f426b; --theme-card: #b9a7c2; --theme-ink: #243044; --theme-soft: #f5f0f7; }
.app-shell.theme-reading { --accent: #52796f; --accent-dark: #3f6259; --theme-card: #b6d0c9; --theme-ink: #243044; --theme-soft: #eef6f4; }
.app-shell.theme-math { --accent: #4e7f95; --accent-dark: #3e697d; --theme-card: #c2dfea; --theme-ink: #243044; --theme-soft: #eff8fb; }
.app-shell.theme-writing { --accent: #59657c; --accent-dark: #465168; --theme-card: #8c95aa; --theme-ink: #f8fafc; --theme-soft: #f0f3f8; }
.topbar { display: flex; justify-content: flex-end; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.library-heading { display: none; }
.eyebrow { margin: 0 0 6px; text-transform: uppercase; letter-spacing: 0; font-size: 12px; color: var(--accent); font-weight: 700; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 28px; line-height: 1.2; }
.subtitle { margin-top: 8px; color: var(--muted); }
.topbar-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stats article, .panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.stats article { padding: 16px; }
.stats span { display: block; color: var(--muted); font-size: 13px; }
.stats strong { display: block; margin-top: 8px; font-size: 30px; line-height: 1; }
.layout { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(300px, 0.64fr); gap: 16px; align-items: start; }
.panel { padding: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.board-head-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.panel-head p, .selection-bar, .review-summary, .question-card .meta, .empty-state { color: var(--muted); }
.filters { display: grid; grid-template-columns: 1.5fr 0.9fr auto; gap: 10px; margin-bottom: 12px; }
.filters input, .filters select, .filters .select-trigger, .form input, .form select, .form .select-trigger, .form textarea, .essay-answer { width: 100%; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; color: var(--text); padding: 10px 12px; }
.filters input, .filters select, .filters .select-trigger, .form input, .form select, .form .select-trigger { min-height: 42px; }
.filters input[type="checkbox"] { width: 16px; height: 16px; padding: 0; border: 1px solid #9aa3ad; border-radius: 3px; }
.filters input:focus, .filters select:focus, .filters .select-trigger:focus, .form input:focus, .form select:focus, .form .select-trigger:focus, .form textarea:focus, .essay-answer:focus { outline: 2px solid rgba(75, 85, 99, 0.18); border-color: var(--accent); }
.toggle { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: var(--radius); padding: 0 12px; background: var(--panel-soft); white-space: nowrap; }
.form .toggle { display: inline-flex; align-items: center; min-height: 38px; }
.toggle input { margin: 0; }
.selection-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 13px; margin-bottom: 10px; }
.selection-bar #nextReviewHint { margin-left: auto; }
.selection-bar #nextReviewHint.good { color: var(--success); font-weight: 700; }
.selection-bar #nextReviewHint.danger { color: var(--danger); font-weight: 700; }
.selection-bar #nextReviewHint.not-started { color: #667085; }
.question-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.question-board.list-mode { display: block; }
.category-column { display: grid; gap: 10px; min-width: 0; align-content: start; }
.category-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 12px 12px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel-soft); }
.category-header h3 { margin: 0 0 4px; font-size: 16px; }
.category-header p { font-size: 13px; color: var(--muted); }
.category-list { display: grid; gap: 10px; min-height: 220px; }
.load-more-row {
  display: flex;
  justify-content: center;
  padding: 4px 0 2px;
}
.load-more-btn {
  min-width: 150px;
  color: var(--muted);
  background: rgba(255, 255, 255, .54);
}
.load-more-btn span {
  color: #98a1ad;
  font-size: 12px;
}
.load-more-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .82);
}
.question-card { position: relative; border: 1px solid var(--border); border-radius: var(--radius); padding: 42px 14px 14px; background: var(--panel-soft); min-width: 0; }
.question-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(75, 85, 99, 0.12); }
.question-card header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.question-card h4 { margin: 0 0 6px; font-size: 15px; line-height: 1.35; }
.question-title { display: flex; gap: 8px; align-items: flex-start; min-width: 0; }
.question-title input { margin-top: 3px; }
.question-heading { display: flex; align-items: center; gap: 7px; min-height: 24px; margin-bottom: 2px; }
.question-mark-slot { position: absolute; top: 9px; right: 12px; z-index: 1; }
.question-mark {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  color: #8b929a;
  background: transparent;
  line-height: 1;
  transition: color .12s ease, transform .12s ease;
}
.mark-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  line-height: 1;
  vertical-align: -0.08em;
}
.mark-star-svg {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  overflow: visible;
}
.mark-star-svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  stroke-linejoin: miter;
  stroke-linecap: butt;
}
.question-mark.is-marked .mark-star-svg path,
.exam-top-btn.is-marked .mark-star-svg path {
  fill: currentColor;
}
.question-mark:hover { color: #d92d20; transform: scale(1.08); }
.question-mark.is-marked { color: #d92d20; }
.question-code { color: var(--muted); font-size: 12px; font-weight: 750; white-space: nowrap; }
.question-card .summary { font-size: 13px; color: var(--text); margin-top: 8px; white-space: pre-wrap; }
.question-card .meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.question-list-table { display: grid; gap: 10px; }
.question-board.list-mode > .load-more-row { margin-top: 10px; }
.question-list-row {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(360px, 1.65fr) repeat(3, minmax(72px, 90px)) minmax(0, 230px);
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-soft);
}
.question-list-row > * { min-width: 0; }
.question-list-row.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(75, 85, 99, 0.12);
}
.list-select-column { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 8px; align-self: start; }
.list-select-column .question-mark { flex: 0 0 24px; }
.list-select-column input { width: 16px; height: 16px; margin-top: 2px; }
.list-main { min-width: 0; }
.list-main h4 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  margin: 0 0 6px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
}
.theme-math .question-list-row {
  padding-top: 10px;
  padding-bottom: 10px;
}
.theme-math .list-main h4 {
  display: block;
  margin-bottom: 4px;
  overflow: hidden;
  line-height: 1.32;
  text-overflow: ellipsis;
  white-space: nowrap;
  -webkit-line-clamp: unset;
  line-clamp: unset;
}
.theme-math .list-prompt-copy {
  display: inline;
}
.list-main p {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-metric {
  min-width: 0;
  padding-left: 12px;
  border-left: 1px solid var(--border);
}
.list-metric strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-metric strong.result-correct { color: var(--success); }
.list-metric strong.result-wrong { color: var(--danger); }
.list-metric strong.result-unrecorded { color: #667085; }
.list-metric strong.review-date { color: var(--text); }
.list-metric strong.good { color: var(--success); }
.list-metric strong.warn { color: var(--warning); }
.list-metric strong.danger { color: var(--danger); }
.list-metric strong.not-started { color: #667085; }
.list-metric span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.row-actions.list-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  max-width: 230px;
}
.list-actions button {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  padding-right: 6px;
  padding-left: 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 10px; background: #e8eef8; color: #234; font-size: 12px; }
.tag-label { display: inline-flex; align-items: center; color: #667085; font-size: 12px; font-weight: 700; }
#points { min-height: 42px; padding: 10px 12px; }
.note-count { margin-top: 10px; color: var(--accent); font-size: 12px; font-weight: 750; }
.row-actions, .form-actions, .review-actions, .column-actions, .exam-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.primary-btn, .ghost-btn { display: inline-flex; justify-content: center; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: var(--radius); transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease; }
.primary-btn { background: var(--accent); color: white; }
.primary-btn:hover { background: var(--accent-dark); }
.ghost-btn { background: transparent; color: var(--text); border: 1px solid var(--border); }
.primary-btn:hover, .ghost-btn:hover { transform: translateY(-1px); }
#questionForm .form-actions .primary-btn {
  color: #fff;
  border: 1px solid #68717d;
  background: #7a838f;
}
#questionForm .form-actions .primary-btn:hover {
  border-color: #59626e;
  background: #66707c;
}
.compact-btn { min-height: 30px; padding: 0 10px; font-size: 13px; }
.question-card .row-actions .primary-btn,
.question-card .row-actions .ghost-btn,
.question-list-row .list-actions .primary-btn,
.question-list-row .list-actions .ghost-btn,
.note-editor-panel .form-actions .primary-btn,
.note-editor-panel .form-actions .ghost-btn {
  color: #1f2937;
  border: 1px solid #cbd5e1;
  background: #fff;
}
.question-card .row-actions .primary-btn:hover,
.question-card .row-actions .ghost-btn:hover,
.question-list-row .list-actions .primary-btn:hover,
.question-list-row .list-actions .ghost-btn:hover,
.note-editor-panel .form-actions .primary-btn:hover,
.note-editor-panel .form-actions .ghost-btn:hover {
  border-color: #aeb8c5;
  background: #f3f6fa;
}
.question-card .row-actions .practice-action,
.question-list-row .list-actions .practice-action {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}
.question-card .row-actions .has-notes,
.question-list-row .list-actions .has-notes {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}
.question-card .row-actions .practice-action:hover,
.question-list-row .list-actions .practice-action:hover {
  color: #fff;
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}
.question-card .row-actions .has-notes:hover,
.question-list-row .list-actions .has-notes:hover {
  color: #fff;
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}
.file-btn { user-select: none; }
.side-column { display: grid; gap: 16px; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(24, 32, 48, .34);
  backdrop-filter: blur(14px) saturate(1.12);
}
.site-confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(24, 32, 48, .24);
  backdrop-filter: blur(12px) saturate(1.08);
}
.site-confirm-dialog {
  width: min(360px, calc(100vw - 48px));
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: 16px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .22), inset 0 1px 0 rgba(255, 255, 255, .76);
  color: #243044;
  text-align: left;
}
.site-confirm-dialog h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.25;
}
.site-confirm-dialog p {
  margin: 10px 0 0;
  color: #697486;
  font-size: 14px;
  line-height: 1.7;
}
.site-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.site-confirm-dialog .danger-btn {
  border-color: #b87070;
  background: #b87070;
}
.site-confirm-dialog .danger-btn:hover {
  background: #a65f5f;
}
.form-panel {
  position: fixed;
  z-index: 101;
  top: 50%;
  left: 50%;
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  transform: translate(-50%, -50%);
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .72);
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .24), inset 0 1px 0 rgba(255, 255, 255, .72);
  backdrop-filter: blur(24px) saturate(1.16);
}
.form-panel .panel-head { align-items: flex-start; }
.icon-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  transition: color .16s ease, background .16s ease, border-color .16s ease;
}
.icon-close-btn:hover { color: var(--text); background: #fff; border-color: rgba(148, 163, 184, .55); }
.note-editor-panel,
.notebook-panel {
  position: fixed;
  z-index: 101;
  top: 50%;
  left: 50%;
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  transform: translate(-50%, -50%);
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .72);
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .24), inset 0 1px 0 rgba(255, 255, 255, .72);
  backdrop-filter: blur(24px) saturate(1.16);
}
.notebook-panel { width: min(900px, calc(100vw - 32px)); }
.auth-view {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(247, 248, 251, .88), rgba(247, 248, 251, .7) 48%, rgba(247, 248, 251, .86)),
    url("./assets/home-study.jpg") center / cover,
    #f7f8fb;
}
.auth-panel {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .58), rgba(255, 255, 255, .36));
  box-shadow: 0 28px 78px rgba(32, 41, 56, .18), inset 0 1px 0 rgba(255, 255, 255, .72);
  backdrop-filter: blur(30px) saturate(1.18);
}
.auth-panel label {
  color: #4b5563;
}
.auth-panel input {
  border: 1px solid rgba(148, 163, 184, .52);
  border-radius: 8px;
  background: rgba(255, 255, 255, .56);
  color: var(--text);
}
.auth-panel input:focus {
  outline: 2px solid rgba(75, 85, 99, .2);
  border-color: rgba(75, 85, 99, .64);
  background: rgba(255, 255, 255, .74);
}
.auth-panel .eyebrow { color: #6b7280; }
.auth-panel h1 { margin: 0 0 12px; font-size: 32px; }
.auth-intro { margin: 0 0 24px; color: var(--muted); line-height: 1.7; }
.auth-form { display: grid; gap: 14px; }
.auth-form .primary-btn {
  width: 100%;
  margin-top: 4px;
  background: #4b5563;
  color: #fff;
}
.auth-form .primary-btn:hover { background: #374151; }
.auth-error { margin: 0; color: #b42318; font-size: 13px; line-height: 1.5; }
.auth-hint { margin: 20px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.auth-hint code { padding: 2px 4px; border-radius: 4px; background: rgba(148, 163, 184, .14); }
.account-badge {
  width: fit-content;
  padding: 5px 9px;
  border: 1px solid rgba(75, 85, 99, .28);
  border-radius: 999px;
  color: #4b5563;
  background: rgba(75, 85, 99, .08);
  font-size: 12px;
}
.account-badge[data-role="admin"] {
  border-color: rgba(115, 84, 127, .3);
  color: #6d4d78;
  background: rgba(115, 84, 127, .1);
}
.admin-user-form {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr .7fr auto;
  align-items: end;
  gap: 10px;
}
.admin-user-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}
.admin-user-form input,
.admin-user-form select {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .82);
  color: var(--text);
  font-size: 14px;
}
.admin-user-form .primary-btn { min-height: 40px; }
.admin-user-list { display: grid; gap: 8px; }
.admin-user-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid rgba(148, 163, 184, .18);
}
.admin-user-row > div { display: grid; gap: 3px; min-width: 0; }
.admin-user-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-row span { color: var(--muted); font-size: 12px; }
.settings-view {
  min-height: 100vh;
  padding: 0 0 64px;
  color: var(--text);
  background:
    linear-gradient(120deg, rgba(115, 84, 127, .12), #f7f8fb 42%, rgba(75, 85, 99, .1)),
    #f7f8fb;
}
.settings-page-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 76px;
  padding: 12px clamp(20px, 4vw, 64px);
  border-bottom: 1px solid rgba(214, 219, 227, .8);
  background: rgba(255, 255, 255, .62);
  box-shadow: 0 10px 28px rgba(32, 41, 56, .06), inset 0 1px 0 rgba(255, 255, 255, .78);
  backdrop-filter: blur(20px) saturate(1.16);
}
.settings-back-btn {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, .5);
  font-size: 14px;
}
.settings-back-btn:hover { background: rgba(255, 255, 255, .82); }
.settings-back-btn span:first-child { font-size: 20px; line-height: 1; }
.settings-page-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.settings-page-brand .eyebrow { margin-bottom: 2px; }
.settings-page-brand strong { display: block; font-size: 17px; }
.settings-page-content {
  width: min(900px, calc(100% - 48px));
  margin: 0 auto;
  padding-top: clamp(24px, 4vw, 40px);
}
.settings-form {
  display: grid;
  gap: 16px;
}
/* 每组一张独立玻璃卡片（参考设置页常见信息架构：组标题 + 行式项），
   行内左文右控件，控件固定在右侧，长描述不会把布局顶歪。 */
.settings-card {
  padding: 8px 24px 12px;
  border: 1px solid rgba(214, 219, 227, .78);
  border-radius: 16px;
  background: rgba(255, 255, 255, .68);
  box-shadow: 0 18px 46px rgba(32, 41, 56, .1), inset 0 1px 0 rgba(255, 255, 255, .72);
  backdrop-filter: blur(20px) saturate(1.16);
}
.settings-card-title {
  margin: 10px 0 2px;
  font-size: 16px;
  font-weight: 650;
}
.settings-card-desc {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-top: 1px solid rgba(148, 163, 184, .22);
}
.settings-card .setting-row:first-of-type {
  border-top: 0;
}
.setting-row-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.setting-row-text strong {
  font-size: 15px;
  font-weight: 650;
}
.setting-row-text span,
.settings-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.setting-row-badge { display: inline-flex; }
.setting-row-control {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}
.setting-row-control input,
.setting-row-control select,
.setting-row-control .select-widget {
  width: 220px;
}
.setting-row-control .select-trigger {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .82);
  color: var(--text);
  font-size: 14px;
}
.setting-row-control input:focus,
.setting-row-control .select-trigger:focus {
  outline: 2px solid rgba(75, 85, 99, .2);
  border-color: var(--accent);
}
.settings-avatar-preview img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.settings-avatar-preview {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid rgba(255, 255, 255, .9);
  border-radius: 50%;
  color: #fff;
  background: #667080;
  box-shadow: 0 0 0 1px #d5dbe3, 0 5px 14px rgba(32, 41, 56, .14);
  font-size: 16px;
  font-weight: 800;
}
.settings-actions { padding-top: 4px; }
.note-editor-panel .panel-head,
.notebook-panel .panel-head { align-items: flex-start; }
.note-editor-panel h2,
.notebook-panel h2 { margin-bottom: 4px; }
.note-existing-list {
  display: grid;
  gap: 10px;
  max-height: 230px;
  overflow-y: auto;
  padding: 2px 4px 4px 0;
}
.note-existing-list h3 {
  color: var(--text);
  font-size: 15px;
}
.note-existing-list article {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-soft);
}
.note-existing-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.note-existing-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}
.note-existing-list time {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.note-existing-list p {
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
}
.notebook-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}
.notebook-list {
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 190px);
  overflow-y: auto;
  padding: 2px 4px 4px 0;
}
.notebook-entry {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-soft);
}
.notebook-entry-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.notebook-entry-head h3 {
  margin-top: 8px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.45;
}
.notebook-entry-head time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}
.notebook-entry-content {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
}
.notebook-entry-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 6px; font-size: 14px; }
.form-grid, .completion-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.completion-grid { align-items: start; }
.form textarea { resize: vertical; min-height: 92px; }
.note-editor-panel #noteContent {
  min-height: 48px;
  max-height: 180px;
  resize: none;
  overflow-y: hidden;
}
.question-type-fields { display: grid; gap: 14px; }
.type-form-section { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel-soft); }
.type-form-section > .form-grid { align-items: start; }
.type-form-section h3 { margin: 0; color: var(--text); font-size: 15px; }
.reading-question-fields, .blank-form-columns, .blank-form-answers { display: grid; gap: 12px; }
.reading-question-editor { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.reading-question-editor h3 { padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.blank-form-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.blank-form-column { min-width: 0; }
.blank-form-answers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-hint { color: var(--muted); font-size: 13px; line-height: 1.5; }
.image-upload-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px 12px; }
.image-upload-field .field-hint { grid-column: 1 / -1; }
.math-image-preview { display: block; grid-column: 1 / -1; width: min(100%, 420px); max-height: 240px; object-fit: contain; border: 1px solid var(--border); background: #fff; }
.note-image-upload-field {
  grid-template-columns: 1fr;
  align-items: start;
}
.note-field-label {
  color: var(--text);
  font-size: 14px;
}
.form .note-image-input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.note-upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.form .note-upload-button {
  display: inline-flex;
  width: auto;
  font-size: 13px;
}
.note-upload-row .field-hint {
  flex: 1 1 190px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.note-image-preview,
.note-image,
.note-existing-image {
  display: block;
  width: 112px;
  height: 84px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 20px rgba(32, 41, 56, .08);
}
.note-image-preview {
  grid-column: 1 / -1;
  width: 96px;
  height: 72px;
}
.note-image,
.note-existing-image { margin-top: 14px; }
.review-summary { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; margin-bottom: 12px; }
.summary-pill { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; padding: 6px 10px; background: var(--panel-soft); }
.review-progress { margin: 2px 0 14px; }
.review-progress-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; color: var(--muted); font-size: 13px; }
.review-progress-head strong { color: var(--text); font-size: 13px; }
.review-progress-track { height: 8px; overflow: hidden; border-radius: 999px; background: #e8edf2; }
.review-progress-track > div { width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .25s ease; }
.review-celebration { position: relative; height: 0; pointer-events: none; }
.review-celebration.is-active { height: 84px; margin: -4px 0 2px; }
.review-confetti { position: absolute; top: 8px; left: var(--x); width: 7px; height: 13px; background: var(--color); opacity: 0; transform: translate3d(0, 0, 0) rotate(var(--rotate)); animation: review-confetti-fall 2.7s cubic-bezier(.2, .7, .3, 1) var(--delay) forwards; }
@keyframes review-confetti-fall {
  0% { opacity: 0; transform: translate3d(0, -6px, 0) rotate(var(--rotate)); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(var(--drift), 82px, 0) rotate(calc(var(--rotate) + 420deg)); }
}
.review-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel-soft); padding: 16px; }
.review-card .prompt, .review-card .answer { white-space: pre-wrap; }
.review-card .answer { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.review-card .meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; color: var(--muted); font-size: 13px; }
.review-list { display: grid; gap: 10px; }
.review-list-item {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-soft);
}
.review-list-item .meta { display: flex; flex-wrap: wrap; gap: 6px; }
.review-list-item h3 {
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}
.review-math-line {
  display: inline-block;
}
.review-list-item button { justify-self: start; }
.review-list-item .review-action {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}
.review-list-item .review-action:hover {
  color: #fff;
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 8px; background: #eef2ff; color: #3730a3; font-size: 12px; }
.badge.good { background: #ecfdf3; color: #166534; }
.badge.warn { background: #fff7ed; color: #9a3412; }
.badge.danger { background: #fef2f2; color: #991b1b; }
.badge.not-started,
.badge.result-unrecorded { background: #f1f3f5; color: #667085; }
.badge.result-correct { background: #dcfce7; color: #15803d; }
.badge.result-wrong { background: #fee2e2; color: #b42318; }
.empty-state { text-align: center; min-height: 180px; display: grid; place-items: center; }

.category-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, .95fr) minmax(0, 1.4fr);
  gap: 22px;
  align-items: stretch;
  overflow: hidden;
  min-height: 176px;
  margin-bottom: 16px;
  padding: 24px 30px;
  border-radius: 12px;
  background: var(--theme-card, #b9a7c2);
  color: var(--theme-ink, #243044);
  box-shadow: 0 18px 46px rgba(25, 37, 69, .12);
}

.category-hero::after {
  content: "";
  position: absolute;
  right: -110px;
  bottom: -150px;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
}

.category-hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.category-hero-copy .type-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  margin: 46px 0 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, .28);
  font-size: 34px;
}
.category-hero-copy .type-icon .category-icon-svg {
  width: 40px;
  height: 40px;
}

.category-hero h2 {
  font-size: clamp(38px, 4vw, 54px);
  line-height: 1.02;
}

.category-hero p:not(.home-kicker) {
  margin-top: 14px;
  font-size: 20px;
  font-weight: 650;
}

.category-hero .home-kicker {
  color: color-mix(in srgb, var(--theme-ink, #243044) 76%, transparent);
}

.category-stats {
  position: relative;
  z-index: 1;
  align-self: center;
  margin: 0;
}

.category-stats article {
  display: grid;
  align-content: end;
  min-height: 78px;
  padding: 10px 14px;
  border-color: rgba(255, 255, 255, .44);
  background: rgba(255, 255, 255, .34);
  box-shadow: none;
}

.category-stats span {
  color: color-mix(in srgb, var(--theme-ink, #243044) 72%, transparent);
  font-size: 12px;
  font-weight: 700;
}

.category-stats strong {
  color: var(--theme-ink, #243044);
  font-size: 28px;
}

.theme-writing .category-stats article,
.theme-writing .category-hero-copy .type-icon {
  background: rgba(255, 255, 255, .16);
}

.theme-writing .category-stats span,
.theme-writing .category-hero .home-kicker {
  color: rgba(248, 250, 252, .76);
}

.review-panel .panel-head button {
  min-width: 68px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.home-view {
  position: relative;
  min-height: 100vh;
  background: #f6f7f9;
}
.site-footer {
  width: min(1400px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0 30px;
  text-align: center;
  color: #7b8491;
  font-size: 12px;
}
.site-footer a {
  color: inherit;
  text-decoration: none;
}
.site-footer a:hover,
.site-footer a:focus-visible {
  color: #4b5563;
  text-decoration: underline;
  text-underline-offset: 3px;
}
body[data-theme="dark"] .site-footer {
  color: #a8b3c1;
}
body[data-theme="dark"] .site-footer a:hover,
body[data-theme="dark"] .site-footer a:focus-visible {
  color: #edf2f7;
}
@media (max-width: 640px) {
  .site-footer {
    width: calc(100% - 32px);
    padding-bottom: 24px;
  }
}
body.intro-open {
  overflow: hidden;
  padding-right: var(--intro-scrollbar-width, 0px);
}
.home-intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  color: #fff;
  background: #f6f7f9;
  isolation: isolate;
  --intro-copy-left: 50%;
  --intro-copy-translate-x: -50%;
  --intro-copy-y: 0px;
  --intro-top-y: 0%;
  --intro-bottom-y: 0%;
  cursor: pointer;
}
.home-intro:focus-visible { outline: 2px solid rgba(255, 255, 255, .82); outline-offset: -8px; }
.home-intro::before {
  display: none;
}
.home-intro::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(7, 15, 27, .76), rgba(7, 15, 27, .5) 48%, rgba(7, 15, 27, .18));
  pointer-events: none;
}
.home-intro-photo {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url("./assets/home-study.jpg") center / cover;
  filter: none;
  transform: none;
}
.home-intro-panel {
  position: absolute;
  right: 0;
  left: 0;
  z-index: 2;
  height: 50%;
  background: rgba(6, 12, 20, .3);
  pointer-events: none;
  will-change: transform;
}
.home-intro-panel-top {
  top: 0;
  transform: translateY(var(--intro-top-y));
}
.home-intro-panel-bottom {
  bottom: 0;
  transform: translateY(var(--intro-bottom-y));
}
.home-intro-copy {
  position: absolute;
  top: 50%;
  left: var(--intro-copy-left);
  z-index: 2;
  width: max-content;
  max-width: calc(100% - 48px);
  color: #fff;
  text-align: left;
  transform: translate3d(var(--intro-copy-translate-x), calc(-50% + var(--intro-copy-y)), 0);
  will-change: left, transform;
}
.home-intro-kicker {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, .72);
  font-size: clamp(13px, 1.05vw, 18px);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}
.home-intro-copy h1 {
  max-width: 100%;
  margin: 0;
  color: #fff;
  font-size: clamp(32px, 5.2vw, 82px);
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.05;
  white-space: nowrap;
}
.home-intro-copy > p:last-child {
  max-width: 980px;
  margin: clamp(18px, 1.5vw, 28px) 0 0;
  color: rgba(255, 255, 255, .82);
  font-size: clamp(16px, 1.35vw, 24px);
}
.home-intro.is-complete {
  opacity: 0;
  transition: opacity .52s ease;
  pointer-events: none;
}

.home-topbar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  isolation: isolate;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  min-height: 64px;
  width: 100%;
  margin: 0 auto;
  padding: 8px clamp(24px, 4vw, 64px);
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  transition:
    top .28s ease,
    width .28s cubic-bezier(.16, 1, .3, 1),
    min-height .28s ease,
    margin .28s cubic-bezier(.16, 1, .3, 1),
    padding .28s ease,
    border-color .2s ease,
    border-radius .28s ease,
    background-color .2s ease,
    box-shadow .28s ease,
    backdrop-filter .2s ease,
    transform .42s cubic-bezier(.16, 1, .3, 1);
}
.home-topbar > *,
.library-topbar > * {
  position: relative;
  z-index: 1;
}
.home-brand {
  position: absolute;
  top: 50%;
  left: clamp(18px, 3.2vw, 52px);
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 10px;
  color: #202735;
  text-decoration: none;
  transform: translateY(-50%);
  transition: left .72s cubic-bezier(.16, 1, .3, 1), transform .72s cubic-bezier(.16, 1, .3, 1);
  will-change: left;
}
.home-brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: #fff;
  background: #46505d;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
}
.home-brand-mark svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.home-brand-copy { display: grid; gap: 1px; }
.home-brand-copy strong { font-size: 14px; line-height: 1.1; }
.home-brand-copy small { color: #8b93a0; font-size: 11px; }
.home-topbar:not(.is-floating) .home-brand { color: rgba(255, 255, 255, .92); }
.home-topbar:not(.is-floating) .home-brand-mark { background: rgba(255, 255, 255, .18); }
.home-topbar:not(.is-floating) .home-brand-copy small { color: rgba(255, 255, 255, .68); }
.home-tabs {
  position: absolute;
  top: 50%;
  left: 50%;
  display: inline-flex;
  justify-self: center;
  gap: 26px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow-x: auto;
  scrollbar-width: none;
  transform: translate(-50%, -50%);
}
.home-tabs::-webkit-scrollbar { display: none; }
.home-tab-indicator {
  position: absolute;
  left: 0;
  bottom: 0;
  width: var(--tab-indicator-width, 0);
  height: 2px;
  border-radius: 999px;
  background: var(--tab-indicator-color, #9aa4b2);
  opacity: var(--tab-indicator-opacity, 0);
  pointer-events: none;
  transform: translateX(var(--tab-indicator-x, 0));
  transition:
    transform .34s cubic-bezier(.16, 1, .3, 1),
    width .34s cubic-bezier(.16, 1, .3, 1),
    opacity .18s ease,
    background-color .22s ease;
}
.home-tab {
  min-height: 32px;
  padding: 5px 0 7px;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: #7e8795;
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}
.home-tab:hover { color: #202735; }
.home-tab.is-active {
  color: #202735;
  border-bottom-color: transparent;
  background: transparent;
  box-shadow: none;
}
/* 未吸顶时顶栏压在首页大图上，底色很深。这一组元素（导航 tab、主页图标、
   头像、名字）必须用同一档白色，之前 tab 是 .76、头像/名字是 .84、主页图标底
   是 .48 深灰半透明，四个位置的白度各不相同，看起来像没对齐。 */
.home-topbar:not(.is-floating) .home-tab { color: rgba(255, 255, 255, .92); }
.home-topbar:not(.is-floating) .home-tab:hover,
.home-topbar:not(.is-floating) .home-tab.is-active { color: #fff; }
/* 激活下划线统一灰色：浅色 hero（生词/数据）和深色 hero（题库）上都可见。 */
.home-topbar:not(.is-floating) .home-tabs { --tab-indicator-color: rgba(255, 255, 255, .8); }
.home-topbar:not(.is-floating) .home-profile,
.home-topbar:not(.is-floating) .profile-name { color: rgba(255, 255, 255, .92); }
.home-topbar:not(.is-floating) .home-profile:hover,
.home-topbar:not(.is-floating) .home-profile:active { color: #fff; }
.library-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  isolation: isolate;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  width: 100%;
  min-height: 64px;
  margin: 0 auto;
  padding: 8px clamp(24px, 4vw, 64px);
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  transition:
    top .28s ease,
    width .28s cubic-bezier(.16, 1, .3, 1),
    min-height .28s ease,
    margin .28s cubic-bezier(.16, 1, .3, 1),
    padding .28s ease,
    border-color .2s ease,
    border-radius .28s ease,
    background-color .2s ease,
    box-shadow .28s ease,
    backdrop-filter .2s ease;
}
.library-topbar-left {
  position: absolute;
  top: 50%;
  left: clamp(18px, 3.2vw, 52px);
  display: flex;
  align-items: center;
  justify-self: start;
  transform: translateY(-50%);
  transition: left .72s cubic-bezier(.16, 1, .3, 1), transform .72s cubic-bezier(.16, 1, .3, 1);
  will-change: left;
}
.library-home-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  cursor: pointer;
}
.library-home-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.library-home-btn:hover {
  background: #596575;
}
.home-profile {
  position: absolute;
  top: 50%;
  right: clamp(34px, 5vw, 80px);
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 9px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #4d5868;
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  transform: translateY(-50%);
  transition: right .72s cubic-bezier(.16, 1, .3, 1), transform .72s cubic-bezier(.16, 1, .3, 1);
  will-change: right;
}
.home-profile {
  appearance: none;
  cursor: pointer;
  text-align: left;
}
.home-profile:hover,
.home-profile:active {
  background: transparent;
}
.home-profile:hover .profile-avatar {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px #d5dbe3, 0 7px 18px rgba(32, 41, 56, .2);
}
/* 未吸顶时顶栏压在首页大图上，底色很深。头像用实色 #667080 会显得比旁边的
   导航字更「沉」，统一成和主页图标一样的半透明白。 */
.home-profile:focus-visible {
  outline: 2px solid rgba(115, 84, 127, .45);
  outline-offset: 5px;
}
.profile-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: #667080;
  box-shadow: 0 0 0 1px #d5dbe3, 0 5px 14px rgba(32, 41, 56, .16);
  font-size: 15px;
  font-weight: 800;
  transition: transform .18s ease, box-shadow .18s ease;
}
/* 上传了头像图片时，圆形容器里渲染压缩后的方图（object-fit: cover）。 */
.profile-avatar img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  display: block;
}
/* 必须放在 .profile-avatar 之后：同优先级下后写的才生效，
   否则会被上面那条实色 #667080 盖掉。未吸顶时顶栏压在首页大图上、
   底色很深，实色头像会显得比旁边的导航字更「沉」，统一成半透明白。 */
.home-topbar:not(.is-floating) .profile-avatar {
  border-color: rgba(255, 255, 255, .72);
  background: rgba(255, 255, 255, .18);
  box-shadow: none;
}
.home-topbar:not(.is-floating) .home-profile:hover .profile-avatar {
  background: rgba(255, 255, 255, .3);
  box-shadow: none;
}
.home-topbar:not(.is-floating) .home-profile { color: rgba(255, 255, 255, .92); }
/* 生词 / 数据页顶部是浅色背景（粉白 / 蓝白渐变），白色顶栏文字完全看不见，
   所以这两个 tab 激活时顶栏必须切回深色 —— 这一版深色曾经是有的，被误删。
   教训：分区配色本身不是 bug，「同一套深色里各元素色值不一致」才是。
   因此这里所有元素统一用同一个灰阶：文字 #2e3644，次要文字 .72 透明，
   图标/头像底 rgba(46,54,68,.78)。 */
.home-view.is-library .home-topbar:not(.is-floating) .home-brand,
.home-view.is-eudic .home-topbar:not(.is-floating) .home-brand,
.home-view.is-dashboard .home-topbar:not(.is-floating) .home-brand { color: #2e3644; }
.home-view.is-library .home-topbar:not(.is-floating) .home-brand-mark,
.home-view.is-eudic .home-topbar:not(.is-floating) .home-brand-mark,
.home-view.is-dashboard .home-topbar:not(.is-floating) .home-brand-mark { background: rgba(46, 54, 68, .78); }
.home-view.is-library .home-topbar:not(.is-floating) .home-brand-copy small,
.home-view.is-eudic .home-topbar:not(.is-floating) .home-brand-copy small,
.home-view.is-dashboard .home-topbar:not(.is-floating) .home-brand-copy small { color: rgba(46, 54, 68, .72); }
.home-view.is-library .home-topbar:not(.is-floating) .home-tab,
.home-view.is-eudic .home-topbar:not(.is-floating) .home-tab,
.home-view.is-dashboard .home-topbar:not(.is-floating) .home-tab { color: rgba(46, 54, 68, .72); }
.home-view.is-library .home-topbar:not(.is-floating) .home-tab:hover,
.home-view.is-library .home-topbar:not(.is-floating) .home-tab.is-active,
.home-view.is-eudic .home-topbar:not(.is-floating) .home-tab:hover,
.home-view.is-eudic .home-topbar:not(.is-floating) .home-tab.is-active,
.home-view.is-dashboard .home-topbar:not(.is-floating) .home-tab:hover,
.home-view.is-dashboard .home-topbar:not(.is-floating) .home-tab.is-active { color: #2e3644; }
.home-view.is-library .home-topbar:not(.is-floating) .home-tabs,
.home-view.is-eudic .home-topbar:not(.is-floating) .home-tabs,
.home-view.is-dashboard .home-topbar:not(.is-floating) .home-tabs { --tab-indicator-color: #9aa4b2; }
.home-view.is-library .home-topbar:not(.is-floating) .home-profile,
.home-view.is-eudic .home-topbar:not(.is-floating) .home-profile,
.home-view.is-dashboard .home-topbar:not(.is-floating) .home-profile,
.home-view.is-library .home-topbar:not(.is-floating) .profile-name,
.home-view.is-eudic .home-topbar:not(.is-floating) .profile-name,
.home-view.is-dashboard .home-topbar:not(.is-floating) .profile-name { color: rgba(46, 54, 68, .78); }
.home-view.is-library .home-topbar:not(.is-floating) .profile-avatar,
.home-view.is-eudic .home-topbar:not(.is-floating) .profile-avatar,
.home-view.is-dashboard .home-topbar:not(.is-floating) .profile-avatar {
  border-color: #fff;
  background: rgba(46, 54, 68, .78);
  box-shadow: 0 0 0 1px rgba(46, 54, 68, .14), 0 5px 14px rgba(32, 41, 56, .12);
}
.app-shell#libraryView {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 76px 0 48px;
  background: #f7f8fb;
}
.app-shell#libraryView::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 460px;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(120deg,
      color-mix(in srgb, var(--theme-card, #c7b6cf) 22%, #f7f8fb),
      rgba(247, 248, 251, .78) 58%,
      rgba(247, 248, 251, 0) 100%);
  filter: blur(18px);
  opacity: .9;
}
.app-shell#libraryView .category-hero,
.app-shell#libraryView > .layout {
  width: min(1400px, calc(100% - 48px));
  margin-left: auto;
  margin-right: auto;
}
.app-shell#libraryView > .layout > .panel,
.app-shell#libraryView .review-panel {
  border-color: rgba(214, 219, 227, .76);
  background: rgba(255, 255, 255, .74);
  box-shadow: 0 18px 46px rgba(32, 41, 56, .11), inset 0 1px 0 rgba(255, 255, 255, .58);
  backdrop-filter: blur(20px) saturate(1.18);
}
.app-shell#libraryView .question-list-row,
.app-shell#libraryView .question-card,
.app-shell#libraryView .category-header,
.app-shell#libraryView .review-card,
.app-shell#libraryView .review-list-item {
  border-color: rgba(214, 219, 227, .68);
  background: rgba(255, 255, 255, .68);
  box-shadow: 0 8px 24px rgba(32, 41, 56, .07), inset 0 1px 0 rgba(255, 255, 255, .48);
  backdrop-filter: blur(16px) saturate(1.14);
}
body[data-theme="dark"] .app-shell#libraryView {
  background: #151b27;
}
body[data-theme="dark"] .app-shell#libraryView::before {
  background:
    linear-gradient(120deg, rgba(87, 100, 128, .28), rgba(21, 27, 39, .82) 58%, rgba(21, 27, 39, 0));
}
body[data-theme="dark"] .app-shell#libraryView > .layout > .panel,
body[data-theme="dark"] .app-shell#libraryView .review-panel {
  border-color: rgba(115, 130, 151, .34);
  background: rgba(25, 33, 47, .78);
  box-shadow: 0 18px 46px rgba(0, 0, 0, .2), inset 0 1px 0 rgba(255, 255, 255, .06);
}
body[data-theme="dark"] .app-shell#libraryView .question-list-row,
body[data-theme="dark"] .app-shell#libraryView .question-card,
body[data-theme="dark"] .app-shell#libraryView .category-header,
body[data-theme="dark"] .app-shell#libraryView .review-card,
body[data-theme="dark"] .app-shell#libraryView .review-list-item {
  border-color: rgba(115, 130, 151, .28);
  background: rgba(31, 41, 57, .72);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .14), inset 0 1px 0 rgba(255, 255, 255, .04);
}
body[data-theme="dark"] .filters input,
body[data-theme="dark"] .filters select,
body[data-theme="dark"] .form input,
body[data-theme="dark"] .form select,
body[data-theme="dark"] .form textarea,
body[data-theme="dark"] .essay-answer {
  border-color: #3b4a5e;
  background: #202b3a;
  color: #edf2f7;
}
body[data-theme="dark"] .form-panel,
body[data-theme="dark"] .note-editor-panel,
body[data-theme="dark"] .notebook-panel {
  border-color: rgba(148, 163, 184, .3);
  background: rgba(27, 36, 49, .86);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .06);
}
body[data-theme="dark"] .modal-backdrop {
  background: rgba(3, 7, 18, .56);
}
body[data-theme="dark"] .home-topbar.is-floating::before,
body[data-theme="dark"] .library-topbar.is-floating::before {
  border-color: rgba(148, 163, 184, .26);
  background: rgba(27, 36, 49, .88);
  box-shadow: 0 14px 36px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.home-topbar.is-floating,
.library-topbar.is-floating {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  max-width: none;
  min-height: 64px;
  margin: 0;
  padding: 8px 16px;
  border-color: transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  transition:
    top .42s cubic-bezier(.16, 1, .3, 1),
    opacity .24s ease,
    padding .42s cubic-bezier(.16, 1, .3, 1);
  grid-template-columns: max-content max-content max-content;
  justify-content: center;
  gap: 16px;
  transform: none;
}
.home-topbar::before,
.library-topbar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 0;
  width: 0;
  height: 56px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: transparent;
  box-shadow: none;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: width .44s cubic-bezier(.16, 1, .3, 1), opacity .26s ease, background-color .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.home-topbar.is-floating::before,
.library-topbar.is-floating::before {
  width: min(520px, calc(100% - 32px));
  top: 4px;
  border-color: rgba(214, 219, 227, .78);
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 14px 36px rgba(32, 41, 56, .12), inset 0 1px 0 rgba(255, 255, 255, .82);
  opacity: 1;
  backdrop-filter: blur(22px) saturate(1.2);
}
.home-topbar.is-floating .home-brand-copy,
.home-topbar.is-floating .profile-name,
.library-topbar.is-floating .profile-name {
  display: none;
}
.home-topbar.is-floating .home-brand,
.library-topbar.is-floating .library-topbar-left {
  left: calc(50% - 238px);
  gap: 0;
}
.home-topbar.is-floating .home-profile,
.library-topbar.is-floating .home-profile {
  right: calc(50% - 226px);
}
.home-topbar.is-collapsed,
.library-topbar.is-collapsed {
  top: -84px;
  opacity: 0;
  pointer-events: none;
}
.home-tab-panel { min-height: calc(100vh - 64px); }

.home-hero {
  height: 100svh;
  min-height: 100svh;
  background-image: url("./assets/home-study.jpg");
  background-size: cover;
  background-position: center center;
}

.home-mask {
  min-height: inherit;
  display: flex;
  align-items: center;
  padding: clamp(72px, 7vw, 126px) clamp(24px, 3.75vw, 72px);
  background: linear-gradient(90deg, rgba(7, 15, 27, .76), rgba(7, 15, 27, .5) 48%, rgba(7, 15, 27, .18));
}

.home-copy {
  width: 100%;
  max-width: none;
  color: #fff;
}

.home-hero .home-kicker {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, .78);
  font-size: clamp(13px, 1.05vw, 18px);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.home-copy h1 {
  max-width: 100%;
  font-size: clamp(32px, 5.2vw, 82px);
  line-height: 1.05;
  letter-spacing: 0;
  white-space: nowrap;
}

.home-copy p:last-child {
  max-width: 980px;
  margin-top: clamp(18px, 1.5vw, 28px);
  color: rgba(255, 255, 255, .82);
  font-size: clamp(16px, 1.35vw, 24px);
}

.home-content {
  max-width: 1480px;
  margin: 0 auto;
  padding: 34px 24px 52px;
}

.home-section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 20px;
}

.home-section-head h2 {
  font-size: 28px;
}

.home-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

.home-dashboard {
  width: min(1400px, calc(100% - 48px));
  margin: 76px auto 52px;
  padding: 22px 24px 24px;
  border: 1px solid #e1e5eb;
  border-radius: 16px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 16px 42px rgba(32, 41, 56, .07);
}
.dashboard-range {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid #e1e6ed;
  border-radius: 8px;
  background: #f7f8fa;
}
.dashboard-range-btn {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 6px;
  background: transparent;
  color: #7a8492;
  font-size: 13px;
}
.dashboard-range-btn.is-active {
  background: #fff;
  color: #202938;
  box-shadow: 0 1px 4px rgba(25, 37, 69, .12);
}
.dashboard-overview {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.dashboard-overview-item {
  min-height: 96px;
  padding: 14px 16px;
  border: 1px solid #e7ebf0;
  border-radius: 8px;
  background: #fbfcfd;
}
.dashboard-overview-item span,
.dashboard-overview-item small {
  display: block;
  color: #748091;
  font-size: 12px;
}
.dashboard-overview-item strong {
  display: block;
  margin: 9px 0 3px;
  color: #202938;
  font-size: 26px;
  line-height: 1;
}
.dashboard-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.dashboard-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid #e7ebf0;
  border-radius: 8px;
  background: #fff;
}
.dashboard-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.dashboard-panel-head h3 { font-size: 17px; line-height: 1.2; }
.dashboard-panel-head p { margin-top: 4px; color: #8a94a3; font-size: 12px; }
.dashboard-panel-total { color: #202938; font-size: 18px; }
.dashboard-activity-total {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.dashboard-activity-head-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.accuracy-list { display: grid; gap: 15px; }
.accuracy-row-label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.accuracy-row-label strong { font-weight: 650; }
.accuracy-row-label span:last-child { color: #526071; font-variant-numeric: tabular-nums; }
.accuracy-category-dot,
.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #a9b1bc;
}
.accuracy-category-dot.reading { background: #52796f; }
.accuracy-category-dot.blank { background: #73547f; }
.accuracy-category-dot.math { background: #4e7f95; }
.accuracy-category-dot.writing { background: #59657c; }
.accuracy-track {
  height: 6px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f3;
}
.accuracy-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #202938;
  transition: width .35s ease;
}
.accuracy-row small { display: block; margin-top: 4px; color: #9aa3ad; font-size: 11px; }
.duration-list { display: grid; gap: 14px; }
.duration-row {
  padding-bottom: 11px;
  border-bottom: 1px solid #eef0f3;
}
.duration-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.duration-row-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.duration-row-main strong { font-weight: 650; }
.duration-row-main b {
  color: #202938;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.duration-row small {
  display: block;
  margin: 5px 0 0 17px;
  color: #9aa3ad;
  font-size: 11px;
}
.dashboard-legend {
  display: flex;
  gap: 10px;
  color: #7a8492;
  font-size: 11px;
  white-space: nowrap;
}
.dashboard-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot.study { background: var(--study-bar); }
.legend-dot.review { background: var(--review-bar); }
.activity-chart-wrap {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  min-height: 198px;
  padding-top: 4px;
  border-bottom: 1px solid #e7ebf0;
}
.activity-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-bottom: 35px;
  color: #8b96a5;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.activity-chart {
  display: grid;
  grid-template-columns: repeat(var(--activity-days, 7), minmax(18px, 1fr));
  align-items: end;
  gap: clamp(4px, 1vw, 12px);
  min-width: calc(var(--activity-days, 7) * 22px);
  height: 198px;
  overflow-x: auto;
}
.activity-chart.is-study-only {
  min-width: 0;
  gap: clamp(3px, .65vw, 8px);
  overflow-x: hidden;
}
.activity-day {
  display: grid;
  grid-template-rows: 1fr 17px;
  align-items: end;
  justify-items: center;
  min-width: 30px;
  height: 100%;
  color: #6c7888;
  font-size: 10px;
}
.activity-chart.is-study-only .activity-day {
  min-width: 0;
}
.activity-chart.is-study-only .activity-bar-column {
  width: min(22px, 72%);
}
.activity-day > label { white-space: nowrap; }
.activity-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  width: 100%;
  height: 100%;
  border-bottom: 1px dashed #eef0f3;
}
.activity-bar-column {
  position: relative;
  width: 13px;
  height: 100%;
}
.activity-count {
  position: absolute;
  bottom: calc(var(--bar-height) + 3px);
  left: 50%;
  z-index: 1;
  color: #3d4858;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transform: translateX(-50%);
}
.activity-count.is-empty { display: none; }
.activity-bar-track {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
}
.activity-bar {
  display: block;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 8px 8px 3px 3px;
}
.activity-bar.study {
  background: var(--study-bar);
}
.activity-bar.review {
  background: var(--review-bar);
}
.activity-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 14px;
  color: #7a8492;
  font-size: 12px;
}
.activity-summary strong { color: #202938; font-variant-numeric: tabular-nums; }
.dashboard-activity-panel { grid-column: 1 / -1; }
.dashboard-mode-panel,
.dashboard-daily-panel { grid-column: 1 / -1; }
.dashboard-mode-list { display: grid; gap: 8px; }
.dashboard-mode-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.4fr) repeat(3, minmax(110px, 1fr));
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #e7ebf0;
  border-radius: 8px;
  background: #fbfcfd;
}
.dashboard-mode-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.dashboard-mode-row > div:not(.dashboard-mode-label) {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dashboard-mode-row span {
  color: #8a94a3;
  font-size: 11px;
}
.dashboard-mode-row b {
  color: #202938;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.dashboard-daily-table-wrap {
  overflow-x: auto;
  border: 1px solid #e7ebf0;
  border-radius: 8px;
}
.dashboard-daily-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  color: #526071;
  font-size: 12px;
}
.dashboard-daily-table th,
.dashboard-daily-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf0f3;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dashboard-daily-table thead th {
  color: #748091;
  background: #f8fafc;
  font-size: 11px;
  font-weight: 700;
}
.dashboard-daily-table th:first-child,
.dashboard-daily-table td:first-child { text-align: left; }
.dashboard-daily-table tbody tr:last-child th,
.dashboard-daily-table tbody tr:last-child td { border-bottom: 0; }
.dashboard-table-empty {
  padding: 22px !important;
  color: #8a94a3;
  text-align: center !important;
}
.dashboard-empty {
  grid-column: 1 / -1;
  padding: 26px 12px;
  color: #8a94a3;
  text-align: center;
}

.scroll-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .62s ease, transform .62s cubic-bezier(.2, .72, .18, 1);
  will-change: opacity, transform;
}

.scroll-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.type-card.scroll-reveal:nth-child(2) { transition-delay: .06s; }
.type-card.scroll-reveal:nth-child(3) { transition-delay: .12s; }
.type-card.scroll-reveal:nth-child(4) { transition-delay: .18s; }
@media (prefers-reduced-motion: reduce) {
  .scroll-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .home-view, .app-shell#libraryView, .practice-view, .settings-view {
    transition: none;
  }
  .view-exit {
    opacity: 1 !important;
    transform: none;
  }
  .view-enter {
    animation: none;
  }
  .home-content-panel.tab-panel-enter {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

.database-error-panel { margin: 0 0 14px; }
.database-error-card {
  display: flex;
  justify-content: center;
  padding: 14px 18px;
  border: 1px solid #e8c48b;
  border-radius: var(--radius);
  background: #fffaf0;
  color: var(--text);
  text-align: center;
}
.database-error-card p + p { margin-top: 4px; }
.database-error-card button { margin-top: 10px; }

.home-eudic {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 90px 0 48px;
  background: #f7f8fb;
}
.home-eudic::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 460px;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(120deg,
      color-mix(in srgb, #d88a8a 28%, #f7f8fb),
      rgba(247, 248, 251, .78) 58%,
      rgba(247, 248, 251, 0) 100%);
  filter: blur(18px);
  opacity: .9;
}
.home-eudic .category-hero,
.home-eudic > .layout {
  width: min(1400px, calc(100% - 48px));
  margin-left: auto;
  margin-right: auto;
}
.home-eudic .board-panel,
.home-eudic .review-panel {
  border-color: rgba(214, 219, 227, .76);
  background: #fff;
  box-shadow: 0 18px 46px rgba(32, 41, 56, .10), inset 0 1px 0 rgba(255, 255, 255, .68);
  backdrop-filter: none;
}
/* C-drive dashboard layout merged into the single D-drive runtime. */
.home-dashboard {
  width: min(1480px, calc(100% - 48px));
  margin: 66px auto 52px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.home-content-panel.tab-panel-enter {
  opacity: 0;
  transform: translateY(30px);
  animation: dashboard-rise-in .72s cubic-bezier(.16, .82, .24, 1) forwards;
}
@keyframes dashboard-rise-in {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.dashboard-section-kicker {
  margin: 0 0 7px;
  color: #7e8795;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}
.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(280px, 1.05fr) minmax(0, 1.5fr);
  gap: 24px;
  min-height: 236px;
  margin-bottom: 18px;
  padding: 28px 32px;
  overflow: hidden;
  border: 1px solid #263449;
  border-radius: 16px;
  color: #f7fafc;
  background: #1f2b3b;
  box-shadow: 0 20px 44px rgba(31, 43, 59, .18);
}
.dashboard-hero-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.dashboard-hero .dashboard-section-kicker { color: #9fabbc; }
.dashboard-hero h3 { font-size: 22px; line-height: 1.2; }
.dashboard-hero-score {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 21px;
}
.dashboard-hero-score strong {
  color: #fff;
  font-size: 64px;
  line-height: .92;
  font-variant-numeric: tabular-nums;
}
.dashboard-hero-score span {
  color: #b7c1ce;
  font-size: 13px;
}
.dashboard-hero-note {
  max-width: 360px;
  margin-top: 15px;
  color: #b7c1ce;
  font-size: 13px;
}
.dashboard-hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: center;
}
.dashboard-hero-stats article {
  min-height: 82px;
  padding: 15px 16px;
  border: 1px solid rgba(194, 207, 222, .18);
  border-radius: 10px;
  background: rgba(255, 255, 255, .07);
}
.dashboard-hero-stats span,
.dashboard-hero-stats small {
  display: block;
  color: #aebaca;
  font-size: 11px;
}
.dashboard-hero-stats strong {
  display: block;
  margin: 8px 0 2px;
  color: #fff;
  font-size: 26px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr);
  gap: 18px;
  margin-bottom: 18px;
}
.dashboard-rhythm-panel,
.dashboard-insight-panel,
.dashboard-diagnosis-panel,
.dashboard-next-panel {
  box-shadow: 0 10px 26px rgba(32, 41, 56, .045);
}
.dashboard-rhythm-panel { min-height: 390px; }
.dashboard-insight-panel {
  display: flex;
  flex-direction: column;
  min-height: 390px;
  background: #f4f6f8;
}
.dashboard-insight-list {
  display: grid;
  gap: 12px;
  flex: 1;
}
.dashboard-insight-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 11px 0;
  border-bottom: 1px solid #e2e7ed;
}
.dashboard-insight-item:last-child { border-bottom: 0; }
.dashboard-insight-item p {
  color: #526071;
  font-size: 13px;
  line-height: 1.65;
}
.dashboard-insight-item strong { color: #202938; }
.insight-mark {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}
.insight-mark svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}
.insight-mark.warning { background: #b87355; }
.insight-mark.action { background: #8fd9c4; }
.insight-mark.calm { background: #71859b; }
.insight-mark.focus { background: #73547f; }
.insight-mark.neutral { color: #526071; background: #dfe5eb; }
.dashboard-review-action {
  width: 100%;
  min-height: 42px;
  margin-top: 18px;
}
.dashboard-heatmap-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 17px;
  color: #526071;
  font-size: 12px;
  font-weight: 700;
}
.dashboard-heatmap-head small {
  color: #9aa3ad;
  font-size: 11px;
  font-weight: 400;
}
.dashboard-heatmap {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 7px 10px;
  margin-top: 9px;
  overflow-x: auto;
}
.dashboard-heatmap-corner { min-width: 70px; }
.dashboard-heatmap-dates,
.dashboard-heatmap-row {
  display: grid;
  grid-template-columns: repeat(var(--heatmap-days, 7), minmax(18px, 1fr));
  gap: 6px;
  min-width: calc(var(--heatmap-days, 7) * 24px);
}
.dashboard-heatmap-dates {
  align-items: end;
  color: #9aa3ad;
  font-size: 9px;
  text-align: center;
}
.dashboard-heatmap-label {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 70px;
  color: #526071;
  font-size: 11px;
  white-space: nowrap;
}
.dashboard-heatmap-label .accuracy-category-dot {
  width: 7px;
  height: 7px;
}
.dashboard-heatmap-cell { display: block; min-width: 18px; }
.dashboard-heatmap-cell i {
  display: block;
  width: 100%;
  height: 15px;
  border-radius: 3px;
  background: #e8edf1;
}
.dashboard-diagnosis-panel { margin-bottom: 18px; }
.dashboard-diagnosis-legend {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #9aa3ad;
  font-size: 11px;
  white-space: nowrap;
}
.dashboard-diagnosis-legend i {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5b9bd5;
}
.dashboard-diagnosis-legend i:nth-of-type(2) { background: #4e7f95; }
.dashboard-diagnosis-legend i:nth-of-type(3) { background: #b87355; }
.dashboard-diagnosis-list { display: grid; gap: 8px; }
.dashboard-diagnosis-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(230px, 1.75fr) 142px 104px 18px;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #e5e9ee;
  border-radius: 9px;
  color: #202938;
  background: #fbfcfd;
  text-align: left;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.dashboard-diagnosis-row:hover {
  border-color: #bcc8d4;
  background: #fff;
  transform: translateY(-1px);
}
.diagnosis-type,
.diagnosis-accuracy {
  display: grid;
  gap: 3px;
}
.diagnosis-type {
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 8px;
}
.diagnosis-type small {
  grid-column: 2;
  color: #9aa3ad;
  font-size: 11px;
}
.diagnosis-type strong { font-size: 14px; }
.diagnosis-accuracy {
  grid-template-columns: auto minmax(50px, 1fr) auto;
  align-items: center;
  gap: 9px;
}
.diagnosis-accuracy b,
.diagnosis-time b,
.diagnosis-due b {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.diagnosis-accuracy small {
  grid-column: 1 / -1;
  color: #9aa3ad;
  font-size: 10px;
}
.diagnosis-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf1;
}
.diagnosis-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #5b9bd5;
}
.diagnosis-time,
.diagnosis-due {
  display: grid;
  gap: 3px;
}
.diagnosis-time small,
.diagnosis-due small {
  color: #9aa3ad;
  font-size: 10px;
}
.diagnosis-due b { color: #b87355; }
.diagnosis-arrow {
  color: #9aa3ad;
  font-size: 18px;
  text-align: right;
}
.dashboard-next-panel { margin-bottom: 18px; }
.dashboard-next-list { display: grid; gap: 8px; }
.dashboard-next-guidance {
  margin: 2px 0 8px;
  padding: 10px 12px;
  border-left: 3px solid #5b9bd5;
  background: #eef4fb;
}
.dashboard-next-guidance strong {
  color: #202938;
  font-size: 13px;
}
.dashboard-next-guidance p {
  margin-top: 3px;
  color: #687585;
  font-size: 12px;
  line-height: 1.55;
}
.dashboard-next-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #edf0f3;
}
.dashboard-next-item:last-child { border-bottom: 0; }
.dashboard-next-index {
  color: #a2acb8;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.dashboard-next-item strong {
  color: #202938;
  font-size: 13px;
}
.dashboard-next-item p {
  margin-top: 2px;
  color: #526071;
  font-size: 13px;
}
.dashboard-next-item small {
  display: block;
  margin-top: 4px;
  color: #9aa3ad;
  font-size: 11px;
}
.dashboard-next-empty {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 11px 0;
}
.dashboard-next-empty p {
  flex: 1;
  color: #748091;
  font-size: 13px;
}
.dashboard-details {
  border-top: 1px solid #dfe5eb;
  color: #526071;
}
.dashboard-details-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 17px 2px 12px;
}
.dashboard-details-head h3 {
  margin-top: 4px;
  color: #28313d;
  font-size: 17px;
  line-height: 1.2;
}
.dashboard-details summary {
  padding: 15px 2px;
  cursor: pointer;
  color: #526071;
  font-size: 13px;
  font-weight: 700;
}
.dashboard-details .dashboard-daily-table-wrap { margin-bottom: 6px; }
.accuracy-category-dot.vocabulary { background: #d88a8a; }

@media (max-width: 1100px) {
  .dashboard-main-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .home-dashboard {
    width: calc(100% - 24px);
    margin-top: 48px;
    padding: 0;
  }
  .dashboard-hero {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 22px;
  }
  .dashboard-hero-score strong { font-size: 48px; }
  .dashboard-hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-panel { padding: 14px; }
  .dashboard-diagnosis-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
  }
  .dashboard-diagnosis-row .diagnosis-accuracy { grid-column: 1 / -1; }
  .dashboard-diagnosis-row .diagnosis-arrow { display: none; }
  .dashboard-heatmap { grid-template-columns: 58px minmax(0, 1fr); }
  .dashboard-heatmap-label { min-width: 58px; font-size: 10px; }
  .dashboard-heatmap-corner { min-width: 58px; }
}

/* The weekly view compares the same dates across question types. */
.home-view.is-dashboard .dashboard-heatmap-category-grid {
  display: grid;
  gap: 9px;
  min-height: 214px;
  padding-top: 2px;
}
.home-view.is-dashboard .dashboard-heatmap-category-header,
.home-view.is-dashboard .dashboard-heatmap-category-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}
.home-view.is-dashboard .dashboard-heatmap-category-header {
  color: #9aa3ad;
  font-size: 10px;
}
.home-view.is-dashboard .dashboard-heatmap-category-header > span {
  text-align: left;
}
.home-view.is-dashboard .dashboard-heatmap-category-row {
  min-height: 30px;
}
.home-view.is-dashboard .dashboard-heatmap-category-row .dashboard-heatmap-label {
  min-width: 48px;
  font-size: 11px;
}
.home-view.is-dashboard .dashboard-heatmap-category-row .dashboard-heatmap-week {
  min-height: 30px;
  align-items: center;
}
.home-view.is-dashboard .dashboard-heatmap-category-row .dashboard-heatmap-cell i {
  width: min(100%, 42px);
  height: auto;
  min-height: 0;
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 5px;
  font-size: 9px;
}
.home-view.is-dashboard .dashboard-heatmap-category-header .dashboard-heatmap-week-labels {
  margin-top: 0;
}
.home-view.is-dashboard .dashboard-details {
  margin-top: 18px;
  padding: 0 14px 10px;
  border: 1px solid #e6eaee;
  border-radius: 9px;
  background: #fff;
}

@media (max-width: 720px) {
  .home-view.is-dashboard .dashboard-heatmap-category-header,
  .home-view.is-dashboard .dashboard-heatmap-category-row {
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 8px;
  }
  .home-view.is-dashboard .dashboard-heatmap-category-row .dashboard-heatmap-label {
    min-width: 50px;
    font-size: 10px;
  }
  .home-view.is-dashboard .dashboard-diagnosis-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}
.eudic-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.eudic-head h2 { font-size: 28px; line-height: 1.15; }
.eudic-head p:not(.eyebrow) { margin-top: 7px; color: #748091; font-size: 13px; }
.eudic-view-switch {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid #e1e6ed;
  border-radius: 8px;
  background: #f7f8fa;
}
.eudic-view-btn {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 6px;
  background: transparent;
  color: #7a8492;
  font-size: 13px;
}
.eudic-view-btn.is-active {
  background: #fff;
  color: #202938;
  box-shadow: 0 1px 4px rgba(25, 37, 69, .12);
}
.eudic-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, .85fr) auto minmax(260px, 1fr);
  gap: 10px;
  align-items: end;
  margin-bottom: 16px;
}
.eudic-toolbar label {
  display: grid;
  gap: 6px;
  color: #667085;
  font-size: 13px;
}
.eudic-category-menu {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}
.eudic-category-field {
  min-width: 0;
}
.eudic-create-book-btn {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
}
.eudic-create-book-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 28;
  width: min(300px, 86vw);
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(216, 138, 138, .24);
  border-radius: 12px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 16px 34px rgba(31, 41, 55, .16);
  backdrop-filter: blur(14px);
}
.eudic-create-book-panel > div {
  display: flex;
  gap: 8px;
}
.eudic-toolbar select,
.eudic-toolbar .select-trigger,
.eudic-toolbar input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #e1e5eb;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}
.eudic-toolbar input:focus,
.eudic-toolbar select:focus,
.eudic-toolbar .select-trigger:focus {
  outline: 2px solid rgba(75, 85, 99, .16);
  border-color: #4b5563;
}
.eudic-add-word {
  position: relative;
  min-width: 220px;
}
.eudic-add-word-field {
  display: grid;
  gap: 6px;
}
.eudic-word-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 25;
  display: grid;
  gap: 2px;
  padding: 5px;
  border: 1px solid #dfe5ec;
  border-radius: 10px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 12px 28px rgba(15, 23, 42, .14);
}
.eudic-word-suggestion {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 7px;
  background: transparent;
  color: #273244;
  font-size: 13px;
  text-align: left;
}
.eudic-word-suggestion:hover,
.eudic-word-suggestion:focus-visible {
  background: #f2f5f8;
  color: #111827;
  outline: none;
}
.eudic-import-menu {
  position: relative;
}
.eudic-import-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 28;
  width: min(380px, 86vw);
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(216, 138, 138, .24);
  border-radius: 12px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 16px 34px rgba(31, 41, 55, .16);
  backdrop-filter: blur(14px);
}
.eudic-import-panel section {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid #edf0f3;
  border-radius: 10px;
  background: #fff;
}
.eudic-import-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}
.eudic-import-panel strong {
  color: #263142;
  font-size: 14px;
}
.eudic-import-panel p {
  margin: 0;
  color: #7b8592;
  font-size: 12px;
  line-height: 1.55;
}
.eudic-import-panel .compact-btn {
  justify-self: start;
}
.eudic-status {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: #748091;
  font-size: 12px;
  text-align: right;
}
.eudic-import-hint {
  margin: -8px 0 14px;
  color: #9aa3ad;
  font-size: 12px;
}
.eudic-message {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid #d9e4e8;
  border-radius: 8px;
  background: #f3f8f8;
  color: #41606a;
  font-size: 13px;
}
.eudic-message.is-error {
  border-color: #f0caca;
  background: #fff6f6;
  color: #a33a35;
}
.app-toast {
  position: fixed;
  top: 18px;
  top: max(18px, calc(env(safe-area-inset-top, 0px) + 12px));
  left: 50%;
  right: auto;
  bottom: auto;
  z-index: 1100;
  width: max-content;
  max-width: min(420px, calc(100vw - 32px));
  padding: 11px 16px;
  border: 1px solid rgba(255, 255, 255, .86);
  border-radius: 12px;
  background: rgba(255, 255, 255, .92);
  color: #334155;
  box-shadow: 0 14px 34px rgba(32, 41, 56, .14), inset 0 1px 0 rgba(255, 255, 255, .86);
  backdrop-filter: blur(18px) saturate(1.12);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.55;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px);
  transition: opacity .18s ease, transform .18s ease;
}
.app-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.app-toast.is-error {
  border-color: rgba(180, 35, 24, .2);
  background: rgba(255, 248, 247, .95);
  color: #9f2f2a;
}
.eudic-word-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid #e1e5eb;
  border-radius: 10px;
  background: #fff;
}
.eudic-word-list-head,
.eudic-word-row {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: 16px;
  align-items: center;
}
.eudic-word-list-head {
  grid-column: 1 / -1;
  min-height: 34px;
  padding: 0 2px;
  border-bottom: 1px solid #e8edf1;
  background: transparent;
  color: #98a1ad;
  font-size: 11px;
}
.eudic-word-row {
  min-width: 0;
  min-height: 132px;
  grid-template-areas:
    "main meta"
    "exp exp"
    "context context";
  gap: 8px 14px;
  padding: 14px;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #fff;
}
.eudic-word-row:hover { background: #fbfdfd; }
.eudic-word-main {
  grid-area: main;
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 4px;
}
.eudic-word-main h3 {
  overflow-wrap: anywhere;
  color: #202938;
  font-size: 16px;
  line-height: 1.2;
}
.eudic-word-row header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.eudic-phon {
  display: block;
  margin-top: 0;
  color: #748091;
  font-size: 12px;
}
.eudic-star {
  flex: 0 0 auto;
  color: #b56a34;
  font-size: 12px;
}
.eudic-exp {
  grid-area: exp;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #334155;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.eudic-context {
  max-height: 38px;
  margin: 0;
  overflow: hidden;
  color: #748091;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.eudic-word-context {
  grid-area: context;
  min-width: 0;
  overflow: hidden;
  padding-left: 10px;
  border-left: 2px solid #d8e2e5;
}
.eudic-context-empty {
  color: #748091;
  font-size: 12px;
}
.eudic-word-meta {
  grid-area: meta;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 4px;
  color: #98a1ad;
  font-size: 11px;
}
.eudic-word-meta time { white-space: nowrap; }
.eudic-empty {
  grid-column: 1 / -1;
  /* 空态只需要一点点呼吸空间。原来 min-height: 180px + 垂直居中，导致提示文字
     上下各空出一大片，粉色块显得很空旷、把整张卡片撑得很长。 */
  min-height: 96px;
  padding: 22px 18px;
  display: grid;
  place-items: center;
  border: 1px dashed #d7dde5;
  border-radius: 10px;
  color: #748091;
  font-size: 14px;
  text-align: center;
}
.eudic-load-more {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}
.eudic-graph-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 240px;
  gap: 12px;
  height: min(620px, calc(100vh - 270px));
  min-height: 440px;
}
.eudic-group-list,
.eudic-graph-stage,
.eudic-word-detail {
  min-width: 0;
  border: 1px solid #e1e5eb;
  border-radius: 10px;
  background: #fff;
}
.eudic-group-list {
  padding: 10px;
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: #b8c7cc #f4f7f8;
}
.eudic-group-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 4px 10px;
  color: #202938;
  font-size: 13px;
}
.eudic-group-list-head span {
  color: #98a1ad;
  font-size: 11px;
  text-align: right;
}
.eudic-group-item {
  display: grid;
  gap: 4px;
  width: 100%;
  margin-top: 6px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #fbfcfd;
  color: #334155;
  text-align: left;
}
.eudic-group-item:hover,
.eudic-group-item.is-active {
  border-color: #a8c4c7;
  background: #f1f8f7;
}
.eudic-group-item strong {
  overflow: hidden;
  color: #202938;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.eudic-group-item span {
  overflow: hidden;
  color: #667085;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.eudic-group-item small {
  color: #98a1ad;
  font-size: 10px;
}
.eudic-group-empty {
  padding: 18px 8px;
  color: #98a1ad;
  font-size: 12px;
  line-height: 1.6;
}
.eudic-graph-stage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}
.eudic-graph-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 10px 14px;
  border-bottom: 1px solid #e8edf1;
  color: #202938;
  font-size: 13px;
}
.eudic-legend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 42px;
  justify-content: flex-end;
  color: #98a1ad;
  font-size: 11px;
  white-space: nowrap;
}
.eudic-legend i {
  display: inline-block;
  width: 18px;
  height: 2px;
  margin-left: 7px;
  background: #4f9485;
}
.eudic-legend i:first-child { margin-left: 0; }
.eudic-legend i.antonym {
  background: repeating-linear-gradient(90deg, #d97878 0 5px, transparent 5px 8px);
}
.eudic-graph-canvas {
  min-height: 450px;
  padding: 4px;
  background: #fff;
}
.eudic-svg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 450px;
}
.eudic-svg-bg { fill: #fff; }
.eudic-edge line {
  stroke-width: 2;
  stroke-linecap: round;
}
.eudic-edge.synonym line { stroke: #4f9485; }
.eudic-edge.antonym line {
  stroke: #d97878;
  stroke-dasharray: 7 6;
}
.eudic-svg-node { cursor: pointer; outline: none; }
.eudic-svg-node circle {
  fill: #fff;
  stroke: #b7c4cc;
  stroke-width: 2;
  filter: drop-shadow(0 4px 8px rgba(42, 65, 77, .1));
  transition: fill .15s ease, stroke .15s ease, transform .15s ease;
}
.eudic-svg-node:hover circle,
.eudic-svg-node:focus circle {
  fill: #f1f8f7;
  stroke: #4f9485;
  stroke-width: 3;
}
.eudic-svg-node.is-center circle {
  fill: #edf7f5;
  stroke: #4f9485;
  stroke-width: 3;
}
.eudic-svg-node.is-focus circle {
  fill: #fff9e8;
  stroke: #c58b34;
  stroke-width: 4;
}
.eudic-svg-node text {
  fill: #263746;
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
}
.eudic-graph-empty,
.eudic-detail-empty {
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: 28px;
  color: #748091;
  font-size: 13px;
  text-align: center;
}
.eudic-graph-empty strong { color: #334155; font-size: 16px; }
.eudic-graph-empty p { margin-top: 8px; line-height: 1.7; }
.eudic-graph-empty code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #f3f5f7;
  color: #526071;
  font-size: 11px;
}
.eudic-word-detail { padding: 14px; }
.eudic-detail-card { color: #334155; }
.eudic-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e8edf1;
}
.eudic-detail-card h3 { color: #202938; font-size: 24px; line-height: 1.2; overflow-wrap: anywhere; }
.eudic-detail-phon { display: block; margin-top: 6px; color: #748091; font-size: 12px; }
.eudic-detail-card > p {
  margin-top: 16px;
  color: #334155;
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
}
.eudic-detail-context {
  margin-top: 16px;
  padding: 10px;
  border-left: 2px solid #d8e2e5;
  background: #fbfcfd;
  color: #748091;
  font-size: 12px;
  line-height: 1.65;
}
.eudic-detail-card > small {
  display: block;
  margin-top: 18px;
  color: #98a1ad;
  font-size: 11px;
}

/* Vocabulary tab uses a distinct soft rose theme.
   --accent is overridden so shared controls (buttons, focus, selected,
   eyebrow, progress) inherit the rose theme instead of falling back to the
   default gray template accent. */
.home-view.is-eudic {
  --accent: #d88a8a;
  --accent-dark: #b87070;
  --eudic-pink: #d88a8a;
  --eudic-pink-dark: #b87070;
  --eudic-pink-soft: #fdf2f2;
  --eudic-pink-pale: #f5dada;
  --eudic-pink-line: #e0b0b0;
}
.home-view.is-eudic .eudic-practice-card .type-card-marked {
  color: rgba(58, 40, 50, .72);
}
.home-view.is-eudic .eudic-head h2,
.home-view.is-eudic .eudic-word-main h3,
.home-view.is-eudic .eudic-group-list-head,
.home-view.is-eudic .eudic-detail-card h3 {
  color: #3a2832;
}
.home-view.is-eudic .eudic-view-switch {
  border-color: #e1e6ed;
  background: var(--eudic-pink-soft);
}
.home-view.is-eudic .eudic-view-btn {
  color: #b08080;
}
.home-view.is-eudic .eudic-view-btn.is-active {
  color: #a86060;
  background: #fff;
  box-shadow: 0 2px 8px rgba(216, 138, 138, .16);
}
.home-view.is-eudic .eudic-toolbar select,
.home-view.is-eudic .eudic-toolbar .select-trigger,
.home-view.is-eudic .eudic-toolbar input {
  border-color: #e1e5eb;
  background: #fff;
}
.home-view.is-eudic .eudic-toolbar input:focus,
.home-view.is-eudic .eudic-toolbar select:focus,
.home-view.is-eudic .eudic-toolbar .select-trigger:focus {
  outline-color: rgba(184, 112, 112, .20);
  border-color: var(--eudic-pink-dark);
}
.home-view.is-eudic .eudic-message {
  border-color: #d9e4e8;
  background: var(--eudic-pink-soft);
  color: #a86060;
}
.home-view.is-eudic .eudic-word-grid,
.home-view.is-eudic .eudic-group-list,
.home-view.is-eudic .eudic-graph-stage,
.home-view.is-eudic .eudic-word-detail {
  border-color: #e1e5eb;
  background: #fff;
  box-shadow: 0 12px 28px rgba(32, 41, 56, .06);
}
.home-view.is-eudic .eudic-word-list-head {
  border-bottom-color: #e8edf1;
  color: #c09090;
}
.home-view.is-eudic .eudic-word-row {
  border-color: #edf0f3;
  background: #fff;
}
.home-view.is-eudic .eudic-word-row:hover {
  border-color: #dbe2ea;
  background: #fbfdfd;
}
.home-view.is-eudic .eudic-word-context {
  border-left-color: #d9e4e8;
}
.home-view.is-eudic .eudic-star {
  color: var(--eudic-pink-dark);
}
.home-view.is-eudic .eudic-group-item {
  border-color: transparent;
  background: transparent;
}
.home-view.is-eudic .eudic-group-item:hover,
.home-view.is-eudic .eudic-group-item.is-active {
  border-color: #e1e5eb;
  background: var(--eudic-pink-soft);
}
.home-view.is-eudic .eudic-empty,
.home-view.is-eudic .eudic-group-empty,
.home-view.is-eudic .eudic-graph-empty,
.home-view.is-eudic .eudic-detail-empty {
  border-color: #e1e5eb;
  background: #fff;
  color: #748091;
}
.home-view.is-eudic .eudic-word-grid {
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.home-view.is-eudic .eudic-word-list-head {
  padding: 0 18px 8px;
}
.home-view.is-eudic .eudic-word-row.question-list-row {
  min-height: 96px;
  grid-template-columns: 34px minmax(360px, 1fr) minmax(96px, 120px) minmax(0, 206px);
  grid-template-areas: none;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: none;
}
.home-view.is-eudic .eudic-word-row.question-list-row:hover {
  border-color: #dbe2ea;
  background: #fbfdfd;
}
.home-view.is-eudic .eudic-word-select {
  align-self: center;
  justify-content: center;
}
.home-view.is-eudic .eudic-word-index {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #d9e0e8;
  border-radius: 8px;
  background: #fff;
  color: #5f6875;
  font-size: 11px;
  font-weight: 850;
}
.home-view.is-eudic .eudic-list-main h4 {
  margin-bottom: 4px;
}
.home-view.is-eudic .eudic-list-main .list-prompt-copy {
  font-size: 17px;
}
.home-view.is-eudic .eudic-list-main p {
  margin: 0;
}
.home-view.is-eudic .eudic-list-main .eudic-exp {
  margin-top: 5px;
  color: #334155;
  font-size: 13px;
  line-height: 1.45;
  white-space: nowrap;
}
.home-view.is-eudic .eudic-list-actions {
  grid-template-columns: repeat(4, minmax(42px, 1fr));
  gap: 6px;
  max-width: 206px;
}
.home-view.is-eudic .eudic-list-actions .compact-btn {
  min-height: 28px;
  padding: 0 6px;
  font-size: 12px;
  white-space: nowrap;
}
.eudic-side-panel {
  padding: 22px;
  border-radius: var(--radius);
}
.eudic-side-panel h2 {
  margin-bottom: 8px;
  font-size: 26px;
}
.eudic-side-panel p {
  color: #748091;
  line-height: 1.7;
}
.eudic-side-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.eudic-side-tags span {
  padding: 8px 12px;
  border: 1px solid #e1e5eb;
  border-radius: 999px;
  color: #a86060;
  background: #fdf4f4;
  font-size: 13px;
  font-weight: 700;
}
.eudic-memory-view {
  box-sizing: border-box;
  height: 100vh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(14px, 3vh, 26px) clamp(18px, 4vw, 64px) clamp(14px, 3vh, 28px);
  background: #fff;
  color: #30343b;
}
.eudic-memory-topbar {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) minmax(152px, auto);
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 1640px;
  margin: 0 auto;
}
.eudic-memory-tools {
  display: inline-flex;
  justify-content: flex-end;
  gap: 8px;
}
.eudic-memory-progress {
  min-width: 0;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: #40454d;
  font-size: 12px;
}
.eudic-memory-progress i {
  display: block;
  height: 12px;
  overflow: hidden;
  border-radius: 4px;
  background: #f0f0f0;
}
.eudic-memory-progress b {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 4px;
  background: #dfeaf9;
  transition: width .18s ease;
}
.eudic-memory-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  width: 100%;
  max-width: 1640px;
  min-height: 0;
  flex: 1 1 auto;
  margin: clamp(8px, 2vh, 18px) auto 0;
}
.eudic-memory-view.is-revealed .eudic-memory-stage {
  grid-template-columns: minmax(0, 1fr) minmax(380px, 520px);
}
.eudic-memory-card {
  min-width: 0;
  min-height: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(10px, 2vh, 16px);
  height: 100%;
  padding: clamp(16px, 5vh, 72px) 24px;
  text-align: center;
}
.eudic-memory-mode {
  margin: 0;
  padding: 3px 8px;
  border-radius: 5px;
  background: #edf9ee;
  color: #69cf75;
  font-size: 12px;
  font-weight: 700;
}
.eudic-memory-card h2 {
  max-width: 100%;
  margin: 0;
  color: #2f3238;
  font-size: clamp(32px, 3.6vw, 48px);
  font-weight: 700;
  line-height: 1.08;
  overflow-wrap: anywhere;
}
.eudic-memory-phon {
  min-height: 24px;
  margin: 0;
  color: #9ba1aa;
  font-size: 17px;
}
.eudic-memory-example {
  min-height: 24px;
  color: #9ba1aa;
  font-size: 13px;
}
.eudic-memory-detail {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  max-height: calc(100vh - 32px);
  margin: -44px calc(clamp(18px, 4vw, 64px) * -1) -28px 26px;
  padding: 44px 26px 34px;
  border-left: 1px solid rgba(15, 23, 42, .08);
  background: #fff;
  box-shadow: none;
  scrollbar-width: thin;
  scrollbar-color: #c6ccd3 transparent;
}
.eudic-memory-detail-inner {
  display: grid;
  gap: 20px;
}
.eudic-memory-detail header {
  padding-bottom: 14px;
  border-bottom: 1px solid #eef2f7;
}
.eudic-memory-detail h3 {
  margin: 0;
  color: #202938;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.eudic-memory-detail header p,
.eudic-memory-muted {
  margin: 10px 0 0;
  color: #7a8698;
  line-height: 1.6;
}
.eudic-memory-section {
  display: grid;
  gap: 10px;
}
.eudic-memory-section h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #3d7ab5;
  font-size: 14px;
  font-weight: 800;
}
.eudic-memory-section h4::before {
  width: 3px;
  height: 16px;
  border-radius: 999px;
  background: #5b9bd5;
  content: "";
}
.eudic-memory-section-body {
  display: grid;
  gap: 6px;
  padding-left: 11px;
  border-left: 1px solid #eef2f7;
}
.eudic-memory-section-body p {
  margin: 0;
  color: #2b3648;
  font-size: 15px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}
.eudic-memory-section-body .eudic-memory-inline {
  word-break: normal;
  white-space: normal;
}
.eudic-memory-question-section .eudic-memory-question-list {
  display: grid;
  gap: 0;
  padding-left: 11px;
  border-left: 1px solid #eef2f7;
}
.eudic-memory-question-list button {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 9px;
  width: 100%;
  padding: 10px 0 12px;
  border: 0;
  border-bottom: 1px solid #eef2f7;
  border-radius: 0;
  background: transparent;
  color: #2b3648;
  text-align: left;
}
.eudic-memory-question-list button:last-child { border-bottom: 0; }
.eudic-memory-question-list button:hover,
.eudic-memory-question-list button:focus-visible {
  color: #1f6fb8;
}
.eudic-memory-question-list strong {
  color: #3d7ab5;
  font-size: 13px;
}
.eudic-memory-question-list small {
  color: #8695a8;
  font-size: 12px;
}
.eudic-memory-question-list span {
  grid-column: 1 / -1;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2b3648;
  font-size: 14px;
  line-height: 1.7;
}
.eudic-memory-actions {
  display: grid;
  flex: 0 0 auto;
  width: min(100%, 1640px);
  margin: clamp(10px, 2vh, 18px) auto 0;
}
.eudic-memory-view.is-revealed .eudic-memory-actions {
  grid-template-columns: minmax(0, 1fr) minmax(380px, 520px);
}
.eudic-memory-view.is-revealed .eudic-memory-judgement,
.eudic-memory-view.is-revealed .eudic-memory-next-action {
  grid-column: 1;
}
.eudic-memory-judgement {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(8px, 1.6vh, 12px);
}
.eudic-memory-action {
  width: 100%;
  min-height: clamp(42px, 6vh, 52px);
  border: 0;
  border-radius: 6px;
  background: #f4f4f4;
  color: #42464d;
  box-shadow: none;
  font-size: 17px;
  font-weight: 500;
}
.eudic-memory-action:hover,
.eudic-memory-action:focus-visible {
  background: #eeeeee;
  color: #22262d;
}
.eudic-memory-action.is-selected {
  background: #eaf3ff;
  color: #2584ff;
}
.eudic-memory-next-action {
  margin-top: 0;
}

.type-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 250px;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  padding: 42px 52px 34px;
  text-align: left;
  color: #243044;
  box-shadow: 0 14px 38px rgba(25, 37, 69, .12);
  transition: transform .16s ease, box-shadow .16s ease;
}

.type-card::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -115px;
  width: 330px;
  height: 330px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .24);
}

.type-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 48px rgba(25, 37, 69, .14);
}

.type-card.scroll-reveal {
  transform: translateY(42px);
  transition: opacity .72s ease, transform .72s cubic-bezier(.16, .82, .24, 1), box-shadow .16s ease;
}
.type-card.scroll-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.type-card.scroll-reveal.is-visible:hover {
  transition-delay: 0s;
  transform: translateY(-6px);
}
.type-card.scroll-reveal:nth-child(2) { transition-delay: .08s; }
.type-card.scroll-reveal:nth-child(3) { transition-delay: .16s; }
.type-card.scroll-reveal:nth-child(4) { transition-delay: .24s; }

/* 视图级切换过渡：所有主视图（主页 / 题库 / 做题 / 设置）切换时，
   旧视图先快速渐隐（.view-exit），新视图再淡入并轻微上升（.view-enter）。
   之前各视图靠 hidden 瞬间翻转，主页点题型 tab 时是「画面闪换」，
   用户感知不到任何上升动效 —— 这就是「前四个 tab 没有上升」的根因。 */
.home-view, .app-shell#libraryView, .practice-view, .settings-view {
  transition: opacity .18s ease, transform .18s ease;
}
.view-exit {
  opacity: 0 !important;
  transform: translateY(-10px);
  pointer-events: none;
}
.view-enter {
  animation: view-rise-in .4s cubic-bezier(.16, .82, .24, 1) both;
}
@keyframes view-rise-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.type-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  font-size: 40px;
  line-height: 1;
  margin-bottom: 12px;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}
.type-icon .category-icon-svg {
  display: block;
  width: 42px;
  height: 42px;
  fill: currentColor;
}

.type-card strong {
  font-size: 38px;
  line-height: 1.15;
}

.type-card > span:not(.type-icon) {
  max-width: 760px;
  margin-top: 20px;
  font-size: 20px;
  line-height: 1.85;
  font-weight: 650;
}

.type-card em {
  position: absolute;
  right: 52px;
  bottom: 34px;
  z-index: 1;
  font-style: normal;
  font-size: 18px;
  font-weight: 800;
}
.type-card-marked {
  position: absolute;
  right: 52px;
  bottom: 58px;
  z-index: 1;
  color: rgba(36, 48, 68, .72);
  font-size: 13px;
  font-style: normal;
  font-weight: 750;
}
.type-card-marked .mark-star {
  width: 15px;
  height: 15px;
}
.type-card > span.mark-star {
  margin: 0;
  font-size: inherit;
  line-height: 1;
  font-weight: inherit;
}

.type-card-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 28px;
  padding-right: 100px;
}

.type-card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: var(--radius);
  color: #233047;
  background: rgba(255, 255, 255, .36);
  border: 1px solid rgba(255, 255, 255, .5);
  font-size: 14px;
  font-weight: 750;
}

.type-card-btn:hover {
  background: rgba(255, 255, 255, .52);
}

.type-card-open {
  color: #fff;
  background: rgba(24, 34, 54, .74);
  border-color: rgba(24, 34, 54, .28);
}

.type-card-open:hover {
  background: rgba(24, 34, 54, .86);
}

.type-blank {
  background: #b9a7c2;
}

.type-reading {
  background: #b6d0c9;
}

.type-math {
  background: #c2dfea;
}

.type-vocabulary {
  background: #e0a8a8;
}

.type-writing {
  background: #8c95aa;
  color: #f8fafc;
}

.type-writing .type-card-btn {
  color: #f8fafc;
  background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .26);
}

.type-writing .type-card-open {
  color: #253047;
  background: rgba(255, 255, 255, .82);
}

.question-board.single-category {
  grid-template-columns: 1fr;
}

.question-board.single-category .category-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.practice-view { min-height: 100vh; background: #fff; color: #171717; font-family: Arial, Helvetica, sans-serif; -webkit-font-smoothing: antialiased; }
.practice-topbar { position: relative; height: 108px; color: #fff; background: #343331; box-shadow: inset 0 -1px 0 rgba(255,255,255,.18); }
.practice-brand { position: absolute; top: 12px; left: max(18px, calc((100vw - 1500px) / 2 + 18px)); display: flex; align-items: center; gap: 10px; height: 48px; min-width: 0; font-family: Arial, sans-serif; }
.ets-mark { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 34px; border: 2px solid #fff; border-radius: 50%; font-size: 11px; font-weight: 800; font-style: italic; }
.ets-mark small { align-self: flex-start; margin: 2px 0 0 2px; font-size: 7px; }
.practice-brand strong { font-size: 48px; line-height: 1; font-style: italic; letter-spacing: 0; }
.practice-section-name { min-width: 0; margin-left: 4px; overflow: hidden; font-size: 16px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.practice-controls { position: absolute; top: 8px; right: max(8px, calc((100vw - 1500px) / 2 + 8px)); display: flex; gap: 7px; align-items: stretch; max-width: calc(100% - 390px); overflow-x: auto; overflow-y: hidden; padding-bottom: 1px; }
.exam-top-btn { display: inline-flex; flex: 0 0 auto; min-width: 70px; height: 64px; flex-direction: column; justify-content: center; align-items: center; gap: 3px; padding: 5px 12px; color: #fff; border: 1px solid rgba(255,255,255,.28); border-radius: 2px; background: #315f89; font-family: Arial, Helvetica, sans-serif; }
.exam-top-btn span { order: 2; font-size: 18px; line-height: 1; }
.exam-top-btn b { order: 1; }
.exam-top-btn .exam-icon { display: block; order: 2; width: 23px; height: 23px; flex: 0 0 23px; object-fit: contain; object-position: center; }
.exam-top-btn .mark-star { order: 2; width: 23px; height: 23px; flex: 0 0 23px; }
.exam-top-btn b { font-size: 14px; font-weight: 700; line-height: 1.05; white-space: nowrap; }
.exam-top-btn:hover { background: #4077a8; }
.exam-top-btn:disabled { background: #454545; }
.exit-section-btn { min-width: 122px; background: #795d70; }
.exit-section-btn:hover { background: #916f84; }
.next-section-btn { background: #315f89; }
.exam-top-btn.is-marked { background: #9b7b35; }
.practice-status-bar { position: absolute; right: 0; bottom: 0; left: 0; display: flex; justify-content: space-between; align-items: center; min-height: 34px; gap: 12px; padding: 4px max(14px, calc((100vw - 1500px) / 2 + 14px)) 4px max(8px, calc((100vw - 1500px) / 2 + 8px)); color: #282828; border-top: 1px solid #8b8b8b; background: #f4e8ed; font-family: Arial, Helvetica, sans-serif; }
.practice-status-bar > strong { min-width: 0; overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.timer-row { display: flex; align-items: center; gap: 10px; font-family: Arial, sans-serif; }
.ui-icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.hide-time-btn { min-width: 108px; height: 25px; padding: 0 7px; color: #333; background: transparent; font-size: 14px; font-weight: 700; }
.hide-time-btn:hover { background: rgba(255,255,255,.48); }
.practice-clock { min-width: 86px; color: #171717; font-size: 18px; font-variant-numeric: tabular-nums; }
.practice-clock.time-hidden { color: transparent; text-shadow: none; }
.exam-stage { display: flex; justify-content: center; min-height: calc(100vh - 108px); padding: 0 12px 128px; background: #fff; }
.exam-paper { position: relative; width: min(100%, 1460px); min-height: calc(100vh - 124px); margin: 0 auto; padding: 18px 28px 136px; overflow: visible; background: #fff; }
.exam-instructions { display: block; width: fit-content; max-width: min(100%, 1280px); margin: 0 auto; padding: 7px 14px; overflow-wrap: anywhere; color: #1d1d1d; background: #d5d5d5; font-family: Arial, Helvetica, sans-serif; font-size: 18px; line-height: 1.28; text-align: center; }
.exam-instructions[hidden] { display: none; }
.exam-prompt { max-width: 100%; margin: 48px auto 0; overflow-wrap: anywhere; color: #171717; font-family: "Times New Roman", Times, serif; font-size: 22px; font-weight: 400; line-height: 1.5; white-space: normal; }
.exam-prompt p { margin: 0 0 14px; }
.exam-prompt p:last-child { margin-bottom: 0; }
.practice-math-image { display: block; width: min(100%, 680px); max-height: 330px; margin: 24px auto 0; object-fit: contain; }
.exam-prompt .practice-blank {
  display: inline-block;
  width: 5.2em;
  min-width: 92px;
  height: .72em;
  margin: 0 .08em;
  border-bottom: 2px solid #222;
  vertical-align: -0.12em;
}
.prompt-equation-block { margin: 0 0 14px; line-height: 1.65; }
.prompt-table-wrap { width: min(760px, 100%); margin: 14px auto 18px; overflow-x: auto; }
.prompt-table { width: auto; min-width: min(560px, 100%); margin: 0 auto; border-collapse: collapse; color: #171717; background: #fff; font-family: "Times New Roman", Times, serif; font-size: 15px; line-height: 1.18; }
.prompt-table th,
.prompt-table td { padding: 5px 12px; border: 1px solid #555; text-align: center; vertical-align: middle; }
.prompt-table th { padding: 6px 12px; border: 1px solid #555; background: #f7f7f7; font-weight: 400; text-align: center; vertical-align: middle; }
.math-radical { display: inline-flex; align-items: baseline; white-space: nowrap; }
.math-coeff { margin-right: .04em; }
.sqrt-symbol { line-height: 1; transform: translateY(.03em); }
.sqrt-bar { display: inline-block; padding: .02em .12em 0 .08em; border-top: 1.5px solid currentColor; line-height: 1.05; }
.math-frac { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; margin: 0 .08em; font-size: .9em; line-height: 1; vertical-align: middle; }
.math-frac > span:first-child { width: 100%; min-width: 1.1em; padding: 0 .16em .08em; border-bottom: 1.5px solid currentColor; text-align: center; }
.math-frac > span:last-child { padding: .08em .16em 0; text-align: center; }
.exam-options { display: grid; gap: 17px; width: min(690px, 100%); margin: 26px auto 0; min-width: 0; }
.blank-choice-columns { grid-template-columns: repeat(var(--blank-column-count, 3), minmax(0, 1fr)); gap: clamp(10px, 1.6vw, 18px); width: min(820px, 100%); }
.blank-choice-columns.blank-choice-two { width: min(720px, 100%); }
.blank-choice-column { display: grid; align-content: start; gap: 12px; }
.blank-choice-column > strong { padding-bottom: 7px; border-bottom: 1px solid #777; font-family: "Times New Roman", Times, serif; font-size: 16px; text-align: center; }
.blank-choice-column .exam-option { gap: 8px; font-size: 17px; }
.exam-option { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 12px; min-width: 0; color: #171717; font-family: "Times New Roman", Times, serif; font-size: 20px; font-weight: 400; line-height: 1.35; cursor: pointer; }
.exam-option input { position: absolute; opacity: 0; pointer-events: none; }
.fake-radio { width: 24px; height: 18px; border: 2px solid #222; border-radius: 50%; background: #fff; box-shadow: inset 0 1px 1px rgba(0,0,0,.08); }
.multiple-choice-options .fake-radio { width: 20px; height: 20px; border-radius: 0; }
.exam-option input:checked + .fake-radio { background: #222; border-color: #222; box-shadow: none; }
.numeric-answer-wrap { display: contents; }
.numeric-answer-unit { color: #171717; font-family: "Times New Roman", Times, serif; font-size: 24px; line-height: 1; }
.essay-answer { display: block; width: min(760px, 100%); min-height: 300px; margin: 28px auto 0; padding: 14px; color: #171717; border: 1px solid #999; border-radius: 0; background: #fff; font-family: Arial, sans-serif; font-size: 16px; line-height: 1.5; resize: vertical; }
.exam-actions { position: fixed; right: 0; bottom: 0; left: 0; z-index: 40; flex-direction: column; align-items: center; justify-content: center; gap: 12px; margin-top: 0; padding: 10px 12px 16px; color: #555; background: #fff; font-family: Arial, Helvetica, sans-serif; box-shadow: 0 -1px 0 rgba(0, 0, 0, .06); }
.practice-bottom-hint { width: fit-content; max-width: min(100%, 1280px); margin: 0 auto; padding: 6px 12px; color: #333; background: #d5d5d5; font-size: 18px; line-height: 1.2; text-align: center; }
.practice-bottom-hint[hidden],
.practice-bottom-hint:empty { display: none; }
.exam-actions #practiceMeta { display: none; }
.exam-actions .primary-btn { border-radius: 2px; background: #315f89; }
.exam-actions .primary-btn:hover { background: #244d72; }
/* 解析面板：原来是遗留的灰色 ETS 模板盒子，这里改成与全站一致的浅色卡片 */
.analysis-panel {
  width: min(860px, 100%);
  flex: 0 0 auto;
  /* 留够呼吸：解析不再贴着最后一行的选项/作答区，视觉上先「告一段落」再开讲。
     用户反馈 48px 还是偏近，再往下挪一档。 */
  margin: 72px auto 24px;
  padding: 22px 24px 24px;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 26px rgba(15, 23, 42, .07), inset 0 1px 0 rgba(255, 255, 255, .9);
  /* 解析正文用 Times New Roman：和 ETS 真题排版一致，读起来更正式，
     也能和上面的题干一眼区分开——题干是题目，这里才是讲解。 */
  font-family: "Times New Roman", Times, serif;
}
/* 面板里的辅助信息不跟着正文换字体，仍是全站字族：
   只有 <section> 直接子级的那条蓝标题（正确答案 / 解析 / 翻译 / AI 解析）
   以及按钮、提示、耗时 badge 走这里；正文内部的加粗、列表、引用都继承 Times。 */
.practice-answer-section > strong,
.ai-solution-heading,
.auto-result,
.ai-solution-btn,
.ai-solution-hint,
.ai-solution-meta,
.ai-solution-status {
  font-family: var(--font-sans);
}
#practiceAnalysis { white-space: normal; line-height: 1.5; }
.practice-highlight { padding: 0 .08em; color: inherit; background: #fff09a; border-radius: 2px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.practice-context-menu { position: fixed; z-index: 60; min-width: 142px; padding: 5px; border: 1px solid rgba(255,255,255,.78); border-radius: 10px; background: rgba(255,255,255,.78); box-shadow: 0 14px 32px rgba(15,23,42,.2); backdrop-filter: blur(20px) saturate(1.16); }
.practice-context-menu button { display: block; width: 100%; min-height: 34px; padding: 0 12px; color: #182337; background: transparent; text-align: left; font-size: 14px; white-space: nowrap; }
.practice-context-menu button:disabled { color: #9aa3b1; cursor: not-allowed; }
.practice-context-menu button:hover { color: #182337; border-radius: 7px; background: rgba(115,84,127,.16); }
.practice-context-menu button:disabled:hover { background: transparent; }
.practice-word-popover {
  position: fixed;
  z-index: 61;
  width: min(330px, calc(100vw - 24px));
  padding: 13px 14px 14px;
  border: 1px solid rgba(255, 255, 255, .84);
  border-radius: 12px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 18px 42px rgba(15, 23, 42, .2);
  color: #273244;
  backdrop-filter: blur(20px) saturate(1.12);
}
.practice-word-popover-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  padding-bottom: 9px;
  border-bottom: 1px solid #edf0f4;
}
.practice-word-popover-head strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #182337;
  font-size: 18px;
  line-height: 1.2;
}
.practice-word-add {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  margin-left: auto;
  overflow: hidden;
  border: 1px solid #dbe2ea;
  border-radius: 7px;
  background: #f8fafc;
  color: #526275;
  font-size: 0;
  line-height: 0;
}
.practice-word-add svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}
.practice-word-add:hover:not(:disabled) {
  border-color: #aebbc9;
  background: #eef2f6;
  color: #1f2937;
}
.practice-word-add:disabled:not(.is-added) {
  cursor: progress;
  opacity: .72;
}
.practice-word-add.is-added {
  width: 28px;
  min-width: 28px;
  padding: 0;
  color: #2f7d52;
  border-color: #bfe1ca;
  background: #eef8f1;
  cursor: default;
  opacity: 1;
}
.practice-word-add.is-added svg {
  stroke-width: 2.1;
}
.practice-word-popover-body {
  display: grid;
  gap: 7px;
  padding-top: 11px;
  color: #4b596c;
  font-size: 13px;
  line-height: 1.5;
}
.practice-word-suggestion {
  margin: 0;
  color: #7b8794;
}
.practice-word-suggestion strong {
  color: #314256;
  font-weight: 700;
}
.practice-word-definition { color: #273244; font-size: 14px; }
.practice-word-label {
  display: inline-block;
  min-width: 58px;
  margin-right: 4px;
  color: #8a96a5;
  font-size: 11px;
}
.practice-word-loading { margin: 0; color: #8a96a5; }
.reading-passage-panel { min-width: 0; max-width: 100%; border: 1px solid #262626; background: #fff; }
.reading-panel-label { padding: 4px 8px; color: #fff; background: #17245a; font-family: Arial, sans-serif; font-size: 14px; font-weight: 700; }
.reading-passage { padding: 14px 18px; overflow-wrap: anywhere; color: #171717; font-size: 19px; line-height: 1.52; }
.passage-sentence { display: inline; margin: 0; padding: 1px 2px; color: inherit; border: 0; border-radius: 2px; background: transparent; font: inherit; line-height: inherit; text-align: left; cursor: pointer; }
.passage-sentence:hover { background: #edf0f2; }
.passage-sentence.is-selected { background: #cfd4d8; box-shadow: inset 0 -2px 0 #51575b; }
.exam-layout-reading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(4px, .5vw, 8px); padding: 0 4px 34px; }
.exam-layout-reading .reading-passage-panel { grid-column: 1; grid-row: 1 / span 5; height: min(760px, calc(100dvh - 188px)); max-height: calc(100dvh - 188px); overflow-y: auto; }
.exam-layout-reading .exam-instructions { grid-column: 2; grid-row: 1; width: calc(100% - 20px); margin: 0 10px; }
.exam-layout-reading .exam-prompt { grid-column: 2; grid-row: 2; margin: 14px 20px 0; }
.exam-layout-reading .exam-options { grid-column: 2; grid-row: 3; width: auto; margin: 24px 28px 0; gap: 19px; }
.exam-layout-reading .exam-actions { grid-column: 2; grid-row: 4; }
.exam-layout-reading .analysis-panel { grid-column: 1 / -1; grid-row: 6; }
.exam-layout-blank { display: flex; flex-direction: column; max-width: 1080px; }
.exam-layout-blank .exam-prompt { max-width: min(860px, 100%); margin-top: 70px; }
.exam-layout-blank .exam-options { width: min(720px, 100%); margin-top: 30px; }
.exam-layout-blank .exam-option { grid-template-columns: 24px minmax(0, 1fr); }
.exam-layout-blank .exam-actions { width: 100%; }
.exam-layout-blank:has(.analysis-panel:not([hidden])) .exam-actions,
.exam-layout-blank.has-analysis .exam-actions { margin-top: 0; padding-top: 10px; }
.exam-layout-blank .blank-choice-column .exam-option { display: flex; min-height: 36px; justify-content: center; padding: 4px 10px; border: 1px solid #777; margin-top: -1px; background: #fff; text-align: center; }
.exam-layout-blank .blank-choice-column .fake-radio { display: none; }
.exam-layout-blank .blank-choice-column .choice-copy { text-align: center; }
.exam-layout-blank .blank-choice-column .exam-option:has(input:checked) { color: #fff; background: #111; }
.exam-layout-math { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 0 clamp(16px, 2vw, 24px); max-width: 1280px; }
.exam-layout-math.calculator-open { grid-template-columns: minmax(0, 1fr); }
.exam-layout-math .exam-instructions { grid-column: 1; margin-right: auto; margin-left: auto; text-align: center; }
.exam-layout-math .exam-prompt { grid-column: 1; max-width: 850px; margin-top: 54px; text-align: center; }
.exam-layout-math .practice-math-image { grid-column: 1; }
.exam-layout-math .exam-options { grid-column: 1; max-width: 650px; margin: 28px auto 0; }
.exam-layout-math.calculator-open .calculator-panel { grid-column: 2; grid-row: 1 / span 5; }
.exam-layout-math .exam-actions { grid-column: 1; }
.exam-layout-math-comparison .exam-prompt { max-width: 760px; margin-top: 38px; text-align: center; }
.math-comparison-prompt { margin-bottom: 18px; text-align: center; }
.math-comparison-prompt p { margin-bottom: 0; }
.quantity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(54px, 9vw, 112px);
  width: min(560px, 100%);
  margin: 18px auto 0;
}
.quantity-card {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: center;
}
.quantity-card strong {
  display: inline-block;
  margin-bottom: 12px;
  padding: 0 2px 2px;
  border-bottom: 1px solid #171717;
  font-family: "Times New Roman", Times, serif;
  font-size: 18px;
  font-weight: 400;
}
.quantity-value {
  min-height: 42px;
  overflow-wrap: anywhere;
  color: #171717;
  font-family: "Times New Roman", Times, serif;
  font-size: 22px;
  line-height: 1.35;
}
.quantity-value p {
  margin: 0;
}
.exam-layout-math-numeric .exam-prompt { max-width: 980px; margin-top: 46px; line-height: 1.5; }
.exam-layout-math-numeric .numeric-answer-wrap {
  grid-column: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: min(100%, 620px);
  margin: 32px auto 0;
}
.exam-layout-math-numeric .essay-answer {
  width: clamp(128px, 17vw, 214px);
  height: 44px;
  min-height: 0;
  margin: 0;
  padding: 5px 10px;
  overflow: hidden;
  border: 2px solid #777;
  border-radius: 0;
  font-family: "Times New Roman", Times, serif;
  font-size: 24px;
  line-height: 1.1;
  text-align: center;
  resize: none;
  white-space: nowrap;
}
.choice-copy {
  min-width: 0;
  overflow-wrap: anywhere;
}
.exam-layout-writing { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: clamp(4px, .5vw, 8px); padding: 0 4px 34px; }
.exam-layout-writing .exam-instructions { grid-column: 1; grid-row: 1; width: calc(100% - 12px); margin: 0 6px; }
.exam-layout-writing .exam-prompt { grid-column: 1; grid-row: 2; margin: 0; padding: 16px 14px; overflow-wrap: anywhere; border: 1px solid #292929; font-family: Arial, sans-serif; line-height: 1.38; }
.exam-layout-writing .essay-answer { grid-column: 2; grid-row: 1 / span 3; width: 100%; height: min(680px, calc(100dvh - 230px)); min-height: 300px; max-height: calc(100dvh - 230px); margin: 0; border: 1px solid #292929; }
.exam-layout-writing .exam-actions { grid-column: 1 / -1; grid-row: 4; }
.exam-layout-writing .analysis-panel { grid-column: 1 / -1; grid-row: 5; }
.calculator-panel {
  position: fixed;
  z-index: 55;
  top: 120px;
  right: 26px;
  width: min(390px, calc(100vw - 32px));
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .78);
  border-radius: 18px;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .26), inset 0 1px 0 rgba(255, 255, 255, .72);
  backdrop-filter: blur(24px) saturate(1.16);
  font-family: Georgia, "Times New Roman", serif;
}
.calculator-panel.is-dragging {
  cursor: move;
  box-shadow: 0 30px 84px rgba(15, 23, 42, .34), inset 0 1px 0 rgba(255, 255, 255, .72);
}
.calc-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: move;
  user-select: none;
  touch-action: none;
  padding: .35rem .55rem;
  color: #f2f5f8;
  background: linear-gradient(180deg, #6d7c8c, #556270);
  font-family: Arial, sans-serif;
  font-size: .72rem;
  font-weight: 600;
}
.calc-display-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 2.6rem;
  margin: .55rem 0 .45rem;
  padding: .35rem .55rem .35rem 1.6rem;
  border: 2px inset #9aa890;
  background: #dce6d4;
}
.mem-flag {
  position: absolute;
  top: .35rem;
  left: .4rem;
  color: #1a2a14;
  font-family: ui-monospace, monospace;
  font-size: .72rem;
  font-weight: 600;
  opacity: 0;
}
.mem-flag.on { opacity: 1; }
.calc-display {
  color: #1a2a14;
  font-family: ui-monospace, monospace;
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: .02em;
}
.calc-keys {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .35rem;
  padding: .45rem .1rem .1rem;
}
.calc-keys .key {
  min-height: 2.35rem;
  color: #222;
  border: 1px solid #8b949e;
  border-radius: 2px;
  background: linear-gradient(180deg, #fff, #eef1f4);
  box-shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 1px 2px rgba(0,0,0,.12);
  cursor: pointer;
  font-family: Arial, sans-serif;
  font-size: .92rem;
  font-weight: 600;
  transition: transform 80ms ease-out, filter 80ms ease-out;
}
.calc-keys .key:hover { filter: brightness(1.03); }
.calc-keys .key:active,
.calc-keys .key.pressed { transform: translateY(1px); filter: brightness(.97); }
.calc-keys .key.op,
.calc-keys .key.mem,
.calc-keys .key.fn { background: linear-gradient(180deg, #e8edf2, #d3dae2); }
.calc-keys .key.danger { color: #fff; border-color: #9a4538; background: linear-gradient(180deg, #d97a6c, #c45c4a); }
.calc-keys .key.warn { color: #2a2416; border-color: #9a7d35; background: linear-gradient(180deg, #e6d29a, #c4a35a); }
.calc-keys .key.eq { color: #f7f9fb; border-color: #2f4663; background: linear-gradient(180deg, #5a7aa0, #3d5a80); }
.calc-keys .key.transfer {
  grid-column: 1 / -1;
  min-height: 2.5rem;
  color: #fff;
  border-color: #24483e;
  background: linear-gradient(180deg, #4a7d6e, #2f5d50);
  font-size: .85rem;
}
.auto-result {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-bottom: 10px;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
}
.auto-result.correct { color: #2f6b4f; background: #e4f3ea; }
.auto-result.wrong { color: #a12c25; background: #fdeceb; }
.auto-result.unknown { color: #2f5f8f; background: #e8f1fa; }
.practice-answer-copy { display: block; white-space: normal; }
.practice-answer-section { margin: 0; padding: 0; }
.practice-answer-section + .practice-answer-section { margin-top: 14px; padding-top: 13px; border-top: 1px solid #eef2f7; }
.practice-answer-section strong {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
  color: #3d7ab5;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.3;
}
.practice-answer-section strong::before {
  content: "";
  flex: 0 0 auto;
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: #5b9bd5;
}
.practice-answer-section div { white-space: pre-wrap; font-size: 15px; line-height: 1.8; color: #2b3648; }
.ai-solution-section { margin-top: 12px; }
.ai-solution-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 2px; }
.ai-solution-btn {
  padding: 6px 16px;
  border: 1px solid #3d7ab5;
  border-radius: 999px;
  background: #5b9bd5;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.ai-solution-btn:hover:not(:disabled) { background: #3d7ab5; border-color: #33699d; box-shadow: 0 2px 8px rgba(91, 155, 213, .28); }
.ai-solution-btn:disabled { background: #b7c9db; border-color: #a8bed4; cursor: progress; box-shadow: none; }
.ai-solution-hint { font-size: 12px; color: #7a8698; white-space: normal; }
.ai-solution-result {
  margin-top: 10px;
  padding: 16px 18px;
  border: 1px solid #e3ebf4;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfdff 0%, #f5f9fd 100%);
  box-shadow: inset 3px 0 0 #5b9bd5;
  max-height: 420px;
  overflow-y: auto;
  white-space: normal;
  scrollbar-width: thin;
  scrollbar-color: #c6d8ea transparent;
}
.ai-solution-result::-webkit-scrollbar { width: 8px; }
.ai-solution-result::-webkit-scrollbar-thumb { background: #c6d8ea; border-radius: 4px; }
.ai-solution-result::-webkit-scrollbar-thumb:hover { background: #a8c3dd; }
.ai-solution-result::-webkit-scrollbar-track { background: transparent; }
.ai-solution-result p { margin: 0 0 8px; font-size: 15px; line-height: 1.75; color: #2b3648; white-space: normal; }
.ai-solution-result p:last-child { margin-bottom: 0; }
.ai-solution-heading {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 18px 0 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  color: #3d7ab5;
}
.ai-solution-heading::before {
  content: "";
  flex: 0 0 auto;
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: #5b9bd5;
}
.ai-solution-result > .ai-solution-heading:first-child { margin-top: 0; }
.ai-solution-meta { color: #8695a8; font-size: 12px; margin-bottom: 10px; }
.ai-solution-list { margin: 0 0 8px; padding-left: 22px; }
.ai-solution-list li { font-size: 15px; line-height: 1.75; margin-bottom: 4px; }
.ai-solution-quote {
  margin: 0 0 8px;
  padding: 8px 12px;
  border-left: 2px solid #b9d5ee;
  border-radius: 0 6px 6px 0;
  background: rgba(91, 155, 213, .07);
  color: #44536b;
}
.ai-solution-result code {
  padding: 1px 6px;
  border-radius: 4px;
  background: #e8f1fa;
  color: #2f5f8f;
  font-size: 13px;
}
.ai-solution-status { color: #7a8698; font-style: italic; font-size: 13px; }
.ai-solution-error { color: #a12c25; font-weight: 600; }
.muted { color: var(--muted); }
.ai-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 120;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 999px;
  background: rgba(255, 255, 255, .82);
  color: var(--text);
  font-size: 14px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .16);
  backdrop-filter: blur(18px) saturate(1.14);
  transition: transform .16s ease, box-shadow .16s ease;
}
.ai-launcher:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(15, 23, 42, .2); }
.ai-icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ai-launcher-icon { color: #5b9bd5; width: 19px; height: 19px; display: block; flex: 0 0 auto; }
.ai-launcher-text { font-weight: 600; letter-spacing: .2px; }
.ai-dock {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 121;
  display: flex;
  flex-direction: column;
  width: min(400px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 44px));
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 18px;
  background: rgba(255, 255, 255, .84);
  box-shadow: 0 26px 70px rgba(15, 23, 42, .24), inset 0 1px 0 rgba(255, 255, 255, .7);
  backdrop-filter: blur(26px) saturate(1.16);
  overflow: hidden;
}
.ai-dock-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 12px 11px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .5);
}
.ai-dock-brand { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; }
.ai-dock-dot { color: #5b9bd5; width: 17px; height: 17px; display: block; flex: 0 0 auto; }
.ai-dock-tools { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; }
.ai-dock-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
}
.ai-dock-btn-icon { display: block; width: 16px; height: 16px; flex: 0 0 auto; pointer-events: none; }
.ai-dock-btn:hover { background: rgba(91, 155, 213, .12); color: #3d7ab5; }
.ai-dock-history {
  max-height: 190px;
  overflow-y: auto;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .42);
}
.ai-dock-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 6px;
  color: var(--muted);
  font-size: 12px;
}
.ai-dock-history-count { color: var(--muted); font-size: 12px; }
.ai-dock-history-list { display: flex; flex-direction: column; gap: 2px; }
.ai-dock-history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  text-align: left;
}
.ai-dock-history-item:hover { background: rgba(91, 155, 213, .1); }
.ai-dock-history-item.is-active { background: rgba(91, 155, 213, .16); }
.ai-dock-history-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-dock-history-del { flex: 0 0 auto; color: var(--muted); font-size: 14px; padding: 0 2px; }
.ai-dock-history-del:hover { color: var(--danger); }
.ai-dock-history-empty { padding: 10px 4px; color: var(--muted); font-size: 13px; }
.ai-dock-body { flex: 1; min-height: 0; overflow-y: auto; }
.ai-dock-welcome { padding: 26px 18px 10px; text-align: center; }
.ai-welcome-mark {
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  display: grid;
  place-content: center;
  border-radius: 50%;
  background: #eef4fb;
  color: #5b9bd5;
}
.ai-welcome-icon { width: 30px; height: 30px; display: block; }
.ai-welcome-title { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.ai-welcome-title span { color: var(--muted); font-weight: 400; }
.ai-welcome-hi { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.ai-welcome-desc { margin: 0 0 18px; font-size: 13px; line-height: 1.7; color: var(--muted); }
.ai-welcome-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ai-chip {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  color: var(--text);
  font-size: 12px;
}
.ai-chip:hover { border-color: #b5d4f4; background: #eef4fb; color: #3d7ab5; }
/* 讲完题后的追问按钮：一行放不下就横向滚动，避免把对话气泡撑得很宽 */
.ai-msg-followups {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-top: 8px;
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.ai-msg-followups .ai-chip { flex: 0 0 auto; white-space: nowrap; text-align: left; }
.ai-msg-followups .ai-chip:focus-visible { outline: 2px solid #3d7ab5; outline-offset: 2px; }
.ai-dock-thread { padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 14px; }
.ai-msg { display: flex; }
.ai-msg.is-user { justify-content: flex-end; }
.ai-msg-bubble {
  max-width: 88%;
  padding: 10px 13px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e6edf5;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
/* 流式输出时最后一个块后面跟一个闪烁光标，做出正在打字的观感 */
.ai-msg-bubble.is-streaming > :last-child::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -2px;
  background: #3d7ab5;
  animation: ai-caret-blink 1s steps(1, end) infinite;
}
@keyframes ai-caret-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
.ai-msg.is-user .ai-msg-bubble {
  background: #5b9bd5;
  border-color: #5b9bd5;
  color: #fff;
  box-shadow: 0 2px 8px rgba(91, 155, 213, .24);
}
.ai-msg.is-user .ai-msg-bubble code { background: rgba(255, 255, 255, .22); color: #fff; }
.ai-msg.is-user .ai-msg-heading { color: #fff; }
.ai-msg.is-user .ai-msg-quote { border-left-color: rgba(255, 255, 255, .55); color: rgba(255, 255, 255, .88); }
.ai-msg-bubble p { margin: 0 0 6px; }
.ai-msg-bubble p:last-child { margin-bottom: 0; }
.ai-msg-heading { font-weight: 600; color: #3d7ab5; margin-top: 9px; }
.ai-msg-bubble > .ai-msg-heading:first-child { margin-top: 0; }
.ai-msg-list { margin: 0 0 6px; padding-left: 19px; }
.ai-msg-list li { margin-bottom: 3px; }
.ai-msg-bubble code { padding: 1px 4px; border-radius: 3px; background: #eef4fb; font-size: 12px; }
.ai-msg-quote { padding-left: 8px; border-left: 2px solid #d6e8f6; color: var(--muted); }
.ai-msg-meta { margin: 6px 2px 0; color: var(--muted); font-size: 11px; }
.ai-msg-error { color: var(--danger); font-size: 13px; }
.ai-msg-pending { color: var(--muted); font-size: 13px; }
.ai-dock-compose {
  flex: 0 0 auto;
  margin: 0 12px 12px;
  padding: 10px 12px 8px;
  border: 1px solid #e3ebf4;
  border-radius: 16px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 2px 10px rgba(15, 23, 42, .05);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ai-dock-compose:focus-within {
  border-color: #b5d4f4;
  box-shadow: 0 2px 14px rgba(91, 155, 213, .16);
}
.ai-dock-compose textarea {
  width: 100%;
  border: 0;
  outline: 0;
  padding: 0;
  resize: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  line-height: 1.6;
  max-height: 108px;
}
.ai-dock-compose textarea::placeholder { color: var(--muted); }
.ai-compose-bar { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.ai-compose-icon { background: transparent; color: var(--muted); font-size: 17px; line-height: 1; padding: 0 2px; border-radius: 6px; }
.ai-compose-icon:hover { color: #3d7ab5; background: rgba(91, 155, 213, .1); }
.ai-compose-mode {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border: 1px solid #e3ebf4;
  border-radius: 999px;
  background: rgba(91, 155, 213, .08);
  color: #5b86ad;
  font-size: 12px;
}
.ai-compose-mode-icon { display: block; width: 11px; height: 11px; flex: 0 0 auto; }
.ai-compose-mode-icon[hidden] { display: none; }
.ai-compose-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-left: auto;
  border-radius: 50%;
  background: #5b9bd5;
  color: #fff;
  font-size: 15px;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(91, 155, 213, .3);
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.ai-compose-send-icon { display: block; width: 17px; height: 17px; flex: 0 0 auto; }
.ai-compose-send:hover:not(:disabled) { background: #3d7ab5; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(91, 155, 213, .36); }
.ai-compose-send:disabled { background: #c3d4e4; box-shadow: none; }
body[data-theme="dark"] .ai-dock,
body[data-theme="dark"] .ai-launcher { background: rgba(27, 36, 49, .86); border-color: rgba(255, 255, 255, .12); }
body[data-theme="dark"] .ai-dock-head { background: rgba(27, 36, 49, .6); }
body[data-theme="dark"] .ai-msg-bubble { background: rgba(32, 43, 58, .9); }
body[data-theme="dark"] .ai-msg.is-user .ai-msg-bubble { background: rgba(61, 122, 181, .22); border-color: rgba(91, 155, 213, .34); color: var(--text); }
body[data-theme="dark"] .ai-dock-compose { background: rgba(32, 43, 58, .85); }
body[data-theme="dark"] .ai-chip { background: rgba(32, 43, 58, .8); }
body[data-theme="dark"] .ai-msg-followups .ai-chip:hover { background: rgba(91, 155, 213, .18); color: #7cb3e8; }
body[data-theme="dark"] .ai-welcome-mark { background: rgba(91, 155, 213, .18); }
body[data-theme="dark"] .ai-solution-btn { background: #3d7ab5; border-color: #5b9bd5; color: #fff; }
body[data-theme="dark"] .ai-solution-btn:hover:not(:disabled) { background: #5b9bd5; border-color: #7cb3e8; }
body[data-theme="dark"] .ai-solution-btn:disabled { background: #35485c; border-color: #46586b; }
body[data-theme="dark"] .ai-solution-result { background: rgba(32, 43, 58, .9); border-color: rgba(255, 255, 255, .12); border-left-color: #5b9bd5; }
body[data-theme="dark"] .ai-solution-heading { color: #7cb3e8; }
body[data-theme="dark"] .ai-solution-result p { color: var(--text); }
body[data-theme="dark"] .ai-solution-hint,
body[data-theme="dark"] .ai-solution-status,
body[data-theme="dark"] .ai-solution-meta { color: var(--muted); }
body[data-theme="dark"] .ai-solution-quote { border-left-color: #3d7ab5; color: var(--muted); }
body[data-theme="dark"] .ai-solution-result code { background: rgba(91, 155, 213, .18); color: var(--text); }
body[data-theme="dark"] .ai-solution-error { color: #f09595; }
@media (max-width: 560px) {
  .ai-dock { right: 8px; bottom: 8px; width: calc(100vw - 16px); height: min(78vh, 560px); }
  .ai-launcher { right: 12px; bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .home-intro-panel,
  .home-intro-copy {
    transition-duration: .01ms !important;
  }
  .review-progress-track > div { transition: none; }
  .review-confetti { animation-duration: .01ms; }
}

@media (max-width: 1320px) { .question-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } .question-list-row { grid-template-columns: 34px minmax(260px, 1fr) repeat(3, 88px); } .home-view.is-eudic .eudic-word-row.question-list-row { grid-template-columns: 34px minmax(260px, 1fr) minmax(96px, 120px) minmax(0, 206px); } .list-actions { grid-column: 2 / -1; justify-content: flex-start; min-width: 0; max-width: none; } .home-view.is-eudic .eudic-list-actions { max-width: none; } .exam-stage { padding-top: 0; } }
@media (max-width: 1100px) { .layout { grid-template-columns: 1fr; } .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .category-hero { grid-template-columns: 1fr; } .type-card-grid, .question-board.single-category .category-list { grid-template-columns: 1fr; } .question-list-row { grid-template-columns: 34px minmax(0, 1fr) repeat(3, 84px); } .home-view.is-eudic .eudic-word-row.question-list-row { grid-template-columns: 34px minmax(0, 1fr) minmax(96px, 120px) minmax(0, 206px); } .dashboard-overview { grid-template-columns: repeat(3, minmax(0, 1fr)); } .dashboard-layout { grid-template-columns: 1fr; } .dashboard-activity-panel, .dashboard-mode-panel, .dashboard-daily-panel { grid-column: auto; } .eudic-toolbar { grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr); } .eudic-word-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .eudic-graph-layout { grid-template-columns: 190px minmax(0, 1fr); } .eudic-word-detail { grid-column: 1 / -1; min-height: 160px; } }
@media (max-width: 980px) {
  .practice-topbar { height: 146px; }
  .practice-brand { top: 8px; left: 12px; }
  .practice-controls { top: 58px; right: 8px; left: 8px; max-width: none; justify-content: flex-start; }
  .practice-status-bar { min-height: 36px; }
  .exam-stage { min-height: calc(100vh - 146px); }
  .exam-layout-math.calculator-open { grid-template-columns: minmax(0, 1fr); }
  .eudic-memory-stage { grid-template-columns: 1fr; min-height: 0; }
  .eudic-memory-detail { max-height: 48vh; }
}
@media (max-width: 720px) {
  .app-shell { padding: 16px; }
  .home-intro-copy { width: max-content; max-width: calc(100% - 28px); }
  .home-intro-copy h1 { font-size: clamp(32px, 5.2vw, 82px); white-space: nowrap; }
  .home-intro-copy > p:last-child { margin-top: 18px; font-size: 14px; letter-spacing: 0; }
  .home-intro-kicker { font-size: 10px; letter-spacing: 0; }
  .home-topbar { grid-template-columns: 1fr auto; gap: 10px 14px; min-height: 72px; padding: 10px 16px; }
  .library-topbar { grid-template-columns: 1fr auto; width: 100%; min-height: 72px; margin: 0 auto; padding: 10px 16px; border-radius: 0; }
  .library-topbar .home-tabs { grid-column: 1 / -1; grid-row: 2; }
  .home-brand-copy, .profile-name { display: none; }
  .home-tabs { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; gap: 6px; }
  .home-tab { flex: 1; min-width: 0; padding: 0 4px; }
  .home-profile { grid-column: 2; grid-row: 1; }
  .home-topbar:not(.is-floating) .home-tabs {
    top: auto;
    right: 58px;
    bottom: 8px;
    left: 58px;
    display: flex;
    width: auto;
    gap: 6px;
    justify-content: space-between;
    transform: none;
  }
  .home-topbar:not(.is-floating) .home-tab { flex: 1 1 0; }
  .home-topbar.is-floating,
  .library-topbar.is-floating {
    top: 0;
    width: 100%;
    min-height: 64px;
    margin: 0;
    padding: 10px 12px;
    border-radius: 0;
    grid-template-columns: max-content minmax(0, 1fr) max-content;
    gap: 10px 12px;
  }
  .home-topbar.is-floating .home-tabs {
    top: 50%;
    right: 56px;
    bottom: auto;
    left: 56px;
    display: flex;
    width: auto;
    justify-content: flex-start;
    transform: translateY(-50%);
  }
  .home-topbar.is-floating .home-tabs { gap: 8px; }
  .home-topbar.is-floating .home-tab { flex: 0 0 auto; padding: 0 4px; }
  .home-topbar.is-floating::before,
  .library-topbar.is-floating::before {
    width: calc(100% - 16px);
    border-radius: 14px;
  }
  .home-topbar.is-floating .home-brand,
  .library-topbar.is-floating .library-topbar-left {
    left: 20px;
  }
  .home-topbar.is-floating .home-profile,
  .library-topbar.is-floating .home-profile {
    right: 20px;
  }
  .home-topbar.is-floating .home-tabs,
  .library-topbar.is-floating .home-tabs {
    grid-column: 2;
    grid-row: 1;
    justify-self: stretch;
  }
  .home-topbar.is-floating .home-profile,
  .library-topbar.is-floating .home-profile {
    grid-column: 3;
    grid-row: 1;
  }
  .app-shell#libraryView { padding: 84px 0 24px; }
  .app-shell#libraryView .category-hero,
  .app-shell#libraryView > .layout { width: calc(100% - 32px); }
  .topbar, .panel-head { flex-direction: column; }
  .board-head-actions { justify-content: flex-start; width: 100%; }
  .topbar-actions { justify-content: flex-start; }
  .stats, .question-board, .filters, .form-grid, .completion-grid, .type-card-grid { grid-template-columns: 1fr; }
  .category-hero { padding: 22px; }
  .category-hero-copy { display: grid; gap: 12px; }
  .category-hero-copy .type-icon { margin: 0; }
  .category-hero h2 { font-size: 36px; }
  .category-hero p:not(.home-kicker) { font-size: 17px; }
  .category-stats { align-self: stretch; }
  .category-stats article { min-height: 70px; }
  .question-list-row { grid-template-columns: 28px minmax(0, 1fr); align-items: start; }
  .list-main p { white-space: normal; }
  .list-metric { padding-left: 0; border-left: 0; }
  .list-actions { grid-column: 1 / -1; justify-content: flex-start; max-width: none; }
  .blank-form-columns, .blank-form-answers { grid-template-columns: 1fr; }
  .image-upload-field { grid-template-columns: 1fr; }
  .image-upload-field .ghost-btn { justify-self: start; }
  .settings-page-topbar { grid-template-columns: auto 1fr; gap: 12px; padding: 12px 16px; }
  .settings-page-brand { justify-self: center; }
  .settings-page-content { width: calc(100% - 24px); padding-top: 24px; }
  .settings-card { padding: 8px 16px 10px; }
  .setting-row { align-items: flex-start; flex-direction: column; gap: 10px; }
  .setting-row-control input, .setting-row-control select { width: 100%; }
  .setting-avatar-control input { width: 100%; }
  .setting-row-control { width: 100%; }
  .auth-panel { padding: 26px 20px; }
  .admin-user-form { grid-template-columns: 1fr; }
  .admin-user-row { grid-template-columns: 1fr auto; }
  .admin-user-row button:last-child { grid-column: 2; }
  .notebook-panel, .note-editor-panel { width: calc(100vw - 24px); max-height: calc(100vh - 24px); padding: 18px; }
  .notebook-list { max-height: calc(100vh - 170px); }
  .notebook-entry-head { display: block; }
  .notebook-entry-head time { display: block; margin-top: 8px; }
  .home-mask { height: auto; min-height: 480px; padding: 48px 20px; }
  .home-hero { height: 100svh; min-height: 100svh; }
  .home-section-head { flex-direction: column; align-items: flex-start; }
  .home-actions { justify-content: flex-start; }
  .home-dashboard { width: calc(100% - 24px); padding: 18px; }
  .home-eudic {
    width: 100%;
    max-height: none;
    padding: 72px 0 32px;
  }
  .home-eudic .category-hero,
  .home-eudic > .layout {
    width: calc(100% - 24px);
  }
  .eudic-toolbar { grid-template-columns: 1fr; align-items: stretch; }
  .eudic-import-add-row { grid-template-columns: 1fr; }
  .eudic-status { min-height: 0; }
  .eudic-word-grid { grid-template-columns: 1fr; padding: 10px; }
  .eudic-word-list-head { grid-template-columns: 1fr; }
  .eudic-word-list-head span:last-child { display: none; }
  .eudic-word-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
  .home-view.is-eudic .eudic-word-row.question-list-row { grid-template-columns: 28px minmax(0, 1fr); align-items: start; }
  .home-view.is-eudic .eudic-list-actions { grid-column: 1 / -1; max-width: none; }
  .home-view.is-eudic .eudic-list-main .eudic-exp,
  .home-view.is-eudic .eudic-list-main .eudic-context { white-space: normal; }
  .eudic-word-row .eudic-exp { grid-column: 1 / -1; }
  .eudic-word-context { grid-column: 1 / -1; }
  .eudic-word-meta { align-items: flex-end; }
  .eudic-view-switch { width: 100%; }
  .eudic-view-btn { flex: 1; }
  .eudic-graph-layout { grid-template-columns: 1fr; min-height: 0; }
  .eudic-group-list { max-height: 220px; }
  .eudic-graph-stage { min-height: 430px; }
  .eudic-word-detail { min-height: 220px; }
  .eudic-memory-view { padding: 14px 12px 18px; }
  .eudic-memory-topbar {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
  }
  .eudic-memory-tools { grid-column: 1 / -1; justify-self: stretch; }
  .eudic-memory-tools .compact-btn { flex: 1; }
  .eudic-memory-progress { grid-template-columns: 48px minmax(0, 1fr); }
  .eudic-memory-stage { margin-top: 18px; gap: 16px; }
  .eudic-memory-card { min-height: 42vh; padding: 30px 10px; }
  .eudic-memory-card h2 { font-size: 42px; }
  .eudic-memory-phon { font-size: 16px; }
  .eudic-memory-detail { padding: 16px; }
  .eudic-memory-actions { grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
  .eudic-memory-action { min-height: 48px; }
  .dashboard-overview { grid-template-columns: 1fr; }
  .dashboard-overview-item { min-height: 82px; }
  .dashboard-layout { gap: 12px; }
  .dashboard-panel { padding: 14px; }
  .dashboard-mode-row { grid-template-columns: 1fr 1fr; }
  .dashboard-mode-label { grid-column: 1 / -1; }
  .type-card { min-height: 220px; padding: 30px 28px; }
  .type-card strong { font-size: 32px; }
  .type-card > span:not(.type-icon) { font-size: 17px; }
  .type-card em { right: 28px; bottom: 24px; }
  .type-card-marked { right: 28px; bottom: 50px; }
  .type-card-actions { padding-right: 82px; }
  .selection-bar #nextReviewHint { margin-left: 0; }
  .practice-topbar { height: 148px; }
  .practice-brand { top: 8px; left: 10px; }
  .practice-brand strong { font-size: 38px; }
  .practice-section-name { display: none; }
  .practice-controls { top: 57px; right: 7px; left: 7px; gap: 3px; justify-content: flex-start; overflow-x: auto; }
  .exam-top-btn { min-width: 54px; height: 46px; gap: 1px; padding: 3px 7px; }
  .exam-top-btn .exam-icon { width: 20px; height: 20px; flex-basis: 20px; }
  .exam-top-btn .mark-star { width: 20px; height: 20px; flex-basis: 20px; }
  .exam-top-btn b { font-size: 11px; }
  .exit-section-btn { min-width: 82px; }
  .practice-status-bar { min-height: 37px; padding: 4px 8px; }
  .practice-status-bar > strong { max-width: 48%; font-size: 12px; }
  .timer-row { gap: 3px; }
  .hide-time-btn { min-width: 88px; font-size: 12px; }
  .practice-clock { min-width: 70px; font-size: 15px; }
  .exam-stage { min-height: calc(100vh - 148px); padding: 0 8px 30px; }
  .exam-paper { width: 100%; }
  .exam-prompt { margin-top: 28px; }
  .exam-option { gap: 12px; }
  .exam-options { width: 100%; }
  .blank-choice-columns, .blank-choice-columns.blank-choice-two { grid-template-columns: 1fr; width: 100%; }
  .quantity-grid { grid-template-columns: 1fr; }
  .blank-choice-column { border-bottom: 1px solid #d0d0d0; padding-bottom: 14px; }
  .exam-layout-reading, .exam-layout-writing { display: block; padding: 0 0 30px; }
  .exam-layout-reading .reading-passage-panel { height: auto; max-height: 42vh; margin-bottom: 12px; }
  .exam-layout-reading .exam-instructions { width: 100%; margin: 0; }
  .exam-layout-reading .exam-prompt { margin: 24px 8px 0; }
  .exam-layout-reading .exam-options { margin: 22px 8px 0; }
  .exam-layout-writing .exam-instructions { width: 100%; margin: 0; }
  .exam-layout-writing .exam-prompt { margin-top: 12px; }
  .exam-layout-writing .essay-answer { width: 100%; height: 38vh; min-height: 260px; margin-top: 12px; }
  .exam-layout-math.calculator-open { display: block; }
  .exam-layout-math.calculator-open .calculator-panel,
  .calculator-panel {
    width: min(390px, calc(100vw - 24px));
    margin: 0;
  }
}

@media (max-width: 720px) {
  .home-dashboard {
    width: calc(100% - 24px);
    margin-top: 48px;
    padding: 0;
  }
}

/* Data dashboard theme and range-specific visual layout.
   --accent is overridden so shared controls (buttons, focus, selected,
   eyebrow, progress) inherit the blue theme instead of falling back to the
   default gray template accent. */
.home-view.is-dashboard {
  --accent: #5b9bd5;
  --accent-dark: #3d7ab5;
  --dashboard-accent: #5b9bd5;
  --dashboard-accent-dark: #3d7ab5;
  --dashboard-accent-soft: #eef4fb;
  --dashboard-accent-pale: #d6e8f6;
  --dashboard-mint: #8fd9c4;
  --dashboard-pink: #f5a9c8;
  --dashboard-lilac: #b9a7ff;
  --dashboard-heat-1: #f0f6fc;
  --dashboard-heat-2: #dbeaf7;
  --dashboard-heat-3: #b5d4ed;
  --dashboard-heat-4: #8bc0e3;
  --dashboard-heat-5: #5b9bd5;
  --study-bar: #5b9bd5;
  --review-bar: #f5a9c8;
}
.home-view.is-dashboard .dashboard-range-btn.is-active,
.home-view.is-dashboard .dashboard-view-btn.is-active {
  color: var(--dashboard-accent-dark);
  border-color: var(--dashboard-accent);
  background: var(--dashboard-accent-soft);
}
.home-view.is-dashboard .home-dashboard {
  color: #28313d;
}
.home-view.is-dashboard .dashboard-hero {
  border-color: #d9eafd;
  color: #28313d;
  background:
    radial-gradient(circle at 92% 12%, rgba(245, 169, 200, .34), transparent 28%),
    linear-gradient(135deg, #f8fcff, #eef4fb 54%, #f7f1ff);
  box-shadow: 0 18px 38px rgba(91, 155, 213, .12);
}
.home-view.is-dashboard .dashboard-hero .dashboard-section-kicker {
  color: var(--dashboard-accent-dark);
}
.home-view.is-dashboard .dashboard-hero h3,
.home-view.is-dashboard .dashboard-hero-score-copy span {
  color: #28313d;
}
.home-view.is-dashboard .dashboard-hero-note,
.home-view.is-dashboard .dashboard-hero-score-copy small {
  color: #7e8795;
}
.dashboard-accuracy-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 116px;
  height: 116px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--dashboard-accent) var(--dashboard-progress, 0%), #e7eff7 0);
}
.dashboard-accuracy-ring::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: #fff;
}
.dashboard-accuracy-ring strong {
  position: relative;
  z-index: 1;
  color: #28313d;
  font-size: 28px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.dashboard-accuracy-ring.is-empty {
  background: conic-gradient(#dfe4e9 100%, #dfe4e9 0);
}
.dashboard-hero-score-copy {
  display: grid;
  gap: 6px;
  align-content: center;
}
.dashboard-hero-score-copy span {
  font-size: 13px;
  font-weight: 700;
}
.dashboard-hero-score-copy small {
  font-size: 12px;
}
.home-view.is-dashboard .dashboard-hero-stats article {
  border-color: rgba(91, 155, 213, .22);
  background: rgba(255, 255, 255, .68);
}
.home-view.is-dashboard .dashboard-hero-stats span,
.home-view.is-dashboard .dashboard-hero-stats small {
  color: #7e8795;
}
.home-view.is-dashboard .dashboard-hero-stats strong {
  color: #28313d;
}
.home-view.is-dashboard .dashboard-panel {
  border-color: #e1edf8;
  background: #fff;
  box-shadow: 0 12px 30px rgba(91, 155, 213, .07);
}
.home-view.is-dashboard .dashboard-insight-panel {
  background: linear-gradient(180deg, #fff, #f8fbff);
}
.home-view.is-dashboard .dashboard-insight-item {
  border-bottom-color: #e3e7eb;
}
.home-view.is-dashboard .dashboard-insight-item p,
.home-view.is-dashboard .dashboard-panel-head p {
  color: #6f7b89;
}
.home-view.is-dashboard .insight-mark.warning { background: var(--dashboard-pink); }
.home-view.is-dashboard .insight-mark.action { background: var(--dashboard-mint); }
.home-view.is-dashboard .insight-mark.focus { background: var(--dashboard-lilac); }
.home-view.is-dashboard .insight-mark.calm {
  color: var(--dashboard-accent-dark);
  background: var(--dashboard-accent-pale);
}
.home-view.is-dashboard .dashboard-review-action {
  border-color: var(--dashboard-accent);
  color: #fff;
  background: var(--dashboard-accent);
}
.home-view.is-dashboard .dashboard-review-action:hover {
  border-color: var(--dashboard-accent-dark);
  background: var(--dashboard-accent-dark);
}
.dashboard-rhythm-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.dashboard-view-tools {
  display: flex;
  justify-content: flex-end;
  min-height: 30px;
  margin: -4px 0 14px;
}
.dashboard-rhythm-panel.is-trend .dashboard-legend-review {
  display: none;
}
.dashboard-view-switch {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid #e1e6eb;
  border-radius: 8px;
  background: #f7f8fa;
}
.dashboard-view-btn {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #7a8492;
  background: transparent;
  font-size: 12px;
}
.dashboard-view-btn.is-active {
  box-shadow: 0 1px 4px rgba(32, 41, 56, .08);
}
.dashboard-visual-grid {
  display: grid;
  gap: 18px;
}
.dashboard-visual-grid.is-week {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
}
.dashboard-visual-grid.is-month,
.dashboard-visual-grid.is-trend {
  grid-template-columns: 1fr;
}
.home-view.is-dashboard .dashboard-visual-grid.is-month .dashboard-heatmap-block,
.home-view.is-dashboard .dashboard-visual-grid.is-trend .dashboard-activity-block {
  min-height: 249px;
}
.dashboard-visual-block {
  min-width: 0;
}
.dashboard-visual-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.dashboard-visual-head strong {
  color: #3a4654;
  font-size: 13px;
}
.dashboard-visual-head small {
  color: #9aa3ad;
  font-size: 11px;
}
.home-view.is-dashboard .activity-chart-wrap {
  min-height: 214px;
  border-bottom-color: #e4e8ec;
}
.home-view.is-dashboard .activity-chart {
  height: 214px;
}
.home-view.is-dashboard .activity-bar.study {
  background: var(--dashboard-accent);
}
.home-view.is-dashboard .activity-bar.review {
  background: var(--dashboard-heat-3);
}
.home-view.is-dashboard .legend-dot.study {
  background: var(--dashboard-accent);
}
.home-view.is-dashboard .legend-dot.review {
  background: var(--dashboard-heat-3);
}
.dashboard-heatmap {
  display: block;
  min-height: 214px;
  margin-top: 0;
  overflow: hidden;
}
.dashboard-heatmap-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(20px, 1fr));
  gap: 8px;
  align-items: end;
  min-height: 174px;
}
.dashboard-heatmap-week-labels {
  display: grid;
  grid-template-columns: repeat(7, minmax(20px, 1fr));
  gap: 8px;
  margin-top: 8px;
  color: #9aa3ad;
  font-size: 10px;
  text-align: center;
}
.dashboard-heatmap-cell {
  display: block;
  min-width: 0;
}
.dashboard-heatmap-cell i {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  min-height: 24px;
  border-radius: 7px;
  color: #fff;
  background: #eef1f3;
  font-size: 10px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}
.dashboard-heatmap-cell.level-1 i { background: var(--dashboard-heat-1); color: #4d80a8; }
.dashboard-heatmap-cell.level-2 i { background: var(--dashboard-heat-2); color: #3d7ab5; }
.dashboard-heatmap-cell.level-3 i { background: var(--dashboard-heat-3); }
.dashboard-heatmap-cell.level-4 i { background: var(--dashboard-heat-4); }
.dashboard-heatmap-cell.level-5 i { background: var(--dashboard-heat-5); }
.dashboard-heatmap-cell.is-blank i { visibility: hidden; }
.dashboard-heatmap-month {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: start;
}
.dashboard-heatmap-weekdays {
  display: grid;
  grid-template-columns: max-content repeat(7, minmax(18px, 1fr));
  gap: 6px;
  color: #9aa3ad;
  font-size: 10px;
  text-align: center;
}
.dashboard-heatmap-month-grid {
  display: grid;
  grid-template-rows: repeat(var(--heatmap-rows, 5), minmax(18px, 1fr));
  gap: 6px;
  min-width: 0;
}
.dashboard-heatmap-month-row {
  display: grid;
  grid-template-columns: max-content repeat(7, minmax(18px, 1fr));
  gap: 6px;
  min-width: 0;
}
.dashboard-heatmap-month-row .dashboard-heatmap-cell i {
  width: min(100%, 28px);
  height: auto;
  min-height: 0;
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 4px;
  font-size: 0;
}
.dashboard-heatmap-month-label {
  width: 34px;
  align-self: center;
  color: #9aa3ad;
  font-size: 10px;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}
.home-view.is-dashboard .diagnosis-track i {
  background: var(--dashboard-accent);
}
.home-view.is-dashboard .diagnosis-due b {
  color: var(--dashboard-accent-dark);
}
.home-view.is-dashboard .dashboard-next-guidance {
  border-left-color: var(--dashboard-accent);
  background: var(--dashboard-accent-soft);
}

@media (max-width: 1100px) {
  .dashboard-visual-grid.is-week {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .dashboard-rhythm-tools {
    justify-content: flex-start;
  }
  .dashboard-visual-grid.is-week {
    grid-template-columns: 1fr;
  }
  .dashboard-accuracy-ring {
    width: 92px;
    height: 92px;
  }
  .dashboard-accuracy-ring::after {
    inset: 7px;
  }
  .dashboard-accuracy-ring strong {
    font-size: 22px;
  }
  .dashboard-heatmap-month-row {
    gap: 4px;
  }
  .dashboard-heatmap-month-grid,
  .dashboard-heatmap-weekdays {
    gap: 4px;
  }
}

/* Keep the calendar as square tiles without stretching each column across the panel. */
.home-view.is-dashboard .dashboard-heatmap {
  --dashboard-heat-cell-size: 34px;
}
.home-view.is-dashboard .dashboard-heatmap-category-grid {
  gap: 7px;
}
.home-view.is-dashboard .dashboard-heatmap-category-header,
.home-view.is-dashboard .dashboard-heatmap-category-row {
  grid-template-columns: 48px max-content;
  gap: 8px;
}
.home-view.is-dashboard .dashboard-heatmap-week,
.home-view.is-dashboard .dashboard-heatmap-week-labels {
  grid-template-columns: repeat(7, var(--dashboard-heat-cell-size));
  gap: 2px;
  width: max-content;
}
.home-view.is-dashboard .dashboard-heatmap-category-row .dashboard-heatmap-week {
  min-height: 0;
}
.home-view.is-dashboard .dashboard-heatmap-category-row .dashboard-heatmap-cell i,
.home-view.is-dashboard .dashboard-heatmap-cell i {
  width: var(--dashboard-heat-cell-size);
  height: var(--dashboard-heat-cell-size);
  min-height: 0;
  aspect-ratio: auto;
  margin: 0;
  border-radius: 4px;
}
.home-view.is-dashboard .dashboard-heatmap-month {
  --dashboard-heat-cell-size: 32px;
  grid-template-columns: max-content;
  gap: 5px;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
}
.home-view.is-dashboard .dashboard-heatmap-month-grid {
  grid-template-rows: repeat(var(--heatmap-rows, 5), var(--dashboard-heat-cell-size));
  gap: 2px;
}
.home-view.is-dashboard .dashboard-heatmap-month-row {
  grid-template-columns: max-content repeat(7, var(--dashboard-heat-cell-size));
  gap: 2px;
}
.home-view.is-dashboard .dashboard-heatmap-weekdays {
  grid-template-columns: max-content repeat(7, var(--dashboard-heat-cell-size));
  gap: 2px;
}
.home-view.is-dashboard .dashboard-heatmap-month-row .dashboard-heatmap-cell i {
  width: var(--dashboard-heat-cell-size);
  height: var(--dashboard-heat-cell-size);
  margin: 0;
}

@media (max-width: 720px) {
  .home-view.is-dashboard .dashboard-heatmap-month {
    --dashboard-heat-cell-size: 28px;
  }
  .dashboard-heatmap-month-label {
    width: 26px;
    font-size: 9px;
  }
  .home-view.is-dashboard .dashboard-heatmap {
    --dashboard-heat-cell-size: 30px;
  }
  .home-view.is-dashboard .dashboard-heatmap-category-header,
  .home-view.is-dashboard .dashboard-heatmap-category-row {
    grid-template-columns: 50px max-content;
    gap: 6px;
  }
}

/* ===== 自定义下拉选择组件（替代原生 select 的系统蓝色菜单） ===== */
.select-native { display: none !important; }
.select-widget { position: relative; display: inline-flex; width: 100%; }
.select-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease, box-shadow .12s ease;
}
.select-trigger:hover { border-color: #b9c1cc; }
.select-trigger:focus-visible { outline: 2px solid rgba(75, 85, 99, .18); border-color: var(--accent); }
.select-widget.is-open .select-trigger { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(75, 85, 99, .08); }
.select-trigger[disabled] { opacity: .55; cursor: not-allowed; }
.select-trigger-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-chevron { flex: 0 0 auto; width: 15px; height: 15px; color: #8b94a3; transition: transform .16s ease; }
.select-widget.is-open .select-chevron { transform: rotate(180deg); }
.select-menu {
  position: fixed;
  z-index: 210;
  min-width: 120px;
  max-height: 264px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid rgba(214, 219, 227, .9);
  border-radius: 12px;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(18px) saturate(1.15);
  box-shadow: 0 18px 44px rgba(15, 23, 42, .16), inset 0 1px 0 rgba(255, 255, 255, .8);
}
.select-option {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.select-option:hover { background: #f2f5f8; }
.select-option.is-active { background: #e8ecf2; }
.select-option.is-selected { background: #edf0f4; color: #202735; font-weight: 650; }
.select-option.is-disabled { opacity: .5; cursor: not-allowed; }
.select-widget.is-placeholder .select-trigger-label { color: #9aa3ad; }
