:root {
  color-scheme: light;
  --bg: #f3f4f0;
  --surface: #ffffff;
  --surface-muted: #e9ece7;
  --surface-warm: #f5efe3;
  --ink: #20231f;
  --ink-soft: #5f665f;
  --line: #d8ddd6;
  --line-strong: #b9c1b8;
  --nav: #222721;
  --nav-soft: #30372f;
  --accent: #2f6b55;
  --accent-strong: #245441;
  --accent-soft: #dcebe3;
  --warm: #a16a19;
  --warm-soft: #f4e5c7;
  --danger: #a83f3f;
  --danger-soft: #f4dddd;
  --success: #2e6a4f;
  --shadow-sm: 0 1px 2px rgba(20, 27, 21, 0.08);
  --shadow-md: 0 10px 30px rgba(20, 27, 21, 0.12);
  --radius-sm: 4px;
  --radius-md: 8px;
  --space-xs: 6px;
  --space-sm: 10px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 36px;
  --space-2xl: 52px;
  --sidebar-width: 228px;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  font-size: 16px;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

button,
input,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  color: inherit;
}

svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 12px;
  color: #fff;
  background: var(--accent-strong);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 28px 16px 20px;
  color: #e8ece7;
  background: var(--nav);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 12px 30px;
}

.brand-code {
  color: #fff;
  font-family: Consolas, "Microsoft YaHei", sans-serif;
  font-size: 1.7rem;
  font-weight: 750;
  line-height: 1.15;
}

.brand-name {
  color: #aeb7ad;
  font-size: 0.82rem;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.nav-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: #cbd2ca;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.nav-item:hover {
  color: #fff;
  background: var(--nav-soft);
}

.nav-item:active {
  background: #3a4339;
}

.nav-item.is-active {
  color: #fff;
  border-color: #465146;
  background: #364137;
}

.nav-badge {
  min-width: 24px;
  padding: 0 6px;
  border-radius: 999px;
  color: #2b251b;
  background: #e4be7b;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
}

.sidebar-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-top: auto;
  padding: 18px 12px 0;
  border-top: 1px solid #3b443a;
  color: #9fa99e;
  font-size: 0.76rem;
}

.sidebar-foot strong {
  color: #eef2ed;
  font-size: 0.82rem;
}

.main-area {
  min-width: 0;
  padding: 0 42px 48px;
}

.main-area.is-session .topbar {
  display: none;
}

.main-area.is-session #view-root {
  padding-top: 24px;
}

body.is-exam-room {
  background: #e8ebe9;
}

body.is-exam-room .app-shell {
  grid-template-columns: 1fr;
}

body.is-exam-room .sidebar {
  display: none;
}

body.is-exam-room .main-area {
  padding: 0;
  background: #e8ebe9;
}

body.is-exam-room .main-area.is-session #view-root {
  padding: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  min-height: 116px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 650;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.3;
}

h1 {
  font-size: 1.65rem;
}

h2 {
  font-size: 1.28rem;
}

h3 {
  font-size: 1rem;
}

.utility-actions,
.dialog-actions,
.action-buttons,
.session-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-muted);
}

.icon-button:active {
  transform: translateY(1px);
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #e0a845;
  outline-offset: 2px;
}

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

#view-root {
  padding-top: 32px;
}

.view-section {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-lg);
  margin-bottom: 22px;
}

.section-head p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.stat-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: var(--space-xl);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.48);
}

.stat-item {
  min-width: 0;
  padding: 19px 20px;
  border-right: 1px solid var(--line);
}

.stat-item:last-child {
  border-right: 0;
}

.stat-item span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.77rem;
}

.stat-item strong {
  display: block;
  margin-top: 2px;
  font-family: Consolas, "Microsoft YaHei", sans-serif;
  font-size: 1.55rem;
  line-height: 1.25;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.8fr);
  gap: var(--space-xl);
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.action-list {
  display: flex;
  flex-direction: column;
}

.action-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-md);
  min-height: 92px;
  padding: 17px 20px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.action-row:last-child {
  border-bottom: 0;
}

.action-row:hover {
  background: #f7f9f6;
}

.action-row:active {
  background: var(--surface-muted);
}

.action-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.action-row:nth-child(2) .action-icon {
  color: #72501c;
  background: var(--warm-soft);
}

