/* Metamuse v2 · 沉浸式 base — 猫箱风 + 蒸馏差异化 */

/* ============ DM Sans variable font 自托管 (跟 scholar.metadistill.com 同源 woff2) ============ */
/* 一个 woff2 包含全部 weight 300-700 + opsz 光学尺寸轴(大字号自动 Display 变体,更扁更粗) */
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url("/fonts/dm-sans/dm-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url("/fonts/dm-sans/dm-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --accent: #a8423c;
  --accent-soft: rgba(168, 66, 60, 0.08);
  --accent-pale: #fdf6ee;
  --accent-yellow: #fcda28;
  --kb-h: 0px;       /* 键盘弹起高度,JS 监听 visualViewport.resize 写入 */

  --ink: #1a1714;
  --ink-2: #2a2a2a;
  --ink-3: #3a3530;
  --ink-dim: #5a5550;
  --ink-mute: #7a7570;
  --ink-soft: #9a9a9a;

  --paper: #ffffff;
  --paper-warm: #f5f3ec;
  --paper-soft: rgba(245, 240, 232, 0.85);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* tabbar 真实高度 = 内容 64 + safe-bottom(home indicator) */
  --tabbar-h: calc(64px + max(8px, var(--safe-bottom)));
  --dock-bottom: calc(var(--tabbar-h) + 6px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  /* 三段 fallback:vh → svh(iOS 15.4+) → dvh(自适应地址栏) */
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  min-height: 100%;
  overflow: hidden;
  overscroll-behavior: none;        /* 防 pull-to-refresh 整页刷新 */
  touch-action: manipulation;       /* 禁双击放大 */
}
.msg-stream, .sheet .body, #view-persona-info, .create-snap {
  overscroll-behavior: contain;     /* 内滚到顶/底不冒到外层 */
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif;
  background: #000;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: transparent; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
.hidden { display: none !important; }

/* ============ Stage / 三层分层 ============ */
.stage {
  position: fixed; inset: 0;
  height: 100dvh;
  background: #0a0a0a;
  overflow: hidden;
}
.bg-img {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center 25%;
  background-repeat: no-repeat;
  transition: filter 0.5s ease, opacity 0.6s ease;
  z-index: 0;
  /* 渐变兜底立绘:加载中 + no-image 时显示 */
  background-color: transparent;
}
.bg-img.no-image,
.bg-img.loading {
  background-image: linear-gradient(165deg, #4a3a52 0%, #6b4d6e 35%, #8a5e6c 60%, #b87466 100%) !important;
}
.bg-img.loaded {
  animation: bg-fade-in 0.6s ease-out;
}
@keyframes bg-fade-in {
  from { opacity: 0; transform: scale(1.04); }
  to   { opacity: 1; transform: scale(1); }
}
/* 呼吸感 — 立绘 4s scale 1.0 ↔ 1.015,极轻微但有"活感" */
.bg-img.breathing {
  animation: bg-fade-in 0.6s ease-out, bg-breath 6s ease-in-out 0.6s infinite;
}
@keyframes bg-breath {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.015); }
}
.bg-img.blurred { filter: blur(8px) brightness(0.78); }

/* v2.1.7 历史载入更多按钮 */
.history-more {
  align-self: center;
  background: rgba(20, 18, 16, 0.5);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.7);
  padding: 8px 18px;
  border-radius: 99px;
  font-size: 12px;
  letter-spacing: 1px;
  cursor: pointer;
  margin: 8px 0;
  transition: background 0.18s;
}
.history-more:hover { background: rgba(168, 66, 60, 0.25); }

