/* chat.css — 对话页（.ct-*）：顶部色块与水印（滚动收缩）、消息、回执与失败重发、照片显影与上传进度、往上翻历史的转圈、输入栏、换色面板、+ 面板、录音浮层（真实音量声波）、入场色块与飞字 */

/* ---------- 页面骨架 ---------- */
.app-view.ct-root {
  --ct-on-soft: var(--c-deep);           /* 浅色底上的强调色（墨色主题浅底是深色，改用 --c-ink） */
  background: var(--bg);
  color: var(--ink);
}
.app-view.ct-root.t-ink { --ct-on-soft: var(--c-ink); }
.ct-main { position: relative; flex: 1 1 auto; min-height: 0; }
.ct-scroll { position: absolute; inset: 0; }
.ct-list {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  min-height: 100%;
  padding: calc(var(--head-h, 158px) + 14px) 22px 18px;
  contain: paint;      /* FLIP/入场位移不撑大滚动区域（否则会误判"不在底部"） */
}

.ct-list:focus-visible { outline-offset: -4px; border-radius: 16px; }

/* 入场/返回时的整屏色块 */
.ct-blob { position: absolute; inset: 0; z-index: 8; background: var(--c-soft); pointer-events: none; }
.app-overlays > .ct-flyer {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 6;
  display: block;
  font-family: var(--font-char);
  line-height: 1;
  white-space: nowrap;
  color: var(--c-deep);
  transform-origin: 0 0;
  pointer-events: none;
  will-change: transform, opacity;
}

/* 我发的消息起飞时的克隆（#overlays 里，不被滚动区裁切；位置由 JS 每帧跟随真实气泡） */
.app-overlays > .ct-fly { position: absolute; inset: 0; z-index: 5; overflow: hidden; pointer-events: none; color: var(--ink); --ct-on-soft: var(--c-deep); }
.app-overlays > .ct-fly.t-ink { --ct-on-soft: var(--c-ink); }
.ct-fly > .ct-row { position: absolute; left: 0; top: 0; margin: 0; will-change: transform; }
.ct-fly .ct-msg { will-change: transform, opacity; }

/* 空聊天 */
.ct-empty {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--head-h, 158px);
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px 24px;
  pointer-events: none;
}
.ct-empty[hidden] { display: none; }
.ct-empty-in { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.ct-empty-char { --size: 76px; opacity: .92; }
.ct-empty-bar { --w: 26px; margin: 2px 0 8px; }
.ct-empty-t { font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--ink); }
.ct-empty-hi { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; pointer-events: auto; }
.ct-hi {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 14px;
  box-shadow: var(--shadow-1);
  transition: background-color var(--dur-2), border-color var(--dur-2), transform var(--dur-1) var(--ease-out);
}
@media (hover: hover) { .ct-hi:hover { border-color: color-mix(in srgb, var(--c-deep) 40%, var(--line)); } }
.ct-hi:active { transform: scale(.96); background: var(--surface-2); }

