/* 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; }
/* 手机点按高亮是按外框画的方块，不跟圆角走（用户 2026-12-06：「按钮触碰时候的 highlight 是方形而不是按钮的椭圆的」）。
   关掉它，按下反馈改用 filter，跟着按钮自己的形状。 */
html { -webkit-tap-highlight-color: transparent; }
button:active:not(:disabled), summary:active, label:active { filter: brightness(.9); }
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; }
.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; }
.hint.fine { min-height: 0; font-size: 12px; }


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

/* 总结页仍复用的基础横幅类 */
.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; flex: none; }
.level-tip[hidden] { display: none; }

/* ---------- 开始页（PC 平衡双栏 + 手机首屏直达开演） ---------- */
main.startwide { padding-top: 8px; }

.start-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  margin-bottom: 8px;
}
.start-me {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.start-me i {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.start-switch {
  flex: none;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  transition: color 140ms var(--ease-std), background-color 140ms var(--ease-std);
}
.start-switch:hover { color: var(--accent); background: var(--accent-soft); }

.start-grid { display: grid; gap: 10px; }

/* 舞台幕布：改 flex 流式布局，彻底杜绝气泡压标题 */
.start .hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  box-shadow: var(--shadow);
  background: radial-gradient(ellipse 74% 62% at 50% 84%, color-mix(in srgb, var(--accent) 22%, var(--stage)) 0%, var(--stage) 64%, color-mix(in srgb, var(--stage) 78%, 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);
}
/* 手机端品牌压为单行顶带（与登录页 .login-bar 呼应） */
.start .brand {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 9px 12px 0;
  text-align: left;
}
.start .brand h1 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: .06em; line-height: 1.2; }
.start .brand .en { font-size: 11.5px; letter-spacing: .14em; color: var(--muted); }
.start .brand .en span { color: var(--accent); }
.start .brand .s { margin-left: auto; font-size: 11.5px; letter-spacing: .1em; color: var(--muted); white-space: nowrap; }

.start .bubble {
  position: relative;
  z-index: 3;
  margin: 8px 12px 10px;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
  border-radius: 13px;
  padding: 7px 11px;
  font-size: 13.5px;
  line-height: 1.45;
  box-shadow: var(--shadow);
  transition: opacity 240ms var(--ease-std), transform 240ms var(--ease-out);
}
.start .bubble.out { opacity: 0; transform: translateY(5px); }
.start .bubble b { display: block; font-size: 11.5px; font-weight: 600; color: color-mix(in srgb, var(--accent) 55%, var(--muted)); margin-bottom: 1px; }
.start .bubble::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: var(--tail, 50%);
  width: 11px;
  height: 11px;
  background: var(--card);
  border-right: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
  rotate: 45deg;
  translate: -50% 0;
}

.start .cast {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-top: 4px;
}
.start .cast .portrait {
  width: 88px;
  height: 99px;
  margin: 0 -6px;
  filter: brightness(.55) saturate(.7);
  transition: filter 400ms var(--ease-std), transform 400ms var(--ease-out);
}
.start .cast .portrait.on { filter: none; transform: translateY(-5px) scale(1.06); z-index: 2; }

/* 右侧/下方控制台 */
.start .panel { min-width: 0; }

/* 进度仪表条（兼容 fillStartStats 原有 DOM，无需改 JS） */
.start .streak {
  margin: 0 0 10px;
  min-height: 36px;
  font-size: 12.5px;
  color: var(--muted);
}
.start .streak:empty {
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  border-radius: 12px;
  opacity: .55;
}
.start .streak:not(:empty):not(:has(b)) {
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  color: var(--ink);
  border-radius: 12px;
  padding: 8px 12px;
}
.start .streak:has(b) {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 5px;
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 12px;
  padding: 8px 12px;
  box-shadow: var(--shadow);
}
.start .streak b { font-size: 16px; font-weight: 800; color: var(--ink); line-height: 1.2; }
.start .streak .up, .start .streak .down {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  padding: 2px 8px;
  border-radius: 999px;
}
.start .streak .up { color: var(--aligned); background: var(--aligned-soft); }
.start .streak .down { color: var(--misfire); background: var(--misfire-soft); }

