:root {
  --ink: #162333;
  --ink-soft: #556478;
  --ink-faint: #8490a0;
  --paper: #f5f7fb;
  --card: #ffffff;
  --line: #e3e8f0;
  --line-strong: #cfd8e5;
  --navy: #17263d;
  --navy-2: #243a5a;
  --teal: #1c9b93;
  --teal-soft: #e8f7f4;
  --coral: #e87861;
  --coral-soft: #fff0ec;
  --yellow-soft: #fff7df;
  --yellow: #d89221;
  --shadow-sm: 0 4px 16px rgba(28, 46, 75, .06);
  --shadow-md: 0 18px 50px rgba(29, 47, 77, .10);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 7% 0%, rgba(67, 178, 164, .10), transparent 30rem),
    radial-gradient(circle at 100% 14%, rgba(232, 120, 97, .08), transparent 28rem),
    var(--paper);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(28, 155, 147, .35);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
  padding: 0 clamp(20px, 4vw, 64px);
  background: rgba(255, 255, 255, .88);
  border-bottom: 1px solid rgba(213, 221, 232, .75);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: white;
  font-family: Georgia, serif;
  font-size: 23px;
  font-weight: 700;
  background: var(--navy);
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(23, 38, 61, .22);
}

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

.brand strong {
  font-size: 15px;
  letter-spacing: .04em;
}

.brand small {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 11px;
  letter-spacing: .08em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 12px;
}

.status-dot i {
  display: block;
  width: 7px;
  height: 7px;
  background: var(--teal);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(28, 155, 147, .13);
}

.ghost-button,
.text-button {
  padding: 7px 0;
  color: var(--ink-soft);
  font-size: 12px;
  background: transparent;
  border: 0;
}

.ghost-button:hover,
.text-button:hover {
  color: var(--teal);
}

.page-layout {
  display: grid;
  grid-template-columns: minmax(220px, 264px) minmax(0, 1fr);
  gap: clamp(26px, 4vw, 64px);
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  padding: 38px 0 54px;
}

.sidebar {
  min-width: 0;
}

.sidebar-heading,
.summary-heading,
.answer-panel-heading,
.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  display: block;
  color: var(--teal);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  line-height: 1.4;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.sidebar h2,
.summary-card h2 {
  margin: 5px 0 0;
  color: var(--navy);
  font-size: 18px;
  letter-spacing: -.02em;
}

.count-badge {
  display: inline-grid;
  min-width: 28px;
  height: 24px;
  padding: 0 7px;
  place-items: center;
  color: var(--navy-2);
  font-size: 11px;
  font-weight: 700;
  background: #e9eef6;
  border-radius: 999px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  margin: 22px 0 18px;
  padding: 0 12px;
  color: var(--ink-faint);
  background: rgba(255, 255, 255, .84);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color .2s, box-shadow .2s;
}

.search-box:focus-within {
  border-color: rgba(28, 155, 147, .7);
  box-shadow: 0 0 0 4px rgba(28, 155, 147, .10);
}

.search-box span {
  font-size: 22px;
  line-height: 1;
  transform: rotate(-15deg);
}

.search-box input {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  font-size: 12px;
  background: transparent;
  border: 0;
  outline: 0;
}

.search-box input::placeholder {
  color: #a5afbd;
}

.chapter-list {
  display: grid;
  gap: 8px;
}

.chapter-item {
  overflow: hidden;
  background: rgba(255, 255, 255, .50);
  border: 1px solid transparent;
  border-radius: 13px;
  transition: background .2s, border-color .2s, box-shadow .2s;
}

.chapter-item.is-active {
  background: white;
  border-color: #d8e4ed;
  box-shadow: var(--shadow-sm);
}

.chapter-button {
  display: flex;
  align-items: flex-start;
  width: 100%;
  gap: 10px;
  padding: 12px 12px 10px;
  color: var(--ink-soft);
  text-align: left;
  background: transparent;
  border: 0;
}

.chapter-button:hover {
  color: var(--navy);
}

.chapter-item.is-active .chapter-button {
  color: var(--navy);
}

.chapter-number {
  display: grid;
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  place-items: center;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  background: #edf1f6;
  border-radius: 8px;
}

.chapter-item.is-active .chapter-number {
  color: white;
  background: var(--teal);
}

