:root {
  --ink: #18212b;
  --muted: #64707d;
  --paper: #f5f7f9;
  --panel: #ffffff;
  --line: #dde2e8;
  --accent: #e44d2e;
  --accent-dark: #b9361d;
  --teal: #0f8b8d;
  --green: #2f7d4b;
  --blue: #2563eb;
  --yellow: #c8860a;
  --pink: #d6336c;
  --slate: #55606d;
  --shadow: 0 12px 30px rgba(23, 32, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #dfe4e9;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
}

.app-shell {
  width: 100%;
  max-width: 520px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 20px 18px 32px;
  background: var(--paper);
  box-shadow: 0 0 0 1px rgba(24, 33, 43, 0.08);
}

.screen {
  display: none;
}

.screen.is-active {
  display: block;
  animation: rise 240ms ease-out;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: 2rem;
  line-height: 1.15;
  letter-spacing: 0;
}

h2 {
  font-size: 1.4rem;
  line-height: 1.35;
}

h3 {
  margin-bottom: 14px;
  font-size: 1rem;
}

.home-copy {
  max-width: 34em;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.home-actions,
.quiz-footer,
.result-actions {
  display: flex;
  gap: 10px;
}

.home-actions {
  margin-top: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, opacity 120ms ease;
}

.btn:active {
  transform: scale(0.98);
}

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

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-dark);
}

.btn-secondary {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
}

.btn-secondary:hover {
  border-color: var(--muted);
}

.btn i {
  width: 18px;
  height: 18px;
}

.disclaimer {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.quiz-header {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 22px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

.icon-btn i {
  width: 18px;
  height: 18px;
}

.progress-wrap {
  height: 10px;
  overflow: hidden;
  border-radius: 8px;
  background: #e5eaef;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: 8px;
  background: var(--teal);
  transition: width 220ms ease;
}

.progress-text {
  min-width: 44px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: right;
}

.teacher-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.teacher-badge .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--chip, var(--slate));
}

.teacher-badge[data-teacher="zhanghui"] {
  --chip: var(--accent);
}

.teacher-badge[data-teacher="chenyunkai"] {
  --chip: var(--teal);
}

.teacher-badge[data-teacher="liyan"] {
  --chip: var(--green);
}

.teacher-badge[data-teacher="yangxixi"] {
  --chip: var(--blue);
}

.teacher-badge[data-teacher="liuguizhi"] {
  --chip: var(--yellow);
}

.teacher-badge[data-teacher="guannan"] {
  --chip: var(--pink);
}

.teacher-badge[data-teacher="liangliqiang"] {
  --chip: var(--slate);
}

.question-text {
  min-height: 96px;
  margin-bottom: 18px;
}

.answer-hint {
  margin: -8px 0 14px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.options {
  display: grid;
  gap: 10px;
}

.option-btn {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: start;
  width: 100%;
  min-height: 72px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.option-btn:hover {
  border-color: var(--muted);
}

.option-btn.is-selected {
  border-color: var(--teal);
  background: #effaf8;
  box-shadow: 0 0 0 3px rgba(15, 139, 141, 0.14);
}

.option-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #e8edf2;
  color: var(--ink);
  font-weight: 800;
}

.option-btn.is-selected .option-letter {
  background: var(--teal);
  color: #ffffff;
}

.option-text {
  padding-top: 5px;
  line-height: 1.55;
}

.quiz-footer {
  justify-content: flex-end;
  margin-top: 22px;
}

.quiz-footer .btn {
  min-width: 120px;
}

.result-hero {
  padding: 22px 0 8px;
}

.type-code {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 1.7rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.result-blurb {
  margin-bottom: 6px;
  color: var(--muted);
  line-height: 1.7;
}

.result-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.dimension-list,
.teacher-ranking {
  display: grid;
  gap: 14px;
}

.dimension-row {
  display: grid;
  gap: 8px;
}

.dimension-labels {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-weight: 700;
}

.dimension-labels small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.dimension-track,
.teacher-track {
  height: 12px;
  overflow: hidden;
  border-radius: 8px;
  background: #e5eaef;
}

.dimension-fill {
  height: 100%;
  border-radius: 8px;
  background: var(--teal);
  transition: width 400ms ease;
}

.teacher-row {
  display: grid;
  gap: 8px;
}

.teacher-row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 0.92rem;
  font-weight: 700;
}

.teacher-row-head small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.teacher-fill {
  height: 100%;
  border-radius: 8px;
  background: var(--blue);
  transition: width 400ms ease;
}

.teacher-row[data-teacher="zhanghui"] .teacher-fill {
  background: var(--accent);
}

.teacher-row[data-teacher="chenyunkai"] .teacher-fill {
  background: var(--teal);
}

.teacher-row[data-teacher="liyan"] .teacher-fill {
  background: var(--green);
}

.teacher-row[data-teacher="yangxixi"] .teacher-fill {
  background: var(--blue);
}

.teacher-row[data-teacher="liuguizhi"] .teacher-fill {
  background: var(--yellow);
}

.teacher-row[data-teacher="guannan"] .teacher-fill {
  background: var(--pink);
}

.teacher-row[data-teacher="liangliqiang"] .teacher-fill {
  background: var(--slate);
}

.top-teacher-note {
  margin-top: 14px;
  padding: 14px;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--panel);
}

.top-teacher-note strong {
  display: block;
  margin-bottom: 4px;
}

.top-teacher-note p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.stat-cell {
  min-height: 110px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.stat-cell strong {
  display: block;
  margin-bottom: 8px;
  font-size: 0.86rem;
  line-height: 1.4;
}

.stat-value {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 1.35rem;
  font-weight: 900;
}

.stat-cell p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.result-actions {
  margin-top: 26px;
}

.result-actions .btn {
  flex: 1 1 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 20;
  transform: translateX(-50%);
  min-width: 180px;
  padding: 12px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
}

.toast[hidden] {
  display: none;
}

@media (min-width: 560px) {
  .app-shell {
    margin: 24px auto;
    min-height: calc(100dvh - 48px);
    border-radius: 8px;
  }

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