/*
 * 考核测试 / 全册检测样式（配合 js/quiz.js）
 *
 * 命名前缀 qz- / exam- / unit-，与旧的 .quiz-* 完全隔开，互不污染。
 * 颜色一律走 style.css 里的主题变量，浅色/深色自动跟随。
 */

.qz-page,
.exam-page,
.qz-run,
.qz-result {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

.qz-kicker {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.qz-loading,
.qz-empty {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-muted);
}

/* ---------- 考核设置页 ---------- */
.qz-hero {
  margin-bottom: 2.5rem;
}

.qz-hero h2,
.exam-hero h2 {
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  line-height: 1.25;
  margin-bottom: 0.6rem;
}

.qz-hero p,
.exam-hero p {
  color: var(--text-muted);
  max-width: 62ch;
}

.qz-section {
  margin-bottom: 2.5rem;
}

.qz-section-head {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  margin-bottom: 1.1rem;
}

.qz-section-head>span {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qz-section-head h3 {
  font-size: 1.15rem;
  line-height: 1.4;
}

.qz-section-head p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.qz-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.35rem;
  background: var(--surface-subtle);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  margin-bottom: 1.2rem;
}

.qz-tab {
  flex: 1 1 auto;
  min-width: 100px;
  padding: 0.6rem 0.9rem;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.qz-tab:hover {
  color: var(--text-main);
}

.qz-tab.is-active {
  background: var(--bg-card);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.qz-scope-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.9rem;
}

.qz-scope-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.1rem 1.2rem;
  border: 2px solid var(--border-soft);
  border-radius: 14px;
  background: var(--bg-card);
  text-align: left;
  cursor: pointer;
  transition: var(--transition-smooth);
  font: inherit;
  color: var(--text-main);
}

.qz-scope-card.is-wide {
  grid-column: 1 / -1;
}

.qz-scope-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.qz-scope-card.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.qz-scope-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.qz-scope-top strong {
  font-size: 0.95rem;
}

.qz-scope-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.qz-scope-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0.85;
}

.qz-badge {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}

.qz-badge.is-empty {
  background: var(--border-soft);
  color: var(--text-muted);
}

.qz-badge.is-pass {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
}

.qz-badge.is-todo {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
}

[data-theme="dark"] .qz-badge.is-pass {
  color: #34d399;
}

[data-theme="dark"] .qz-badge.is-todo {
  color: #fbbf24;
}

/* 题型选择 */
.qz-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.8rem;
}

.qz-type {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1.1rem 1rem;
  border: 2px solid var(--border-soft);
  border-radius: 14px;
  background: var(--bg-card);
  cursor: pointer;
  text-align: left;
  transition: var(--transition-smooth);
  font: inherit;
  color: var(--text-main);
}

.qz-type:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.qz-type.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.qz-type-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.qz-type-name {
  font-weight: 700;
  font-size: 0.98rem;
}

.qz-type-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.qz-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.qz-chip {
  padding: 0.5rem 1rem;
  border: 2px solid var(--border-soft);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-main);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.qz-chip:hover {
  border-color: var(--accent);
}

.qz-chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.qz-select {
  padding: 0.45rem 0.7rem;
  border: 2px solid var(--border-soft);
  border-radius: 9px;
  background: var(--bg-card);
  color: var(--text-main);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.qz-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  cursor: pointer;
}

.qz-switch input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.qz-start-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  z-index: 20;
}

.qz-start-summary {
  display: flex;
  flex-direction: column;
}

.qz-start-summary strong {
  font-size: 1rem;
}

.qz-start-summary span {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* 错题本 */
.qz-wrong-words {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.2rem;
}

.qz-wrong-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  font-size: 0.85rem;
  font-weight: 600;
}

.qz-wrong-chip i {
  font-style: normal;
  font-size: 0.7rem;
  opacity: 0.75;
}

.qz-wrong-chip.is-more {
  background: var(--border-soft);
  color: var(--text-muted);
}

[data-theme="dark"] .qz-wrong-chip {
  color: #fca5a5;
}

.qz-wrongbook-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.8rem;
}

.qz-wrongbook-actions .qz-scope-card {
  flex: 1 1 260px;
}

.qz-clear {
  flex-shrink: 0;
  border: 1px solid var(--border-soft);
}

/* ---------- 全册检测 ---------- */
.exam-hero {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 2.5rem;
}

.exam-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin: 1.6rem 0 1rem;
}

.exam-stats div {
  display: flex;
  flex-direction: column;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-soft);
}

.exam-stats strong {
  font-size: 1.35rem;
  line-height: 1.2;
}