/* ---------- 顶部色块（往上翻历史时收缩：--p 0→1，由 JS 按离底部距离写入） ---------- */
.ct-head {
  --p: 0;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 8px 22px;
  color: var(--c-ink);
  pointer-events: none;
  transition: color var(--dur-4) var(--ease-in-out);
}
.ct-head-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 0 0 28px 28px;
  background-color: var(--c-soft);
  transform: translate3d(0, calc(var(--p) * var(--cd, 0px) * -1), 0);
  transition: background-color var(--dur-4) var(--ease-in-out);
}
.ct-wipe { position: absolute; inset: 0; background: var(--c-soft); }
.ct-wm {
  position: absolute;
  right: 8px;
  bottom: -16px;
  transform-origin: 100% 100%;
  transform: scale(calc(1 - var(--p) * .45));
  opacity: calc(.22 - var(--p) * .05);
  pointer-events: none;
}
.ct-wm-in {
  display: block;
  font-family: var(--font-char);
  font-size: 150px;
  line-height: 1;
  color: var(--c-wm);
  transform-origin: 50% 85%;
  transition: color var(--dur-4) var(--ease-in-out);
  -webkit-user-select: none;
  user-select: none;
}
.ct-head-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ct-head-bar > button { pointer-events: auto; }
.ct-back { color: inherit; }
.ct-tint {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  margin-right: 6px;
  border: 1px solid var(--c-line);
  border-radius: 10px;
  color: inherit;
  font-size: 13px;
  transition: border-color var(--dur-4) var(--ease-in-out), background-color var(--dur-2), transform var(--dur-1) var(--ease-out);
}
.ct-tint::after { content: ''; position: absolute; inset: -5px -2px; }   /* 触控区补到 44px */
.ct-tint:hover { background: color-mix(in srgb, var(--c-ink) 7%, transparent); }
.ct-tint:active { transform: scale(.95); }
.ct-head-title {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 64px;
  padding: 4px 14px 0;
}
.ct-name {
  align-self: flex-start;
  max-width: 100%;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform-origin: 0 0;
  transform: translate3d(calc(var(--p) * var(--tx, 0px)), calc(var(--p) * var(--ty, 0px)), 0) scale(calc(1 - var(--p) * var(--ts, .43)));
}
.ct-sub {
  font-size: 13px;
  line-height: 1.5;
  white-space: nowrap;
  opacity: calc(1 - var(--p) * 2.4);
  transform: translate3d(0, calc(var(--p) * var(--ty, 0px) * .6), 0);
}
.ct-sub-in { display: inline-flex; align-items: center; }
.ct-sub .ui-typing > i { width: 4px; height: 4px; }
.ct-sub .ui-typing { margin-left: 4px; }
/* 别人换了颜色：状态行临时亮出是谁换的（楷书字 + 一句话） */
.ct-sub-by { display: inline-flex; align-items: center; margin-right: 5px; }
.ct-sub-by .ui-char { --size: 16px; line-height: 1; }
/* 在线小点 */
.ct-online { flex: none; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #3FA45B; box-shadow: 0 0 0 2px color-mix(in srgb, var(--c-soft) 80%, transparent); }

/* 往上翻历史：顶部小转圈 */
.ct-older {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--head-h, 158px) + 8px);
  z-index: 2;
  display: flex;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-8px) scale(.7);
  transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-3) var(--ease-spring);
}
.ct-older.is-on { opacity: 1; transform: none; }
.ct-older-sp {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line);
}
.ct-older-sp::before {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--c-deep) 22%, transparent);
  border-top-color: var(--c-deep);
  animation: ct-spin .8s linear infinite;
}
@keyframes ct-spin { to { transform: rotate(360deg); } }

/* ---------- 消息行 ---------- */
.ct-row { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; transform-origin: 0 50%; }
.ct-row--me { align-items: flex-end; transform-origin: 100% 50%; }
.ct-row--sys, .ct-row--sep { align-items: stretch; transform-origin: 50% 50%; }
.ct-sep { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.ct-sep > i { flex: 1; height: 1px; background: var(--line); }
.ct-sep > span { font-family: var(--font-display); font-size: 12px; line-height: 1.4; letter-spacing: 1px; color: var(--muted); white-space: nowrap; }
.ct-sys { align-self: center; max-width: 88%; padding: 0 8px; font-size: 12px; line-height: 1.6; color: var(--muted); text-align: center; }
.ct-reedit { position: relative; margin-left: 6px; padding: 2px 0; font-size: 12px; color: var(--c-deep); text-decoration: underline; text-underline-offset: 3px; }
.ct-reedit::after { content: ''; position: absolute; inset: -11px -8px; }   /* 触控区补到 44px */
.ct-sys-retry { color: var(--danger); }

.ct-who { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 3px; font-size: 12px; line-height: 1; color: var(--c-deep); }
.ct-who .ui-char { --size: 17px; }
/* 群里几个人同时在打字：楷书字叠在一起 */
.ct-who-chars { display: inline-flex; align-items: center; }
.ct-who-chars > .ui-char + .ui-char { margin-left: -3px; }

/* 我的消息：左侧是发送失败时出现的红圈感叹号（点了重发） */
.ct-line { display: flex; align-items: center; justify-content: flex-end; gap: 8px; width: 100%; min-width: 0; }
.ct-retry {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--danger);
  color: var(--on-danger);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--danger) 35%, transparent);
  transition: transform var(--dur-1) var(--ease-out);
}
.ct-retry::after { content: ''; position: absolute; inset: -11px; }   /* 触控区补到 44px */
.ct-retry[hidden] { display: none; }
.ct-retry:active { transform: scale(.88); }

