/* === Student Exam Mode === */

:root {
  --L1: #6b7280;
  --L2: #3b82f6;
  --L3: #8b5cf6;
  --L5: #f59e0b;
  --L6: #ef4444;
}

/* -- Top bar with logout -- */
.exam-top-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0;
}
.exam-top-bar h1 {
  margin: 0;
}
.exam-logout-btn {
  margin-top: 8px;
  padding: 6px 20px;
  background: var(--red, #e74c3c);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.exam-logout-btn:hover {
  opacity: 1;
}

/* -- Exam select screen -- */
.exam-select {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.exam-select h1 {
  text-align: center;
  margin-bottom: 10px;
  font-size: 28px;
}
.exam-select-subtitle {
  text-align: center;
  color: var(--text2);
  margin-bottom: 24px;
  font-size: 15px;
}
.exam-year-group {
  margin-bottom: 24px;
}
.exam-year-label {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--text);
}
.exam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.exam-card {
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  cursor: pointer;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.exam-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(108, 140, 255, 0.15);
}
.exam-card-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 6px;
}
.exam-card-meta {
  font-size: 13px;
  color: var(--text2);
}
.exam-catalog-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(120px, auto)) auto auto;
  gap: 8px;
  align-items: center;
  margin: 0 auto 10px;
}
.exam-catalog-search,
.exam-catalog-select {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--text);
  font: inherit;
}
.exam-catalog-chip {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
}
.exam-catalog-chip:hover,
.exam-catalog-chip.active {
  border-color: var(--accent);
  background: rgba(108, 140, 255, 0.1);
  color: var(--accent);
}
.exam-catalog-count,
.exam-catalog-empty {
  text-align: center;
  color: var(--text2);
  font-size: 13px;
  margin-bottom: 18px;
}

/* -- Region two-column layout -- */
.exam-region-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.exam-region-col {
  min-width: 0;
}
.exam-region-header {
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  color: var(--text);
}
.exam-region-count {
  font-weight: 400;
  font-size: 14px;
  color: var(--text2);
}
@media (max-width: 700px) {
  .exam-region-row {
    grid-template-columns: 1fr;
  }
  .exam-catalog-tools {
    grid-template-columns: 1fr 1fr;
  }
  .exam-catalog-search {
    grid-column: 1 / -1;
  }
}

/* -- Mode toggle -- */
.exam-mode-bar {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}
.exam-mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 24px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: none;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s;
  min-width: 200px;
}
.exam-mode-btn:hover {
  border-color: var(--accent);
}
.exam-mode-btn.active {
  border-color: var(--accent);
  background: rgba(108, 140, 255, 0.08);
}
.exam-mode-btn-label {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}
.exam-mode-btn-desc {
  font-size: 11px;
  color: var(--text2);
}

.exam-resume-card {
  max-width: 640px;
  margin: 0 auto 20px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  display: grid;
  gap: 8px;
}
.exam-resume-title {
  font-weight: 700;
}
.exam-resume-meta {
  color: var(--text2);
  font-size: 13px;
}
.exam-resume-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* -- Dashboard button -- */
.exam-dashboard-btn {
  display: block;
  margin: 0 auto 24px;
}

/* -- Intro screen -- */
.exam-intro {
  max-width: 680px;
  margin: 50px auto;
  text-align: center;
  padding: 0 20px;
}
.exam-intro h1 {
  font-size: 26px;
  margin-bottom: 14px;
}
.exam-intro-rules {
  text-align: left;
  margin: 24px 0;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text2);
}
.exam-intro-rules li {
  margin-bottom: 8px;
}
.exam-start-btn {
  padding: 14px 48px;
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  background: var(--accent, #6c8cff);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s;
}
.exam-start-btn:hover {
  opacity: 0.85;
}

/* -- Exam top bar -- */
.exam-topbar {
  position: sticky;
  top: 48px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  flex-wrap: wrap;
}
.exam-timer {
  font-weight: 700;
  font-family: ui-monospace, monospace;
  font-size: 20px;
}
.exam-timer.warn {
  color: #e74c3c;
}
.exam-timer.overtime {
  color: #c2410c;
}
.exam-progress {
  color: var(--text2);
  font-size: 14px;
  margin-right: auto;
}

/* Font controls */
.exam-font-ctrl {
  display: flex;
  gap: 2px;
}
.exam-font-btn {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
}
.exam-font-btn:hover {
  background: var(--bg);
}

/* Star bookmark */
.exam-star-btn {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: var(--text2);
  transition: color 0.15s;
}
.exam-star-btn.active {
  color: #f1c40f;
  border-color: #f1c40f;
}
.exam-star-btn:hover {
  color: #f1c40f;
}

/* Nav/Calc toggle buttons */
.exam-nav-toggle {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--text2);
}
.exam-nav-toggle:hover {
  background: var(--bg);
}
.exam-nav-toggle.active {
  border-color: var(--accent);
  background: rgba(108, 140, 255, 0.1);
  color: var(--accent);
}
.exam-annotation-toggle {
  min-width: 142px;
}

