/* comm-quiz 视觉方向 A「对戏舞台」——方案见 docs/dispatch/gemini-v3-design.reply.md，用户 2026-12-05 选定 */

:root {
  --bg: #F3F1EC;
  --card: #FFFFFF;
  --stage: #EAE6DD;
  --ink: #1D1E22;
  --muted: #5B5D64;
  --line: #DCD8CE;
  --accent: #33538A;
  --on-accent: #FFFFFF;
  --accent-soft: #E8EEF7;
  --aligned: #1D6B48;
  --aligned-soft: #E3F3EB;
  --passable: #8F5408;
  --passable-soft: #FAF0DC;
  --misfire: #B0322B;
  --misfire-soft: #FBE6E4;
  --mark: #FDE293;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 6px 20px rgba(0,0,0,.05);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-std: cubic-bezier(0.2, 0, 0, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131418;
    --card: #1C1E24;
    --stage: #171920;
    --ink: #EEECE6;
    --muted: #9FA2AC;
    --line: #2D303A;
    --accent: #84AEEC;
    --on-accent: #101520;
    --accent-soft: #212B3B;
    --aligned: #6AD29F;
    --aligned-soft: #1A3127;
    --passable: #F0B95B;
    --passable-soft: #342918;
    --misfire: #F58B82;
    --misfire-soft: #3A1F22;
    --mark: #5A4818;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 15.5px/1.6 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 14px 16px calc(24px + env(safe-area-inset-bottom));
}

.num { font-variant-numeric: tabular-nums; }
.loading, .muted { color: var(--muted); }

h1 { font-size: 22px; line-height: 1.3; margin: 20px 0 6px; }
h2 { font-size: 15px; margin: 0 0 8px; }

button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn {
  display: inline-block;
  border: 0;
  border-radius: 999px;
  padding: 11px 22px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}
.btn:disabled { opacity: .45; cursor: default; }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.link { background: none; border: 0; color: var(--accent); font-size: 13px; padding: 0; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-top: 12px;
}