/* 续玩 / 上轮总结条：左色带区别于下方升降级提示 */
.start .panel > .resume {
  margin-bottom: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-left: 3px solid var(--accent);
}

/* 统一配置卡 */
.setup-card {
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2px 14px;
}

/* 练什么（折叠行与下方设置行共享 48px 标签列） */
.pickbox {
  padding: 10px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.pickbox > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  min-height: 28px;
}
.pickbox > summary::-webkit-details-marker { display: none; }
.pickbox > summary h2 {
  flex: 0 0 48px;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.pickbox .pick-sum {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pickbox .pick-edit {
  flex: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
}
.pickbox .pick-edit::after {
  content: " ▾";
  display: inline-block;
  transition: transform 180ms var(--ease-std);
}
.pickbox[open] .pick-edit { color: var(--muted); background: transparent; }
.pickbox[open] .pick-edit::after { transform: rotate(180deg); }
.pickbox[open] > summary { margin-bottom: 10px; }

.tiles { display: grid; gap: 8px; }
.tile {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  align-items: center;
  text-align: left;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 6px 12px 6px 6px;
  transition: border-color 160ms var(--ease-std), background 160ms var(--ease-std);
}
.tile.on { border-color: var(--accent); background: linear-gradient(90deg, var(--accent-soft), var(--card) 78%); }
.tile .face { width: 56px; height: 63px; display: block; }
.tile .face svg { width: 100%; height: 100%; display: block; }
.tile .body { display: block; min-width: 0; }
.tile .nm { display: block; font-weight: 700; font-size: 15px; line-height: 1.3; }
.tile .ds { display: block; font-size: 12px; color: var(--muted); }
.tile .meter { display: flex; align-items: center; gap: 8px; margin-top: 5px; font-size: 11.5px; color: var(--muted); }
.tile .meter i { flex: 1; height: 5px; 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); }

/* 几题 & 难度：固定左列 + 药丸组 + 对齐说明 */
.setup-row.sizes {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 0;
  padding: 10px 0 4px;
  font-size: 13px;
}
.setup-row .row-k { flex: 0 0 48px; font-size: 13px; font-weight: 600; }
.pill-group { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.start .sizes .pill {
  padding: 6px 11px;
  min-height: 34px;
  min-width: 44px;
  font-size: 13.5px;
  line-height: 1.25;
  background: var(--bg);
  transition: border-color 140ms var(--ease-std), background-color 140ms var(--ease-std), color 140ms var(--ease-std);
}
.start .sizes .pill:hover:not(.on) { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.start .sizes .pill.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 700; }
.start #all-n { font-size: 12px; opacity: .78; margin-left: 2px; }

.setup-level { padding-bottom: 10px; }
.setup-level .sizes.levels { padding-top: 6px; }
.start #level-desc {
  margin: 4px 0 0;
  min-height: 1.35em;
  padding-left: 58px; /* 48px 标签列 + 10px 间距，与难度药丸左对齐 */
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

/* 审题模式：配置卡底部拨动开关行，原生 checkbox 保留无障碍 */
.reviewmode {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 9px 0 10px;
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  cursor: pointer;
}
.reviewmode .rm-body { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; min-width: 0; }
.reviewmode .rm-title { font-size: 13px; font-weight: 600; color: color-mix(in srgb, var(--ink) 84%, var(--muted)); }
.reviewmode .rm-desc { font-size: 12px; color: var(--muted); }
.reviewmode:has(input:checked) .rm-title { color: var(--accent); }
.reviewmode input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  position: relative;
  width: 38px;
  height: 22px;
  margin: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--line) 85%, var(--bg));
  cursor: pointer;
  transition: background-color 160ms var(--ease-std), border-color 160ms var(--ease-std);
}
.reviewmode input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-std);
}
.reviewmode input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.reviewmode input[type="checkbox"]:checked::after { transform: translateX(16px); background: var(--on-accent); }

