
:root {
  --ink: #102033;
  --ink-soft: #526174;
  --paper: #f2efe8;
  --paper-cool: #e9eef2;
  --surface: #fffdfa;
  --surface-strong: #ffffff;
  --line: #d7d4cd;
  --line-strong: #b9c0c8;
  --navy: #0b1728;
  --navy-soft: #152a43;
  --blue: #175cd3;
  --blue-dark: #0f46a4;
  --signal: #ff5c35;
  --signal-dark: #d63b1d;
  --teal: #087d71;
  --teal-soft: #dff6ef;
  --gold: #d99a16;
  --gold-soft: #fff1c9;
  --coral: #bd2b38;
  --coral-soft: #ffe6e8;
  --shadow-sm: 0 8px 24px rgba(11, 23, 40, 0.08);
  --shadow-lg: 0 28px 80px rgba(11, 23, 40, 0.17);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  min-height: 100dvh;
  margin: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(23, 92, 211, 0.12), transparent 34rem),
    radial-gradient(circle at 94% 8%, rgba(255, 92, 53, 0.09), transparent 30rem),
    var(--paper);
  letter-spacing: 0.01em;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.22;
  pointer-events: none;
  background-image: linear-gradient(rgba(16,32,51,.055) 1px, transparent 1px), linear-gradient(90deg, rgba(16,32,51,.055) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, #000, transparent 72%);
}
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
button, a, input { -webkit-tap-highlight-color: transparent; }
a { color: var(--blue); font-weight: 800; }
.auth-screen { min-height: 100dvh; display: grid; place-items: center; padding: 28px max(20px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }
.auth-layout { width: min(100%, 920px); display: grid; grid-template-columns: 1.15fr .85fr; overflow: hidden; border: 1px solid rgba(255,255,255,.3); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-lg); }
.auth-story { position: relative; min-height: 520px; padding: 46px; overflow: hidden; color: #fff; background: var(--navy); }
.auth-story::before { content: ""; position: absolute; width: 360px; height: 360px; right: -130px; bottom: -130px; border: 72px solid rgba(255,92,53,.9); border-radius: 50%; box-shadow: 0 0 0 34px rgba(255,255,255,.06), 0 0 0 72px rgba(255,255,255,.035); }
.auth-story::after { content: "01 / LIVE"; position: absolute; right: 34px; top: 40px; color: rgba(255,255,255,.32); font-family: "Songti SC", STSong, serif; font-size: 54px; font-weight: 800; letter-spacing: -.04em; writing-mode: vertical-rl; }
.auth-story h1 { position: relative; max-width: 420px; margin: 104px 0 18px; font-family: "Songti SC", STSong, serif; font-size: clamp(44px, 6vw, 72px); line-height: .98; letter-spacing: -.04em; }
.auth-story p { position: relative; max-width: 330px; color: #b9c8da; font-size: 17px; line-height: 1.8; }
.auth-panel, .panel { background: rgba(255,253,250,.96); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.auth-panel { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 46px 38px; border: 0; border-radius: 0; box-shadow: none; }
.auth-panel h2, .panel h2, .player-status-row h2 { margin: 5px 0 0; font-size: 24px; line-height: 1.2; letter-spacing: -.03em; }
.subtle, .hint { color: var(--ink-soft); line-height: 1.65; }
.hint { margin: 12px 0 0; font-size: 13px; }
.eyebrow { margin: 0; color: var(--teal); font-size: 11px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.field { display: grid; gap: 8px; margin: 22px 0; color: var(--ink-soft); font-size: 13px; font-weight: 850; }
.field input { width: 100%; min-height: 52px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 0 15px; color: var(--ink); background: #fff; outline: none; font-size: 16px; transition: border-color 160ms ease, box-shadow 160ms ease; }
.field input:focus, .button:focus-visible, .buzz-button:focus-visible, .link-card:focus-visible { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(23,92,211,.18); outline: none; }
.form-error { min-height: 22px; margin: 12px 0 0; color: var(--coral); font-size: 14px; font-weight: 800; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 0 16px; font-size: 14px; font-weight: 850; text-decoration: none; transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, box-shadow 150ms ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:active:not(:disabled) { transform: translateY(0) scale(.99); }
.button.primary { color: #fff; background: var(--blue); box-shadow: 0 10px 24px rgba(23,92,211,.22); }
.button.primary:hover:not(:disabled) { background: var(--blue-dark); }
.button.signal { color: #fff; background: var(--signal); box-shadow: 0 12px 26px rgba(255,92,53,.24); }
.button.signal:hover:not(:disabled) { background: var(--signal-dark); }
.button.secondary { color: var(--ink); background: #edf2f7; border-color: #d7dee7; }
.button.danger { color: var(--coral); background: var(--coral-soft); border-color: #ffc5ca; }
.button.ghost { color: var(--ink-soft); background: transparent; border-color: var(--line); }
.button.dark { color: #fff; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); }
.button.wide { width: 100%; }
.button:disabled, .buzz-button:disabled { opacity: .48; transform: none; box-shadow: none; }
.app-shell { width: min(1540px, 100%); margin: 0 auto; padding: 20px max(18px, env(safe-area-inset-right)) max(36px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); }
.topbar, .player-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; padding: 17px 20px; color: #fff; background: var(--navy); border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.brand-lockup { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-mark { display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px; border-radius: 13px 13px 13px 3px; color: #fff; background: var(--signal); font-family: Georgia, serif; font-size: 22px; font-weight: 900; box-shadow: 0 8px 22px rgba(255,92,53,.28); }
.topbar h1, .player-header h1 { margin: 2px 0 0; font-family: "Songti SC", STSong, serif; font-size: 24px; line-height: 1.05; letter-spacing: -.03em; }
.topbar .eyebrow, .player-header .eyebrow { color: #7ddaca; }
.topbar-meta, .topbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.topbar-right { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.status-pill { display: inline-flex; align-items: center; justify-content: center; min-height: 30px; border-radius: 999px; padding: 0 11px; color: var(--ink); background: #e9eef3; border: 1px solid rgba(16,32,51,.08); font-size: 12px; font-weight: 850; white-space: nowrap; font-variant-numeric: tabular-nums; }
.status-pill.success { color: #066258; background: var(--teal-soft); }
.status-pill.warning { color: #7b5000; background: var(--gold-soft); }
.status-pill.danger { color: var(--coral); background: var(--coral-soft); }
.status-pill.neutral { color: var(--ink-soft); background: #e9eef3; }
.status-pill.live::before, .connection-dot { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(8,125,113,.11); }
.network-banner { display: none; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; padding: 12px 14px; border-radius: var(--radius-sm); color: var(--coral); background: var(--coral-soft); border: 1px solid #ffc5ca; font-size: 14px; font-weight: 850; }
.network-banner.show { display: flex; }
.host-grid { display: grid; grid-template-columns: minmax(300px,.88fr) minmax(430px,1.5fr) minmax(290px,.9fr); gap: 14px; align-items: start; }
.panel { min-width: 0; padding: 18px; }
.control-panel { position: sticky; top: 14px; }
.live-panel { min-height: 496px; border-top: 4px solid var(--signal); }
.score-panel { max-height: 720px; overflow: auto; }
.participants-panel { grid-column: 2 / 4; }
.section-heading, .player-status-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-heading.compact { margin-bottom: 10px; }
.phase-console { position: relative; overflow: hidden; margin: 2px 0 14px; padding: 20px; color: #fff; border-radius: 16px; background: linear-gradient(150deg, var(--navy), var(--navy-soft)); }
.phase-console::after { content: attr(data-round); position: absolute; right: -8px; bottom: -30px; color: rgba(255,255,255,.06); font-family: Georgia, serif; font-size: 140px; font-weight: 900; line-height: 1; }
.phase-kicker { position: relative; z-index: 1; margin: 0 0 8px; color: #7ddaca; font-size: 11px; font-weight: 900; letter-spacing: .14em; }
.phase-console h3 { position: relative; z-index: 1; margin: 0; font-family: "Songti SC", STSong, serif; font-size: 32px; letter-spacing: -.03em; }
.phase-console p { position: relative; z-index: 1; min-height: 44px; margin: 8px 0 18px; color: #b9c8da; font-size: 14px; line-height: 1.55; }
.phase-console .button { position: relative; z-index: 1; width: 100%; min-height: 52px; font-size: 16px; }
.flow-rail { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin-bottom: 15px; }
.flow-step { padding: 8px 6px; border-top: 3px solid var(--line); color: #8b96a4; font-size: 11px; font-weight: 850; text-align: center; }
.flow-step.active { border-color: var(--signal); color: var(--ink); }
.control-stack { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.share-box { display: grid; grid-template-columns: 116px 1fr; gap: 14px; align-items: center; margin-top: 14px; padding: 13px; border: 1px solid var(--line); border-radius: 15px; background: #f7f6f2; }
.share-copy { min-width: 0; }
.join-url { display: -webkit-box; overflow: hidden; margin: 6px 0 10px; color: var(--ink-soft); font-size: 12px; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.share-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.share-actions .button { min-height: 36px; padding: 0 11px; font-size: 12px; }
.qr-frame { display: grid; place-items: center; width: 116px; min-height: 116px; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 7px; }
.qr-frame svg { width: 100px; height: 100px; display: block; }
.buzz-list, .scoreboard, .participant-list { display: grid; gap: 9px; }
.participant-list.compact { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.empty-state { display: grid; place-items: center; min-height: 180px; padding: 24px; color: var(--ink-soft); text-align: center; border: 1px dashed #b8c0ca; border-radius: 15px; background: #f7f6f2; line-height: 1.6; }
.buzz-item, .score-row, .participant-row { display: grid; align-items: center; gap: 11px; min-height: 62px; border: 1px solid var(--line); border-radius: 14px; padding: 11px; background: var(--surface-strong); transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease; }
.buzz-item { grid-template-columns: 52px 1fr auto; }
.buzz-item.candidate { border-color: #edb24d; background: #fffbef; box-shadow: 0 8px 24px rgba(217,154,22,.12); }
.buzz-list.small .buzz-item { grid-template-columns: 44px 1fr; }
.rank { display: grid; place-items: center; width: 44px; height: 44px; color: #fff; background: var(--navy); border-radius: 13px 13px 13px 4px; font-family: Georgia, serif; font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; }
.rank.first { color: #3f2b00; background: #f2c14f; }
.rank.second { color: #24303c; background: #c8d1dc; }
.rank.third { color: #fff; background: #b7703c; }
.item-title { margin: 0; font-size: 18px; font-weight: 900; line-height: 1.25; }
.item-meta { margin: 4px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.45; font-variant-numeric: tabular-nums; }
.judge-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.judge-actions .button { min-height: 40px; padding: 0 12px; }
.score-row { grid-template-columns: 28px 1fr auto auto; }
.score-index { color: #8a96a5; font-family: Georgia, serif; font-size: 17px; font-weight: 900; text-align: center; }
.score-value { min-width: 48px; color: var(--blue); font-family: Georgia, serif; font-size: 26px; font-weight: 900; text-align: right; font-variant-numeric: tabular-nums; }
.participant-row { grid-template-columns: 1fr auto auto; }
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: #a6afba; }
.dot.online { background: var(--teal); box-shadow: 0 0 0 4px rgba(8,125,113,.1); }
.toast { position: fixed; left: 50%; bottom: max(24px, calc(env(safe-area-inset-bottom) + 12px)); z-index: 30; max-width: min(92vw, 480px); padding: 13px 18px; color: #fff; background: rgba(11,23,40,.96); border: 1px solid rgba(255,255,255,.12); border-radius: 999px; box-shadow: var(--shadow-lg); opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: opacity 180ms ease, transform 180ms ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.player-page { display: grid; place-items: start center; padding: 14px max(14px, env(safe-area-inset-right)) max(26px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); background: var(--navy); }
.player-page::before { z-index: 0; opacity: .15; background-image: radial-gradient(circle at 50% 24%, rgba(255,92,53,.32), transparent 24rem), linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: auto, 26px 26px, 26px 26px; mask-image: none; }
.player-shell { position: relative; z-index: 1; width: min(100%, 580px); }
.player-header { margin-bottom: 12px; padding: 14px 16px; background: rgba(18,38,62,.82); box-shadow: none; backdrop-filter: blur(14px); }
.player-header .topbar-meta { flex-wrap: nowrap; }
.join-panel, .buzzer-panel { padding: 20px; border-color: rgba(255,255,255,.14); border-radius: 24px; box-shadow: 0 24px 70px rgba(0,0,0,.25); }
.join-panel { overflow: hidden; }
.join-panel::before { content: "READY"; display: block; margin: -38px -10px -8px; color: rgba(23,92,211,.07); font-family: Georgia, serif; font-size: 96px; font-weight: 900; line-height: 1; text-align: right; }
.join-panel h2 { font-family: "Songti SC", STSong, serif; font-size: 30px; }
.join-form { margin-top: 10px; }
.player-status-row { align-items: center; }
.player-score-number { font-family: Georgia, serif; font-variant-numeric: tabular-nums; }
.round-card { display: grid; gap: 14px; margin: 10px 0 18px; padding: 16px; border: 1px solid var(--line); border-radius: 20px; background: #f7f6f2; }
.round-status-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.round-card p { min-height: 58px; margin: 0; color: var(--ink); font-size: 20px; font-weight: 850; line-height: 1.45; }
.online-note { color: var(--ink-soft); font-size: 12px; font-weight: 750; }
.buzz-button { position: relative; width: 100%; min-height: 228px; overflow: hidden; border: 0; border-radius: 50%; color: #fff; background: radial-gradient(circle at 34% 26%, #ff957c 0%, var(--signal) 34%, #d83c1e 72%, #9f2714 100%); box-shadow: inset 0 -14px 24px rgba(93,18,7,.24), inset 0 5px 10px rgba(255,255,255,.28), 0 18px 0 #812313, 0 30px 50px rgba(183,45,24,.35); font-family: "Songti SC", STSong, serif; font-size: 46px; font-weight: 900; letter-spacing: .04em; touch-action: manipulation; transform: translateY(-6px); transition: transform 100ms ease, box-shadow 100ms ease, filter 160ms ease; }
.buzz-button::before { content: ""; position: absolute; inset: 10px; border: 2px solid rgba(255,255,255,.25); border-radius: 50%; }
.buzz-button:not(:disabled):active { transform: translateY(10px) scale(.985); box-shadow: inset 0 -8px 20px rgba(93,18,7,.24), inset 0 4px 8px rgba(255,255,255,.24), 0 2px 0 #812313, 0 12px 24px rgba(183,45,24,.26); }
.round-card[data-state="open"] .buzz-button { animation: readyPulse 1.45s ease-in-out infinite; }
.round-card[data-state="waiting"] .buzz-button, .round-card[data-state="ended"] .buzz-button, .round-card[data-state="reviewing"] .buzz-button { background: radial-gradient(circle at 34% 26%, #9aa8b8, #64748a 44%, #3a485c 100%); box-shadow: inset 0 -12px 22px rgba(11,23,40,.22), inset 0 5px 10px rgba(255,255,255,.18), 0 14px 0 #29374a, 0 24px 40px rgba(11,23,40,.2); }
.top-three { border-top: 1px solid var(--line); padding-top: 16px; }
.join-form-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.join-form-actions .wide { min-width: 0; }
@keyframes readyPulse { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.13) saturate(1.08); } }

/* Read-only room display */
.display-page { min-height: 100dvh; overflow-x: hidden; color: #fff; background: var(--navy); }
.display-page::before { z-index: 0; opacity: .22; background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 42px 42px; mask-image: radial-gradient(circle at 50% 30%, #000, transparent 72%); }
.display-shell { position: relative; z-index: 1; min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; padding: 24px 28px; }
.display-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid rgba(255,255,255,.14); }
.display-header h1 { margin: 3px 0 0; font-family: "Songti SC", STSong, serif; font-size: clamp(28px,3vw,46px); letter-spacing: -.04em; }
.display-header .eyebrow { color: #7ddaca; }
.display-main { display: grid; grid-template-columns: 1.4fr .8fr; gap: 20px; align-items: stretch; padding-top: 20px; }
.display-stage { display: grid; grid-template-rows: auto 1fr; min-width: 0; overflow: hidden; border: 1px solid rgba(255,255,255,.13); border-radius: 28px; background: rgba(255,255,255,.055); }
.display-phase { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 26px 30px; background: rgba(0,0,0,.16); }
.display-question { font-family: Georgia, serif; font-size: clamp(46px,7vw,104px); font-weight: 900; line-height: .85; font-variant-numeric: tabular-nums; }
.display-phase-copy { text-align: right; }
.display-phase-copy h2 { margin: 0; font-family: "Songti SC", STSong, serif; font-size: clamp(30px,4vw,62px); letter-spacing: -.04em; }
.display-phase-copy p { margin: 8px 0 0; color: #9fb0c4; font-size: clamp(14px,1.4vw,20px); }
.podium { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; align-items: end; padding: 28px; }
.podium-card { position: relative; display: grid; align-content: end; min-height: 42%; overflow: hidden; padding: 22px; border: 1px solid rgba(255,255,255,.13); border-radius: 22px 22px 8px 8px; background: rgba(255,255,255,.07); }
.podium-card[data-rank="1"] { min-height: 76%; color: #2c2108; background: linear-gradient(160deg,#ffe7a1,#e6aa2d); }
.podium-card[data-rank="2"] { min-height: 61%; background: linear-gradient(160deg,#bac7d7,#687b91); }
.podium-card[data-rank="3"] { min-height: 50%; background: linear-gradient(160deg,#c58455,#754126); }
.podium-rank { position: absolute; right: 14px; top: 8px; opacity: .24; font-family: Georgia, serif; font-size: clamp(60px,8vw,128px); font-weight: 900; line-height: 1; }
.podium-name { position: relative; margin: 0; font-size: clamp(20px,2.4vw,38px); font-weight: 900; line-height: 1.15; overflow-wrap: anywhere; }
.podium-meta { position: relative; margin: 7px 0 0; font-size: clamp(12px,1.1vw,16px); font-weight: 750; opacity: .78; font-variant-numeric: tabular-nums; }
.display-scoreboard { min-width: 0; overflow: hidden; padding: 22px; border: 1px solid rgba(255,255,255,.13); border-radius: 28px; background: rgba(255,255,255,.055); }
.display-scoreboard h2 { margin: 4px 0 18px; font-family: "Songti SC", STSong, serif; font-size: clamp(28px,3vw,44px); }
.display-score-list { display: grid; gap: 9px; }
.display-score-row { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 12px; min-height: 56px; padding: 10px 13px; border-radius: 13px; background: rgba(255,255,255,.075); }
.display-score-row:nth-child(1) { color: #2c2108; background: #f2c14f; }
.display-score-row .place { font-family: Georgia, serif; font-size: 20px; font-weight: 900; text-align: center; }
.display-score-row .name { overflow: hidden; font-size: clamp(16px,1.35vw,22px); font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.display-score-row .points { font-family: Georgia, serif; font-size: clamp(22px,2.3vw,34px); font-weight: 900; font-variant-numeric: tabular-nums; }
.display-empty { display: grid; place-items: center; min-height: 50%; color: #91a4bb; font-size: clamp(16px,1.5vw,22px); text-align: center; }
[hidden] { display: none !important; }
@media (max-width: 1120px) {
  .host-grid { grid-template-columns: minmax(300px,.8fr) minmax(430px,1.2fr); }
  .live-panel { grid-column: 2; grid-row: 1 / span 2; }
  .score-panel { grid-column: 1; }
  .participants-panel { grid-column: 1 / 3; }
  .topbar-right { align-items: flex-end; flex-direction: column; gap: 8px; }
}
@media (max-width: 760px) {
  .auth-screen { padding: 14px; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-story { min-height: 220px; padding: 26px; }
  .auth-story::before { width: 240px; height: 240px; right: -100px; bottom: -130px; border-width: 48px; }
  .auth-story::after { display: none; }
  .auth-story h1 { margin: 32px 0 10px; font-size: 44px; }
  .auth-story p { margin: 0; font-size: 14px; }
  .auth-panel { padding: 28px 24px; }
  .app-shell { padding-top: 12px; }
  .topbar { align-items: flex-start; flex-direction: column; padding: 16px; }
  .topbar-right { width: 100%; align-items: flex-start; }
  .topbar-meta, .topbar-actions { justify-content: flex-start; }
  .host-grid { grid-template-columns: 1fr; }
  .control-panel { position: static; }
  .live-panel, .score-panel, .participants-panel { grid-column: auto; grid-row: auto; }
  .live-panel { min-height: 400px; }
  .participants-panel { order: 4; }
  .buzz-item { grid-template-columns: 44px 1fr; }
  .buzz-item .judge-actions { grid-column: 1 / 3; }
  .judge-actions { justify-content: stretch; }
  .judge-actions .button { flex: 1; }
  .score-row { grid-template-columns: 24px 1fr auto; }
  .score-row > .button { grid-column: 2 / 4; width: 100%; }
  .participant-row { grid-template-columns: 1fr auto; }
  .participant-row > .button { grid-column: 1 / 3; width: 100%; }
  .share-box { grid-template-columns: 100px 1fr; }
  .qr-frame { width: 100px; min-height: 100px; }
  .qr-frame svg { width: 86px; height: 86px; }
  .player-header { align-items: center; flex-direction: row; }
  .player-header .topbar-meta { justify-content: flex-end; }
  .player-header h1 { font-size: 20px; }
  .player-header .eyebrow { display: none; }
  .join-panel, .buzzer-panel { padding: 17px; }
  .round-card p { min-height: 50px; font-size: 18px; }
  .buzz-button { min-height: min(58vw,230px); font-size: 40px; }
  .display-shell { padding: 16px; }
  .display-header { align-items: flex-start; }
  .display-main { grid-template-columns: 1fr; }
  .display-stage { min-height: 62vh; }
  .display-scoreboard { display: none; }
  .display-phase { padding: 20px; }
  .podium { gap: 7px; padding: 16px; }
  .podium-card { padding: 12px; }
}
@media (max-width: 420px) {
  .brand-mark { width: 38px; height: 38px; }
  .player-header .status-pill:nth-child(2) { display: none; }
  .control-stack { grid-template-columns: 1fr; }
  .share-box { grid-template-columns: 1fr; }
  .qr-frame { width: 132px; min-height: 132px; }
  .qr-frame svg { width: 116px; height: 116px; }
  .join-form-actions { grid-template-columns: 1fr; }
}
@media (max-height: 650px) and (orientation: landscape) {
  .player-page { padding-top: 8px; }
  .player-header { margin-bottom: 8px; }
  .buzzer-panel { display: grid; grid-template-columns: .72fr 1.28fr; gap: 14px; }
  .player-status-row, .top-three { grid-column: 1; }
  .round-card { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
  .buzz-button { min-height: 190px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* v3 · all-participant question flow */
textarea { font: inherit; }
.brand-mark { position: relative; }
.brand-mark::after { content: "品牌位"; position: absolute; left: calc(100% + 9px); bottom: -1px; width: max-content; color: rgba(255,255,255,.36); font-family: "PingFang SC", sans-serif; font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.host-grid {
  grid-template-areas:
    "control live scores"
    "questions live roster";
  grid-template-columns: minmax(300px,.92fr) minmax(470px,1.46fr) minmax(300px,.92fr);
}
.control-panel { grid-area: control; position: static; }
.live-panel { grid-area: live; max-height: calc(100dvh - 132px); overflow: auto; }
.score-panel { grid-area: scores; max-height: min(720px, calc(100dvh - 132px)); }
.question-panel { grid-area: questions; }
.participants-panel { grid-area: roster; max-height: 620px; overflow: auto; }
.flow-rail.v3 { grid-template-columns: repeat(4,1fr); }
.question-summary { display: grid; gap: 9px; margin-bottom: 14px; padding: 15px; border: 1px solid rgba(255,255,255,.13); border-radius: 15px; background: rgba(255,255,255,.07); }
.question-summary .eyebrow { color: #7ddaca; }
.question-summary-title { margin: 0; color: #fff; font-family: "Songti SC", STSong, serif; font-size: 20px; font-weight: 800; line-height: 1.45; }
.question-summary-answer { margin: 0; color: #b9c8da; font-size: 13px; line-height: 1.55; }
.question-media { display: block; width: 100%; max-height: 240px; margin-top: 5px; border: 1px solid rgba(255,255,255,.13); border-radius: 12px; background: #fff; object-fit: contain; }
.progress-block { margin: 13px 0 16px; }
.progress-copy { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; color: #c4cfda; font-size: 12px; font-weight: 800; }
.progress-track { height: 8px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.13); }
.progress-fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--signal),#ffb13d); transition: width 180ms ease; }
.question-import { display: grid; gap: 10px; }
.question-import textarea { width: 100%; min-height: 176px; resize: vertical; border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 13px; color: var(--ink); background: #fff; outline: none; font-size: 13px; line-height: 1.6; }
.question-import textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(23,92,211,.14); }
.question-import-actions, .utility-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.question-import-actions .button { flex: 1; }
.import-feedback { min-height: 20px; margin: 0; color: var(--ink-soft); font-size: 12px; font-weight: 750; line-height: 1.5; }
.import-feedback.error { color: var(--coral); }
.import-feedback.success { color: var(--teal); }
.import-preview { display: grid; gap: 7px; max-height: 280px; overflow: auto; }
.preview-card { padding: 10px 11px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.preview-card.error { border-color: #ffc5ca; background: var(--coral-soft); }
.preview-card p { margin: 0; font-size: 12px; line-height: 1.5; }
.preview-card .preview-title { color: var(--ink); font-weight: 850; }
.question-list { display: grid; gap: 7px; max-height: 360px; margin-top: 12px; overflow: auto; }
.question-choice { display: grid; grid-template-columns: 34px 1fr auto; gap: 9px; align-items: center; width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 9px; color: var(--ink); background: #fff; text-align: left; }
.question-choice:hover:not(:disabled) { border-color: #9eb4d7; }
.question-choice.selected { border-color: var(--blue); background: #edf4ff; box-shadow: 0 0 0 2px rgba(23,92,211,.08); }
.question-choice.current { border-color: var(--signal); }
.question-choice-number { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px 9px 9px 3px; color: #fff; background: var(--navy); font-family: Georgia, serif; font-weight: 900; }
.question-choice-copy { min-width: 0; }
.question-choice-title { display: block; overflow: hidden; font-size: 13px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.question-choice-meta { display: block; margin-top: 3px; color: var(--ink-soft); font-size: 10px; }
.question-choice-check { color: var(--blue); font-size: 11px; font-weight: 900; }
.danger-zone { display: grid; gap: 9px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed #d7a7ac; }
.danger-zone-title { margin: 0; color: var(--coral); font-size: 11px; font-weight: 900; letter-spacing: .1em; }
.buzz-list { counter-reset: people; }
.buzz-item { min-height: 58px; }
.buzz-item.self, .score-row.self, .ranking-row.self { border-color: var(--blue); background: #edf4ff; box-shadow: 0 0 0 2px rgba(23,92,211,.08); }
.buzz-item.missing { border-style: dashed; background: #f3f1ec; }
.rank.unanswered { color: var(--ink-soft); background: #dfe3e7; font-size: 15px; }
.score-row.medal-1, .ranking-row.medal-1 { border-color: #e2b139; background: #fff8df; }
.score-row.medal-2, .ranking-row.medal-2 { border-color: #aeb9c6; background: #f1f4f7; }
.score-row.medal-3, .ranking-row.medal-3 { border-color: #b87949; background: #fff2e7; }
.question-panel details > summary { cursor: pointer; color: var(--blue); font-size: 13px; font-weight: 850; }
.question-panel details[open] > summary { margin-bottom: 12px; }
.round-card { gap: 12px; }
.player-question { display: grid; gap: 10px; min-height: 92px; padding: 14px; border-radius: 15px; color: #fff; background: linear-gradient(145deg,var(--navy),var(--navy-soft)); }
.player-question .eyebrow { color: #7ddaca; }
.player-question-text { margin: 0 !important; min-height: 0 !important; color: #fff !important; font-family: "Songti SC", STSong, serif; font-size: 21px !important; line-height: 1.5 !important; }
.player-question .question-media { max-height: 220px; }
.player-rank-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
.player-stat { padding: 9px; border: 1px solid var(--line); border-radius: 11px; background: #fff; text-align: center; }
.player-stat strong { display: block; font-family: Georgia, serif; font-size: 20px; }
.player-stat span { color: var(--ink-soft); font-size: 10px; font-weight: 800; }
.ranking-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 17px 0 10px; padding: 5px; border-radius: 12px; background: #e6e8e8; }
.ranking-tab { min-height: 38px; border: 0; border-radius: 9px; color: var(--ink-soft); background: transparent; font-size: 13px; font-weight: 850; }
.ranking-tab.active { color: #fff; background: var(--navy); box-shadow: 0 4px 12px rgba(11,23,40,.14); }
.player-ranking { display: grid; gap: 7px; max-height: 440px; overflow: auto; }
.ranking-row { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 9px; align-items: center; min-height: 52px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: #fff; }
.ranking-row .ranking-place { font-family: Georgia, serif; font-size: 18px; font-weight: 900; text-align: center; }
.ranking-row .ranking-name { overflow: hidden; font-size: 14px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.ranking-row .ranking-meta { color: var(--ink-soft); font-size: 11px; font-weight: 750; text-align: right; }
.round-card[data-state="collecting"] .buzz-button { animation: readyPulse 1.45s ease-in-out infinite; }
.round-card[data-state="waiting"] .buzz-button, .round-card[data-state="completed"] .buzz-button, .round-card[data-state="reviewing"] .buzz-button { background: radial-gradient(circle at 34% 26%, #9aa8b8, #64748a 44%, #3a485c 100%); box-shadow: inset 0 -12px 22px rgba(11,23,40,.22), inset 0 5px 10px rgba(255,255,255,.18), 0 14px 0 #29374a, 0 24px 40px rgba(11,23,40,.2); }
.display-shell.v3 { height: 100dvh; min-height: 0; grid-template-rows: auto minmax(0,1fr); overflow: hidden; }
.display-main.v3 { display: grid; grid-template-columns: 1fr; grid-template-rows: minmax(210px,32vh) minmax(0,1fr); gap: 16px; min-height: 0; padding-top: 16px; }
.display-question-band { display: grid; grid-template-columns: minmax(0,1fr) minmax(260px,.34fr); gap: 18px; align-items: stretch; min-height: 0; overflow: hidden; padding: 20px 24px; border: 1px solid rgba(255,255,255,.13); border-radius: 24px; background: rgba(255,255,255,.055); }
.display-question-copy { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 18px; align-items: center; min-width: 0; min-height: 0; overflow: hidden; }
.display-question-copy > div:nth-child(2) { min-width: 0; max-height: 100%; overflow: hidden; }
.display-question-number { min-width: 100px; color: var(--signal); font-family: Georgia, serif; font-size: clamp(52px,6vw,92px); font-weight: 900; line-height: .8; }
.display-question-text { display: -webkit-box; max-height: 6.75em; margin: 0; overflow: hidden; font-family: "Songti SC", STSong, serif; font-size: clamp(24px,3vw,46px); font-weight: 800; line-height: 1.35; letter-spacing: -.025em; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 5; }
.display-question-text.long { max-height: 8.1em; font-size: clamp(18px,2vw,34px); -webkit-line-clamp: 6; }
.display-question-image { width: min(24vw,320px); max-height: min(220px,25vh); margin-left: auto; border: 1px solid rgba(255,255,255,.18); border-radius: 16px; background: #fff; object-fit: contain; }
.display-phase-card { display: grid; align-content: center; justify-items: end; border-left: 1px solid rgba(255,255,255,.12); padding-left: 22px; text-align: right; }
.display-phase-card h2 { margin: 4px 0 5px; font-family: "Songti SC", STSong, serif; font-size: clamp(24px,2.5vw,40px); }
.display-phase-card p { margin: 0; color: #9fb0c4; font-size: clamp(12px,1.1vw,17px); line-height: 1.55; }
.display-ranking-panel { display: grid; grid-template-rows: auto minmax(0,1fr); min-height: 0; overflow: hidden; padding: 18px 20px 20px; border: 1px solid rgba(255,255,255,.13); border-radius: 24px; background: rgba(255,255,255,.055); }
.display-ranking-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.display-ranking-heading h2 { margin: 4px 0 0; font-family: "Songti SC", STSong, serif; font-size: clamp(26px,2.7vw,42px); }
.display-ranking-heading p { margin: 0; color: #9fb0c4; font-size: clamp(12px,1vw,16px); }
.display-rank-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); grid-template-rows: repeat(10,minmax(0,1fr)); grid-auto-flow: column; gap: 8px 12px; min-height: 0; }
.display-rank-card { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; gap: 10px; align-items: center; min-height: 0; overflow: hidden; border: 1px solid rgba(255,255,255,.11); border-radius: 12px; padding: 7px 11px; background: rgba(255,255,255,.075); }
.display-rank-card.medal-1 { color: #2c2108; background: #f2c14f; }
.display-rank-card.medal-2 { background: linear-gradient(135deg,#7e8fa3,#56677b); }
.display-rank-card.medal-3 { background: linear-gradient(135deg,#a7663b,#704127); }
.display-rank-place { font-family: Georgia, serif; font-size: clamp(17px,1.4vw,24px); font-weight: 900; text-align: center; }
.display-rank-name { overflow: hidden; font-size: clamp(13px,1.25vw,20px); font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.display-rank-meta { color: inherit; font-size: clamp(10px,.9vw,14px); font-weight: 750; opacity: .74; white-space: nowrap; }
.display-rank-card.waiting-slot { opacity: .42; border-style: dashed; }
.display-rank-card.unanswered-slot { border-style: dashed; color: #b9c8da; background: rgba(255,255,255,.035); }
@media (max-width: 1120px) {
  .host-grid {
    grid-template-areas:
      "control live"
      "questions roster"
      "scores roster";
    grid-template-columns: minmax(300px,.78fr) minmax(440px,1.22fr);
  }
  .score-panel, .participants-panel { max-height: 600px; }
  .display-question-band { grid-template-columns: 1fr; }
  .display-phase-card { justify-items: start; border-top: 1px solid rgba(255,255,255,.12); border-left: 0; padding-top: 14px; padding-left: 0; text-align: left; }
}
@media (max-height: 800px) and (min-width: 761px) {
  .display-shell.v3 { padding-top: 16px; padding-bottom: 16px; }
  .display-main.v3 { grid-template-rows: minmax(160px,28vh) minmax(0,1fr); gap: 10px; padding-top: 10px; }
  .display-question-band { padding: 12px 16px; }
  .display-question-number { min-width: 72px; font-size: 48px; }
  .display-question-text { font-size: clamp(20px,2.4vw,32px); }
  .display-question-text.long { font-size: clamp(16px,1.65vw,24px); -webkit-line-clamp: 6; }
  .display-question-image { width: min(20vw,240px); max-height: 150px; }
  .display-ranking-panel { padding: 10px 14px 12px; }
  .display-ranking-heading { margin-bottom: 7px; }
  .display-ranking-heading h2 { font-size: 27px; }
  .display-rank-grid { gap: 4px 8px; }
  .display-rank-card { grid-template-columns: 34px minmax(0,1fr) auto; gap: 7px; padding: 3px 8px; }
  .display-rank-place { font-size: 17px; }
  .display-rank-name { font-size: 13px; }
  .display-rank-meta { font-size: 10px; }
}
@media (max-width: 760px) {
  .host-grid { grid-template-areas: "control" "questions" "live" "scores" "roster"; grid-template-columns: 1fr; }
  .live-panel, .score-panel, .participants-panel { max-height: none; }
  .brand-mark::after { display: none; }
  .player-rank-summary { grid-template-columns: 1fr 1fr; }
  .player-rank-summary .player-stat:last-child { grid-column: 1 / 3; }
  .display-shell.v3 { height: auto; min-height: 100dvh; overflow: visible; }
  .display-main.v3 { grid-template-rows: auto minmax(0,1fr); }
  .display-question-band { padding: 16px; }
  .display-question-copy { grid-template-columns: 1fr; gap: 9px; }
  .display-question-number { min-width: 0; font-size: 42px; }
  .display-question-image { width: 100%; max-height: 180px; margin: 0; }
  .display-ranking-panel { overflow: auto; }
  .display-rank-grid { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-flow: row; }
  .display-rank-card { min-height: 52px; }
}

/* v3 · ceremonial light theme
   Keep the realtime structure intact while returning the room to a formal,
   warm-white visual language suited to corporate training. */
:root {
  --paper: #f4f1ea;
  --paper-cool: #eef1f3;
  --surface: #fffefb;
  --line: #d9d5cc;
  --line-strong: #b9c0c7;
  --shadow-sm: 0 10px 30px rgba(20, 34, 52, .07);
  --shadow-lg: 0 30px 90px rgba(20, 34, 52, .13);
}
body {
  background:
    radial-gradient(circle at 9% -8%, rgba(23,92,211,.09), transparent 31rem),
    radial-gradient(circle at 95% 3%, rgba(217,154,22,.09), transparent 27rem),
    linear-gradient(180deg,#faf9f5 0%,var(--paper) 100%);
}
body::before {
  opacity: .18;
  background-image: linear-gradient(rgba(16,32,51,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(16,32,51,.045) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom,#000,transparent 82%);
}

/* Login and host console */
.auth-layout { border-color: rgba(16,32,51,.12); }
.auth-story {
  color: var(--ink);
  background: linear-gradient(145deg,#fffefb 0%,#f1eee6 100%);
  border-right: 1px solid var(--line);
}
.auth-story::before {
  border-color: rgba(255,92,53,.72);
  box-shadow: 0 0 0 34px rgba(23,92,211,.055), 0 0 0 72px rgba(23,92,211,.025);
}
.auth-story::after { color: rgba(11,23,40,.13); }
.auth-story p { color: var(--ink-soft); }
.auth-story .eyebrow { color: var(--teal); }
.host-page .topbar {
  position: relative;
  overflow: hidden;
  color: var(--ink);
  background: rgba(255,254,251,.96);
  border-color: var(--line);
  box-shadow: 0 14px 38px rgba(20,34,52,.08);
}
.host-page .topbar::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: linear-gradient(180deg,var(--navy),var(--blue));
}
.host-page .topbar .eyebrow { color: var(--teal); }
.host-page .topbar .button.dark {
  color: var(--ink);
  background: #f5f4f0;
  border-color: var(--line);
}
.host-page .brand-mark::after,
.player-page .brand-mark::after,
.display-page .brand-mark::after { display: none; }
.host-page .question-media,
.player-page .question-media { border-color: var(--line); }
.button.signal { background: #d64022; }
.button.signal:hover:not(:disabled) { background: #b93118; }
.host-page .phase-console {
  color: var(--ink);
  background: linear-gradient(145deg,#fff 0%,#f5f4ef 100%);
  border: 1px solid #cfd5da;
  box-shadow: inset 6px 0 0 var(--navy), 0 16px 36px rgba(20,34,52,.07);
}
.host-page .phase-console::after { color: rgba(11,23,40,.035); }
.host-page .phase-kicker,
.host-page .question-summary .eyebrow { color: var(--teal); }
.host-page .phase-console p,
.host-page .question-summary-answer,
.host-page .progress-copy { color: var(--ink-soft); }
.host-page .question-summary {
  border-color: var(--line);
  background: rgba(255,255,255,.8);
}
.host-page .question-summary-title { color: var(--ink); }
.host-page .progress-track { background: #dfe3e5; }

/* Participant console */
.player-page {
  color: var(--ink);
  background:
    radial-gradient(circle at 50% -14%,rgba(23,92,211,.12),transparent 28rem),
    linear-gradient(180deg,#faf9f5 0%,#f1eee7 100%);
}
.player-page::before {
  opacity: .2;
  background-image: linear-gradient(rgba(16,32,51,.05) 1px, transparent 1px), linear-gradient(90deg,rgba(16,32,51,.05) 1px,transparent 1px);
  background-size: 30px 30px;
  mask-image: linear-gradient(to bottom,#000,transparent 80%);
}
.player-header {
  color: var(--ink);
  background: rgba(255,254,251,.94);
  border-color: var(--line);
  box-shadow: 0 12px 34px rgba(20,34,52,.08);
  backdrop-filter: blur(14px);
}
.player-header .eyebrow { color: var(--teal); }
.join-panel,
.buzzer-panel {
  border-color: var(--line);
  background: rgba(255,254,251,.98);
  box-shadow: 0 24px 64px rgba(20,34,52,.12);
}
.player-question {
  color: var(--ink);
  background: linear-gradient(145deg,#fff 0%,#f3f2ed 100%);
  border: 1px solid var(--line);
  box-shadow: inset 4px 0 0 var(--navy);
}
.player-question .eyebrow { color: var(--teal); }
.player-question-text { color: var(--ink) !important; }
.round-card { background: #f7f5ef; }

/* Read-only room display */
.display-page {
  color: var(--ink);
  background:
    radial-gradient(circle at 8% -10%,rgba(23,92,211,.11),transparent 34rem),
    radial-gradient(circle at 96% 4%,rgba(217,154,22,.1),transparent 28rem),
    linear-gradient(180deg,#faf9f5 0%,#f1eee7 100%);
}
.display-page::before {
  opacity: .2;
  background-image: linear-gradient(rgba(16,32,51,.05) 1px, transparent 1px), linear-gradient(90deg,rgba(16,32,51,.05) 1px,transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 28%,#000,transparent 76%);
}
.display-shell.v3 { border-top: 6px solid var(--navy); }
.display-header { border-bottom-color: rgba(16,32,51,.16); }
.display-header .eyebrow,
.display-question-band .eyebrow,
.display-ranking-panel .eyebrow { color: var(--teal); }
.display-question-band,
.display-ranking-panel {
  border-color: rgba(16,32,51,.14);
  background: rgba(255,254,251,.94);
  box-shadow: 0 18px 48px rgba(20,34,52,.08);
}
.display-phase-card { border-color: rgba(16,32,51,.14); }
.display-phase-card p,
.display-ranking-heading p { color: var(--ink-soft); }
.display-question-image { border-color: var(--line); }
.display-rank-card {
  color: var(--ink);
  border-color: #d9dde0;
  background: #f4f5f3;
}
.display-rank-card.medal-1 {
  color: #3f2b00;
  border-color: #dfb647;
  background: linear-gradient(135deg,#fff5cf,#f1cb67);
}
.display-rank-card.medal-2 {
  color: #253446;
  border-color: #aeb8c3;
  background: linear-gradient(135deg,#f7f9fb,#d9e0e7);
}
.display-rank-card.medal-3 {
  color: #54321d;
  border-color: #c7946d;
  background: linear-gradient(135deg,#fff3e8,#e1b18e);
}
.display-rank-card.waiting-slot {
  opacity: 1;
  color: var(--ink-soft);
  background: #f6f5f1;
  border-color: #c8c5be;
}
.display-rank-card.unanswered-slot {
  color: var(--ink-soft);
  background: #f3f1ec;
  border-color: #c8c5be;
}
.display-empty { color: var(--ink-soft); }
.docx-import-card { display: grid; gap: 10px; padding: 13px; border: 1px solid #c8d6eb; border-radius: 13px; background: #f5f9ff; }
.docx-import-card .preview-title { margin: 0; color: var(--ink); font-size: 14px; font-weight: 900; }
.docx-import-card .hint { margin: 3px 0 0; }
.docx-import-card input[type="file"] { width: 100%; min-height: 48px; padding: 8px; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--ink); background: #fff; }
.import-divider { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-size: 11px; font-weight: 850; }
.import-divider::before, .import-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.preview-options { display: grid; gap: 3px; margin-top: 6px; color: var(--ink-soft); }
.preview-answer { margin-top: 6px !important; color: var(--teal) !important; font-weight: 800; }
.answer-card { display: grid; gap: 12px; padding: 15px; border: 1px solid #a9bddb; border-radius: 15px; background: #fff; box-shadow: 0 12px 28px rgba(20,34,52,.08); }
.answer-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.answer-card-heading h3 { margin: 3px 0 0; color: var(--ink); font-family: "Songti SC", STSong, serif; font-size: 20px; }
.answer-options { display: grid; gap: 9px; }
.answer-option { display: flex; align-items: flex-start; gap: 11px; min-height: 50px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fff; cursor: pointer; }
.answer-option:has(input:checked) { border-color: var(--blue); background: #edf4ff; box-shadow: 0 0 0 2px rgba(23,92,211,.08); }
.answer-option input { flex: 0 0 auto; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--blue); }
.answer-option-id { min-width: 22px; color: var(--blue); font-weight: 900; }
.answer-option-label { line-height: 1.45; }
.answer-feedback { min-height: 20px; margin: 0; color: var(--ink-soft); font-size: 13px; font-weight: 800; line-height: 1.5; }
.answer-feedback.success { color: var(--teal); }
.answer-feedback.error { color: var(--coral); }
.display-question-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; margin-top: 12px; }
.display-option { display: grid; grid-template-columns: 28px minmax(0,1fr); gap: 7px; align-items: center; min-height: 38px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; font-size: clamp(11px,1vw,15px); }
.display-option strong { color: var(--blue); }
textarea:focus-visible, input:focus-visible, summary:focus-visible, .answer-option:focus-within, .ranking-tab:focus-visible { outline: 3px solid rgba(23,92,211,.28); outline-offset: 2px; }
@media (max-width: 1120px) {
  .display-phase-card { border-top-color: rgba(16,32,51,.14); }
}
@media (max-width: 760px) {
  .display-question-options { grid-template-columns: 1fr; }
  .answer-card { padding: 12px; }
}
