/* ===================== 版本角标（右下角常显，前后端版本比对） ===================== */
.app-version {
  position: fixed;
  right: 8px;
  bottom: 8px;
  z-index: 9999;
  font-size: 11px;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  opacity: 0.5;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}
.app-version--warn {
  background: #e23b3b;
  opacity: 1;
  font-weight: 600;
  pointer-events: auto;
}
/* 语音输入不可用（非 localhost/https 等）：按钮半透明但仍可点，点击弹出原因提示 */
.composer__mic--off { opacity: 0.5; }

/* ===================== 基础与变量 ===================== */
:root {
  --accent: #15c2b1;
  --accent-2: #8b6dff;
  --accent-3: #ff7ab6;
  --accent-soft: #d7f6f2;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --card: #ffffff;
  --text: #1f2330;
  --text-dim: #8a8f9c;
  --line: #ececf0;
  --ai-bubble: #ebecef;
  --user-bubble: var(--accent);
  --radius: 18px;
  /* 安全区 */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overscroll-behavior: none;
}

body { overflow: hidden; }

/* ===================== 页面切换 ===================== */
.page {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  background: var(--bg);
}
.page--active { display: flex; }

/* 入口闸 / 加载态（仅对接模式：无 code 不可浏览） */
.gate {
  position: fixed; inset: 0; z-index: 400;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 24px; text-align: center; background: var(--bg);
}
.gate:not([hidden]) { display: flex; }
.gate__icon { font-size: 44px; }
.gate__msg { color: var(--text-dim); font-size: 15px; line-height: 1.6; max-width: 280px; }
.gate__action { min-width: 170px; padding: 11px 20px; border: 0; border-radius: 999px; color: #fff; background: var(--accent); font-size: 14px; font-weight: 700; cursor: pointer; box-shadow: 0 8px 20px rgba(21, 194, 177, .22); }
.gate__action:active { transform: scale(.98); }

/* ===================== 双 Tab 视图 ===================== */
/* Tab 视图占满主壳，给底部 Tab Bar 让出空间 */
.tabview {
  position: absolute;
  inset: 0;
  bottom: calc(58px + var(--safe-bottom)); /* 让出 Tab Bar 高度 */
  display: none;
  flex-direction: column;
}
.tabview--active { display: flex; }

/* ===================== 底部 Tab Bar ===================== */
.tabbar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-bottom);
  box-shadow: 0 -2px 12px rgba(31, 35, 48, .05);
}
.tabbar__item {
  flex: 1 1 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px;
  height: 58px;
  border: none; background: transparent; cursor: pointer;
  color: var(--text-dim);
}
.tabbar__icon { font-size: 22px; line-height: 1; filter: grayscale(1) opacity(.7); }
.tabbar__label { font-size: 11px; font-weight: 600; }
.tabbar__item--active { color: var(--accent); }
.tabbar__item--active .tabbar__icon { filter: none; }

/* ---- demo 精简：店员 Tab 隐藏（body.clerks-hidden，由 app.js 按 SHOW_CLERKS_TAB 加） ---- */
/* P0-2：底栏保留「消息 / 动态 / 我的」三 Tab；只把「店员」入口与视图藏掉。 */
/* 恢复店员：把 config.js 的 SHOW_CLERKS_TAB 改回 true，此类不再挂载即自动失效。 */
body.clerks-hidden .tabbar__item--clerks { display: none; }
body.clerks-hidden #tab-clerks { display: none; }

/* ---- 纯聊天模式（config.CHAT_ONLY）：只留「消息」列表 + 聊天 ---- */
/* 隐藏整条底部 Tab 栏（动态/我的），列表视图回收其占位、铺满到底。 */
body.chat-only .tabbar { display: none; }
body.chat-only .tabview { bottom: var(--safe-bottom); }
/* 点头像不再开详情，去掉可点提示 */
body.chat-only .topbar--chat .topbar__avatar { cursor: default; }
body.chat-only .topbar--chat .topbar__avatar:active { transform: none; }