/* v2.0.2 CP 双立绘 — 左右半屏分割 */
body.cp-mode .bg-img {
  background-image: var(--cp-bg-a, none);
  background-size: cover;
  background-position: 30% center;
  filter: brightness(0.7);
}
body.cp-mode .bg-img::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 50%;
  background-image: var(--cp-bg-b, none);
  background-size: cover;
  background-position: 70% center;
  filter: brightness(0.7);
}
/* CP 双气泡 — A 靠左,B 靠右 */
.msg.assistant.cp-msg-A {
  align-self: flex-start;
  border-left: 2px solid rgba(168, 200, 255, 0.45);
}
.msg.assistant.cp-msg-B {
  align-self: flex-end;
  border-right: 2px solid rgba(255, 180, 200, 0.45);
  background: rgba(40, 20, 25, 0.62);
}
.msg.assistant .cp-name {
  display: inline-block;
  font-size: 11.5px;
  color: rgba(255, 200, 195, 0.85);
  letter-spacing: 1px;
  margin-bottom: 4px;
  margin-left: 4px;
  font-weight: 500;
  vertical-align: middle;
}
.msg.assistant .cp-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 2px;
  border: 1px solid rgba(255,255,255,0.2);
}
.msg.assistant.cp-msg-A .cp-name { color: rgba(168, 200, 255, 0.92); }
.msg.assistant.cp-msg-B .cp-name { color: rgba(255, 180, 200, 0.92); }
body.cp-mode .msg.user {
  align-self: center;
  max-width: 70%;
}
/* multi (N≥3) 角色头像条 — 顶部固定,水平排 N 个圆头像 */
.party-bar {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 10px;
  padding: 6px 10px;
  background: rgba(20, 14, 18, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-radius: 22px;
  z-index: 22;
}
.party-slot {
  display: flex; flex-direction: column; align-items: center;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity .18s, transform .18s;
}
.party-slot.active {
  opacity: 1;
  transform: scale(1.08);
}
.party-slot img {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover;
  border: 2px solid transparent;
}
.party-slot.active img { border-color: rgba(255, 200, 195, 0.85); }
.party-slot span {
  font-size: 10px; color: rgba(255,255,255,0.85);
  margin-top: 2px; max-width: 48px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.msg.assistant.party-msg {
  align-self: flex-start;
  border-left: 2px solid var(--party-color, rgba(168, 200, 255, 0.45));
}
.msg.assistant.party-msg .cp-name { color: var(--party-color, rgba(255,200,195,0.92)); }
/* SC-02 Top1 4 模式调度 chip — 头像条最右侧 */
.party-mode-chip {
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: 8px;
  padding: 3px 10px;
  font-size: 10px;
  background: rgba(255, 200, 195, 0.15);
  color: rgba(255, 220, 215, 0.95);
  border: 1px solid rgba(255, 200, 195, 0.4);
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s, transform .12s;
  white-space: nowrap;
  align-self: center;
}
.party-mode-chip:hover, .party-mode-chip:active {
  background: rgba(255, 200, 195, 0.32);
  transform: scale(1.04);
}
/* R10+ UX:emotion 触发头像 slot 微动效(对标顶级氛围切换) */
.party-slot.emo-pulse img {
  animation: party-emo-pulse 1.4s ease-out;
}
@keyframes party-emo-pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 var(--emo-color, rgba(255,255,255,0.6)); }
  35% { transform: scale(1.12); box-shadow: 0 0 0 6px var(--emo-color, rgba(255,255,255,0.0)); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 transparent; }
}
.party-slot.emo-angry  { --emo-color: rgba(232, 100, 90, 0.55); }
.party-slot.emo-shy    { --emo-color: rgba(255, 180, 200, 0.55); }
.party-slot.emo-sad    { --emo-color: rgba(140, 170, 220, 0.55); }
.party-slot.emo-happy  { --emo-color: rgba(255, 220, 130, 0.55); }
.party-slot.emo-tender { --emo-color: rgba(220, 195, 255, 0.55); }
/* R10+ UX:关系阶段 → body class → dock 边框暖色 glow(对标 intimate 阶段) */
body.rel-close .input-bar { box-shadow: inset 0 0 0 1px rgba(255, 200, 195, 0.25); }
body.rel-deep .input-bar  { box-shadow: inset 0 0 0 1px rgba(255, 180, 180, 0.42), 0 0 12px rgba(255, 180, 180, 0.12); }
body.rel-heartfelt .input-bar {
  box-shadow: inset 0 0 0 1px rgba(255, 160, 165, 0.62), 0 0 18px rgba(255, 150, 160, 0.22);
  animation: rel-heartfelt-glow 4s ease-in-out infinite;
}
@keyframes rel-heartfelt-glow {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(255, 160, 165, 0.62), 0 0 18px rgba(255, 150, 160, 0.22); }
  50%      { box-shadow: inset 0 0 0 1px rgba(255, 175, 180, 0.78), 0 0 26px rgba(255, 165, 175, 0.32); }
}
/* v2.11.5 B. SCENE 时间线 — 角色档案抽屉里 "你们的剧情节点" */
.scene-timeline-card {
  margin: 14px 14px 8px;
  padding: 12px 14px 10px;
  background: rgba(28, 22, 25, 0.55);
  border: 1px solid rgba(255, 200, 195, 0.18);
  border-radius: 12px;
}
.stl-h {
  font-size: 12px; letter-spacing: 4px;
  color: rgba(255, 200, 195, 0.85);
  margin-bottom: 8px;
  font-weight: 500;
}
.stl-list { display: flex; flex-direction: column; gap: 0; }
.stl-item {
  position: relative;
  padding: 6px 0 6px 18px;
  border-left: 1px solid rgba(255, 200, 195, 0.22);
  margin-left: 4px;
}
.stl-item:last-child { border-left-color: transparent; }
.stl-dot {
  position: absolute; left: -4px; top: 11px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255, 180, 180, 0.85);
  box-shadow: 0 0 6px rgba(255, 180, 180, 0.5);
}
.stl-row1 {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: rgba(255, 220, 215, 0.92);
}
.stl-row1 strong { font-weight: 500; letter-spacing: 1px; }
.stl-date { font-size: 10px; color: rgba(255, 200, 195, 0.55); }
.stl-snap {
  font-size: 11px;
  color: rgba(255, 220, 215, 0.62);
  margin-top: 2px;
  font-style: italic;
  line-height: 1.45;
}
.stl-empty {
  font-size: 11px;
  color: rgba(255, 200, 195, 0.42);
  text-align: center;
  padding: 10px 0;
  font-style: italic;
}
/* v2.11.5 C. 高光时刻特效 — 全屏渐变 + 中央大字 + 1.6s 淡出 */
.highlight-fx {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity .35s ease-out;
}
.highlight-fx.show { opacity: 1; }
.hfx-glow {
  position: absolute; inset: 0;
  background: radial-gradient(circle at center,
    rgba(255, 200, 195, 0.32) 0%,
    rgba(255, 180, 175, 0.18) 32%,
    rgba(40, 20, 25, 0.0) 68%);
  animation: hfx-pulse 1.6s ease-out;
}
@keyframes hfx-pulse {
  0%   { transform: scale(0.7); opacity: 0; }
  25%  { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}
.hfx-text {
  position: absolute; left: 50%; top: 42%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  letter-spacing: 8px;
  color: rgba(255, 240, 235, 0.96);
  text-align: center;
  text-shadow: 0 2px 18px rgba(255, 180, 175, 0.65), 0 0 36px rgba(255, 200, 195, 0.45);
  animation: hfx-text 1.6s ease-out;
}
.hfx-text strong {
  display: block;
  font-size: 32px;
  margin-top: 8px;
  font-weight: 600;
  letter-spacing: 12px;
  color: rgba(255, 220, 215, 1);
}
@keyframes hfx-text {
  0%   { transform: translate(-50%, -50%) scale(0.6); opacity: 0; }
  20%  { transform: translate(-50%, -50%) scale(1.04); opacity: 1; }
  85%  { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.06); opacity: 0; }
}
/* v2.11.6 D. 高光画册 — 历史高光列表,点击重生成卡 */
.highlight-album-card {
  margin: 14px 14px 8px;
  padding: 12px 14px 10px;
  background: linear-gradient(140deg, rgba(40, 22, 25, 0.62), rgba(28, 18, 22, 0.55));
  border: 1px solid rgba(255, 200, 195, 0.22);
  border-radius: 12px;
}
.rel-vector-card {
  margin: 14px 14px 8px;
  padding: 12px 14px 10px;
  background: linear-gradient(140deg, rgba(28, 28, 42, 0.62), rgba(20, 22, 32, 0.55));
  border: 1px solid rgba(170, 180, 220, 0.22);
  border-radius: 12px;
}
.rv-h {
  font-size: 12px; letter-spacing: 4px;
  color: rgba(220, 225, 240, 0.92);
  margin-bottom: 10px;
  font-weight: 500;
  display: flex; align-items: baseline; justify-content: space-between;
}
.rv-tip { font-size: 9px; letter-spacing: 1px; color: rgba(170, 180, 220, 0.5); font-weight: normal; }
.rv-grid { display: flex; flex-direction: column; gap: 6px; }
.rv-row { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.rv-lab { width: 64px; color: rgba(220, 225, 240, 0.7); flex-shrink: 0; }
.rv-bar {
  flex: 1; height: 6px; border-radius: 3px;
  background: rgba(170, 180, 220, 0.10);
  overflow: hidden;
  position: relative;
}
.rv-bar-bi {
  background: linear-gradient(to right, rgba(255, 100, 100, 0.10) 0%, rgba(170, 180, 220, 0.10) 50%, rgba(100, 200, 150, 0.10) 100%);
}
.rv-fill { height: 100%; border-radius: 3px; transition: width .4s ease, transform .4s ease; }
.rv-depth { background: linear-gradient(90deg, #c83a3a, #ffa370); width: 0%; }
.rv-valence { background: linear-gradient(90deg, #ff8888, #ffffff, #88ff99); width: 50%; transform-origin: center; }
.rv-trust { background: linear-gradient(90deg, #aabbe0, #ffd4a0); width: 0%; }
.rv-foresight { background: linear-gradient(90deg, #d8a3ff, #ffcd6e); width: 0%; }
.rv-val { width: 42px; text-align: right; color: rgba(220, 225, 240, 0.85); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.foresight-card {
  margin: 14px 14px 8px;
  padding: 12px 14px 10px;
  background: linear-gradient(140deg, rgba(38, 28, 22, 0.62), rgba(28, 22, 18, 0.55));
  border: 1px solid rgba(255, 210, 170, 0.22);
  border-radius: 12px;
}
.fs-h {
  font-size: 12px; letter-spacing: 4px;
  color: rgba(255, 225, 200, 0.92);
  margin-bottom: 8px;
  font-weight: 500;
  display: flex; align-items: baseline; justify-content: space-between;
}
.fs-tip { font-size: 9px; letter-spacing: 1px; color: rgba(255,210,170,0.45); font-weight: normal; }
.fs-list { display: flex; flex-direction: column; gap: 6px; }
.fs-item {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255, 210, 170, 0.06);
  border: 1px solid rgba(255, 210, 170, 0.14);
  border-radius: 10px;
  padding: 8px 10px;
}
.fs-text {
  flex: 1; font-size: 12px; line-height: 1.45;
  color: rgba(255, 232, 210, 0.92);
}
.fs-topic {
  font-size: 10px; padding: 1px 6px;
  background: rgba(255, 180, 120, 0.16);
  border: 1px solid rgba(255, 180, 120, 0.32);
  border-radius: 6px;
  color: rgba(255, 220, 180, 0.9);
  margin-right: 6px;
  flex-shrink: 0;
}
.fs-done {
  font-size: 14px; line-height: 1;
  width: 22px; height: 22px;
  border-radius: 50%; border: 1px solid rgba(255,210,170,0.4);
  background: rgba(255,210,170,0.08);
  color: rgba(255,220,180,0.85);
  cursor: pointer; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .18s, transform .12s;
}
.fs-done:hover, .fs-done:active { background: rgba(200, 250, 200, 0.18); transform: scale(1.05); }
.fs-empty { font-size: 11px; color: rgba(255,210,170,0.5); padding: 6px 2px; text-align: center; }
.hal-h {
  font-size: 12px; letter-spacing: 4px;
  color: rgba(255, 220, 215, 0.92);
  margin-bottom: 8px;
  font-weight: 500;
  display: flex; align-items: baseline; justify-content: space-between;
}
.hal-tip { font-size: 9px; letter-spacing: 1px; color: rgba(255,200,195,0.45); font-weight: normal; }
.hal-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hal-item {
  background: rgba(255, 200, 195, 0.08);
  border: 1px solid rgba(255, 200, 195, 0.18);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  transition: background .18s, transform .12s;
}
.hal-item:hover, .hal-item:active {
  background: rgba(255, 200, 195, 0.18);
  transform: translateY(-1px);
}
.hal-scene {
  font-size: 12px; font-weight: 500;
  color: rgba(255, 220, 215, 0.95);
  letter-spacing: 1px;
}
.hal-text {
  font-size: 11px;
  color: rgba(255, 200, 195, 0.7);
  margin-top: 4px;
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}
.hal-date { font-size: 9px; color: rgba(255, 200, 195, 0.42); margin-top: 4px; }
.hal-empty { font-size: 11px; color: rgba(255, 200, 195, 0.42); text-align: center; padding: 10px 0; font-style: italic; }
/* v2.11.6 E. 角色独白气泡 — 用户离开 24h+ 回来时插入,跟普通 reply 区分 */
.msg.assistant.monologue {
  background: linear-gradient(135deg, rgba(60, 30, 40, 0.55), rgba(40, 22, 30, 0.4));
  border: 1px dashed rgba(255, 200, 195, 0.32);
  align-self: stretch;
  max-width: 90%;
  margin: 0 auto 12px;
  padding: 10px 14px;
  border-radius: 10px;
}
.mono-tag {
  font-size: 10px;
  letter-spacing: 3px;
  color: rgba(255, 200, 195, 0.78);
  display: block;
  margin-bottom: 6px;
}
.mono-body { color: rgba(255, 220, 215, 0.95); line-height: 1.55; }
.mono-callback {
  margin-top: 8px;
  font-size: 11px;
  color: rgba(255, 200, 195, 0.5);
  font-style: italic;
}
/* v2.11.6 F. 关系报告 summary — persona-sheet hero 顶部一行 */
.ph-rel-summary {
  margin-top: 8px;
  padding: 6px 12px;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: rgba(255, 220, 215, 0.85);
  background: rgba(255, 200, 195, 0.12);
  border: 1px solid rgba(255, 200, 195, 0.22);
  border-radius: 12px;
  display: inline-block;
  text-align: center;
}
/* v2.11.7 G. 故事书章节 */
.storybook-card {
  margin: 14px 14px 8px;
  padding: 12px 14px 10px;
  background: linear-gradient(135deg, rgba(35, 25, 35, 0.65), rgba(28, 18, 24, 0.55));
  border: 1px solid rgba(220, 180, 255, 0.18);
  border-radius: 12px;
}
.sb-h {
  font-size: 12px; letter-spacing: 4px;
  color: rgba(220, 200, 245, 0.92);
  margin-bottom: 10px;
  font-weight: 500;
  display: flex; align-items: baseline; justify-content: space-between;
}
.sb-tip { font-size: 9px; letter-spacing: 1px; color: rgba(220, 200, 245, 0.4); font-weight: normal; }
.sb-list { display: flex; flex-direction: column; gap: 8px; }
.sb-item {
  display: flex; gap: 10px;
  padding: 9px 10px;
  background: rgba(220, 180, 255, 0.06);
  border-left: 2px solid rgba(220, 180, 255, 0.45);
  border-radius: 0 8px 8px 0;
}
.sb-num {
  font-size: 11px;
  color: rgba(220, 200, 245, 0.7);
  letter-spacing: 1px;
  white-space: nowrap;
  align-self: flex-start;
  padding-top: 2px;
}
.sb-body { flex: 1; min-width: 0; }
.sb-title {
  font-size: 13px; font-weight: 500;
  color: rgba(255, 240, 245, 0.95);
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.sb-scenes {
  font-size: 11px;
  color: rgba(220, 200, 245, 0.7);
  line-height: 1.5;
  word-break: break-all;
}
.sb-date {
  font-size: 10px;
  color: rgba(220, 200, 245, 0.45);
  margin-top: 4px;
}
.sb-empty { font-size: 11px; color: rgba(220, 200, 245, 0.42); text-align: center; padding: 10px 0; font-style: italic; }
.sb-export-btn {
  font-size: 10px; letter-spacing: 2px;
  padding: 4px 10px;
  background: rgba(220, 180, 255, 0.18);
  color: rgba(255, 240, 245, 0.92);
  border: 1px solid rgba(220, 180, 255, 0.42);
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s, transform .12s;
}
.sb-export-btn:hover, .sb-export-btn:active {
  background: rgba(220, 180, 255, 0.32);
  transform: scale(1.04);
}
/* #3 关系报告分享按钮 */
.ph-rel-share-btn {
  display: block;
  margin: 10px auto 0;
  padding: 6px 16px;
  font-size: 11px;
  letter-spacing: 2px;
  background: rgba(255, 200, 195, 0.18);
  color: rgba(255, 240, 235, 0.92);
  border: 1px solid rgba(255, 200, 195, 0.42);
  border-radius: 14px;
  cursor: pointer;
  transition: background .15s, transform .12s;
}
.ph-rel-share-btn:hover, .ph-rel-share-btn:active {
  background: rgba(255, 200, 195, 0.32);
  transform: scale(1.03);
}
/* v2.12.5 A. 章节摘要 — 1-2 句剧情概要 */
.sb-summary {
  font-size: 12px;
  color: rgba(255, 230, 220, 0.78);
  line-height: 1.55;
  margin: 4px 0 6px;
  font-style: italic;
  letter-spacing: 0.5px;
  border-left: 2px solid rgba(220, 180, 255, 0.32);
  padding-left: 8px;
}
/* v2.12.5 B. 情感曲线 SVG */
.emo-curve-card {
  margin: 12px 14px 8px;
  padding: 12px 14px 10px;
  background: rgba(28, 22, 28, 0.55);
  border: 1px solid rgba(255, 200, 195, 0.18);
  border-radius: 12px;
}
.ec-h {
  font-size: 12px; letter-spacing: 4px;
  color: rgba(255, 220, 215, 0.88);
  margin-bottom: 8px;
  font-weight: 500;
  display: flex; align-items: baseline; justify-content: space-between;
}
.ec-tip { font-size: 9px; letter-spacing: 1px; color: rgba(255, 200, 195, 0.42); font-weight: normal; }
.ec-svg { width: 100%; height: auto; display: block; }
.ec-empty {
  font-size: 11px; color: rgba(255, 200, 195, 0.42);
  text-align: center; padding: 12px 0; font-style: italic;
}
/* v2.12.6 #1 下章预告 */
.sb-next-hint {
  font-size: 12px;
  color: rgba(255, 200, 215, 0.85);
  margin-top: 6px;
  padding: 6px 10px;
  background: linear-gradient(90deg, rgba(255, 180, 195, 0.12), rgba(220, 180, 255, 0.08));
  border-left: 2px solid rgba(255, 180, 195, 0.45);
  border-radius: 0 6px 6px 0;
  font-style: italic;
  letter-spacing: 0.5px;
}
/* v2.12.6 #2 情感观察 */
.ec-note {
  margin-top: 8px;
  padding: 6px 10px;
  font-size: 11px;
  line-height: 1.55;
  color: rgba(255, 220, 215, 0.78);
  background: rgba(255, 200, 195, 0.08);
  border-radius: 6px;
  font-style: italic;
}
/* v2.12.7 场景化背景滤镜 — 用户提到地点/天气时叠加 8s 氛围色调 */
.bg-img.scene-canteen   { filter: hue-rotate(8deg) saturate(1.18) brightness(0.96); }
.bg-img.scene-classroom { filter: hue-rotate(-8deg) saturate(0.92) brightness(0.94); }
.bg-img.scene-court     { filter: hue-rotate(-15deg) saturate(1.2) brightness(1.04); }
.bg-img.scene-library   { filter: hue-rotate(20deg) saturate(0.78) brightness(0.85); }
.bg-img.scene-dorm      { filter: hue-rotate(-5deg) saturate(0.92) brightness(0.78); }
.bg-img.scene-corridor  { filter: hue-rotate(2deg) saturate(0.85) brightness(0.88); }
.bg-img.scene-rain      { filter: hue-rotate(15deg) saturate(0.65) brightness(0.7) blur(0.5px); }
.bg-img.scene-sunset    { filter: hue-rotate(-20deg) saturate(1.32) brightness(1.06); }
.bg-img.scene-night     { filter: hue-rotate(15deg) saturate(0.6) brightness(0.55); }
.bg-img.scene-snow      { filter: hue-rotate(0deg) saturate(0.45) brightness(1.18) contrast(0.92); }
.bg-img.scene-sea       { filter: hue-rotate(20deg) saturate(1.22) brightness(0.95); }
.bg-img.scene-park      { filter: hue-rotate(10deg) saturate(1.12) brightness(1.04); }
.bg-img[class*="scene-"] { transition: filter 0.7s ease-out; }
/* v2.12.9 #1 mood + #2 quiz chip 行 */
.mood-chip-row {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 8px 12px;
  position: absolute; top: 80px; left: 50%; transform: translateX(-50%);
  z-index: 18;
}
.mood-chip, .quiz-chip {
  font-size: 11px; letter-spacing: 1.5px;
  padding: 5px 12px;
  background: rgba(255, 200, 195, 0.16);
  color: rgba(255, 240, 235, 0.96);
  border: 1px solid rgba(255, 200, 195, 0.38);
  border-radius: 14px;
  cursor: default;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
/* v2.13.30+ 视觉差异化 — mood 是"想法展示", quiz 是"可点话题" — 让用户一眼分清 */
/* mood-chip: 暗一点 + italic, 不显眼但能看 — 暗示"看一眼就好, 不用回应" */
.mood-chip:not([hidden]) {
  opacity: 0.72;
  font-style: italic;
}
.mood-chip:not([hidden])::before {
  content: "💭 ";
  font-style: normal;
  margin-right: 2px;
  opacity: 0.85;
}
.quiz-chip {
  cursor: pointer;
  background: rgba(220, 180, 255, 0.22);
  border-color: rgba(220, 180, 255, 0.5);
  transition: background .15s, transform .12s;
  font-weight: 500;
}
.quiz-chip:not([hidden])::after {
  content: " ›";
  opacity: 0.7;
  margin-left: 2px;
}
.quiz-chip:hover, .quiz-chip:active {
  background: rgba(220, 180, 255, 0.42);
  transform: scale(1.04);
}
/* 轻微 pulse 提示可点 (只在未 hover 时, 进入页面前 6s 内吸引注意) */
.quiz-chip:not([hidden]):not(:hover) {
  animation: quizChipPulse 2.4s ease-in-out 0s 3;
}
@keyframes quizChipPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 180, 255, 0); }
  50%      { box-shadow: 0 0 0 4px rgba(220, 180, 255, 0.18); }
}
/* #2 quiz panel(浮起卡) */
.quiz-panel {
  position: fixed;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 86%; max-width: 360px;
  z-index: 100;
  background: linear-gradient(140deg, rgba(45, 28, 38, 0.96), rgba(28, 18, 26, 0.96));
  border: 1px solid rgba(220, 180, 255, 0.42);
  border-radius: 16px;
  padding: 20px 18px 14px;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.qp-q {
  font-size: 16px; line-height: 1.5;
  color: rgba(255, 240, 245, 0.96);
  margin-bottom: 16px;
  text-align: center;
}
.qp-options { display: flex; flex-direction: column; gap: 8px; }
.qp-opt {
  padding: 10px 14px;
  font-size: 14px;
  background: rgba(220, 180, 255, 0.14);
  color: rgba(255, 240, 245, 0.94);
  border: 1px solid rgba(220, 180, 255, 0.32);
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s, transform .12s;
}
.qp-opt:hover, .qp-opt:active {
  background: rgba(220, 180, 255, 0.32);
  transform: scale(1.02);
}
.qp-close {
  display: block;
  margin: 14px auto 0;
  font-size: 11px;
  letter-spacing: 2px;
  background: transparent;
  color: rgba(255, 200, 195, 0.6);
  border: none;
  cursor: pointer;
  padding: 6px 12px;
}
/* 运行期对话失败 → 末尾 chip 形按钮,点击重发本轮 user */
.msg.system.retry-chip {
  align-self: center;
  background: transparent;
  padding: 4px 0;
}
.retry-btn {
  background: rgba(232, 100, 90, 0.15);
  color: rgba(255, 200, 195, 0.95);
  border: 1px solid rgba(232, 100, 90, 0.4);
  border-radius: 14px;
  padding: 4px 14px;
  font-size: 12px;
  cursor: pointer;
  transition: background .15s;
}
.retry-btn:hover, .retry-btn:active {
  background: rgba(232, 100, 90, 0.28);
}
/* P1-4 pre-typing 占位:TA 在想… 立即出现,首字到达时被替换 */
.msg.assistant.pre-typing {
  opacity: 0.85;
}
.msg.assistant.pre-typing .typing-label {
  font-style: italic;
  letter-spacing: 1px;
  opacity: 0.75;
}
/* ============ 情绪滤镜 (轻量氛围,5s 后自动淡回) ============
 * 后端 stream done 帧带 emotion → JS 加 emo-* class
 * 极轻 filter,不破坏立绘本体,只改氛围
 */
.bg-img.emo-angry  { filter: hue-rotate(-12deg) saturate(1.2) brightness(0.92) contrast(1.05); }
.bg-img.emo-shy    { filter: hue-rotate(8deg) saturate(1.15) brightness(1.06); }
.bg-img.emo-sad    { filter: saturate(0.7) brightness(0.9) contrast(0.96); }
.bg-img.emo-happy  { filter: saturate(1.18) brightness(1.06) contrast(1.04); }
.bg-img.emo-tender { filter: saturate(1.05) brightness(1.04) blur(0.3px); }
.bg-darken {
  position: absolute; inset: 0;
  /* v2.5.4: 4 stop 改 5 stop,顶部更深以稳 top-bar/scene-sticker,中段保留立绘脸,底部加重锁 dock */
  background:
    radial-gradient(ellipse at 50% 0%, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0) 35%),
    linear-gradient(180deg,
      rgba(0,0,0,0.22) 0%,
      rgba(0,0,0,0) 20%,
      rgba(0,0,0,0) 52%,
      rgba(0,0,0,0.46) 86%,
      rgba(0,0,0,0.62) 100%);
  z-index: 1;
  pointer-events: none;
}

/* ============ backdrop-filter 不支持 fallback (中低端 Android / 老 WebView) ============ */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .dock { background: rgba(255, 252, 244, 0.96); }
  .audio-veil { background: linear-gradient(180deg, rgba(0,0,0,0.86), rgba(0,0,0,0.78)); }
  .upload-tile { background: rgba(255,255,255,0.32); }
  .lightning { background: rgba(0,0,0,0.62); }
  .mm-toast { background: rgba(20,18,16,0.94); }
  .msg.assistant { background: rgba(20,18,16,0.78); }
  .sheet { background: #fff; }
}

/* ============ View 容器 ============ */
.view {
  position: absolute; inset: 0;
  display: none;
  z-index: 2;
}
.view.active {
  display: block;
  animation: view-fade-in 0.22s ease-out;
}
@keyframes view-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .view.active { animation: none; }
}

/* ============ View · 沉浸聊天 ============ */
#view-immersive {
  display: none;
  flex-direction: column;
}
#view-immersive.active { display: flex; }

.top-bar {
  position: absolute;
  top: calc(var(--safe-top) + 8px);
  left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 14px;
  z-index: 5;
}
.top-bar button {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.94);
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.45));
}
.top-bar button svg {
  width: 24px; height: 24px;
  stroke: currentColor; fill: none; stroke-width: 1.6;
}
.top-bar .right { display: flex; gap: 6px; }

/* iframe 嵌入态 (?embed=1):隐藏 top-bar 给宿主页留控制权 */
body.embed .top-bar { display: none; }
body.embed .tabbar  { display: none; }
body.embed .home-bar { display: none; }
body.embed .stage    { /* 让宿主决定整体留白 */ }

/* 单角色态(用户只有 1 个角色) — 隐藏 tabbar,沉浸优先;凝新入口在档案抽屉底 */
body.single-char .tabbar { display: none; }
body.single-char {
  /* dock-bottom 不再算 tabbar 高度,直接贴底 + safe-bottom */
  --tabbar-h: 0px;
  --dock-bottom: max(14px, var(--safe-bottom));
}
body.single-char .home-bar { bottom: max(2px, calc(var(--safe-bottom) - 2px)); }

/* ============ 消息流 ============ */
.msg-stream {
  position: absolute;
  left: 0; right: 0;
  top: calc(var(--safe-top) + 80px);
  /* v2.6.3: dock 56 + info-bar 26 + 14px 缓冲 = 96 → 气泡末尾不再压 @京芷卉 行 */
  bottom: calc(var(--dock-bottom) + var(--kb-h) + 96px);
  overflow-y: auto;
  z-index: 3;
  transition: bottom 0.25s ease;
  display: flex; flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  padding-bottom: 4px;
  padding-left: max(28px, env(safe-area-inset-left, 0px));
  padding-right: max(28px, env(safe-area-inset-right, 0px));
  scrollbar-width: none;
  /* v2.5.4: 顶部 fade mask 让滚动有"溢出感",视觉更优 */
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, black 5%, black 100%);
  mask-image: linear-gradient(180deg, transparent 0%, black 5%, black 100%);
}
.msg-stream > :first-child {
  margin-top: auto;
}
.msg-stream::-webkit-scrollbar { display: none; }

/* v2.7.2: iPad / 平板横屏键盘弹起时,kb-h 占比过大会把 transcript 压成 1 条
   收紧 bottom 加成 + min-height 兜底 */
@media (orientation: landscape) and (min-width: 768px) {
  .msg-stream {
    bottom: calc(var(--dock-bottom) + var(--kb-h) + 64px);
    min-height: 240px;
  }
}

.msg {
  max-width: 84%;
  word-wrap: break-word;
  animation: steam-in 0.4s ease-out;
}
/* v2.9 主动 Push 气泡 — 虚化 + 朱红丝带 + "时间标签",跟普通气泡区分 */
.msg.assistant.proactive-push {
  background: rgba(168, 66, 60, 0.10);
  border-left: 2px solid rgba(255, 200, 180, 0.55);
  font-style: italic;
  opacity: 0.88;
}
.msg.assistant.proactive-push .pp-meta {
  font-family: "Songti SC", serif;
  font-size: 11px;
  color: rgba(255, 200, 180, 0.7);
  letter-spacing: 1.5px;
  margin-bottom: 6px;
  display: block;
  font-style: normal;
}

.msg.assistant {
  align-self: flex-start;
  /* v2.5.4 视觉抠 — 更虚化 + 更松弛 */
  background: rgba(20, 18, 16, 0.52);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  backdrop-filter: blur(16px) saturate(1.15);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 14px 18px;
  color: rgba(255, 255, 255, 0.96);
  font-size: 16.5px;
  line-height: 1.85;
  letter-spacing: 0.4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.22);
  position: relative;
  max-width: 86%;
  /* 防长 URL / 单字撑爆 */
  word-break: break-word;
  overflow-wrap: anywhere;
}
/* 多气泡 gap 4→3,碎片感降低 */
.msg.assistant + .msg.assistant[data-reply-id] { margin-top: 3px; }
.msg.assistant[data-reply-id]:not(.last-of-reply) { border-bottom-left-radius: 4px; }
.msg.assistant[data-reply-id]:not(.first-of-reply) { border-top-left-radius: 4px; }
/* 新气泡入场:轻微上滑 + 淡入,模拟"TA 又敲了一句" */
.msg.assistant.bubble-fresh,
.msg.assistant._greeting-bubble {
  animation: bubble-drop 0.42s cubic-bezier(0.22, 0.9, 0.34, 1.0);
}
@keyframes bubble-drop {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
/* 中文派两层视觉:
 * 1) (动作/场景) → .rp 用 desc-color (用户可调:粉/玫/米/灰),浅显配菜
 * 2) [内心想法] → .rp-mind 朱红半透 + 💭 前缀 + 斜体,情感锚点(品牌差异化)
 */
:root {
  --desc-color: rgba(255, 200, 195, 0.72);   /* E 浅粉默认 */
}
.msg.assistant .rp {
  color: var(--desc-color);
  font-weight: 400;
  font-style: normal;
  font-size: 0.92em;
  line-height: 1.55;
  letter-spacing: 0.4px;
  opacity: 0.92;
}
.msg.assistant .rp-action {
  /* 保留兼容:旧消息含 *xxx* 渲染走这里,跟 .rp 同视觉 */
  color: var(--desc-color);
  font-weight: 400;
  font-style: normal;
  font-size: 0.93em;
}
/* 内心 OS · 默认块级 (M2 风) — 楷书朱红 + 左竖线 + 渐变底 + ""紧贴引号
 * 字号跟动作 (.rp 0.93em) 对齐,辐条 padding 缩,块更紧凑
 */
.msg.assistant .rp-mind {
  display: block;
  margin: 6px 2px 4px 2px;
  padding: 5px 14px 5px 16px;
  letter-spacing: 0.6px;
  line-height: 1.7;
}
.msg.assistant .rp-mind:first-child { margin-top: 0; }
.msg.assistant .rp-mind:last-child { margin-bottom: 0; }
/* 去掉早期 ::before/::after 引号包裹 — 已有朱红左线 + 楷书 + 朱红色,引号多余 */
/* 用户切到行内样式时:body.mind-inline 全覆盖 — N1 〈心声〉 */
body.mind-inline .msg.assistant .rp-mind {
  display: inline;
  margin: 0 4px;
  padding: 0;
  border: none;
  background: transparent;
}
body.mind-inline .msg.assistant .rp-mind::before {
  content: '〈心声〉';
  display: inline;
  font-family: "Songti SC", serif;
  font-size: 0.74em;
  letter-spacing: 1px;
  color: rgba(168, 66, 60, 0.95);
  margin-right: 6px;
  vertical-align: 1px;
  font-style: normal;
}
body.mind-inline .msg.assistant .rp-mind::after {
  content: '';
  display: none;
}
/* 删水印 — 用户:蒸字太土。msg 卡保持纯净 */
/* (旁白色已在新 .msg.assistant .rp 规则里定义,这条作废保留以防被覆盖) */
/* 出处小书签 — 浮在气泡外右下角(微信"已读"角标位置),不挤压气泡正文 */
.msg.assistant { position: relative; }
.msg.assistant .src-tag {
  position: absolute;
  right: -4px; bottom: -8px;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0;   /* 隐文字,只显图标 */
  color: rgba(255, 255, 255, 0.92);
  background: var(--accent);
  border: 2px solid rgba(20, 18, 16, 0.85);
  border-radius: 50%;
  padding: 0;
  margin: 0;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(168, 66, 60, 0.45);
  z-index: 2;
}
.msg.assistant .src-tag svg {
  width: 12px; height: 12px;
  fill: currentColor; stroke: none;
}
.msg.assistant .src-tag:active {
  transform: scale(0.92);
  box-shadow: 0 2px 6px rgba(168, 66, 60, 0.65);
}
.msg.assistant.streaming::after {
  content: '';
  display: inline-block;
  width: 4px; height: 14px;
  background: var(--accent);
  margin-left: 3px;
  vertical-align: -2px;
  animation: blink 1s steps(2) infinite;
}
/* 首 token 到达前的"打字中"波浪 */
.msg.assistant.thinking::before {
  /* 暂时隐藏背景"蒸"水印,腾位置给思考点 */
  opacity: 0.6;
}
/* "正在打字" 文字标签 — 首 token 到达前;微小斜体灰,比三点动画更"克制 + 像人" */
.typing-label {
  font-size: 0.72em;
  font-style: italic;
  color: var(--ink-mute);
  opacity: 0.62;
  margin-right: 6px;
  letter-spacing: 0.3px;
  vertical-align: 1px;
}
/* "正在打字" 占位气泡 — 收紧 padding/透明度,避免长得像一个巨黑胶囊;真气泡有内容了 thinking class 会被去掉,自动恢复正常 */
.msg.assistant.thinking {
  padding: 8px 16px;
  min-height: 0;
  background: rgba(20, 18, 16, 0.4);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: none;
  line-height: 1.2;
  font-size: 13.5px;
  border-radius: 14px;
}
.msg.assistant.thinking .thinking-dots,
.msg.assistant.thinking::after {
  display: inline-block;
  width: 28px; height: 12px;
  margin-left: 2px;
  vertical-align: -1px;
  background-image:
    radial-gradient(circle 3px at 4px 6px, var(--ink-mute) 100%, transparent 100%),
    radial-gradient(circle 3px at 14px 6px, var(--ink-mute) 100%, transparent 100%),
    radial-gradient(circle 3px at 24px 6px, var(--ink-mute) 100%, transparent 100%);
  background-repeat: no-repeat;
  animation: thinking-dots 1.2s ease-in-out infinite;
  content: '';
}
.msg.assistant.thinking.streaming::after {
  /* thinking 状态时,blink 光标让位给思考点 */
  background: transparent;
  animation: thinking-dots 1.2s ease-in-out infinite;
  width: 28px; height: 12px;
  background-image:
    radial-gradient(circle 3px at 4px 6px, var(--ink-mute) 100%, transparent 100%),
    radial-gradient(circle 3px at 14px 6px, var(--ink-mute) 100%, transparent 100%),
    radial-gradient(circle 3px at 24px 6px, var(--ink-mute) 100%, transparent 100%);
  background-repeat: no-repeat;
}
@keyframes thinking-dots {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}
.msg.assistant { cursor: pointer; transition: box-shadow 0.25s ease; }
.msg.assistant.tts-loading {
  box-shadow: 0 0 0 1.5px rgba(168, 66, 60, 0.40), 0 6px 18px rgba(168, 66, 60, 0.10);
}
.msg.assistant.tts-loading::after {
  content: '';
  display: inline-block;
  width: 12px; height: 12px;
  margin-left: 6px;
  vertical-align: -2px;
  border: 1.5px solid rgba(168, 66, 60, 0.30);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: tts-spin 0.7s linear infinite;
}
@keyframes tts-spin { to { transform: rotate(360deg); } }
.msg.assistant.speaking {
  box-shadow: 0 0 0 1.5px var(--accent), 0 6px 20px rgba(168, 66, 60, 0.18);
}
/* 错误兜底泡 — 角色化文案 + retry */
.msg.assistant.soft-error {
  background: rgba(255, 255, 255, 0.78);
  border: 1px dashed rgba(168, 66, 60, 0.30);
  color: var(--ink-mute);
  font-style: italic;
}
.msg.assistant .retry-btn {
  display: inline-block;
  margin-left: 6px;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 99px;
  cursor: pointer;
  font-family: inherit;
  font-style: normal;
  letter-spacing: 0.5px;
}
.msg.assistant .retry-btn:active { opacity: 0.8; }
.msg.assistant .soft-error-line { font-style: italic; }
/* idle nudge — TA 在自言自语,跟主气泡同暗黑玻璃但更弱(半透耳语感) */
.msg.assistant.nudge {
  background: rgba(20, 18, 16, 0.32);
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
  backdrop-filter: blur(14px) saturate(1.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-style: italic;
  color: rgba(255, 255, 255, 0.55);
  align-self: flex-start;
  max-width: 60%;
  font-size: 13.5px;
  padding: 8px 14px;
  animation: steam-in 0.5s ease-out;
}
.msg.assistant.speaking::after {
  content: '';
  display: inline-block;
  width: 14px; height: 12px;
  margin-left: 6px;
  vertical-align: -1px;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-size: 2px 4px;
  background-position: 0 50%;
  box-shadow:
    4px 0 0 -1px var(--accent),
    8px 0 0 -1px var(--accent),
    12px 0 0 -1px var(--accent);
  animation: speaking-bars 0.9s ease-in-out infinite;
}
@keyframes speaking-bars {
  0%, 100% { background-size: 2px 4px; box-shadow: 4px 0 0 -1px var(--accent), 8px 0 0 -1px var(--accent), 12px 0 0 -1px var(--accent); }
  25% { background-size: 2px 10px; box-shadow: 4px 0 0 -3px var(--accent), 8px 0 0 -1px var(--accent), 12px 0 0 -2px var(--accent); }
  50% { background-size: 2px 6px; box-shadow: 4px 0 0 -2px var(--accent), 8px 0 0 -3px var(--accent), 12px 0 0 0 var(--accent); }
  75% { background-size: 2px 8px; box-shadow: 4px 0 0 0 var(--accent), 8px 0 0 -2px var(--accent), 12px 0 0 -1px var(--accent); }
}

.msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #b54a44, var(--accent));
  color: #fff;
  padding: 12px 18px;
  border-radius: 18px;
  font-size: 16.5px;
  line-height: 1.55;
  letter-spacing: 0.4px;
  max-width: 78%;
  box-shadow: 0 3px 10px rgba(168, 66, 60, 0.32), 0 1px 0 rgba(255,255,255,0.08) inset;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* ============ 灯泡续写按钮 ============ */
.lightning {
  position: absolute;
  right: 14px;
  /* v2.6 贴 dock 上方 6px,跟 info-bar 同视觉行,默认隐形磨砂 */
  bottom: calc(var(--dock-bottom) + var(--kb-h) + 60px);
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(20, 18, 16, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.10);
  display: flex; align-items: center; justify-content: center;
  z-index: 6;
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.3s, background 0.2s, border-color 0.2s, bottom 0.2s ease;
  box-shadow: 0 3px 10px rgba(0,0,0,0.32);
  cursor: pointer;
}
.lightning svg { width: 14px; height: 14px; fill: rgba(255, 255, 255, 0.85); transition: fill 0.2s; }
.lightning:active { transform: scale(0.92); }
.lightning.hidden { opacity: 0; pointer-events: none; }
/* 展开态 — 旋转 45° + 朱红实心,跟 X 关闭按钮的视觉一致 */
.lightning.expanded {
  background: rgba(168, 66, 60, 0.85);
  border-color: rgba(255, 200, 195, 0.45);
  transform: rotate(45deg);
  box-shadow: 0 4px 16px rgba(168, 66, 60, 0.45);
}
.lightning.expanded svg { fill: #fff; }

/* ============ 横向 4 图标信息行 ============ */
/* 角色信息条 — dock 上方,清晰可见,集成红点 + 名字 + creator */
.info-bar {
  position: absolute;
  /* 跟 msg-stream 一致 36px + safe-area */
  left: max(36px, env(safe-area-inset-left, 0px));
  right: max(36px, env(safe-area-inset-right, 0px));
  max-width: calc(100% - 72px);
  /* v2.6 贴 dock 上方 8px 缝,纯文字浮签(不融 dock),跟 lightning 同行 */
  bottom: calc(var(--dock-bottom) + var(--kb-h) + 60px);
  /* 注:跟 .lightning 同 bottom,但水平不冲突(info-bar 左侧名字 / lightning 右侧球) */
  z-index: 5;
  pointer-events: none;
  transition: bottom 0.2s ease;
}
.info-bar .name-block {
  pointer-events: auto;
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent;
  border: none;
  padding: 4px 0;
  cursor: pointer;
  color: #fff;
  font-family: inherit;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
  transition: opacity 0.18s, transform 0.18s;
}
.info-bar .name-block:active { transform: scale(0.97); opacity: 0.85; }

/* v2.9.2 角色切换按钮 — 紧贴 name-block 右侧 */
.info-bar .char-switch {
  pointer-events: auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  margin-left: 8px;
  background: rgba(20, 18, 16, 0.55);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 50%;
  color: rgba(255, 235, 225, 0.85);
  cursor: pointer;
  vertical-align: middle;
  transition: transform 0.18s, background 0.18s;
}
.info-bar .char-switch:hover { background: rgba(168, 66, 60, 0.40); }
.info-bar .char-switch:active { transform: scale(0.92); }
/* 名字前的 @ 符号 — 像 IM 用户名那样,有"活人/账号"感 */
.info-bar .name-block .distill-dot {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: auto; height: auto;
  border-radius: 0;
  background: none;
  box-shadow: none;
  flex-shrink: 0;
  font-family: "DM Sans", -apple-system, sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -0.5px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.55);
  margin-right: -2px;
}
.info-bar .name-block .distill-dot::before { content: '@'; }
.info-bar .name-block .distill-dot.hidden { display: none; }
/* 黄角标删除 — 跟"通知未读"语义冲突 (agent R3 视觉) */
.info-bar .name-block .nm {
  font-size: 16px; font-weight: 600;
  display: flex; align-items: center; gap: 1px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.55);
  letter-spacing: 0.3px;
  max-width: 60vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.info-bar .name-block .nm > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.info-bar .name-block .nm svg {
  flex-shrink: 0;
  width: 14px; height: 14px;
  stroke: rgba(255,255,255,0.7); fill: none; stroke-width: 2;
  margin-left: 2px;
}
.info-bar .name-block .creator {
  font-size: 11px;
  color: rgba(255,255,255,0.72);
  text-shadow: 0 1px 4px rgba(0,0,0,0.50);
  margin-left: 2px;
  letter-spacing: 0.3px;
  max-width: 30vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.info-bar .actions { display: flex; gap: 18px; align-items: flex-end; }
.info-bar .ai {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: #fff;
}
.info-bar .ai svg {
  width: 24px; height: 24px;
  stroke: currentColor; fill: none; stroke-width: 1.7;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.45));
}
.info-bar .ai svg.heart { fill: currentColor; stroke: none; }
.info-bar .ai .lb {
  font-size: 10.5px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.45);
  font-weight: 500;
}

/* ============ 语音通话 modal (A 实时语音 A 档) ============
 * 全屏暗色蒙层 + 立绘 + 中间话筒按钮 + 底部红色挂断
 * tap mic → 录音(波纹动画) → 再 tap → ASR + send + 自动 TTS 播
 */
.voice-modal {
  position: fixed; inset: 0;
  z-index: 120;          /* > audio-veil(110) */
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: #0a0907;
  animation: voice-in 0.3s cubic-bezier(0.22, 0.9, 0.34, 1.0);
}
.voice-modal.hidden { display: none; }
@keyframes voice-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.voice-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center 20%;
  filter: blur(2px) brightness(0.6);
  z-index: 0;
}
.voice-overlay {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 0%, rgba(10,9,7,0.8) 100%);
  z-index: 1;
}
.voice-close {
  position: absolute; top: calc(var(--safe-top) + 14px); left: 16px;
  width: 36px; height: 36px;
  background: transparent; border: none; cursor: pointer;
  color: rgba(255,255,255,0.85);
  z-index: 3;
  display: flex; align-items: center; justify-content: center;
}
.voice-close svg { width: 22px; height: 22px; }
.voice-name {
  position: absolute; top: calc(var(--safe-top) + 18px); left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 17px; font-weight: 600; letter-spacing: 0.5px;
  z-index: 3;
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
/* v2.5.1 语音对话流 — 顶部立绘留给档案,下半屏给字幕 */
.voice-stream {
  position: relative; z-index: 2;
  flex: 1;
  width: 100%;
  margin-top: calc(var(--safe-top) + 50px);
  padding: 0 16px;
  overflow-y: auto;
  display: flex; flex-direction: column;
  gap: 8px;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, black 6%, black 94%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, black 6%, black 94%, transparent 100%);
}
.voice-stream::-webkit-scrollbar { display: none; }
.voice-stream .vm-bub {
  max-width: 86%;
  padding: 10px 16px;
  border-radius: 16px;
  font-size: 15.5px;
  line-height: 1.7;
  letter-spacing: 0.3px;
  word-break: break-word;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
  animation: vm-bub-in 0.25s cubic-bezier(0.22, 0.9, 0.34, 1.0);
}
.voice-stream .vm-bub.vm-user {
  align-self: flex-end;
  background: rgba(168, 66, 60, 0.8);
  color: #fff;
}
.voice-stream .vm-bub.vm-ai {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.20);
  color: rgba(255, 250, 245, 0.96);
  font-family: "Songti SC", serif;
}
@keyframes vm-bub-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.voice-status {
  position: relative; z-index: 2;
  margin-top: 8px;
  color: rgba(255,255,255,0.78);
  font-size: 13px; letter-spacing: 0.5px;
  text-align: center; padding: 0 32px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
  min-height: 18px;
}
.voice-mic {
  position: relative; z-index: 2;
  margin-top: auto; margin-bottom: 32px;
  width: 88px; height: 88px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #1a1714;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
  transition: transform 0.15s, background 0.18s;
}
.voice-mic:active { transform: scale(0.94); }
.voice-mic.recording {
  background: var(--accent);
  color: #fff;
  animation: voice-pulse 0.9s ease-in-out infinite;
}
@keyframes voice-pulse {
  0%, 100% { box-shadow: 0 4px 24px rgba(168,66,60,0.5), 0 0 0 0 rgba(168,66,60,0.6); }
  50%      { box-shadow: 0 4px 24px rgba(168,66,60,0.5), 0 0 0 18px rgba(168,66,60,0); }
}
.voice-mic.thinking {
  background: rgba(255, 255, 255, 0.5);
  pointer-events: none;
}
.voice-mic svg { width: 36px; height: 36px; }
.voice-hangup {
  position: relative; z-index: 2;
  margin-bottom: calc(var(--safe-bottom) + 24px);
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #e0524d;
  color: #fff;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(224,82,77,0.4);
  transition: transform 0.15s;
}
.voice-hangup:active { transform: scale(0.94); }
.voice-hangup svg { width: 26px; height: 26px; }

