/* ===== styles-im-ctx.css — 聊天消息右键菜单（PC 端，2026-09-16）=====
   设计取向：**不复刻微信**。微信右键菜单是「浅灰底 + 直角 + 上下分隔线 + emoji 图标」；
   本菜单走「深色玻璃质感（glassmorphism）+ 圆角卡片 + 左侧线性 SVG 图标 + 悬停蓝色高亮」，
   与全站品牌蓝 #2563eb 一致，图标全部为自研 SVG（见 styles-icons.css 的 ico-copy / ico-quote /
   ico-forward / ico-multiselect / ico-delete / ico-recall），零 emoji、零第三方素材。
   关闭方式：点击空白处 / ESC / 滚动 / 窗口失焦。置灰项不可点击并给出原因 tooltip（title）。 */

.im-ctx-menu {
  position: fixed;
  z-index: 9000;
  min-width: 196px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(28, 32, 40, .96);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, .09);
  box-shadow: 0 14px 38px rgba(0, 0, 0, .34), 0 2px 8px rgba(0, 0, 0, .22);
  color: #e8ecf3;
  font-size: 13.5px;
  line-height: 1;
  user-select: none;
  animation: imCtxIn .13s cubic-bezier(.2, .9, .3, 1);
  transform-origin: top left;
}
@keyframes imCtxIn {
  from { opacity: 0; transform: scale(.95) translateY(-4px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.im-ctx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 11px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, color .12s;
}
.im-ctx-item:hover { background: #2563eb; color: #fff; }
.im-ctx-item:hover .app-ico { opacity: 1; }
.im-ctx-item .app-ico {
  font-size: 17px;
  opacity: .82;
  transition: opacity .12s;
}
.im-ctx-item .im-ctx-label { flex: 1 1 auto; }
/* 快捷键提示（如 Ctrl+C）*/
.im-ctx-item .im-ctx-kbd {
  font-size: 11px;
  opacity: .5;
  letter-spacing: .3px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.im-ctx-item:hover .im-ctx-kbd { opacity: .8; }

/* 危险项（删除）红色语义，悬停用红底 */
.im-ctx-item.im-ctx-danger { color: #ff8f8f; }
.im-ctx-item.im-ctx-danger:hover { background: #dc2626; color: #fff; }

/* 置灰：不可点，且用 title 说明原因 */
.im-ctx-item.im-ctx-disabled {
  opacity: .38;
  cursor: not-allowed;
  pointer-events: none;
}

/* 分隔线（分组：编辑类 / 选择类 / 危险类） */
.im-ctx-sep {
  height: 1px;
  margin: 5px 8px;
  background: rgba(255, 255, 255, .1);
}

/* ── 菜单顶部消息预览区（.im-ctx-head / -who / -txt）已于 2026-09-16 按用户要求整体移除：
      长文本会撑开弹窗，且摘要冗余；菜单现在只含操作项，宽度恒定 ≈ min-width。 ── */

/* ── 批量选择模式条 ── */
.im-batch-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(28, 32, 40, .97);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, .1);
  color: #e8ecf3;
  animation: imBatchIn .15s ease;
}
@keyframes imBatchIn { from { transform: translateY(100%); } to { transform: translateY(0); } }
.im-batch-bar .im-batch-count { font-size: 13px; color: #9aa4b2; }
.im-batch-bar .im-batch-count b { color: #60a5fa; font-size: 14px; }
.im-batch-bar .im-batch-spacer { flex: 1 1 auto; }
.im-batch-bar .btn { height: 30px; padding: 0 14px; display: inline-flex; align-items: center; line-height: 1; }
.im-batch-bar .btn-danger { background: #dc2626; border-color: #dc2626; color: #fff; }
.im-batch-bar .btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }

/* 批量选择模式下：每行左侧出现勾选框，选中的行高亮 */
.chat-content-list.im-batch-mode,
#groupChatList.im-batch-mode { padding-left: 34px; }
.chat-content-list.im-batch-mode .chat-row,
#groupChatList.im-batch-mode .chat-row { position: relative; cursor: pointer; border-radius: 10px; transition: background .12s; }
.chat-content-list.im-batch-mode .chat-row:hover,
#groupChatList.im-batch-mode .chat-row:hover { background: rgba(37, 99, 235, .07); }
.im-batch-box {
  position: absolute;
  left: -28px;
  top: 12px;
  width: 17px; height: 17px;
  border-radius: 5px;
  border: 2px solid #cbd5e1;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, border-color .12s;
}
.im-batch-box::after {
  content: '';
  width: 4px; height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px) scale(0);
  transition: transform .13s;
}
.chat-row.im-batch-on .im-batch-box { background: #2563eb; border-color: #2563eb; }
.chat-row.im-batch-on .im-batch-box::after { transform: rotate(45deg) translate(-1px, -1px) scale(1); }
.chat-row.im-batch-on { background: rgba(37, 99, 235, .1) !important; }

/* ── 引用态：输入框上方的引用预览条 ── */
/* r39：预览条渲染真实媒体（图片缩略图 / 语音·视频·文件徽标） */
.im-quote-preview .im-quote-media { display: flex; align-items: center; gap: 6px; margin: 3px 0; }
.im-quote-preview .im-quote-img {
  width: 44px; height: 44px;
  border-radius: 6px;
  object-fit: cover;
  background: #e2e8f0;
  display: block;
}
.im-quote-preview .im-quote-more { font-size: 11.5px; color: #64748b; }
.im-quote-preview .im-quote-badge {
  font-size: 12px;
  color: #475569;
  background: #e2e8f0;
  border-radius: 5px;
  padding: 2px 8px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.im-quote-preview {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 7px 10px 7px 12px;
  margin-bottom: 7px;
  border-left: 3px solid #2563eb;
  border-radius: 0 8px 8px 0;
  background: #f1f5f9;
  animation: imQuoteIn .16s ease;
}
@keyframes imQuoteIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.im-quote-preview .im-quote-body { flex: 1 1 auto; min-width: 0; }
.im-quote-preview .im-quote-who {
  font-size: 11.5px;
  color: #2563eb;
  font-weight: 600;
  margin-bottom: 2px;
}
.im-quote-preview .im-quote-txt {
  font-size: 12.5px;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.im-quote-preview .im-quote-x {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #94a3b8;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  transition: background .12s, color .12s;
}
.im-quote-preview .im-quote-x:hover { background: #e2e8f0; color: #475569; }

/* ── 消息中已渲染的「引用块」（对方/自己发的引用消息） ── */
/* r39：引用携带真实内容 → 布局改为 flex，容纳图片缩略图 / 类型徽标 / 文本 */
.chat-quote-inner {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  margin-bottom: 5px;
  border-left: 3px solid rgba(37, 99, 235, .55);
  border-radius: 0 6px 6px 0;
  background: rgba(100, 116, 139, .1);
  font-size: 12px;
  color: #64748b;
  max-width: 100%;
  overflow: hidden;
}
.chat-quote-inner .chat-quote-who { color: #2563eb; font-weight: 600; flex: 0 0 auto; }
.chat-quote-inner .chat-quote-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chat-quote-img {
  flex: 0 0 auto;
  width: 26px; height: 26px;
  border-radius: 4px;
  object-fit: cover;
  background: rgba(0, 0, 0, .08);
  display: block;
}
.chat-quote-more { flex: 0 0 auto; font-size: 11px; opacity: .8; }
.chat-quote-badge { flex: 0 0 auto; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row.me .chat-quote-inner { background: rgba(255, 255, 255, .16); color: rgba(255, 255, 255, .82); border-left-color: rgba(255, 255, 255, .7); }
.chat-row.me .chat-quote-inner .chat-quote-who { color: rgba(255, 255, 255, .92); }

/* ── 撤回后的系统提示行（居中灰字，无气泡） ── */
.chat-recall-tip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 9px 0;
  font-size: 12.5px;
  color: #94a3b8;
  text-align: center;
}
.chat-recall-tip .app-ico { font-size: 13px; opacity: .75; }
.chat-recall-tip b { color: #64748b; font-weight: 600; }

/* ── r83：通话记录 = 普通气泡里的一行（图标 + 文案），左右归属与普通消息一致 ── */
.chat-calllog-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  line-height: 1.5;
}
.chat-calllog-line .app-ico { flex: 0 0 auto; opacity: .9; }
/* 未接通（未接听/忙线/离线/连接失败）：红色，一眼区分；己方蓝底气泡上换浅红保证可读 */
.chat-calllog-line.missed { color: #dc2626; }
.chat-row.me .chat-calllog-line.missed { color: #fecaca; }

/* ── 转发：选择目标会话弹层 ── */
/* r39：顶部搜索框（筛选好友/群），列表全量渲染 + 内部滚动 */
.im-fwd-search { margin: 2px -4px 8px; }
.im-fwd-search-input {
  width: 100%;
  box-sizing: border-box;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #f8fafc;
  font-size: 13px;
  color: #1f2937;
  outline: none;
  transition: border-color .12s, background .12s;
}
.im-fwd-search-input:focus { border-color: #2563eb; background: #fff; }
.im-fwd-empty { padding: 18px 0; text-align: center; font-size: 12.5px; color: #94a3b8; }
.im-fwd-list {
  max-height: 46vh;
  overflow-y: auto;
  margin: 2px -4px;
}
.im-fwd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 9px;
  cursor: pointer;
  transition: background .12s;
}
.im-fwd-item:hover { background: #f1f5f9; }
.im-fwd-av {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  overflow: hidden;
}
.im-fwd-av img { width: 100%; height: 100%; object-fit: cover; }
.im-fwd-info { flex: 1 1 auto; min-width: 0; }
.im-fwd-name { font-size: 13.5px; color: #1f2937; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.im-fwd-sub { font-size: 11.5px; color: #94a3b8; margin-top: 2px; }
.im-fwd-tag {
  flex: 0 0 auto;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 5px;
  background: #e0e7ff;
  color: #4338ca;
}
.im-fwd-tag.grp { background: #dcfce7; color: #15803d; }

/* r143：通话记录图标修复 + 对齐 App 端（call_log_bubble.dart）
   根因：CALL_LOG_ICON 是内联 <svg class="app-ico">，但 .app-ico 是给 <i> 用的 CSS mask 图标
   （background-color:currentColor + mask:var(--ico)）。svg 上没有 --ico 变量 => mask 不生效，
   只剩 currentColor 背景 => 渲染成实心黑块。这里对 svg 还原为正常矢量图标，
   并按 App 端对齐：图标 17 / 间距 7 / 字号 17。
   实测（headless Edge）：修复前 background-color=rgb(0,0,0)、尺寸 14x14；修复后 transparent、17x17。 */
.chat-calllog-line svg.app-ico {
  background: none;
  -webkit-mask: none;
  mask: none;
  width: 17px;
  height: 17px;
  vertical-align: baseline;
}
/* 字号与行高回到普通聊天消息基线（.chat-text: 14px / 1.55）—— r143 曾按 App 端调到 17px，
   但网页端普通消息是 14px，通话记录 17px 明显偏大、且行高与相邻气泡不齐。
   图标仍为 17px（小于行高 21.7px，不会撑高气泡）。 */
.chat-calllog-line { gap: 7px; font-size: 14px; line-height: 1.55; }