.chapter-copy {
  min-width: 0;
  padding-top: 1px;
}

.chapter-name {
  display: block;
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chapter-desc {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chapter-progress {
  height: 3px;
  margin: 0 12px 10px 47px;
  overflow: hidden;
  background: #edf1f6;
  border-radius: 99px;
}

.chapter-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), #67c7ba);
  border-radius: inherit;
  transition: width .35s ease;
}

.sidebar-note {
  display: flex;
  gap: 9px;
  margin-top: 28px;
  padding: 12px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.6;
  background: rgba(232, 247, 244, .75);
  border: 1px solid rgba(173, 222, 214, .65);
  border-radius: 12px;
}

.sidebar-note p {
  margin: 0;
}

.sidebar-note code,
.guide-dialog code {
  padding: 1px 4px;
  color: var(--navy-2);
  font-family: Consolas, monospace;
  font-size: .9em;
  background: rgba(255,255,255,.65);
  border-radius: 4px;
}

.note-icon {
  display: grid;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  place-items: center;
  color: var(--teal);
  font-size: 15px;
  background: white;
  border-radius: 6px;
}

.workspace {
  min-width: 0;
}

.hero-card {
  position: relative;
  display: flex;
  min-height: 168px;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  overflow: hidden;
  padding: 30px clamp(24px, 4vw, 48px);
  color: white;
  background:
    linear-gradient(120deg, rgba(20, 37, 62, .98), rgba(35, 60, 89, .96)),
    var(--navy);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.hero-card::after {
  position: absolute;
  right: -70px;
  bottom: -125px;
  width: 310px;
  height: 230px;
  content: "";
  background: rgba(28, 155, 147, .17);
  border-radius: 50%;
  transform: rotate(-18deg);
}

.hero-card .eyebrow {
  color: #7bd3c8;
}

.hero-card h1 {
  max-width: 580px;
  margin: 8px 0 9px;
  font-size: clamp(24px, 3vw, 35px);
  font-weight: 700;
  letter-spacing: -.045em;
  line-height: 1.15;
}

.hero-card p {
  max-width: 620px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, .70);
  font-size: 13px;
  line-height: 1.65;
}

.hero-orbit {
  position: relative;
  z-index: 1;
  flex: 0 0 145px;
  width: 145px;
  height: 120px;
}

.orbit {
  position: absolute;
  display: block;
  border: 1px solid rgba(130, 223, 210, .55);
  border-radius: 50%;
  transform: rotate(-32deg);
}

.orbit-a {
  inset: 7px 14px 10px 12px;
}

.orbit-b {
  inset: 20px 0 0 28px;
  border-color: rgba(232, 120, 97, .65);
  transform: rotate(47deg);
}

.orbit-core {
  position: absolute;
  top: 39px;
  left: 57px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--navy);
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  background: #9de1d6;
  border-radius: 50%;
  box-shadow: 0 0 0 7px rgba(157, 225, 214, .12), 0 8px 22px rgba(0,0,0,.2);
}

.control-bar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px 15px;
  margin: 23px 0 19px;
  padding: 15px 17px;
  background: rgba(255,255,255,.83);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 5px 18px rgba(28, 46, 75, .04);
}

.select-group {
  display: grid;
  flex: 0 1 155px;
  gap: 5px;
}

.select-group label,
.filter-label {
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
}

.select-group select {
  width: 100%;
  height: 34px;
  padding: 0 26px 0 10px;
  color: var(--ink);
  font-size: 12px;
  background-color: white;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: 0;
}

.type-filter,
.level-filter,
.source-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 34px;
  margin-left: 3px;
}

.filter-label {
  margin-right: 2px;
}

.filter-chip {
  height: 30px;
  padding: 0 10px;
  color: var(--ink-soft);
  font-size: 11px;
  background: #f4f6fa;
  border: 1px solid transparent;
  border-radius: 7px;
  transition: color .2s, background .2s, border-color .2s;
}

.filter-chip:hover {
  color: var(--teal);
  border-color: #b7e0db;
}

.filter-chip.is-active {
  color: #147f78;
  font-weight: 700;
  background: var(--teal-soft);
  border-color: #b7e0db;
}

