:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #6f6b63;
  --paper: #f5f0e8;
  --card: #fffdf8;
  --line: #ded7ca;
  --orange: #ec6d3d;
  --orange-dark: #b94d28;
  --teal: #2d8b83;
  --red: #b7392f;
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button, input { font: inherit; }
button { cursor: pointer; }
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 18px clamp(18px, 4vw, 56px); border-bottom: 1px solid var(--line); background: rgba(255,253,248,.8); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .03em; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; color: #fff; background: var(--ink); border-radius: 9px; }
.top-note { color: var(--muted); font-size: 13px; text-align: right; }
.page { width: min(1040px, calc(100% - 32px)); margin: 0 auto; padding: 40px 0 64px; flex: 1; }
.hero { display: grid; grid-template-columns: 1.25fr .75fr; gap: 28px; align-items: stretch; margin: 18px 0 28px; }
.hero-copy, .panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 30px rgba(62,45,24,.06); }
.hero-copy { padding: clamp(26px, 5vw, 54px); }
.eyebrow { color: var(--orange-dark); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 13px 0 14px; font-size: clamp(36px, 7vw, 72px); line-height: 1.04; letter-spacing: -.04em; }
h2 { margin: 0 0 12px; font-size: clamp(25px, 4vw, 38px); line-height: 1.2; }
h3 { margin: 0; font-size: 20px; }
p { line-height: 1.7; }
.subtle { color: var(--muted); }
.hero-art { border-radius: 14px; padding: 26px; min-height: 290px; background: var(--ink); color: #fff; display: flex; align-items: end; overflow: hidden; position: relative; }
.hero-art::before { content: ""; position: absolute; width: 240px; height: 240px; right: -60px; top: -60px; border: 1px solid rgba(255,255,255,.28); border-radius: 50%; box-shadow: 0 0 0 24px rgba(255,255,255,.06), 0 0 0 48px rgba(255,255,255,.04); }
.ticket { position: relative; z-index: 1; border-left: 4px solid var(--orange); padding-left: 18px; }
.ticket strong { display: block; color: #ffc4a6; font-size: 12px; letter-spacing: .13em; }
.ticket h2 { margin-top: 10px; font-size: 42px; }
.panel { padding: 24px; }
.home-panel { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.btn { border: 0; border-radius: 9px; padding: 12px 18px; min-height: 44px; font-weight: 700; }
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-dark); }
.btn-secondary { background: var(--ink); color: #fff; }
.btn-quiet { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn:disabled { opacity: .45; cursor: default; }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; }
.share-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin: 22px 0; }
.share-row input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 24px 0; }
.step { border-top: 3px solid var(--teal); padding: 13px 3px 0; }
.step strong { display: block; margin-bottom: 4px; }
.step span { color: var(--muted); font-size: 13px; }
.room-head { display: flex; justify-content: space-between; gap: 20px; align-items: end; }
.room-code { color: var(--orange-dark); font-weight: 900; letter-spacing: .16em; font-size: 24px; }
.stat-line { display: flex; gap: 26px; color: var(--muted); margin: 14px 0 0; }
.stat-line strong { color: var(--ink); font-size: 26px; margin-right: 4px; }
.empty { color: var(--muted); padding: 30px 0 5px; }
.submission { border-top: 1px solid var(--line); padding: 22px 0 4px; }
.submission:first-child { border-top: 0; }
.submission-head { display: flex; justify-content: space-between; gap: 16px; align-items: start; }
.submission-meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.match-list { margin-top: 15px; display: grid; gap: 9px; }
.match { display: grid; grid-template-columns: 32px 1fr auto; gap: 12px; align-items: center; padding: 11px 12px; border-radius: 10px; background: #f8f3eb; }
.rank { width: 25px; height: 25px; display: grid; place-items: center; background: var(--ink); color: #fff; border-radius: 50%; font-size: 12px; }
.match-title { font-weight: 800; }
.quote { color: var(--red); font-size: 13px; line-height: 1.5; margin-top: 3px; }
.percent { font-weight: 900; color: var(--orange-dark); font-size: 20px; }
.quiz { max-width: 760px; margin: 0 auto; }
.quiz-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.progress { height: 5px; background: #dfd7ca; border-radius: 99px; overflow: hidden; margin-top: 12px; }
.progress span { display: block; height: 100%; background: var(--orange); transition: width .2s ease; }
.counter { color: var(--muted); font-size: 13px; white-space: nowrap; }
.question-label { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .11em; }
.question-text { margin: 12px 0 23px; font-size: clamp(24px, 4vw, 34px); line-height: 1.4; }
.option-list { display: grid; gap: 11px; }
.option { position: relative; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option label { display: block; padding: 15px 17px 15px 50px; border: 1px solid var(--line); border-radius: 10px; background: #fff; line-height: 1.55; position: relative; }
.option label::before { content: attr(data-letter); position: absolute; left: 16px; top: 14px; width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; background: #eee8dc; color: var(--muted); font-weight: 800; font-size: 12px; }
.option input:checked + label { border-color: var(--orange); background: #fff3eb; box-shadow: 0 0 0 2px rgba(236,109,61,.12); }
.option input:checked + label::before { background: var(--orange); color: #fff; }
.quiz-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.identity-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.identity-option label { text-align: center; padding: 22px 12px; }
.nickname { width: 100%; padding: 13px 14px; min-height: 48px; border: 1px solid var(--line); border-radius: 9px; background: #fff; margin-top: 16px; }
.result-head { text-align: center; margin-bottom: 22px; }
.result-head h1 { font-size: clamp(32px, 6vw, 56px); }
.results { max-width: 760px; margin: 0 auto; }
.result-card { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; padding: 19px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 11px; }
.result-rank { width: 36px; height: 36px; display: grid; place-items: center; background: var(--ink); color: #fff; border-radius: 50%; font-weight: 900; }
.result-title { font-size: 20px; font-weight: 900; }
.result-quote { color: var(--red); margin-top: 5px; font-size: 14px; line-height: 1.5; }
.result-percent { font-size: 27px; font-weight: 900; color: var(--orange-dark); }
.notice { padding: 13px 15px; border-radius: 9px; background: #f6eadf; color: #8d492e; line-height: 1.6; }
.footer { padding: 18px; text-align: center; color: var(--muted); font-size: 12px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20; padding: 11px 15px; border-radius: 9px; color: #fff; background: var(--ink); box-shadow: 0 10px 25px rgba(0,0,0,.18); }

@media (max-width: 720px) {
  .topbar { align-items: flex-start; }
  .top-note { max-width: 150px; }
  .page { width: min(100% - 22px, 680px); padding-top: 22px; }
  .hero { grid-template-columns: 1fr; }
  .hero-art { min-height: 220px; }
  .home-panel, .room-head { display: block; }
  .home-panel .button-row { margin-top: 20px; }
  .share-row { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .step { border-top: 0; border-left: 3px solid var(--teal); padding: 2px 0 2px 12px; }
  .match { grid-template-columns: 28px 1fr; }
  .percent { grid-column: 2; }
  .result-card { grid-template-columns: 36px 1fr; }
  .result-percent { grid-column: 2; }
  .identity-options { grid-template-columns: 1fr; }
}