/* -- Dual pane -- */
.exam-panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - 48px - 44px - 52px);
}
.exam-passage-pane {
  padding: 24px 28px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  max-height: calc(100vh - 144px);
  line-height: 1.8;
  font-size: 16px;
  position: relative;
}
.exam-passage-pane .passage-text {
  white-space: pre-wrap;
}
.exam-passage-pane .passage-text.annotation-mode-on {
  cursor: text;
  -webkit-user-select: text;
  user-select: text;
}
.exam-passage-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text3, #888);
  font-style: italic;
}
.exam-passage-pane.line-reader-on {
  --reader-y: 90px;
}
.exam-line-reader-band {
  position: absolute;
  left: 16px;
  right: 16px;
  top: calc(var(--reader-y) - 23px);
  height: 46px;
  border: 1px solid rgba(108, 140, 255, 0.45);
  border-radius: 6px;
  background: rgba(108, 140, 255, 0.08);
  box-shadow:
    0 -999px 0 999px rgba(15, 23, 42, 0.08),
    0 999px 0 999px rgba(15, 23, 42, 0.08);
  pointer-events: none;
  z-index: 2;
}
.exam-question-pane {
  padding: 24px 28px;
  overflow-y: auto;
  max-height: calc(100vh - 144px);
}
.exam-q-number {
  font-weight: 700;
  font-size: inherit;
  color: var(--accent);
  margin-bottom: 14px;
}
.exam-q-text {
  font-size: inherit;
  line-height: 1.7;
  margin-bottom: 24px;
}
.exam-q-image {
  max-width: 100%;
  margin: 14px 0;
  border-radius: 6px;
}

