:root {
  color-scheme: light;
  --bg: #f7faf8;
  --surface: #ffffff;
  --surface-soft: #f1f7f3;
  --ink: #14201a;
  --muted: #5d6d63;
  --line: #d9e4dd;
  --green: #148a5c;
  --green-dark: #0d5f43;
  --cyan: #2f9faf;
  --amber: #c47b1d;
  --red: #b94646;
  --shadow: 0 18px 50px rgba(20, 32, 26, 0.1);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(rgba(247, 250, 248, 0.9), rgba(247, 250, 248, 0.94)),
    url("./assets/biology-bg.png") center / cover fixed;
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Segoe UI",
    sans-serif;
}

button {
  border: 0;
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 14px;
  min-height: 100vh;
  padding: 14px;
}

.side-panel,
.main-panel,
.report-sheet {
  border: 1px solid rgba(217, 228, 221, 0.9);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.side-panel {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  min-height: calc(100vh - 28px);
}

.side-panel {
  padding: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border: 2px solid var(--green);
  border-radius: 50%;
  background:
    radial-gradient(circle at 70% 34%, var(--cyan) 0 4px, transparent 5px),
    radial-gradient(circle at 35% 66%, var(--amber) 0 3px, transparent 4px),
    linear-gradient(135deg, rgba(20, 138, 92, 0.14), rgba(47, 159, 175, 0.18));
}

.brand h1,
.brand p,
.topbar h2,
.report-header h2,
.report-columns h3 {
  margin: 0;
}

.brand h1 {
  font-size: 17px;
  line-height: 1.2;
}

.brand p,
.eyebrow,
.module-label,
.status-strip,
.answer-note {
  color: var(--muted);
  font-size: 12px;
}

.score-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.score-card strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

.progress-ring {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, #fff 72%, transparent 73%),
    conic-gradient(var(--green) 0deg, #dfe9e3 0deg);
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
}

.question-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  overflow: auto;
  padding-right: 2px;
}

.q-jump {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.q-jump.is-current {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
}

.q-jump.is-answered {
  background: #e7f5ee;
  border-color: #b7ddc9;
}

.q-jump.is-marked {
  color: var(--amber);
  border-color: rgba(196, 123, 29, 0.6);
}

.side-actions {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 18px;
}

.main-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-radius: var(--radius);
  min-height: calc(100vh - 28px);
  overflow: hidden;
}

.topbar,
.actionbar,
.report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar {
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.module-label {
  color: var(--green-dark);
  font-weight: 800;
}

.topbar h2 {
  margin-top: 6px;
  font-size: 30px;
  line-height: 1.15;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 430px;
}

.status-strip span,
.module-tabs button,
.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 6px 10px;
}

.question-panel {
  align-self: stretch;
  padding: 30px 34px;
  overflow: auto;
}

.question-stem {
  max-width: 980px;
  margin: 0 0 24px;
  font-size: 24px;
  line-height: 1.65;
  font-weight: 750;
}

.options {
  display: grid;
  gap: 12px;
  max-width: 980px;
}

.option-button {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 68px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.option-button:hover {
  border-color: rgba(20, 138, 92, 0.55);
  transform: translateY(-1px);
}

.option-button.is-selected {
  border-color: var(--green);
  background: #e8f6ef;
}

.option-key {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #edf5f0;
  color: var(--green-dark);
  font-weight: 800;
}

.option-button.is-selected .option-key {
  background: var(--green);
  color: #fff;
}

.actionbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

#nextButton {
  min-width: 150px;
  margin-left: auto;
}

#submitButton {
  min-width: 130px;
}

.primary-button,
.secondary-button,
.submit-button,
.ghost-button {
  display: inline-grid;
  place-items: center;
  min-height: 40px;
  border-radius: 6px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 750;
  text-decoration: none;
}

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

.submit-button {
  background: var(--ink);
  color: #fff;
}

.secondary-button,
.ghost-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

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

.report-view {
  min-height: 100vh;
  padding: 18px;
  background:
    linear-gradient(rgba(247, 250, 248, 0.94), rgba(247, 250, 248, 0.98)),
    url("./assets/biology-bg.png") center / cover fixed;
}

.report-view.is-hidden {
  display: none;
}

body.showing-report .app-shell {
  display: none;
}

.report-sheet {
  max-width: 1280px;
  margin: 0 auto;
  border-radius: var(--radius);
  padding: 24px;
}

.report-header {
  margin-bottom: 20px;
}

.report-header h2 {
  margin-top: 4px;
  font-size: 28px;
}

.report-lead {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.metric-card,
.weak-card,
.wrong-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px;
}

.metric-card strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
}

.report-block {
  margin: 18px 0;
}

.report-block h3 {
  margin: 0 0 10px;
  font-size: 17px;
}

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

.chart-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px;
}

.chart-card > strong {
  display: block;
  margin-bottom: 12px;
}

.chart-list {
  display: grid;
  gap: 12px;
}

.chart-row {
  display: grid;
  gap: 6px;
}

.chart-row-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.bar-meter {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6eee9;
}

.bar-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--cyan));
}

.report-columns {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 14px;
}

.report-columns h3 {
  margin-bottom: 10px;
  font-size: 17px;
}

.weak-card,
.wrong-card {
  margin-bottom: 10px;
}

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

.priority-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 52px;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
}

.priority-rank {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--green-dark);
  font-weight: 800;
}

.priority-main {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.priority-main strong {
  margin: 0;
}

.priority-main .answer-note {
  margin: 0;
}

.priority-score,
.group-score {
  color: var(--green-dark);
  text-align: right;
}

.compact-details,
.wrong-group {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.compact-details {
  margin-top: 8px;
  padding: 0 12px 12px;
}

.compact-details summary,
.wrong-group summary {
  cursor: pointer;
  font-weight: 800;
}

.compact-details summary {
  padding: 12px 0;
}

.wrong-group {
  margin-bottom: 8px;
  padding: 0 12px 12px;
}

.wrong-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
}

.wrong-group summary span:first-child {
  display: grid;
  gap: 3px;
}

.wrong-group summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.wrong-group > .answer-note {
  margin: 0 0 8px;
}

.wrong-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.wrong-item {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.wrong-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

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

.weak-card strong,
.wrong-card strong {
  display: block;
  margin-bottom: 8px;
}

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

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

.answer-note {
  line-height: 1.6;
}

.is-correct {
  color: var(--green-dark);
}

.is-wrong {
  color: var(--red);
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }
}

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

  .side-panel,
  .main-panel {
    min-height: auto;
  }

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

  .topbar,
  .actionbar,
  .report-header {
    align-items: stretch;
    flex-direction: column;
  }

  .status-strip {
    justify-content: flex-start;
  }

  .question-panel {
    padding: 22px 16px;
  }

  .question-stem {
    font-size: 20px;
  }

  .actionbar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  #nextButton {
    margin-left: 0;
  }

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