/* 启动区：手机端全宽吸底（镜像答题页 .dock），保底 375×667 首屏可见 */
.start-dock {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 10px -16px 0;
  padding: 9px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--card);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px color-mix(in srgb, var(--bg) 60%, transparent);
}
.start-notices { display: grid; gap: 7px; margin-bottom: 8px; }
.start-notices:not(:has(#pick-count:not(:empty), #level-tip:not([hidden]))) { display: none; }

.start #pick-count {
  position: relative;
  margin: 0;
  min-height: 0;
  padding-left: 14px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}
.start #pick-count:empty { display: none; }
.start #pick-count::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .56em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--aligned);
}
.start #pick-count[data-state="stale"] {
  padding: 7px 10px 7px 23px;
  border-radius: 10px;
  background: var(--passable-soft);
  border: 1px solid color-mix(in srgb, var(--passable) 32%, transparent);
  color: var(--passable);
  font-weight: 600;
}
.start #pick-count[data-state="stale"]::before { left: 10px; top: 13px; background: var(--passable); }
.start #pick-count[data-state="stale"]::after { content: " · 本轮将抽旧题"; font-weight: 500; opacity: .92; }
.start #pick-count[data-state="empty"] {
  padding: 7px 10px 7px 23px;
  border-radius: 10px;
  background: var(--misfire-soft);
  border: 1px solid color-mix(in srgb, var(--misfire) 32%, transparent);
  color: var(--misfire);
  font-weight: 600;
}
.start #pick-count[data-state="empty"]::before { left: 10px; top: 13px; background: var(--misfire); }

/* 升降级提示与状态行同区收拢，采用次级边框样式避免和顶部 .resume 撞色 */
.start .level-tip {
  margin: 2px 0 12px;
  padding: 7px 8px 7px 11px;
  border-radius: 10px;
  background: var(--stage);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
  font-size: 12.5px;
  line-height: 1.4;
}
.start .level-tip .btn { padding: 5px 11px; font-size: 12px; }

.start .cta .btn {
  width: 100%;
  padding: 12px 18px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .04em;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 26%, transparent);
  transition: filter 140ms var(--ease-std), transform 100ms var(--ease-std), opacity 140ms var(--ease-std);
}
.start .cta .btn:hover:not(:disabled) { filter: brightness(1.06); }
.start .cta .btn:active:not(:disabled) { transform: scale(.988); }
.start .cta .btn:disabled { box-shadow: none; }

/* 破坏性操作：沉底居中，与「换人」隔开整页 */
.start-foot {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}
.start-clear {
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--muted);
  opacity: .76;
  transition: color 140ms var(--ease-std), background-color 140ms var(--ease-std), opacity 140ms var(--ease-std);
}
.start-clear:hover, .start-clear:focus-visible {
  color: var(--misfire);
  background: var(--misfire-soft);
  opacity: 1;
}

/* 平板/窄窗（640–1023px）：吸底栏对齐 640px 列宽，不向两侧伸出 */
@media (min-width: 640px) and (max-width: 1023px) {
  .start-dock { margin: 12px 0 0; border-radius: var(--radius); border: 1px solid var(--line); }
}