.exam-stats span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.exam-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--border-soft);
  overflow: hidden;
}

.exam-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #10b981);
  transition: width 0.4s ease;
}

.exam-overall {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.6rem 1.75rem;
  border-radius: 18px;
  border: 1px solid var(--border-soft);
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
  margin-bottom: 3rem;
}

.exam-overall-text {
  flex: 1 1 320px;
}

.exam-overall-text h3 {
  font-size: 1.2rem;
  margin-bottom: 0.35rem;
}

.exam-overall-text p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.exam-overall-actions {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  align-items: flex-start;
}

.exam-units-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.exam-units-head h3 {
  font-size: 1.25rem;
}

.exam-units-head p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.exam-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.exam-toolbar-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.exam-toolbar .qz-chip {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

/* 单元卡片 */
.unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  align-items: start;
}

.unit-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.4rem 1.5rem 1.25rem;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}

.unit-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.unit-card.is-passed {
  border-color: rgba(16, 185, 129, 0.45);
}

.unit-card-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.unit-no {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.unit-stage {
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.unit-score {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
  white-space: nowrap;
}

.unit-score.is-pass {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
}

.unit-score.is-empty {
  background: var(--border-soft);
  color: var(--text-muted);
}

[data-theme="dark"] .unit-score {
  color: #fbbf24;
}

[data-theme="dark"] .unit-score.is-pass {
  color: #34d399;
}

[data-theme="dark"] .unit-score.is-empty {
  color: var(--text-muted);
}

.unit-title {
  font-size: 1.05rem;
  line-height: 1.45;
}

.unit-title-en {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin-top: -0.35rem;
}

.unit-idea {
  font-size: 0.87rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.unit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  list-style: none;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.6rem 0;
  border-top: 1px dashed var(--border-soft);
  border-bottom: 1px dashed var(--border-soft);
}

.unit-meta strong {
  color: var(--text-main);
  font-size: 0.9rem;
}

.unit-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.unit-chip {
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-soft);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

.unit-chip.is-more {
  color: var(--text-muted);
  font-family: inherit;
}

.unit-detail {
  border-top: 1px solid var(--border-soft);
  padding-top: 0.7rem;
}

.unit-detail>summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  list-style: none;
}

.unit-detail>summary::-webkit-details-marker {
  display: none;
}

.unit-detail>summary::before {
  content: "\25B8\00A0";
}

.unit-detail[open]>summary::before {
  content: "\25BE\00A0";
}

.unit-detail-body {
  padding-top: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.unit-detail-block h5 {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.unit-detail-block ul {
  margin: 0;
  padding-left: 1.1rem;
}

.unit-detail-block li,
.unit-detail-block p {
  font-size: 0.83rem;
  line-height: 1.7;
  color: var(--text-main);
}

.unit-detail-block li {
  margin-bottom: 0.2rem;
}

.unit-detail-block li b {
  color: var(--accent);
}

.unit-sight-words {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.unit-sight-word {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-soft);
  font-size: 0.8rem;
  font-weight: 600;
}

.unit-sight-word i {
  font-style: normal;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
}

.unit-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 0.6rem;
}

.unit-actions .btn {
  flex: 1 1 auto;
}

/* ---------- 答题界面 ---------- */
.qz-run {
  max-width: 760px;
  margin: 0 auto;
}

.qz-runbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.qz-exit {
  border: 1px solid var(--border-soft);
  background: var(--bg-card);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.qz-exit:hover {
  color: var(--text-main);
  border-color: var(--accent);
}

.qz-runbar-meta {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.qz-scope-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 55%;
}

.qz-runbar-stats {
  display: flex;
  gap: 0.85rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.qz-runbar-stats b {
  font-variant-numeric: tabular-nums;
  color: var(--text-main);
}

.qz-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--border-soft);
  overflow: hidden;
}

.qz-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.qz-progress-text {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0.5rem 0 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.qz-type-tag {
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.qz-card {
  padding: 2rem 1.75rem;
  border-radius: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-md);
}

.qz-title {
  font-size: 1.25rem;
  line-height: 1.55;
  text-align: center;
  margin-bottom: 0.6rem;
}

.qz-word-inline {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
}

.qz-mark {
  font-style: normal;
  color: var(--phoneme-5);
  border-bottom: 3px solid var(--phoneme-5);
  padding-bottom: 1px;
}

.qz-prompt-hint {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.qz-audio-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin: 1.2rem 0 1.6rem;
}

.qz-play {
  min-width: 190px;
}

.qz-audio-tip {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.qz-sentence {
  font-size: 1.2rem;
  line-height: 2;
  text-align: center;
  padding: 1.2rem;
  border-radius: 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-soft);
  margin-bottom: 0.8rem;
}

.qz-blank {
  display: inline-block;
  min-width: 5rem;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.1em;
}

.qz-spell-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.qz-spell-meaning {
  font-size: 1.05rem;
  font-weight: 600;
}

.qz-spell-slots {
  display: flex;
  gap: 0.4rem;
}

.qz-spell-slots i {
  display: block;
  width: 20px;
  height: 3px;
  border-radius: 2px;
  background: var(--border-soft);
}

.qz-spell-count {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.qz-options {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.qz-option {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  padding: 0.95rem 1.15rem;
  border: 2px solid var(--border-soft);
  border-radius: 12px;
  background: var(--bg-card);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--text-main);
  transition: var(--transition-smooth);
}

.qz-option:not(:disabled):hover {
  border-color: var(--accent);
  transform: translateX(3px);
  box-shadow: var(--shadow-sm);
}

.qz-option:disabled {
  cursor: default;
}

.qz-option-key {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.qz-option-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.qz-option-main {
  font-size: 1.15rem;
  font-weight: 600;
}

.qz-option-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.qz-option-flag {
  flex-shrink: 0;
  width: 1.2rem;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
}

.qz-option.is-correct {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}

.qz-option.is-correct .qz-option-flag::after {
  content: "\2713";
  color: #10b981;
}

.qz-option.is-wrong {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.qz-option.is-wrong .qz-option-flag::after {
  content: "\2717";
  color: #ef4444;
}

.qz-option.is-dim {
  opacity: 0.45;
}

.qz-input-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

.qz-input {
  width: 100%;
  max-width: 380px;
  padding: 0.9rem 1.1rem;
  font-family: inherit;
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  text-align: center;
  border: 2px solid var(--border-soft);
  border-radius: 10px;
  background: var(--bg-main);
  color: var(--text-main);
  transition: var(--transition-smooth);
}

.qz-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.qz-input.is-correct {
  border-color: #10b981;
  color: #059669;
}

.qz-input.is-wrong {
  border-color: #ef4444;
  color: #dc2626;
}

[data-theme="dark"] .qz-input.is-correct {
  color: #34d399;
}

[data-theme="dark"] .qz-input.is-wrong {
  color: #fca5a5;
}

/* ---------- 判分反馈 + 讲解 ---------- */
.qz-feedback {
  margin-top: 1.5rem;
  padding: 1.15rem 1.25rem;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  border-left-width: 4px;
  background: var(--surface-subtle);
  animation: qzFadeUp 0.25s ease;
}

@keyframes qzFadeUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.qz-feedback.is-correct {
  border-left-color: #10b981;
}

.qz-feedback.is-wrong {
  border-left-color: #ef4444;
}

.qz-feedback-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}

.qz-feedback-mark {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
}

.qz-feedback.is-correct .qz-feedback-mark {
  background: #10b981;
}

.qz-feedback.is-wrong .qz-feedback-mark {
  background: #ef4444;
}

.qz-feedback-answer {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.qz-feedback-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.qz-explain {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
}

.qz-explain-word {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.qz-explain-word strong {
  font-size: 1.3rem;
  letter-spacing: 0.02em;
}

.qz-explain-meaning {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.qz-explain-play {
  align-self: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-soft);
  background: var(--surface-subtle);
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  transition: var(--transition-smooth);
}

.qz-explain-play:hover {
  border-color: var(--accent);
  transform: scale(1.08);
}

.qz-explain-breakdown {
  font-size: 1.05rem;
}

.qz-explain-rule {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.qz-explain-pattern {
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.qz-explain-ipa {
  color: var(--text-main);
  font-weight: 600;
}

.qz-explain-tip {
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-main);
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.1);
}

.qz-explain-sentence {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border-soft);
}

.qz-explain-en {
  font-size: 0.95rem;
}

.qz-explain-cn {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ---------- 成绩页 ---------- */
.qz-result {
  max-width: 820px;
  margin: 0 auto;
}

.qz-result-head {
  text-align: center;
  margin-bottom: 2.5rem;
}

.qz-score-ring {
  width: 168px;
  height: 168px;
  margin: 1.6rem auto 1.2rem;
  border-radius: 50%;
  border: 8px solid var(--ring-color, var(--accent));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.qz-score-num {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.qz-score-num i {
  font-style: normal;
  font-size: 1.2rem;
  margin-left: 2px;
}

.qz-score-grade {
  margin-top: 0.35rem;
  font-size: 1.05rem;
  color: var(--ring-color, var(--accent));
  font-weight: 600;
}

.qz-result-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.8rem;
  margin: 1.5rem 0 1rem;
}

.qz-result-stats div {
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
  border-radius: 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-soft);
}

.qz-result-stats strong {
  font-size: 1.15rem;
}

.qz-result-stats span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.qz-result-note {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.qz-result-note.is-pass {
  color: #059669;
  font-weight: 600;
}

[data-theme="dark"] .qz-result-note.is-pass {
  color: #34d399;
}

.qz-result-block {
  margin-bottom: 2.5rem;
}

.qz-result-block h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.qz-type-stats {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.qz-type-stat {
  display: grid;
  grid-template-columns: minmax(110px, auto) 1fr auto;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.qz-type-stat-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--border-soft);
  overflow: hidden;
}

.qz-type-stat-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}

.qz-type-stat-num {
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.qz-review {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.qz-review-item {
  border: 1px solid var(--border-soft);
  border-left-width: 4px;
  border-radius: 12px;
  background: var(--bg-card);
  overflow: hidden;
}

.qz-review-item.is-correct {
  border-left-color: #10b981;
}

.qz-review-item.is-wrong {
  border-left-color: #ef4444;
}

.qz-review-item>summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  cursor: pointer;
  list-style: none;
}

.qz-review-item>summary::-webkit-details-marker {
  display: none;
}

.qz-review-no {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-subtle);
  border: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.qz-review-word {
  font-size: 1.02rem;
  font-weight: 600;
}

.qz-review-type {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--surface-subtle);
}

.qz-review-mark {
  margin-left: auto;
  font-weight: 700;
}

.qz-review-item.is-correct .qz-review-mark {
  color: #10b981;
}

.qz-review-item.is-wrong .qz-review-mark {
  color: #ef4444;
}

.qz-review-body {
  padding: 0 1rem 1rem;
}

.qz-review-diff {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.7rem;
}

.qz-review-diff b {
  color: var(--text-main);
}

.qz-result-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: center;
}

.qz-result-actions .btn {
  min-width: 140px;
}

/* ---------- Toast ---------- */
#toast-container {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.qz-toast {
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  background: var(--slate-900);
  color: #fff;
  font-size: 0.88rem;
  box-shadow: var(--shadow-lg);
  animation: qzFadeUp 0.25s ease;
  transition: opacity 0.4s ease;
}

.qz-toast.is-out {
  opacity: 0;
}

[data-theme="dark"] .qz-toast {
  background: #f8fafc;
  color: #0f172a;
}

/* ---------- 窄屏 ---------- */
@media (max-width: 768px) {

  .qz-page,
  .exam-page,
  .qz-run,
  .qz-result {
    padding-top: 1.5rem;
  }

  .qz-scope-grid,
  .qz-type-grid {
    grid-template-columns: 1fr 1fr;
  }

  .qz-type {
    padding: 0.85rem 0.75rem;
  }

  .qz-type-desc {
    display: none;
  }

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

  .qz-card {
    padding: 1.35rem 1.1rem;
  }

  .qz-title {
    font-size: 1.1rem;
  }

  .qz-word-inline {
    font-size: 1.4rem;
  }

  .qz-option {
    padding: 0.85rem 0.9rem;
    gap: 0.65rem;
  }

  .qz-option-main {
    font-size: 1.02rem;
  }

  .qz-option-key {
    display: none;
  }

  .qz-start-bar {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    bottom: calc(0.75rem + env(safe-area-inset-bottom));
    border-radius: 14px;
    padding: 0.8rem 1rem;
  }

  .qz-page {
    padding-bottom: 7rem;
  }

  .exam-overall {
    padding: 1.25rem;
  }

  .exam-overall-actions {
    width: 100%;
  }

  .exam-overall-actions .btn {
    width: 100%;
  }

  .qz-result-actions {
    flex-direction: column;
  }

  .qz-result-actions .btn {
    width: 100%;
  }

  .qz-type-stat {
    grid-template-columns: 1fr auto;
  }

  .qz-type-stat-bar {
    grid-column: 1 / -1;
    order: 3;
  }
}

@media (max-width: 420px) {
  /* 范围卡片标题长，挤两列会折成四行；题型卡片只剩图标+名字，两列反而更紧凑 */
  .qz-scope-grid {
    grid-template-columns: 1fr;
  }
}

/* 打印：单元卡片直接当纸质检测清单用 */
@media print {

  .qz-start-bar,
  .unit-actions,
  .exam-toolbar,
  .exam-overall-actions {
    display: none;
  }

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

  .unit-card {
    break-inside: avoid;
    box-shadow: none;
  }
}
