﻿:root {
  --bg: #f6f8f7;
  --panel: #ffffff;
  --panel-soft: #f7faf9;
  --ink: #16231f;
  --muted: #66756f;
  --line: #dfe7e3;
  --line-strong: #cdd9d4;
  --accent: #0d8a72;
  --accent-strong: #076a58;
  --accent-soft: #e8f6f2;
  --accent-faint: #f3fbf8;
  --amber: #ba6b00;
  --amber-soft: #fff3dc;
  --red: #b42318;
  --red-soft: #fff0ee;
  --shadow: 0 18px 44px rgba(22, 35, 31, 0.07);
  --shadow-soft: 0 8px 22px rgba(22, 35, 31, 0.05);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #ffffff 0, #f6f8f7 168px),
    var(--bg);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

button:focus-visible,
label:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(13, 138, 114, 0.16);
}

.app-shell {
  min-height: 100vh;
  padding: 22px 24px 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1500px;
  margin: 0 auto 18px;
  padding: 2px 2px 0;
}

.topbar h1 {
  margin: 0;
  font-size: 29px;
  line-height: 1.2;
  letter-spacing: 0;
  font-weight: 820;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.status-cluster {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  border-radius: 6px;
  font-size: 13px;
  box-shadow: var(--shadow-soft);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(270px, 320px) minmax(430px, 1fr) minmax(370px, 455px);
  gap: 18px;
  max-width: 1500px;
  margin: 0 auto;
  align-items: start;
}

.settings-panel,
.preview-panel,
.analysis-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  isolation: isolate;
}

.settings-panel {
  padding: 18px;
  position: sticky;
  top: 18px;
}

.preview-panel,
.analysis-panel {
  min-height: calc(100vh - 108px);
  overflow: hidden;
}

.panel-section {
  padding-bottom: 20px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.panel-section h2,
.panel-heading h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
}

.panel-heading {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, var(--panel-soft));
}

.panel-heading span {
  color: var(--muted);
  font-size: 13px;
}

.upload-box {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 24px 16px;
  margin-top: 14px;
  background: linear-gradient(180deg, #f8fffc, var(--accent-faint));
  border: 1px dashed #84bfb2;
  border-radius: 8px;
  color: var(--accent-strong);
  text-align: center;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.upload-box:hover {
  border-color: var(--accent);
  background: linear-gradient(180deg, #ffffff, #eef9f5);
  box-shadow: inset 0 0 0 1px rgba(13, 138, 114, 0.04);
}

.upload-box small {
  color: var(--muted);
  line-height: 1.45;
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  font-size: 26px;
  line-height: 1;
  box-shadow: 0 10px 22px rgba(13, 138, 114, 0.22);
}

#fileInput {
  display: none;
}

.file-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.file-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px;
  background: #fbfdfc;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  max-width: 100%;
  box-sizing: border-box;
  align-items: start;
}

.file-item > div {
  min-width: 0;
}

.file-item strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item small {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.file-item > small:last-child {
  min-width: auto;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

label {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  color: #303a36;
  font-size: 13px;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 10px 11px;
  outline: none;
  font-size: 14px;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 143, 117, 0.12);
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  width: 100%;
  min-height: 44px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 750;
  letter-spacing: 0;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), #0b745f);
  color: white;
  box-shadow: 0 12px 24px rgba(13, 138, 114, 0.20);
}

.primary-btn:hover {
  background: linear-gradient(135deg, #0f9279, var(--accent-strong));
  transform: translateY(-1px);
  box-shadow: 0 15px 28px rgba(13, 138, 114, 0.24);
}

.primary-btn:active,
.ghost-btn:active {
  transform: translateY(0);
}

.primary-btn:disabled,
.ghost-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.secondary-btn {
  margin-top: 10px;
  background: white;
  border-color: var(--line);
  color: var(--ink);
}

.ghost-btn {
  width: auto;
  min-width: 104px;
  padding: 0 14px;
  background: #24312d;
  color: white;
  border-color: #24312d;
  box-shadow: var(--shadow-soft);
}

.ghost-btn:not(:disabled):hover {
  background: #111d19;
  border-color: #111d19;
  transform: translateY(-1px);
}

.preview-area {
  height: calc(100vh - 164px);
  min-height: 620px;
  overflow: auto;
  padding: 18px;
  background:
    linear-gradient(90deg, rgba(204, 218, 212, 0.24) 1px, transparent 1px),
    linear-gradient(0deg, rgba(204, 218, 212, 0.24) 1px, transparent 1px),
    #f1f5f3;
  background-size: 24px 24px;
}

.preview-stack {
  display: grid;
  gap: 14px;
}

.preview-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(22, 35, 31, 0.06);
}

.preview-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.preview-card img,
.preview-card object {
  display: block;
  width: 100%;
  min-height: 420px;
  background: white;
}

.preview-card img {
  height: auto;
  min-height: auto;
}

.empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 460px;
  text-align: center;
  color: var(--muted);
  gap: 9px;
  max-width: 360px;
  margin: 0 auto;
}