/* PC 宽屏（≥1024px）：左右等高平衡双栏 + 合并主操作卡 */
@media (min-width: 1024px) {
  main.startwide { max-width: 960px; padding: 18px 24px 28px; }
  .start {
    min-height: calc(100svh - 46px);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .start-bar { margin-bottom: 12px; }
  .start-grid {
    grid-template-columns: minmax(0, 1.06fr) minmax(380px, 436px);
    gap: 24px;
    align-items: start;
  }
  .start .hero { height: 468px; position: sticky; top: 20px; }
  .start .brand { display: block; text-align: center; padding: 34px 24px 0; }
  .start .brand h1 { font-size: 34px; letter-spacing: .08em; }
  .start .brand .en { font-size: 13.5px; letter-spacing: .2em; margin-top: 1px; }
  .start .brand .s { margin: 4px 0 0; font-size: 13px; letter-spacing: .22em; }
  .start .bubble { margin: auto 22px 18px; min-height: 82px; padding: 11px 15px; font-size: 14.5px; line-height: 1.5; }
  .start .bubble b { font-size: 12px; }
  .start .cast .portrait { width: 128px; height: 144px; margin: 0 -15px; }

  .start .streak { margin-bottom: 12px; min-height: 70px; }
  .start .streak:not(:empty):not(:has(b)) { display: flex; align-items: center; padding: 12px 16px; font-size: 13.5px; }
  .start .streak:has(b) {
    border-radius: var(--radius);
    padding: 12px 16px 13px;
    font-size: 13px;
    gap: 4px 6px;
  }
  .start .streak:has(b)::before {
    content: "你的进度";
    flex: 0 0 100%;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--muted);
    margin-bottom: 2px;
  }
  .start .streak b { font-size: 19px; }
  .start .panel > .resume { margin-bottom: 12px; padding: 10px 10px 10px 14px; }

  /* PC 下配置卡与启动带合并为一张无接缝主卡 */
  .panel-main {
    background: var(--card);
    border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
  }
  .setup-card { border: 0; border-radius: 0; box-shadow: none; padding: 4px 18px 2px; }
  .pickbox { padding: 12px 0; }
  .tile { grid-template-columns: 64px 1fr; gap: 12px; }
  .tile .face { width: 64px; height: 72px; }
  .setup-row.sizes { padding: 12px 0 6px; gap: 12px; }
  .start .sizes .pill { padding: 6px 13px; font-size: 14px; }
  .setup-level { padding-bottom: 12px; }
  .start #level-desc { padding-left: 60px; font-size: 12.5px; }
  .reviewmode { padding: 11px 0 12px; }

  .start-dock {
    position: static;
    margin: 0;
    padding: 14px 18px 18px;
    background: color-mix(in srgb, var(--stage) 52%, var(--card));
    border-top: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
    box-shadow: none;
  }
  .start-notices { margin-bottom: 12px; }
  .start-notices .level-tip { margin: 0; }
  .start .cta .btn { padding: 13px 20px; }
  .start-foot { justify-content: flex-end; margin-top: 8px; }
}
@media (min-width: 1024px) and (max-height: 680px) {
  .start { min-height: 0; justify-content: flex-start; }
}

/* ---------- 答题：舞台卡 ---------- */
.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: rise 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; }
}

/* .pickbox 样式已收拢至上方「开始页」区块 */

/* ---------- 舞台卡三段式（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; }
}

/* 来源：Gemini 定稿 D1（docs/dispatch/gemini-v8-login.reply.md），Claude 落地；用户 2026-12-06 选浅蓝待发气泡 */
/* ---------- 登录页定稿（方案 D1：单人近景舞台 + 对戏气泡流） ---------- */
.login-view {
  max-width: 420px;
  margin: 0 auto;
  min-height: calc(100svh - 38px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}
.login-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}
.login-brand { display: inline-flex; align-items: baseline; gap: 7px; }
.login-brand b { font-size: 20px; font-weight: 800; letter-spacing: .08em; line-height: 1.2; }
.login-brand .en { font-size: 12px; letter-spacing: .16em; color: var(--muted); }
.login-brand .en i { font-style: normal; color: var(--accent); }
.login-sub { font-size: 12.5px; letter-spacing: .12em; color: var(--muted); white-space: nowrap; }

.login-card { display: flex; flex-direction: column; }

/* 上半（桌面为左栏）：单人近景舞台 */
.login-stage {
  position: relative;
  background: var(--stage);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 12px 16px 0;
  overflow: hidden;
}
.login-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 64% 58% at 50% 88%,
    color-mix(in srgb, var(--pc-c, var(--accent)) 24%, transparent),
    transparent 72%
  );
  transition: opacity 280ms var(--ease-std);
}
.login-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 240ms var(--ease-std), background-color 240ms var(--ease-std);
}
.login-stage[data-mood="open"]::after {
  background: radial-gradient(ellipse 68% 60% at 50% 86%, var(--aligned), transparent 72%);
  opacity: .22;
}
.login-stage[data-mood="tense"]::after {
  background: radial-gradient(ellipse 68% 60% at 50% 86%, var(--misfire), transparent 72%);
  opacity: .18;
}
.login-stage .portrait { position: relative; z-index: 1; width: 136px; height: 153px; flex: none; }