.ct-msg { position: relative; -webkit-touch-callout: none; }
.ct-msg:focus-visible { outline-offset: 3px; }
.ct-plain {
  max-width: min(290px, 86%);
  border-radius: 6px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ct-bubble {
  max-width: min(250px, 78%);
  padding: 10px 15px;
  border-radius: 14px;
  background: var(--c-soft);
  color: var(--c-ink);
  font-size: 16px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  transform-origin: 100% 100%;
  transition: background-color var(--dur-4) var(--ease-in-out), color var(--dur-4) var(--ease-in-out);
}
.ct-txt { display: block; }
@media (pointer: coarse) {
  .ct-msg { -webkit-user-select: none; user-select: none; }
}

/* 引用 */
.ct-q {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-width: 100%;
  min-width: 0;
  margin: 0 0 6px;
  padding: 2px 0 2px 9px;
  border-left: 2px solid var(--ct-on-soft);
  text-align: left;
  font-size: 13px;
  line-height: 1.45;
  color: inherit;
  opacity: .78;
  transition: border-color var(--dur-4) var(--ease-in-out), opacity var(--dur-2);
}
.ct-q:hover { opacity: 1; }
.ct-q b { font-size: 12px; font-weight: 600; }
.ct-q span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-plain .ct-q { border-left-color: var(--c-deep); color: var(--ink-2); }
.ct-q.is-gone span { font-style: italic; opacity: .8; }

/* 照片（拍立得） */
/* 画面尺寸按原图比例（--ct-pw × --ct-ph，由 JS 写；默认 160×200 = 插画的 4:5） */
.ct-photo { width: calc(var(--ct-pw, 160px) + 12px); max-width: 100%; padding: 6px 6px 20px; text-align: left; transition: width var(--dur-3) var(--ease-out); }
.ct-photo.has-cap { padding-bottom: 6px; }
.ct-photo .ui-polaroid-img, .ct-share .ui-polaroid-img { -webkit-user-drag: none; }
.ct-photo .ui-polaroid-img { height: var(--ct-ph, 200px); }
.ct-frame { position: relative; display: block; overflow: hidden; background: var(--surface-2); }
/* 懒加载：加载前露出底色，加载完淡入 */
.ct-frame > .ui-polaroid-img { transition: opacity var(--dur-3) var(--ease-out), height var(--dur-3) var(--ease-out); }
.ct-frame > .ui-polaroid-img.is-loading { opacity: 0; }
.ct-dev {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FBFAF7;
  color: #8A857D;
  font-size: 12px;
  letter-spacing: 3px;
}
.ct-dev-t { animation: ct-dev 1.3s var(--ease-in-out) infinite; }
@keyframes ct-dev { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
/* 上传进度：拍立得底部一条细线 */
.ct-dev-bar {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  height: 3px;
  border-radius: 2px;
  background: rgba(31, 29, 26, .08);
  overflow: hidden;
  opacity: 0;
  transition: opacity var(--dur-2) var(--ease-out);
}
.ct-dev-bar > i { display: block; height: 100%; border-radius: inherit; background: #8A857D; transform-origin: 0 50%; transform: scaleX(var(--pr, 0)); transition: transform .3s var(--ease-out); }
.ct-dev.has-bar .ct-dev-bar { opacity: 1; }
.ct-dev.is-failed .ct-dev-t { animation: none; opacity: 1; color: #B3261E; letter-spacing: 1px; }

/* 分享（今天） */
.ct-k-share .ct-share { margin: 6px 0 4px 4px; }
.ct-row--me.ct-k-share .ct-share { margin: 6px 4px 4px 0; }
.ct-share { --rot: -1.5deg; width: 196px; padding: 7px 7px 12px; text-align: left; box-shadow: 0 6px 18px rgba(31, 29, 26, .12); }
.ct-row--me .ct-share { --rot: 1.5deg; }
.ct-share .ui-polaroid-img { height: 150px; }
.ct-share .ui-polaroid-cap { padding: 8px 3px 1px; }
.ct-share.no-cap .ui-polaroid-sub { padding-top: 8px; }
.ct-share-blank { display: flex; align-items: center; justify-content: center; height: 110px; background: var(--c-soft); }
.ct-share-blank .ui-char { --size: 56px; }
.ct-photo.ui-pressing, .ct-share.ui-pressing { transform: rotate(var(--rot, 0deg)) scale(.97); }
@media (hover: hover) {
  .ct-photo:hover, .ct-share:hover { box-shadow: 0 10px 26px rgba(31, 29, 26, .18); }
}

/* 语音 */
.ct-voice {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 14px 0 8px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  transition: background-color var(--dur-4) var(--ease-in-out), color var(--dur-4) var(--ease-in-out), transform var(--dur-1) var(--ease-out);
}
.ct-row--me .ct-voice { background: var(--c-soft); color: var(--c-ink); box-shadow: none; }
.ct-voice-ic {
  position: relative;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--c-deep);
  color: var(--c-on-deep);
  transition: background-color var(--dur-4) var(--ease-in-out), transform var(--dur-2) var(--ease-spring);
}
.ct-voice-ic > svg { position: absolute; left: 50%; top: 50%; margin: -6.5px 0 0 -6.5px; transition: opacity var(--dur-2), transform var(--dur-3) var(--ease-spring); }
.ct-voice-ic .ct-vi-play { margin-left: -5.5px; }
.ct-voice-ic .ct-vi-pause { opacity: 0; transform: scale(.4); }
.ct-voice.is-playing .ct-vi-play { opacity: 0; transform: scale(.4); }
.ct-voice.is-playing .ct-vi-pause { opacity: 1; transform: none; }
.ct-voice.is-playing .ct-voice-ic { transform: scale(1.08); }
.t-ink .ct-row--me .ct-voice-ic { background: var(--c-ink); color: var(--c-soft); }
.ct-wave { position: relative; display: flex; align-items: center; gap: 2px; height: 22px; }
.ct-wave > i, .ct-wave-hi > i { flex: none; display: block; width: 3px; height: var(--bh, 50%); border-radius: 2px; background: currentColor; }
.ct-wave > i { opacity: .3; }
.ct-wave-hi { position: absolute; inset: 0; display: flex; align-items: center; gap: 2px; color: var(--ct-on-soft); clip-path: inset(0 100% 0 0); }
.ct-row--them .ct-wave-hi { color: var(--c-deep); }
.ct-voice.is-playing .ct-wave > i, .ct-voice.is-playing .ct-wave-hi > i { animation: ct-bar .7s var(--ease-in-out) infinite alternate; animation-delay: calc(var(--i) * -83ms); }
@keyframes ct-bar { from { transform: scaleY(1); } to { transform: scaleY(.45); } }
.ct-voice-t { min-width: 30px; font-size: 13px; font-variant-numeric: tabular-nums; }

/* 对方正在输入 */
.ct-row--typing { transform-origin: 0 100%; }
.ct-typing {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 14px 14px 14px 6px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--c-deep);
}

/* 喜欢 + 回执（grid 0fr→1fr 折叠） */
.ct-foot { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur-2) var(--ease-out); }
.ct-foot.is-open { grid-template-rows: 1fr; }
.ct-foot-in { min-height: 0; overflow: hidden; display: flex; align-items: center; gap: 8px; margin: 0 -6px; padding: 0 6px; }
.ct-row--me .ct-foot-in { justify-content: flex-end; }
.ct-react { display: inline-flex; align-items: center; gap: 5px; margin-top: 5px; font-size: 12px; line-height: 16px; color: var(--muted); transform-origin: 0 50%; }
.ct-row--me .ct-react { transform-origin: 100% 50%; }
.ct-react .ui-ico { color: var(--c-deep); transition: color var(--dur-4) var(--ease-in-out); }
.ct-receipt { display: inline-block; margin-top: 5px; font-size: 11px; line-height: 16px; color: var(--muted); }
.ct-receipt.is-fail { color: var(--danger); }

/* 跳到被引用的消息时闪一下 */
.ct-row.is-flash > .ct-msg, .ct-row.is-flash > .ct-line > .ct-msg { animation: ct-flash 1.2s var(--ease-out); }
@keyframes ct-flash {
  0%, 35% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--c-deep) 28%, transparent); }
  100% { box-shadow: 0 0 0 5px transparent; }
}

