:root {
  color-scheme: light;
  --ink: #19202a;
  --muted: #637083;
  --line: #d9e1ea;
  --paper: #fbfcf8;
  --panel: #ffffff;
  --blue: #2c6fbb;
  --green: #1f8a5b;
  --red: #c64d39;
  --amber: #c78720;
  --shadow: 0 18px 50px rgba(31, 44, 67, 0.12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(44, 111, 187, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(31, 138, 91, 0.12), transparent 38%),
    #f4f7ed;
  font-family: "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
}
button, input, select { font: inherit; }
button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
}
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.primary, button.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.layout { min-height: 100vh; }
.topbar {
  min-height: 86px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
}
.title-block h1 { margin: 4px 0 0; font-size: 30px; letter-spacing: 0; }
.eyebrow {
  display: inline-block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}
.top-controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.top-controls select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}
.body { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 22px; padding: 24px; }
.sidebar {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  height: calc(100vh - 134px);
  overflow: auto;
  box-shadow: var(--shadow);
}
.subject-badge {
  border-radius: 8px;
  padding: 14px;
  color: #fff;
  font-weight: 700;
  margin-bottom: 12px;
  background: var(--blue);
}
.subject-badge.chinese { background: #b34c35; }
.subject-badge.math { background: #236f88; }
.subject-badge.english { background: #2f7b55; }
.nav-mode, .unit {
  width: 100%;
  margin-bottom: 8px;
  text-align: left;
}
.unit {
  display: grid;
  gap: 4px;
  padding: 12px;
}
.unit span { color: var(--muted); font-size: 13px; }
.content { min-width: 0; }
.question-card, .panel, .empty-card {
  background: rgba(255,255,255,0.93);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
}
.question-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.question-head h2 { margin: 8px 0 0; font-size: 26px; line-height: 1.35; }
.difficulty { color: var(--amber); white-space: nowrap; }
.knowledge { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.knowledge span {
  background: #eef5ff;
  color: #245b9a;
  border: 1px solid #d4e5fb;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 13px;
}
.options { display: grid; gap: 12px; margin: 20px 0; }
.answer-box {
  display: grid;
  gap: 8px;
  margin: 20px 0;
}
.answer-input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
}
.answer-input:focus {
  outline: 2px solid rgba(47, 111, 237, 0.18);
  border-color: var(--blue);
}
.answer-box small { color: var(--muted); }
.option {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  text-align: left;
  padding: 14px;
}
.option b {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eef2f6;
  display: grid;
  place-items: center;
}
.option.selected {
  border-color: var(--blue);
  background: #f0f7ff;
}
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hint-panel {
  margin-top: 18px;
  padding: 14px;
  background: #fff8e8;
  border: 1px solid #f0d9a4;
  border-radius: 8px;
}
.hint-panel p { margin: 6px 0; }
.result {
  margin-top: 18px;
  padding: 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.result.correct { background: #eef9f1; border-color: #b9e2c5; }
.result.wrong { background: #fff0ec; border-color: #f1c0b4; }
.result h3 { margin-top: 0; }
.remediation {
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-top: 12px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.wrong-list, .report-grid {
  display: grid;
  gap: 12px;
}
.wrong-list article, .report-grid article, .admin-note {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.report-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.report-grid b {
  display: block;
  font-size: 28px;
  color: var(--green);
}
.empty-text { color: var(--muted); }
.fatal {
  margin: 40px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 24px;
  border-radius: 8px;
}
@media (max-width: 820px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .body { grid-template-columns: 1fr; padding: 14px; }
  .sidebar { height: auto; max-height: 360px; }
  .question-head { flex-direction: column; }
}