.primary-button,
.secondary-button,
.next-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 35px;
  padding: 0 15px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  transition: transform .18s, box-shadow .18s, background .18s, border-color .18s;
}

.primary-button {
  color: white;
  background: var(--teal);
  border: 1px solid var(--teal);
  box-shadow: 0 5px 12px rgba(28, 155, 147, .18);
}

.primary-button:hover {
  background: #16867f;
  box-shadow: 0 7px 17px rgba(28, 155, 147, .26);
  transform: translateY(-1px);
}

.control-bar .primary-button {
  margin-left: auto;
  align-self: flex-end;
  white-space: nowrap;
}

.secondary-button {
  color: var(--navy-2);
  background: white;
  border: 1px solid var(--line-strong);
}

.secondary-button:hover {
  color: var(--teal);
  border-color: #9ed6d0;
  background: #fbfffe;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, .8fr);
  align-items: start;
  gap: 20px;
}

.question-column {
  min-width: 0;
}

.section-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 4px 9px;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.section-kicker span:last-child {
  overflow: hidden;
  font-weight: 500;
  letter-spacing: .02em;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.question-card,
.summary-card,
.stats-card,
.empty-state {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.question-card {
  padding: clamp(20px, 3vw, 30px);
}

.question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.question-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 9px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
}

.pill-accent {
  color: #147f78;
  background: var(--teal-soft);
}

.pill-muted {
  color: var(--ink-soft);
  font-weight: 600;
  background: #f0f3f7;
}

.icon-button {
  display: inline-grid;
  flex: 0 0 auto;
  width: 33px;
  height: 33px;
  place-items: center;
  padding: 0;
  color: #9ba7b6;
  font-size: 22px;
  line-height: 1;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  transition: color .2s, background .2s, border-color .2s;
}

.icon-button:hover {
  color: var(--coral);
  background: var(--coral-soft);
  border-color: #f7d1c8;
}

.icon-button.is-favorite {
  color: var(--coral);
}

.unit-breadcrumb {
  margin-top: 17px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
}

.question-stem {
  margin: 9px 0 23px;
  color: var(--navy);
  font-size: clamp(18px, 2vw, 23px);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.62;
}

.options-container {
  display: grid;
  gap: 9px;
}

.option-label {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 13px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: color .18s, background .18s, border-color .18s, transform .18s;
}

.option-label:hover {
  color: var(--navy);
  border-color: #a8dcd6;
  transform: translateX(2px);
}

.option-label.is-selected {
  color: var(--navy);
  background: #f0fbf9;
  border-color: #80c9c1;
  box-shadow: 0 0 0 2px rgba(28, 155, 147, .08);
}

.option-label.is-correct {
  color: #176e57;
  background: #ecfaf4;
  border-color: #77c9a8;
}

.option-label.is-wrong {
  color: #a44d40;
  background: #fff2ef;
  border-color: #eab0a5;
}

.option-label input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--teal);
}

.option-key {
  display: inline-grid;
  flex: 0 0 auto;
  width: 23px;
  height: 23px;
  place-items: center;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  background: #edf1f6;
  border-radius: 6px;
}

.option-label.is-selected .option-key {
  color: white;
  background: var(--teal);
}

.option-label.is-correct .option-key {
  color: white;
  background: #35a977;
}

.option-label.is-wrong .option-key {
  color: white;
  background: #d87564;
}

.answer-input {
  width: 100%;
  min-height: 88px;
  padding: 12px 14px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  background: #fbfcfe;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: 0;
}

.answer-input:focus {
  border-color: #80c9c1;
  box-shadow: 0 0 0 3px rgba(28, 155, 147, .10);
}

.input-hint {
  margin-top: 8px;
  color: var(--ink-faint);
  font-size: 11px;
}

.question-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 23px;
  padding-top: 18px;
  border-top: 1px solid #edf0f4;
}

.question-actions .text-button {
  margin-left: auto;
}

.feedback {
  margin-top: 15px;
  padding: 10px 12px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
  background: #f5f7fb;
  border-left: 3px solid var(--ink-faint);
  border-radius: 6px;
}

.feedback.is-correct {
  color: #176e57;
  background: #edf9f4;
  border-left-color: #35a977;
}

.feedback.is-wrong {
  color: #974a3f;
  background: #fff2ef;
  border-left-color: #d87564;
}