/* 顶栏 */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}
.progress { display: flex; gap: 3px; align-items: center; flex: 1 1 auto; min-width: 40px; max-width: 220px; justify-content: flex-end; }
.progress i { display: block; flex: 1 1 0; max-width: 16px; min-width: 2px; height: 3px; border-radius: 2px; background: var(--line); }
.topbar .where { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar .me-name { white-space: nowrap; max-width: 6em; overflow: hidden; text-overflow: ellipsis; }
.topbar .link { white-space: nowrap; }
.progress i.done { background: var(--accent); }
.progress i.now { background: var(--muted); }

/* 胶囊选择 */
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.pill {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 14.5px;
}
.pill .n { margin-left: 6px; font-size: 12px; color: var(--muted); }
.pill .sub { margin-left: 6px; font-size: 11px; color: var(--muted); font-weight: 400; }
.reviewmode { display: flex; gap: 6px; align-items: center; margin-top: 14px; font-size: 12px; color: var(--muted); }
.pill.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.pill.on .n { color: var(--accent); }

/* 登录 */
.narrow { max-width: 440px; margin: 0 auto; }
.login-row { display: flex; gap: 8px; margin-top: 10px; }
.login-row input {
  flex: 1; min-width: 0;
  font: inherit; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 16px;
}
.hint { font-size: 13px; color: var(--muted); min-height: 1.4em; margin: 6px 0 0; }

/* 开局设定 */
.setup h2 + .pills { margin-top: 4px; }
.setup .group + .group { margin-top: 14px; }

/* 开始页：B 开场幕布 + C 场景卡（用户 2026-12-06「全都要」） */
.start .hero { position: relative; height: 330px; margin: 0 -16px; overflow: hidden;
  background: radial-gradient(ellipse 70% 60% at 50% 78%, color-mix(in srgb, var(--accent) 22%, var(--stage)) 0%, var(--stage) 62%, var(--bg) 100%); }
.start .hero::before { content: ""; position: absolute; left: 50%; top: -40px; width: 320px; height: 380px; translate: -50% 0; pointer-events: none;
  background: conic-gradient(from 180deg at 50% 0, transparent 160deg, rgba(255,240,200,.08) 172deg, rgba(255,240,200,.14) 180deg, rgba(255,240,200,.08) 188deg, transparent 200deg); }
.hero-top { position: absolute; top: 10px; left: 16px; right: 16px; display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); z-index: 3; }
.start .brand { position: absolute; top: 34px; left: 0; right: 0; text-align: center; }
.start .brand h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: .08em; }
.start .brand .en { font-size: 14px; letter-spacing: .18em; color: var(--muted); margin-top: -2px; }
.start .brand .en span { color: var(--accent); }
.start .brand .s { font-size: 13px; color: var(--muted); letter-spacing: .2em; }
.start .cast { position: absolute; bottom: 0; left: 0; right: 0; display: flex; justify-content: center; align-items: flex-end; }
.start .cast .portrait { width: 104px; height: 116px; margin: 0 -12px; filter: brightness(.55) saturate(.7); transition: filter 400ms var(--ease-std), transform 400ms var(--ease-out); }
.start .cast .portrait.on { filter: none; transform: translateY(-6px) scale(1.06); z-index: 2; }
.start .bubble { position: absolute; left: 20px; right: 20px; bottom: 126px; z-index: 3; background: var(--card); border-radius: 14px; padding: 9px 13px; font-size: 14px; line-height: 1.5; box-shadow: var(--shadow); transition: opacity 240ms, transform 240ms var(--ease-out); }
.start .bubble.out { opacity: 0; transform: translateY(6px); }
.start .bubble b { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.start .bubble::after { content: ""; position: absolute; bottom: -6px; left: var(--tail, 50%); width: 12px; height: 12px; background: var(--card); rotate: 45deg; translate: -50% 0; }
.start .panel { padding-top: 14px; }
.streak { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.streak b { color: var(--ink); }
.streak .up { color: var(--aligned); } .streak .down { color: var(--misfire); }
.resume { display: flex; align-items: center; gap: 10px; background: var(--accent-soft); border-radius: 12px; padding: 8px 8px 8px 12px; font-size: 13px; margin-bottom: 14px; }
.resume .btn { padding: 6px 14px; font-size: 13px; margin-left: auto; }
.tiles { display: grid; gap: 10px; margin-top: 6px; }
.tile { display: grid; grid-template-columns: 68px 1fr; gap: 12px; align-items: center; text-align: left; font: inherit; color: var(--ink);
  background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; padding: 6px 14px 6px 6px; cursor: pointer; transition: border-color 160ms, background 160ms; }
.tile.on { border-color: var(--accent); background: linear-gradient(90deg, var(--accent-soft), var(--card) 75%); }
.tile .face { width: 68px; height: 76px; display: block; }
.tile .face svg { width: 100%; height: 100%; display: block; }
.tile .body { display: block; min-width: 0; }
.tile .nm { display: block; font-weight: 800; font-size: 16px; }
.tile .ds { display: block; font-size: 12px; color: var(--muted); }
.tile .meter { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.tile .meter i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); position: relative; overflow: hidden; }
.tile .meter i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--aligned); border-radius: 3px; transition: width 500ms var(--ease-out); }
.sizes { display: flex; gap: 8px; align-items: center; margin-top: 14px; font-size: 13px; }
.sizes .pill { padding: 5px 14px; }
.cta .btn { width: 100%; padding: 14px; font-size: 16px; margin-top: 10px; }
@media (min-width: 1024px) {
  main.startwide { max-width: 1000px; }
  .start { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; align-items: start; margin-top: 10px; }
  .start .hero { height: 560px; margin: 0; border-radius: var(--radius); position: sticky; top: 16px; }
  .start .brand { top: 64px; } .start .brand h1 { font-size: 36px; }
  .start .cast .portrait { width: 140px; height: 156px; margin: 0 -16px; }
  .start .bubble { bottom: 178px; left: 32px; right: 32px; font-size: 15px; }
  .start .panel { padding-top: 0; }
}

/* ---------- 答题：舞台卡 ---------- */
.play { display: grid; gap: 10px; margin-top: 10px; }

.stagecard {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.stage {
  position: relative;
  background: var(--stage);
  display: flex;
  gap: 12px;
  align-items: flex-end;
  padding: 12px 14px 0;
  max-height: 42vh;
}
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: transparent;
  opacity: 0;
  transition: opacity 220ms var(--ease-std), background-color 220ms var(--ease-std);
  pointer-events: none;
}
.stage[data-mood="open"]::after { background: radial-gradient(ellipse at 22% 80%, var(--aligned), transparent 70%); opacity: .2; }
.stage[data-mood="tense"]::after { background: radial-gradient(ellipse at 22% 80%, var(--passable), transparent 70%); opacity: .22; }
.stage[data-mood="annoyed"]::after { background: radial-gradient(ellipse at 22% 80%, var(--misfire), transparent 70%); opacity: .2; box-shadow: inset 0 2px 0 var(--misfire); }
.stage[data-mood="neutral"]::after { background: radial-gradient(ellipse at 22% 80%, var(--passable), transparent 70%); opacity: .14; }