/* v2.1.1 好感度顶部条 */
.affinity-bar {
  position: absolute;
  top: calc(var(--safe-top) + 14px);
  right: 14px;
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(20, 18, 16, 0.5);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 200, 195, 0.18);
  border-radius: 99px;
  padding: 5px 13px;
  z-index: 5;
  font-size: 11px;
  color: rgba(255, 235, 230, 0.85);
  letter-spacing: 0.8px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.affinity-bar.hidden { display: none; }
.aff-h { opacity: 0.7; }
.aff-track {
  display: inline-block;
  width: 64px; height: 5px;
  background: rgba(255,255,255,0.12);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}
.aff-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, rgba(168,66,60,0.85), rgba(255,200,195,0.95));
  width: 50%;
  transition: width 0.5s cubic-bezier(0.22, 0.9, 0.34, 1.0), background 0.3s;
}
.aff-fill.neg {
  background: linear-gradient(90deg, rgba(80,80,90,0.85), rgba(140,140,160,0.95));
}
.aff-num { font-weight: 600; min-width: 24px; text-align: right; }

/* v2.1.2 结局达成卡 */
.ending-mask {
  position: fixed; inset: 0;
  z-index: 130;
  background: rgba(10, 9, 7, 0.78);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  display: flex; align-items: center; justify-content: center;
  animation: voice-in 0.35s ease-out;
}
.ending-mask.hidden { display: none; }
.ending-card {
  background: linear-gradient(180deg, rgba(40, 25, 25, 0.95), rgba(20, 15, 15, 0.95));
  border: 1px solid rgba(168, 66, 60, 0.45);
  border-radius: 18px;
  padding: 32px 28px 24px;
  text-align: center;
  max-width: 320px;
  width: 86%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.ending-seal {
  width: 60px; height: 60px;
  margin: 0 auto 18px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: "Songti SC", serif;
  font-size: 28px; font-weight: 700;
  letter-spacing: 1px;
  box-shadow: 0 4px 16px rgba(168,66,60,0.5);
}
.ending-h {
  font-family: "Songti SC", serif;
  font-size: 18px;
  color: rgba(255,235,230,0.95);
  letter-spacing: 4px;
  margin-bottom: 8px;
}
.ending-sub {
  font-size: 12.5px;
  color: rgba(255,255,255,0.6);
  line-height: 1.6;
  margin-bottom: 22px;
}
.ending-actions { display: flex; gap: 10px; }
.ending-act {
  flex: 1;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.92);
  padding: 10px;
  border-radius: 99px;
  font-size: 13px; cursor: pointer;
  letter-spacing: 1px;
}
.ending-act.ending-act-primary {
  background: var(--accent);
  border-color: var(--accent);
}
.ending-act:active { transform: scale(0.97); }