.action-row:nth-child(3) .action-icon {
  color: #653f3f;
  background: #eee0df;
}

.action-copy strong,
.action-copy span {
  display: block;
}

.action-copy span {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.action-arrow {
  color: var(--ink-soft);
}

.resume-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  padding: 16px 18px;
  border: 1px solid #bdcfbf;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  background: #edf5ef;
}

.resume-banner p {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.button {
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 650;
  line-height: 1.35;
}

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

.button-primary:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.button-secondary {
  border-color: var(--line-strong);
  background: var(--surface);
}

.button-secondary:hover {
  background: var(--surface-muted);
}

.button-danger {
  color: var(--danger);
  border-color: #d8a7a7;
  background: #fff;
}

.history-list {
  min-height: 218px;
}

.history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-md);
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}

.history-row:last-child {
  border-bottom: 0;
}

.history-row time,
.history-row span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.history-score {
  align-self: center;
  min-width: 58px;
  color: var(--accent-strong);
  font-family: Consolas, monospace;
  font-size: 1.25rem;
  font-weight: 750;
  text-align: right;
}

.empty-inline {
  display: grid;
  min-height: 218px;
  padding: 28px;
  place-items: center;
  color: var(--ink-soft);
  font-size: 0.88rem;
  text-align: center;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: var(--space-md);
}

.chapter-card {
  display: flex;
  flex-direction: column;
  min-height: 172px;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.chapter-card:hover {
  border-color: #aeb9af;
}

.chapter-index {
  color: var(--accent);
  font-family: Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
}

.chapter-card h3 {
  margin-top: 8px;
  font-size: 0.98rem;
}

.chapter-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 10px 0 18px;
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.chapter-card .button {
  width: 100%;
  margin-top: auto;
}

.mock-setup {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: var(--space-xl);
  align-items: start;
}

.mock-copy {
  padding: 6px 0;
}

.mock-copy > p {
  max-width: 650px;
  margin: 12px 0 26px;
  color: var(--ink-soft);
}

.blueprint {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.blueprint-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-md);
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.blueprint-row:last-child {
  border-bottom: 0;
}

.blueprint-row strong {
  font-family: Consolas, "Microsoft YaHei", sans-serif;
}

.note-band {
  margin-top: var(--space-lg);
  padding: 13px 15px;
  border-left: 3px solid var(--warm);
  color: #5c4828;
  background: var(--surface-warm);
  font-size: 0.84rem;
}

.wrong-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.toggle-row,
.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  cursor: pointer;
}

.toggle-row input,
.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.wrong-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: var(--space-xl);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.wrong-summary .stat-item {
  text-align: center;
}

.empty-state {
  display: grid;
  min-height: 340px;
  padding: var(--space-xl);
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.45);
  text-align: center;
}

.empty-state svg {
  width: 38px;
  height: 38px;
  margin: 0 auto 14px;
  color: var(--accent);
}

.empty-state p {
  margin: 6px 0 0;
  font-size: 0.88rem;
}

.exam-room {
  min-height: 100vh;
  background: #e8ebe9;
}

.exam-room-header {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  min-height: 72px;
  padding: 10px 24px;
  border-bottom: 1px solid #c9ceca;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.exam-room-identity,
.exam-room-status {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.exam-room-identity strong,
.exam-room-identity span,
.exam-room-status span,
.exam-room-status strong {
  display: block;
}

.exam-room-identity strong {
  font-size: 1rem;
}

.exam-room-identity span,
.exam-room-status span {
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.exam-room-status {
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fafbfa;
}

.exam-progress-count,
.exam-clock {
  min-width: 108px;
  padding: 7px 14px;
  text-align: center;
}

.exam-progress-count {
  border-right: 1px solid var(--line);
}

.exam-progress-count strong,
.exam-clock strong {
  font-family: Consolas, "Microsoft YaHei", sans-serif;
  font-size: 1rem;
  line-height: 1.25;
}

.exam-clock strong {
  color: var(--accent-strong);
}

.exam-clock strong.is-low {
  color: var(--danger);
}

.exam-header-submit {
  display: none;
  color: #fff;
  border-color: #157f9f;
  background: #157f9f;
}

.exam-type-tabs {
  position: sticky;
  top: 72px;
  z-index: 190;
  display: flex;
  align-items: stretch;
  min-height: 54px;
  padding: 0 24px;
  border-bottom: 1px solid #c8cdca;
  background: #dfe2e0;
}

.exam-type-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-width: 150px;
  padding: 10px 18px 8px;
  border: 0;
  border-bottom: 3px solid transparent;
  color: #4d544e;
  background: transparent;
  cursor: pointer;
}

.exam-type-tab:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.52);
}