/* ===================== 顶栏 ===================== */
.topbar {
  flex: 0 0 auto;
  padding-top: var(--safe-top);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar--home {
  padding: calc(var(--safe-top) + 22px) 20px 18px;
  background: linear-gradient(160deg, var(--accent-soft), var(--surface));
  border-bottom: none;
}
.topbar__title { font-size: 22px; font-weight: 700; }
.topbar__sub { margin-top: 4px; font-size: 13px; color: var(--text-dim); }

.topbar--chat {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: calc(var(--safe-top) + 52px);
  padding: calc(var(--safe-top) + 7px) 12px 7px;
  background: #fff;
  border-bottom: 1px solid rgba(31, 35, 48, .06);
}
.iconbtn {
  flex: 0 0 auto;
  width: 36px; height: 36px;
  border: none; background: transparent;
  font-size: 30px; line-height: 1;
  color: var(--accent);
  cursor: pointer;
  border-radius: 50%;
}
.iconbtn:active { background: var(--accent-soft); }
.topbar__avatar {
  flex: 0 0 auto;
  width: 36px; height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 17px;
  background: var(--accent);
}
.topbar__namebox { flex: 1 1 auto; min-width: 0; }
.topbar--chat .topbar__namebox {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  cursor: pointer;
  border-radius: 12px;
}
.topbar--chat .topbar__namebox:active { opacity: .72; }
.topbar__name { font-size: 18px; font-weight: 700; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__novoice { font-size: 11px; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar--chat .topbar__name {
  flex: 0 1 auto;
  font-size: 17px;
  font-weight: 700;
}
.topbar__sub { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 3px; }
.topbar--chat .topbar__sub {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  margin-top: 0;
}
/* 「虚拟店员」淡紫徽标 + 「在线」状态（仿参考图） */
.chip-soft {
  font-size: 11px; font-weight: 600; color: #8a7be0;
  background: #f0ecff; border-radius: 9px; padding: 1px 8px; line-height: 1.6;
}
.online { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--accent); font-weight: 600; }
.online i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; }
.topbar__voiceswitch {
  border: 1px solid #ddd; background: #f5f5f8; color: var(--text);
  font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: 11px;
  cursor: pointer; white-space: nowrap;
}
.topbar__voiceswitch:active { transform: scale(.96); }
.topbar__voiceswitch[disabled] { cursor: default; }
.topbar__voiceswitch--volc { border-color: #d3e2ff; background: #e6efff; color: #2563eb; }
.topbar__voiceswitch--minimax { border-color: #ebd9ff; background: #f3e8ff; color: #9333ea; }
.topbar__avatar--img { background-size: cover; background-position: center; color: transparent; }
/* 聊天页头像可点开「个人主页」，给个可点提示 */
.topbar--chat .topbar__avatar { cursor: pointer; }
.topbar--chat .topbar__avatar:active { transform: scale(.94); }

.intimacy-heart {
  --intimacy-progress: 0;
  flex: 0 0 auto;
  position: relative;
  width: 58px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 122, 182, .18);
  color: #ff6ea8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  overflow: hidden;
  font: inherit;
}
.intimacy-heart:active { transform: scale(.96); }
.intimacy-heart--levelup {
  animation: intimacy-levelup-pop .72s ease-out;
  overflow: visible;
}
.intimacy-heart--levelup::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(255, 122, 182, .42), transparent 68%);
  animation: intimacy-levelup-glow .72s ease-out;
  pointer-events: none;
}
.intimacy-heart__ring {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(#fff, #fff) padding-box,
    conic-gradient(#ff6ea8 calc(var(--intimacy-progress) * 1%), rgba(255, 255, 255, .18) 0) border-box;
  border: 2px solid transparent;
  opacity: .92;
}
.intimacy-heart__icon,
.intimacy-heart__level {
  position: relative;
  z-index: 1;
}
.intimacy-heart__icon {
  font-size: 16px;
  line-height: 1;
}
.intimacy-heart__level {
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.intimacy-pop {
  position: fixed;
  top: calc(var(--safe-top) + 58px);
  right: 12px;
  z-index: 120;
  width: min(310px, calc(100vw - 24px));
  pointer-events: none;
}
.intimacy-pop__panel {
  pointer-events: auto;
  /* 加入礼物区块后弹窗变长：限高可滚，小屏也够得着底部 */
  max-height: calc(100vh - var(--safe-top) - 88px);
  overflow-y: auto;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .96);
  color: var(--text);
  box-shadow: 0 14px 34px rgba(31, 35, 48, .18);
  border: 1px solid rgba(255, 122, 182, .14);
}
.intimacy-pop__top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.intimacy-pop__heart {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #ff7ab6, #8b6dff);
  font-size: 18px;
  box-shadow: 0 8px 18px rgba(255, 122, 182, .24);
}
.intimacy-pop__level {
  font-size: 15px;
  font-weight: 800;
}
.intimacy-pop__score,
.intimacy-pop__hint {
  font-size: 12px;
  color: var(--text-dim);
}
.intimacy-pop__bar {
  height: 8px;
  margin-top: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #f0ecff;
}
.intimacy-pop__bar i {
  display: block;
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff7ab6, #8b6dff);
  transition: width .25s ease;
}
.intimacy-pop__hint {
  margin-top: 8px;
}
.intimacy-pop__daily,
.intimacy-pop__streak {
  margin-top: 10px;
  border-radius: 12px;
  background: rgba(255, 122, 182, .08);
  border: 1px solid rgba(255, 122, 182, .12);
}
.intimacy-pop__daily {
  padding: 8px 10px;
}
.intimacy-pop__daily-main {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
}
.intimacy-pop__daily-note {
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-dim);
}
.intimacy-pop__streak {
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 800;
  color: #d94f8d;
}
.intimacy-pop__unlocks {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.intimacy-pop__section-title {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
}
.intimacy-pop__unlock {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  color: var(--text-dim);
  font-size: 12px;
}
.intimacy-pop__unlock--on {
  color: var(--text);
}
.intimacy-pop__unlock-icon {
  line-height: 1;
  text-align: center;
  color: #a9a5b8;
}
.intimacy-pop__unlock--on .intimacy-pop__unlock-icon {
  color: #ff6ea8;
}
.intimacy-pop__unlock-name,
.intimacy-pop__unlock-level {
  min-width: 0;
  line-height: 1.3;
}
.intimacy-pop__unlock-name {
  overflow-wrap: anywhere;
}
.intimacy-pop__unlock-level {
  font-size: 11px;
  color: #a9a5b8;
  white-space: nowrap;
}
/* 送礼物（亲密度弹窗内） */
.gift-sec {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.gift-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.gift-grid__state {
  grid-column: 1 / -1;
  padding: 10px 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
}
.gift-item {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 8px 2px 6px;
  border: 1px solid rgba(255, 122, 182, .14);
  border-radius: 12px;
  background: rgba(255, 122, 182, .06);
  cursor: pointer;
  font: inherit;
  transition: transform .12s ease, background .12s ease;
}
.gift-item:active {
  transform: scale(.94);
  background: rgba(255, 122, 182, .16);
}
.gift-item__emoji {
  font-size: 20px;
  line-height: 1.2;
}
.gift-item__name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
}
.gift-item__cost {
  font-size: 10px;
  font-weight: 700;
  color: #8b6dff;
}
.gift-sec__note {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-dim);
}
@keyframes intimacy-levelup-pop {
  0% { transform: scale(1); }
  38% { transform: scale(1.16); }
  100% { transform: scale(1); }
}
@keyframes intimacy-levelup-glow {
  0% { opacity: 0; transform: scale(.78); }
  35% { opacity: 1; transform: scale(1.16); }
  100% { opacity: 0; transform: scale(1.55); }
}

/* ===================== 列表页 ===================== */
.list-wrap {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px calc(16px + var(--safe-bottom));
}
.cards { display: flex; flex-direction: column; gap: 12px; }

.card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(31, 35, 48, .05);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.card:active { transform: scale(.985); box-shadow: 0 1px 6px rgba(31,35,48,.08); }
.card__avatar {
  flex: 0 0 auto;
  width: 54px; height: 54px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 24px;
}
.card__main { min-width: 0; flex: 1 1 auto; }
.card__name { font-size: 17px; font-weight: 600; }
.card__line {
  margin-top: 2px;
  font-size: 13px; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card__owner {
  margin-top: 3px;
  font-size: 12px; color: var(--text-dim); opacity: .8;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card__chevron { flex: 0 0 auto; color: var(--text-dim); font-size: 22px; }
.card__del {
  flex: 0 0 auto; border: none; background: transparent; cursor: pointer;
  font-size: 17px; padding: 6px 8px; border-radius: 10px; opacity: .55;
}
.card__del:hover, .card__del:active { opacity: 1; background: #ffe9ec; }

/* 克隆体卡片上的真人头像 / 小动作 */
.card__avatar-img { object-fit: cover; }
.card__badges { margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; }
.minivoice {
  display: inline-flex; align-items: center; gap: 5px;
  border: none; cursor: pointer;
  background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 12px;
}
.minivoice:active { transform: scale(.95); }
.minivoice--loading, .minivoice--playing { opacity: .9; }
.tag-voice {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); border-radius: 10px; padding: 3px 9px;
}
.tag-novoice {
  display: inline-flex; align-items: center;
  font-size: 11px; color: var(--text-dim);
  background: #f0f0f3; border-radius: 10px; padding: 3px 9px;
}

/* 音色来源标签（火山 / MiniMax / 未训练）——便于对比不同克隆方式 */
.vp {
  display: inline-flex; align-items: center;
  margin-left: 8px; vertical-align: middle;
  font-size: 11px; font-weight: 600;
  border-radius: 10px; padding: 2px 8px;
  line-height: 1.6;
}
/* 中性「真人音色」标签（不暴露 TTS 平台品牌） */
.vp--voice { color: var(--accent); background: var(--accent-soft); }
.vp--none { color: var(--text-dim); background: #f0f0f3; }

/* ===================== 选择克隆方式弹窗 ===================== */
.picker {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, 0.45);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 16px;
}
.picker__card {
  width: 100%; max-width: 420px;
  background: #fff; border-radius: 18px;
  padding: 18px 16px calc(14px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 30px rgba(0, 0, 0, 0.2);
  animation: picker-in 0.18s ease-out;
}
@keyframes picker-in { from { transform: translateY(20px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.picker__title { font-size: 16px; font-weight: 700; text-align: center; }
.picker__sub { margin: 6px 0 12px; font-size: 12px; color: var(--text-dim); text-align: center; }
.picker__btn {
  display: block; width: 100%; margin-top: 10px;
  border: 1px solid #eee; border-radius: 12px;
  padding: 13px; font-size: 15px; font-weight: 600;
  background: #f7f7fa; color: var(--text); cursor: pointer;
}
.picker__btn--volc { background: #e6efff; color: #2563eb; border-color: #d3e2ff; }
.picker__btn--minimax { background: #f3e8ff; color: #9333ea; border-color: #ebd9ff; }
.picker__btn:disabled { opacity: 0.45; cursor: not-allowed; }
.picker__cancel {
  display: block; width: 100%; margin-top: 12px;
  border: none; background: transparent; cursor: pointer;
  padding: 10px; font-size: 14px; color: var(--text-dim);
}

/* ===================== 店员网格（Tab 店员） ===================== */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.clerk {
  display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(31, 35, 48, .05);
  overflow: hidden;
  padding: 14px 12px 12px;
}
.clerk__top { display: flex; align-items: center; gap: 10px; }
.clerk__avatar {
  flex: 0 0 auto;
  width: 52px; height: 52px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent-soft);
  cursor: pointer;
}
.clerk__avatar--placeholder {
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 22px;
  background: var(--accent);
}
.clerk__id { min-width: 0; flex: 1 1 auto; }
.clerk__name {
  font-size: 16px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.clerk__meta {
  margin-top: 2px;
  font-size: 12px; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.clerk__grade {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px; font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 8px; padding: 0 6px;
  vertical-align: middle;
}
.clerk__region {
  margin-top: 4px;
  font-size: 12px; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.clerk__tags {
  margin-top: 8px;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.clerk__tag {
  font-size: 11px; color: var(--accent);
  background: var(--accent-soft);
  border-radius: 10px; padding: 3px 9px;
}
.clerk__sign {
  margin-top: 8px;
  font-size: 12.5px; color: var(--text); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.clerk__actions {
  margin-top: 10px;
  display: flex; gap: 8px;
}
.clerk__actions .btn--sm { flex: 1 1 0; padding: 8px 6px; }
.btn--cloned {
  background: #e8f3ed; color: #3f9e72;
}
/* 已克隆的店员：可点的「AI」按钮，点击跳到对应克隆体对话 */
.btn--ai {
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
}
.btn--ai::before { content: "💬"; font-size: 13px; }
.btn--ai:active { transform: scale(.96); }

/* ===================== 店员网格骨架 ===================== */
.grid-skel {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.gskel {
  height: 158px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #ececf0 25%, #f6f5f8 37%, #ececf0 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}

/* ===================== 分页 ===================== */
.pager {
  display: flex; align-items: center; justify-content: center;
  gap: 14px;
  padding: 18px 4px 4px;
}
.pager__info { font-size: 13px; color: var(--text-dim); }

/* 下拉加载更多 状态条 */
.clerk-more {
  text-align: center; color: var(--text-dim);
  font-size: 13px; padding: 16px 4px 8px; cursor: default;
}
.btn--sm { padding: 8px 16px; font-size: 14px; }
.btn[disabled] { opacity: .4; cursor: default; }

/* ===================== 图片查看器 ===================== */
.viewer {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, .92);
  display: flex; align-items: center; justify-content: center;
  animation: toast-in .18s ease;
}
.viewer__img {
  max-width: 92vw; max-height: 80vh;
  border-radius: 10px;
  object-fit: contain;
}
.viewer__close {
  position: absolute;
  top: calc(var(--safe-top) + 14px); right: 16px;
  width: 40px; height: 40px;
  border: none; border-radius: 50%;
  background: rgba(255, 255, 255, .15); color: #fff;
  font-size: 26px; line-height: 1; cursor: pointer;
}
.viewer__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 60px;
  border: none; background: transparent; color: #fff;
  font-size: 44px; line-height: 1; cursor: pointer;
  opacity: .8;
}
.viewer__nav--prev { left: 4px; }
.viewer__nav--next { right: 4px; }
.viewer__count {
  position: absolute;
  bottom: calc(var(--safe-bottom) + 22px); left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, .9); font-size: 14px;
}

/* ===================== 状态态（加载/错误/空） ===================== */
.state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px;
  padding: 60px 24px;
  text-align: center;
  color: var(--text-dim);
}
.state__icon { font-size: 40px; }
.state__hint { font-size: 12px; }
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner--sm { width: 18px; height: 18px; border-width: 2px; }

/* ===================== 列表骨架屏 ===================== */
.skeletons { display: flex; flex-direction: column; gap: 12px; }
.skel-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px; background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(31, 35, 48, .05);
}
.skel-avatar { flex: 0 0 auto; width: 54px; height: 54px; border-radius: 50%; }
.skel-lines { flex: 1 1 auto; display: flex; flex-direction: column; gap: 8px; }
.skel-line { height: 12px; border-radius: 6px; }
.skel-line--w60 { width: 60%; } .skel-line--w50 { width: 50%; }
.skel-line--w55 { width: 55%; } .skel-line--w45 { width: 45%; }
.skel-line--w40 { width: 40%; } .skel-line--w35 { width: 35%; }
.skel-avatar, .skel-line {
  background: linear-gradient(90deg, #ececf0 25%, #f6f5f8 37%, #ececf0 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* 历史加载中（对话页顶部） */
.history-loading {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px; color: var(--text-dim); font-size: 13px;
}

/* ===================== 聊天区 ===================== */
.chat-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #fff;
}

.msg { display: flex; align-items: flex-start; gap: 8px; max-width: 100%; }
.msg--user { justify-content: flex-end; }
.msg--ai { justify-content: flex-start; }

/* 每条消息的头像（克隆体在左、用户在右）——仿参考图 */
.msg__avatar {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  border-radius: 50%;
  overflow: hidden;
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 15px;
  box-shadow: 0 1px 5px rgba(31, 35, 48, .08);
}
.msg__avatar--user {
  background: linear-gradient(135deg, #7fe0d6, var(--accent)); color: #fff;
}
.msg__avatar--user svg { width: 22px; height: 22px; fill: currentColor; }

.bubble {
  max-width: 72%;
  padding: 11px 15px;
  border-radius: 19px;
  font-size: 16px;
  line-height: 1.55;
  word-break: break-word;
  white-space: pre-wrap;
}
.msg--user .bubble {
  background: var(--user-bubble);
  color: #fff;
  border-top-right-radius: 8px;
  box-shadow: 0 4px 10px rgba(21, 194, 177, .18);
}
.msg--ai .bubble {
  background: var(--ai-bubble);
  color: var(--text);
  border-top-left-radius: 8px;
}

/* AI 气泡内的播放按钮 */
.bubble__row { display: flex; align-items: flex-end; gap: 8px; }
.bubble__row .bubble { flex: 0 1 auto; }
.playbtn {
  flex: 0 0 auto;
  width: 32px; height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 15px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  align-self: flex-end;
  transition: transform .1s ease;
}
.playbtn:active { transform: scale(.9); }
/* 加载态：转圈 */
.playbtn--loading { color: var(--accent); }
.playbtn--loading::after {
  content: ""; position: absolute;
  width: 18px; height: 18px;
  border: 2px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.playbtn--loading { position: relative; color: transparent; }
/* 播放中：脉冲波纹 */
.playbtn--playing { animation: pulse 1s ease infinite; }
@keyframes pulse { 50% { background: var(--accent); color: #fff; } }
.playbtn[disabled] { opacity: .5; cursor: default; }

/* 克隆体主动发的「语音条」（仿微信语音消息）。
   左对齐、随 AI 气泡风格；点条播放，下方「查看文字」可展开看内容。 */
.voicemsg { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; max-width: 72%; }
.voicemsg__bar {
  display: inline-flex; align-items: center; gap: 8px;
  min-width: 120px; max-width: 100%;
  padding: 10px 14px;
  border: none; cursor: pointer;
  border-radius: 18px; border-top-left-radius: 7px;
  background: var(--ai-bubble); color: var(--text);
  font-size: 15px;
  transition: transform .1s ease;
}
.voicemsg__bar:active { transform: scale(.97); }
.voicemsg__icon { font-size: 16px; line-height: 1; color: var(--accent); }
.voicemsg__len { font-size: 12px; color: var(--text-soft, #8a8f9c); }
/* 静态声波三两竖条，呼应语音的意象 */
.voicemsg__wave { display: inline-flex; align-items: center; gap: 3px; height: 16px; }
.voicemsg__wave i {
  width: 3px; border-radius: 2px; background: var(--accent); opacity: .55;
}
.voicemsg__wave i:nth-child(1) { height: 7px; }
.voicemsg__wave i:nth-child(2) { height: 13px; }
.voicemsg__wave i:nth-child(3) { height: 9px; }
.voicemsg__wave i:nth-child(4) { height: 5px; }
/* 播放中：声波轻轻起伏 */
.voicemsg__wave--on i { animation: voicewave .9s ease infinite; }
.voicemsg__wave--on i:nth-child(2) { animation-delay: .15s; }
.voicemsg__wave--on i:nth-child(3) { animation-delay: .3s; }
.voicemsg__wave--on i:nth-child(4) { animation-delay: .45s; }
@keyframes voicewave { 50% { transform: scaleY(1.6); opacity: 1; } }
.voicemsg__toggle {
  border: none; background: none; cursor: pointer;
  padding: 0 4px; font-size: 12px; color: var(--accent);
}
.voicemsg__caption {
  align-self: stretch;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 14px; line-height: 1.5;
  word-break: break-word; white-space: pre-wrap;
}
/* 正在输入指示 */
.typing .bubble {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 9px 13px;
}
.typing__text {
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  animation: typingPulse 1.2s ease-in-out infinite;
}
/* 聊天里的图片消息（自拍等）——历史回放与实时共用 */
.bubble--image {
  padding: 4px;
  line-height: 0;
}
.bubble--image img {
  display: block;
  max-width: 100%;
  max-height: 260px;
  border-radius: 15px;
  cursor: zoom-in;
}

.bubble--typing-text::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  border-radius: 2px;
  background: currentColor;
  vertical-align: -2px;
  animation: caretBlink .8s steps(1) infinite;
}
@keyframes typingPulse { 50% { opacity: .62; transform: translateY(-1px); } }
@keyframes caretBlink { 50% { opacity: 0; } }



/* ===================== H5 实时语音 ===================== */
.realtime-call-btn {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 48px; height: 34px; padding: 0 9px;
  border: 1px solid rgba(21, 194, 177, .28); border-radius: 17px;
  background: #effbf9; color: var(--accent);
  font-size: 12px; font-weight: 700; cursor: pointer;
}
.realtime-call-btn:active { transform: scale(.96); }
.realtime-call-btn[disabled] { opacity: .45; cursor: default; transform: none; }
.realtime-call-btn--active { background: #dff7f1; border-color: var(--accent); }
.realtime-call-btn__text { white-space: nowrap; }
.realtime-call-dialog { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; }
.realtime-call-dialog[hidden] { display: none; }
.realtime-call-dialog__mask { position: absolute; inset: 0; background: rgba(12, 22, 32, .62); backdrop-filter: blur(5px); }
.realtime-call-dialog__panel {
  position: relative; width: min(100%, 360px); padding: 28px 24px 22px;
  border: 1px solid rgba(255,255,255,.55); border-radius: 24px;
  background: linear-gradient(160deg, #ffffff, #effbf9);
  color: var(--text); text-align: center; box-shadow: 0 24px 70px rgba(12, 22, 32, .3);
}
.realtime-call-dialog__eyebrow { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.realtime-call-dialog h2 { margin: 8px 0 10px; font-size: 22px; }
.realtime-call-dialog__status { min-height: 24px; color: var(--text-dim); font-size: 14px; }
.realtime-call-dialog__time { margin: 14px 0 18px; color: var(--accent); font-size: 38px; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.realtime-call-dialog__error { margin: 0 0 14px; color: #c4435b; font-size: 13px; line-height: 1.5; }
.realtime-call-dialog__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.realtime-call-dialog__action { min-height: 42px; border: 0; border-radius: 14px; background: #dff7f1; color: #137d6d; font-size: 14px; font-weight: 700; cursor: pointer; }
.realtime-call-dialog__action:active { transform: scale(.97); }
.realtime-call-dialog__action--danger { background: #ffe4e9; color: #c4435b; }
@media (max-width: 420px) {
  .realtime-call-btn { min-width: 38px; padding: 0 7px; }
  .realtime-call-btn__text { display: none; }
  .realtime-call-dialog { align-items: end; padding: 0; }
  .realtime-call-dialog__panel { width: 100%; border-radius: 24px 24px 0 0; padding-bottom: calc(22px + var(--safe-bottom)); }
}

/* ===================== 输入栏 ===================== */
.topic-suggestions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 9px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.topic-suggestions[hidden] { display: none; }
.topic-suggestions__label {
  flex: 0 0 auto;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.topic-suggestions__list {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.topic-suggestions__list::-webkit-scrollbar { display: none; }
.topic-chip {
  flex: 0 0 auto;
  max-width: 220px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  padding: 7px 11px;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.topic-chip--related {
  border-color: rgba(21, 194, 177, .35);
  background: var(--accent-soft);
  color: #0d7d73;
}
.topic-chip--play {
  border-color: rgba(147, 95, 255, .28);
  background: #f0ecff;
  color: #5b35b1;
}
.topic-chip:active { transform: scale(.97); }
.topic-chip[disabled] { opacity: .55; cursor: default; }

/* ===================== 聊天内小游戏 ===================== */
.game-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}
.game-actions__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.game-actions__grid--signs {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.game-actions__grid--nums {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.game-btn {
  min-height: 42px;
  border: 1px solid rgba(103, 112, 132, .18);
  border-radius: 14px;
  background: #f7f8fb;
  color: #333844;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .04);
}
.game-btn--primary {
  min-height: 48px;
  border: 0;
  background: linear-gradient(135deg, #15c2b1, #7c5cff);
  color: #fff;
  box-shadow: 0 10px 22px rgba(73, 89, 205, .22);
}
.game-btn:active { transform: scale(.97); }
@media (max-width: 360px) {
  .game-actions__grid--signs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .game-actions__grid--nums { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.msg--game {
  max-width: 100%;
}
.game-card {
  width: min(318px, calc(100vw - 78px));
  border: 1px solid rgba(21, 194, 177, .14);
  border-radius: 18px 18px 18px 7px;
  padding: 10px;
  background: #f7fbfa;
  color: #292d36;
  box-shadow: 0 4px 12px rgba(28, 34, 48, .06);
}
.game-card__head {
  display: flex;
  align-items: center;
  gap: 9px;
}
.game-card__asset {
  flex: 0 0 auto;
  width: 52px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 5px 8px rgba(44, 46, 66, .12));
}
.game-card__copy {
  min-width: 0;
  flex: 1 1 auto;
}
.game-card__title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
}
.game-card__desc {
  margin-top: 2px;
  color: #626a78;
  font-size: 12px;
  line-height: 1.35;
}
.game-card__context {
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(21, 194, 177, .22);
  border-radius: 12px;
  background: rgba(21, 194, 177, .08);
}
.game-card__context-label {
  color: #0d7d73;
  font-size: 11px;
  font-weight: 800;
}
.game-card__context-text {
  margin-top: 3px;
  color: #303642;
  font-size: 13px;
  line-height: 1.45;
}
.game-card__status {
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(21, 194, 177, .12), rgba(124, 92, 255, .1));
  color: #43505f;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}
.game-card__hint {
  padding: 2px 2px 0;
  color: #697080;
  font-size: 12px;
  line-height: 1.35;
}
.game-card__picked {
  margin-top: 8px;
  color: #6e7480;
  font-size: 12px;
  line-height: 1.35;
}
.game-card__notice {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed rgba(103, 112, 132, .18);
  color: #7a808b;
  font-size: 11px;
  line-height: 1.45;
}
.game-card .game-actions {
  margin-top: 9px;
  gap: 7px;
}
.game-card .game-actions__grid {
  gap: 6px;
}
.game-card .game-btn {
  min-height: 34px;
  border-color: rgba(103, 112, 132, .12);
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  color: #303642;
  font-size: 12.5px;
  box-shadow: none;
}
.game-card .game-btn--primary {
  min-height: 36px;
  background: rgba(21, 194, 177, .16);
  color: #0d7d73;
  box-shadow: none;
}
.game-card--used {
  opacity: .62;
}
.game-card .game-btn[disabled] {
  opacity: .48;
  cursor: default;
}
.game-card:not(.game-card--used) .game-btn[disabled] {
  opacity: .28;
}
.game-card .game-actions__grid--nums {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
@media (max-width: 360px) {
  .game-card { width: min(300px, calc(100vw - 70px)); }
  .game-card .game-actions__grid--signs,
  .game-card .game-actions__grid--nums {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.composer {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 9px 10px calc(9px + var(--safe-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.composer__input {
  flex: 1 1 auto;
  resize: none;
  overflow: hidden;
  max-height: 120px;
  min-height: 42px;
  padding: 10px 14px;
  border: 0;
  border-radius: 15px;
  font: inherit;
  font-size: 16px;
  background: #f5f6f8;
  outline: none;
}
.composer__input::-webkit-scrollbar { display: none; }
.composer__input { scrollbar-width: none; }
.composer__input:focus { background: #fff; }
.composer__send {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .1s ease, opacity .2s ease;
}
.composer__send:active { transform: scale(.92); }
.composer__send[disabled] { opacity: .45; cursor: default; }
/* 发送中：把发送图标换成转圈 */
.composer__send--busy svg { display: none; }
.composer__send--busy::after {
  content: ""; width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* 按住说话：与发送按钮同尺寸圆钮，长按录音 */
.composer__mic {
  flex: 0 0 auto;
  order: -1;                      /* 语音键移到输入框左侧（仿参考图） */
  width: 42px; height: 42px;
  border: none;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .1s ease, background .2s ease, color .2s ease, opacity .2s ease;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;            /* 防止长按触发系统手势/选择 */
}
.composer__mic:active { transform: scale(.92); }
.composer__mic[disabled] { opacity: .45; cursor: default; }
/* 录音中：变色 + 呼吸波纹 */
.composer__mic--rec {
  background: var(--accent);
  color: #fff;
  animation: micPulse 1.1s ease-in-out infinite;
}
@keyframes micPulse {
  0%   { box-shadow: 0 0 0 0 var(--accent-soft); }
  70%  { box-shadow: 0 0 0 10px rgba(21,194,177,0); }
  100% { box-shadow: 0 0 0 0 rgba(21,194,177,0); }
}
/* 识别中：转圈替换图标 */
.composer__mic--busy svg { display: none; }
.composer__mic--busy::after {
  content: ""; width: 18px; height: 18px;
  border: 2px solid rgba(21,194,177,.4);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ===================== 通用按钮 ===================== */
.btn {
  border: none; cursor: pointer;
  padding: 10px 22px; border-radius: 20px;
  font-size: 15px; font-weight: 600;
}
.btn--ghost {
  background: var(--accent-soft); color: var(--accent);
}
.btn--ghost:active { transform: scale(.96); }

/* ===================== 全局 toast 提示条 ===================== */
.toast {
  position: fixed;
  left: 50%;
  top: calc(var(--safe-top) + 14px);
  transform: translateX(-50%);
  z-index: 100;
  max-width: calc(100% - 32px);
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px 11px 16px;
  background: #2b2f3a;
  color: #fff;
  border-radius: 14px;
  box-shadow: 0 6px 22px rgba(31, 35, 48, .25);
  font-size: 14px;
  animation: toast-in .22s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.toast--error { background: #d9534f; }
.toast--warn  { background: #e08a2b; }
.toast--ok    { background: #3f9e72; }
.toast__msg { flex: 1 1 auto; line-height: 1.4; }
.toast__action {
  flex: 0 0 auto;
  border: none; cursor: pointer;
  background: rgba(255, 255, 255, .22);
  color: #fff; font-weight: 600;
  padding: 5px 12px; border-radius: 12px; font-size: 13px;
}
.toast__action:active { background: rgba(255, 255, 255, .34); }
.toast__close {
  flex: 0 0 auto;
  border: none; background: transparent; cursor: pointer;
  color: rgba(255, 255, 255, .8);
  font-size: 20px; line-height: 1; padding: 0 2px;
}

/* ===================== 对话顶栏工具按钮（动态/人设） ===================== */
.iconbtn--tool { width: 34px; height: 34px; font-size: 0; }
.iconbtn--tool svg { display: block; margin: auto; }

/* ===================== 抽屉（动态 / 人设，自底部滑出） ===================== */
.sheet { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; }
.sheet__mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .42); }
.sheet__panel {
  position: relative; margin-top: auto;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  max-height: 82vh;
  display: flex; flex-direction: column;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .2);
  animation: picker-in .2s ease-out;
}
.sheet__head {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 10px;
  border-bottom: 1px solid var(--line);
}
.sheet__title { font-size: 17px; font-weight: 700; }
.sheet__close {
  border: none; background: transparent; cursor: pointer;
  font-size: 26px; line-height: 1; color: var(--text-dim); padding: 0 4px;
}
.sheet__bar {
  flex: 0 0 auto;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}
.sheet__bar .btn--sm { width: 100%; }
.sheet__bar--split { display: flex; gap: 10px; }
.sheet__bar--split .btn--sm { flex: 1 1 0; width: auto; }
.sheet__body {
  flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 14px 18px calc(18px + var(--safe-bottom));
}
.sheet .btn--sm {
  background: var(--accent); color: #fff;
}
.sheet .btn--sm:active { transform: scale(.97); }
.sheet .btn--sm[disabled] { opacity: .5; }

/* 抽屉内的加载/空态 */
.sheet-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 48px 16px; color: var(--text-dim); text-align: center;
}
.sheet-state--empty p { margin: 0; font-size: 14px; }

/* ===================== 动态条目 ===================== */
.feed-item {
  background: var(--bg);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.feed-item__content {
  font-size: 15px; line-height: 1.55; color: var(--text);
  white-space: pre-wrap; word-break: break-word;
}
.feed-item__images {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}
.feed-item__image {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 0;
  border-radius: 10px;
  background: var(--line) center / cover no-repeat;
  cursor: pointer;
  padding: 0;
}
.feed-item__voice { margin-top: 10px; }
.feed-item__voice .minivoice {
  background: var(--accent-soft); color: var(--accent);
  font-weight: 600; font-size: 13px; padding: 6px 14px; border-radius: 14px;
}
.feed-item__voice .minivoice--playing { background: var(--accent); color: #fff; }
.feed-item__meta { margin-top: 8px; font-size: 12px; color: var(--text-dim); }
/* 动态来源徽章：auto=自动发布（强调色）/ manual=手动发布（中性灰） */
.feed-reason {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 1px 8px; border-radius: 10px; vertical-align: middle;
}
.feed-reason--auto { color: var(--accent); background: var(--accent-soft); }
.feed-reason--manual { color: var(--text-dim); background: #f0f0f3; }
.feed-item--new { animation: feed-pop .35s ease; }
@keyframes feed-pop {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

/* ===================== 人设调整 ===================== */
/* 逐字段编辑表单 */
.persona-edit { display: flex; flex-direction: column; gap: 14px; }
.persona-edit__field { display: flex; flex-direction: column; gap: 6px; }
.persona-edit__label { font-size: 13px; font-weight: 700; color: var(--text-dim); }
.persona-edit__hint { font-size: 12px; color: var(--text-dim); opacity: .8; margin-top: -2px; }
.persona-edit__textarea { resize: vertical; min-height: 56px; line-height: 1.5; }
.persona-edit__actions {
  display: flex; gap: 10px; margin-top: 4px;
}
.persona-edit__actions .btn--sm { flex: 1 1 0; }
.persona-edit__actions #persona-reset { flex: 0 0 auto; }

/* 自然语言快捷区（折叠） */
.persona-quick {
  margin-top: 18px; padding-top: 14px;
  border-top: 1px solid var(--line);
}
.persona-quick__summary {
  list-style: none; cursor: pointer;
  font-size: 14px; font-weight: 700; color: var(--accent);
  padding: 4px 0;
}
.persona-quick__summary::-webkit-details-marker { display: none; }
.persona-quick__summary::after { content: " ▾"; color: var(--text-dim); font-weight: 400; }
.persona-quick[open] .persona-quick__summary::after { content: " ▴"; }
.persona-quick .persona__hint { margin-top: 10px; }

.persona__hint { margin: 0 0 12px; font-size: 13px; color: var(--text-dim); line-height: 1.5; }
.persona__form { display: flex; flex-direction: column; gap: 10px; }
.persona__input {
  width: 100%; resize: none;
  padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px;
  font: inherit; font-size: 15px; background: var(--bg); outline: none;
}
.persona__input:focus { border-color: var(--accent); background: #fff; }
.persona__revert {
  margin-top: 12px;
  border: 1px solid var(--line); background: transparent;
  color: var(--text-dim); cursor: pointer;
  font-size: 13px; padding: 8px 14px; border-radius: 14px;
}
.persona__revert:active { transform: scale(.97); }
.persona__revert[disabled] { opacity: .5; }
.persona__result { margin-top: 16px; }
.persona__msg {
  font-size: 14px; font-weight: 600;
  padding: 10px 12px; border-radius: 12px;
}
.persona__msg--ok { color: #3f9e72; background: #e8f3ed; }
.persona__msg--warn { color: #b9722a; background: #fbf0e2; }

/* before -> after diff */
.persona__diff { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.diff-row {
  background: var(--bg); border-radius: 12px; padding: 10px 12px;
}
.diff-row__field { font-size: 12px; font-weight: 700; color: var(--text-dim); margin-bottom: 6px; }
.diff-line {
  font-size: 14px; line-height: 1.5; word-break: break-word;
  padding: 3px 8px; border-radius: 8px; margin: 2px 0;
}
.diff-line--del { color: #b04a47; background: #fbe9e8; text-decoration: line-through; }
.diff-line--add { color: #2e7d54; background: #e6f4ec; }
.diff-arrow { text-align: center; color: var(--text-dim); font-size: 13px; margin: 1px 0; }

/* ===================== 用户画像（TA 记住的你） ===================== */
.sheet__bar--split .profile__subtitle {
  flex: 1 1 auto; min-width: 0;
  font-size: 13px; color: var(--text-dim); line-height: 1.4;
  display: flex; align-items: center;
}
.sheet__bar--split #profile-refresh { flex: 0 0 auto; width: auto; }

.profile-guide {
  font-size: 13px; line-height: 1.6; color: var(--text-dim);
  background: var(--accent-soft); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 16px;
}
.profile-guide b { color: var(--accent); font-weight: 700; }

.profile-sec { margin-bottom: 16px; }
.profile-sec__title {
  font-size: 13px; font-weight: 700; color: var(--text-dim); margin-bottom: 8px;
}
.profile-sec__empty {
  font-size: 14px; color: var(--text-dim);
  background: var(--bg); border-radius: 12px; padding: 12px 14px;
}
.profile-name {
  display: inline-block;
  font-size: 18px; font-weight: 700; color: var(--accent);
  background: var(--accent-soft); border-radius: 12px; padding: 8px 16px;
}
.profile-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-tag { font-size: 14px; padding: 6px 14px; border-radius: 14px; }
.profile-tag--like { color: #2e7d54; background: #e6f4ec; }
.profile-tag--dislike { color: #b04a47; background: #fbe9e8; }
.profile-notes { display: flex; flex-direction: column; gap: 8px; }
.profile-note {
  font-size: 14px; line-height: 1.55; color: var(--text);
  background: var(--bg); border-radius: 12px; padding: 10px 14px;
  word-break: break-word;
}

/* ===================== 个人主页（点头像进入：介绍 + ta 的动态流） ===================== */
.sheet__panel--home { max-height: 88vh; }

/* 头部：大头像 + 名字 + 一句话简介 */
.home-head {
  display: flex; align-items: center; gap: 14px;
  padding-bottom: 16px; margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

/* 相册：详情图缩略图网格 */
.home-album {
  padding-top: 16px; margin-top: 4px;
  border-top: 1px solid var(--line);
}
.home-album__grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px;
}
.home-album__cell {
  aspect-ratio: 1 / 1; border-radius: 10px; cursor: pointer;
  background-size: cover; background-position: center; background-color: var(--accent-soft);
  border: 0; padding: 0;
}
.home-album__cell:active { transform: scale(.97); }
.home-avatar {
  flex: 0 0 auto;
  width: 68px; height: 68px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 30px;
  background: var(--accent);
  background-size: cover; background-position: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
}
.home-avatar--img { color: transparent; }
.home-avatar--tap { cursor: pointer; }
.home-avatar--tap:active { transform: scale(.96); }
.home-id { flex: 1 1 auto; min-width: 0; }
.home-membership {
  width: 100%; display: flex; align-items: center; gap: 11px;
  margin: 12px 0 2px; padding: 13px 14px; border: 1px solid var(--line);
  border-radius: 15px; background: var(--surface); color: var(--text);
  text-align: left; cursor: pointer; font: inherit;
}
.home-membership:active { background: var(--accent-soft); transform: scale(.99); }
.home-membership__icon {
  flex: 0 0 38px; width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 12px; background: #fff0f6; color: #d65791; font-size: 20px;
}
.home-membership__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.home-membership__main strong { font-size: 14px; font-weight: 800; }
.home-membership__main small { color: var(--text-dim); font-size: 11px; line-height: 1.35; }
.home-membership__arrow { flex: 0 0 auto; color: var(--text-dim); font-size: 24px; line-height: 1; }
.home-name {
  font-size: 20px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
}
.home-oneliner {
  margin-top: 6px; font-size: 14px; line-height: 1.5; color: var(--text-dim);
  word-break: break-word;
}
.home-owner {
  margin-top: 6px; font-size: 13px; color: var(--text-dim); opacity: .85;
}

/* 介绍区 */
.home-intro { padding: 16px 0 4px; }
.home-sec { margin-bottom: 16px; }
.home-sec__title {
  font-size: 13px; font-weight: 700; color: var(--text-dim); margin-bottom: 8px;
}
.home-sec__text {
  font-size: 15px; line-height: 1.6; color: var(--text);
  white-space: pre-wrap; word-break: break-word;
}
.home-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.home-tag {
  font-size: 14px; padding: 6px 14px; border-radius: 14px;
  color: var(--accent); background: var(--accent-soft);
}

/* 动态流 */
.home-feed {
  padding-top: 16px; margin-top: 4px;
  border-top: 1px solid var(--line);
}
.home-feed__title { margin-bottom: 12px; }
.home-feed__list { display: block; }
.home-feed__list .sheet-state { padding: 32px 16px; }

/* ===================== 设置 / 我的：行项目 ===================== */
.setgroup {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(31, 35, 48, .05);
  overflow: hidden;
  margin-bottom: 16px;
}
.setrow {
  width: 100%;
  display: flex; align-items: center; gap: 14px;
  padding: 15px 16px;
  border: none; background: transparent;
  text-align: left; cursor: pointer;
  font: inherit; color: var(--text);
}
.setrow + .setrow { border-top: 1px solid var(--line); }
.setrow:active { background: var(--accent-soft); }
.setrow--soon { cursor: default; }
.setrow--soon:active { background: transparent; }
.setrow__icon {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; border-radius: 10px;
  background: var(--accent-soft);
}
.setrow__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.setrow__title { font-size: 15px; font-weight: 600; }
.setrow__sub { font-size: 12px; color: var(--text-dim); }
.setrow__right {
  flex: 0 0 auto; color: var(--text-dim);
  font-size: 18px; line-height: 1;
}
.setrow__badge {
  font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 10px;
  background: #f0f0f4; color: var(--text-dim);
}
.setrow--soon .setrow__title { color: var(--text-dim); }

/* ===================== 动态 Tab：聚合时间线 ===================== */
.agg-timeline { display: flex; flex-direction: column; gap: 12px; }
/* 一条时间线卡：来源形象头部 + 复用的动态条 */
.agg-card {
  background: var(--card, #fff);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
}
.agg-card__head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.agg-card__avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 40px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 16px; cursor: pointer;
  background-size: cover; background-position: center;
}
.agg-card__avatar--img { background-color: var(--accent-soft); }
.agg-card__name {
  font-size: 15px; font-weight: 700; color: var(--text); cursor: pointer;
}
.agg-card__name:active { opacity: .6; }
.agg-card__namecol { min-width: 0; flex: 1 1 auto; cursor: pointer; }
.agg-card__owner {
  margin-top: 2px; font-size: 12px; color: var(--text-dim); opacity: .8;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 「来自 X 主播」可点链接态：点开主播资料页 */
.card__owner--link, .agg-card__owner--link, .home-owner--link {
  cursor: pointer; color: var(--accent); opacity: 1;
}
.card__owner--link:active, .agg-card__owner--link:active,
.home-owner--link:active { opacity: .6; }

/* 主播资料页（creator-sheet）：主播名 + 旗下公开形象列表 */
.creator-head { padding: 4px 0 14px; }
.creator-name { font-size: 20px; font-weight: 700; color: var(--text); }
.creator-sub { margin-top: 4px; font-size: 13px; color: var(--text-dim); }
.creator-clones { display: flex; flex-direction: column; gap: 10px; }
.creator-clone {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; border: 1px solid var(--line, #eee); border-radius: 14px;
  background: var(--card-bg, #fff); cursor: pointer; text-align: left;
}
.creator-clone:active { opacity: .7; }
.creator-clone__avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: 0 0 44px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 17px;
  background-size: cover; background-position: center;
}
.creator-clone__avatar--img { background-color: var(--accent-soft); }
.creator-clone__main { min-width: 0; flex: 1 1 auto; }
.creator-clone__name { font-size: 16px; font-weight: 600; color: var(--text); }
.creator-clone__line {
  margin-top: 2px; font-size: 13px; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.creator-clone__chevron { flex: 0 0 auto; color: var(--text-dim); font-size: 22px; }
/* 卡内的动态条去掉自身底色/外边距，让来源卡作为容器统一视觉 */
.agg-card .feed-item {
  background: transparent; padding: 0; margin-bottom: 0;
}

/* ===================== 关于页 ===================== */
.about-hero {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 24px 0 12px;
}
.about-logo {
  width: 72px; height: 72px; border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 38px; background: var(--accent-soft);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
}
.about-title { font-size: 20px; font-weight: 700; }
.about-ver {
  font-size: 13px; color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.about-desc {
  font-size: 14px; line-height: 1.6; color: var(--text-dim);
  text-align: center; margin: 8px 16px 0;
}

/* ===================== 动态发布（二级抽屉旧样式兼容） ===================== */
.feedauto-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(31, 35, 48, .05);
  padding: 15px 16px; margin-bottom: 16px;
}
.feedauto-row__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.feedauto-row__title { font-size: 15px; font-weight: 600; }
.feedauto-row__sub { font-size: 12px; color: var(--text-dim); }

/* 开关 switch */
.switch {
  flex: 0 0 auto;
  width: 48px; height: 28px; border-radius: 999px;
  border: none; padding: 0; cursor: pointer;
  background: #d8d8e0; position: relative;
  transition: background .2s ease;
}
.switch--on { background: var(--accent); }
.switch__knob {
  position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .2s ease;
}
.switch--on .switch__knob { transform: translateX(20px); }

.feedauto-grouptitle {
  font-size: 13px; font-weight: 600; color: var(--text-dim);
  margin: 4px 2px 10px;
}
.feedauto-cadence { display: flex; gap: 10px; margin-bottom: 12px; }
.cadence-opt {
  flex: 1 1 0;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 12px 6px; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--surface);
  cursor: pointer; font: inherit; color: var(--text);
  transition: border-color .15s ease, background .15s ease;
}
.cadence-opt:disabled { opacity: .5; cursor: default; }
.cadence-opt--on { border-color: var(--accent); background: var(--accent-soft); }
.cadence-opt__label { font-size: 15px; font-weight: 600; }
.cadence-opt__sub { font-size: 11px; color: var(--text-dim); text-align: center; }
.feedauto-tick { width: 100%; margin-top: 6px; }
.feedauto-note {
  font-size: 12px; line-height: 1.5; color: var(--text-dim);
  margin: 10px 2px 0;
}
.feedauto-disabled {
  font-size: 13px; line-height: 1.6; color: var(--text-dim);
  background: var(--accent-soft); border-radius: 14px;
  padding: 14px 16px;
}

/* ===================== 数据看板（二级抽屉） ===================== */
.dash-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-bottom: 18px;
}
.dash-stat {
  background: var(--surface); border-radius: 16px;
  box-shadow: 0 2px 10px rgba(31, 35, 48, .05);
  padding: 16px 14px; text-align: center;
}
.dash-stat__num {
  font-size: 26px; font-weight: 700; color: var(--accent);
  font-variant-numeric: tabular-nums; line-height: 1.2;
}
.dash-stat__label { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

.dash-sec { margin-bottom: 18px; }
.dash-sec__title { font-size: 14px; font-weight: 700; margin-bottom: 12px; }

.dash-bar { margin-bottom: 12px; }
.dash-bar__head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 6px;
}
.dash-bar__label { font-size: 13px; font-weight: 600; }
.dash-bar__val { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.dash-bar__track {
  height: 10px; border-radius: 999px; background: #ececf0; overflow: hidden;
}
.dash-bar__fill {
  height: 100%; border-radius: 999px; background: var(--accent);
  min-width: 2px; transition: width .3s ease;
}
.dash-bar__fill--voice { background: #9333ea; }
.dash-bar__fill--text { background: #2563eb; }

.dash-counts { display: flex; flex-wrap: wrap; gap: 8px; }
.dash-count {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 12px;
  background: var(--surface); box-shadow: 0 1px 6px rgba(31, 35, 48, .05);
  font-size: 13px;
}
.dash-count__name { color: var(--text); }
.dash-count__n {
  font-weight: 700; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.dash-empty { font-size: 13px; color: var(--text-dim); padding: 4px 2px; }

.dash-clones {
  background: var(--surface); border-radius: 16px;
  box-shadow: 0 2px 10px rgba(31, 35, 48, .05); overflow: hidden;
}
.dash-clone {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 13px 16px;
}
.dash-clone + .dash-clone { border-top: 1px solid var(--line); }
.dash-clone__name { font-size: 14px; font-weight: 600; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-clone__meta { font-size: 12px; color: var(--text-dim); flex: 0 0 auto;
  font-variant-numeric: tabular-nums; }

/* ===================== 个人主页：一键沉淀语料 ===================== */
.home-corpus { width: 100%; margin: 14px 0 4px; }

[hidden] { display: none !important; }

/* ===================== Soul-like chat polish ===================== */
.topbar--chat {
  position: relative;
  z-index: 10;
  min-height: calc(var(--safe-top) + 70px);
  padding: calc(var(--safe-top) + 12px) 14px 11px;
  background: linear-gradient(180deg, rgba(9, 11, 28, .96), rgba(9, 11, 28, .72));
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 16px 34px rgba(0, 0, 0, .22);
  backdrop-filter: blur(18px);
}
.topbar--chat::after {
  content: "";
  position: absolute;
  left: 52px;
  right: 54px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(32, 224, 197, .55), transparent);
}
.topbar__avatar {
  width: 46px;
  height: 46px;
  border: 2px solid rgba(255, 255, 255, .55);
  box-shadow: 0 0 0 5px rgba(32, 224, 197, .12), 0 10px 24px rgba(0, 0, 0, .28);
}
.topbar--chat .topbar__namebox {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.topbar--chat .topbar__name {
  max-width: 100%;
  color: #fff;
  font-size: 18px;
}
.chip-soft {
  color: #dcd5ff;
  background: rgba(139, 109, 255, .22);
  border: 1px solid rgba(139, 109, 255, .28);
}
.online {
  color: var(--accent);
}
.online i {
  box-shadow: 0 0 0 5px rgba(32, 224, 197, .12);
}
.iconbtn {
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .78);
}
.intimacy-heart {
  background: rgba(255, 255, 255, .08);
  color: #ff9cc8;
}
.intimacy-heart__ring {
  background:
    linear-gradient(rgba(9, 11, 28, .92), rgba(9, 11, 28, .92)) padding-box,
    conic-gradient(#ff7ab6 calc(var(--intimacy-progress) * 1%), rgba(255, 255, 255, .16) 0) border-box;
}
.iconbtn:active {
  background: rgba(32, 224, 197, .18);
}
.chat-scroll {
  position: relative;
  padding: 18px 14px 12px;
  background:
    radial-gradient(circle at 22% 4%, rgba(32, 224, 197, .18), transparent 27%),
    radial-gradient(circle at 94% 20%, rgba(139, 109, 255, .18), transparent 28%),
    linear-gradient(180deg, rgba(10, 12, 30, .08), transparent);
  scrollbar-width: none;
}
.chat-scroll::-webkit-scrollbar { display: none; }
.chat-scroll::before {
  content: "";
  position: fixed;
  inset: calc(var(--safe-top) + 74px) 0 0;
  pointer-events: none;
  opacity: .18;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.88) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(32,224,197,.8) 0 1px, transparent 1.5px);
  background-size: 58px 58px, 93px 93px;
  background-position: 8px 12px, 38px 44px;
}
.msg {
  position: relative;
  z-index: 1;
  gap: 10px;
}
.msg__avatar {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, .34);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .22);
}
.msg__avatar--user {
  background: linear-gradient(135deg, #ff7ab6, #8b6dff);
}
.bubble {
  max-width: min(76%, 620px);
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, .12);
  font-size: 15.5px;
  line-height: 1.6;
  backdrop-filter: blur(16px);
}
.msg--ai .bubble {
  background: rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .92);
  border-top-left-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
}
.msg--user .bubble {
  background: var(--user-bubble);
  color: #fff;
  border: 0;
  border-top-right-radius: 8px;
  box-shadow: 0 14px 30px rgba(88, 104, 255, .28);
}
.typing .bubble {
  background: rgba(255, 255, 255, .12);
}
.typing__text {
  color: rgba(255, 255, 255, .68);
}

.chat-quick-actions {
  flex: 0 0 auto;
  position: relative;
  z-index: 8;
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 9px 12px 7px;
  background: linear-gradient(180deg, rgba(7, 8, 20, .1), rgba(7, 8, 20, .78));
  scrollbar-width: none;
}
.chat-quick-actions[hidden] { display: none; }
.chat-quick-actions::-webkit-scrollbar { display: none; }
.quick-action {
  flex: 0 0 auto;
  min-width: 74px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .88);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(14px);
}
.quick-action:active { transform: scale(.97); }
.quick-action__icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  background: rgba(32, 224, 197, .16);
  color: var(--accent);
}
.quick-action--feed .quick-action__icon { background: rgba(255, 122, 182, .18); color: #ff9cc8; }
.quick-action--membership .quick-action__icon { background: rgba(255, 201, 92, .18); color: #d79a16; }

.topic-suggestions {
  position: relative;
  z-index: 8;
  padding: 7px 12px 8px;
  background: rgba(7, 8, 20, .82);
  border-top: 1px solid rgba(255, 255, 255, .08);
  backdrop-filter: blur(16px);
}
.topic-suggestions::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 32px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(7, 8, 20, .9));
}
.topic-suggestions__label {
  color: rgba(255, 255, 255, .5);
  align-self: center;
}
.topic-chip {
  border-color: rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .86);
  min-height: 30px;
  display: inline-flex;
  align-items: center;
}
.topic-chip--related {
  border-color: rgba(32, 224, 197, .28);
  background: rgba(32, 224, 197, .12);
  color: #a8fff0;
}
.topic-chip--play {
  border-color: rgba(139, 109, 255, .32);
  background: rgba(139, 109, 255, .18);
  color: #ded8ff;
}

.composer {
  position: relative;
  z-index: 9;
  align-items: center;
  padding: 10px 12px calc(10px + var(--safe-bottom));
  background: rgba(7, 8, 20, .92);
  border-top: 1px solid rgba(255, 255, 255, .09);
  box-shadow: 0 -18px 34px rgba(0, 0, 0, .24);
  backdrop-filter: blur(18px);
}
.composer__input {
  min-height: 44px;
  padding: 11px 15px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 999px;
  background: rgba(255, 255, 255, .09);
  color: #fff;
}
.composer__input::placeholder {
  color: rgba(255, 255, 255, .45);
}
.composer__input:focus {
  background: rgba(255, 255, 255, .13);
  border-color: rgba(32, 224, 197, .34);
}
.composer__mic,
.composer__send {
  width: 44px;
  height: 44px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, .22);
}
.composer__mic {
  background: rgba(255, 255, 255, .09);
  color: var(--accent);
  border: 1px solid rgba(255, 255, 255, .12);
}
.composer__send {
  background: linear-gradient(135deg, #20e0c5, #8b6dff);
}

.voicemsg__bar {
  background: rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .9);
  border: 1px solid rgba(255, 255, 255, .12);
}
.voicemsg__caption {
  background: rgba(32, 224, 197, .12);
  color: rgba(255, 255, 255, .88);
}
.voicemsg__len {
  color: rgba(255, 255, 255, .62);
}

body.chat-only .topbar--chat .topbar__avatar,
body.chat-only .topbar--chat .topbar__namebox {
  cursor: pointer;
}
body.chat-only .topbar--chat .topbar__avatar:active {
  transform: scale(.94);
}

.game-card {
  width: min(328px, calc(100vw - 78px));
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 22px 22px 22px 9px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .08)),
    radial-gradient(circle at 90% 0%, rgba(139, 109, 255, .28), transparent 40%);
  color: rgba(255, 255, 255, .92);
  box-shadow: 0 18px 34px rgba(0, 0, 0, .22);
  backdrop-filter: blur(18px);
}
.game-card__asset {
  width: 56px;
  height: 52px;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .28));
}
.game-card__title {
  color: #fff;
}
.game-card__desc,
.game-card__hint,
.game-card__picked,
.game-card__notice {
  color: rgba(255, 255, 255, .64);
}
.game-card__notice {
  border-top-color: rgba(255, 255, 255, .12);
}
.game-card .game-btn {
  min-height: 36px;
  border-color: rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .9);
}
.game-card .game-btn--primary {
  background: linear-gradient(135deg, rgba(32, 224, 197, .95), rgba(139, 109, 255, .95));
  color: #fff;
  box-shadow: 0 12px 24px rgba(82, 96, 255, .22);
}
.game-card--used {
  opacity: .72;
  filter: saturate(.85);
}

.sheet__mask {
  background: rgba(0, 0, 0, .58);
  backdrop-filter: blur(6px);
}
.sheet__panel {
  background:
    radial-gradient(circle at 18% 0%, rgba(32, 224, 197, .2), transparent 32%),
    radial-gradient(circle at 90% 10%, rgba(139, 109, 255, .2), transparent 32%),
    #101225;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 -24px 54px rgba(0, 0, 0, .38);
}
.sheet__head {
  border-bottom-color: rgba(255, 255, 255, .09);
}
.sheet__title {
  color: #fff;
}
.sheet__subtitle {
  margin-top: 2px;
  color: rgba(255, 255, 255, .55);
  font-size: 12px;
}
.sheet__close {
  color: rgba(255, 255, 255, .62);
}
.sheet__body {
  color: rgba(255, 255, 255, .86);
  scrollbar-width: none;
}
.sheet__body::-webkit-scrollbar { display: none; }
.sheet-state {
  color: rgba(255, 255, 255, .55);
}
.home-head,
.home-feed,
.home-album {
  border-color: rgba(255, 255, 255, .1);
}
.home-name,
.home-sec__text,
.feed-item__content {
  color: rgba(255, 255, 255, .9);
}
.home-oneliner,
.home-owner,
.home-sec__title,
.feed-item__meta {
  color: rgba(255, 255, 255, .56);
}
.home-tag {
  color: #bdfdf3;
  background: rgba(32, 224, 197, .14);
  border: 1px solid rgba(32, 224, 197, .18);
}
.home-avatar {
  border-radius: 24px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, .34);
}
.home-album__cell {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .1);
}
.feed-item {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 18px;
}
.feed-item__voice .minivoice {
  background: rgba(32, 224, 197, .14);
  color: #bdfdf3;
  border: 1px solid rgba(32, 224, 197, .18);
}

@media (min-width: 720px) {
  .page {
    left: 50%;
    width: min(460px, 100vw);
    transform: translateX(-50%);
    border-left: 1px solid rgba(255, 255, 255, .08);
    border-right: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 0 80px rgba(0, 0, 0, .36);
  }
  .toast {
    left: 50%;
    width: min(420px, calc(100vw - 32px));
    transform: translateX(-50%);
  }
}

@media (max-width: 380px) {
  .quick-action {
    min-width: 66px;
    font-size: 12px;
  }
  .bubble {
    max-width: 78%;
    font-size: 15px;
  }
  .topbar--chat .topbar__name {
    font-size: 17px;
  }
}

/* 默认先回到白色聊天背景；上方星空/Soul 深色代码保留，给 body 加 soul-space 可恢复。 */
body:not(.soul-space) {
  background: #fff;
}
body:not(.soul-space) .page {
  background: #fff;
}
body:not(.soul-space) .gate {
  background: #fff;
}
body:not(.soul-space) .topbar--chat {
  min-height: calc(var(--safe-top) + 58px);
  padding: calc(var(--safe-top) + 8px) 12px 8px;
  background: #fff;
  border-bottom: 1px solid rgba(31, 35, 48, .06);
  box-shadow: none;
  backdrop-filter: none;
}
body:not(.soul-space) .topbar--chat::after,
body:not(.soul-space) .chat-scroll::before {
  display: none;
}
body:not(.soul-space) .topbar__avatar {
  width: 38px;
  height: 38px;
  border: 0;
  box-shadow: 0 1px 5px rgba(31, 35, 48, .08);
}
body:not(.soul-space) .topbar--chat .topbar__namebox {
  flex-direction: row;
  align-items: center;
  gap: 6px;
}
body:not(.soul-space) .topbar--chat .topbar__name {
  color: var(--text);
  font-size: 17px;
}
body:not(.soul-space) .chip-soft {
  color: #8a7be0;
  background: #f0ecff;
  border: 0;
}
body:not(.soul-space) .iconbtn {
  background: transparent;
  color: var(--accent);
}
body:not(.soul-space) .intimacy-heart {
  background: #fff0f7;
  color: #d94f8d;
  box-shadow: none;
}
body:not(.soul-space) .intimacy-heart__ring {
  background:
    linear-gradient(#fff0f7, #fff0f7) padding-box,
    conic-gradient(#ff6ea8 calc(var(--intimacy-progress) * 1%), rgba(217, 79, 141, .16) 0) border-box;
}
body:not(.soul-space) .chat-scroll {
  background: #fff;
  scrollbar-width: none;
}
body:not(.soul-space) .msg__avatar {
  border: 0;
  box-shadow: 0 1px 5px rgba(31, 35, 48, .08);
}
body:not(.soul-space) .msg__avatar--user {
  background: linear-gradient(135deg, #7fe0d6, var(--accent));
}
body:not(.soul-space) .bubble {
  border: 0;
  backdrop-filter: none;
}
body:not(.soul-space) .msg--ai .bubble {
  background: var(--ai-bubble);
  color: var(--text);
  box-shadow: none;
}
body:not(.soul-space) .typing .bubble {
  background: var(--ai-bubble);
}
body:not(.soul-space) .typing__text {
  color: var(--text-dim);
}
body:not(.soul-space) .msg--user .bubble {
  background: var(--user-bubble);
  color: #fff;
  box-shadow: 0 4px 10px rgba(21, 194, 177, .18);
}
body:not(.soul-space) .chat-quick-actions {
  background: #fff;
  border-top: 1px solid var(--line);
}
body:not(.soul-space) .quick-action {
  border-color: var(--line);
  background: #f8f8fb;
  color: var(--text);
  backdrop-filter: none;
}
body:not(.soul-space) .quick-action__icon {
  background: var(--accent-soft);
  color: var(--accent);
}
body:not(.soul-space) .quick-action--feed .quick-action__icon {
  background: #fff0f7;
  color: #d94f8d;
}
body:not(.soul-space) .quick-action--membership .quick-action__icon {
  background: #fff6df;
  color: #b57900;
}
body:not(.soul-space) .topic-suggestions {
  background: #fff;
  border-top: 1px solid var(--line);
  backdrop-filter: none;
}
body:not(.soul-space) .topic-suggestions::after {
  background: linear-gradient(90deg, transparent, #fff);
}
body:not(.soul-space) .topic-suggestions__label {
  color: var(--text-dim);
}
body:not(.soul-space) .topic-chip {
  border-color: var(--line);
  background: var(--bg);
  color: var(--text);
}
body:not(.soul-space) .topic-chip--related {
  border-color: rgba(21, 194, 177, .35);
  background: var(--accent-soft);
  color: #0d7d73;
}
body:not(.soul-space) .topic-chip--play {
  border-color: rgba(147, 95, 255, .28);
  background: #f0ecff;
  color: #5b35b1;
}
body:not(.soul-space) .composer {
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: none;
  backdrop-filter: none;
}
body:not(.soul-space) .composer__input {
  border: 0;
  background: #f5f6f8;
  color: var(--text);
}
body:not(.soul-space) .composer__input::placeholder {
  color: var(--text-dim);
}
body:not(.soul-space) .composer__input:focus {
  background: #fff;
  border-color: transparent;
}
body:not(.soul-space) .composer__mic {
  background: var(--accent-soft);
  color: var(--accent);
  border: 0;
  box-shadow: none;
}
body:not(.soul-space) .composer__send {
  background: var(--accent);
  box-shadow: none;
}
body:not(.soul-space) .voicemsg__bar {
  background: var(--ai-bubble);
  color: var(--text);
  border: 0;
}
body:not(.soul-space) .voicemsg__caption {
  background: var(--accent-soft);
  color: var(--text);
}
body:not(.soul-space) .voicemsg__len {
  color: var(--text-dim);
}
body:not(.soul-space) .game-card {
  background: #f7fbfa;
  color: #292d36;
  border-color: rgba(21, 194, 177, .14);
  box-shadow: 0 4px 12px rgba(28, 34, 48, .06);
  backdrop-filter: none;
}
body:not(.soul-space) .game-card__title {
  color: #292d36;
}
body:not(.soul-space) .game-card__desc,
body:not(.soul-space) .game-card__hint,
body:not(.soul-space) .game-card__picked,
body:not(.soul-space) .game-card__notice {
  color: #626a78;
}
body:not(.soul-space) .game-card .game-btn {
  border-color: rgba(103, 112, 132, .12);
  background: rgba(255, 255, 255, .7);
  color: #303642;
}
body:not(.soul-space) .game-card .game-btn--primary {
  background: rgba(21, 194, 177, .16);
  color: #0d7d73;
  box-shadow: none;
}
body:not(.soul-space) .sheet__mask {
  background: rgba(0, 0, 0, .42);
  backdrop-filter: none;
}
body:not(.soul-space) .sheet__panel {
  background: #fff;
  color: var(--text);
  border: 0;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .2);
}
body:not(.soul-space) .sheet__head {
  border-bottom-color: var(--line);
}
body:not(.soul-space) .sheet__title,
body:not(.soul-space) .home-name,
body:not(.soul-space) .home-sec__text,
body:not(.soul-space) .feed-item__content {
  color: var(--text);
}
body:not(.soul-space) .sheet__subtitle,
body:not(.soul-space) .home-oneliner,
body:not(.soul-space) .home-owner,
body:not(.soul-space) .home-sec__title,
body:not(.soul-space) .feed-item__meta,
body:not(.soul-space) .sheet-state {
  color: var(--text-dim);
}
body:not(.soul-space) .sheet__close {
  color: var(--text-dim);
}
body:not(.soul-space) .home-head,
body:not(.soul-space) .home-feed,
body:not(.soul-space) .home-album {
  border-color: var(--line);
}
body:not(.soul-space) .home-tag,
body:not(.soul-space) .feed-item__voice .minivoice {
  color: var(--accent);
  background: var(--accent-soft);
  border: 0;
}
body:not(.soul-space) .home-avatar {
  border-radius: 20px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
}
body:not(.soul-space) .home-album__cell {
  border: 0;
}
body:not(.soul-space) .feed-item {
  background: var(--bg);
  border: 0;
}
@media (min-width: 720px) {
  body:not(.soul-space) .page {
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    box-shadow: 0 0 40px rgba(31, 35, 48, .08);
  }
  .intimacy-pop {
    left: calc(50% + min(230px, 50vw) - 242px);
    right: auto;
  }
}



/* ===================== 店员工作台预览返回 ===================== */
.studio-return-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid rgba(64, 78, 112, .15);
  border-radius: 12px;
  color: #33405f;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 4px 14px rgba(35, 45, 72, .08);
  font-size: 13px;
  cursor: pointer;
}
.studio-return-btn[hidden] { display: none; }
.studio-return-btn span { font-size: 22px; line-height: 1; }
.studio-return-btn b { font-weight: 700; }
.studio-return-btn:active { transform: scale(.96); }
body.studio-preview .topbar--chat { gap: 9px; }

@media (max-width: 430px) {
  .studio-return-btn { min-height: 36px; padding: 0 9px; }
  .studio-return-btn b { display: none; }
  body.studio-preview .topbar--chat .topbar__avatar { width: 38px; height: 38px; }
  body.studio-preview .topbar--chat .topbar__name { font-size: 16px; }
}