/* ============ v1.7.2 场景卡顶部贴纸 (storied 角色专属) ============
 * 顶部小胶囊,显示 时间 · 地点 · 天气 三个图标
 * scene_change(beat 触发)时切动画刷新内容
 */
.scene-sticker {
  position: absolute;
  top: calc(var(--safe-top) + 52px);
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(20, 18, 16, 0.5);
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
  backdrop-filter: blur(14px) saturate(1.05);
  border: 1px solid rgba(255, 200, 195, 0.18);
  border-radius: 99px;
  padding: 5px 12px;
  z-index: 5;
  font-family: "Songti SC", serif;
  font-size: 11px;
  color: rgba(255, 235, 230, 0.78);
  letter-spacing: 1.2px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.22, 0.9, 0.34, 1.0);
}
.scene-sticker.hidden { display: none; }
.scene-sticker.flash {
  animation: scene-flash 0.6s cubic-bezier(0.22, 0.9, 0.34, 1.0);
}
@keyframes scene-flash {
  0%   { transform: translateX(-50%) translateY(-4px); opacity: 0.4; }
  100% { transform: translateX(-50%) translateY(0); opacity: 1; }
}
.ssk-i { display: inline-flex; align-items: center; }
.ssk-i:not(:empty) ~ .ssk-i:not(:empty)::before {
  content: '·';
  margin-right: 8px;
  opacity: 0.5;
}

