/* 聊天框页：顶栏 / 消息气泡 / 底栏 / 通话页 / 消息菜单 / 弹层（原 index.html 第 1912-2814 行） */

/* ============================================================
   聊天框页：顶栏 / 消息区 / 底栏（输入行 + 功能行）
   ============================================================ */
.talk-view{
  background:var(--bg);
  background-size:cover; background-position:center; background-repeat:no-repeat;
}
/* 顶栏透明：能透出下面的壁纸 */
.talk-head{
  flex:0 0 auto;
  position:relative;
  display:flex; align-items:center; gap:2px;
  padding:var(--head-top) 10px 5px;
  border-bottom:none;
  background:transparent;
}
.talk-head .back-btn{ width:32px; height:32px; }
.talk-head .back-btn svg{ width:20px; height:20px; }
.talk-head .talk-calllog-btn{ margin-left:auto; }
.talk-title{
  position:absolute; left:50%; top:50%;
  transform:translate(-50%,-50%);
  max-width:52%;
  text-align:center;
  font-size:15.5px; font-weight:600;
  margin:0;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  pointer-events:none;
}
/* 顶栏右侧两个图标：离线长文本 / 更多 */
.talk-head .icon-btn{ width:32px; height:32px; }
.talk-more svg{ width:20px; height:20px; }
.talk-offline-btn svg{ width:19px; height:19px; }
.talk-offline-btn.on{ color:var(--accent); }
.talk-calllog-btn svg{ width:19px; height:19px; }

