:root {
  --bg: #eee7da;
  --bg-dark: #282624;
  --card: #ffffff;
  --ink: #22201e;
  --muted: #5d574f;
  --soft: #7e776d;
  --yellow: #ffd84d;
  --yellow-deep: #f4c328;
  --red: #d94336;
  --tape: rgba(232, 221, 187, 0.94);
  --border: #22201e;
  --radius: 20px;
  --display: "ZCOOL QingKe HuangYou", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --ui: "M PLUS Rounded 1c", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: clip;
}
body.is-dark { background: var(--bg-dark); color: #f8f5ef; }
button, input { font-family: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--yellow); color: var(--ink); }

.wrap {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding:
    max(18px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(48px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}
body[data-screen="quiz"] .wrap,
body[data-screen="reveal"] .wrap,
body[data-screen="verdict"] .wrap {
  width: min(680px, 100%);
}
.stage-start,
.page-nav {
  width: min(640px, 100%);
  margin-inline: auto;
}

.pill-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--card);
  color: var(--ink);
  border: 2px solid var(--border);
  border-radius: 999px;
  padding: 7px 10px 7px 8px;
  box-shadow: 0 3px 0 var(--border);
  width: min(680px, 100%);
  margin: 0 auto 26px;
}
.header-left, .header-actions { display: flex; align-items: center; gap: 8px; min-width: 0; }
.header-title {
  font-weight: 800;
  font-size: 0.98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill-btn, .icon-btn, .mode-chip, .choice-btn, .btn-primary, .btn-ghost, .btn-outline, .text-link {
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.12s ease;
}
.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-weight: 800;
  font-size: 0.86rem;
}
.pill-btn:hover, .icon-btn:hover { background: var(--yellow); }
.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  padding: 0;
}
.icon-btn svg { width: 18px; height: 18px; display: block; }
.icon-btn[aria-pressed="true"] { background: var(--ink); color: var(--yellow); }

.stage-start { text-align: center; padding: 2px 4px 8px; }
.hero { display: flex; justify-content: center; margin: 4px 0 12px; }
.hero svg {
  width: min(320px, 86vw);
  height: auto;
  filter: drop-shadow(0 6px 0 rgba(34, 32, 30, 0.12));
}
.start-title {
  margin: 2px 0 8px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.45rem, 8vw, 3.45rem);
  line-height: 1.28;
  letter-spacing: 0.01em;
}
.marker {
  background: linear-gradient(180deg, transparent 46%, var(--yellow) 46%, var(--yellow) 90%, transparent 90%);
  padding: 0 8px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.start-tagline { margin: 0 auto 4px; max-width: 28rem; font-weight: 800; font-size: 1.05rem; }
.local-name { margin: 0 0 8px; font-weight: 800; color: var(--soft); }
.start-rules { margin: 0 auto 16px; color: var(--muted); font-weight: 700; font-size: 0.92rem; }
.mode-pills { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.mode-chip {
  padding: 6px 14px;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-weight: 800;
  font-size: 0.86rem;
}
.mode-chip.active { background: var(--ink); color: var(--yellow); }
.mode-blurb { margin: 0 0 16px; color: var(--muted); font-size: 0.86rem; font-weight: 700; min-height: 1.3em; }
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 340px;
  min-height: 54px;
  padding: 12px 24px;
  border: 2.5px solid var(--border);
  border-radius: 16px;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 900;
  font-size: 1.12rem;
  box-shadow: 0 4px 0 var(--border);
}
.btn-primary:hover { background: var(--yellow-deep); }
.btn-primary:active, .choice-btn:active, .btn-outline:active, .btn-ghost:active, .pill-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--border);
}
.start-tip, .choice-tip, .fine {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}
.start-tip { margin: 14px auto 8px; max-width: 28rem; }
.start-stats { margin: 0 0 4px; color: var(--muted); font-size: 0.86rem; }
.fine { margin: 8px 0 0; font-weight: 600; }