/* ============ v2.6 统一 stack(建议 + 动作合一)============
 * 闪电球点开 → 上方竖排堆叠:
 *   上半 .sg-replies(白底 chip,主路径)— 智能补话候选
 *   下半 .sg-actions(暗色 chip,辅助)— 重说 / 换语气 / 续写
 * 球贴 dock 上方,默认隐形;stack 默认 hidden,不挤占气泡区
 */
.sg-stack {
  position: absolute;
  right: 14px;
  bottom: calc(var(--dock-bottom) + var(--kb-h) + 102px);  /* 球顶 + 10px 缝 */
  display: flex; flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  max-width: calc(100% - 28px);
  transition: opacity 0.22s ease, bottom 0.2s ease;
}
.sg-stack:not(.hidden) { pointer-events: auto; opacity: 1; }
.sg-stack.hidden { display: none; }
.sg-stack .sg-replies, .sg-stack .sg-actions {
  display: flex; flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  width: 100%;
}
.sg-stack .sg-replies:empty { display: none; }
.sg-stack .sg-replies:empty + .sg-divider { display: none; }
.sg-stack .sg-divider {
  width: 70%;
  height: 1px;
  background: linear-gradient(to left, rgba(255,255,255,0.20), rgba(255,255,255,0));
  margin: 5px 0 3px;
  align-self: flex-end;
}
/* 上半 — 建议回复 chip(白底,主路径) */
.sg-stack .sg {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 9px 14px;
  border-radius: 16px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
  color: #1a1714;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.16s ease, color 0.16s ease;
  -webkit-tap-highlight-color: transparent;
  animation: sg-chip-in 0.28s cubic-bezier(0.22, 0.9, 0.34, 1.0) both;
}
.sg-stack .sg:active {
  transform: scale(0.96);
  background: linear-gradient(135deg, #b54a44, #a8423c);
  color: #fff;
  border-color: rgba(255, 200, 195, 0.4);
}
/* 下半 — 动作 chip(暗色磨砂,辅助) */
.sg-stack .sg-act {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 16px;
  white-space: nowrap;
  background: rgba(20, 18, 16, 0.55);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0.3px;
  font-family: inherit;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  transition: transform 0.12s ease, background 0.16s ease, border-color 0.16s ease;
  -webkit-tap-highlight-color: transparent;
  animation: sg-chip-in 0.28s cubic-bezier(0.22, 0.9, 0.34, 1.0) both;
}
.sg-stack .sg-act svg {
  width: 12px; height: 12px;
  fill: currentColor;
  opacity: 0.85;
}
.sg-stack .sg-act:active {
  transform: scale(0.96);
  background: rgba(168, 66, 60, 0.85);
  border-color: rgba(255, 200, 195, 0.45);
  color: #fff;
}
@keyframes sg-chip-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============ Dock — 现代克制风 ============
 * 设计:深色玻璃,贴底,几乎"页面延伸"而非悬浮按钮组
 *   - 不再用米黄椭圆胶囊(对深色背景反差太大)
 *   - 输入框无独立边框,跟 dock 同底色
 *   - 发送键默认弱化(灰色 stroke icon),有内容时朱红填充上色 (Threads / 毛象同款)
 *   - caret 跟 placeholder 同色,不再出现"白色竖线"
 */
.dock {
  position: absolute;
  left: 10px; right: 10px;
  bottom: calc(var(--dock-bottom) + var(--kb-h));
  display: flex; align-items: flex-end;
  background: rgba(20, 18, 16, 0.6);
  backdrop-filter: blur(24px) saturate(1.15);
  -webkit-backdrop-filter: blur(24px) saturate(1.15);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 24px;
  padding: 9px 10px 9px 18px;
  gap: 8px;
  z-index: 4;
  box-shadow: 0 8px 24px rgba(0,0,0,0.28), 0 1px 0 rgba(255,255,255,0.04) inset;
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.25s ease, bottom 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}
.dock.collapsed {
  transform: translateY(105%);
  opacity: 0;
  pointer-events: none;
}
.dock .ico-l { color: rgba(255, 255, 255, 0.55); display: flex; align-items: center; }
.dock .ico-l svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.dock .pill {
  flex: 1;
  color: rgba(255, 255, 255, 0.96);
  caret-color: var(--accent);
  font-size: 16px;
  padding: 9px 0;
  outline: none;
  border: none;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  font-family: inherit;
  resize: none;
  line-height: 1.5;
  letter-spacing: 0.3px;
  max-height: 96px;
  min-height: 22px;
  overflow-y: auto;
  transition: height 0.15s ease;
}
.dock .pill::placeholder { color: rgba(255, 255, 255, 0.36); font-size: 15px; letter-spacing: 0.4px; }
/* v2.5.1 黄色输入框 — 核弹级 reset 防所有可能源头 */
.dock,
.dock *,
.dock .pill {
  -webkit-tap-highlight-color: transparent !important;
  outline: none !important;
}
.dock .pill:focus,
.dock .pill:focus-visible,
.dock .pill:focus-within,
.dock .pill:active {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
  background: transparent !important;
}
/* Chrome / Safari autofill 黄色高亮全部覆盖 */
.dock .pill:-webkit-autofill,
.dock .pill:-webkit-autofill:hover,
.dock .pill:-webkit-autofill:focus,
.dock .pill:-webkit-autofill:active,
input:-webkit-autofill,
textarea:-webkit-autofill {
  -webkit-text-fill-color: rgba(255, 255, 255, 0.95) !important;
  -webkit-box-shadow: 0 0 0 100px rgba(20, 18, 16, 0.62) inset !important;
  box-shadow: 0 0 0 100px rgba(20, 18, 16, 0.62) inset !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  transition: background-color 5000s ease-in-out 0s !important;
  caret-color: var(--accent) !important;
  border-color: transparent !important;
}
/* search 取消按钮 — 防 iOS 显示原生 X */
.dock .pill::-webkit-search-cancel-button,
.dock .pill::-webkit-search-decoration { -webkit-appearance: none; display: none; }
/* Firefox */
.dock .pill::-moz-focus-inner { border: 0 !important; }
/* 表单 accent-color 设朱红(防默认蓝/黄) */
.dock { accent-color: var(--accent); }
.dock .pill::placeholder { color: rgba(255, 255, 255, 0.42); }
.dock .ico-r { display: flex; gap: 6px; align-items: center; align-self: flex-end; padding-bottom: 1px; }
.dock .ico-r .item {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, 0.55);
  background: transparent; border: none; cursor: pointer;
  border-radius: 50%;
  transition: color 0.15s, background 0.15s;
}
.dock .ico-r .item:active { background: rgba(255, 255, 255, 0.08); }
.dock .ico-r .item svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; }
/* v2.6 发送键 — 统一浅色磨砂(跟 mic 同款),不再切朱红;有内容时只加微白底 + 描边变实 */
.dock .ico-r .plus-bg {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  color: rgba(255, 255, 255, 0.55);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.32, 0.72, 0, 1), background 0.2s, color 0.2s, border-color 0.2s;
}
.dock.has-text .ico-r .plus-bg {
  background: rgba(255,255,255,0.12);
  color: rgba(255, 255, 255, 0.92);
  border-color: rgba(255,255,255,0.18);
}
.dock .ico-r .plus-bg:active { transform: scale(0.92); }
.dock .ico-r .plus-bg svg { width: 18px; height: 18px; }