.empty-state::before {
  content: "";
  width: 54px;
  height: 54px;
  margin-bottom: 4px;
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(13, 138, 114, 0.18) 12px, transparent 12px) 16px 18px / 28px 3px no-repeat,
    linear-gradient(90deg, rgba(13, 138, 114, 0.14) 12px, transparent 12px) 16px 28px / 28px 3px no-repeat,
    linear-gradient(90deg, rgba(13, 138, 114, 0.12) 20px, transparent 20px) 16px 38px / 28px 3px no-repeat,
    linear-gradient(180deg, #ffffff, #eef8f4);
  border: 1px solid #cfe3dc;
  box-shadow: 0 14px 26px rgba(22, 35, 31, 0.08);
}

.empty-state strong {
  color: var(--ink);
  font-size: 17px;
  line-height: 1.35;
}

.empty-state span {
  line-height: 1.6;
  max-width: 100%;
  overflow-wrap: break-word;
}

.analysis-panel {
  display: flex;
  flex-direction: column;
}

.report-root {
  padding: 18px;
  overflow: auto;
  height: calc(100vh - 164px);
  min-height: 620px;
}

.muted-report {
  display: grid;
  align-content: start;
}

.score-card {
  background:
    linear-gradient(180deg, rgba(13, 138, 114, 0.06), rgba(13, 138, 114, 0.02)),
    #ffffff;
  border: 1px solid #d5e5df;
  border-radius: 8px;
  color: var(--ink);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.score-card span {
  font-size: 13px;
  color: var(--muted);
}

.score-card strong {
  display: block;
  margin-top: 6px;
  font-size: 34px;
  line-height: 1.1;
  color: var(--accent-strong);
}

.score-card p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 12px 0;
}

.metric {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
}

.metric span {
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.report-section {
  margin-top: 18px;
}

.report-section h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.question-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  background: white;
}

.question-card.correct {
  border-color: #b8ded3;
}

.question-card.wrong {
  border-color: #f2c3bc;
}

.question-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.question-title {
  display: grid;
  gap: 3px;
}

.question-title strong {
  font-size: 15px;
}

.question-title span,
.mini-label {
  color: var(--muted);
  font-size: 12px;
}

.score-pill {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
}

.wrong .score-pill {
  background: var(--red-soft);
  color: var(--red);
}

.kv {
  display: grid;
  gap: 4px;
  margin-top: 9px;
  line-height: 1.55;
  font-size: 13px;
}

.kv strong {
  color: #35403c;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 5px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  color: #35403c;
  font-size: 12px;
}

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

.bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 120px) 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.bar-track {
  height: 8px;
  border-radius: 999px;
  background: #e8eeeb;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--accent);
}

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

.warning {
  padding: 10px;
  border-radius: 6px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 13px;
  line-height: 1.45;
}

.loading-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 28px 16px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.loading-state span {
  color: var(--muted);
  font-size: 13px;
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #d8e6e1;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.error-box {
  margin: 16px;
  padding: 12px 13px;
  border: 1px solid #efb3aa;
  background: var(--red-soft);
  color: var(--red);
  border-radius: 6px;
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 300px 1fr;
  }

  .analysis-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .app-shell {
    padding: 14px;
  }

  .topbar,
  .workspace {
    display: grid;
    grid-template-columns: 1fr;
  }

  .status-cluster {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    justify-content: stretch;
    gap: 8px;
  }

  .badge {
    min-width: 58px;
    padding: 0 10px;
    justify-content: center;
    white-space: nowrap;
  }

  .ghost-btn {
    width: 100%;
    min-width: 0;
  }

  .settings-panel {
    position: static;
  }

  .preview-panel,
  .analysis-panel {
    min-height: auto;
  }

  .preview-area,
  .report-root {
    height: auto;
    min-height: 420px;
  }

  .empty-state {
    max-width: 280px;
  }

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


