:root {
  --paper: #f2f5f3;
  --white: #ffffff;
  --ink: #171716;
  --muted: #5e6662;
  --line: #c5cbc8;
  --coral: #ff5f50;
  --cyan: #2fc0c7;
  --yellow: #ffd449;
  --green: #50a16a;
  --purple: #8068c8;
  --shadow: 7px 7px 0 var(--ink);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
[hidden] { display: none !important; }
.lucide { width: 19px; height: 19px; stroke-width: 2.3; flex: 0 0 auto; }

.topbar {
  display: flex;
  width: min(1160px, calc(100% - 40px));
  min-height: 72px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--ink);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 18px; font-weight: 900; text-decoration: none; }
.brand-mark { display: grid; width: 42px; height: 34px; place-items: center; background: var(--ink); color: var(--white); line-height: 1; }
.icon-text-button, .link-button { display: inline-flex; min-height: 44px; padding: 8px 0; align-items: center; gap: 7px; background: transparent; color: var(--ink); border: 0; font-weight: 800; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
main { min-height: calc(100vh - 154px); }
.screen { display: none; }
.screen.is-active { display: block; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.18; letter-spacing: 0; }
h1 { font-size: 68px; font-weight: 950; }
h2 { font-size: 30px; }
h3 { font-size: 20px; }
.eyebrow, .section-number { margin-bottom: 10px; color: var(--coral); font-size: 13px; font-weight: 950; text-transform: uppercase; }

.home-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, .85fr);
  width: min(1160px, calc(100% - 40px));
  min-height: 555px;
  margin: 0 auto;
  padding: 52px 0 38px;
  align-items: center;
  gap: 72px;
}
.hero-copy h1 { margin-bottom: 20px; }
.hero-copy h1 span { color: var(--coral); }
.hero-lead { max-width: 640px; margin-bottom: 28px; color: #303634; font-size: 19px; }
.hero-art { margin: 0; }
.hero-art img { display: block; width: 100%; height: auto; border: 2px solid var(--ink); box-shadow: var(--shadow); }
.hero-art figcaption { margin-top: 14px; color: var(--muted); font-size: 13px; }
.fact-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 560px; background: var(--white); border: 2px solid var(--ink); }
.fact-row div { min-width: 0; padding: 11px 14px; border-right: 2px solid var(--ink); }
.fact-row div:last-child { border-right: 0; }
.fact-row strong, .fact-row span { display: block; }
.fact-row strong { font-size: 25px; line-height: 1.2; }
.fact-row span { color: var(--muted); font-size: 12px; }
.start-band {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(420px, 1fr);
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  padding: 58px 0 80px;
  gap: 80px;
  border-top: 2px solid var(--ink);
}
.start-band > div > p:last-child { max-width: 500px; color: var(--muted); }
.action-form { padding: 25px; background: var(--white); border: 2px solid var(--ink); box-shadow: var(--shadow); }
label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 850; }
input { width: 100%; min-height: 50px; padding: 11px 13px; background: var(--white); color: var(--ink); border: 2px solid var(--ink); border-radius: 0; }
input::placeholder { color: #78817c; }
.primary-button, .secondary-button {
  display: inline-flex;
  min-height: 50px;
  padding: 11px 18px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 2px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  font-weight: 900;
}
.primary-button { background: var(--coral); box-shadow: 4px 4px 0 var(--ink); }
.secondary-button { background: var(--white); box-shadow: 3px 3px 0 var(--ink); }
.primary-button:hover:not(:disabled), .secondary-button:hover:not(:disabled) { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--ink); }
.primary-button:disabled, .secondary-button:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.block-button { width: 100%; margin-top: 18px; }
.form-note { margin: 13px 0 0; color: var(--muted); font-size: 12px; }
.button-link { text-decoration: none; }