/* Word marking & highlighting */
.exam-word-mark {
  background: #fff3cd;
  border-radius: 2px;
  padding: 0 2px;
}
.passage-text span[data-mark-id] {
  border-radius: 2px;
  padding: 0 1px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.user-mark-yellow {
  background-color: #F0E68C;
  --user-mark-color: #F0E68C;
  --user-mark-line-color: #333333;
}
.user-mark-pink {
  background-color: #FFDDFF;
  --user-mark-color: #FFDDFF;
  --user-mark-line-color: #333333;
}
.user-mark-blue {
  background-color: #99CCFF;
  --user-mark-color: #99CCFF;
  --user-mark-line-color: #333333;
}
.user-mark-solid {}
.user-mark-underline {
  background: none;
  border-bottom: 2px solid var(--user-mark-line-color, currentColor);
  padding-bottom: 1px;
}
.user-mark-strike {
  background: none;
  text-decoration: line-through;
  text-decoration-color: var(--user-mark-line-color, currentColor);
  text-decoration-thickness: 2px;
}
.user-mark-squiggle {
  background: none;
  text-decoration: underline wavy;
  text-decoration-color: var(--user-mark-line-color, currentColor);
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}
.annotation-note-panel {
  margin: 16px 12px 12px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fafafa;
}
.annotation-note-panel-title {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
}
.annotation-reflection {
  margin-bottom: 12px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-left: 3px solid #6366f1;
  border-radius: 6px;
}
.annotation-reflection-label {
  font-size: 11px;
  font-weight: 700;
  color: #4338ca;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}
.annotation-reflection-input {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 6px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  outline: none;
  resize: vertical;
  background: #fff;
  color: #1f2937;
  font-size: 14px;
  line-height: 1.5;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.annotation-reflection-input:focus {
  border-color: #6366f1;
}
.annotation-reflection-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 8px;
}
.annotation-reflection-chip {
  background: #fff;
  color: #1f2937;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.4;
  transition: all 0.15s;
}
.annotation-reflection-chip:hover {
  border-color: #6366f1;
  color: #4338ca;
}
.annotation-reflection-chip.is-active {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
}
.annotation-reflection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  justify-content: flex-end;
}
.annotation-reflection-report-btn,
.annotation-reflection-clear-btn {
  background: #fff;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.annotation-reflection-report-btn:hover {
  border-color: #6366f1;
  color: #4338ca;
}
.annotation-reflection-clear-btn {
  color: #b91c1c;
  border-color: #fecaca;
}
.annotation-reflection-clear-btn:hover {
  background: #fef2f2;
  border-color: #ef4444;
}
/* Minimal mode (during exam): only title + per-highlight cards. */
.annotation-note-panel-minimal .annotation-reflection,
.annotation-note-panel-minimal .annotation-reflection-actions {
  display: none;
}
.annotation-note-panel-empty {
  margin: 12px 8px;
  padding: 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  color: #64748b;
  font-size: 13px;
  text-align: center;
}
.annotation-error-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.annotation-error-tag {
  padding: 3px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  font-family: inherit;
}
.annotation-error-tag:hover {
  border-color: #6366f1;
  color: #4338ca;
}
.annotation-error-tag.active {
  background: #6366f1;
  border-color: #6366f1;
  color: #fff;
}
.annotation-feedback-row {
  margin-top: 8px;
  text-align: right;
}
.annotation-feedback-btn {
  padding: 4px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.annotation-feedback-btn:hover {
  border-color: #f59e0b;
  color: #b45309;
  background: #fffbeb;
}

.annotation-feedback-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.annotation-feedback-dialog {
  width: min(480px, 100%);
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
}
.annotation-feedback-title {
  font-size: 16px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 12px;
}
.annotation-feedback-types {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.annotation-feedback-type {
  padding: 4px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.annotation-feedback-type:hover {
  border-color: #f59e0b;
}
.annotation-feedback-type.active {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #fff;
}
.annotation-feedback-textarea {
  display: block;
  width: 100%;
  min-height: 96px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  outline: none;
  resize: vertical;
  background: #fff;
  color: #1f2937;
  font-size: 14px;
  line-height: 1.5;
  font-family: inherit;
  box-sizing: border-box;
  margin-bottom: 12px;
}
.annotation-feedback-textarea:focus {
  border-color: #f59e0b;
}
.annotation-feedback-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.annotation-feedback-cancel,
.annotation-feedback-submit {
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.annotation-feedback-cancel {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
}
.annotation-feedback-cancel:hover {
  background: #f8fafc;
}
.annotation-feedback-submit {
  border: 1px solid #f59e0b;
  background: #f59e0b;
  color: #fff;
}
.annotation-feedback-submit:hover {
  background: #d97706;
  border-color: #d97706;
}
.annotation-feedback-submit:disabled {
  background: #94a3b8;
  border-color: #94a3b8;
  cursor: default;
}

.annotation-review-panel {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fafafa;
}
.annotation-review-panel-title {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 10px;
}
.annotation-review-reflection-label {
  font-size: 11px;
  font-weight: 700;
  color: #4338ca;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}
.annotation-review-reflection-input {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 6px 8px;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #6366f1;
  border-radius: 4px;
  outline: none;
  resize: vertical;
  background: #fff;
  color: #1f2937;
  font-size: 13px;
  line-height: 1.5;
  font-family: inherit;
  box-sizing: border-box;
  margin-bottom: 12px;
}
.annotation-review-reflection-input:focus {
  border-color: #6366f1;
}
.annotation-review-card {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  margin-bottom: 8px;
  overflow: hidden;
}
.annotation-review-card:last-child {
  margin-bottom: 0;
}
.annotation-review-card-snippet {
  padding: 7px 10px;
  background: #fff7d6;
  color: #5b4500;
  font-size: 12px;
  font-weight: 600;
  border-bottom: 1px solid #e2e8f0;
}
.annotation-review-card-input {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 6px 10px;
  border: none;
  outline: none;
  resize: vertical;
  background: #fff;
  color: #1f2937;
  font-size: 13px;
  line-height: 1.5;
  font-family: inherit;
  box-sizing: border-box;
}
.annotation-review-card-input:focus {
  background: #fffdf5;
}
.annotation-review-legacy {
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  color: #1f2937;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.annotation-note-card {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
  margin-bottom: 8px;
}
.annotation-note-card:last-child {
  margin-bottom: 0;
}
.annotation-note-card-snippet-row {
  display: flex;
  align-items: stretch;
  background: #fff7d6;
  border-bottom: 1px solid #e2e8f0;
}
.annotation-note-card-snippet {
  flex: 1;
  padding: 8px 10px;
  color: #5b4500;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.annotation-note-card-snippet:hover {
  background: #fef08a;
}
.annotation-note-card-delete {
  flex: 0 0 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-left: 1px solid #e2e8f0;
  background: transparent;
  color: #94a3b8;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.annotation-note-card-delete:hover {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}
.annotation-note-card-input {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 8px 10px;
  border: none;
  outline: none;
  resize: vertical;
  background: #fff;
  color: #1f2937;
  font-size: 14px;
  line-height: 1.5;
  font-family: inherit;
  box-sizing: border-box;
}
.annotation-note-card-input:focus {
  background: #fffdf5;
}
@keyframes user-mark-flash-anim {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 0 3px #fbbf24; }
}
.user-mark-flash {
  animation: user-mark-flash-anim 1.2s ease-in-out;
  border-radius: 2px;
}
.exam-hl-underline {
  border-bottom: 2px solid var(--accent, #6c8cff);
}

.highlight-note-popover {
  position: absolute;
  z-index: 1110;
  width: min(200px, calc(100vw - 24px));
  background: #fff;
  border: 1px solid #909399;
  border-radius: 4px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}
.highlight-note-preview {
  display: grid;
  grid-template-columns: 1fr 20px;
  gap: 8px;
  align-items: start;
  min-height: 64px;
  padding: 10px 10px 6px;
  background: #f9fafb;
}
.highlight-note-snippet {
  color: #3f4a5a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.28;
  background: linear-gradient(transparent 56%, #F0E68C 56%);
}
.highlight-note-delete {
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  background: transparent;
  color: #909399;
  cursor: pointer;
}
.highlight-note-input {
  width: 100%;
  min-height: 46px;
  box-sizing: border-box;
  padding: 8px 10px 10px;
  border: none;
  border-top: 1px solid #dcdfe6;
  resize: none;
  background: #fff;
  color: #606266;
  font: inherit;
  line-height: 1.25;
}

/* Highlight popup */
.highlight-popup {
  position: absolute;
  /* Above .dash-preview-overlay (z-index 1000) so the popup floats over the
     Wrong tab carousel modal — otherwise it's painted behind the dark
     backdrop and looks like nothing happened. */
  z-index: 1100;
  width: 306px;
  height: 58px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  background: #fff;
  border: 1px solid #dcdfe6;
  border-radius: 29px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.16);
}
.highlight-popup button {
  appearance: none;
  font: inherit;
}
.highlight-popup-swatch,
.highlight-popup-icon-btn,
.highlight-style-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0;
  cursor: pointer;
}
.highlight-popup-swatch {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(96, 98, 102, 0.22);
  border-radius: 999px;
  color: #606266;
}
.highlight-popup-swatch-yellow {
  background: #F0E68C;
}
.highlight-popup-swatch-pink {
  background: #FFDDFF;
}
.highlight-popup-swatch-blue {
  background: #99CCFF;
}
.highlight-popup-swatch:hover {
  box-shadow: 0 0 0 2px rgba(96, 98, 102, 0.1);
}
.highlight-popup-icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid #dcdfe6;
  border-radius: 999px;
  background: #fff;
  color: #606266;
}
.highlight-popup-icon-btn:hover {
  background: #f5f7fa;
}
.highlight-popup-svg {
  width: 18px;
  height: 18px;
  display: block;
}
.highlight-style-dropdown {
  position: relative;
  flex: 0 0 48px;
}
.highlight-style-trigger {
  width: 48px;
  height: 40px;
  border: none;
  background: transparent;
  border-radius: 18px;
  color: #606266;
  font-size: 22px;
  font-weight: 400;
  gap: 4px;
}
.highlight-style-trigger:hover {
  background: #f5f7fa;
}
.highlight-style-trigger-solid {}
.highlight-style-trigger-underline {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 2px;
}
.highlight-style-trigger-strike {
  text-decoration: underline;
  text-decoration-style: dashed;
  text-decoration-thickness: 2px;
}
.highlight-style-trigger-squiggle {
  text-decoration: none;
}
.highlight-style-chevron {
  width: 14px;
  height: 14px;
}
.highlight-style-dropdown-menu {
  position: absolute;
  z-index: 1120;
  top: 46px;
  left: -12px;
  display: none;
  min-width: 124px;
  padding: 6px;
  background: #fff;
  border: 1px solid #dcdfe6;
  border-radius: 12px;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.18);
}
.highlight-style-dropdown-menu.open {
  display: grid;
  gap: 4px;
}
.highlight-style-option {
  min-height: 32px;
  padding: 0 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #606266;
  text-align: left;
  cursor: pointer;
}
.highlight-style-option:hover {
  background: #f5f7fa;
}
.highlight-style-option-dotted {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 2px;
}
.highlight-style-option-dashed {
  text-decoration: underline;
  text-decoration-style: dashed;
  text-decoration-thickness: 2px;
}
.highlight-style-option-none {
  text-decoration: none;
}

.exam-question-header {
  display: flex;
  align-items: stretch;
  width: 100%;
  margin-bottom: 22px;
}
.exam-q-number-badge {
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
  background: #111;
  color: #fff;
  font-weight: 700;
}
.exam-q-stem {
  flex: 1;
  padding: 10px 12px;
  background: #f1f5f9;
  color: #1f2937;
  border-bottom: 1px dashed #e2e8f0;
  text-align: left;
}
.exam-q-stem .exam-q-text {
  margin-bottom: 0;
}
.exam-crossout-toggle {
  flex: 0 0 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 0;
  border-bottom: 1px dashed #e2e8f0;
  background: #f1f5f9;
  cursor: pointer;
}
.exam-crossout-toggle:hover,
.exam-crossout-toggle.active {
  background: #e2e8f0;
}
.exam-crossout-toggle-img {
  width: 49px;
  height: 27px;
  display: block;
}

/* -- Choices -- */
.exam-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.exam-choice-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.exam-choice {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition:
    border-color 0.12s,
    background 0.12s;
  font-size: inherit;
  line-height: 1.6;
}
.exam-choice:hover {
  border-color: var(--accent);
  background: rgba(108, 140, 255, 0.04);
}
.exam-choice.selected {
  border-color: var(--accent);
  background: rgba(108, 140, 255, 0.1);
}
.exam-choice.eliminated {
  position: relative;
  color: #d1d5db;
  border-color: var(--border);
  background: none;
  cursor: default;
}
.exam-choice.eliminated:hover {
  border-color: var(--border);
  background: none;
}
.exam-choice.eliminated.selected {
  border-color: var(--accent);
  color: #d1d5db;
}
.exam-choice-label {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--border);
  font-weight: 700;
  font-size: 14px;
}
.exam-choice.selected .exam-choice-label {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.exam-choice-text {
  padding-top: 4px;
}
.exam-crossout-line {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 50%;
  width: calc(100% - 24px);
  height: 1px;
  transform: translateY(-50%);
  pointer-events: none;
}
.exam-crossout-slot {
  flex: 0 0 40px;
  width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.exam-crossout-choice-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.exam-crossout-choice-img {
  width: 34px;
  max-height: 40px;
  display: block;
}
.exam-crossout-choice-btn[title^="Restore"] .exam-crossout-choice-img {
  width: 40px;
}

/* -- Bottom bar -- */
.exam-bottombar {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--card);
  border-top: 1px solid var(--border);
}
.exam-bottombar-btns {
  display: flex;
  gap: 10px;
}
.exam-time-spent {
  font-size: 12px;
  color: var(--text3, #888);
}
.exam-btn {
  padding: 10px 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: none;
  cursor: pointer;
  font-size: 15px;
  color: var(--text);
  transition: background 0.12s;
}
.exam-btn:hover {
  background: var(--bg);
}
.exam-btn-sm {
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--accent);
  white-space: nowrap;
}
.exam-btn-sm:hover {
  background: var(--bg);
}
.exam-btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.exam-btn.primary:hover {
  opacity: 0.85;
}
.exam-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* -- Nav grid overlay -- */
.exam-nav-grid-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.exam-nav-grid-panel {
  background: var(--card);
  border-radius: 12px;
  padding: 24px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.exam-nav-grid-title {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 8px;
}
.exam-nav-legend {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text2);
  margin-bottom: 12px;
}
.exam-nav-grid {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 6px;
}
.exam-nav-dot {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.12s;
}
.exam-nav-dot:hover {
  border-color: var(--accent);
}
.exam-nav-dot.answered {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.exam-nav-dot.current {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.exam-nav-dot.bookmarked {
  box-shadow: inset 0 -3px 0 #f1c40f;
}

/* -- Check Your Work -- */
.exam-check {
  max-width: 640px;
  margin: 50px auto;
  text-align: center;
  padding: 0 20px;
}
.exam-check h1 {
  font-size: 30px;
  margin-bottom: 14px;
}
.exam-check-subtitle {
  color: var(--text2);
  font-size: 15px;
  margin-bottom: 24px;
  line-height: 1.7;
}
.exam-check-section {
  margin-bottom: 16px;
  font-weight: 600;
  font-size: 16px;
}
.exam-check-grid {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 6px;
  max-width: 400px;
  margin: 0 auto 32px;
}
.exam-check-dot {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
}
.exam-check-dot.answered {
  background: var(--text2);
  color: #fff;
  border-color: var(--text2);
}
.exam-check-dot.bookmarked {
  box-shadow: inset 0 -3px 0 #f1c40f;
}

/* -- Adaptive recommendation -- */
.exam-adaptive-card {
  margin: 20px auto 24px;
  padding: 16px 20px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: rgba(108, 140, 255, 0.05);
  max-width: 420px;
}
.exam-adaptive-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 8px;
}
.exam-adaptive-accuracy {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}
.exam-adaptive-reason {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 4px;
}
.exam-adaptive-source {
  font-size: 13px;
  font-weight: 600;
}
.exam-adaptive-fallback {
  font-size: 13px;
  color: var(--text2);
  font-style: italic;
}

/* -- Score Report -- */
.exam-report {
  max-width: 800px;
  margin: 40px auto;
  padding: 0 20px;
}
.exam-report h1 {
  text-align: center;
  font-size: 30px;
  margin-bottom: 10px;
}
.exam-report-mode {
  display: block;
  width: fit-content;
  margin: 0 auto 8px;
  padding: 3px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(108, 140, 255, 0.1);
  color: var(--accent);
}
.exam-report-adaptive-info {
  text-align: center;
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 12px;
}
.exam-report-score {
  text-align: center;
  font-size: 56px;
  font-weight: 800;
  color: var(--accent);
  margin: 16px 0 4px;
}
.exam-report-score-clickable {
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s, color 0.1s;
}
.exam-report-score-clickable:hover {
  transform: scale(1.04);
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
}
.exam-report-score-clickable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 6px;
}
.exam-report-max {
  text-align: center;
  color: var(--text2);
  font-size: 15px;
  margin-bottom: 24px;
}
.exam-report-score-mode-box {
  margin: 0 auto 18px;
  max-width: 720px;
}
.exam-report-score-label {
  text-align: center;
  color: var(--text2);
  font-size: 13px;
}
.exam-report-score-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.exam-score-select {
  min-height: 38px;
  min-width: 180px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--text);
  font: inherit;
}
.exam-report-score-note {
  margin-top: 10px;
  text-align: center;
  color: var(--text2);
  font-size: 13px;
}
.exam-report-summary {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.exam-report-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
}
.exam-report-card-label {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 6px;
}
.exam-report-card-value {
  font-size: 28px;
  font-weight: 700;
}
.exam-report-card-sub {
  font-size: 12px;
  color: var(--text3, #888);
  margin-top: 4px;
}
.exam-report-comment {
  text-align: center;
  padding: 16px;
  background: rgba(108, 140, 255, 0.06);
  border-radius: 8px;
  margin-bottom: 24px;
  font-size: 15px;
  line-height: 1.6;
}
.exam-report-actions {
  text-align: center;
  margin-top: 24px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Tags (bookmarks, words) */
.exam-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}
.exam-tag {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(108, 140, 255, 0.08);
  color: var(--accent);
}
.exam-tag.word {
  background: #fff3cd;
  color: #856404;
}
.exam-tag.overtime {
  background: rgba(249, 115, 22, 0.14);
  color: #c2410c;
}

/* Detail table */
.exam-detail-heading {
  font-weight: 700;
  font-size: 16px;
  margin: 24px 0 12px;
}
.exam-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.exam-detail-table th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  color: var(--text2);
}
.exam-detail-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.exam-detail-table tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}
.exam-detail-correct {
  color: #27ae60;
  font-weight: 600;
}
.exam-detail-wrong {
  color: #e74c3c;
  font-weight: 600;
}
.exam-detail-empty {
  color: var(--text3, #888);
}
.exam-detail-time {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: var(--text2);
}
.exam-detail-overtime {
  color: #c2410c;
  font-weight: 600;
}

/* -- Student name input -- */
.exam-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 20px 0;
}
.exam-name-label {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}
.exam-name-input {
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
  width: 240px;
  background: var(--bg, #f8f8f8);
  transition: border-color 0.15s;
}
.exam-name-input:focus {
  border-color: var(--accent);
  outline: none;
}

/* -- Pause overlay -- */
.exam-pause-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.exam-pause-panel {
  background: var(--card, #fff);
  border-radius: 16px;
  padding: 40px 48px;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}
.exam-pause-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.6;
}
.exam-pause-text {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text);
}
.exam-pause-btn {
  font-size: 18px;
  padding: 4px 10px;
}

/* -- Trajectory timeline -- */
.exam-traj-wrap {
  position: relative;
  height: 32px;
  margin: 12px 0;
  background: rgba(108, 140, 255, 0.06);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.exam-traj-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.exam-traj-dot.traj-normal {
  background: var(--accent, #6c8cff);
}
.exam-traj-dot.traj-back {
  background: #e74c3c;
}
.exam-traj-dot.traj-change {
  background: #f39c12;
  width: 10px;
  height: 10px;
}
.exam-traj-dot.traj-mod {
  background: #27ae60;
  width: 12px;
  height: 12px;
}
.exam-traj-legend {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text2);
  margin: 8px 0;
}
.exam-traj-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.exam-traj-legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.exam-traj-legend-dot.traj-normal {
  background: var(--accent, #6c8cff);
}
.exam-traj-legend-dot.traj-back {
  background: #e74c3c;
}
.exam-traj-legend-dot.traj-change {
  background: #f39c12;
}
.exam-traj-legend-dot.traj-mod {
  background: #27ae60;
}
.exam-traj-stats {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 16px;
}

/* -- Expandable wrong question explanation -- */
.exam-detail-expandable {
  cursor: pointer;
}
.exam-detail-expandable:hover {
  background: rgba(231, 76, 60, 0.04);
}
.exam-detail-expandable.expanded {
  background: rgba(231, 76, 60, 0.06);
}
.exam-detail-exp-row td {
  padding: 0 !important;
  border-bottom: 2px solid var(--border);
}
.exam-detail-exp {
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.02);
  border-left: 3px solid #e74c3c;
  margin: 0;
}
.exam-exp-passage {
  background: var(--bg, #f8f8f8);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text2);
  margin-bottom: 10px;
  white-space: pre-wrap;
}
.exam-exp-question {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.5;
}
.exam-exp-choice {
  font-size: 13px;
  padding: 3px 8px;
  margin: 2px 0;
  border-radius: 4px;
}
.exam-exp-correct {
  background: rgba(39, 174, 96, 0.1);
  color: #27ae60;
  font-weight: 600;
}
.exam-exp-wrong {
  background: rgba(231, 76, 60, 0.1);
  color: #e74c3c;
}
.exam-exp-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 12px;
  margin-bottom: 4px;
  text-transform: uppercase;
}
.exam-exp-text {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text2);
  margin-bottom: 4px;
}

/* -- Attention heatmap -- */
.exam-heatmap-label {
  font-weight: 600;
  font-size: 14px;
  margin: 12px 0 6px;
  color: var(--text);
}
.exam-heatmap-canvas {
  border: 1px solid var(--border);
  border-radius: 6px;
  display: block;
  margin-bottom: 12px;
}

/* -- Student image upload -- */
.exam-student-img-section {
  margin-top: 16px;
}
.exam-img-upload-btn {
  padding: 6px 14px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  background: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--text2);
  transition:
    border-color 0.15s,
    color 0.15s;
}
.exam-img-upload-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.exam-img-thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.exam-img-thumb-wrap {
  position: relative;
  display: inline-block;
}
.exam-img-thumb {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s;
}
.exam-img-thumb:hover {
  border-color: var(--accent);
}
.exam-img-del {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: #e74c3c;
  color: #fff;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  padding: 0;
}
.exam-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

/* -- Leave button in top bar -- */
.exam-leave-topbar {
  padding: 4px 14px;
  border: 1px solid rgba(231, 76, 60, 0.4);
  border-radius: 14px;
  background: rgba(231, 76, 60, 0.08);
  color: #e74c3c;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
  white-space: nowrap;
}
.exam-leave-topbar:hover {
  background: rgba(231, 76, 60, 0.18);
  border-color: #e74c3c;
}

/* -- Leave confirm overlay -- */
.exam-leave-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.exam-leave-panel {
  background: var(--card, #fff);
  border-radius: 14px;
  padding: 32px 36px;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
  max-width: 380px;
}
.exam-leave-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}
.exam-leave-msg {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 24px;
}
.exam-leave-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.exam-leave-confirm {
  background: #e74c3c !important;
  color: #fff !important;
  border-color: #e74c3c !important;
}
.exam-leave-confirm:hover {
  opacity: 0.85;
}

/* -- Question navigator dropdown (bottom bar center) -- */
.exam-qnav-wrap {
  position: relative;
}
.exam-qnav-toggle {
  padding: 10px 18px;
  border: 1px solid #111827;
  border-radius: 4px;
  background: #000;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.exam-qnav-toggle:hover {
  background: #1f2937;
}
.exam-qnav-panel {
  position: absolute;
  bottom: 58px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card, #fff);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 16px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
  z-index: 2010;
  width: min(600px, calc(100vw - 32px));
}
.exam-qnav-grid {
  height: 200px;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 12px 16px;
}
.exam-qnav-dot {
  width: 32px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  background: #fff;
  color: var(--text);
  transition: all 0.12s;
}
.exam-qnav-dot:hover {
  color: #c2410c;
  border-color: #fed7aa;
}
.exam-qnav-dot.answered {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.exam-qnav-dot.current {
  background: #000;
  border-color: #000;
  color: #fff;
}
.exam-qnav-dot.bookmarked {
  box-shadow: inset 0 -3px 0 #f1c40f;
}
.exam-qnav-panel .el-popper__arrow {
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transform: translateX(-50%) rotate(45deg);
}

/* -- Dual-pane review in report -- */
.exam-review-panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-height: 200px;
}
.exam-review-left {
  padding: 16px 20px;
  border-right: 1px solid var(--border);
  line-height: 1.8;
  font-size: 15px;
  max-height: 400px;
  overflow-y: auto;
}
.exam-review-passage {
  white-space: pre-wrap;
}
.annotation-review-note {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.1);
}
.annotation-review-note-title {
  margin-bottom: 5px;
  color: var(--text2, #475569);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.annotation-review-note-body {
  color: var(--text, #111827);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.exam-review-no-passage {
  color: var(--text3, #888);
  font-style: italic;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.exam-review-right {
  padding: 16px 20px;
  max-height: 400px;
  overflow-y: auto;
}
.exam-review-qnum {
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
}
.exam-review-type {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-bottom: 10px;
  padding: 2px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--text2);
  font-size: 12px;
  font-weight: 600;
}
.exam-review-qtext {
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 16px;
}
.exam-review-choices {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.exam-review-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
}
.exam-review-choice.review-correct {
  background: rgba(39, 174, 96, 0.1);
  border-color: #27ae60;
}
.exam-review-choice.review-wrong {
  background: rgba(231, 76, 60, 0.1);
  border-color: #e74c3c;
  opacity: 0.7;
}
.exam-review-choice.review-correct.review-wrong {
  text-decoration: none;
  opacity: 1;
}
.exam-review-choice-label {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--border);
  font-weight: 700;
  font-size: 12px;
}
.review-correct .exam-review-choice-label {
  background: #27ae60;
  color: #fff;
  border-color: #27ae60;
}
.review-wrong .exam-review-choice-label {
  background: #e74c3c;
  color: #fff;
  border-color: #e74c3c;
}
.review-correct.review-wrong .exam-review-choice-label {
  background: #27ae60;
  border-color: #27ae60;
}
.exam-review-exp-toggle {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(108, 140, 255, 0.06);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 8px;
}
.exam-review-exp-toggle:hover {
  background: rgba(108, 140, 255, 0.12);
}
.exam-review-exp-content {
  margin-top: 8px;
}
@media (max-width: 768px) {
  .exam-review-panes {
    grid-template-columns: 1fr;
  }
  .exam-review-left {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 200px;
  }
}

/* -- Print styles -- */
@media print {
  .exam-topbar,
  .exam-bottombar,
  .exam-report-actions,
  .exam-nav-toggle,
  .exam-star-btn,
  .exam-font-ctrl {
    display: none !important;
  }
  .exam-panes {
    display: block;
  }
  .exam-passage-pane,
  .exam-question-pane {
    max-height: none;
    overflow: visible;
  }
}

/* -- Mobile -- */
@media (max-width: 768px) {
  .exam-panes {
    grid-template-columns: 1fr;
  }
  .exam-passage-pane {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 40vh;
  }
  .exam-question-pane {
    max-height: none;
  }
  .exam-topbar {
    top: 44px;
    gap: 6px;
    padding: 6px 10px;
  }
  .exam-nav-grid {
    grid-template-columns: repeat(9, 1fr);
  }
  .exam-check-grid {
    grid-template-columns: repeat(9, 1fr);
  }
  .exam-report-summary {
    grid-template-columns: 1fr;
  }
  .exam-mode-bar {
    flex-direction: column;
    align-items: center;
  }
  .exam-mode-btn {
    min-width: 260px;
  }
  .exam-report-actions {
    flex-direction: column;
  }
}

/* GRFL Difficulty Badges */
.grfl-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
}
.grfl-badge.grfl-1 {
  background: #22c55e22;
  color: #22c55e;
}
.grfl-badge.grfl-2 {
  background: #3b82f622;
  color: #3b82f6;
}
.grfl-badge.grfl-3 {
  background: #f59e0b22;
  color: #f59e0b;
}
.grfl-badge.grfl-4 {
  background: #f9731622;
  color: #f97316;
}
.grfl-badge.grfl-5 {
  background: #ef444422;
  color: #ef4444;
}
.grfl-dims {
  display: inline-flex;
  gap: 3px;
  margin-left: 4px;
}
.grfl-dim {
  display: inline-block;
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
}
.grfl-dim.dim-G {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}
.grfl-dim.dim-R {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}
.grfl-dim.dim-F {
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
}
.grfl-dim.dim-L {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}
.grfl-dim.dim-off {
  opacity: 0.2;
}
.grfl-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.grfl-panel-label {
  font-size: 11px;
  color: var(--muted, #888);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── T1 字体 token 应用规则 ── */

/* Passage 正文区域 */
.passage-text,
.passage-content,
.reading-passage,
[class*="passage"] p {
  font-family: var(--font-passage);
  font-size: var(--fs-passage);
  line-height: 1.75;
}

/* 题干 */
.question-stem,
.stem,
[class*="stem"] {
  font-family: var(--font-stem);
  font-size: var(--fs-stem);
  line-height: 1.6;
}

/* 选项文字 */
.option-text,
.choice-text,
.answer-option .text {
  font-family: var(--font-ui);
  font-size: var(--fs-option);
}

/* 等宽/代码区块 */
.math-display,
pre,
code,
.equation {
  font-family: var(--font-mono);
}

/* 主题色应用 */
.btn-primary,
.option-selected .option-letter,
[class*="selected"] .letter {
  background-color: var(--exam-primary);
  color: #fff;
}

.btn-primary:hover {
  background-color: var(--exam-primary-hover);
}

/* ── Inline math calculator + reference sheet ── */
.passage-column-frame {
  display: flex;
  min-height: 430px;
  border-right: 2px solid #e5e7eb;
}

.exam-inline-calc-frame {
  width: 100%;
}

.exam-inline-calc-inner {
  width: 100%;
  padding: 16px;
  box-sizing: border-box;
}

.exam-inline-calc-slot {
  width: 100%;
  height: 400px;
  overflow: hidden;
  background: #fff;
}

.exam-inline-calc-fallback {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: #6b7280;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  text-align: center;
}

.math-reference-overlay {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.34);
}

.math-reference-dialog {
  width: min(700px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: hidden;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.26);
}

.math-reference-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}

.math-reference-title {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
}

.math-reference-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #6b7280;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.math-reference-close:hover {
  background: #f3f4f6;
  color: #111827;
}

.math-reference-body {
  padding: 18px;
  overflow: auto;
}

.math-reference-img {
  display: block;
  width: 100%;
  height: auto;
}