/* 下半（桌面为右栏）：一问一答对话流 */
.login-talk {
  background: var(--card);
  padding: 16px 14px;
  display: grid;
  align-content: start;
  gap: 12px;
}

/* 对方气泡：与答题页 .dialogue .them 完全同款 */
.login-say {
  margin: 0;
  justify-self: start;
  max-width: 88%;
  background: var(--bg);
  border-left: 3px solid var(--pc-c, var(--accent));
  border-radius: 4px 12px 12px 4px;
  padding: 10px 14px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink);
}
.login-say .by {
  display: block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: color-mix(in srgb, var(--pc-c, var(--muted)) 80%, var(--ink));
  margin-bottom: 2px;
}

/* 你的气泡输入框：靠右 + 右上小圆角，待发浅蓝，发出变实心蓝 */
.login-reply {
  justify-self: end;
  width: 88%;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-soft);
  border: 1.5px solid color-mix(in srgb, var(--accent) 42%, var(--line));
  border-radius: 16px 4px 16px 16px;
  padding: 5px 5px 5px 14px;
  transition: background-color 200ms var(--ease-std), border-color 160ms var(--ease-std), box-shadow 160ms var(--ease-std);
}
.login-reply:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.login-reply input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink);
  caret-color: var(--accent);
  background: transparent;
  border: 0;
  outline: none;
  padding: 6px 0;
}
.login-reply input::placeholder { color: color-mix(in srgb, var(--accent) 55%, var(--muted)); }
.login-reply input:focus-visible { outline: none; }

.login-send {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  opacity: .45;
  transition: opacity 150ms var(--ease-std), transform 120ms var(--ease-std);
}
.login-reply.has-val .login-send { opacity: 1; }
.login-send:active:not(:disabled) { transform: scale(.94); }
.login-send svg { width: 18px; height: 18px; }

/* 报错态 */
.login-reply.err {
  border-color: var(--misfire);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--misfire) 18%, transparent);
  animation: login-shake 280ms var(--ease-std);
}
@keyframes login-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  55% { transform: translateX(4px); }
  80% { transform: translateX(-2px); }
}
.login-err {
  margin: -6px 4px 0 0;
  justify-self: end;
  max-width: 88%;
  text-align: right;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--misfire);
  animation: push 180ms var(--ease-out);
}
.login-err:empty { display: none; }

/* 发出锁定态：平滑转为答题页 .me 同款实心蓝气泡 */
.login-reply.sent {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: none;
}
.login-reply.sent input {
  color: var(--on-accent);
  -webkit-text-fill-color: var(--on-accent);
  opacity: 1;
}
.login-reply.sent .login-send { opacity: 0; pointer-events: none; }

.login-note {
  margin: 0;
  text-align: center;
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
}

/* 进场节拍（由 .enter 控制，互动后移除防重播） */
.login-view.enter .login-bar,
.login-view.enter .login-note { animation: fade 260ms var(--ease-std) both; }
.login-view.enter .login-stage .portrait { animation: rise 280ms var(--ease-out) both; }
.login-view.enter .login-say { animation: push 240ms var(--ease-out) 120ms both; }
.login-view.enter .login-reply { animation: push 240ms var(--ease-out) 300ms both; }

/* 手机横屏或软键盘顶起时改为自然贴顶 */
@media (max-height: 540px) {
  .login-view { min-height: 0; justify-content: flex-start; padding-top: 2px; }
}

/* 桌面端：700px 居中双栏小舞台（左大立绘 + 右对话流） */
@media (min-width: 768px) {
  main.loginwide { max-width: 760px; }
  .login-view { max-width: 700px; min-height: calc(100svh - 48px); gap: 16px; }
  .login-brand b { font-size: 22px; }
  .login-brand .en, .login-sub { font-size: 13px; }
  .login-card { display: grid; grid-template-columns: 248px 1fr; min-height: 300px; }
  .login-stage { padding: 24px 16px 0; }
  .login-stage .portrait { width: 184px; height: 207px; }
  .login-talk { padding: 28px 28px 24px; align-content: center; gap: 14px; }
  .login-say { font-size: 16px; }
}
