:root {
  color-scheme: light;
  --ink: #173b35;
  --muted: #6c7774;
  --paper: #fffdf8;
  --wash: #eef5ef;
  --green: #28695d;
  --green-dark: #204f46;
  --gold: #e1a83c;
  --red: #bd554a;
  --line: #d9e2dc;
  --shadow: 0 10px 30px rgba(24, 60, 53, .10);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #f4f6f1; color: var(--ink); }
body { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
button, .button-like { min-height: 48px; border: 1px solid var(--line); border-radius: 14px; background: white; color: var(--ink); padding: 11px 18px; font: inherit; font-weight: 700; cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
.primary { background: var(--green); color: white; border-color: var(--green); }
.danger { color: #9b332d; border-color: #e6b9b4; }
.hidden { display: none !important; }
.topbar { position: sticky; z-index: 10; top: 0; display: grid; grid-template-columns: 48px 1fr 48px; gap: 14px; align-items: center; padding: calc(12px + env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 12px max(18px, env(safe-area-inset-left)); background: rgba(255,253,248,.94); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 1px 0 0; font-size: clamp(20px, 3vw, 29px); line-height: 1.2; }
.eyebrow { color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .05em; }
.icon-btn { width: 48px; padding: 0; font-size: 23px; border-radius: 50%; }
#app { width: min(100%, 980px); margin: 0 auto; padding: 28px max(18px, env(safe-area-inset-right)) 34px max(18px, env(safe-area-inset-left)); }
.hero { display: grid; grid-template-columns: 1.4fr .7fr; gap: 22px; align-items: stretch; margin-bottom: 24px; }
.hero-main, .stat-card, .day-card, .question-card, .overview-card, .result-card { background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 24px; }
.hero-main { padding: 30px; background: linear-gradient(135deg,#fffdf8 35%,#e6f1ea); }
.hero-main h2 { font-size: clamp(28px,5vw,48px); margin: 0 0 10px; }
.hero-main p { color: var(--muted); font-size: 17px; margin: 0; line-height: 1.7; }
.stat-card { padding: 24px; display: flex; flex-direction: column; justify-content: center; text-align: center; }
.stat-number { font-size: 42px; font-weight: 900; color: var(--green); }
.stat-label { color: var(--muted); }
.section-title { display: flex; justify-content: space-between; align-items: end; margin: 27px 4px 14px; }
.section-title h2 { margin: 0; font-size: 22px; }
.section-title span { color: var(--muted); font-size: 14px; }
.day-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }
.day-card { padding: 22px; text-align: left; position: relative; overflow: hidden; }
.day-card h3 { margin: 0 0 7px; font-size: 22px; }
.day-card p { color: var(--muted); margin: 0 0 17px; line-height: 1.55; }
.day-card.locked { opacity: .58; }
.day-card.review { border-color: #d9b467; background: #fffaf0; }
.progress { height: 9px; overflow: hidden; background: #e5e9e5; border-radius: 99px; margin: 14px 0 8px; }
.progress > i { display: block; height: 100%; background: var(--green); border-radius: inherit; }
.overview-intro { margin-bottom: 20px; }
.overview-intro h2 { font-size: 30px; margin: 0 0 8px; }
.overview-intro p { color: var(--muted); line-height: 1.6; }
.overview-list { display: grid; gap: 14px; }
.overview-card { overflow: hidden; }
.overview-card summary { padding: 18px 21px; font-weight: 800; font-size: 18px; cursor: pointer; list-style-position: inside; }
.overview-text { white-space: pre-wrap; line-height: 1.75; color: #334a46; padding: 0 22px 23px; }
.question-head { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin: 2px 2px 16px; }
.pill { display: inline-flex; align-items: center; min-height: 34px; padding: 5px 12px; border-radius: 99px; background: #e4f0e9; color: var(--green-dark); font-weight: 800; font-size: 13px; }
.question-card { padding: clamp(20px,4vw,34px); }
.question-number { color: var(--gold); font-weight: 900; font-size: 14px; letter-spacing: .08em; }
.prompt { margin: 11px 0 22px; font-size: clamp(18px,2.5vw,23px); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; line-height: 1.65; overflow-wrap: anywhere; }
.options { display: grid; gap: 12px; }
.option { display: grid; grid-template-columns: 37px 1fr; align-items: center; gap: 13px; width: 100%; text-align: left; font-weight: 600; line-height: 1.45; padding: 14px 16px; }
.option-key { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 50%; background: var(--wash); color: var(--green); }
.option.selected { border: 2px solid var(--green); background: #edf7f1; }
.option.correct { border-color: #4d9274; background: #e6f5eb; }
.option.wrong { border-color: #d47a70; background: #fff0ee; }
.feedback { margin-top: 20px; padding: 18px; border-radius: 17px; line-height: 1.65; white-space: pre-wrap; }
.feedback.hint { background: #fff6dd; border: 1px solid #efd694; }
.feedback.answer { background: #eef5ef; border: 1px solid #c8ddce; }
.feedback h3 { margin: 0 0 6px; font-size: 18px; }
.correction { margin-top: 10px; color: #8d4e25; font-size: 14px; }
.bottom-bar { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; display: flex; gap: 12px; justify-content: center; padding: 12px max(18px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); background: rgba(255,253,248,.96); border-top: 1px solid var(--line); backdrop-filter: blur(18px); }
.bottom-bar button { flex: 1; max-width: 430px; }
.result-card { padding: 34px; text-align: center; }
.result-card h2 { font-size: 32px; margin: 5px 0 8px; }
.result-card p { color: var(--muted); line-height: 1.65; }
.score-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 25px 0; }
.score-box { padding: 16px 8px; border-radius: 18px; background: var(--wash); }
.score-box strong { display:block; font-size: 27px; }
dialog { border: 0; padding: 0; border-radius: 24px; width: min(90vw,480px); box-shadow: 0 25px 80px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(10,30,25,.45); backdrop-filter: blur(4px); }
.dialog-card { padding: 28px; }
.dialog-card h2 { margin-top: 0; }
.dialog-card p { color: var(--muted); line-height: 1.6; }
.dialog-actions { display: grid; gap: 10px; }
.button-like { display: grid; place-items: center; }
@media (max-width: 650px) {
  .hero { grid-template-columns: 1fr; }
  .hero-main { padding: 24px; }
  .day-grid { grid-template-columns: 1fr; }
  .score-row { grid-template-columns: 1fr; }
  .topbar { grid-template-columns: 44px 1fr 44px; gap: 9px; }
  .icon-btn { width: 44px; min-height: 44px; }
}
@media (orientation: landscape) and (max-height: 600px) {
  .topbar { position: static; padding-top: 9px; padding-bottom: 9px; }
  #app { padding-top: 16px; }
}