/* 「N 条新消息」 */
.ct-pill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  z-index: 4;
  width: max-content;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px 0 12px;
  border-radius: 999px;
  background: var(--c-deep);
  color: var(--c-on-deep);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-2);
}
.ct-pill::after { content: ''; position: absolute; inset: -4px; }
.ct-pill[hidden] { display: none; }

/* ---------- 输入栏 ---------- */
.ct-composer { position: relative; z-index: 2; flex: none; padding: 6px 12px 12px; }
.ct-card {
  position: relative;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}
.ct-reply { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur-3) var(--ease-out); }
.ct-reply.is-on { grid-template-rows: 1fr; }
.ct-reply-in { min-height: 0; overflow: hidden; }
.ct-reply-box {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 8px 2px 0 12px;
  padding-left: 10px;
  border-left: 3px solid var(--c-deep);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-3) var(--ease-out), border-color var(--dur-4) var(--ease-in-out);
}
.ct-reply.is-on .ct-reply-box { opacity: 1; transform: none; }
.ct-reply-t { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; line-height: 1.4; color: var(--muted); }
.ct-reply-t b { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.ct-reply-t span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-reply-x { color: var(--muted); }
.ct-bar { display: flex; align-items: flex-end; gap: 6px; padding: 6px; }
.ct-plus { color: var(--ink-2); }
.ct-plus .ui-ico { transition: transform var(--dur-3) var(--ease-spring); }
.ct-composer.is-more .ct-plus .ui-ico { transform: rotate(45deg); }
.ct-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  max-height: 128px;
  padding: 10px 4px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  line-height: 24px;
  resize: none;
  outline: none;
  overflow-y: hidden;
  scrollbar-width: none;
}
.ct-input::-webkit-scrollbar { display: none; }
.ct-input:focus-visible { outline: none; }
.ct-card:has(.ct-input:focus) { border-color: color-mix(in srgb, var(--c-deep) 35%, var(--line)); }
.ct-send {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--c-deep);
  color: var(--c-on-deep);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  transition: background-color var(--dur-3) var(--ease-out), color var(--dur-3) var(--ease-out), transform var(--dur-2) var(--ease-spring);
}
.ct-send:active { transform: scale(.92); }
.ct-send.is-mic { background: color-mix(in srgb, var(--c-soft) 75%, transparent); color: var(--ct-on-soft); }
/* 不能录语音时（不支持 / 没权限）：空输入框旁边是一个淡下去的普通发送按钮 */
.ct-send.is-idle { background: color-mix(in srgb, var(--c-soft) 75%, transparent); color: var(--ct-on-soft); }
.ct-send.is-idle .ct-i-send { opacity: .55; }
.ct-send-i { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-3) var(--ease-spring); }
.ct-send .ct-i-mic { opacity: 0; transform: scale(.4) rotate(-30deg); }
.ct-send.is-mic .ct-i-mic { opacity: 1; transform: none; }
.ct-send.is-mic .ct-i-send { opacity: 0; transform: translateY(8px) scale(.5); }
.ct-send.is-rec { transform: scale(1.14); background: var(--c-deep); color: var(--c-on-deep); }
.ct-send.is-rec::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--c-deep);
  opacity: .35;
  animation: ct-ring 1.1s var(--ease-out) infinite;
  z-index: -1;
}
@keyframes ct-ring { from { transform: scale(1); opacity: .4; } to { transform: scale(1.7); opacity: 0; } }