.print-title {
  display: none;
}

.report-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 22px;
}

.hero-copy {
  min-width: 0;
}

.score-ring {
  width: 104px;
  height: 104px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  background: rgba(255, 255, 255, 0.1);
}

.score-ring span {
  font-size: 12px;
  opacity: 0.78;
}

.score-ring b {
  margin-top: 3px;
  font-size: 26px;
  line-height: 1;
}

.summary-grid--report {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 14px 0 18px;
}

.section-heading-copy {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.section-heading-copy h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
}

.section-heading-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.insight-section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.insight-grid,
.weak-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.insight-card,
.weak-card,
.reason-card,
.practice-card,
.plan-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.insight-card,
.weak-card {
  padding: 13px;
}

.insight-card span,
.weak-card span,
.practice-card header span {
  color: var(--muted);
  font-size: 12px;
}

.insight-card strong,
.weak-card strong {
  display: block;
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.4;
}

.insight-card p,
.weak-card p,
.practice-body p,
.plan-item p {
  margin: 8px 0 0;
  color: #43504b;
  font-size: 13px;
  line-height: 1.6;
}

.weak-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.weak-card p {
  grid-column: 1 / -1;
}

.weak-card b {
  color: var(--accent-strong);
  font-size: 14px;
}

.reason-list,
.practice-list,
.plan-list,
.question-list {
  display: grid;
  gap: 12px;
}

.reason-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
}

.reason-card strong {
  display: block;
  font-size: 15px;
}

.reason-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.reason-card b {
  color: var(--amber);
}

.question-card {
  padding: 15px;
  margin-bottom: 0;
}