.answer-panel {
  margin-top: 20px;
  padding: 20px;
  background: linear-gradient(145deg, #f8fbfd, #f5faf9);
  border: 1px solid #d8ebe8;
  border-radius: 12px;
  animation: reveal .28s ease;
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.answer-panel-heading h3 {
  margin: 4px 0 0;
  color: var(--navy);
  font-size: 16px;
}

.answer-status {
  align-self: center;
  padding: 5px 9px;
  color: #147f78;
  font-size: 10px;
  font-weight: 700;
  background: var(--teal-soft);
  border-radius: 99px;
}

.answer-block {
  margin-top: 17px;
}

.answer-label {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
}

.answer-block p {
  margin-bottom: 0;
  color: var(--navy-2);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-line;
}

.explanation-block {
  padding-top: 14px;
  border-top: 1px dashed #d8e6e5;
}

.point-row {
  margin-top: 17px;
  padding-top: 14px;
  border-top: 1px dashed #d8e6e5;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 8px;
  color: #39706b;
  font-size: 10px;
  background: white;
  border: 1px solid #c9e2df;
  border-radius: 6px;
}

.source-line {
  margin-top: 16px;
  color: var(--ink-faint);
  font-size: 10px;
}

.source-line strong {
  color: var(--ink-soft);
}

.source-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.source-line small {
  flex-basis: 100%;
  color: var(--ink-faint);
  line-height: 1.55;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 0 7px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  border-radius: 6px;
}

.source-badge.is-core {
  color: #176f69;
  background: #e0f4f0;
  border: 1px solid #b8e3dc;
}

.source-badge.is-supplement {
  color: #805726;
  background: #fff2dc;
  border: 1px solid #f0d29c;
}

.next-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 15px;
}

.question-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.next-button {
  min-height: 39px;
  color: var(--navy-2);
  background: white;
  border: 1px solid var(--line-strong);
}

.next-button:hover {
  color: var(--teal);
  border-color: #9ed6d0;
  transform: translateX(2px);
}

.prev-button:hover {
  transform: translateX(-2px);
}

.next-button:disabled,
.next-button:disabled:hover {
  color: var(--ink-faint);
  background: var(--paper);
  border-color: var(--line);
  cursor: not-allowed;
  opacity: .72;
  transform: none;
}

.next-button span {
  font-size: 18px;
  font-weight: 400;
  line-height: .7;
}

.progress-text {
  color: var(--ink-faint);
  font-size: 11px;
  margin-left: auto;
}

.summary-column {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.summary-card {
  padding: 21px;
}

.summary-symbol {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--coral);
  font-size: 16px;
  background: var(--coral-soft);
  border-radius: 9px;
}

.summary-description {
  margin: 15px 0 18px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.6;
}

.completion-meter {
  padding: 12px;
  background: #f6f8fb;
  border-radius: 10px;
}

.meter-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-faint);
  font-size: 10px;
}

.meter-label strong {
  color: var(--teal);
  font-size: 11px;
}

.meter-track {
  height: 6px;
  margin-top: 8px;
  overflow: hidden;
  background: #e1e7ef;
  border-radius: 99px;
}

.meter-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), #77cec2);
  border-radius: inherit;
  transition: width .35s ease;
}

.summary-section {
  margin-top: 22px;
}

.summary-section h3 {
  margin: 0 0 11px;
  color: var(--navy);
  font-size: 12px;
}

.check-list,
.trap-list {
  display: grid;
  gap: 9px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.check-list li,
.trap-list li {
  position: relative;
  padding-left: 21px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.6;
}

.check-list li::before {
  position: absolute;
  top: 3px;
  left: 0;
  display: grid;
  width: 14px;
  height: 14px;
  place-items: center;
  color: var(--teal);
  font-size: 10px;
  font-weight: 700;
  content: "✓";
  background: var(--teal-soft);
  border-radius: 50%;
}

.trap-section {
  padding-top: 16px;
  border-top: 1px solid #edf0f4;
}

.trap-section h3 {
  color: #a56a21;
}

.trap-section h3 span {
  display: inline-grid;
  width: 16px;
  height: 16px;
  margin-right: 4px;
  place-items: center;
  color: #a56a21;
  font-size: 10px;
  background: var(--yellow-soft);
  border-radius: 50%;
}

.trap-list li::before {
  position: absolute;
  top: 7px;
  left: 3px;
  width: 8px;
  height: 8px;
  content: "";
  background: #e6b45b;
  border-radius: 50%;
}

.stats-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 17px 10px;
}