/* ============ 通话页（语音 / 视频，全屏覆盖层） ============ */
.call-screen{
  position:absolute; inset:0;
  z-index:96;
  display:none;
  flex-direction:column;
  background:#141418;
  color:#fff;
  padding-top:env(safe-area-inset-top);
  overflow:hidden;
}
.call-screen.show{ display:flex; animation:viewIn .3s var(--ease-out) both; }
.call-screen.video::before{
  content:'';
  position:absolute; inset:0;
  background:var(--call-bg) center/cover no-repeat;
  filter:blur(28px) brightness(.45);
  transform:scale(1.15);
  z-index:0;
}
.call-screen > *{ position:relative; z-index:1; }
.call-head{
  flex:0 0 auto;
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 12px 0;
}
.call-mode-tag{
  font-size:12px; color:rgba(255,255,255,.7);
  background:rgba(255,255,255,.12);
  padding:5px 12px; border-radius:999px;
}
.call-mini-btn{
  width:38px; height:38px;
  border:none; border-radius:50%;
  background:rgba(255,255,255,.12); color:#fff;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
}
.call-mini-btn svg{ width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
.call-hero{
  flex:0 0 auto;
  display:flex; flex-direction:column; align-items:center;
  padding:22px 20px 10px;
}
.call-avatar, .call-avatar-initial{
  width:96px; height:96px; border-radius:32px;
  object-fit:cover;
  box-shadow:0 14px 34px rgba(0,0,0,.4);
}
.call-avatar-initial{
  display:flex; align-items:center; justify-content:center;
  background:#2A2A32; color:#fff;
  font-size:38px; font-weight:600;
}
.call-screen.ringing .call-avatar,
.call-screen.ringing .call-avatar-initial{ animation:callPulse 1.6s ease-in-out infinite; }
@keyframes callPulse{
  0%,100%{ transform:scale(1); }
  50%{ transform:scale(1.05); }
}
.call-name{ margin-top:14px; font-size:19px; font-weight:600; }
.call-status{
  margin-top:5px;
  font-size:13px; color:rgba(255,255,255,.62);
  font-variant-numeric:tabular-nums;
}
.call-body{
  flex:1; min-height:0;
  overflow-y:auto;
  padding:8px 20px 12px;
  display:flex; flex-direction:column; gap:10px;
}
.call-body::-webkit-scrollbar{ width:0; }
.call-line{
  font-size:14.5px; line-height:1.65;
  color:rgba(255,255,255,.92);
  word-break:break-word; white-space:pre-wrap;
  animation:msgIn .3s var(--ease-out) both;
}
.call-line.me{ color:rgba(255,255,255,.62); text-align:right; }
.call-line b{ font-weight:600; opacity:.7; margin-right:6px; font-size:12.5px; }
.call-line.aside{
  align-self:center;
  text-align:center;
  font-size:12.5px; font-style:italic;
  color:rgba(255,255,255,.55);
  background:rgba(255,255,255,.08);
  padding:6px 14px; border-radius:12px;
}
.call-line.sys{ align-self:center; font-size:12px; color:rgba(255,255,255,.45); }
.call-empty{
  margin:auto; text-align:center;
  font-size:13px; color:rgba(255,255,255,.4);
  line-height:1.8;
}
.call-typing{ display:flex; gap:4px; padding:4px 0; }
.call-typing span{
  width:6px; height:6px; border-radius:50%;
  background:rgba(255,255,255,.6);
  animation:typingDot 1.1s ease-in-out infinite;
}
.call-typing span:nth-child(2){ animation-delay:.16s; }
.call-typing span:nth-child(3){ animation-delay:.32s; }
@keyframes typingDot{ 0%,80%,100%{ opacity:.3; transform:translateY(0); } 40%{ opacity:1; transform:translateY(-3px); } }
.call-foot{
  flex:0 0 auto;
  padding:10px 16px calc(16px + env(safe-area-inset-bottom));
  display:flex; flex-direction:column; gap:12px;
}
.call-input-row{ display:flex; align-items:flex-end; gap:8px; }
.call-input{
  flex:1; min-width:0;
  border:none; outline:none; resize:none;
  background:rgba(255,255,255,.12);
  color:#fff;
  font-family:inherit; font-size:14.5px; line-height:1.5;
  padding:11px 14px;
  border-radius:18px;
  max-height:96px;
}
.call-input::placeholder{ color:rgba(255,255,255,.4); }
.call-act-btn{
  flex:0 0 auto;
  height:42px; padding:0 15px;
  border:none; border-radius:999px;
  background:rgba(255,255,255,.14); color:#fff;
  font-family:inherit; font-size:13.5px; font-weight:500;
  cursor:pointer;
  transition:transform .18s var(--spring), background .18s;
}
.call-act-btn:active{ transform:scale(.94); }
.call-act-btn.primary{ background:#fff; color:#0B0B0F; }
.call-btn-row{ display:flex; align-items:center; justify-content:center; gap:46px; }
.call-round{
  display:flex; flex-direction:column; align-items:center; gap:7px;
  border:none; background:transparent; color:rgba(255,255,255,.8);
  font-family:inherit; font-size:12px;
  cursor:pointer;
}
.call-round i{
  width:62px; height:62px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:rgba(255,255,255,.14);
  transition:transform .18s var(--spring);
}
.call-round:active i{ transform:scale(.92); }
.call-round i svg{ width:28px; height:28px; fill:none; stroke:#fff; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
.call-round.hang i{ background:var(--danger); }
.call-round.answer i{ background:#34C759; }
.call-screen.ringing .call-input-row{ display:none; }
.call-screen.ringing .call-body{ display:none; }
.call-screen.ringing .call-hero{ flex:1; justify-content:center; }
.call-screen:not(.incoming) .call-round.answer{ display:none; }
.call-screen:not(.incoming) .call-round.reject{ display:none; }
.call-screen.incoming .call-round.hang{ display:none; }

/* 缩小后的小窗：右上角悬浮 */
.call-mini{
  position:absolute;
  top:calc(58px + env(safe-area-inset-top)); right:12px;
  z-index:95;
  display:none;
  align-items:center; gap:8px;
  padding:6px 12px 6px 6px;
  border:none; border-radius:999px;
  background:#141418; color:#fff;
  box-shadow:0 12px 30px rgba(0,0,0,.28);
  cursor:pointer;
  font-family:inherit;
  animation:viewIn .3s var(--ease-out) both;
}
.call-mini.show{ display:flex; }
.call-mini img, .call-mini .call-mini-ico, .call-mini .call-mini-initial{
  width:34px; height:34px; border-radius:50%;
  object-fit:cover;
  display:flex; align-items:center; justify-content:center;
  background:rgba(255,255,255,.14);
  font-size:14px; font-weight:600;
}
.call-mini .call-mini-ico svg{ width:18px; height:18px; fill:none; stroke:#fff; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
.call-mini.ringing .call-mini-ico,
.call-mini.ringing img, .call-mini.ringing .call-mini-initial{ animation:callPulse 1.4s ease-in-out infinite; }
.call-mini-text{ display:flex; flex-direction:column; line-height:1.25; }
.call-mini-text b{ font-size:12px; font-weight:600; max-width:90px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.call-mini-text span{ font-size:11px; color:rgba(255,255,255,.62); font-variant-numeric:tabular-nums; }

/* 聊天框里的通话卡片 */
.msg-call{ display:flex; align-items:center; gap:10px; min-width:150px; cursor:pointer; }
.msg-call svg{ width:20px; height:20px; flex:0 0 auto; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.msg-call span{ font-size:13.5px; }
.msg-call small{ display:block; font-size:11px; opacity:.6; margin-top:2px; }

/* 通话记录页 */
.calllog-tabs{ display:flex; gap:3px; margin:14px 18px 12px; background:var(--fill); border-radius:14px; padding:3px; }
.calllog-item{ margin:0 18px 10px; background:var(--fill); border-radius:20px; overflow:hidden; }
.calllog-head{
  display:flex; align-items:center; gap:12px;
  width:100%;
  padding:14px 16px;
  border:none; background:transparent;
  font-family:inherit; text-align:left;
  cursor:pointer;
}
.calllog-ico{
  width:36px; height:36px; border-radius:12px; flex:0 0 auto;
  background:var(--bg);
  display:flex; align-items:center; justify-content:center;
}
.calllog-ico svg{ width:18px; height:18px; fill:none; stroke:var(--ink); stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.calllog-item.missed .calllog-ico svg{ stroke:var(--danger); }
.calllog-word{ flex:1; min-width:0; }
.calllog-word b{ display:block; font-size:14px; font-weight:500; }
.calllog-word span{ display:block; font-size:11.5px; color:var(--gray-2); margin-top:3px; }
.calllog-arrow{ width:16px; height:16px; flex:0 0 auto; fill:none; stroke:var(--gray-2); stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; transition:transform .2s; }
.calllog-item.open .calllog-arrow{ transform:rotate(90deg); }
.calllog-lines{ display:none; padding:2px 16px 14px; }
.calllog-item.open .calllog-lines{ display:block; }
.calllog-line{ font-size:13px; line-height:1.65; color:var(--ink); padding:4px 0; white-space:pre-wrap; word-break:break-word; }
.calllog-line + .calllog-line{ box-shadow:inset 0 1px 0 rgba(11,11,15,.05); }
.calllog-line b{ font-weight:600; color:var(--gray-1); margin-right:6px; }
.calllog-line.aside{ color:var(--gray-1); font-style:italic; text-align:center; }
.calllog-line.none{ color:var(--gray-2); text-align:center; }
.calllog-empty{ text-align:center; font-size:13px; color:var(--gray-2); line-height:1.8; padding:40px 20px; }

/* 表情包分组多选 */
.stk-pick{ display:flex; flex-wrap:wrap; gap:8px; padding:6px 16px 14px; }
.stk-pick button{
  border:none; border-radius:999px;
  background:var(--bg); color:var(--gray-1);
  font-family:inherit; font-size:12.5px; font-weight:500;
  padding:7px 13px;
  cursor:pointer;
}
.stk-pick button.on{ background:var(--ink); color:#fff; }
.stk-pick .stk-none{ font-size:12px; color:var(--gray-2); padding:4px 0; }

/* 消息区 */
.talk-body{
  flex:1; min-height:0;
  overflow-y:auto;
  overscroll-behavior:contain;
  padding:18px 16px 10px;
  display:flex; flex-direction:column; gap:14px;
  background:transparent;
}
.talk-body::-webkit-scrollbar{ width:0; }
/* 时间戳：两条消息相隔 5 分钟以上时出现 */
.msg-stamp{
  align-self:center;
  font-size:11px; color:var(--gray-2);
  background:rgba(11,11,15,.05);
  padding:4px 12px;
  border-radius:999px;
}
/* 旁白：类似时间戳 / 系统框，居中浅底 */
.msg-aside{
  align-self:center;
  max-width:86%;
  text-align:center;
  font-size:12.5px; color:var(--gray-1);
  line-height:1.65;
  background:rgba(11,11,15,.06);
  padding:7px 14px;
  border-radius:12px;
  white-space:pre-wrap; word-break:break-word;
  animation:msgIn .3s var(--ease-out) both;
}
.msg-aside.picked{ outline:2px solid var(--ink); }
/* 撤回提示 */
.msg-recall{
  align-self:center;
  font-size:11.5px; color:var(--gray-2);
  padding:3px 12px;
}
/* 线下模式：长篇小说式正文（不走气泡） */
.msg-novel{
  width:100%; max-width:100%;
  padding:16px 18px;
  background:rgba(255,255,255,.82);
  border-radius:18px;
  font-size:13.5px; line-height:1.9; color:var(--ink);
  white-space:pre-wrap; word-break:break-word;
  text-align:justify;
}
.msg.mine .msg-novel{
  background:rgba(11,11,15,.05);
  font-style:italic;
}
/* ============ 线下页（独立视图：小说式正文） ============ */
.off-view{
  background-color:var(--sk-off-bg, #F5F1EA);
  background-size:cover; background-position:center;
}
.off-head{
  flex:0 0 auto;
  display:flex; align-items:center; gap:6px;
  padding:calc(var(--head-top) + env(safe-area-inset-top)) 10px 8px;
  background:rgba(247,244,238,.86);
  -webkit-backdrop-filter:blur(14px); backdrop-filter:blur(14px);
  border-bottom:1px solid var(--hairline);
}
.off-head .back-btn{ flex:0 0 auto; }
.off-title{
  flex:1; min-width:0;
  margin:0; text-align:center;
  font-size:15px; font-weight:600; letter-spacing:.02em;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.off-head .icon-btn{ width:32px; height:32px; flex:0 0 auto; }
.off-set-btn svg{ width:19px; height:19px; }
.off-hist-btn svg{ width:19px; height:19px; }
.off-end-btn svg{ width:19px; height:19px; }
.off-end-btn{ color:var(--danger); }
.off-end-btn:disabled, .off-hist-btn:disabled{ opacity:.4; }
.off-body{
  flex:1; min-height:0;
  overflow-y:auto;
  overscroll-behavior:contain;
  padding:18px 18px 12px;
  display:flex; flex-direction:column; gap:14px;
}
.off-body::-webkit-scrollbar{ width:0; }
.off-empty{
  margin:auto 0;
  padding:26px 22px;
  text-align:center;
  font-size:13px; line-height:1.85; color:var(--gray-1);
  background:rgba(255,255,255,.7);
  border-radius:20px;
}
.off-empty b{ display:block; margin-bottom:8px; font-size:15px; color:var(--ink); }
/* 正文段：TA 的段落是小说正文，我的段落是斜体动作 */
.off-entry{
  width:100%;
  padding:16px 18px;
  border-radius:var(--sk-off-radius, 18px);
  font-size:var(--sk-off-font, 14px); line-height:1.95; color:var(--sk-off-ink, var(--ink));
  white-space:pre-wrap; word-break:break-word;
  text-align:justify;
  animation:msgIn .3s var(--ease-out) both;
}
.off-entry.off-novel{ background:rgba(255,255,255,var(--sk-off-alpha, .84)); }
.off-entry.off-me{
  background:rgba(11,11,15,calc(var(--sk-off-alpha, .84) * .08));
  font-style:italic; color:var(--gray-1);
}
.off-entry.off-writing{ display:flex; align-items:center; min-height:52px; }
/* 段落上方的头像 / 网名：默认隐藏，由美化开关（.off-view 上的 class）控制 */
.off-meta{ display:none; align-items:center; gap:8px; margin-bottom:8px; white-space:normal; font-style:normal; }
.off-view.off-show-avatar .off-meta, .off-view.off-show-name .off-meta{ display:flex; }
.off-meta-avatar{ width:28px; height:28px; border-radius:50%; object-fit:cover; display:none; background:var(--fill); }
.off-meta-name{ font-size:12px; font-weight:600; color:var(--sk-off-accent, #C0392B); display:none; }
.off-view.off-show-avatar .off-meta-avatar{ display:block; }
.off-view.off-show-name .off-meta-name{ display:inline; }
.off-entry.off-me .off-meta-name{ color:var(--gray-1); }
/* 正文美化：台词 / 心理 / 强调 / 环境 */
.off-say{ font-weight:600; color:var(--sk-off-accent, #C0392B); font-style:normal; }
.off-think{ font-style:italic; color:var(--gray-1); }
.off-em{ font-weight:700; text-decoration:underline; text-decoration-thickness:1px; text-underline-offset:3px; }
.off-env{ font-size:12.5px; color:var(--gray-2); }
/* 每个楼层：长按 / 右键弹出的操作菜单（复用 .msg-menu 的样式） */
.off-entry.off-picked{ outline:2px solid var(--ink); outline-offset:-2px; }
.off-body.selecting .off-entry{ cursor:pointer; position:relative; padding-left:44px; }
.off-body.selecting .off-entry::before{
  content:'';
  position:absolute; left:14px; top:18px;
  width:19px; height:19px; border-radius:50%;
  border:1.6px solid var(--gray-3);
  background:transparent;
}
.off-body.selecting .off-entry.off-picked::before{
  background:var(--ink); border-color:var(--ink);
  background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:center; background-size:12px;
}
.off-select-bar{ flex:0 0 auto; }
/* 楼层内联编辑框 */
.off-edit-area{
  width:100%; min-height:120px;
  border:none; outline:none; resize:vertical;
  background:rgba(255,255,255,.95);
  border-radius:14px;
  padding:12px 14px;
  font-family:inherit; font-size:14px; line-height:1.9; color:var(--ink);
  box-shadow:0 0 0 1.5px var(--ink);
}
.off-edit-acts{ display:flex; gap:8px; justify-content:flex-end; margin-top:8px; }
.off-edit-acts button{
  border:none; border-radius:999px;
  padding:7px 16px;
  font-family:inherit; font-size:12.5px; font-weight:500;
  background:rgba(11,11,15,.06); color:var(--gray-1);
  cursor:pointer;
}
.off-edit-acts button.primary{ background:var(--ink); color:#fff; }
/* 回复建议面板：4 个方向，点一下填进输入框 */
.off-replies{
  display:grid; grid-template-columns:1fr 1fr; gap:6px;
  animation:msgIn .25s var(--ease-out) both;
}
.off-replies[hidden]{ display:none; }
.off-reply{
  border:none; text-align:left;
  background:rgba(255,255,255,.9);
  border-radius:14px;
  padding:9px 11px;
  font-family:inherit; font-size:12px; line-height:1.55; color:var(--ink);
  cursor:pointer;
  transition:transform .18s var(--spring);
}
.off-reply:active{ transform:scale(.97); }
.off-reply b{ display:block; font-size:10.5px; color:var(--gray-2); margin-bottom:2px; font-weight:500; }
.off-reply span{
  display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden;
}
.off-act.on{ background:var(--ink); color:#fff; }
/* 过往记录卡 */
.off-hist-card{
  background:var(--fill);
  border-radius:18px;
  padding:13px 16px;
  margin-bottom:10px;
}
.off-hist-head{ display:flex; align-items:center; gap:10px; cursor:pointer; }
.off-hist-head b{ flex:1; min-width:0; font-size:13.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.off-hist-head small{ flex:0 0 auto; font-size:11px; color:var(--gray-2); }
.off-hist-body{
  margin-top:10px; padding-top:10px;
  border-top:1px solid var(--hairline);
  font-size:12.5px; line-height:1.85; color:var(--ink);
  white-space:pre-wrap; word-break:break-word;
  max-height:50vh; overflow-y:auto;
}
.off-hist-body[hidden]{ display:none; }
.off-hist-acts{ display:flex; gap:8px; margin-top:10px; }
.off-hist-acts button{
  flex:1; height:34px;
  border:1px solid var(--hairline); border-radius:12px;
  background:var(--bg); color:var(--gray-1);
  font-family:inherit; font-size:12.5px; font-weight:500;
  cursor:pointer;
}
.off-hist-acts button.danger{ color:var(--danger); }
.off-hist-empty{ font-size:12.5px; color:var(--gray-3); text-align:center; padding:40px 0; }
/* 文风预设列表 */
.off-style-row{
  display:flex; align-items:center; gap:8px;
  padding:9px 12px;
  background:var(--bg);
  border-radius:12px;
  margin-bottom:6px;
}
.off-style-row .name{
  flex:1; min-width:0;
  border:none; background:transparent; text-align:left;
  font-family:inherit; font-size:13px; color:var(--ink);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  cursor:pointer;
}
.off-style-row .sub{ flex:0 0 auto; font-size:11px; color:var(--gray-2); max-width:38%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.off-style-row .del{
  flex:0 0 auto;
  border:none; background:transparent;
  font-family:inherit; font-size:12px; color:var(--danger);
  padding:4px 6px; cursor:pointer;
}
.off-dots{ display:inline-flex; gap:5px; }
.off-dots span{
  width:6px; height:6px; border-radius:50%;
  background:var(--gray-2);
  animation:offDot 1.1s ease-in-out infinite;
}
.off-dots span:nth-child(2){ animation-delay:.18s; }
.off-dots span:nth-child(3){ animation-delay:.36s; }
@keyframes offDot{ 0%,80%,100%{ opacity:.25; transform:translateY(0); } 40%{ opacity:1; transform:translateY(-3px); } }
/* 底栏：输入行 + 三个动作键 */
.off-foot{
  flex:0 0 auto;
  padding:8px 12px calc(8px + env(safe-area-inset-bottom));
  display:flex; flex-direction:column; gap:8px;
  background:rgba(247,244,238,.86);
  -webkit-backdrop-filter:blur(14px); backdrop-filter:blur(14px);
  border-top:1px solid var(--hairline);
}
.off-foot .talk-input{ background:rgba(255,255,255,.9); max-height:120px; }
.off-actions{ display:flex; gap:8px; }
.off-act{
  flex:1; min-width:0;
  display:flex; align-items:center; justify-content:center; gap:5px;
  height:34px;
  border:none; border-radius:999px;
  background:rgba(11,11,15,.06);
  color:var(--gray-1);
  font-family:inherit; font-size:12px;
  cursor:pointer;
  transition:transform .18s var(--spring), opacity .18s;
}
.off-act:active{ transform:scale(.96); }
.off-act:disabled{ opacity:.4; cursor:default; }
.off-act.danger{ color:var(--danger); }
.off-act svg{
  width:15px; height:15px; flex:0 0 auto;
  fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round;
}
.off-act span{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* 线下归档卡：结束线下后收纳成一张可展开的卡片 */
.msg-novelpack{
  width:100%;
  padding:13px 16px;
  background:var(--fill);
  border:1px dashed rgba(11,11,15,.18);
  border-radius:16px;
  cursor:pointer;
}
.msg-novelpack b{ display:block; font-size:13px; }
.msg-novelpack small{ display:block; margin-top:3px; font-size:11px; color:var(--gray-2); }
.msg-novelpack .np-body{
  margin-top:10px; padding-top:10px;
  border-top:1px solid var(--hairline);
  font-size:12.5px; line-height:1.85;
  white-space:pre-wrap; word-break:break-word;
}
.msg-novelpack .np-body[hidden]{ display:none; }
.msg.msg-novelpack{ text-align:left; color:var(--ink); }
.msg.msg-novelpack .np-body{ max-height:46vh; overflow-y:auto; }
/* 群聊：发言人名字显示在气泡上方 */
.msg-who{
  display:block;
  font-size:10.5px; color:var(--gray-2);
  margin:0 0 3px 2px;
}
/* 表情包消息：没有任何气泡效果 */
.msg-sticker{
  max-width:73%;
  padding:0; background:transparent; box-shadow:none;
}
.msg-sticker .sticker-cap{
  display:block; margin-top:3px;
  font-size:11px; color:var(--gray-2);
  text-align:center;
  max-width:120px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.msg-sticker img{
  display:block;
  width:120px; height:120px; object-fit:contain;
}
.talk-empty{
  margin:auto;
  text-align:center;
  font-size:13px; color:var(--gray-2);
  line-height:1.8;
}
.msg-day{
  align-self:center;
  font-size:11px; color:var(--gray-2);
  background:rgba(11,11,15,.05);
  padding:4px 12px;
  border-radius:999px;
}
.msg{
  display:flex; align-items:flex-end; gap:9px;
  max-width:100%;
  animation:msgIn .3s var(--ease-out) both;
}
@keyframes msgIn{
  from{ opacity:0; transform:translateY(8px); }
  to  { opacity:1; transform:none; }
}
.msg.mine{ flex-direction:row-reverse; }
.msg.msg-aside{ display:block; max-width:86%; align-self:center; }
.msg-avatar{
  flex:0 0 auto;
  width:38px; height:38px;
  border-radius:50%;
  object-fit:cover;
  background:var(--fill);
}
.msg-avatar-initial{
  flex:0 0 auto;
  width:38px; height:38px;
  border-radius:50%;
  background:var(--fill); color:var(--ink);
  display:flex; align-items:center; justify-content:center;
  font-size:15px; font-weight:600;
}
.msg-bubble{
  max-width:73%;
  padding:8px 11px;
  border-radius:20px;
  font-size:14.5px;
  line-height:1.62;
  color:var(--ink);
  background:var(--fill);
  border-bottom-left-radius:7px;
  white-space:pre-wrap;
  word-break:break-word;
  box-shadow:0 1px 2px rgba(0,0,0,.04);
}
.msg.mine .msg-bubble{
  background:var(--ink); color:#fff;
  border-bottom-left-radius:20px;
  border-bottom-right-radius:7px;
}
/* 输入中的省略号气泡 */
.msg-typing{ display:flex; gap:5px; padding:14px; }
.msg-typing span{
  width:7px; height:7px; border-radius:50%;
  background:var(--gray-3);
  animation:dotJump 1.05s infinite;
}
.msg-typing span:nth-child(2){ animation-delay:.16s; }
.msg-typing span:nth-child(3){ animation-delay:.32s; }
@keyframes dotJump{
  0%,60%,100%{ transform:translateY(0); opacity:.55; }
  30%{ transform:translateY(-5px); opacity:1; }
}

/* ============ 底栏：上行输入 / 下行功能键 ============ */
.talk-foot{
  flex:0 0 auto;
  background:transparent;           /* 底栏透明：透出壁纸 */
  border-top:none;
  padding:12px 12px calc(0px + env(safe-area-inset-bottom));   /* 输入栏整体往下几像素 */
  display:flex; flex-direction:column; gap:8px;
}
/* 表情包面板 */
.sticker-panel{
  display:flex; flex-direction:column; gap:8px;
  padding:6px 0 2px;
  animation:msgIn .26s var(--ease-out) both;
}
.sticker-panel[hidden]{ display:none; }
.sticker-groups{
  display:flex; align-items:center; gap:6px;
  overflow-x:auto; padding:0 2px;
}
.sticker-groups::-webkit-scrollbar{ height:0; }
.sticker-group-btn{
  flex:0 0 auto;
  border:none; background:var(--fill);
  color:var(--gray-1);
  font-family:inherit; font-size:12px;
  padding:6px 12px; border-radius:999px;
  cursor:pointer; white-space:nowrap;
}
.sticker-group-btn.on{ background:var(--ink); color:#fff; }
.sticker-group-btn.tool{ background:transparent; color:var(--gray-2); padding:6px 8px; }
.sticker-grid{
  display:grid;
  grid-template-columns:repeat(4, 1fr);
  gap:8px;
  max-height:212px; overflow-y:auto;
  padding:2px;
}
.sticker-grid::-webkit-scrollbar{ width:0; }
.sticker-cell{
  aspect-ratio:1;
  border:none; background:rgba(11,11,15,.035);
  border-radius:14px;
  padding:6px; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  transition:transform .18s var(--spring), background .18s;
  -webkit-user-select:none; user-select:none;
  -webkit-touch-callout:none;
}
.sticker-cell:active{ transform:scale(.92); }
.sticker-cell{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; }
.sticker-cell img{ width:100%; flex:1; min-height:0; object-fit:contain; display:block; pointer-events:none; }
/* 表情包配字：显示在图片下面 */
.sticker-cell-cap{
  flex:0 0 auto; max-width:100%;
  font-size:10px; line-height:1.3; color:var(--gray-2);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  pointer-events:none;
}
.sticker-cell.add{ color:var(--gray-2); font-size:26px; }
.sticker-empty{
  grid-column:1 / -1;
  text-align:center; font-size:12px; color:var(--gray-2);
  padding:22px 0;
}
/* 表情包预览 */
.sticker-preview-img{
  display:block; margin:8px auto 4px;
  width:200px; height:200px; object-fit:contain;
}
/* 上行：输入栏 + 发送键 */
.talk-input-row{ display:flex; align-items:flex-end; gap:8px; }
.talk-input{
  flex:1; min-width:0;
  min-height:42px; max-height:104px;
  padding:11px 16px;
  border:none;
  border-radius:21px;
  background:var(--fill);
  color:var(--ink);
  font-family:inherit;
  font-size:14.5px;
  line-height:1.45;
  resize:none;
  overflow-y:auto;
}
.talk-input::placeholder{ color:var(--gray-3); }
.talk-input::-webkit-scrollbar{ width:0; }
/* 发送键：正在输入时从右侧出现 */
.talk-send{
  flex:0 0 auto;
  width:0; height:42px;
  padding:0; border:none;
  border-radius:50%;
  background:var(--ink); color:#fff;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
  opacity:0;
  transform:scale(.4);
  overflow:hidden;
  transition:width .26s var(--spring), opacity .2s, transform .3s var(--spring);
}
.talk-input-row.typing .talk-send{
  width:42px;
  opacity:1;
  transform:none;
}
.talk-send svg{
  width:20px; height:20px;
  fill:none; stroke:currentColor;
  stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round;
}
.talk-send:active{ transform:scale(.9); }
/* 下行：功能键（纯线条图标、无文字） */
.talk-actions{
  display:flex; align-items:center;
  justify-content:space-between;
  padding:0 4px 2px;
}
.talk-act{
  width:40px; height:40px;
  border:none; background:transparent;
  color:var(--gray-1);
  border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
  transition:background .18s, color .18s, transform .18s var(--spring);
}
.talk-act:hover{ background:rgba(11,11,15,.05); color:var(--ink); }
.talk-act:active{ transform:scale(.86); }
.talk-act.on{ color:var(--ink); background:var(--fill); }
.talk-act svg{
  width:23px; height:23px;
  fill:none; stroke:currentColor;
  stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round;
}
.talk-act.plus svg{ stroke-width:1.9; }

/* 加号展开的功能面板 */
.talk-panel{
  display:grid;
  grid-template-columns:repeat(4, 1fr);
  gap:4px 0;
  padding:6px 0 2px;
  animation:msgIn .26s var(--ease-out) both;
}
.talk-panel[hidden]{ display:none; }
.tp-item{
  border:none; background:transparent;
  display:flex; flex-direction:column; align-items:center; gap:7px;
  padding:10px 0;
  cursor:pointer;
  font-family:inherit;
  font-size:11.5px; color:var(--gray-1);
  border-radius:16px;
  transition:background .18s, transform .18s var(--spring);
}
.tp-item:hover{ background:rgba(11,11,15,.035); }
.tp-item:active{ transform:scale(.94); }
.tp-icon{
  width:48px; height:48px;
  border-radius:17px;
  background:var(--fill);
  color:var(--ink);
  display:flex; align-items:center; justify-content:center;
}
.tp-icon svg{
  width:22px; height:22px;
  fill:none; stroke:currentColor;
  stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round;
}

/* ============ 系统提示（居中灰字） ============ */
.msg-system{
  align-self:center;
  max-width:82%;
  text-align:center;
  font-size:11.5px; color:var(--gray-2);
  line-height:1.6;
  background:rgba(11,11,15,.045);
  padding:5px 12px;
  border-radius:9px;
  animation:msgIn .3s var(--ease-out) both;
}

/* ============ 语音气泡 ============ */
.msg-voice{
  display:flex; flex-direction:column;
  min-width:150px;
  cursor:pointer;
}
.voice-main{ display:flex; align-items:center; gap:10px; }
.voice-play{
  flex:0 0 auto;
  width:24px; height:24px;
  border-radius:50%;
  background:rgba(127,127,127,.16);
  display:flex; align-items:center; justify-content:center;
  transition:background .16s, transform .16s;
}
.voice-play:active{ transform:scale(.92); }
.voice-play svg{
  width:13px; height:13px;
  margin-left:1px;
  fill:currentColor; stroke:none;
}
/* 播放中：播放键变成暂停 */
.msg-voice.playing .voice-play svg path{ d:path("M7.5 5.5h3v13h-3zM13.5 5.5h3v13h-3z"); }
.msg-voice.loading .voice-play{ animation:voicePulse 1s infinite; }
@keyframes voicePulse{ 0%,100%{ opacity:1; } 50%{ opacity:.4; } }
/* 转文字键 */
.voice-tt{
  flex:0 0 auto;
  width:24px; height:24px;
  margin-left:2px;
  border-radius:8px;
  display:flex; align-items:center; justify-content:center;
  opacity:.62;
  transition:background .16s, opacity .16s;
}
.voice-tt svg{
  width:15px; height:15px;
  fill:none; stroke:currentColor;
  stroke-width:1.9; stroke-linecap:round;
}
.voice-tt:hover{ opacity:.9; }
.voice-tt.on{ opacity:1; background:rgba(127,127,127,.18); }
.voice-wave{
  flex:1;
  display:flex; align-items:center; gap:2.5px;
  height:18px;
}
.voice-wave i{
  display:block;
  width:2.5px; border-radius:2px;
  background:currentColor;
  opacity:.5;
}
.msg-voice.playing .voice-wave i{ animation:waveJump .9s infinite; }
@keyframes waveJump{
  0%,100%{ transform:scaleY(.55); opacity:.4; }
  50%    { transform:scaleY(1.25); opacity:.95; }
}
.voice-dur{
  flex:0 0 auto;
  font-size:12px; opacity:.72;
  font-variant-numeric:tabular-nums;
}
.voice-text{
  margin-top:9px;
  padding-top:9px;
  border-top:1px solid rgba(127,127,127,.28);
  font-size:13.5px; line-height:1.6;
}

/* ============ 红包气泡 ============ */
.msg-red{
  position:relative;
  padding:0; overflow:hidden;
  background:linear-gradient(160deg, #FF8A65 0%, #F0553D 55%, #D8402E 100%);
  color:#fff;
  min-width:212px; max-width:240px;
  cursor:pointer;
  border-radius:18px !important;
  box-shadow:0 6px 18px rgba(226,96,74,.32), inset 0 1px 0 rgba(255,255,255,.28);
  transition:transform .18s var(--spring), box-shadow .18s;
}
.msg-red:active{ transform:scale(.97); }
.msg.mine .msg-red{ background:linear-gradient(160deg, #FF8A65 0%, #F0553D 55%, #D8402E 100%); color:#fff; }
/* 顶部的封口弧线 + 光斑 */
.msg-red::before{
  content:''; position:absolute; left:-10%; right:-10%; top:-58px;
  height:92px; border-radius:50%;
  background:rgba(255,255,255,.14);
  box-shadow:0 2px 0 rgba(0,0,0,.06);
  pointer-events:none;
}
.msg-red::after{
  content:''; position:absolute; right:-28px; bottom:14px;
  width:96px; height:96px; border-radius:50%;
  background:radial-gradient(circle, rgba(255,220,120,.32), rgba(255,220,120,0) 70%);
  pointer-events:none;
}
.red-top{
  position:relative; z-index:1;
  display:flex; align-items:center; gap:12px;
  padding:16px 16px 14px;
}
.red-ico{
  flex:0 0 auto;
  width:42px; height:42px;
  border-radius:50%;
  background:linear-gradient(150deg, #FFE9A8, #F2C24B);
  box-shadow:0 3px 8px rgba(0,0,0,.18), inset 0 -2px 0 rgba(0,0,0,.08);
  display:flex; align-items:center; justify-content:center;
}
.red-ico i{
  font-style:normal; font-weight:700;
  font-size:17px; line-height:1;
  color:#B23A22;
  font-family:"Noto Serif SC", "Songti SC", "STSong", serif;
  letter-spacing:.02em;
}
.red-word{ flex:1; min-width:0; }
.red-word b{
  display:block; font-size:15px; font-weight:600;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  text-shadow:0 1px 1px rgba(0,0,0,.12);
}
.red-word span{ display:block; font-size:11.5px; opacity:.86; margin-top:3px; }
.red-foot{
  position:relative; z-index:1;
  display:flex; align-items:center; justify-content:space-between;
  padding:6px 16px 7px;
  background:rgba(0,0,0,.14);
  font-size:10.5px; letter-spacing:.08em;
  opacity:.92;
}
.red-foot em{ font-style:normal; font-family:var(--font-num), inherit; font-weight:600; letter-spacing:0; font-size:11.5px; }
.msg-red.done{
  background:linear-gradient(160deg, #F2C0B4 0%, #E5A697 60%, #D9998A 100%);
  box-shadow:none;
}
.msg-red.done::after{ display:none; }
.msg-red.done .red-ico{ background:linear-gradient(150deg, #F7E3B9, #E9CC8E); box-shadow:none; }
.msg-red.done .red-ico i{ color:#B76A5C; }

/* ============ 转账气泡 ============ */
.msg-transfer{
  position:relative;
  padding:0; overflow:hidden;
  background:linear-gradient(160deg, #FFB870 0%, #F58F3E 60%, #E87A2E 100%);
  color:#fff;
  min-width:212px; max-width:240px;
  cursor:pointer;
  border-radius:18px !important;
  box-shadow:0 6px 18px rgba(232,135,60,.3), inset 0 1px 0 rgba(255,255,255,.3);
  transition:transform .18s var(--spring);
}
.msg-transfer:active{ transform:scale(.97); }
.msg.mine .msg-transfer{ background:linear-gradient(160deg, #FFB870 0%, #F58F3E 60%, #E87A2E 100%); color:#fff; }
.msg-transfer::after{
  content:''; position:absolute; right:-30px; top:-30px;
  width:110px; height:110px; border-radius:50%;
  background:rgba(255,255,255,.12);
  pointer-events:none;
}
.tr-top{
  position:relative; z-index:1;
  display:flex; align-items:center; gap:12px;
  padding:15px 16px 13px;
}
.tr-ico{
  flex:0 0 auto;
  width:40px; height:40px;
  border-radius:50%;
  background:rgba(255,255,255,.24);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.35);
  display:flex; align-items:center; justify-content:center;
}
.tr-ico svg{
  width:20px; height:20px;
  fill:none; stroke:#fff;
  stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round;
}
.tr-word{ flex:1; min-width:0; }
.tr-word b{
  display:block;
  font-size:21px; font-weight:600;
  font-family:var(--font-num), inherit;
  font-variant-numeric:tabular-nums;
  letter-spacing:-.01em; line-height:1.15;
  text-shadow:0 1px 1px rgba(0,0,0,.1);
}
.tr-word b small{ font-size:13px; font-weight:600; margin-right:1px; }
.tr-word span{
  display:block; font-size:11.5px; opacity:.9; margin-top:3px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.tr-foot{
  position:relative; z-index:1;
  display:flex; align-items:center; justify-content:space-between;
  padding:6px 16px 7px;
  background:rgba(0,0,0,.13);
  font-size:10.5px; letter-spacing:.08em;
  opacity:.92;
}
.msg-transfer.done{
  background:linear-gradient(160deg, #F0CFAA 0%, #E3B58A 60%, #D9A97E 100%);
  box-shadow:none;
}
.msg-transfer.back{
  background:linear-gradient(160deg, #D2D4DB 0%, #BCC0C9 60%, #AFB3BD 100%);
  box-shadow:none;
}
.msg-transfer.done::after, .msg-transfer.back::after{ display:none; }

/* ============ 长按气泡：浮动功能栏 ============ */
.msg-menu{
  position:absolute;
  z-index:95;
  display:flex;
  background:var(--ink);
  border-radius:14px;
  padding:4px;
  box-shadow:0 10px 30px rgba(0,0,0,.26);
  transform:scale(.86);
  opacity:0;
  pointer-events:none;
  transition:opacity .16s, transform .24s var(--spring);
}
.msg-menu.show{ transform:none; opacity:1; pointer-events:auto; }
.msg-menu button{
  border:none; background:transparent;
  color:#fff;
  font-family:inherit;
  font-size:12.5px;
  padding:8px 11px;
  border-radius:10px;
  cursor:pointer;
  white-space:nowrap;
  transition:background .16s;
}
.msg-menu button:hover{ background:rgba(255,255,255,.14); }
.msg-menu button:active{ background:rgba(255,255,255,.22); }

/* 多选：气泡前的勾选圈 */
.msg-pick{
  flex:0 0 auto;
  width:21px; height:21px;
  border-radius:50%;
  border:1.6px solid var(--gray-3);
  display:flex; align-items:center; justify-content:center;
  align-self:center;
}
.msg-pick svg{
  width:13px; height:13px;
  fill:none; stroke:#fff;
  stroke-width:2.4; stroke-linecap:round; stroke-linejoin:round;
  opacity:0;
}
.msg.picked .msg-pick{ background:var(--ink); border-color:var(--ink); }
.msg.picked .msg-pick svg{ opacity:1; }
.talk-body.selecting .msg{ cursor:pointer; }

/* 多选操作栏（替换底栏） */
.talk-select-bar{
  display:flex; align-items:center; gap:10px;
  padding:12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top:1px solid var(--hairline);
  background:var(--bg);
}
.talk-select-bar[hidden]{ display:none; }
.tsb-count{ flex:1; font-size:13px; color:var(--gray-1); }
.tsb-btn{
  border:none; background:var(--fill);
  color:var(--ink);
  font-family:inherit; font-size:13px; font-weight:500;
  padding:9px 16px;
  border-radius:999px;
  cursor:pointer;
  transition:background .18s, transform .18s var(--spring);
}
.tsb-btn:active{ transform:scale(.95); }
.tsb-btn.danger{ background:var(--danger); color:#fff; }

/* 输入栏上方的引用条 / 编辑条 */
.talk-quote-bar{
  display:flex; align-items:center; gap:10px;
  padding:8px 12px;
  background:var(--fill);
  border-radius:14px;
  margin-bottom:2px;
}
.talk-quote-bar[hidden]{ display:none; }
.tqb-line{
  flex:0 0 auto;
  width:2.5px; height:26px;
  border-radius:2px;
  background:var(--ink);
  opacity:.5;
}
.tqb-text{
  flex:1; min-width:0;
  font-size:12.5px; color:var(--gray-1);
  line-height:1.5;
  overflow:hidden;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
}
.tqb-text b{ color:var(--ink); font-weight:600; }
.tqb-close{
  flex:0 0 auto;
  width:26px; height:26px;
  border:none; background:transparent;
  color:var(--gray-2);
  border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
}
.tqb-close svg{
  width:15px; height:15px;
  fill:none; stroke:currentColor;
  stroke-width:2; stroke-linecap:round;
}
.tqb-close:hover{ background:rgba(11,11,15,.06); color:var(--ink); }

/* ============ 语音输入面板 / 金额输入面板 ============ */
.pad-body{ padding:4px 20px 8px; }
.pad-input{
  width:100%;
  border:none;
  background:var(--fill);
  color:var(--ink);
  font-family:inherit;
  font-size:15px;
  line-height:1.55;
  padding:13px 15px;
  border-radius:16px;
  resize:none;
  box-sizing:border-box;
}
.pad-input::placeholder{ color:var(--gray-3); }
.pad-amount{
  width:100%;
  border:none; border-bottom:1.5px solid var(--hairline);
  background:transparent;
  color:var(--ink);
  font-family:inherit;
  font-size:34px; font-weight:600;
  letter-spacing:.01em;
  padding:6px 0 12px;
  text-align:center;
  font-variant-numeric:tabular-nums;
  box-sizing:border-box;
}
.pad-amount::placeholder{ color:var(--gray-3); font-weight:500; }
.pad-amount:focus{ outline:none; border-bottom-color:var(--ink); }
.pad-hint{
  font-size:12px; color:var(--gray-2);
  text-align:center;
  margin:12px 0 0;
  line-height:1.65;
}
.pad-row{ display:flex; align-items:center; gap:10px; margin-top:16px; }
.pad-row .pad-input{ flex:1; font-size:14px; padding:11px 14px; }
.pad-dur{
  flex:0 0 auto;
  font-size:12px; color:var(--gray-2);
  font-variant-numeric:tabular-nums;
}
