:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #d9dee8;
  --blue: #1f5f99;
  --blue-dark: #164873;
  --green: #16794c;
  --red: #b42318;
  --amber: #946200;
  --shadow: 0 10px 28px rgba(16, 24, 40, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

button, select, input { font: inherit; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background: #ffffff;
  border-right: 1px solid var(--line);
  padding: 22px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid #b8c7d9;
  background: #e8eef5;
  color: #0b2545;
  font-weight: 800;
  border-radius: 8px;
}

.brand-name { font-weight: 800; }
.brand-subtitle { color: var(--muted); font-size: 12px; margin-top: 2px; }

.score-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfe;
  margin-bottom: 18px;
}

.tester-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  margin-bottom: 12px;
}

.tester-label input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
}

.tester-label input:focus {
  outline: 2px solid #c9ddf0;
  border-color: #8fb3d8;
}

.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  color: var(--muted);
}

.score-row strong { color: var(--ink); }

.progress-track {
  height: 9px;
  background: #e5e9f0;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: var(--blue);
  transition: width 180ms ease;
}

.result-status {
  margin-top: 12px;
  border-radius: 8px;
  padding: 9px 10px;
  font-weight: 800;
  line-height: 1.35;
}

.result-status.status-pending {
  color: var(--amber);
  background: #fff7e6;
  border: 1px solid #f3d38b;
}

.result-status.status-pass {
  color: var(--green);
  background: #eef8f2;
  border: 1px solid #84c7a2;
}

.result-status.status-excellent {
  color: #0b4d7a;
  background: #eef5fb;
  border: 1px solid #8fb3d8;
}

.result-status.status-retry {
  color: var(--red);
  background: #fff3f2;
  border: 1px solid #f0a6a0;
}

.time-summary {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  margin-top: 8px;
}

.section-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}

.section-button:hover,
.section-button.active {
  border-color: #8fb3d8;
  background: #eef5fb;
}

.section-count {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.main {
  min-width: 0;
  padding: 26px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 18px;
}

h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
}

#quizSubtitle {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.top-actions,
.question-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-btn,
.ghost-btn {
  border-radius: 8px;
  padding: 10px 14px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.primary-btn {
  background: var(--blue);
  color: #fff;
}

.primary-btn:hover { background: var(--blue-dark); }

.ghost-btn {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.ghost-btn:hover { background: #f2f5f8; }

.toolbar,
.question-panel,
.review-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.toolbar {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px;
  margin-bottom: 18px;
}

.select-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

select {
  min-width: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
}

.check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.question-panel {
  padding: 22px;
  margin-bottom: 18px;
}

.question-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #e8eef5;
  color: #0b4d7a;
  font-size: 12px;
  font-weight: 700;
}

.muted { color: var(--muted); }

#questionStem {
  margin: 0 0 16px;
  font-size: 21px;
  line-height: 1.45;
}

.options {
  display: grid;
  gap: 10px;
}

.option {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  cursor: pointer;
  line-height: 1.5;
}

.option:hover { border-color: #a9c6e2; background: #fbfdff; }
.option.selected { border-color: var(--blue); background: #eef5fb; }
.option.correct { border-color: #84c7a2; background: #eef8f2; }
.option.wrong { border-color: #f0a6a0; background: #fff3f2; }

.option-key {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #f1f4f8;
  font-weight: 800;
}

.question-actions {
  margin-top: 18px;
  justify-content: space-between;
}

.feedback {
  margin-top: 16px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fbfcfe;
  line-height: 1.6;
}

.feedback.good { border-color: #84c7a2; background: #f0f8f3; }
.feedback.bad { border-color: #f0a6a0; background: #fff5f4; }

.feedback-title {
  font-weight: 800;
  margin-bottom: 6px;
}

.review-panel {
  padding: 18px;
}

.review-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.review-head h2 {
  margin: 0;
  font-size: 18px;
}

.review-list {
  display: grid;
  gap: 10px;
}

.review-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.review-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.status-ok { color: var(--green); font-weight: 800; }
.status-bad { color: var(--red); font-weight: 800; }
.status-pending { color: var(--amber); font-weight: 800; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .main { padding: 18px; }
  .topbar { flex-direction: column; }
  .question-actions { justify-content: flex-start; }
}