.stat-item {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 2px 9px;
  text-align: center;
}

.stat-item + .stat-item {
  border-left: 1px solid var(--line);
}

.stat-number {
  color: var(--navy);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.03em;
}

.stat-label {
  color: var(--ink-faint);
  font-size: 10px;
}

.empty-state {
  padding: 42px 24px;
  text-align: center;
}

.empty-icon {
  color: var(--teal);
  font-family: Georgia, serif;
  font-size: 34px;
}

.empty-state h3 {
  margin: 10px 0 6px;
  color: var(--navy);
  font-size: 17px;
}

.empty-state p {
  margin-bottom: 17px;
  color: var(--ink-faint);
  font-size: 12px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: min(1440px, calc(100% - 48px));
  padding: 18px 0 30px;
  margin: 0 auto;
  color: var(--ink-faint);
  font-size: 10px;
  border-top: 1px solid rgba(213, 221, 232, .8);
}

.guide-dialog {
  width: min(520px, calc(100% - 32px));
  padding: 25px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(17, 35, 61, .22);
}

.guide-dialog::backdrop {
  background: rgba(18, 32, 52, .38);
  backdrop-filter: blur(3px);
}

.guide-dialog h2 {
  margin: 5px 0 0;
  color: var(--navy);
  font-size: 19px;
}

.guide-dialog p,
.guide-dialog li {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.75;
}

.guide-dialog p {
  margin: 21px 0 10px;
}

.guide-dialog ol {
  padding-left: 21px;
  margin: 0 0 22px;
}

.guide-dialog li + li {
  margin-top: 6px;
}

.guide-dialog .primary-button {
  width: 100%;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 24px;
  z-index: 30;
  max-width: min(320px, calc(100% - 44px));
  padding: 11px 14px;
  color: white;
  font-size: 12px;
  line-height: 1.45;
  pointer-events: none;
  background: var(--navy);
  border-radius: 9px;
  box-shadow: 0 10px 30px rgba(17, 35, 61, .20);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
}

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

@media (max-width: 1120px) {
  .page-layout {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 27px;
  }

  .content-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(240px, .8fr);
  }

  .type-filter {
    order: 3;
    width: 100%;
  }

  .level-filter,
  .source-filter {
    order: 4;
    width: 100%;
  }

  .control-bar .primary-button {
    order: 5;
    margin-left: auto;
  }
}

@media (max-width: 860px) {
  .page-layout {
    grid-template-columns: 1fr;
    width: min(720px, calc(100% - 32px));
    padding-top: 24px;
  }

  .sidebar {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 0 16px;
  }

  .sidebar-heading {
    grid-column: 1 / -1;
  }

  .search-box {
    margin: 16px 0;
  }

  .chapter-list {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: thin;
  }

  .chapter-item {
    flex: 0 0 205px;
  }

  .sidebar-note {
    display: none;
  }

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

  .summary-column {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

@media (max-width: 570px) {
  .topbar {
    height: 64px;
    padding: 0 16px;
  }

  .topbar-actions .status-dot {
    display: none;
  }

  .page-layout,
  .footer {
    width: calc(100% - 24px);
  }

  .hero-card {
    min-height: 0;
    padding: 24px 21px;
  }

  .hero-orbit {
    display: none;
  }

  .control-bar {
    align-items: stretch;
    padding: 13px;
  }

  .select-group,
  .unit-group {
    flex: 1 1 calc(50% - 8px);
  }

  .control-bar .primary-button {
    width: 100%;
    margin-left: 0;
  }

  .type-filter,
  .level-filter,
  .source-filter {
    gap: 5px;
  }

  .filter-chip {
    flex: 1 0 auto;
  }

  .question-card {
    padding: 19px 16px;
  }

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

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

  .question-actions .primary-button,
  .question-actions .secondary-button {
    flex: 1 1 auto;
  }

  .question-actions .text-button {
    margin-left: 0;
  }

  .summary-column {
    grid-template-columns: 1fr;
  }

  .footer {
    flex-direction: column;
    gap: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