/* 跨阶段提示条 — 关系刚跨过新阶段(陌生→半熟等)出现 2.5s */
.stage-toast {
  position: absolute;
  left: 50%; top: calc(var(--safe-top) + 60px);
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(20, 18, 16, 0.85);
  -webkit-backdrop-filter: blur(20px) saturate(1.1);
  backdrop-filter: blur(20px) saturate(1.1);
  border: 1px solid rgba(255, 200, 180, 0.30);
  border-radius: 99px;
  padding: 9px 18px;
  z-index: 60;
  font-family: "Songti SC", "STSong", serif;
  font-size: 13px;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 24px rgba(168, 66, 60, 0.45), 0 0 0 1px rgba(255, 200, 180, 0.15);
  animation: stage-toast-in 0.5s cubic-bezier(0.32, 0.72, 0, 1);
  pointer-events: none;
}
.stage-toast.hidden { display: none; }
/* v2.5 阶段独占奖励 — 心声 line 单独样式 */
.stage-toast .stage-voice {
  display: block;
  margin-top: 6px;
  font-family: "Songti SC", serif;
  font-size: 12.5px;
  font-style: italic;
  color: rgba(255, 200, 195, 0.9);
  letter-spacing: 1.5px;
  line-height: 1.7;
}
.stage-toast .ic {
  color: #ffd6cc;
  font-size: 16px;
  font-weight: 300;
}
.stage-toast .txt strong { color: #ffd6cc; font-weight: 600; }
@keyframes stage-toast-in {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.dock-collapsed-hint {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + 18px);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 3px;
  z-index: 5;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity 0.3s;
  /* 点这个提示就直接展开 dock 并 focus 输入框 */
  pointer-events: none;
  padding: 8px 16px;
  cursor: pointer;
}
.dock-collapsed-hint.show { pointer-events: auto; opacity: 1; }

/* ============ 5-tab 底部导航 ============ */
.tabbar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: var(--tabbar-h);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
  align-items: center;
  z-index: 6;
  padding-bottom: max(8px, var(--safe-bottom));
  padding-top: 0;
  background: #000;
  transition: background 0.35s ease;
}
.tabbar.tabbar-3 { grid-template-columns: 1fr 1fr 1fr; }
.tabbar button.tab {
  background: transparent; border: none; padding: 0;
  font-family: inherit;
}
/* 白底页(角色信息/创作/列表/我) */
.tabbar.theme-light {
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid #f0eee8;
}
.tabbar.theme-light .tab { color: #6a6560; }
.tabbar.theme-light .tab.active { color: var(--accent); }
.tabbar.theme-light .tab.center-ai { color: var(--accent); border-color: var(--accent); }

.tab {
  display: flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  position: relative;
}
.tab svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.tab.active { color: #fff; }
.tab.active::after {
  content: ''; position: absolute; bottom: 6px;
  left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px;
  background: var(--accent);
  border-radius: 50%;
}
.tab.center-ai {
  width: 48px; height: 36px;
  border: 1.5px solid currentColor;
  border-radius: 10px;
  justify-self: center;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  background: transparent;
  padding: 0;
  color: #fff;
}
.tab.center-ai svg {
  width: 18px; height: 18px;
  stroke: currentColor;
  fill: none;
}
.tab.center-ai.themed { color: var(--accent); }

.home-bar {
  position: absolute;
  bottom: max(6px, calc(var(--safe-bottom) - 2px));
  left: 50%; transform: translateX(-50%);
  width: 120px; height: 4px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 2px;
  z-index: 7;
  pointer-events: none;
}
.tabbar.theme-light ~ .home-bar { background: rgba(0,0,0,0.55); }

/* ============ View · 角色信息页 ============ */
#view-persona-info {
  background: #fff;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.persona-hero {
  position: relative;
  height: 60vh;
  min-height: 420px;
  background-size: cover;
  background-position: center 25%;
  background-repeat: no-repeat;
}
.persona-hero .hero-grad {
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(0,0,0,0.32) 0%,
    rgba(0,0,0,0) 30%,
    rgba(0,0,0,0) 55%,
    rgba(0,0,0,0.78) 100%);
}
.persona-hero .top-actions {
  position: absolute;
  top: calc(var(--safe-top) + 8px);
  left: 12px; right: 12px;
  display: flex; justify-content: space-between;
  z-index: 3;
}
.persona-hero .top-actions button {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.32);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.persona-hero .top-actions svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.persona-hero .info {
  position: absolute;
  left: 16px; right: 16px;
  bottom: 20px;
  color: #fff;
  z-index: 3;
}
.persona-hero .ribbon {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  padding: 4px 11px 4px 4px;
  border-radius: 99px;
  font-weight: 600;
  margin-bottom: 10px;
}
.persona-hero .ribbon .ic {
  width: 14px; height: 14px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, rgba(255,255,255,0.5), transparent 55%),
    #fff;
  box-shadow: 0 0 0 1.5px rgba(168, 66, 60, 0.30);
}
.persona-hero .nm {
  font-size: 32px; font-weight: 700;
  letter-spacing: -0.3px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.4);
}
.persona-hero .story {
  font-size: 13px; line-height: 1.75;
  opacity: 0.92;
  margin-top: 8px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  font-family: "Songti SC", "STSong", serif;
  letter-spacing: 0.5px;
}
.persona-body {
  background: #fff;
  border-radius: 24px 24px 0 0;
  margin-top: -22px;
  position: relative;
  z-index: 2;
  /* 底部留白 = tabbar(64+safe) + cta-bar(~62) + 缓冲(24),否则最后一段被 cta-bar 遮 */
  padding: 6px 0 calc(var(--tabbar-h) + 88px);
}
.story-block {
  padding: 16px 22px;
  border-bottom: 1px solid #f5f3ec;
}
.story-block .h {
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 8px;
}
.story-block .text {
  font-size: 14px; line-height: 1.85;
  color: var(--ink-3);
  font-family: "Songti SC", "STSong", serif;
}
.story-block .text strong { color: var(--accent); font-weight: 500; }
.cta-bar {
  position: absolute;
  bottom: var(--tabbar-h);
  left: 0; right: 0;
  padding: 12px 16px;
  background: rgba(255,255,255,0.97);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-top: 1px solid #f0f0f0;
  display: flex; gap: 8px; align-items: center;
  z-index: 5;
}
.cta-bar .icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--paper-warm);
  display: flex; align-items: center; justify-content: center;
  color: #444;
  flex-shrink: 0;
}
.cta-bar .icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.cta-bar .primary {
  flex: 1;
  background: var(--accent);
  color: #fff;
  padding: 13px;
  border-radius: 99px;
  font-size: 14.5px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 1px;
}

