:root {
  --ink: #2a2024;
  --muted: #806e73;
  --paper: #fff9f8;
  --white: #ffffff;
  --line: #f0e2e4;
  --red: #e79399;
  --red-dark: #b86a72;
  --red-pale: #fcecee;
  --green: #639774;
  --blue: #567fbd;
  --yellow: #dfad35;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
.app-shell { width: min(100%, 480px); min-height: 100vh; min-height: 100dvh; margin: 0 auto; padding: 20px 18px max(28px, env(safe-area-inset-bottom)); }
.screen { min-height: calc(100vh - 48px); min-height: calc(100dvh - 48px); }
.topbar, .game-header, .ranking-title { display: flex; align-items: center; justify-content: space-between; }
.topbar { min-height: 28px; }
.version-chip { display: flex; align-items: center; gap: 7px; min-width: 0; max-width: calc(100% - 86px); padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 800; text-align: left; }
.version-chip > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.changelog-icon { display: grid; place-items: center; flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; background: #172033; color: #fff; font-size: 16px; font-weight: 900; line-height: 1; box-shadow: 0 8px 22px rgba(23, 32, 51, .12); }
.eyebrow { color: var(--red-dark); font-size: 12px; font-weight: 800; letter-spacing: 1px; }
.credits-link { color: var(--muted); font-size: 13px; font-weight: 700; text-decoration: none; }
.welcome-hero { padding: 46px 4px 24px; }
.eyebrow { margin: 0 0 9px; }
h1 { margin: 0; font-size: 43px; line-height: 1.08; letter-spacing: 0; }
h1 span, .brand-small span { color: var(--red); font-style: normal; }
.intro { margin: 12px 0 0; color: var(--muted); font-size: 16px; line-height: 1.5; }
.rule-board { min-height: 226px; padding: 22px 18px 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); box-shadow: 0 13px 30px rgba(90, 53, 57, .07); }
.rule-caption { margin: 0 0 28px; color: var(--muted); font-size: 13px; font-weight: 700; text-align: center; }
.sample-row { display: flex; align-items: baseline; justify-content: center; gap: 12px; margin-bottom: 26px; }
.sample-row b { font-size: 34px; line-height: 1; }
.sample-red { color: #d85d68; }.sample-blue { color: #3f6eae; }.sample-yellow { color: #c9941b; }
.answer-hint { padding: 11px 10px; border-radius: 5px; background: #fff1ef; color: var(--red-dark); font-size: 13px; font-weight: 700; text-align: center; }
.start-panel { margin-top: 18px; padding: 17px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.start-panel label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 13px; font-weight: 800; }
input { width: 100%; height: 47px; padding: 0 13px; border: 1px solid #e9d9db; border-radius: 6px; outline: none; background: #fffdfd; color: var(--ink); }
input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(235, 116, 124, .12); }
.primary-button, .secondary-button { width: 100%; min-height: 48px; margin-top: 10px; border-radius: 7px; font-weight: 800; }
.primary-button { border: 1px solid var(--red-dark); background: var(--red); color: #fff; box-shadow: 0 6px 0 var(--red-dark); }
.primary-button:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--red-dark); }
.secondary-button { border: 1px solid #eadcde; background: #fff; color: #59454a; }
.secondary-button:active { background: #fff4f3; }
.history-button { width: 100%; min-height: 48px; margin-top: 10px; border: 1px solid var(--ink); border-radius: 7px; background: var(--ink); color: #fff; font-weight: 900; }

.quiz-screen { display: flex; flex-direction: column; }
.game-header { min-height: 38px; }
.brand-small { font-size: 22px; font-weight: 900; }
.round-label { color: var(--muted); font-size: 13px; font-weight: 800; }
.progress { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin: 25px 0 23px; }
.progress i { height: 6px; border-radius: 999px; background: #eddfe0; }.progress i.on { background: var(--red); }
.word-stage { flex: 1; display: flex; align-items: center; justify-content: center; gap: clamp(6px, 2vw, 14px); min-height: 235px; margin: 14px 0; padding: 24px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 16px 36px rgba(90, 53, 57, .06); overflow: hidden; }
.color-word { flex: 0 1 auto; min-width: 0; max-width: 31%; font-weight: 900; line-height: 1.05; white-space: nowrap; text-align: center; text-shadow: 0 1px 0 rgba(255,255,255,.25); animation: word-in .32s ease-out; }
@keyframes word-in { from { opacity: .15; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.speech-caption { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 11px; width: 100%; min-height: 64px; margin: 0 0 6px; padding: 9px 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fffdfd; box-shadow: 0 8px 22px rgba(90, 53, 57, .05); transition: border-color 180ms ease, background 180ms ease; }
.speech-caption.live, .speech-caption.listening { border-color: #e6c7cb; background: #fffafa; }
.speech-caption.done { border-color: #d8e7dd; background: #fbfefc; }
.speech-caption.error, .speech-caption.timeout { background: #faf7f8; }
.caption-speaker { align-self: stretch; display: flex; align-items: center; border-right: 1px solid var(--line); color: var(--red-dark); font-size: 11px; font-weight: 900; }
.caption-line { min-width: 0; display: flex; align-items: center; overflow: hidden; }
.recognition-text { min-width: 0; color: var(--ink); font-size: 17px; font-weight: 900; line-height: 1.35; overflow-wrap: anywhere; }
.recognition-text.placeholder { color: var(--muted); font-size: 13px; font-weight: 700; }
.caption-char { display: inline-block; }
.caption-char.incoming { animation: caption-char-in 260ms ease-out both; }
.caption-cursor { flex: 0 0 auto; width: 2px; height: 20px; margin-left: 3px; border-radius: 1px; background: var(--red-dark); opacity: 0; }
.speech-caption.live .caption-cursor, .speech-caption.listening .caption-cursor { animation: caption-cursor 760ms step-end infinite; }
@keyframes caption-char-in { from { opacity: .12; transform: translateY(6px) scale(.94); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes caption-cursor { 0%, 48% { opacity: .9; } 49%, 100% { opacity: 0; } }
.answer-dock { min-height: 134px; margin-top: auto; padding: 7px 0 0; text-align: center; }
.listening-indicator { width: 92px; height: 44px; margin: 0 auto 6px; display: flex; align-items: center; justify-content: center; gap: 5px; }
.listening-indicator i { width: 6px; height: 30px; border-radius: 3px; background: #dfc9cc; transform: scaleY(.22); transition: transform 90ms linear, background 180ms ease; }
.answer-dock.listening .listening-indicator i { background: var(--red); }
.answer-dock.processing .listening-indicator i { background: var(--red-dark); animation: voice-processing .7s ease-in-out infinite alternate; }
.answer-dock.processing .listening-indicator i:nth-child(2), .answer-dock.processing .listening-indicator i:nth-child(4) { animation-delay: .16s; }
.answer-dock.done .listening-indicator i { background: var(--green); transform: scaleY(.55) !important; }
.answer-dock.error .listening-indicator i { background: #a5989b; transform: scaleY(.18) !important; }
@keyframes voice-processing { from { transform: scaleY(.22); } to { transform: scaleY(.85); } }
.listening-status { display: block; min-height: 24px; color: var(--ink); font-size: 17px; line-height: 24px; }
.answer-dock.listening .listening-status { color: var(--red-dark); }
.answer-dock.done .listening-status { color: var(--green); }
.voice-support { min-height: 17px; margin: 3px 0 8px; color: var(--muted); font-size: 11px; text-align: center; }
.voice-actions { min-height: 42px; display: flex; align-items: center; justify-content: center; }
.stop-answer-button, .retry-answer-button { min-width: 132px; min-height: 40px; border-radius: 7px; font-size: 13px; font-weight: 900; }
.stop-answer-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid #e6d5d8; background: #fff; color: #59454a; }
.stop-answer-button span { width: 10px; height: 10px; border-radius: 2px; background: var(--red-dark); }
.retry-answer-button { border: 1px solid var(--red-dark); background: var(--red); color: #fff; }
.stop-answer-button:active, .retry-answer-button:active { transform: translateY(1px); }

.result-screen { padding-top: 35px; text-align: center; }
.result-mark { width: 66px; height: 66px; margin: 0 auto 18px; border-radius: 50%; border: 7px solid var(--red-pale); background: var(--red); box-shadow: inset 0 0 0 8px #fff; }
.result-mark.wrong { background: #899199; }
.result-screen h1 { font-size: 35px; }.result-lead { margin: 10px 0 20px; color: var(--muted); font-size: 15px; }
.result-rating { margin: -10px 0 18px; color: var(--red-dark); font-size: 22px; font-weight: 900; }
.review-card { margin: 0 0 12px; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-align: left; }
.answer-review { display: block; }
.answer-review .review-row { display: block; padding: 15px 16px; border-bottom: 1px solid #f3e6e7; }
.answer-review .review-row:last-child { border-bottom: 0; }
.review-row-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.review-row-head b { font-size: 15px; }
.review-row-head i { color: var(--muted); font-size: 12px; font-style: normal; font-weight: 800; }
.review-row.correct .review-row-head i { color: var(--green); }
.review-answer-block > small { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; font-weight: 800; }
.review-colors { display: grid; gap: 5px; }
.review-colors span { display: grid; grid-template-columns: 24px 1fr; align-items: center; min-height: 30px; padding: 4px 8px; border-radius: 5px; background: #fff7f6; color: var(--ink); }
.review-colors em { color: var(--red-dark); font-size: 11px; font-style: normal; font-weight: 900; }
.review-colors b { font-size: 14px; }
.review-row p { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.ranking-block { overflow: hidden; margin: 0 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-align: left; }
.ranking-title { padding: 15px 16px 12px; border-bottom: 1px solid #f3e6e7; }.ranking-title b { font-size: 15px; }.ranking-title span { color: var(--muted); font-size: 11px; font-weight: 700; }
.ranking-list { min-height: 52px; }.rank-row { display: grid; grid-template-columns: 29px 1fr auto; gap: 7px; align-items: center; padding: 9px 16px; border-bottom: 1px solid #f6eeee; font-size: 13px; }.rank-row:last-child { border-bottom: 0; }.rank-row.current { background: #fff2f1; }.rank-no { color: var(--red-dark); font-weight: 900; }.rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }.rank-score { color: var(--muted); font-size: 12px; }.rank-empty { padding: 18px 16px; color: var(--muted); font-size: 13px; text-align: center; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 5; max-width: calc(100vw - 44px); padding: 11px 16px; border-radius: 6px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; transform: translateX(-50%); box-shadow: 0 10px 26px rgba(42, 32, 36, .22); }
.modal { position: fixed; inset: 0; z-index: 10; display: grid; place-items: end center; padding: 18px; }.modal-backdrop { position: absolute; inset: 0; background: rgba(42,32,36,.32); }.modal-card { position: relative; width: min(100%, 480px); max-height: min(78dvh, 650px); overflow: auto; border-radius: 12px 12px 8px 8px; background: #fff9f8; box-shadow: 0 20px 60px rgba(42,32,36,.22); }.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 16px; border-bottom: 1px solid var(--line); }.modal-head span,.modal-head b { display:block; }.modal-head span { color: var(--red-dark); font-size: 12px; font-weight: 900; }.modal-head b { margin-top: 3px; font-size: 22px; }.modal-close { border:0; border-radius: 6px; padding: 8px 10px; background:#fff; color:var(--muted); font-size:12px; font-weight:800; }.modal-close.changelog-close { display:grid; place-items:center; width:30px; height:30px; border-radius:50%; padding:0; background:#172033; color:#fff; font-size:21px; line-height:1; }.modal-content { padding: 12px 20px 22px; }.changelog-card { overflow:hidden; }.changelog-list { max-height: calc(min(78dvh, 650px) - 76px); overflow:auto; padding:4px 20px 18px; }.changelog-item { padding:14px 0; border-bottom:1px solid var(--line); }.changelog-item:last-child { border-bottom:0; }.changelog-item b { display:block; color:var(--ink); font-size:14px; }.changelog-item p { margin:6px 0 0; color:var(--muted); font-size:13px; line-height:1.55; }.history-item { display:grid; grid-template-columns:1fr auto; gap:8px; padding:14px 0; border-bottom:1px solid #f1e6e7; }.history-item:last-child { border-bottom:0; }.history-item b { font-size:15px; }.history-item span { color:var(--muted); font-size:12px; }.history-item i { align-self:center; color:var(--red-dark); font-size:14px; font-style:normal; font-weight:900; }.history-empty { padding:30px 4px; color:var(--muted); font-size:14px; text-align:center; }
.credits-page { padding-top: 32px; }.credits-back { display:block; width:fit-content; margin:0 0 24px; padding:10px 14px; border-radius:999px; background:var(--ink); color:#fff; font-size:13px; font-weight:900; text-decoration:none; }.team-panel { margin-top:38px; }.team-panel h1 { margin:10px 0 22px; font-size:42px; line-height:1.08; }.team-list { display:grid; gap:12px; }.model-list { display:grid; gap:10px; }.team-list div { border:1px solid #efe6db; border-radius:18px; padding:18px; background:#fff; box-shadow:0 12px 30px rgba(90,53,57,.07); }.team-list span,.model-row span,.model-row small,.model-row strong { display:block; color:var(--muted); font-size:13px; font-weight:800; }.team-list b { display:block; margin-top:5px; font-size:24px; }.model-panel { margin-top:26px; padding-bottom:28px; }.model-row { border:1px solid #f0e2e4; border-radius:14px; padding:14px; background:#fff; box-shadow:0 10px 24px rgba(42,32,36,.06); }.model-row span { color:var(--red-dark); font-size:12px; font-weight:900; }.model-row b { display:block; margin-top:5px; font-size:18px; line-height:1.25; }.model-row strong { margin-top:4px; color:var(--red-dark); font-size:13px; line-height:1.35; }.model-row small { margin-top:7px; line-height:1.45; font-size:12px; font-weight:800; }
@media (max-height: 650px) { .welcome-hero { padding-top: 27px; padding-bottom: 17px; }.rule-board { min-height: 194px; }.rule-caption { margin-bottom: 22px; }.sample-row { margin-bottom: 20px; }.word-stage { min-height: 170px; }.quiz-screen { min-height: calc(100vh - 48px); } }
@media (prefers-reduced-motion: reduce) { .caption-char.incoming { animation: none; }.caption-cursor { animation: none !important; opacity: .65 !important; } }