.hud {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.hud.shake { animation: hudShake 0.36s ease; }
@keyframes hudShake {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-5px); }
  60% { transform: translateX(5px); }
}
.q-counter { font-weight: 800; font-size: 0.95rem; }
.q-counter strong { font-size: 1.05rem; }
.conf-label { font-weight: 800; font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.conf-track {
  flex: 1;
  height: 12px;
  background: rgba(34, 32, 30, 0.08);
  border: 2px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.conf-fill { height: 100%; border-radius: 999px; transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1), background 0.3s; }
.conf-fill.low { background: #5ba8a0; }
.conf-fill.mid { background: #f29f3d; }
.conf-fill.high { background: #e05245; }
.conf-pct { min-width: 42px; text-align: end; font-weight: 900; }
.conf-pct.high { color: var(--red); }

.taped-card {
  position: relative;
  margin-top: 10px;
  background: var(--card);
  color: var(--ink);
  border: 2.5px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 22px 22px;
  box-shadow: 0 6px 0 rgba(34, 32, 30, 0.12);
}
.tape {
  position: absolute;
  top: -12px;
  left: 50%;
  width: 92px;
  height: 22px;
  transform: translateX(-50%) rotate(-2deg);
  background: var(--tape);
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.question-card { text-align: center; animation: cardIn 0.28s ease; }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-weight: 800;
  font-size: 0.9rem;
}
.cat-ico {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}
.cat-ico svg { width: 16px; height: 16px; }
.cat-home .cat-ico { background: #f3e2d2; }
.cat-toy .cat-ico { background: #ffe3a3; }
.cat-screen .cat-ico { background: #d7f0e4; }
.cat-net .cat-ico { background: #e3dcff; }
.cat-pop .cat-ico { background: #ffd5dc; }
.q-title {
  margin: 0 0 8px;
  font-size: clamp(1.45rem, 4vw, 1.85rem);
  font-weight: 900;
  line-height: 1.28;
}
.q-sub { margin: 0 0 12px; color: var(--muted); font-weight: 700; font-size: 0.95rem; }
.q-ask { margin: 0; font-weight: 900; font-size: 1.02rem; }

.choices { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.choice-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  font-weight: 800;
  font-size: 1rem;
  text-align: left;
  box-shadow: 0 3px 0 var(--border);
}
.choice-btn:hover, .choice-btn.is-picked { background: #fff9df; }
.choice-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.choice-left > span:last-child { min-width: 0; overflow-wrap: break-word; }
.dots { display: inline-flex; gap: 4px; }
.dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: transparent;
}
.dots i.on { background: var(--ink); }
.choice-key { color: var(--soft); font-size: 0.8rem; font-weight: 800; }
.choice-tip { text-align: center; margin: 12px 0 0; }

.reveal {
  min-height: calc(100dvh - 180px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 8px 12px;
}
.reveal-lead { margin: 0 0 8px; color: #b8b0a4; font-weight: 800; font-size: 1.12rem; }
.reveal-sub { margin: 0; font-weight: 900; font-size: 1.28rem; }
.reveal-age-wrap { opacity: 0; transform: scale(0.92); transition: opacity 0.45s ease, transform 0.45s ease; margin: 8px 0 22px; }
.reveal-age-wrap.visible { opacity: 1; transform: scale(1); }
.reveal-age {
  font-family: var(--display);
  font-size: clamp(3.1rem, 10vw, 4.6rem);
  line-height: 1.15;
  font-weight: 400;
}
.reveal-underline { height: 7px; width: 78%; margin: 6px auto 0; border-radius: 999px; background: var(--red); }
.reveal-ask { margin: 0 0 14px; font-weight: 800; font-size: 1.12rem; }
.reveal-btn-row { display: flex; gap: 12px; width: min(380px, 100%); }
.reveal-btn-row .btn-primary, .reveal-btn-row .btn-ghost { max-width: none; flex: 1; }
.btn-ghost {
  min-height: 54px;
  border-radius: 16px;
  border: 2.5px solid #f8f5ef;
  background: transparent;
  color: #f8f5ef;
  font-weight: 900;
  font-size: 1.05rem;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }
.text-link {
  margin-top: 18px;
  background: none;
  border: 0;
  color: #a39990;
  font-weight: 800;
  text-decoration: underline;
  font-size: 0.92rem;
}
.revise { width: min(380px, 100%); }
.revise p { margin: 0 0 10px; font-weight: 800; }
.age-input {
  width: 148px;
  margin: 0 auto 12px;
  display: block;
  text-align: center;
  font-size: 2rem;
  font-weight: 900;
  padding: 8px 10px;
  border-radius: 16px;
  border: 2.5px solid #f8f5ef;
  background: transparent;
  color: #f8f5ef;
}
.age-input:focus { outline: 3px solid var(--yellow); }
.age-input.bad { animation: hudShake 0.36s ease; border-color: #ffb4ae; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.verdict-card, .strata-card, .clincher-card { text-align: left; }
.kicker { margin: 0 0 4px; color: var(--muted); font-size: 0.84rem; font-weight: 800; }
.verdict-you { margin: 0; font-weight: 800; }
.verdict-age {
  margin: 2px 0 6px;
  font-family: var(--display);
  font-size: clamp(2.3rem, 7vw, 3.1rem);
  font-weight: 400;
  line-height: 1.2;
}
.verdict-sub, .verdict-line, .feedback { margin: 0 0 6px; font-weight: 800; }
.verdict-sub, .verdict-line { color: var(--muted); }
.feedback.hit { color: #1f7a45; }
.feedback.miss { color: var(--red); }
.strata-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.strata-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  padding: 6px 10px;
  border-radius: 10px;
  overflow: hidden;
  background: #f7f3ea;
}
.strata-row.hatched {
  background-image: repeating-linear-gradient(-45deg, transparent, transparent 7px, rgba(34, 32, 30, 0.05) 7px, rgba(34, 32, 30, 0.05) 13px);
}
.strata-fill { position: absolute; inset: 0 auto 0 0; border-radius: 10px; opacity: 0.95; }
.strata-decade, .strata-tags, .strata-empty { position: relative; z-index: 1; }
.strata-decade { font-weight: 900; font-size: 0.86rem; white-space: nowrap; flex: 0 0 auto; }
.strata-empty { color: var(--soft); font-size: 0.8rem; font-weight: 800; }
.strata-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; max-width: 62%; }
.strata-tags span {
  background: #fff;
  border: 1.5px solid rgba(34, 32, 30, 0.16);
  border-radius: 7px;
  padding: 2px 7px;
  font-size: 0.74rem;
  font-weight: 800;
  max-width: 9.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.clincher-card h3 { margin: 0 0 6px; font-size: 1.2rem; }
.clincher-card p { margin: 0; color: var(--muted); font-weight: 700; }
.verdict-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 6px; }
.btn-row { display: flex; gap: 10px; width: min(340px, 100%); }
.btn-outline {
  flex: 1;
  min-height: 46px;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font-weight: 800;
}
.btn-outline:hover { background: #faf6ed; }

.modal-back {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(34, 32, 30, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(16px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}
.modal {
  position: relative;
  width: min(440px, 100%);
  max-height: min(90dvh, 860px);
  overflow: auto;
  background: var(--card);
  color: var(--ink);
  border: 2.5px solid var(--border);
  border-radius: 22px;
  padding: 26px 20px 20px;
  text-align: center;
}
.modal-x {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--muted);
}
.modal h2 { margin: 0 0 12px; font-size: 1.28rem; }
.modal ul { margin: 0 0 16px; padding-left: 1.15rem; text-align: left; }
.modal li { margin: 0 0 8px; font-weight: 700; }
.modal p { margin: 0 0 12px; font-weight: 700; color: var(--muted); text-align: left; }
.modal .btn-primary { max-width: none; }
.share-modal img { width: min(280px, 100%); border-radius: 16px; border: 2px solid var(--border); margin: 0 auto 12px; display: block; }
.share-modal p { text-align: center; }

.place-line {
  display: inline-block;
  margin: 0 0 10px;
  padding: 2px 12px;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--yellow);
  font-weight: 800;
  font-size: 0.86rem;
}
.edition-list { margin: 4px 0 14px; }
.edition-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 8px;
  border: 0;
  border-bottom: 1px solid #e6e0d4;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
  font-weight: 800;
  font-size: 1.05rem;
}
.edition-row:hover { background: #fff8e4; }
.edition-row.active { background: #fff3c4; }
.edition-num { width: 1.2rem; flex: 0 0 auto; color: var(--soft); font-variant-numeric: tabular-nums; }
.edition-name { flex: 1; display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; min-width: 0; }
.edition-local { font-size: 0.78rem; color: var(--muted); font-weight: 700; }
.edition-place { color: var(--soft); font-size: 0.82rem; font-weight: 700; text-align: right; max-width: 46%; }

.dare-banner {
  margin: 0 auto 14px;
  max-width: 28rem;
  background: var(--ink);
  color: var(--yellow);
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 800;
}
.page-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin: 28px 0 4px;
}
.page-nav a {
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  border-bottom: 2px solid var(--yellow);
}
.landing { display: flex; flex-direction: column; gap: 28px; margin-top: 18px; text-align: left; }
.landing h2 { margin: 0 0 8px; font-size: clamp(1.35rem, 4vw, 1.7rem); line-height: 1.25; }
.section-note { margin: 0 0 14px; color: var(--muted); font-weight: 700; }
.bank-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.bank-card, .mode-card, .step-card, .pin, .faq-item {
  border: 2px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 3px 0 var(--border);
}
.bank-card, .mode-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  min-width: 0;
  padding: 14px;
  text-align: left;
  font-weight: 700;
}
.bank-card.active, .mode-card.active { background: #fff6d0; }
.bank-local { color: var(--soft); font-size: 0.78rem; font-weight: 800; }
.bank-place { font-size: 1rem; font-weight: 900; line-height: 1.25; overflow-wrap: break-word; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.mini-chip {
  background: var(--bg);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 800;
}
.bank-go { margin-top: auto; font-weight: 900; font-size: 0.86rem; }
.mode-stack { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mode-card { padding: 12px 10px; }
.mode-card-top { display: flex; width: 100%; justify-content: space-between; gap: 2px 8px; align-items: baseline; flex-wrap: wrap; }
.mode-card-top strong { min-width: 0; overflow-wrap: break-word; }
.mode-time { color: var(--soft); font-size: 0.78rem; font-weight: 800; }
.mode-card-body { color: var(--muted); font-weight: 700; font-size: 0.84rem; line-height: 1.45; overflow-wrap: break-word; }
.steps, .pin-list, .faq-list { display: flex; flex-direction: column; gap: 10px; }
.step-card { padding: 14px 16px; }
.step-card h3 { margin: 2px 0 4px; font-size: 1.05rem; }
.step-card p, .faq-item p { margin: 0; color: var(--muted); font-weight: 700; }
.step-no { font-weight: 900; color: var(--soft); }
.pin { display: flex; gap: 12px; align-items: baseline; padding: 10px 12px; }
.pin-year { font-weight: 900; min-width: 3.4rem; }
.pin-title { font-weight: 800; flex: 1; }
.pin-cat { color: var(--soft); font-size: 0.78rem; font-weight: 800; white-space: nowrap; }
.faq-item summary { cursor: pointer; font-weight: 800; padding: 12px 14px; }
.faq-item p { padding: 0 14px 14px; }
.site-foot { margin: 0; text-align: center; color: var(--muted); font-weight: 700; font-size: 0.9rem; }
.dare-btn { width: min(340px, 100%); }
.share-status {
  width: min(340px, 100%);
  margin: 0;
  padding: 10px 14px;
  border: 2.5px solid var(--border);
  border-radius: 14px;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 900;
  text-align: center;
}
.share-fallback {
  width: min(340px, 100%);
  min-height: 44px;
  padding: 8px 10px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font-weight: 800;
}
.static-home { padding-bottom: 28px; }
.static-langs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.static-langs a {
  padding: 4px 10px;
  border: 2px solid var(--border);
  border-radius: 999px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  background: var(--card);
}
@media (max-width: 767px) {
  .bank-grid, .mode-stack { gap: 8px; }
  .bank-card, .mode-card { padding: 10px 8px; }
  .bank-local { font-size: 0.7rem; }
  .bank-place { font-size: 0.92rem; }
  .mini-chip { font-size: 0.66rem; padding: 1px 6px; }
  .bank-go { font-size: 0.78rem; }
  .mode-card-top { flex-direction: column; align-items: flex-start; gap: 0; }
  .mode-time { font-size: 0.7rem; }
  .mode-card-body { font-size: 0.74rem; line-height: 1.35; }
  .pin-cat { display: none; }
  .taped-card { padding: 24px 16px 16px; }
  .choice-btn { padding: 12px; font-size: 0.95rem; }
  .strata-decade { white-space: normal; }
  .strata-tags { max-width: 54%; }
  .q-sub { font-size: 0.9rem; }
}

@media (min-width: 768px) {
  .wrap {
    padding-left: max(28px, env(safe-area-inset-left));
    padding-right: max(28px, env(safe-area-inset-right));
  }
  .bank-grid, .mode-stack { gap: 12px; }
  .bank-card, .mode-card { padding: 16px 14px; }
  .bank-place { font-size: 1.12rem; }
  .mode-card-body { font-size: 0.9rem; }
  .landing { gap: 36px; }
  .hero svg { width: min(360px, 86vw); }
  .steps, .pin-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1100px) {
  .bank-place { font-size: 1.22rem; }
  .mode-card-body { font-size: 0.95rem; }
  .landing h2 { font-size: 1.9rem; }
  .faq-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
}

button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

@media (max-width: 380px) {
  .header-title, .conf-label, .choice-key { display: none; }
  .pill-header { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .reveal-age-wrap { opacity: 1; transform: none; }
}