.question-card.wrong {
  background: linear-gradient(90deg, #fff8f6 0, #ffffff 18%);
}

.question-card.correct {
  background: linear-gradient(90deg, #f6fcfa 0, #ffffff 18%);
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.answer-block {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
}

.answer-block strong,
.coach-note strong,
.practice-body strong {
  display: block;
  margin-bottom: 5px;
  color: #303a36;
  font-size: 12px;
}

.answer-block p,
.coach-note p {
  margin: 0;
  color: #25312d;
  font-size: 13px;
  line-height: 1.65;
}

.coach-note {
  margin-top: 10px;
  padding: 11px 12px;
  border-left: 3px solid #c8d6d1;
  background: #fbfcfb;
  border-radius: 0 6px 6px 0;
}

.coach-note--accent {
  border-left-color: var(--accent);
  background: var(--accent-soft);
}

.practice-card header {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.practice-card header b {
  font-size: 14px;
}

.practice-body {
  padding: 13px 14px;
}

.practice-body p {
  margin-bottom: 12px;
}

.plan-item {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  padding: 13px 14px;
}

.plan-item > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
}

.plan-item strong {
  font-size: 14px;
}

@media (max-width: 820px) {
  .report-hero,
  .summary-grid--report,
  .insight-grid,
  .weak-grid,
  .answer-grid {
    grid-template-columns: 1fr;
  }

  .score-ring {
    width: 92px;
    height: 92px;
  }

  .reason-card,
  .weak-card {
    grid-template-columns: 1fr;
  }
}
@page {
  size: A4;
  margin: 16mm 14mm;
}

@media print {
  body {
    background: white;
    color: #17201d;
  }

  .topbar,
  .settings-panel,
  .preview-panel,
  .analysis-panel > .panel-heading,
  .loading-state,
  .error-box {
    display: none !important;
  }

  .app-shell {
    padding: 0;
  }

  .workspace {
    display: block;
    max-width: none;
    margin: 0;
  }

  .analysis-panel {
    border: 0;
    box-shadow: none;
    min-height: auto;
    display: block;
  }

  .report-root {
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 0;
    font-size: 11.5pt;
    line-height: 1.65;
  }

  .print-title {
    display: block;
    margin-bottom: 8mm;
    padding-bottom: 7mm;
    border-bottom: 1px solid #dce4e0;
  }

  .print-title h2 {
    margin: 0 0 2mm;
    font-size: 22pt;
    line-height: 1.2;
  }

  .print-title p {
    margin: 0;
    color: #65716d;
    font-size: 10.5pt;
  }

  .score-card {
    background: white !important;
    color: #17201d;
    border: 1px solid #dce4e0;
    border-radius: 4px;
    padding: 8mm;
  }

  .score-card span,
  .score-card p {
    color: #43504b;
  }

  .score-card strong {
    font-size: 28pt;
  }

  .score-ring {
    border-color: #dce4e0;
    background: #f5f7f6;
    color: #17201d;
  }

  .summary-grid,
  .summary-grid--report,
  .insight-grid,
  .weak-grid,
  .answer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5mm;
  }

  .metric,
  .insight-card,
  .weak-card,
  .reason-card,
  .question-card,
  .practice-card,
  .plan-item,
  .warning {
    break-inside: avoid;
    page-break-inside: avoid;
    box-shadow: none;
  }

  .report-section {
    margin-top: 10mm;
  }

  .page-section {
    break-before: auto;
  }

  .question-section,
  .practice-section,
  .plan-section {
    break-before: page;
  }

  .section-heading-copy {
    margin-bottom: 5mm;
  }

  .section-heading-copy h3 {
    font-size: 16pt;
  }

  .section-heading-copy p,
  .mini-label,
  .tag,
  .question-title span,
  .answer-block p,
  .coach-note p,
  .practice-body p,
  .plan-item p {
    font-size: 10.5pt;
  }

  .question-card {
    margin-bottom: 6mm;
    padding: 5mm;
    background: white !important;
    border-radius: 4px;
  }

  .answer-block,
  .coach-note,
  .practice-card,
  .plan-item {
    background: white !important;
  }

  .tag-row {
    margin-top: 3mm;
  }

  .score-pill,
  .tag,
  .plan-item > span {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
/* Wrong-question focused report */
.wrong-report-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.wrong-report-header span {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
}

.wrong-report-header h2 {
  margin: 5px 0 7px;
  font-size: 22px;
  line-height: 1.25;
}

.wrong-report-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.wrong-summary {
  display: flex;
  gap: 10px;
}

.wrong-summary div {
  min-width: 78px;
  padding: 11px;
  border-radius: 7px;
  background: var(--accent-soft);
  text-align: center;
}

.wrong-summary strong {
  display: block;
  color: var(--accent-strong);
  font-size: 24px;
  line-height: 1;
}

.wrong-summary span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.wrong-question-section {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.wrong-question-card {
  padding: 16px;
  border: 1px solid #efc6bd;
  border-radius: 8px;
  background: #fffdfc;
}

.wrong-question-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f2ded9;
}

.wrong-question-header span {
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
}

.wrong-question-header h3 {
  margin: 4px 0 0;
  font-size: 17px;
  line-height: 1.35;
}

.wrong-question-header b {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 6px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 14px;
}

.wrong-tags {
  margin-top: 10px;
}

.wrong-focus {
  margin-top: 12px;
  padding: 12px;
  border-radius: 7px;
  background: #fff5f3;
}

.wrong-focus--advice {
  background: var(--accent-soft);
}

.wrong-focus strong,
.wrong-answer-grid strong,
.similar-question-box strong {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
  color: #303a36;
}

.wrong-focus p,
.wrong-answer-grid p,
.similar-question-box p {
  margin: 0;
  color: #26322e;
  font-size: 14px;
  line-height: 1.65;
}

.wrong-answer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.wrong-answer-grid > div {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
}

.similar-question-box {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #d7e7e2;
  border-radius: 7px;
  background: #fbfffd;
}

.no-wrong-state {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.no-wrong-state strong {
  font-size: 17px;
}

.no-wrong-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

@media (max-width: 820px) {
  .wrong-report-header,
  .wrong-answer-grid {
    grid-template-columns: 1fr;
  }

  .wrong-summary {
    width: 100%;
  }

  .wrong-summary div {
    flex: 1;
  }
}

@media print {
  .wrong-report-header,
  .wrong-question-card,
  .no-wrong-state {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .wrong-report-header {
    padding: 0 0 7mm;
    border: 0;
    border-bottom: 1px solid #dce4e0;
    border-radius: 0;
    background: white !important;
  }

  .wrong-report-header h2 {
    margin-top: 2mm;
    font-size: 15pt;
  }

  .wrong-report-header span {
    color: #65716d;
    font-size: 9.5pt;
  }

  .wrong-summary div {
    background: #f5f7f6 !important;
  }

  .wrong-question-section {
    gap: 7mm;
    margin-top: 9mm;
  }

  .wrong-question-card {
    padding: 6mm;
    background: white !important;
    border-color: #e6c7c1;
    border-radius: 4px;
  }

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

  .wrong-focus,
  .wrong-focus--advice,
  .similar-question-box,
  .wrong-answer-grid > div {
    background: white !important;
  }

  .wrong-focus p,
  .wrong-answer-grid p,
  .similar-question-box p {
    font-size: 10.5pt;
    line-height: 1.7;
  }
}
.original-question-box {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #d7e7e2;
  border-radius: 7px;
  background: #fbfffd;
}

.original-question-box + .wrong-focus {
  margin-top: 12px;
}

.student-answer-box,
.standard-answer-box {
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
}

.original-question-box strong,
.student-answer-box strong,
.standard-answer-box strong,
.answer-appendix-item b {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
  color: #303a36;
}

.original-question-box p,
.student-answer-box p,
.standard-answer-box p,
.answer-appendix-item p {
  margin: 0;
  color: #26322e;
  font-size: 14px;
  line-height: 1.65;
}

.answer-appendix {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.answer-appendix-list {
  display: grid;
  gap: 12px;
}

.answer-appendix-item {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfb;
}

.answer-appendix-item header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.answer-appendix-item header span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.answer-appendix-item header strong {
  font-size: 15px;
}

@media print {
  .answer-appendix {
    break-before: page;
    page-break-before: always;
    margin-top: 0;
    padding: 0;
    border: 0;
    background: white !important;
  }

  .answer-appendix-item,
  .original-question-box,
  .student-answer-box,
  .standard-answer-box {
    break-inside: avoid;
    page-break-inside: avoid;
    background: white !important;
  }

  .original-question-box p,
  .student-answer-box p,
  .standard-answer-box p,
  .answer-appendix-item p {
    font-size: 10.5pt;
    line-height: 1.7;
  }
}
.katex {
  font-size: 1.04em;
}

.katex-display {
  margin: 8px 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.wrong-question-card .katex,
.answer-appendix .katex {
  color: #17201d;
}

@media print {
  .katex {
    font-size: 1em;
  }

  .katex-display {
    margin: 4mm 0;
    overflow: visible;
  }
}
.similar-question-box p,
.student-answer-box p,
.answer-appendix-item p,
.wrong-focus p {
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
}

.katex,
.katex-html,
.katex .base {
  white-space: nowrap;
  word-break: normal;
}

.similar-question-box p .katex-display,
.student-answer-box p .katex-display,
.answer-appendix-item p .katex-display,
.wrong-focus p .katex-display {
  display: inline !important;
  margin: 0 0.12em !important;
  text-align: inherit !important;
}

.similar-question-box p .katex-display > .katex,
.student-answer-box p .katex-display > .katex,
.answer-appendix-item p .katex-display > .katex,
.wrong-focus p .katex-display > .katex {
  display: inline !important;
  white-space: nowrap !important;
}

@media print {
  .similar-question-box p,
  .student-answer-box p,
  .answer-appendix-item p,
  .wrong-focus p {
    word-break: normal !important;
    overflow-wrap: break-word !important;
  }

  .katex,
  .katex-html,
  .katex .base {
    white-space: nowrap !important;
  }
}

/* Customer-facing Qwen layout polish */
.topbar {
  margin-bottom: 20px;
}

.topbar h1 {
  font-size: 28px;
}

.topbar p {
  display: block;
  max-width: 520px;
}

.badge {
  max-width: 190px;
  justify-content: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--accent-strong);
  border-color: #cfe3dc;
  background: #f7fffb;
}

.settings-panel,
.preview-panel,
.analysis-panel {
  border-color: #d8e3df;
}

.upload-box {
  padding: 28px 18px;
  gap: 10px;
}

.upload-box strong {
  color: var(--accent-strong);
  font-size: 16px;
}

.upload-box small {
  max-width: 210px;
}

.primary-btn {
  min-height: 46px;
}

.score-card {
  min-height: 142px;
  display: grid;
  align-content: center;
}

@media (max-width: 820px) {
  .topbar {
    gap: 12px;
  }

  .status-cluster {
    grid-template-columns: 1fr;
  }

  .badge,
  .ghost-btn {
    width: 100%;
    max-width: none;
  }

  .workspace {
    gap: 14px;
  }

  .settings-panel,
  .preview-panel,
  .analysis-panel {
    border-radius: 7px;
  }

  .upload-box {
    padding: 22px 14px;
  }
}
/* Disabled export button should stay quiet before a report exists */
.status-cluster .ghost-btn:disabled,
.status-cluster .ghost-btn[disabled] {
  background: #e8eeeb;
  border-color: #d8e3df;
  color: #74817b;
  box-shadow: none;
  opacity: 1;
}
/* History reports and practice difficulty */
.option-section {
  padding-bottom: 18px;
}

.difficulty-options {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.difficulty-option {
  display: grid;
  grid-template-columns: 16px 1fr;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  margin-top: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdfc;
  color: #26322e;
  cursor: pointer;
}

.difficulty-option input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.difficulty-option:has(input:checked) {
  border-color: #9ed0c4;
  background: var(--accent-faint);
  color: var(--accent-strong);
}

.history-section {
  margin-top: 18px;
  margin-bottom: 0;
  padding-top: 18px;
  padding-bottom: 0;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.text-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 0;
}

.text-btn:not(:disabled):hover {
  color: var(--red);
}

.text-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.history-list {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.history-empty {
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdfc;
}

.history-open {
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 0;
}

.history-open strong,
.history-open span,
.history-open small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-open strong {
  font-size: 13px;
  line-height: 1.35;
}

.history-open span,
.history-open small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.history-delete {
  align-self: center;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.history-delete:hover {
  border-color: #efb3aa;
  color: var(--red);
  background: var(--red-soft);
}

@media (max-width: 820px) {
  .history-section {
    padding-top: 16px;
  }

  .history-item {
    grid-template-columns: 1fr;
  }

  .history-delete {
    justify-self: start;
  }
}
/* Three-level similar practice cards */
.similar-practice-grid,
.similar-answer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.similar-practice-card,
.similar-answer-grid > div {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
}

.similar-practice-card > span,
.similar-answer-grid b {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-bottom: 7px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.similar-practice-card p,
.similar-answer-grid p {
  margin: 0;
  color: #26322e;
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: break-word;
}

@media (max-width: 820px) {
  .similar-practice-grid,
  .similar-answer-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  .similar-practice-grid,
  .similar-answer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4mm;
  }

  .similar-practice-card,
  .similar-answer-grid > div {
    break-inside: avoid;
    page-break-inside: avoid;
    background: white !important;
  }
}
/* Similar practice layout fix: long math problems need full width */
.similar-practice-grid,
.similar-answer-grid {
  grid-template-columns: 1fr !important;
  gap: 12px;
}

.similar-practice-card,
.similar-answer-grid > div {
  overflow: hidden;
}

.similar-practice-card p,
.similar-answer-grid p {
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
}

.similar-practice-card .katex-display,
.similar-answer-grid .katex-display,
.original-question-box .katex-display,
.standard-answer-box .katex-display {
  display: inline !important;
  margin: 0 0.12em !important;
  text-align: inherit !important;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  vertical-align: baseline;
}

.similar-practice-card .katex-display > .katex,
.similar-answer-grid .katex-display > .katex,
.original-question-box .katex-display > .katex,
.standard-answer-box .katex-display > .katex {
  display: inline !important;
  white-space: nowrap !important;
}

.similar-practice-card .katex,
.similar-answer-grid .katex,
.original-question-box .katex,
.standard-answer-box .katex {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  vertical-align: baseline;
}

@media print {
  .similar-practice-grid,
  .similar-answer-grid {
    grid-template-columns: 1fr !important;
    gap: 4mm;
  }
}
.question-image-reference {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed #d7e7e2;
}

.question-image-reference > strong {
  margin-bottom: 8px;
  color: var(--accent-strong);
}

.question-image-grid {
  display: grid;
  gap: 10px;
}

.question-image-grid figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
}

.question-image-grid img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  background: #f7faf8;
}

.question-image-grid figcaption {
  padding: 7px 9px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

@media print {
  .question-image-reference {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .question-image-grid img {
    max-height: 95mm;
  }
}