:root {
  color-scheme: light;
  --paper: #f4f0e8;
  --card: #fffdf8;
  --ink: #202923;
  --muted: #777d75;
  --line: #e8e3d9;
  --green: #214c3b;
  --green-dark: #183a2d;
  --orange: #d96e4c;
  --soft-green: #eaf0e8;
  --shadow: 0 24px 70px rgb(49 52 43 / 8%);
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 83% 4%, rgb(217 110 76 / 9%), transparent 28rem),
    var(--paper);
}

button, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 3px solid rgb(217 110 76 / 55%);
  outline-offset: 3px;
}

.app-shell {
  width: min(100% - 40px, 880px);
  margin: 0 auto;
  padding: 28px 0 30px;
}

.topbar { display: flex; align-items: center; justify-content: space-between; }
.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  color: #fffdf8;
  background: var(--green);
  font-family: Georgia, serif;
  font-size: 19px;
  font-style: italic;
  letter-spacing: 0;
}
.brand-light { color: #858a80; font-weight: 600; }
.top-note { color: #81857d; font-size: 12px; letter-spacing: .04em; }

.intro { padding: 54px 8px 30px; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--orange);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .12em;
}
h1 {
  margin: 0;
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: clamp(34px, 6vw, 52px);
  font-weight: 600;
  letter-spacing: -.045em;
  line-height: 1.12;
}
.title-dot { color: var(--orange); }
.intro-copy { max-width: 500px; margin: 15px 0 0; color: var(--muted); font-size: 15px; line-height: 1.8; }

.practice-panel {
  overflow: hidden;
  border: 1px solid rgb(232 227 217 / 90%);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.toolbar {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
}
.filter-label { display: grid; gap: 5px; min-width: 0; }
.control-caption { color: #858a82; font-size: 11px; font-weight: 650; letter-spacing: .07em; }
.category-select {
  max-width: min(48vw, 280px);
  padding: 2px 24px 2px 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
  font-weight: 700;
}
.icon-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #61675f;
  background: transparent;
  font-size: 12px;
  transition: background .18s, border-color .18s, color .18s;
}
.icon-button span:first-child { color: var(--green); font-size: 18px; line-height: .8; }
.icon-button:hover:not(:disabled) { border-color: #cdd9cf; background: var(--soft-green); color: var(--green); }
button:disabled, select:disabled { cursor: not-allowed; opacity: .55; }

.progress-row { display: flex; justify-content: space-between; gap: 12px; padding: 20px 28px 10px; }
.progress-label { color: #70766f; font-size: 12px; font-weight: 650; }
.progress-count { color: #9a9e96; font-size: 12px; font-variant-numeric: tabular-nums; }
.progress-track { height: 3px; margin: 0 28px; overflow: hidden; border-radius: 99px; background: #eeeae2; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--orange); transition: width .25s ease; }

.question-card { padding: 30px 34px 34px; }
.question-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.category-badge { padding: 6px 10px; border-radius: 999px; color: var(--green); background: var(--soft-green); font-size: 11px; font-weight: 750; }
.question-number { color: #9a9e96; font-size: 12px; font-variant-numeric: tabular-nums; }
.question-title {
  max-width: 720px;
  margin: 23px 0 21px;
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: clamp(22px, 4vw, 31px);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.outline-details { margin: 0 0 25px; color: #777d75; font-size: 13px; }
.outline-details summary { width: fit-content; cursor: pointer; color: #6f766e; font-weight: 650; }
.outline-details summary::marker { color: var(--orange); }
.outline-details p { margin: 10px 0 0; padding: 12px 15px; border-left: 2px solid #d8a28d; color: #555e55; background: #faf7f0; line-height: 1.75; overflow-wrap: anywhere; }
.answer-panel { margin: 0 0 24px; padding: 21px 22px 22px; border: 1px solid #e7ede4; border-radius: 15px; background: #f7f9f5; animation: reveal .22s ease-out; }
.answer-heading-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.answer-mark { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 8px; color: white; background: var(--green); font-family: Georgia, serif; font-size: 13px; }
.answer-heading-row h3 { margin: 0; color: var(--green); font-size: 13px; font-weight: 750; }
.answer-text { color: #343c35; font-size: 14px; line-height: 1.95; white-space: pre-wrap; overflow-wrap: anywhere; }

.card-actions { display: flex; justify-content: space-between; gap: 12px; padding-top: 5px; }
.button { min-height: 46px; padding: 0 18px; border: 1px solid transparent; border-radius: 11px; font-size: 13px; font-weight: 700; transition: transform .15s, background .15s, border-color .15s; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button-secondary { border-color: var(--line); color: #525a52; background: transparent; }
.button-secondary:hover { border-color: #cdd9cf; background: var(--soft-green); }
.button-primary { color: #fffdf8; background: var(--green); }
.button-primary:hover { background: var(--green-dark); }
.button-primary span { margin-left: 8px; font-size: 17px; line-height: 0; }

.empty-state { padding: 52px 26px 58px; text-align: center; }
.empty-icon { color: var(--orange); font-size: 30px; }
.empty-state h2 { margin: 12px 0 7px; font-family: Georgia, "Songti SC", "SimSun", serif; font-size: 25px; }
.empty-state p { margin: 0 auto 22px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.error-state { padding: 40px 28px; color: #8d402f; text-align: center; }
.error-state p { color: #777d75; font-size: 13px; line-height: 1.7; }
.footer-note { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 22px 0 0; color: #858a82; font-size: 11px; letter-spacing: .04em; }
.footer-star { color: var(--orange); }
[hidden] { display: none !important; }

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

@media (max-width: 560px) {
  .app-shell { width: min(100% - 28px, 880px); padding-top: 18px; }
  .top-note { font-size: 11px; }
  .intro { padding: 43px 3px 23px; }
  .intro-copy { max-width: 340px; margin-top: 11px; font-size: 14px; }
  .practice-panel { border-radius: 17px; }
  .toolbar { min-height: 68px; padding: 13px 17px; }
  .restart-text { display: none; }
  .icon-button { width: 40px; height: 40px; justify-content: center; padding: 0; }
  .progress-row { padding: 17px 18px 9px; }
  .progress-track { margin: 0 18px; }
  .question-card { padding: 25px 19px 21px; }
  .question-title { margin-top: 20px; }
  .answer-panel { padding: 17px 15px; }
  .answer-text { font-size: 13px; line-height: 1.9; }
  .card-actions { position: sticky; bottom: 0; padding: 13px 0 0; background: linear-gradient(transparent, var(--card) 20%); }
  .button { min-height: 45px; padding: 0 14px; }
}