/* ============ View · +蒸 创作面板 ============ */
#view-create {
  background: #fff;
  display: none;
  flex-direction: column;
}
#view-create.active { display: flex; }
.create-head {
  padding: calc(var(--safe-top) + 14px) 16px 8px;
  display: flex; align-items: center; justify-content: space-between;
}
.create-head .title {
  font-size: 17px; font-weight: 700; color: var(--ink);
  font-family: "Songti SC", serif;
}
.create-head .close {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-mute);
}
.create-head .close svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; }

.create-snap {
  flex: 1;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding: 12px 16px calc(var(--tabbar-h) + 24px);
  gap: 12px;
  scrollbar-width: none;
}
.create-snap::-webkit-scrollbar { display: none; }
.create-card {
  flex: 0 0 100%;
  scroll-snap-align: center;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  background: #f5f3ec;
  display: flex; flex-direction: column;
  min-height: 0;
}
.create-card .card-head {
  padding: 18px 20px 8px;
  font-size: 18px; font-weight: 700;
  font-family: "Songti SC", serif;
  color: var(--ink);
}
.create-card .card-head .sub {
  font-size: 12px; color: var(--ink-mute);
  font-weight: 400; margin-top: 4px;
  font-family: -apple-system, sans-serif;
}
.create-card .card-body { flex: 1; padding: 8px 20px 20px; overflow-y: auto; }