.portrait {
  position: relative;
  width: 116px;
  height: 128px;
  flex: none;
}
.portrait svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  transition: opacity 220ms var(--ease-std);
}
/* 选前入场：0.3 秒内落稳（.enter 在点下选项时去掉，避免表情动画结束后重播） */
.enter .portrait { animation: rise 240ms cubic-bezier(0.22, 1, 0.36, 1); }
.enter .who { animation: push 220ms cubic-bezier(0.22, 1, 0.36, 1) 40ms backwards; }
.enter .option { animation: push 160ms cubic-bezier(0.22, 1, 0.36, 1) 60ms backwards; }
.enter .option:nth-child(2) { animation-delay: 90ms; }
.enter .option:nth-child(3) { animation-delay: 120ms; }
.enter .option:nth-child(4) { animation-delay: 150ms; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* 回话那一刻的体态：放松轻抬带回弹，紧绷缩一下再微震，平静轻点头 */
.portrait.lift { animation: lift 360ms cubic-bezier(0.22, 1.25, 0.36, 1); }
.portrait.shake { animation: shake 340ms linear; }
.portrait.nod { animation: nod 300ms var(--ease-out); }
@keyframes lift { 0% { transform: none; } 45% { transform: translateY(-4px) scale(1.02); } 100% { transform: none; } }
@keyframes shake { 0%, 100% { transform: none; } 15% { transform: translateY(1px) scale(.99); } 35% { transform: translateX(-3px); } 55% { transform: translateX(3px); } 75% { transform: translateX(-1.5px); } }
@keyframes nod { 0% { transform: none; } 40% { transform: translateY(2px); } 100% { transform: none; } }
.portrait.flinch { animation: flinch 360ms var(--ease-out); }
@keyframes flinch { 0% { transform: none; } 30% { transform: translateY(2px) scale(.97); } 60% { transform: translateY(1px) scale(.985); } 100% { transform: none; } }
/* 旁观题：说话的人轻轻起伏、嘴在动，听的人暗一点 */
.portrait { transition: opacity 240ms var(--ease-std), filter 240ms var(--ease-std); }
.portrait.talking { animation: talk 420ms ease-in-out infinite alternate; }
.portrait.talking .v2 .mouth { transform-box: fill-box; transform-origin: center; animation: chatter 300ms steps(2, jump-none) infinite; }
.portrait.listening { opacity: .55; filter: saturate(.7); }
@keyframes talk { to { transform: translateY(-2px); } }
@keyframes chatter { 50% { scale: 1 1.7; } }

/* 立绘 v2 分层小动（用户 2026-12-06 选「人物 B」）：呼吸、眨眼常驻；表情只换 data-e，眉、嘴、头的角度过渡 */
.v2 .head { transform-box: view-box; transform-origin: 80px 120px; transition: transform 380ms var(--ease-out); animation: v2-breathe 3.8s ease-in-out infinite alternate; }
.v2 .torso { transform-box: view-box; transform-origin: 80px 180px; animation: v2-chest 3.8s ease-in-out infinite alternate; }
@keyframes v2-breathe { to { translate: 0 -1.3px; } }
@keyframes v2-chest { to { scale: 1.012 1.018; } }
.v2 .eyes { transform-box: fill-box; transform-origin: center; animation: v2-blink var(--blink, 4.6s) infinite; animation-delay: var(--bd, 0s); }
@keyframes v2-blink { 0%, 92%, 100% { scale: 1 1; } 95% { scale: 1 .08; } }
.v2 .brow { transform-box: fill-box; transform-origin: center; transition: transform 320ms var(--ease-out); }
.v2 .mouth > * { transition: opacity 200ms; opacity: 0; }
.v2[data-e="neutral"] .m-neutral, .v2[data-e="open"] .m-open, .v2[data-e="tense"] .m-tense, .v2[data-e="annoyed"] .m-annoyed { opacity: 1; }
.v2 .cheek { transition: opacity 300ms; opacity: 0; }
.v2[data-e="open"] .cheek { opacity: .45; }
.v2[data-e="open"] .head { transform: rotate(2.5deg) translateY(-2px); }
.v2[data-e="open"] .brow.l { transform: translateY(-3px) rotate(-4deg); }
.v2[data-e="open"] .brow.r { transform: translateY(-3px) rotate(4deg); }
/* 紧张（慌、尴尬、为难）：眉头内侧往上、嘴抿成波浪、头微缩；生气（不耐烦、责怪）：眉头内侧压下、嘴角下撇 */
.v2[data-e="tense"] .head { transform: rotate(1.5deg) translateY(1.5px); }
.v2[data-e="tense"] .brow.l { transform: translateY(-1px) rotate(-13deg); }
.v2[data-e="tense"] .brow.r { transform: translateY(-1px) rotate(13deg); }
.v2[data-e="tense"] .eyes { animation-duration: 1.9s; }
.v2[data-e="annoyed"] .head { transform: rotate(-2deg) translateY(1.5px); }
.v2[data-e="annoyed"] .brow.l { transform: translateY(2px) rotate(12deg); }
.v2[data-e="annoyed"] .brow.r { transform: translateY(2px) rotate(-12deg); }
.v2[data-e="annoyed"] .eyes { animation-duration: 2.6s; }

.who { padding-bottom: 12px; min-width: 0; }
.who .name { font-size: 18px; font-weight: 700; line-height: 1.35; }
.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  margin-left: 6px;
  vertical-align: 2px;
  transition: opacity 320ms var(--ease-std);
}
.badge.dim { opacity: .55; }
.who .meta { font-size: 13px; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.cues { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13px; color: color-mix(in srgb, var(--ink) 78%, var(--muted)); line-height: 1.5; }
.cues li::before { content: "· "; }
.cues li.hit { color: var(--ink); }
.cues li.hit span { background: linear-gradient(var(--mark), var(--mark)) no-repeat 0 0 / 100% 100%; border-radius: 3px; padding: 0 2px; }

/* 情景类型（2026-12-06）：主动开口显示目的，对方不说话只留信号，旁观两人对话并排两个人 */
.kind-tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 1px 8px; margin-bottom: 4px; }
.who .and { font-weight: 400; font-size: 14px; color: var(--muted); }
.line[data-kind="initiate"] .k { display: inline-block; font-size: 12px; font-weight: 700; color: var(--accent); border: 1px solid var(--accent); border-radius: 6px; padding: 0 6px; margin-right: 8px; vertical-align: 3px; }
.line[data-kind="silent"] .hush { color: var(--muted); font-style: italic; }
.line[data-kind="observe"] { display: grid; gap: 6px; font-size: 16px; }
/* 每个人一种颜色（名字和气泡边），用户 2026-12-06：「不同人物不同说话颜色和名字区分」 */
[data-sp="character"] { --pc: var(--pc-c, var(--muted)); }
[data-sp="partner"] { --pc: var(--pc-p, var(--muted)); }
.pn { color: color-mix(in srgb, var(--pc) 85%, var(--ink)); }
.badge.other { margin-right: 2px; }
.line[data-kind="observe"] .x { margin: 0; padding: 6px 10px; border-radius: 10px; background: var(--bg); max-width: 92%; border-left: 3px solid var(--pc); }
/* 双方都靠左、靠颜色和名字分人；右边只留给「你」 */
.line[data-kind="observe"] .x b { display: block; font-size: 12px; color: color-mix(in srgb, var(--pc) 80%, var(--ink)); font-weight: 600; }
.line[data-kind="observe"] .x.wait { opacity: 0; transform: translateY(6px); }
.line[data-kind="observe"] .x.pop { animation: push 260ms var(--ease-out); }
.them .by { display: block; font-size: 12px; color: color-mix(in srgb, var(--pc) 80%, var(--ink)); font-weight: 600; }
.felt[data-sp] > span { color: color-mix(in srgb, var(--pc) 70%, var(--muted)); }
.duo { display: flex; align-items: flex-end; flex: none; }
.duo .portrait { width: 88px; height: 98px; }
.duo .portrait + .portrait { margin-left: -10px; }
.portrait[data-role="partner"] svg { transform: scaleX(-1); }