/* 对方已注销：输入栏换成一行淡字，「换色」「+」、语音、快捷问候都收起 */
.ct-gone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 56px;
  padding: 0 16px;
  border-radius: 20px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}
.ct-gone[hidden] { display: none; }
.ct-gone > .ui-ico { flex: none; opacity: .8; }
.ct-root.is-gone .ct-card,
.ct-root.is-gone .ct-more,
.ct-root.is-gone .ct-empty-hi { display: none; }
.ct-root.is-gone .ct-tint { visibility: hidden; pointer-events: none; }

/* + 面板 */
.ct-more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur-3) var(--ease-out); }
.ct-composer.is-more .ct-more { grid-template-rows: 1fr; }
.ct-more-in { min-height: 0; overflow: hidden; }
.ct-more-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 14px 2px 2px; }
.ct-act {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 4px 0;
  border-radius: 14px;
  font-size: 12px;
  color: var(--ink-2);
  opacity: 0;
  transform: translateY(12px) scale(.9);
  transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-3) var(--ease-spring);
}
.ct-composer.is-more .ct-act { opacity: 1; transform: none; }
.ct-composer.is-more .ct-act:nth-child(2) { transition-delay: 35ms; }
.ct-composer.is-more .ct-act:nth-child(3) { transition-delay: 70ms; }
.ct-composer.is-more .ct-act:nth-child(4) { transition-delay: 105ms; }
.ct-act-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  color: var(--c-deep);
  transition: transform var(--dur-1) var(--ease-out), background-color var(--dur-2), color var(--dur-4) var(--ease-in-out);
}
.ct-act:hover .ct-act-ic { background: var(--surface-2); }
.ct-act:active .ct-act-ic { transform: scale(.9); }