/* 左卡:角色库网格 */
.persona-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.persona-grid .item {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: transform 0.2s;
}
.persona-grid .item:active { transform: scale(0.97); }
.persona-grid .item .av {
  width: 100%;
  aspect-ratio: 1 / 1.1;
  background-size: cover;
  background-position: center 25%;
  background-color: #e8e4d8;
}
.persona-grid .item .meta { padding: 8px 10px 10px; }
.persona-grid .item .nm { font-size: 13.5px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.persona-grid .item .item-kind {
  display: inline-block;
  font-size: 9.5px; padding: 1px 6px; border-radius: 99px;
  background: rgba(122, 117, 112, 0.18);
  color: var(--ink-mute);
  letter-spacing: 0.5px;
  font-weight: 500;
}
.persona-grid .item .item-kind.storied {
  background: rgba(168, 66, 60, 0.15);
  color: var(--accent);
}
.persona-grid .item .bio {
  font-size: 11px; color: var(--ink-mute);
  margin-top: 4px;
  line-height: 1.45;
  /* R4 fix: 让 bio 显示 2 行,不要单行截断 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 右卡:蒸馏定制 */
.distill-card {
  background: linear-gradient(165deg, #6b4d6e 0%, #8a5e6c 60%, #b87466 100%);
  color: #fff;
}
.distill-card .card-head, .distill-card .card-head .sub { color: #fff; }
.distill-card .card-head .sub { color: rgba(255,255,255,0.78); }
.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}
.upload-tile {
  background: rgba(255,255,255,0.16);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 14px;
  padding: 16px 14px;
  display: flex; flex-direction: column; gap: 6px;
  color: #fff;
  font-size: 13px; font-weight: 600;
  text-align: left;
  min-height: 88px;
}
.upload-tile svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.upload-tile .sub {
  font-size: 10.5px; font-weight: 400;
  opacity: 0.8;
}
.privacy-tip {
  margin-top: 14px;
  font-size: 11px;
  color: rgba(255,255,255,0.78);
  background: rgba(0,0,0,0.18);
  padding: 8px 12px;
  border-radius: 10px;
  line-height: 1.55;
}

/* ============ View · 列表 / 我 ============ */
#view-messages, #view-me {
  background: #fff;
  padding: calc(var(--safe-top) + 24px) 0 calc(var(--tabbar-h) + 32px);
  overflow-y: auto;
}
.messages-page { padding: 0 22px; }
.messages-h {
  font-size: 22px; font-weight: 600;
  font-family: "Songti SC", "STSong", serif;
  color: var(--ink);
  margin-bottom: 14px;
  letter-spacing: 0.5px;
}
.messages-new {
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 24px;
  padding: 14px;
  background: var(--accent-pale);
  color: var(--accent);
  border: 1.5px dashed rgba(168, 66, 60, 0.40);
  border-radius: 12px;
  font-size: 13px;
  letter-spacing: 2px;
  font-family: inherit;
  cursor: pointer;
}
.messages-new svg { width: 14px; height: 14px; stroke: currentColor; }

/* M07 me 页 4 段 */
.me-page { padding: 0 22px; }
/* v2.2.1 创作者 dashboard */
.me-creator-list { display: flex; flex-direction: column; gap: 8px; }
.me-creator-empty { font-size: 12px; color: #999; text-align: center; padding: 16px 0; }
.me-creator-row {
  display: flex; align-items: center; gap: 10px;
  background: #fff;
  border: 1px solid #ece6d8;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.16s, transform 0.14s;
}
.me-creator-row:active { transform: scale(0.98); background: #fcf8f1; }
.me-creator-av {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #f5f0e8 center/cover no-repeat;
  flex-shrink: 0;
  border: 1px solid #ece6d8;
}
.me-creator-meta { flex: 1; min-width: 0; }
.me-creator-nm { font-size: 14px; color: var(--ink); font-weight: 500; }
.me-creator-stats { font-size: 11px; color: var(--ink-mute); margin-top: 2px; letter-spacing: 0.3px; }
.me-creator-stats .badge-r { color: #c5302d; margin-left: 6px; }
.me-creator-vis {
  font-size: 10px; padding: 2px 7px; border-radius: 99px;
  background: #f5f0e8; color: var(--ink-dim);
  margin-left: 6px;
}
.me-creator-vis.public { background: rgba(168, 66, 60, 0.12); color: var(--accent); }

/* v2.0.4 用户档案 */
.me-profile .me-pf-tip { font-size: 11.5px; color: #999; margin-bottom: 10px; line-height: 1.5; }
.me-pf-row { margin-bottom: 10px; }
.me-pf-lab { display: block; font-size: 11.5px; color: #777; letter-spacing: 0.5px; margin-bottom: 4px; }
.me-pf-inp {
  width: 100%;
  background: #fff;
  border: 1px solid #ece6d8;
  border-radius: 8px;
  padding: 9px 12px;
  color: #1a1714;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.18s;
}
.me-pf-inp:focus { border-color: var(--accent); }
.me-pf-save {
  margin-top: 6px;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 99px;
  font-size: 13px;
  letter-spacing: 1px;
  cursor: pointer;
}
.me-pf-save:active { transform: scale(0.97); }

.me-section { padding: 14px 0; border-bottom: 1px solid #f5f3ec; }
.me-section:last-child { border-bottom: none; }
.me-section-h {
  font-size: 11px; color: var(--accent);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 12px;
}
.me-section-h-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.me-section-action {
  background: none; border: none;
  color: var(--accent);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}
.me-avatar-row {
  display: flex; align-items: center; gap: 14px;
  padding: 4px 0;
}
.me-av {
  width: 52px; height: 52px;
  border-radius: 50%;
  background-size: cover; background-position: center 25%;
  background-color: var(--accent-pale);
  flex-shrink: 0;
  position: relative;
}
/* 空状态(无 background-image)显示人形剪影提示"待绑定" */
.me-av:not([style*="background-image"])::after {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='12' cy='9' r='3.5' fill='none' stroke='%23a8423c' stroke-width='1.6' opacity='0.55'/%3E%3Cpath d='M5 20a7 7 0 0 1 14 0' fill='none' stroke='%23a8423c' stroke-width='1.6' opacity='0.55'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 60%;
}
.me-info { flex: 1; min-width: 0; }
.me-nm { font-size: 16px; font-weight: 600; color: var(--ink); }
.me-sub { font-size: 12px; color: var(--ink-mute); margin-top: 3px; }
.me-arr { color: #ccc; font-size: 18px; }

/* B 数据故事化 */
.me-stat-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.me-stat {
  background: var(--accent-pale);
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
  font-size: 11px;
  color: var(--ink-mute);
  font-family: -apple-system, sans-serif;
}
.me-stat .n {
  font-size: 22px; font-weight: 700;
  color: var(--accent);
  font-family: "Songti SC", serif;
  margin-bottom: 2px;
}
/* 当 .n 是文字提示而不是数字(如"今日初见"),保持同字族,只略小 */
.me-stat .n.text-fallback {
  font-size: 18px;
  letter-spacing: 0.5px;
}

/* C 角色库 */
.me-lib-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.me-lib-grid .item {
  background: #f5f3ec;
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
}
.me-lib-grid .item .av-sm {
  width: 100%; aspect-ratio: 1 / 1.1;
  background-size: cover; background-position: center 25%;
  background-color: #e8e4d8;
  border-radius: 8px;
  margin-bottom: 6px;
}
.me-lib-grid .item .nm-sm { font-size: 13px; font-weight: 600; color: var(--ink); }
.me-lib-grid .item .last-sm { font-size: 11px; color: var(--ink-mute); margin-top: 1px; }
.me-lib-grid .ph-empty {
  grid-column: span 2;
  text-align: center;
  color: var(--ink-mute);
  font-size: 12px;
  padding: 20px 0;
}

/* D 关于品牌 */
.me-brand {
  text-align: center;
  padding: 30px 0 18px;
}
.me-brand-mark {
  /* DM Sans 规格,严格驼峰 MetaMuse(跟 scholar.metadistill.com Header.js 完全一致) */
  font-family: "DM Sans", "Noto Sans SC", -apple-system, "PingFang SC", sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.05;
  text-transform: none;
  color: #222;
  display: block;
  margin-bottom: 8px;
  /* kern + palt 字母对收紧 — scholar globals.css body 全局开,这里显式补 */
  font-feature-settings: "palt", "kern";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.me-brand-slogan {
  font-size: 12px;
  color: var(--ink-mute);
  line-height: 1.85;
  font-family: "Songti SC", "STSong", serif;
  letter-spacing: 0.3px;
}
.me-brand-links {
  margin-top: 18px;
  display: flex; justify-content: center; align-items: center; gap: 8px;
  font-size: 12px;
}
.me-brand-links a { color: var(--accent); text-decoration: none; cursor: pointer; }
.me-brand-links .dot { color: #ddd; }
.me-version {
  margin-top: 10px;
  font-size: 10px;
  color: #bbb;
  letter-spacing: 1px;
}
.placeholder-list {
  display: flex; flex-direction: column; gap: 14px;
}
.placeholder-list .ph-h {
  font-size: 22px; font-weight: 700;
  color: var(--ink);
  font-family: "Songti SC", serif;
  margin-bottom: 8px;
}
.placeholder-list .ph-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f5f3ec;
}
.placeholder-list .ph-row .av {
  width: 48px; height: 48px;
  border-radius: 50%;
  background-size: cover;
  background-position: center 25%;
  background-color: #e8e4d8;
  flex-shrink: 0;
}
.placeholder-list .ph-row .info { flex: 1; min-width: 0; }
.placeholder-list .ph-row .nm { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.placeholder-list .ph-row .last {
  font-size: 12px; color: var(--ink-mute);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.placeholder-list .ph-empty {
  padding: 60px 0;
  text-align: center;
  color: var(--ink-mute);
  font-size: 13px;
}

/* ============ Boot 启动占位 ============ */
.boot {
  position: fixed; inset: 0;
  /* 跟 scholar.metadistill.com 一致:暖纸 #fafafa + 墨 #222 */
  background: #fafafa;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 100;
  color: #222;
  transition: opacity 0.4s;
}
.boot.done { opacity: 0; pointer-events: none; }
.boot-brand {
  /* DM Sans 700 -0.5px 1.5rem · 跟 scholar.metadistill.com MetaMuse logo 完全一致 */
  font-family: "DM Sans", "Noto Sans SC", -apple-system, "PingFang SC", sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.05;
  text-transform: none;
  color: #222;            /* scholar --ink-soft */
  margin-bottom: 18px;
  font-feature-settings: "palt", "kern";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* 字体没就绪前先隐 — 防 fallback PingFang 闪一帧再 swap 到 DM Sans */
  opacity: 0;
  transition: opacity 0.25s ease;
}
.fonts-ready .boot-brand { opacity: 1; }
.boot-tip {
  font-size: 12px; color: #666;   /* scholar --ink-faint */
  letter-spacing: 1.2px;
}
.boot .err {
  color: var(--accent);
  margin-top: 14px;
  font-size: 13px;
  letter-spacing: 1px;
}

/* ============ M03 E · 顶部右上头像 = 复播按钮 ============ */
.char-avatar-btn {
  position: absolute;
  top: calc(var(--safe-top) + 10px);
  right: 14px;
  width: 38px; height: 38px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  background-size: cover;
  background-position: center 25%;
  background-repeat: no-repeat;
  background-color: #2a1a2e;
  z-index: 6;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.30);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.char-avatar-btn:active { transform: scale(0.92); }
.char-avatar-btn.speaking {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(168, 66, 60, 0.25), 0 2px 10px rgba(168, 66, 60, 0.50);
  animation: avatar-speaking 1.7s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes avatar-speaking {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 2px rgba(168,66,60,0.20), 0 2px 10px rgba(168,66,60,0.30); }
  50%      { transform: scale(1.035); box-shadow: 0 0 0 8px rgba(168,66,60,0), 0 0 24px rgba(168,66,60,0.45); }
}
.char-avatar-btn.loading {
  border-color: rgba(168, 66, 60, 0.40);
}
.char-avatar-btn.loading::after {
  content: '';
  position: absolute; inset: -3px;
  border: 1.5px solid transparent;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: tts-spin 0.7s linear infinite;
}

/* ============ M03 B + M04 D · 启动暗黑引导卡 ============ */
.audio-veil {
  position: fixed; inset: 0;
  /* 必须 > .boot(100),否则 boot 没淡出前看不到 veil */
  z-index: 110;
  background: linear-gradient(180deg,
    rgba(0,0,0,0.72) 0%,
    rgba(0,0,0,0.55) 40%,
    rgba(0,0,0,0.78) 100%);
  -webkit-backdrop-filter: blur(2px) saturate(0.85);
  backdrop-filter: blur(2px) saturate(0.85);
  display: flex; align-items: center; justify-content: center;
  padding: 30px;
  animation: veil-in 0.5s ease-out;
}
@keyframes veil-in { from { opacity: 0; } }
.audio-veil .veil-card {
  text-align: center;
  max-width: 320px;
}
.audio-veil .veil-line {
  font-size: 17.5px;
  line-height: 1.95;
  color: #fff;
  font-family: "Songti SC", "STSong", serif;
  letter-spacing: 1.4px;
  text-shadow: 0 2px 14px rgba(0,0,0,0.6);
  margin-bottom: 38px;
  min-height: 4em;
  display: flex;
  align-items: center;
  justify-content: center;
}
.audio-veil .veil-line::before {
  content: '"';
  color: rgba(255,255,255,0.35);
  font-size: 36px;
  vertical-align: -8px;
  margin-right: 4px;
  font-family: serif;
}
.audio-veil .veil-line::after {
  content: '"';
  color: rgba(255,255,255,0.35);
  font-size: 36px;
  vertical-align: -8px;
  margin-left: 4px;
  font-family: serif;
}
.audio-veil .veil-cta {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--accent);
  color: #fff;
  padding: 13px 26px;
  border-radius: 99px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 2px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 8px 30px rgba(168, 66, 60, 0.55);
  animation: veil-cta-pulse 2.4s ease-in-out infinite;
}
@keyframes veil-cta-pulse {
  0%, 100% { box-shadow: 0 8px 30px rgba(168,66,60,0.55); }
  50%      { box-shadow: 0 8px 40px rgba(168,66,60,0.85); transform: scale(1.02); }
}
.audio-veil .veil-cta svg { width: 18px; height: 18px; }
/* 短角色名包裹 — 名字内部字距收 0,跟周围字距形成对比,不被撕开 */
.audio-veil .veil-cta .veil-nm { letter-spacing: 0; margin: 0 2px; }
.audio-veil .veil-skip {
  display: block;
  margin: 18px auto 0;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  letter-spacing: 1px;
  cursor: pointer;
  font-family: inherit;
}
.audio-veil .veil-skip:active { color: rgba(255,255,255,0.8); }
.audio-veil.fading {
  animation: veil-out 0.45s ease-in forwards;
  pointer-events: none;
}
@keyframes veil-out { to { opacity: 0; } }

/* ============ a11y ============ */
button:focus { outline: none; }
button:focus-visible,
.tab:focus-visible,
[role="button"]:focus-visible,
.dock .pill:focus-visible {
  outline: 2px solid var(--accent-yellow);
  outline-offset: 2px;
  border-radius: 6px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============ Toast(底部通知) ============ */
.mm-toast {
  position: fixed;
  /* 居中偏上 — 不挡 dock 不挡 msg 不挡 status-bar */
  top: 40vh;
  left: 50%;
  transform: translate(-50%, -8px);
  background: rgba(20, 18, 16, 0.86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: #fff;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 99px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: 80vw;
  text-align: center;
  box-shadow: 0 6px 24px rgba(0,0,0,0.35);
}
.mm-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ============ 首印象 hint:点屏幕听她说话 ============ */
.tap-hint {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--dock-bottom) + 250px);
  z-index: 4;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: rgba(255,255,255,0.92);
  text-shadow: 0 1px 6px rgba(0,0,0,0.55);
  font-size: 12px;
  letter-spacing: 4px;
  font-family: "Songti SC", "STSong", serif;
  pointer-events: none;
  animation: tap-hint-pulse 2s ease-in-out infinite;
}
.tap-hint .ic {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.16);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
}
.tap-hint .ic svg {
  width: 16px; height: 16px;
  fill: #fff;
}
.tap-hint.fading { animation: none; opacity: 0; transition: opacity 0.4s; }
@keyframes tap-hint-pulse {
  0%, 100% { opacity: 0.55; transform: translateX(-50%) translateY(0); }
  50% { opacity: 1; transform: translateX(-50%) translateY(-4px); }
}