.exam-type-tab.is-active {
  color: var(--accent-strong);
  border-bottom-color: var(--accent);
  background: #fff;
}

.exam-type-tab strong {
  font-family: Consolas, monospace;
  font-size: 0.76rem;
}

.exam-room-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  width: min(1600px, calc(100% - 40px));
  margin: 0 auto;
  padding: 20px 0 40px;
  align-items: start;
}

.exam-paper {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #cdd2ce;
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.exam-question-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  min-height: 76px;
  padding: 14px 24px;
  border-bottom: 1px solid #d5dad6;
  background: #e2e5e3;
}

.exam-question-band span {
  display: block;
}

.exam-question-number {
  color: #176f86;
  font-size: 1.02rem;
  font-weight: 750;
}

.exam-global-number {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 0.73rem;
}

.exam-question-body {
  min-height: 520px;
  padding: 28px 32px 34px;
}

.exam-source {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.exam-question-body .question-text {
  max-width: 1050px;
  font-size: 1.14rem;
  line-height: 1.8;
}

.exam-question-body .options-list {
  max-width: 980px;
}

.exam-question-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-height: 78px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: #fafbfa;
}

.exam-answer-sheet {
  position: sticky;
  top: 146px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 166px);
  overflow: hidden;
  border: 1px solid #c9ceca;
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.exam-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-height: 58px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #dfe2e0;
}

.exam-sheet-head h2 {
  font-size: 1.08rem;
}

.exam-sheet-head strong {
  color: #c94d25;
  font-family: Consolas, monospace;
  font-size: 0.95rem;
}

.exam-sheet-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.exam-answer-group {
  padding: 14px 14px 16px;
  border-bottom: 1px solid var(--line);
}

.exam-answer-group:last-child {
  border-bottom: 0;
}

.exam-answer-group h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: 10px;
  padding-left: 8px;
  border-left: 3px solid #1685aa;
  font-size: 0.82rem;
}

.exam-answer-group h3 strong {
  color: var(--ink-soft);
  font-family: Consolas, monospace;
  font-size: 0.73rem;
}

.exam-answer-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 5px;
}

.exam-answer-number {
  position: relative;
  min-height: 32px;
  aspect-ratio: auto;
  font-size: 0.68rem;
}

.exam-answer-number.is-flagged::after {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d39a32;
  content: "";
}

.exam-sheet-foot {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
  background: #fafbfa;
}

.exam-sheet-foot .answer-legend {
  padding: 0 0 10px;
  border: 0;
}

.legend-dot.flagged {
  border-color: #d39a32;
  background: #d39a32;
}

.exam-submit-button {
  width: 100%;
  color: #fff;
  border-color: #157f9f;
  background: #157f9f;
}

.exam-submit-button:hover {
  border-color: #0f657f;
  background: #0f657f;
}

.session-view {
  width: min(1320px, 100%);
  margin: 0 auto;
}

.session-header {
  display: grid;
  grid-template-columns: minmax(180px, auto) minmax(220px, 1fr) auto;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.session-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.session-title strong,
.session-title span {
  display: block;
}

.session-title span {
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.session-progress {
  min-width: 0;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe3dd;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease;
}

.timer {
  min-width: 92px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--surface);
  font-family: Consolas, monospace;
  font-size: 1rem;
  font-weight: 750;
  text-align: center;
}

.timer.is-low {
  color: var(--danger);
  border-color: #d7a0a0;
  background: var(--danger-soft);
}

.session-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--space-lg);
  align-items: start;
}

.question-stage {
  min-height: 560px;
  padding: 28px 30px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.question-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.type-tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 2px 8px;
  border: 1px solid #b9d0c1;
  border-radius: 999px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-weight: 700;
}

