﻿/* ============================================================
   WeTalk — 微信风格聊天网站样式
   PC: 微信桌面版三栏布局 / H5: 手机微信单页布局
   ============================================================ */

:root {
  --wx-green: #07c160;
  --wx-green-hover: #06ad56;
  --wx-green-light: #95ec69;      /* 自己发出的气泡 */
  --wx-bg: #ededed;               /* 聊天区背景 */
  --wx-side: #2e2e2e;             /* 侧边栏 */
  --wx-side-hover: #3a3a3a;
  --wx-side-active: #424242;
  --wx-panel: #f7f7f7;
  --wx-panel-border: #e7e7e7;
  --wx-text: #191919;
  --wx-text-sub: #888;
  --wx-red: #f43530;
  --wx-blue: #576b95;
  --radius: 6px;
  --radius-bubble: 14px;
  --shadow: 0 4px 24px rgba(0, 0, 0, .12);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
          "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  color: var(--wx-text);
  background: #d7d7d7;
  overflow: hidden;
  /* 禁止长按弹出「复制/搜索/翻译」等系统菜单 */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; font-size: inherit; outline: none; }
/* 输入框必须能选中 / 编辑 */
input, textarea {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}
img { display: block; }

.hidden { display: none !important; }

/* 布局修正：主屏与聊天区撑满 */
#main-screen { height: 100%; }
#app { height: 100%; }

/* ---------- 头像 ---------- */
.avatar {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; font-weight: 600;
  flex-shrink: 0;
  user-select: none;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  transition: transform .15s ease, box-shadow .15s ease;
}
.avatar-sm { width: 30px; height: 30px; border-radius: 4px; font-size: 14px; }
.avatar-lg { width: 56px; height: 56px; border-radius: 8px; font-size: 24px; }
.avatar-xl { width: 80px; height: 80px; border-radius: 10px; font-size: 34px; }

/* ============================================================
   登录 / 注册
   ============================================================ */