/* ---------- 换色面板（底部弹窗，在 #overlays 里） ---------- */
.ct-pal-sub { margin: -4px 0 14px; font-size: 13px; color: var(--muted); }
.ct-pal-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding-bottom: 4px; }
.ct-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 10px 0 8px;
  border-radius: 14px;
  font-size: 12px;
  color: var(--muted);
  transition: background-color var(--dur-2), color var(--dur-2);
}
.ct-swatch:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.ct-swatch[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.ct-swatch-chip {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  width: 44px;
  height: 44px;
  padding: 6px;
  border-radius: 13px;
  background: var(--c-soft);
  box-shadow: inset 0 0 0 1px rgba(31, 29, 26, .08);
  transition: transform var(--dur-3) var(--ease-spring), box-shadow var(--dur-2);
}
.ct-swatch-chip > i { width: 10px; height: 10px; border-radius: 3px; background: var(--c-deep); }
.ct-swatch[aria-pressed="true"] .ct-swatch-chip { box-shadow: inset 0 0 0 1px rgba(31, 29, 26, .08), 0 0 0 2px var(--surface-2), 0 0 0 4px var(--c-deep); }
.ct-swatch:active .ct-swatch-chip { transform: scale(.88); }

/* ---------- 按住说话浮层（在 #overlays 里） ---------- */
.app-overlays > .ct-rec {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 128px;
  background: linear-gradient(to top, var(--scrim), transparent 72%);
  pointer-events: none;
}
.ct-rec-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 196px;
  padding: 18px 16px 14px;
  border-radius: 24px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-2);
  transition: background-color var(--dur-2), color var(--dur-2), transform var(--dur-3) var(--ease-spring);
}
.ct-rec.is-cancel .ct-rec-card { background: var(--danger); color: var(--on-danger); transform: translateY(-10px) scale(1.04); }
.ct-rec-ic { position: relative; width: 20px; height: 20px; color: var(--c-deep); }
.ct-rec-ic > svg { position: absolute; inset: 0; transition: opacity var(--dur-2), transform var(--dur-3) var(--ease-spring); }
.ct-rec-ic > svg:last-child { opacity: 0; transform: scale(.4); }
.ct-rec.is-cancel .ct-rec-ic { color: inherit; }
.ct-rec.is-cancel .ct-rec-ic > svg:first-child { opacity: 0; transform: scale(.4); }
.ct-rec.is-cancel .ct-rec-ic > svg:last-child { opacity: 1; transform: none; }
.ct-rec-wave { display: flex; align-items: center; gap: 3px; height: 34px; color: var(--c-deep); }
.ct-rec.is-cancel .ct-rec-wave { color: inherit; opacity: .6; }
.ct-rec-wave > i {
  display: block;
  width: 4px;
  height: 100%;
  border-radius: 2px;
  background: currentColor;
  transform: scaleY(.2);
  animation: ct-rec-bar .62s var(--ease-in-out) infinite alternate;
  animation-delay: calc(var(--i) * -97ms);
}
@keyframes ct-rec-bar { from { transform: scaleY(.16); } to { transform: scaleY(var(--s, .9)); } }
/* 打开麦克风中：声波淡一些、慢一些 */
.ct-rec.is-starting .ct-rec-wave { opacity: .4; }
.ct-rec.is-starting .ct-rec-wave > i { animation-duration: 1.1s; }
/* 真实音量驱动（JS 每 ~70ms 写 transform） */
.ct-rec.is-live .ct-rec-wave > i { animation: none; transform: scaleY(.12); transition: transform 90ms linear; }
.ct-rec-time { font-family: var(--font-display); font-size: 22px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; transition: color var(--dur-2); }
.ct-rec-time.is-warn { color: var(--c-deep); }
.ct-rec.is-cancel .ct-rec-time.is-warn { color: inherit; }
.ct-rec-hint { font-size: 12px; color: var(--muted); transition: color var(--dur-2); }
.ct-rec.is-cancel .ct-rec-hint { color: inherit; }