.line {
  padding: 12px 14px;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.55;
}
mark {
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
  background: linear-gradient(var(--mark), var(--mark)) no-repeat 0 0 / 100% 100%;
}
.sweep mark, .sweep .cues li.hit span { animation: sweep 320ms cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes sweep { from { background-size: 0% 100%; } to { background-size: 100% 100%; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tw-off { opacity: 0; }
.tw.typing .tw-on::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin: 0 -1px;
  vertical-align: -2px;
  background: currentColor;
  opacity: .5;
}
.zh { font-size: 13px; color: var(--muted); padding: 0 14px 10px; margin-top: -6px; }

/* 对话流 */
.talk { display: grid; gap: 8px; padding: 0 14px 12px; }
.talk:empty { display: none; }
.me {
  justify-self: end;
  max-width: 85%;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 14px 4px 14px 14px;
  padding: 9px 12px;
  animation: push 220ms var(--ease-out);
}
.them {
  max-width: 88%;
  background: var(--bg);
  border-left: 3px solid var(--line);
  border-radius: 4px 12px 12px 4px;
  padding: 9px 12px;
  animation: push 260ms var(--ease-out);
}
.them[data-sp] { border-left-color: var(--pc); }
.them.dots { display: flex; gap: 4px; align-items: center; min-height: 40px; width: 56px; border-left-color: var(--line); }
.them.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: breathe 900ms ease-in-out infinite; }
.them.dots i:nth-child(2) { animation-delay: 150ms; }
.them.dots i:nth-child(3) { animation-delay: 300ms; }
@keyframes breathe { 0%, 100% { opacity: .25; } 50% { opacity: .9; } }
@keyframes push { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 选项 */
.options { display: grid; gap: 8px; }
.option {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 15.5px;
  line-height: 1.5;
  box-shadow: 0 1px 0 var(--line);
  transition: transform 100ms var(--ease-std), opacity 180ms var(--ease-std), border-color 120ms;
}
.option:hover:not(:disabled) { border-color: var(--accent); }
.option .key { display: none; }
@media (min-width: 1024px) {
  .option .key { display: inline-block; width: 1.4em; color: var(--muted); font-size: 12px; opacity: .7; }
}
.option:active:not(:disabled) { transform: scale(.985); }
.option.picked { transform: scale(.985); border-color: var(--accent); }
.options.leaving .option { opacity: 0; }
/* 选前第一步：先看题，再点「看选项」（用户 2026-12-06） */
.gate { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 18px 18px; text-align: center; animation: push 260ms var(--ease-out) 200ms backwards; }
.gate-q { margin: 0; font-size: 17px; font-weight: 700; }
.gate-dots { display: flex; gap: 6px; justify-content: center; margin: 12px 0 16px; }
.gate-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: gate-bob 1.2s ease-in-out infinite; }
.gate-dots i:nth-child(2) { animation-delay: 160ms; }
.gate-dots i:nth-child(3) { animation-delay: 320ms; }
@keyframes gate-bob { 0%, 100% { transform: translateY(0); opacity: .35; } 40% { transform: translateY(-5px); opacity: 1; } }
.reveal-btn { min-width: 9em; animation: gate-glow 2.4s ease-in-out 1s infinite; }
@keyframes gate-glow { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 50% { box-shadow: 0 0 0 8px transparent; } }
.gate-hint { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.options.reveal .option { animation: deal 300ms var(--ease-out) backwards; }
.options.reveal .option:nth-child(2) { animation-delay: 60ms; }
.options.reveal .option:nth-child(3) { animation-delay: 120ms; }
.options.reveal .option:nth-child(4) { animation-delay: 180ms; }
@keyframes deal { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
/* 等待时现场信号一条条亮起 */
.enter .cues li { animation: push 260ms var(--ease-out) backwards; animation-delay: 420ms; }
.enter .cues li + li { animation-delay: 620ms; }
.wait { display: flex; justify-content: center; }
.textbtn { background: none; border: 0; color: var(--accent); font-size: 14px; padding: 8px 12px; }

/* ---------- 复盘卡 ---------- */
.review {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  animation: slidein 300ms cubic-bezier(0.16, 1, 0.3, 1);
}
.review[data-tier="aligned"] { box-shadow: inset 0 3px 0 var(--aligned), var(--shadow); }
.review[data-tier="passable"] { box-shadow: inset 0 3px 0 var(--passable), var(--shadow); }
.review[data-tier="misfire"] { box-shadow: inset 0 3px 0 var(--misfire), var(--shadow); }
.review.fresh .lead .tier { animation: stamp 260ms cubic-bezier(0.22, 1.25, 0.36, 1) 100ms backwards; }
.review.fresh[data-tier="misfire"] .take.mine { animation: flash 700ms ease-out 200ms backwards; }
.review.fresh .take.better { animation: push 260ms var(--ease-out) 160ms backwards; }
@keyframes stamp { from { opacity: 0; transform: scale(.88); } 60% { opacity: 1; transform: scale(1.04); } to { transform: none; } }
@keyframes flash { from { box-shadow: 0 0 0 2px var(--misfire); } }
@keyframes slidein { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.tier {
  display: inline-block;
  font-weight: 700;
  font-size: 13px;
  padding: 2px 10px;
  border-radius: 999px;
}
.tier.aligned { color: var(--aligned); background: var(--aligned-soft); }
.tier.passable { color: var(--passable); background: var(--passable-soft); }
.tier.misfire { color: var(--misfire); background: var(--misfire-soft); }
.move, .think { font-size: 13px; color: var(--muted); margin-left: 6px; }
.think { margin-left: 8px; }

/* 解析卡 C「两句对照」（用户 2026-12-06 选定） */
.lead { margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; }
.lead .think { margin-left: auto; }
.cl { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.cl::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--passable); margin-right: 6px; vertical-align: 2px; }
.cl.ok::before { background: var(--aligned); }
.duel { display: grid; gap: 10px; margin-top: 12px; }
.take { border-radius: 12px; padding: 12px 14px; }
.take .k { font-size: 12px; font-weight: 700; }
.take .said { font-size: 17px; font-weight: 700; line-height: 1.5; margin: 4px 0 6px; }
.take .felt { font-size: 14px; line-height: 1.6; }
.take .felt span { color: var(--muted); margin-right: 6px; }
.take .also { font-size: 13px; color: var(--muted); margin-top: 6px; }
.take.mine[data-tier="aligned"], .take.better { background: var(--aligned-soft); }
.take.mine[data-tier="aligned"] .k, .take.better .k { color: var(--aligned); }
.take.mine[data-tier="passable"] { background: var(--passable-soft); }
.take.mine[data-tier="passable"] .k { color: var(--passable); }
.take.mine[data-tier="misfire"] { background: var(--misfire-soft); }
.take.mine[data-tier="misfire"] .k { color: var(--misfire); }
.point { margin: 14px 0 0; padding-left: 12px; border-left: 3px solid var(--accent); font-size: 14px; line-height: 1.6; }
.more { margin-top: 12px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 12px; color: var(--ink); background: none; cursor: pointer; }
.chip[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.chip i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.chip i.aligned { background: var(--aligned); } .chip i.passable { background: var(--passable); } .chip i.misfire { background: var(--misfire); }
.whybtn { margin-left: auto; }
.aitone { font-size: 12px; color: var(--muted); padding: 4px 0 0; }
.aitone:hover { color: var(--accent); }
.detail { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--line) 35%, transparent); font-size: 14px; }
.detail p { margin: 0; } .detail p + p { margin-top: 4px; }
.detail .tier { margin-right: 6px; }

.notebox { margin-top: 12px; }
textarea {
  width: 100%;
  min-height: 40px;
  height: 40px;
  font: inherit;
  font-size: 14.5px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  resize: vertical;
  transition: height 160ms var(--ease-std);
}
textarea:focus, textarea.has { height: 84px; }
.saved { font-size: 12px; color: var(--muted); min-height: 1.4em; }

/* 吸底动作栏 */
.dock {
  position: sticky;
  bottom: 0;
  margin: 10px -16px 0;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--card);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  z-index: 5;
}
.dock .ask { font-size: 12px; color: var(--muted); white-space: nowrap; }
.dock .fb { padding: 8px 4px; font-size: 13px; color: var(--muted); }
.dock:not(.fbopen) .ask, .dock:not(.fbopen) .stars { display: none; }
/* 快速评分：好 / 不好，不选 = 正常 */
.quick { display: flex; gap: 6px; }
.quick button { font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.quick button:hover { color: var(--ink); }
.quick button[data-quick="good"].on { background: var(--aligned); border-color: var(--aligned); color: var(--on-accent); }
.quick button[data-quick="bad"].on { background: var(--misfire); border-color: var(--misfire); color: var(--on-accent); }
.dock.fbopen .fb { display: none; }
.stars { display: flex; gap: 5px; }
.stars button {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 13px;
  font-weight: 600;
}
.stars button.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.dock .go { margin-left: auto; display: flex; gap: 6px; }
.dock .btn { padding: 9px 18px; white-space: nowrap; }
.dock .btn.ghost { padding: 9px 12px; }

/* 总结 */
.stat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat div { border-radius: 12px; padding: 10px; text-align: center; }
.stat b { display: block; font-size: 22px; line-height: 1.2; }
.stat .aligned { background: var(--aligned-soft); color: var(--aligned); }
.stat .passable { background: var(--passable-soft); color: var(--passable); }
.stat .misfire { background: var(--misfire-soft); color: var(--misfire); }
.list { margin: 8px 0 0; padding: 0; list-style: none; font-size: 14px; }
.list li { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding: 7px 0; }
.summary-grid { display: grid; gap: 12px; }
/* 总结页 B「仪表盘」（用户 2026-12-06 选定）：颜色只表身份，数字写成文字 */
.dash .block + .block { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.dash h2 .muted { font-weight: 400; font-size: 13px; }
.stack { display: flex; gap: 2px; height: 30px; }
.stack > div { border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--card); min-width: 18px; }
.stack .aligned, .legend i.aligned, .hb i.aligned { background: var(--aligned); }
.stack .passable, .legend i.passable, .hb i.passable { background: var(--passable); }
.stack .misfire, .legend i.misfire, .hb i.misfire { background: var(--misfire); background-image: repeating-linear-gradient(135deg, transparent 0 4px, rgba(0,0,0,.22) 4px 6px); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.legend i.rate { background: var(--accent); }
.legend i.avgmark { width: 2px; background: var(--ink); opacity: .5; }
.bars { display: grid; grid-template-columns: auto 1fr auto; gap: 8px 10px; align-items: center; font-size: 13px; }
.bars .track { height: 12px; background: color-mix(in srgb, var(--line) 60%, transparent); border-radius: 4px; position: relative; }
.bars .fill { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 4px; min-width: 2px; }
.bars .avg { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); opacity: .5; }
.bars .val { text-align: right; color: var(--muted); }
.bars .val small { font-size: 11px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mini { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.mini .k { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.mini .v { font-size: 22px; font-weight: 700; line-height: 1.3; }
.mini .d { font-size: 12px; margin-top: 4px; }
.mini .up { color: var(--aligned); } .mini .down { color: var(--misfire); }
.slope { width: 100%; height: 70px; display: block; }
.habit { display: grid; grid-template-columns: 1fr minmax(90px, 40%); gap: 8px 12px; align-items: center; font-size: 13px; }
.hb { display: flex; gap: 2px; height: 10px; }
.hb i { border-radius: 3px; }
.ai-card { border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.ai-head { font-size: 17px; font-weight: 700; margin: 0 0 8px; line-height: 1.5; }
.ai-row { margin: 6px 0 0; font-size: 14px; line-height: 1.6; }
.ai-row .k { display: inline-block; min-width: 5.5em; font-size: 12px; color: var(--muted); }
.ai-by { margin: 10px 0 0; font-size: 11px; color: var(--muted); }
.skel { height: 10px; border-radius: 4px; background: color-mix(in srgb, var(--accent) 22%, transparent); margin-top: 8px; animation: breathe 1.4s ease-in-out infinite; }
.roundlist summary { cursor: pointer; font-weight: 700; font-size: 15px; }

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(80px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  max-width: 90vw;
  z-index: 10;
}

.fade-in { animation: fade 220ms var(--ease-std); }
section.out { opacity: 0; transform: translateX(var(--dx, -8px)); transition: opacity 120ms cubic-bezier(0.2, 0, 0, 1), transform 120ms cubic-bezier(0.2, 0, 0, 1); }
.stat.rise > div { animation: push 260ms var(--ease-out) backwards; }
.stat.rise > div:nth-child(2) { animation-delay: 70ms; }
.stat.rise > div:nth-child(3) { animation-delay: 140ms; }
.list.stagger li { animation: push 220ms var(--ease-out) backwards; }
.list.stagger li:nth-child(2) { animation-delay: 35ms; }
.list.stagger li:nth-child(3) { animation-delay: 70ms; }
.list.stagger li:nth-child(4) { animation-delay: 105ms; }
.list.stagger li:nth-child(5) { animation-delay: 140ms; }
.list.stagger li:nth-child(6) { animation-delay: 175ms; }
.list.stagger li:nth-child(7) { animation-delay: 210ms; }
.list.stagger li:nth-child(n+8) { animation-delay: 245ms; }

/* 演出对比面板，只在 ?lab 时出现 */
.lab {
  position: fixed;
  top: 8px;
  right: 8px;
  z-index: 50;
  max-width: 220px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 8px 10px;
  font-size: 12px;
}
.lab summary { cursor: pointer; font-weight: 600; }
.lab label { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.lab button { margin-top: 8px; font-size: 12px; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.lab p { margin: 6px 0 0; color: var(--muted); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 桌面：左右分屏 ---------- */
@media (min-width: 1024px) {
  main.wide { max-width: 1060px; }
  .play { grid-template-columns: 44% 1fr; gap: 20px; align-items: start; }
  .play .left { position: sticky; top: 16px; }
  .stage { flex-direction: column; align-items: center; text-align: center; padding-top: 18px; max-height: none; }
  .portrait { width: 196px; height: 220px; }
  .duo .portrait { width: 168px; height: 188px; }
  .duo .portrait + .portrait { margin-left: -24px; }
  .who { padding-bottom: 14px; }
  .cues { display: inline-block; text-align: left; }
  .dock { margin: 10px 0 0; border-radius: 12px; border: 1px solid var(--line); }
  .summary-grid { grid-template-columns: 1fr 1fr; align-items: start; }
  main.mid { max-width: 960px; }
}

@media (prefers-reduced-motion: reduce) {
  .v2 .head, .v2 .torso, .v2 .eyes { animation: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* 开始页「练什么」先折叠（用户 2026-12-06），只露一行已选的 */
.pickbox > summary { list-style: none; display: flex; align-items: baseline; gap: 10px; cursor: pointer; }
.pickbox > summary::-webkit-details-marker { display: none; }
.pickbox > summary h2 { margin: 0; }
.pickbox .pick-sum { font-size: 14px; color: var(--ink); }
.pickbox .pick-edit { font-size: 13px; color: var(--accent); margin-left: auto; }
.pickbox[open] .pick-edit { visibility: hidden; }
.pickbox[open] > summary { margin-bottom: 10px; }

/* ---------- 舞台卡三段式（Gemini 方案 2026-12-06，Claude 落地） ----------
   人物区只放头像和名牌；现场区全宽左对齐放情景、线索、「你想」；对话区里所有人说的话同一种左侧气泡，「你」在右。
   用户：「如果是单人说话也要有气泡」「信息排列……不要搞得太花里胡哨」 */
.stage { max-height: none; padding: 10px 14px 0; }
.stage .portrait { width: 88px; height: 98px; }
.who { flex: 1; min-width: 0; align-self: center; padding: 4px 0 10px; }
.who .name, .actor .name { display: inline-flex; align-items: center; gap: 6px; font-size: 18px; font-weight: 700; line-height: 1.3; white-space: nowrap; }
.who .role, .actor .role { font-size: 13px; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.badge { font-size: 11.5px; padding: 1px 7px; margin-left: 0; vertical-align: middle; }
.stage[data-kind="observe"] { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; padding: 12px 14px 10px; }
.actor { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.actor .portrait { width: 84px; height: 94px; }
.actor .name { gap: 5px; margin-top: 6px; font-size: 16px; }
.actor .role { font-size: 12px; }
.who .pn, .actor .pn { color: color-mix(in srgb, var(--pc) 85%, var(--ink)); }

.scene-brief { padding: 10px 14px 12px; text-align: left; }
.scene-brief .setting { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.scene-brief .kind-tag { padding: 0 7px; margin: 0 6px 0 0; line-height: 1.5; vertical-align: 1px; }
.cues { margin: 7px 0 0; display: grid; gap: 3px; font-size: 13.5px; font-weight: 500; line-height: 1.5; color: var(--ink); }
.cues li { position: relative; padding-left: 12px; }
.cues li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 4px; height: 4px; border-radius: 50%; background: var(--muted); }
.cues li.hit::before { background: var(--passable); }
.aim { margin: 8px 0 0; padding: 7px 10px; border-radius: 8px; background: var(--accent-soft); font-size: 14px; font-weight: 600; line-height: 1.45; color: var(--ink); }
.aim .k { display: inline-block; font-size: 11.5px; font-weight: 700; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 5px; padding: 0 5px; margin-right: 7px; vertical-align: 1px; }
.enter .scene-brief { animation: push 220ms cubic-bezier(0.22, 1, 0.36, 1) 60ms backwards; }

.dialogue { padding: 12px 14px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
/* 主动开口选前还没人说话：整块不显示（旁观题的 .x 也算有内容） */
.dialogue:not(:has(.them, .me, .x)) { display: none; }
.dialogue .line, .dialogue .talk { padding: 0; display: grid; gap: 8px; font-size: 15.5px; }
.dialogue .line:empty, .dialogue .talk:empty { display: none; }
.dialogue .them, .dialogue .line .x {
  margin: 0; justify-self: start; max-width: 88%;
  background: var(--bg); border-left: 3px solid var(--pc); border-radius: 4px 12px 12px 4px;
  padding: 9px 12px; font-size: 15.5px; font-weight: 500; line-height: 1.55; color: var(--ink);
}
.dialogue .them .by, .dialogue .line .x b { display: block; font-size: 12px; font-weight: 600; line-height: 1.35; color: color-mix(in srgb, var(--pc) 80%, var(--ink)); margin-bottom: 2px; }
.dialogue .them .zh { font-size: 13px; color: var(--muted); padding: 0; margin: 4px 0 0; }
.dialogue .them.dots { border-left-color: var(--line); }
/* 对方不说话：虚线静默气泡 */
.dialogue .them.silent { animation: none; background: transparent; border: 1px dashed var(--line); border-left: 3px solid color-mix(in srgb, var(--pc) 45%, var(--line)); font-size: 14px; font-weight: 400; color: var(--muted); }
.dialogue .them.silent .by { color: color-mix(in srgb, var(--pc) 65%, var(--muted)); }
.dialogue .them.silent .hush { font-style: normal; }
.dialogue .me { font-size: 15.5px; font-weight: 500; line-height: 1.55; }

@media (min-width: 1024px) {
  .stage { flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 16px 16px 12px; }
  .stage .portrait { width: 156px; height: 174px; }
  .who { align-self: auto; padding: 0; }
  .stage[data-kind="observe"] { gap: 12px; padding: 16px 16px 12px; }
  .actor .portrait { width: 136px; height: 152px; }
  .actor .name { font-size: 17px; }
  .actor .role { font-size: 13px; }
  .scene-brief { padding: 12px 16px; }
  .cues { display: grid; text-align: left; }
  .dialogue { padding: 12px 16px 14px; }
}