#auth-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f6f6f6 0%, #e6e6e6 100%);
  z-index: 100;
  padding: 20px;
}
.auth-card {
  width: 360px; max-width: 100%;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 36px 32px 28px;
  animation: fadeUp .35s ease;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.auth-logo {
  width: 64px; height: 64px; margin: 0 auto 14px;
  border-radius: 16px;
  background: var(--wx-green);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 30px; font-weight: 700;
  box-shadow: 0 6px 16px rgba(7, 193, 96, .35);
}
.auth-title { text-align: center; font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.auth-sub { text-align: center; color: var(--wx-text-sub); font-size: 12px; margin-bottom: 26px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--wx-text-sub); margin-bottom: 6px; }
.field input {
  width: 100%; height: 42px; padding: 0 12px;
  border: 1px solid #e0e0e0; border-radius: var(--radius);
  background: #fafafa;
  transition: border-color .2s, background .2s;
}
.field input:focus { border-color: var(--wx-green); background: #fff; }

.btn-primary {
  width: 100%; height: 44px;
  background: var(--wx-green); color: #fff;
  border-radius: var(--radius);
  font-size: 15px; font-weight: 500;
  transition: background .2s;
}
.btn-primary:hover { background: var(--wx-green-hover); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }

.auth-switch { text-align: center; margin-top: 16px; font-size: 13px; color: var(--wx-text-sub); }
.auth-switch a { color: var(--wx-blue); text-decoration: none; cursor: pointer; }
.auth-err { color: var(--wx-red); font-size: 12px; min-height: 18px; margin-bottom: 6px; }

/* 注册/登录表单的行内校验提示 */
.field-err {
  color: var(--wx-red);
  font-size: 12px;
  line-height: 1.5;
  margin-top: 4px;
  display: none;
}
.field-ok {
  color: #07c160;
  font-size: 12px;
  line-height: 1.5;
  margin-top: 4px;
  display: none;
}
input.has-err {
  border-color: var(--wx-red) !important;
  background: #fff6f6 !important;
}

/* ============================================================
   主界面
   ============================================================ */
#app {
  height: 100%;
  display: flex;
  background: #fff;
}

/* ---- 左侧导航（PC 微信最左窄栏） ---- */
.navbar {
  width: 58px;
  background: var(--wx-side);
  display: flex; flex-direction: column; align-items: center;
  padding: 18px 0;
  flex-shrink: 0;
}
.nav-avatar { margin-bottom: 24px; cursor: pointer; }
/* 手机端顶栏头像：桌面不显示 */
.m-avatar { display: none; }
.nav-items { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.nav-item {
  width: 40px; height: 40px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: #8f8f8f;
  position: relative;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--wx-side-hover); color: #d8d8d8; }
.nav-item.active { background: var(--wx-side-active); color: var(--wx-green); }
.nav-item svg { width: 22px; height: 22px; fill: currentColor; }

/* ---- 会话列表栏 ---- */
.sidebar {
  width: 280px;
  background: var(--wx-panel);
  border-right: 1px solid var(--wx-panel-border);
  display: flex; flex-direction: column;
  flex-shrink: 0;
}
.sidebar-top {
  height: 60px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
}
.search-box {
  flex: 1; height: 30px;
  background: #e9e9e9;
  border-radius: 4px;
  display: flex; align-items: center; gap: 6px;
  padding: 0 8px;
}
.search-box svg { width: 14px; height: 14px; fill: #999; flex-shrink: 0; }
.search-box input { flex: 1; border: none; background: none; font-size: 12px; }
.icon-btn {
  width: 30px; height: 30px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  color: #666;
  transition: background .15s;
}
.icon-btn:hover { background: #e2e2e2; }
.icon-btn svg { width: 18px; height: 18px; fill: currentColor; }
/* 搜索框旁的改名按钮：保持与搜索框同高，不抢空间 */
.rename-btn { flex-shrink: 0; }

.session-list { flex: 1; overflow-y: auto; }
.session-item {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px;
  cursor: pointer;
  position: relative;
  transition: background .12s;
}
.session-item:hover { background: #ececec; }
.session-item.active { background: #dcdcdc; }
/* 选中态：左侧绿色竖条，一眼能看出当前在哪 */
.session-item.active::before {
  content: "";
  position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--wx-green);
}
.session-item .info { flex: 1; min-width: 0; }
.session-item .row1 { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.session-item .name {
  font-size: 14px; color: var(--wx-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.session-item .time { font-size: 11px; color: #b2b2b2; flex-shrink: 0; }
.session-item .row2 { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 3px; }
.session-item .preview {
  font-size: 12px; color: var(--wx-text-sub);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.badge {
  min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: 9px; background: var(--wx-red); color: #fff;
  font-size: 11px; line-height: 17px; text-align: center;
  flex-shrink: 0;
}
.badge.dot { width: 8px; height: 8px; min-width: 8px; padding: 0; border-radius: 50%; }
.pin-tag {
display: inline-block;
margin-left: 6px;
padding: 1px 5px;
font-size: 10px;
line-height: 14px;
color: #07c160;
background: #e7f8ee;
border-radius: 3px;
vertical-align: middle;
font-weight: 400;
}
.empty-tip { text-align: center; color: #b0b0b0; font-size: 12px; padding: 30px 0; }

/* ---- 聊天区 ---- */
.chat {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  background: var(--wx-bg);
  position: relative;
}
.chat-header {
  height: 60px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid #e0e0e0;
  background: var(--wx-bg);
  cursor: default;
}
.chat-header .title { font-size: 16px; font-weight: 500; }
.chat-header .sub { font-size: 12px; color: var(--wx-text-sub); }
.chat-header .spacer { flex: 1; }
.chat-header .back-btn { display: none; margin-left: -8px; }
.chat-header.hidden { display: none !important; }

.messages {
  flex: 1; overflow-y: auto;
  padding: 20px 24px 10px;
  display: flex; flex-direction: column; gap: 4px;
}
.msg-time-sep {
  text-align: center; font-size: 11px; color: #a3a3a3;
  margin: 14px 0 8px;
}
.msg-time-sep span {
  background: rgba(0,0,0,.05); padding: 3px 9px; border-radius: 6px;
}
.msg-sys {
  text-align: center; font-size: 11px; color: #a3a3a3;
  margin: 8px 0;
}
.msg-sys span { background: rgba(0,0,0,.05); padding: 4px 10px; border-radius: 6px; max-width: 70%; display: inline-block; }

.msg-row {
  display: flex; gap: 10px;
  margin-bottom: 12px;
  align-items: flex-start;
  max-width: 100%;
  animation: msgIn .18s ease;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.msg-row.self { flex-direction: row-reverse; }
.msg-body { max-width: min(60%, 520px); display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.msg-row.self .msg-body { align-items: flex-end; }
.msg-body > * { max-width: 100%; }
.msg-sender { font-size: 11px; color: #999; padding: 0 2px; }
.msg-row.self .msg-sender { text-align: right; }

.bubble {
  position: relative;
  padding: 9px 13px;
  border-radius: var(--radius-bubble);
  background: #fff;
  line-height: 1.55;
  word-break: break-word;
  white-space: pre-wrap;
  font-size: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
  /* 聊天内容允许选中复制 */
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}
.msg-row.self .bubble { background: var(--wx-green-light); }
/* 气泡小尖角：贴近微信的圆润感 */
.msg-row:not(.self) .bubble { border-top-left-radius: 4px; }
.msg-row.self .bubble { border-top-right-radius: 4px; }
.bubble::after {
  content: ""; position: absolute; top: 12px;
  border: 6px solid transparent;
}
.msg-row:not(.self) .bubble::after { left: -11px; border-right-color: #fff; }
.msg-row.self .bubble::after { right: -11px; border-left-color: var(--wx-green-light); }

/* 图片气泡 */
.bubble-img {
  padding: 0; background: none !important; box-shadow: none;
  overflow: visible; width: fit-content; max-width: 100%;
  display: flex; flex-direction: column; align-items: stretch;
}
.bubble-img::after { display: none; }
.bubble-img img {
  max-width: 220px; max-height: 260px;
  width: auto; height: auto; display: block;
  border-radius: var(--radius);
  cursor: zoom-in;
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.bubble-img .cap {
  margin-top: 4px; font-size: 13px; color: #333;
  background: #fff; padding: 7px 11px; border-radius: var(--radius);
  line-height: 1.5; word-break: break-word; white-space: pre-wrap;
  box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

/* 语音条 */
.voice-bubble {
  display: flex; align-items: center; gap: 8px;
  min-width: 80px;
  cursor: pointer;
  user-select: none;
}
.voice-bubble .wave { display: flex; align-items: center; gap: 2px; height: 16px; }
.voice-bubble .wave i {
  display: block; width: 2px; border-radius: 1px;
  background: #4a4a4a; opacity: .75;
}
.voice-bubble .vsec { font-size: 12px; color: #555; margin-left: 4px; min-width: 28px; }
.voice-bubble.playing .wave i { animation: voiceWave .9s infinite ease-in-out; }
@keyframes voiceWave {
  0%, 100% { transform: scaleY(.45); }
  50% { transform: scaleY(1); }
}
.voice-bubble .vsec { font-variant-numeric: tabular-nums; }

/* 已过期语音：不可点，弱化显示 */
.voice-bubble.expired {
  cursor: default;
  background: #f2f2f2 !important;
  color: #999;
  box-shadow: none;
}
.voice-bubble.expired .vexpired { font-size: 12px; color: #999; }
.bubble.expired-file {
  background: #f2f2f2 !important;
  color: #999; font-size: 12px;
}

/* ---- 输入区 ---- */
.composer {
  border-top: 1px solid #dcdcdc;
  background: #f5f5f5;
  flex-shrink: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}
.composer.hidden { display: none !important; }
.composer-tools {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 16px 2px;
}
.tool-btn {
  width: 30px; height: 30px;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  color: #5a5a5a;
  transition: background .15s, color .15s;
}
.tool-btn:hover { background: #e5e5e5; }
.tool-btn.active { color: var(--wx-green); background: #e3f7ea; }
.tool-btn svg { width: 20px; height: 20px; fill: currentColor; }

.composer-input {
  padding: 2px 16px 12px;
}
.composer-input textarea {
  width: 100%; height: 76px;
  resize: none; border: none; background: transparent;
  font-size: 14px; line-height: 1.6;
  padding: 4px 0;
}
.composer-input textarea::placeholder { color: #b8b8b8; }

.composer-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  padding-right: 16px; padding-bottom: 12px;
  margin-top: -8px;
}
.btn-send {
  height: 32px; padding: 0 22px;
  background: var(--wx-green); color: #fff;
  border-radius: 4px; font-size: 13px;
  transition: background .2s;
}
.btn-send:hover { background: var(--wx-green-hover); }
.btn-send:disabled { background: #c9c9c9; cursor: not-allowed; }

/* 按住/点击 说话栏 */
.talk-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 16px 12px;
}
.hold-talk {
  flex: 1;
  height: 42px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #e2e2e2;
  color: #333;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: none;
  transition: background .15s, border-color .15s;
}
.hold-talk:hover { border-color: #ccc; }
.hold-talk.recording {
  background: #e8f9ef;
  border-color: var(--wx-green);
  color: var(--wx-green);
  font-weight: 500;
}
.hold-talk.recording::before {
  content: "";
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--wx-red);
  margin-right: 8px;
  animation: recPulse 1s infinite;
}
@keyframes recPulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
.rec-mode-switch {
  height: 42px;
  padding: 0 12px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #e2e2e2;
  color: #666;
  font-size: 12px;
  white-space: nowrap;
}
.rec-mode-switch:hover { background: #f7f7f7; }
.composer.voice-mode .talk-bar { display: flex; }
.composer.voice-mode .composer-input { display: none; }
.composer.voice-mode .composer-tools { display: none; }
.composer.voice-mode .composer-actions { display: none; }
/* 语音模式下必须留一个「切回打字」的出口，否则用户被困在录音栏 */
.voice-exit {
  display: none;
  width: 42px; height: 42px;
  flex: 0 0 42px;
  align-items: center; justify-content: center;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #e2e2e2;
  color: #333;
}
.voice-exit svg { width: 22px; height: 22px; fill: currentColor; }
.voice-exit:hover { background: #f2f2f2; }
.composer.voice-mode .voice-exit { display: flex; }

/* 录音浮层按钮 */
.rec-stop, .rec-cancel {
  margin-top: 12px;
  width: 100%;
  height: 36px;
  border-radius: 6px;
  font-size: 14px;
  background: var(--wx-green);
  color: #fff;
}
.rec-cancel {
  margin-top: 8px;
  background: rgba(255,255,255,.14);
  color: #ddd;
}
.rec-stop:hover { background: var(--wx-green-hover); }
.rec-cancel:hover { background: rgba(255,255,255,.22); }

/* 在线成员栏（聊天区顶部） */
.online-bar {
  display: none;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 20px 10px;
  background: #fff;
  border-bottom: 1px solid #eaeaea;
  flex-shrink: 0;
}
.online-bar.show { display: flex; }
.ol-head {
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0;
  padding-top: 3px;
}
.ol-label { font-size: 12px; color: #888; white-space: nowrap; }
.ol-count {
  font-size: 12px; color: #07c160; font-weight: 600;
  background: #e7f8ee; padding: 1px 7px; border-radius: 9px;
  line-height: 16px;
}
.ol-list {
  display: flex; align-items: flex-start; gap: 14px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
  max-height: 78px;
  overflow-y: auto;
}
.ol-person {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 46px; flex-shrink: 0;
  position: relative;
}
.ol-person .avatar {
  width: 34px; height: 34px; font-size: 14px; border-radius: 6px;
}
.ol-person .ol-name {
  font-size: 11px; color: #555; text-align: center;
  width: 100%; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.ol-person.me .ol-name { color: #07c160; font-weight: 500; }
.ol-person .ol-dot {
  position: absolute; top: 27px; right: 4px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #07c160; border: 2px solid #fff;
}
.ol-person.speaking .avatar {
  box-shadow: 0 0 0 2px #95ec69;
}
.ol-empty { font-size: 12px; color: #bbb; padding-top: 8px; }

/* 移动端在线栏缩小 */
/* H5 发送按钮：PC 隐藏，手机显示 */
.mb-send {
  display: none;
  flex: 0 0 auto;
  height: 32px;
  padding: 0 12px;
  margin-bottom: 3px;
  background: var(--wx-green);
  color: #fff;
  border-radius: 4px;
  font-size: 14px;
}
.mb-send:active { background: var(--wx-green-hover); }

@media (max-width: 767px) {
  .online-bar { padding: 8px 12px; gap: 8px; }
  .ol-list { gap: 10px; max-height: 66px; }
  .ol-person { width: 40px; }
  .ol-person .avatar { width: 30px; height: 30px; font-size: 13px; }
}
/* ============ 移动端：禁止按钮被“双击/长按”放大 ============
   手机上双击按钮会触发浏览器缩放（视觉上就是按钮一下大一下小），
   长按还会弹出文字选择菜单。这里把所有可点区域统一禁掉，
   只保留正文区域可选（方便复制聊天文字）。 */
button, .vc-btn, .icon-btn, .nav-item, .ol-person, .avatar, .btn-primary,
.ol-person *, .vc-btn * {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  touch-action: manipulation;   /* 关键：禁掉双击缩放 */
}
/* 按压反馈只保留缩小一点点，不放大 */
.vc-btn.icon:active { transform: scale(.94); }
.vc-btn.icon:active svg { transform: scale(.96); }

/* 群语音通话条（位于标题栏下方） */
.voice-call-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 16px;
  background: #f0f9f4;
  border-bottom: 1px solid #dff0e6;
  flex-shrink: 0;
}
.voice-call-bar.show { display: flex; }
.vc-info { display: flex; align-items: center; gap: 8px; min-width: 0; }
.vc-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #bbb; flex-shrink: 0;
}
.voice-call-bar.live .vc-dot {
  background: var(--wx-green);
  box-shadow: 0 0 0 0 rgba(7,193,96,.5);
  animation: livePulse 1.6s infinite;
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(7,193,96,.5); }
  70% { box-shadow: 0 0 0 7px rgba(7,193,96,0); }
  100% { box-shadow: 0 0 0 0 rgba(7,193,96,0); }
}
.vc-text { font-size: 12px; color: #4a7c5d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc-actions { display: flex; gap: 8px; flex-shrink: 0; }
.vc-btn {
  height: 28px; padding: 0 14px;
  border-radius: 14px;
  background: var(--wx-green); color: #fff;
  font-size: 12px;
}
.vc-btn:hover { background: var(--wx-green-hover); }
.vc-btn.danger { background: #fff; color: var(--wx-red); border: 1px solid #f0c8c8; }
.vc-btn.danger:hover { background: #fdf2f2; }
.vc-btn.icon {
  width: 28px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid #d8e8df;
}
.vc-btn.icon svg { width: 16px; height: 16px; fill: #4a7c5d; }
.vc-btn.icon.muted { background: #ffecec; border-color: #f5c6c6; }
.vc-btn.icon.muted svg { fill: var(--wx-red); }
/* 已关闭麦克风：给个更明显的“已关”视觉，避免用户分不清 */
.vc-btn.icon.off { background: #ffe2e2; border-color: #e88888; }
.vc-btn.icon.off svg { fill: #d32f2f; }
.vc-btn.icon.on-hint { background: #eef6f1; }
/* 点击确认闪烁：让用户明确知道这次点生效了 */
.vc-btn.icon.pulse { animation: vcPulse .32s ease; }
@keyframes vcPulse {
  0% { transform: scale(1); }
  45% { transform: scale(1.12); box-shadow: 0 0 0 6px rgba(7,193,96,.18); }
  100% { transform: scale(1); }
}
/* 点击/处理中的即时反馈：没有这个，用户会觉得“点了没反应” */
.vc-btn.icon:active { transform: scale(.92); background: #eef6f1; }
.vc-btn.icon.busy {
  opacity: .6;
  pointer-events: none;
  animation: vcBusy .8s infinite alternate;
}
@keyframes vcBusy { from { opacity: .45; } to { opacity: .85; } }
/* 只听模式（没有麦克风）：麦克风按钮给个橙色提示 */
.vc-btn.icon.no-mic { border-color: #f0c07a; background: #fff8ec; }
.vc-btn.icon.no-mic svg { fill: #d98700; }

/* 单个成员被屏蔽的样式 */
.ol-person.blocked { opacity: .55; }
.ol-person.blocked .avatar { filter: grayscale(1); }
.ol-person .ol-mute {
  font-size: 10px; color: var(--wx-red);
  background: #ffecec; border-radius: 6px;
  padding: 0 4px; line-height: 14px; white-space: nowrap;
}
.ol-person:not(.me) { cursor: pointer; }
.ol-person:not(.me):active { transform: scale(.96); }

/* 旧版按住说话样式已废弃，统一由 .talk-bar 控制 */
.talk-bar { display: none; }
.composer.voice-mode .talk-bar { display: flex; }

/* 录音浮层 */
.rec-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.28);
  display: flex; align-items: center; justify-content: center;
  z-index: 300;
}
.rec-card {
  background: rgba(30,30,30,.86);
  color: #fff;
  border-radius: 12px;
  padding: 22px 28px;
  text-align: center;
  min-width: 150px;
}
.rec-card .mic-icon {
  width: 56px; height: 56px; margin: 0 auto 12px;
  border-radius: 50%;
  background: rgba(255,255,255,.16);
  display: flex; align-items: center; justify-content: center;
}
.rec-card .mic-icon svg { width: 28px; height: 28px; fill: #fff; }
.rec-card .rec-time { font-size: 22px; font-variant-numeric: tabular-nums; }
.rec-card .rec-tip { font-size: 12px; color: #bbb; margin-top: 6px; }
.rec-card.cancel { background: rgba(190,40,40,.9); }

/* 表情面板 */
.emoji-panel {
  display: none;
  max-height: 190px; overflow-y: auto;
  padding: 10px 14px;
  background: #fff;
  border-top: 1px solid #e6e6e6;
}
.emoji-panel.open { display: block; }
.emoji-grid { display: flex; flex-wrap: wrap; gap: 2px; }
.emoji-grid button {
  width: 32px; height: 32px; font-size: 20px; line-height: 1;
  border-radius: 4px;
}
.emoji-grid button:hover { background: #f0f0f0; }

/* 图片预览（发送前） */
.img-preview {
  display: none;
  padding: 8px 16px;
  background: #f5f5f5;
}
.img-preview.open { display: flex; align-items: center; gap: 10px; }
.img-preview img { width: 56px; height: 56px; object-fit: cover; border-radius: 4px; }
.img-preview .pname { flex: 1; font-size: 12px; color: #666; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.img-preview .rm {
  width: 24px; height: 24px; border-radius: 50%;
  background: #ddd; color: #fff; font-size: 14px; line-height: 24px;
}

/* ============================================================
   右侧信息面板 / 弹窗 / 抽屉
   ============================================================ */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  padding: 20px;
  animation: maskIn .15s ease;
}
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 400px; max-width: 100%;
  max-height: 86vh;
  background: #fff; border-radius: 10px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: fadeUp .22s ease;
}
.modal-head {
  height: 52px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid #eee;
}
.modal-head .t { font-size: 15px; font-weight: 500; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot {
  padding: 12px 18px;
  display: flex; justify-content: flex-end; gap: 10px;
  border-top: 1px solid #eee;
}
.btn {
  height: 34px; padding: 0 18px; border-radius: 4px;
  font-size: 13px; background: #f0f0f0; color: #444;
  transition: background .15s;
}
.btn:hover { background: #e6e6e6; }
.btn.green { background: var(--wx-green); color: #fff; }
.btn.green:hover { background: var(--wx-green-hover); }
.btn.red { background: #fdecec; color: var(--wx-red); }
.btn.red:hover { background: #fbdcdc; }

.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 12px; color: #888; margin-bottom: 6px; }
.form-row input, .form-row select {
  width: 100%; height: 38px; padding: 0 10px;
  border: 1px solid #e2e2e2; border-radius: 4px;
  background: #fafafa;
}
.form-row input:focus, .form-row select:focus { border-color: var(--wx-green); background: #fff; }
.hint { font-size: 11px; color: #aaa; margin-top: 5px; }

.member-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid #f2f2f2;
}
.member-row .nm { flex: 1; font-size: 13px; }
.member-row .tag { font-size: 11px; color: #999; }

.kv { display: flex; justify-content: space-between; padding: 9px 2px; font-size: 13px; border-bottom: 1px solid #f3f3f3; }
.kv .k { color: #888; }
.kv .v { color: #222; max-width: 60%; text-align: right; word-break: break-all; }

/* 图片查看器 */
#lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.88);
  display: flex; align-items: center; justify-content: center;
  z-index: 400;
}
#lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 4px; }
#lightbox .close {
  position: absolute; top: 18px; right: 24px;
  color: #fff; font-size: 30px; opacity: .8;
}

/* Toast */
#toast {
  position: fixed; left: 50%; top: 40px;
  transform: translateX(-50%);
  background: rgba(0,0,0,.78); color: #fff;
  padding: 9px 18px; border-radius: 6px;
  font-size: 13px; z-index: 500;
  pointer-events: none;
  opacity: 0; transition: opacity .2s, top .2s;
}
#toast.show { opacity: 1; top: 56px; }

/* 右键菜单 */
#ctxmenu {
  position: fixed; z-index: 450;
  background: #fff; border-radius: 6px;
  box-shadow: 0 4px 18px rgba(0,0,0,.16);
  padding: 5px; min-width: 130px;
}
#ctxmenu button {
  display: block; width: 100%; text-align: left;
  padding: 8px 12px; font-size: 13px; border-radius: 4px;
}
#ctxmenu button:hover { background: #f2f2f2; }
#ctxmenu button.danger { color: var(--wx-red); }

/* 空白欢迎页 */
.welcome {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: #b0b0b0; gap: 10px;
}
.welcome svg { width: 64px; height: 64px; fill: #d5d5d5; }
.welcome .wt { font-size: 15px; }
.welcome .ws { font-size: 12px; }


/* ============================================================
   H5 / 移动端适配（< 768px）
   ============================================================ */ */
/* 移动端工具条按钮：PC 默认隐藏（必须写在媒体查询之前） */
.mb-btn { display: none; }

/* 认证卡片在手机上收窄 */
@media (max-width: 767px) {
  .auth-card { padding: 28px 22px 22px; }
}

@media (max-width: 767px) {
  body { background: #fff; }

  .navbar { display: none; }

  #app { position: relative; }

  .sidebar {
    width: 100%;
    border-right: none;
    background: #ededed;
  }
  .sidebar-top { height: 96px; padding: 36px 12px 0; background: #ededed; }

  /* 手机端把头像摆进搜索栏左侧，作为「我的资料」入口 */
  .sidebar-top {
    display: flex; align-items: center; gap: 8px;
    height: auto; padding: 40px 12px 8px;
  }
  .sidebar-top .search-box { flex: 1; }
      .sidebar-top .m-avatar {
        display: block; flex-shrink: 0;
        width: 34px; height: 34px;
        margin: 0; font-size: 15px;
        border-radius: 6px;
        cursor: pointer;
      }

      /* H5：头像与搜索框严格垂直居中，与搜索框、新建按钮同一基准线 */
      .sidebar-top {
        align-items: center;
        gap: 8px;
      }
      .sidebar-top .search-box {
        height: 34px;
        align-self: center;
      }
      .sidebar-top .icon-btn {
        width: 34px; height: 34px;
        align-self: center;
        flex-shrink: 0;
      }
      .sidebar-top .m-avatar {
        align-self: center;
        line-height: 34px;
      }

  .chat {
    position: fixed; inset: 0;
    z-index: 60;
    transform: translateX(100%);
    transition: transform .26s cubic-bezier(.3,.8,.4,1);
    background: #ededed;
  }
  .chat.open { transform: none; }
  .chat .welcome { display: none; }

  .chat-header {
    height: 52px; padding: 0 10px;
    background: #ededed;
    border-bottom: 1px solid #dcdcdc;
  }
  .chat-header .back-btn { display: flex; }
  .chat-header .title { font-size: 15px; }
  .chat-header .sub { display: none; }
  .chat-header .icon-btn { display: flex; }
  .composer-input .mb-send { display: flex; align-items: center; justify-content: center; }

  .messages { padding: 12px 12px 6px; }
  .msg-body { max-width: 74%; }
  .bubble-img img { max-width: 170px; max-height: 220px; }
  .bubble-img { max-width: 74%; }
  .msg-row { gap: 8px; margin-bottom: 10px; }
  .msg-row .avatar { width: 36px; height: 36px; font-size: 15px; }

  .composer-tools { display: none; }
  .composer-input { padding: 7px 10px; display: flex; align-items: flex-end; gap: 8px; }
  .composer-input textarea {
    flex: 1 1 auto; background: #fff; border-radius: 4px;
    padding: 8px 10px; height: 38px; min-height: 38px; min-width: 0; width: auto;
    font-size: 15px; line-height: 1.4; border: none;
  }
  /* H5 发送按钮：右侧紧跟输入框 */
  .composer-actions { display: none; }
  .talk-bar { margin: 6px 10px; }
  .hold-talk { height: 40px; font-size: 15px; }
  .rec-mode-switch { height: 40px; padding: 0 9px; font-size: 11px; }

  /* 移动端底部工具条：语音 / 输入框 / 表情 / 加号 */
  .composer-input .mb-btn {
    flex: 0 0 32px;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    padding: 0; background: none; border: none;
    color: #333;
  }
  .composer-input .mb-btn svg { width: 24px; height: 24px; fill: #333; display: block; }
  .composer-input .mb-btn.on svg { fill: var(--wx-green); }

  .composer-input .mb-btn .mb-plus {
    width: 22px; height: 22px; border: 1.6px solid #333; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; line-height: 1; font-weight: 400; color: #333;
  }

  /* 移动端隐藏桌面专属按钮 */
  .pc-only { display: none !important; }

  /* 底部安全区 */
  .composer { padding-bottom: env(safe-area-inset-bottom); }

  /* 弹窗：靠底摆放，避免软键盘遮住「保存昵称」按钮 */
  .modal-mask { padding: 0; align-items: flex-end; }
  .modal {
    width: 100% !important; max-width: 100%;
    border-radius: 12px 12px 0 0;
    max-height: 82vh;
  }
  .modal-foot {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    flex-wrap: wrap;
  }
  .modal-foot .btn { height: 38px; font-size: 14px; }
  .form-row input { font-size: 16px; }  /* 防止 iOS 聚焦自动放大 */
}

.back-btn svg { width: 22px; height: 22px; fill: #333; }

/* ============================================================
   移动端语音模式：隐藏工具栏 / 已隐藏输入框保持关闭
   ============================================================ */
@media (max-width: 767px) {
  .composer.voice-mode .composer-tools { display: none; }
  .composer.voice-mode .composer-actions { display: none; }
  .composer.voice-mode .emoji-panel { display: none !important; }
  /* 手机端：语音模式下也得能一键回到打字（含发送按钮） */
  .composer.voice-mode #mb-send { display: none; }
  .composer.voice-mode .voice-exit { display: flex; }
  .voice-exit { height: 40px; width: 40px; flex: 0 0 40px; }
}

/* 滚动条美化 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,.16); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.28); }
::-webkit-scrollbar-track { background: transparent; }