.invite-shell { width: min(720px, calc(100% - 40px)); margin: 0 auto; padding: 78px 0 105px; text-align: center; }
.invite-shell h1 { margin-bottom: 20px; font-size: 50px; }
.invite-shell h1 span { color: var(--coral); overflow-wrap: anywhere; }
.invite-shell > p:not(.eyebrow) { max-width: 590px; margin-right: auto; margin-left: auto; color: var(--muted); }
.challenge-stamp { display: grid; width: 116px; height: 86px; margin: 0 auto 32px; place-items: center; background: var(--yellow); border: 2px solid var(--ink); box-shadow: var(--shadow); font-size: 20px; font-weight: 950; transform: rotate(-3deg); }
.compact-form { max-width: 520px; margin: 34px auto 0; text-align: left; }

.quiz-shell { width: min(920px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 72px; }
.quiz-topline { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 13px; }
.quiz-topline div span, .quiz-topline div strong { display: block; }
.quiz-topline div span { color: var(--muted); font-size: 12px; }
.quiz-topline div strong { font-size: 20px; overflow-wrap: anywhere; }
.quiz-topline > strong { font-size: 18px; }
.progress-track { height: 11px; background: #dce2df; border: 2px solid var(--ink); overflow: hidden; }
.progress-track span { display: block; width: 12.5%; height: 100%; background: var(--cyan); transition: width .2s ease; }
.question-stage { min-height: 510px; padding: 42px 0 26px; }
.question-meta { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 22px; color: var(--coral); font-size: 13px; font-weight: 900; }
.question-scene { max-width: 730px; margin-bottom: 8px; color: var(--muted); font-size: 17px; }
.question-stage h1 { max-width: 800px; margin-bottom: 32px; font-size: 36px; }
.choice-list { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.choice-button { position: relative; display: flex; min-height: 148px; padding: 22px 22px 22px 62px; align-items: center; background: var(--white); color: var(--ink); border: 2px solid var(--ink); text-align: left; font-weight: 750; box-shadow: 5px 5px 0 var(--ink); }
.choice-button:hover { background: var(--yellow); transform: translate(1px, 1px); box-shadow: 4px 4px 0 var(--ink); }
.choice-button.is-selected { background: var(--cyan); }
.choice-letter { position: absolute; top: 18px; left: 18px; display: grid; width: 29px; height: 29px; place-items: center; background: var(--ink); color: var(--white); font-size: 13px; }
.quiz-navigation { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-top: 20px; border-top: 2px solid var(--ink); }
.save-state { margin: 16px 0 0; color: var(--muted); font-size: 12px; text-align: center; }

.waiting-shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(330px, .72fr); width: min(1040px, calc(100% - 40px)); margin: 0 auto; padding: 76px 0 105px; gap: 74px; align-items: center; }
.waiting-copy h1 { margin-bottom: 18px; font-size: 50px; }
.waiting-copy > p:not(.eyebrow) { color: var(--muted); }
.waiting-signal { display: flex; width: 92px; height: 62px; margin-bottom: 32px; align-items: center; justify-content: center; gap: 8px; background: var(--yellow); border: 2px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); }
.waiting-signal span { width: 11px; height: 11px; background: var(--ink); animation: pulse 1.2s infinite ease-in-out; }
.waiting-signal span:nth-child(2) { animation-delay: .15s; }
.waiting-signal span:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 0%, 70%, 100% { transform: translateY(0); } 35% { transform: translateY(-8px); } }
.own-result { max-width: 520px; margin-top: 28px; padding: 18px 0; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.own-result strong, .own-result span { display: block; }
.own-result strong { font-size: 22px; }
.own-result span { color: var(--muted); font-size: 13px; }
.share-panel { padding: 26px; background: var(--white); border: 2px solid var(--ink); box-shadow: var(--shadow); }
.share-panel canvas { display: block; width: 184px; height: 184px; margin: 0 auto 24px; image-rendering: pixelated; }
.share-panel input { color: var(--muted); font-size: 13px; }
.share-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.share-panel .link-button { margin: 15px auto 0; }

.result-shell { width: min(1100px, calc(100% - 40px)); margin: 0 auto; padding: 56px 0 82px; }
.result-header { max-width: 850px; margin: 0 auto 45px; text-align: center; }
.result-header h1 { margin-bottom: 14px; font-size: 54px; overflow-wrap: anywhere; }
.verdict-block { max-width: 720px; margin: 26px auto 0; padding: 24px; background: var(--yellow); border: 2px solid var(--ink); box-shadow: var(--shadow); }
.verdict-block > span { color: var(--coral); font-size: 12px; font-weight: 950; }
.result-verdict { margin: 9px 0 10px; font-size: 22px; font-weight: 900; }
.result-kicker { margin: 0; color: #37403c; font-size: 15px; }
.versus-board { display: grid; grid-template-columns: 1fr 80px 1fr; align-items: stretch; }
.player-card { min-width: 0; min-height: 210px; padding: 27px; background: var(--white); border: 2px solid var(--ink); }
.player-card.is-winner { background: var(--yellow); box-shadow: var(--shadow); }
.player-card .player-role { margin-bottom: 13px; color: var(--muted); font-size: 12px; font-weight: 850; }
.player-card h2 { margin-bottom: 30px; overflow-wrap: anywhere; }
.player-card .level-caption { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 850; }
.player-card .level-name { margin: 0; color: var(--coral); font-size: 24px; font-weight: 950; }
.versus-mark { display: grid; place-items: center; font-size: 29px; font-weight: 950; }
.result-actions { display: flex; justify-content: center; gap: 18px; margin-top: 42px; }
.expiry-note { margin: 24px 0 0; color: var(--muted); font-size: 12px; text-align: center; }

.status-screen { width: min(680px, calc(100% - 40px)); margin: 0 auto; padding: 92px 0 120px; text-align: center; }
.status-screen h1 { margin-bottom: 16px; font-size: 46px; }
.status-screen > p:not(.eyebrow) { color: var(--muted); }
.loading-mark, .message-mark { display: grid; width: 108px; height: 82px; margin: 0 auto 30px; place-items: center; background: var(--cyan); border: 2px solid var(--ink); box-shadow: var(--shadow); font-size: 22px; font-weight: 950; transform: rotate(3deg); }
.message-mark { background: var(--yellow); transform: rotate(-3deg); }
.message-actions { display: flex; justify-content: center; gap: 16px; margin-top: 30px; }

footer { display: flex; width: min(1160px, calc(100% - 40px)); min-height: 82px; margin: 0 auto; align-items: center; justify-content: space-between; gap: 20px; border-top: 2px solid var(--ink); color: var(--muted); font-size: 13px; }
footer a { color: var(--ink); font-weight: 800; }
.legal-page { width: min(760px, calc(100% - 40px)); margin: 0 auto; padding: 48px 0 80px; }
.legal-page > a { display: inline-block; margin-bottom: 34px; color: var(--ink); font-weight: 800; }
.legal-page h1 { font-size: 48px; }
.legal-page h2 { margin-top: 34px; font-size: 22px; }
.legal-page p, .legal-page li { color: #37403c; }
.legal-notice { padding: 18px; background: var(--yellow); border-left: 5px solid var(--ink); font-weight: 700; }

dialog { width: min(620px, calc(100% - 28px)); padding: 0; background: var(--white); color: var(--ink); border: 2px solid var(--ink); border-radius: 0; box-shadow: 9px 9px 0 var(--ink); }
dialog::backdrop { background: rgba(23, 23, 22, .65); }
.dialog-header { display: flex; padding: 23px; align-items: start; justify-content: space-between; border-bottom: 2px solid var(--ink); }
.dialog-header span { color: var(--coral); font-size: 12px; font-weight: 900; }
.dialog-header h2 { margin: 2px 0 0; }
.dialog-header button { display: grid; width: 42px; height: 42px; padding: 0; place-items: center; background: transparent; border: 0; color: var(--ink); }
.dialog-body { padding: 23px; }
.dialog-body dl { margin: 0 0 20px; }
.dialog-body dl div { display: grid; grid-template-columns: 70px 1fr; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.dialog-body dt { font-weight: 900; }
.dialog-body dd { margin: 0; color: #37403c; }
.dialog-body p { margin-bottom: 0; padding: 12px; background: var(--yellow); font-size: 13px; font-weight: 750; }
.wechat-share-guide[hidden] { display: none; }
.wechat-share-guide { position: fixed; z-index: 100; inset: 0; display: grid; padding: 96px 28px 36px; place-items: start center; background: rgba(23, 23, 22, .92); color: var(--white); text-align: center; }
.wechat-guide-arrow { position: absolute; top: 4px; right: 25px; color: var(--yellow); font-size: 88px; font-weight: 950; line-height: 1; transform: rotate(22deg); }
.wechat-guide-close { position: absolute; top: 20px; left: 20px; display: grid; width: 44px; height: 44px; padding: 0; place-items: center; background: transparent; color: var(--white); border: 2px solid var(--white); }
.wechat-guide-copy { width: min(520px, 100%); }
.wechat-guide-copy p { margin: 0 0 10px; color: var(--cyan); font-size: 13px; font-weight: 900; text-transform: uppercase; }
.wechat-guide-copy h2 { margin: 0 0 10px; color: var(--white); font-size: 36px; }
.wechat-guide-copy strong { display: block; color: var(--yellow); font-size: 22px; }
.wechat-guide-copy > span { display: block; margin: 18px 0 28px; color: #d8d8d2; }
.wechat-guide-copy .secondary-button { margin: 0 auto; background: var(--white); color: var(--ink); }
.toast { position: fixed; z-index: 50; right: 20px; bottom: 20px; max-width: min(360px, calc(100% - 40px)); padding: 12px 16px; background: var(--ink); color: var(--white); opacity: 0; pointer-events: none; transform: translateY(12px); transition: .2s ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 840px) {
  .home-shell { grid-template-columns: 1fr; gap: 34px; min-height: 0; }
  .hero-art { max-width: 620px; }
  .start-band { grid-template-columns: 1fr; gap: 28px; }
  .choice-list { grid-template-columns: 1fr; }
  .waiting-shell { grid-template-columns: 1fr; gap: 44px; }
  .versus-board { grid-template-columns: 1fr; gap: 14px; }
  .versus-mark { min-height: 44px; }
}

@media (max-width: 560px) {
  .topbar, .home-shell, .start-band, .quiz-shell, .waiting-shell, .result-shell, footer { width: min(100% - 24px, 1160px); }
  .topbar { min-height: 62px; }
  .brand { font-size: 16px; }
  .home-shell { padding: 30px 0 36px; }
  h1, .hero-copy h1 { font-size: 46px; }
  .hero-lead { font-size: 17px; }
  .fact-row div { padding: 10px 8px; }
  .fact-row strong { font-size: 21px; }
  .start-band { padding: 40px 0 60px; }
  .action-form { padding: 18px; box-shadow: 5px 5px 0 var(--ink); }
  .invite-shell { width: min(100% - 24px, 720px); padding: 62px 0 88px; }
  .invite-shell h1 { font-size: 38px; }
  .quiz-shell { padding: 28px 0 58px; }
  .question-stage { min-height: 535px; padding-top: 30px; }
  .question-stage h1 { font-size: 28px; }
  .choice-button { min-height: 130px; }
  .quiz-navigation .primary-button, .quiz-navigation .secondary-button { min-width: 0; flex: 1; }
  .waiting-shell { padding: 60px 0 88px; }
  .waiting-copy h1 { font-size: 39px; }
  .share-buttons { grid-template-columns: 1fr; }
  .result-shell { padding-top: 42px; }
  .result-header h1 { font-size: 40px; }
  .verdict-block { padding: 20px 17px; }
  .result-verdict { font-size: 19px; }
  .player-card { padding: 21px; }
  .result-actions, .message-actions { flex-direction: column; }
  .result-actions > *, .message-actions > * { width: 100%; }
  footer { padding: 19px 0; align-items: start; flex-direction: column; justify-content: center; }
  .legal-page { width: min(100% - 24px, 760px); }
  .legal-page h1 { font-size: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
