:root {
  color-scheme: light;
  font-family: system-ui, "Microsoft YaHei", sans-serif;
  background: #f3f5f0;
  color: #18211d;
  --green: #12372a;
  --green-2: #275b47;
  --cream: #fffdf5;
  --gold: #d7ad55;
  --red: #a93a36;
  --border: #dfe5dd;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; padding-bottom: 82px; }
button, input { font: inherit; }
button { cursor: pointer; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(18px, env(safe-area-inset-top)) 20px 14px;
  background: var(--green);
  color: white;
}
.topbar h1 { margin: 2px 0 0; font-size: 1.35rem; }
.eyebrow { margin: 0; color: #c6d8cf; font-size: .78rem; }
.badge { display: inline-block; padding: 5px 9px; border-radius: 999px; background: #e5eee9; color: var(--green); font-size: .78rem; }
.topbar .badge { background: rgba(255,255,255,.12); color: white; }

main { width: min(720px, 100%); margin: 0 auto; padding: 18px 14px; }
.page { display: none; }
.page.active { display: block; }
.card { background: white; border: 1px solid var(--border); border-radius: 18px; padding: 18px; box-shadow: 0 5px 20px rgba(17,42,31,.05); }
.hero { background: linear-gradient(145deg, var(--cream), #edf4ee); }
.hero > p { margin: 0; color: var(--green-2); }
.hero-number { display: flex; align-items: baseline; gap: 8px; margin: 14px 0 20px; }
.hero-number strong { font-size: 3rem; color: var(--green); }
.hero-number span, .stats span { color: #637069; }

.primary, .secondary, .rating-buttons button {
  width: 100%; border: 0; border-radius: 12px; padding: 13px 16px; margin-top: 10px;
}
.primary { background: var(--green); color: white; font-weight: 700; }
.secondary { background: #edf1ed; color: var(--green); }
.primary:active, .secondary:active, .rating-buttons button:active { transform: translateY(1px); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.stats .card { padding: 14px 8px; text-align: center; }
.stats strong, .stats span { display: block; }
.stats strong { margin-bottom: 3px; font-size: 1.35rem; }
.stats span { font-size: .76rem; }
.tip h2, #settingsPage h2 { margin-top: 0; font-size: 1rem; }
.tip p { margin-bottom: 0; }

.question-meta { display: flex; justify-content: space-between; align-items: center; color: #68726c; font-size: .85rem; }
.question-card h2 { font-size: 1.08rem; line-height: 1.75; margin: 18px 0 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tags span { padding: 3px 8px; border-radius: 8px; background: #f2f4f1; color: #68726c; font-size: .74rem; }
.options { display: grid; gap: 10px; }
.option { display: flex; align-items: flex-start; gap: 10px; padding: 13px; border: 1px solid var(--border); border-radius: 12px; line-height: 1.55; }
.option:has(input:checked) { border-color: var(--green-2); background: #eef6f1; }
.option input { margin-top: 4px; accent-color: var(--green); }
.feedback { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.feedback h3 { color: var(--green); }
.feedback h3.wrong { color: var(--red); }
.rating-buttons { margin-top: 18px; }
.rating-buttons button { background: #edf1ed; color: #243c32; }
.rating-buttons button:nth-of-type(1) { border: 1px solid #e1b4b2; }
.rating-buttons button:nth-of-type(3) { border: 1px solid #aac9b8; }

label { display: grid; gap: 7px; margin: 15px 0; color: #3b4842; }
input[type="url"], input[type="password"], input[type="number"] { width: 100%; border: 1px solid #cfd8d1; border-radius: 10px; padding: 12px; background: white; }
.bottom-nav { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(3, 1fr); padding: 8px 10px max(8px, env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); border-top: 1px solid var(--border); }
.bottom-nav button { border: 0; background: transparent; padding: 10px; color: #718078; }
.bottom-nav button.active { color: var(--green); font-weight: 700; }
.muted { color: #6a766f; font-size: .85rem; line-height: 1.55; }
.error { color: var(--red); }
.hidden { display: none !important; }
.empty { text-align: center; }

@media (min-width: 700px) {
  .topbar { padding-left: calc((100% - 690px) / 2); padding-right: calc((100% - 690px) / 2); }
  .bottom-nav { left: 50%; right: auto; width: 720px; transform: translateX(-50%); border: 1px solid var(--border); border-bottom: 0; border-radius: 18px 18px 0 0; }
}