.question-text {
  margin: 0 0 24px;
  font-size: 1.08rem;
  font-weight: 650;
  line-height: 1.75;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.subjective-answer {
  display: block;
  max-width: 980px;
}

.subjective-answer > span {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 700;
}

.subjective-answer textarea {
  display: block;
  width: 100%;
  min-height: 160px;
  padding: 14px 16px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: #fff;
  line-height: 1.75;
}

.subjective-answer textarea[readonly] {
  color: var(--ink-soft);
  background: #f5f7f4;
}

.subjective-reference {
  max-width: 980px;
  margin-top: 20px;
  padding: 16px 18px;
  border-left: 4px solid var(--warm);
  background: var(--surface-warm);
}

.subjective-reference.is-correct {
  border-left-color: var(--success);
  background: #eaf3ec;
}

.subjective-reference.is-wrong {
  border-left-color: var(--danger);
  background: var(--danger-soft);
}

.subjective-reference-head,
.rubric-head,
.feedback-score {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.subjective-reference-head,
.rubric-head,
.feedback-score {
  justify-content: space-between;
}

.subjective-reference-head span,
.rubric-head span {
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 700;
}

.subjective-reference > p {
  margin: 12px 0 16px;
  white-space: pre-wrap;
  font-size: 0.92rem;
  line-height: 1.85;
}

.rubric-head {
  padding-top: 14px;
  border-top: 1px solid rgba(95, 102, 95, 0.25);
}

.rubric-head > div strong,
.rubric-head > div span,
.rubric-copy strong,
.rubric-copy span,
.rubric-copy small {
  display: block;
}

.rubric-head > div span {
  margin-top: 2px;
  font-weight: 500;
}

.rubric-score {
  flex: 0 0 auto;
  color: var(--accent-strong);
  font-family: Consolas, "Microsoft YaHei", sans-serif;
  font-size: 1.55rem;
}

.rubric-score span {
  display: inline;
  font-size: 0.82rem;
}

.rubric-list {
  margin-top: 12px;
  border-top: 1px solid var(--line);
}

.rubric-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 44px;
  align-items: start;
  gap: 11px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.rubric-row input {
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: var(--accent);
}

.rubric-row.is-selected .rubric-copy > strong,
.rubric-row.is-selected .rubric-points {
  color: var(--accent-strong);
}

.rubric-copy > strong {
  color: var(--ink-soft);
  font-size: 0.74rem;
}

.rubric-copy > span {
  margin-top: 2px;
  line-height: 1.65;
}

.rubric-copy small {
  margin-top: 4px;
  color: var(--warm);
  font-size: 0.7rem;
}

.rubric-points {
  padding-top: 2px;
  font-family: Consolas, "Microsoft YaHei", sans-serif;
  font-size: 0.82rem;
  font-weight: 750;
  text-align: right;
}

.rubric-confirm {
  width: 100%;
  margin-top: 14px;
}

.rubric-final {
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 650;
}

.feedback-score span {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 750;
}

.option-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 20px;
  align-items: start;
  gap: 12px;
  min-height: 58px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.option-row:hover {
  border-color: #aeb9af;
  background: #f8faf7;
}

.option-row.is-selected {
  border-color: var(--accent);
  background: #edf5ef;
}

.option-row.is-correct {
  border-color: #7eb194;
  background: #e6f2e9;
}

.option-row.is-wrong {
  border-color: #d18b8b;
  background: #f8e7e7;
}

.option-key {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-family: Consolas, monospace;
  font-size: 0.86rem;
  font-weight: 750;
}

.option-row.is-selected .option-key {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.option-text {
  padding-top: 3px;
  line-height: 1.65;
}

.option-row input {
  width: 18px;
  height: 18px;
  margin-top: 7px;
  accent-color: var(--accent);
}

.feedback {
  margin-top: 20px;
  padding: 15px 17px;
  border-left: 4px solid var(--success);
  background: #eaf3ec;
}

.feedback.is-wrong {
  border-left-color: var(--danger);
  background: var(--danger-soft);
}

.feedback strong {
  display: block;
  margin-bottom: 2px;
}

.feedback p {
  margin: 0;
  font-size: 0.86rem;
}

.feedback-answer {
  color: var(--ink);
  font-weight: 650;
}

.feedback-explanation {
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid rgba(46, 106, 79, 0.2);
}

.feedback.is-wrong .feedback-explanation {
  border-top-color: rgba(168, 63, 63, 0.2);
}

.feedback-explanation span {
  display: block;
  margin-bottom: 3px;
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 700;
}

.feedback-explanation p {
  line-height: 1.7;
}

.question-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.answer-panel {
  position: sticky;
  top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.answer-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
}

.answer-panel-head span {
  color: var(--ink-soft);
  font-size: 0.74rem;
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  max-height: 430px;
  padding: 14px;
  overflow-y: auto;
}

.answer-number {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  font-family: Consolas, monospace;
  font-size: 0.73rem;
}

.answer-number:hover {
  border-color: var(--line-strong);
  background: var(--surface-muted);
}

.answer-number.is-answered {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.answer-number.is-current {
  box-shadow: 0 0 0 2px #e0a845;
}

.answer-number.is-wrong {
  color: #fff;
  border-color: var(--danger);
  background: var(--danger);
}

.answer-number.is-correct {
  color: #fff;
  border-color: var(--success);
  background: var(--success);
}

.answer-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: #fff;
}

.legend-dot.answered {
  border-color: var(--accent);
  background: var(--accent);
}

.legend-dot.current {
  border-color: #e0a845;
  background: #e0a845;
}

.result-layout {
  width: min(920px, 100%);
  margin: 0 auto;
}

.result-hero {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: var(--space-xl);
  align-items: center;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.score-ring {
  display: grid;
  place-items: center;
  width: 164px;
  height: 164px;
  border: 12px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
}

.score-ring.is-failed {
  border-color: var(--danger-soft);
  border-top-color: var(--danger);
}

.score-ring strong {
  font-family: Consolas, monospace;
  font-size: 2.5rem;
  line-height: 1;
}

.score-ring span {
  color: var(--ink-soft);
  font-size: 0.74rem;
}

.result-copy p {
  margin: 8px 0 22px;
  color: var(--ink-soft);
}

.result-detail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: var(--space-lg) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.result-detail div {
  padding: 15px;
  border-right: 1px solid var(--line);
  text-align: center;
}

.result-detail div:last-child {
  border-right: 0;
}

.result-detail span,
.result-detail strong {
  display: block;
}

.result-detail span {
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.result-detail strong {
  margin-top: 2px;
}

.setup-dialog {
  width: min(480px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.setup-dialog::backdrop {
  background: rgba(24, 28, 24, 0.55);
}

.setup-dialog form {
  padding: 22px;
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.setup-dialog fieldset {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-sm);
  margin: 0 0 var(--space-lg);
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.setup-dialog legend {
  padding: 0 6px;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 650;
}

.number-input {
  width: 100%;
  min-height: 44px;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
}

.form-error {
  min-height: 24px;
  margin: 6px 0 2px;
  color: var(--danger);
  font-size: 0.78rem;
}

.dialog-actions {
  justify-content: flex-end;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  max-width: min(380px, calc(100vw - 44px));
  padding: 11px 15px;
  border: 1px solid #303830;
  border-radius: var(--radius-sm);
  color: #fff;
  background: #293129;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

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

@media (max-width: 1080px) {
  .main-area {
    padding-right: 28px;
    padding-left: 28px;
  }

  .session-layout {
    grid-template-columns: minmax(0, 1fr) 250px;
  }

  .answer-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .exam-room-content {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

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

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    z-index: 10;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    min-height: auto;
    padding: 12px 16px;
  }

  .brand {
    padding: 0 18px 0 0;
  }

  .brand-code {
    font-size: 1.25rem;
  }

  .brand-name,
  .sidebar-foot {
    display: none;
  }

  .nav-list {
    flex-direction: row;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .nav-item {
    flex: 0 0 auto;
    grid-template-columns: 20px auto auto;
    width: auto;
    min-height: 42px;
    padding: 8px 10px;
    white-space: nowrap;
  }

  .nav-item svg {
    width: 18px;
    height: 18px;
  }

  .main-area {
    padding: 0 20px 36px;
  }

  .topbar {
    min-height: 96px;
  }

  .overview-grid,
  .mock-setup,
  .session-layout {
    grid-template-columns: 1fr;
  }

  .answer-panel {
    position: static;
  }

  .answer-grid {
    grid-template-columns: repeat(10, 1fr);
    max-height: none;
  }

  .answer-number {
    min-height: 34px;
    aspect-ratio: auto;
  }

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

  .exam-answer-sheet {
    position: static;
    max-height: none;
  }

  .exam-sheet-scroll {
    overflow: visible;
  }

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

  .exam-header-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 620px) {
  .sidebar {
    display: block;
    padding: 10px 12px 8px;
  }

  .brand {
    display: none;
  }

  .nav-item {
    grid-template-columns: 19px auto auto;
    font-size: 0.78rem;
  }

  .main-area {
    padding: 0 14px 28px;
  }

  .topbar {
    min-height: 92px;
  }

  .topbar .eyebrow {
    display: none;
  }

  h1 {
    font-size: 1.35rem;
  }

  #view-root {
    padding-top: 22px;
  }

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

  .stat-item:nth-child(2) {
    border-right: 0;
  }

  .stat-item:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .overview-grid {
    gap: var(--space-lg);
  }

  .action-row {
    grid-template-columns: 40px minmax(0, 1fr) 18px;
    padding: 14px;
  }

  .resume-banner {
    grid-template-columns: 1fr;
  }

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

  .section-head,
  .wrong-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .wrong-toolbar .button {
    width: 100%;
  }

  .session-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-md);
  }

  .session-progress {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .question-stage {
    min-height: 500px;
    padding: 20px 16px 16px;
  }

  .question-kicker,
  .question-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .question-footer .session-actions {
    width: 100%;
  }

  .question-footer .button {
    flex: 1;
  }

  .option-row {
    grid-template-columns: 34px minmax(0, 1fr) 18px;
    padding: 10px;
  }

  .answer-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .result-hero {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 22px;
    text-align: center;
  }

  .result-copy .action-buttons {
    flex-wrap: wrap;
    justify-content: center;
  }

  .result-detail,
  .wrong-summary {
    grid-template-columns: 1fr;
  }

  .result-detail div,
  .wrong-summary .stat-item {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .result-detail div:last-child,
  .wrong-summary .stat-item:last-child {
    border-bottom: 0;
  }

  .setup-dialog fieldset {
    grid-template-columns: 1fr;
  }

  .exam-room-header {
    position: static;
    align-items: flex-start;
    min-height: 68px;
    padding: 10px 12px;
  }

  .exam-room-identity {
    gap: 8px;
  }

  .exam-room-identity span {
    display: none;
  }

  .exam-room-status {
    align-self: center;
  }

  .exam-progress-count,
  .exam-clock {
    min-width: 74px;
    padding: 5px 8px;
  }

  .exam-progress-count {
    display: none;
  }

  .exam-room-status span {
    font-size: 0.64rem;
  }

  .exam-type-tabs {
    top: 0;
    min-height: 50px;
    padding: 0;
  }

  .exam-type-tab {
    flex-direction: column;
    flex: 1;
    min-width: 0;
    gap: 0;
    padding: 8px 5px 6px;
  }

  .exam-type-tab span {
    font-size: 0.78rem;
  }

  .exam-room-content {
    width: calc(100% - 24px);
    padding: 12px 0 24px;
  }

  .exam-question-band {
    min-height: 68px;
    padding: 11px 14px;
  }

  .exam-question-body {
    min-height: 460px;
    padding: 20px 16px 24px;
  }

  .exam-question-body .question-text {
    font-size: 1rem;
  }

  .exam-question-footer {
    align-items: stretch;
    flex-direction: column;
    padding: 14px;
  }

  .exam-question-footer > .button {
    width: 100%;
  }

  .exam-question-footer .session-actions {
    width: 100%;
  }

  .exam-question-footer .session-actions .button {
    flex: 1;
  }

  .exam-header-submit {
    display: none;
  }

  .subjective-answer textarea {
    min-height: 180px;
    padding: 12px;
  }

  .subjective-reference {
    padding: 14px;
  }

  .subjective-reference-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .rubric-head {
    align-items: stretch;
    flex-direction: column;
  }

  .rubric-score {
    align-self: flex-end;
  }

  .rubric-row {
    grid-template-columns: 20px minmax(0, 1fr) 40px;
    gap: 8px;
  }

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

@media (max-width: 620px) {
  .nav-list {
    justify-content: flex-start;
    gap: 12px;
    overflow-x: visible;
  }

  .nav-item {
    position: relative;
    display: grid;
    grid-template-columns: 22px;
    place-items: center;
    width: 46px;
    padding: 8px;
  }

  .nav-item > span:not(.nav-badge) {
    display: none;
  }

  .nav-badge {
    position: absolute;
    margin: -26px 0 0 28px;
  }
}

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