/* ── CSS 变量（主题变量桥接）────── */
:root {
  /* 桥接到主题系统变量（由 themes/*.css 覆盖） */
  --primary:       #07c160;
  --primary-dark:  #06ae56;
  --primary-light: #e8f8f0;
  --bg-sidebar:    #2c2c2c;
  --bg-conv-panel: #f7f7f7;
  --bg-chat:       #ededed;
  --bg-msg-out:    #95ec69;
  --bg-msg-in:     #ffffff;
  --text-msg-out:  #000000;
  --text-msg-in:   #000000;
  --avatar-radius: 6px;
  --msg-radius:    8px;
  --conv-item-hover:   #ebebeb;
  --conv-item-active:  #d4edda;
  --input-bg:      #ffffff;
  --border-color:  #e5e5e5;
  --tabbar-bg:     #f7f7f7;
  --tabbar-active: #07c160;
  --sidebar-icon-active: #07c160;

  /* 内部别名（保持向后兼容） */
  --green:        var(--primary);
  --green-dark:   var(--primary-dark);
  --green-light:  var(--primary-light);
  --green-bubble: var(--bg-msg-out);
  --blue:         #409eff;
  --blue-dark:    #337ecc;
  --sidebar-bg:   var(--bg-sidebar);
  --panel-bg:     var(--bg-conv-panel);
  --chat-bg:      var(--bg-chat);
  --white:        var(--input-bg);
  --border:       var(--border-color);
  --text-main:    #1a1a1a;
  --text-sub:     #999999;
  --text-light:   #bbbbbb;
  --hover:        var(--conv-item-hover);
  --active:       var(--conv-item-active);
  --radius-sm:    6px;
  --radius-md:    10px;
  --radius-lg:    18px;
  --shadow-sm:    0 1px 4px rgba(0,0,0,0.08);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--chat-bg);
  height: 100vh;
  overflow: hidden;
  color: var(--text-main);
  font-size: 14px;
}

/* ══════════════════════════════════════════════
   登录页
══════════════════════════════════════════════ */
#login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
}

.login-card {
  background: var(--white);
  border-radius: 16px;
  padding: 44px 40px 36px;
  width: 380px;
  box-shadow: var(--shadow-md);
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}

.login-logo .icon { font-size: 38px; }
.login-logo h1    { font-size: 26px; color: var(--green); font-weight: 700; letter-spacing: 1px; }

.login-subtitle {
  text-align: center;
  color: var(--text-sub);
  font-size: 13px;
  margin-bottom: 32px;
}

.form-group { margin-bottom: 14px; position: relative; }

.form-group input {
  width: 100%;
  padding: 11px 16px 11px 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  background: #fafafa;
  outline: none;
  transition: all 0.2s;
  color: var(--text-main);
}

.form-group input:focus {
  border-color: var(--green);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(7,193,96,0.12);
}

.form-group .input-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: #c0c0c0;
  font-size: 15px;
  pointer-events: none;
}

.error-msg {
  color: #f56c6c;
  font-size: 12px;
  min-height: 18px;
  margin: -6px 0 8px 2px;
}

.btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--green);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 2px;
}

.btn-primary:hover  { background: var(--green-dark); }
.btn-primary:active { transform: scale(0.98); }

.toggle-mode {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-sub);
}

.toggle-mode a {
  color: var(--green);
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
}

.toggle-mode a:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════
   主界面布局
══════════════════════════════════════════════ */
#main-page { display: flex; height: 100vh; height: 100dvh; }

/* ── 左侧图标导航栏 ── */
.sidebar {
  width: 54px;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
  flex-shrink: 0;
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 15px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.sidebar-avatar:hover { opacity: 0.85; }

.sidebar-btn {
  width: 40px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #888;
  font-size: 19px;
  margin-bottom: 1px;
  transition: all 0.15s;
  position: relative;
  flex-shrink: 0;
}

.sidebar-btn:hover  { background: rgba(255,255,255,0.08); color: #ddd; }
.sidebar-btn.active { background: rgba(255,255,255,0.12); color: white; }

.sidebar-spacer { flex: 1; }

.sidebar-btn .tooltip {
  position: absolute;
  left: 48px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.72);
  color: white;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  white-space: nowrap;
  display: none;
  z-index: 999;
  pointer-events: none;
}

.sidebar-btn:hover .tooltip { display: block; }

/* ── 会话列表面板 ── */
.conv-panel {
  width: 240px;
  background: var(--panel-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.conv-panel-header {
  padding: 14px 10px 8px;
  background: var(--panel-bg);
}

.conv-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.conv-panel-title h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-sub);
  transition: background 0.15s;
}
/* SVG 图标在 icon-btn 里的颜色继承 */
.icon-btn .lc { color: inherit; }

.icon-btn:hover { background: var(--border); color: var(--text-main); }

.search-wrap { position: relative; }

.search-wrap::before {
  content: "🔍";
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 6px 12px 6px 28px;
  border: none;
  border-radius: 20px;
  background: #e0e0e0;
  font-size: 12px;
  outline: none;
  color: var(--text-main);
  transition: background 0.2s;
}

.search-input:focus { background: #d4d4d4; }

.conv-list {
  flex: 1;
  overflow-y: auto;
}

.conv-item {
  display: flex;
  align-items: center;
  padding: 10px 10px;
  cursor: pointer;
  transition: background 0.12s;
  gap: 10px;
  border-bottom: none;
}

.conv-item:hover  { background: var(--hover); }
.conv-item.active { background: var(--active); }

.avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--avatar-radius);          /* 主题头像圆角 */
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
  position: relative;
}

.badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #f44336;
  color: white;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
  font-weight: 600;
  line-height: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  pointer-events: none;
}

.conv-info { flex: 1; min-width: 0; }

.conv-name-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}

.conv-name { font-size: 14px; font-weight: 500; color: var(--text-main); }
.conv-time { font-size: 11px; color: var(--text-light); flex-shrink: 0; }
.conv-last {
  font-size: 12px;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── 聊天区域 ── */
.tab-content {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;        /* 撑满父容器 */
  overflow: hidden;
  background: var(--white);
}

.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--chat-bg);
  color: #c0c0c0;
  gap: 12px;
}

.chat-empty .icon { font-size: 56px; opacity: 0.5; }
.chat-empty p     { font-size: 15px; }

.chat-header {
  padding: 0 16px;
  height: 54px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.chat-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}

.chat-header-actions { display: flex; gap: 2px; }

/* ── 消息区 ── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 20px;
  background: var(--chat-bg);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;       /* flex 子元素 overflow 生效的关键 */
}

.msg-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.msg-row.mine { flex-direction: row-reverse; }

.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--avatar-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  position: relative;   /* 供图片绝对定位 */
  overflow: hidden;
}

.msg-content {
  max-width: 60%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.msg-row.mine .msg-content { align-items: flex-end; }

.bubble {
  padding: 9px 13px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
  position: relative;
}

/* 对方气泡：白色 + 左小尖角 */
.bubble.theirs {
  background: var(--bg-msg-in);
  color: var(--text-msg-in);
  border-radius: 0 var(--msg-radius) var(--msg-radius) var(--msg-radius);
  box-shadow: var(--shadow-sm);
}

/* 自己气泡：主题色 + 右小尖角 */
.bubble.mine {
  background: var(--bg-msg-out);
  color: var(--text-msg-out);
  border-radius: var(--msg-radius) 0 var(--msg-radius) var(--msg-radius);
  box-shadow: var(--shadow-sm);
}

.msg-time {
  font-size: 11px;
  color: var(--text-light);
  padding: 0 4px;
}

/* ── 输入区 ── */
.chat-input-area {
  background: var(--white);
  border-top: 1px solid var(--border);
  flex-shrink: 0;     /* 输入区不压缩，消息区自动收缩 */
}

.chat-toolbar {
  padding: 6px 10px 2px;
  display: flex;
  gap: 2px;
}

.chat-input-row {
  display: flex;
  align-items: flex-end;
  padding: 6px 10px 10px;
  gap: 8px;
}

#msg-input {
  flex: 1;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  resize: none;
  max-height: 100px;
  background: var(--input-bg);
  font-family: inherit;
  transition: border-color 0.2s;
  line-height: 1.5;
  color: var(--text-main);
}

#msg-input:focus { border-color: var(--green); }

.send-btn {
  width: 64px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--green);
  background: var(--white);
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  letter-spacing: 1px;
}

.send-btn:hover  { background: var(--green); color: white; }
.send-btn:active { background: var(--green-dark); color: white; }

/* ── 滚动条 ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* ── 工具 ── */
.hidden { display: none !important; }

/* ══════════════════════════════════════════════
   好友/通讯录面板
══════════════════════════════════════════════ */
.contacts-panel {
  width: 240px;
  background: var(--panel-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.contacts-header {
  padding: 14px 12px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.contacts-header h2 { font-size: 15px; font-weight: 600; }

.contacts-list { flex: 1; overflow-y: auto; }

/* 官方客服功能入口（通讻录顶部） */
.contacts-feature-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f5f5f5;
  transition: background 0.12s;
}
.contacts-feature-entry:hover { background: var(--hover); }
.contacts-feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.contacts-feature-label {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  color: #222;
}

/* 官方客服面板 Tab 按钮 */
.oa-tab-btn {
  background: none;
  border: none;
  font-size: 14px;
  color: #999;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  transition: all 0.15s;
}
.oa-tab-btn.active {
  color: #fa8c16;
  background: rgba(250, 140, 22, 0.1);
  font-weight: 600;
}

/* 官方客服 Feed 动态卡片 */
.oa-post-card {
  background: #fff;
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.oa-post-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.oa-post-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 8px;
}
.oa-post-card-author {
  font-size: 13px;
  font-weight: 500;
  color: #666;
}
.oa-post-card-body {
  padding: 0 14px 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.oa-post-card-text { flex: 1; min-width: 0; }
.oa-post-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #222;
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.oa-post-card-summary {
  font-size: 13px;
  color: #999;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.oa-post-card-cover {
  width: 80px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f0f0f0;
}
.oa-post-card-date {
  font-size: 12px;
  color: #bbb;
  padding: 0 14px 10px;
}

/* 官方客服关注列表 */
.oa-account-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #f5f5f5;
  cursor: pointer;
  transition: background 0.12s;
}
.oa-account-item:hover { background: #fafafa; }
.oa-account-item-info { flex: 1; min-width: 0; }
.oa-account-item-name { font-size: 15px; font-weight: 600; color: #222; }
.oa-account-item-bio { font-size: 13px; color: #999; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oa-account-item-count { font-size: 12px; color: #bbb; }

.contact-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  gap: 10px;
  transition: background 0.12s;
}

.contact-item:hover  { background: var(--hover); }
.contact-item.active { background: var(--active); }

.contact-info { flex: 1; min-width: 0; }
.contact-name { font-size: 14px; font-weight: 500; }
.contact-remark { font-size: 12px; color: var(--text-sub); }

.contacts-section-title {
  padding: 8px 12px 4px;
  font-size: 12px;
  color: var(--text-sub);
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* 好友详情面板（右侧） */
/* ── 通讯录右侧 - 好友资料卡（微信风格）── */
.friend-detail {
  flex: 1;
  background: #f5f5f5;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* 空状态 */
.friend-detail-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ccc;
  gap: 12px;
}

/* 顶部彩色横幅 */
.fd-banner {
  height: 120px;
  background: linear-gradient(135deg, var(--primary, #07c160) 0%, #059a4d 100%);
  flex-shrink: 0;
  position: relative;
}

/* 资料区（头像悬浮在横幅上） */
.fd-profile {
  background: #fff;
  padding: 0 20px 20px;
  margin-bottom: 10px;
  position: relative;
}

.fd-avatar-wrap {
  position: absolute;
  top: -36px;
  left: 20px;
}

.fd-avatar {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  background: #1a73e8;
  color: #fff;
  font-size: 30px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}

/* 名字/账号区（要给头像留位置） */
.fd-info {
  padding-top: 44px;
}

.fd-name {
  font-size: 20px;
  font-weight: 700;
  color: #111;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.fd-username {
  font-size: 13px;
  color: #999;
  margin-top: 2px;
}

.fd-bio {
  font-size: 13px;
  color: #666;
  margin-top: 6px;
  line-height: 1.5;
}

/* 操作按钮栏 */
.fd-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.fd-btn {
  flex: 1;
  padding: 10px 0;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.fd-btn:hover { opacity: .85; }
.fd-btn-primary { background: var(--primary, #07c160); color: #fff; }
.fd-btn-default { background: #f0f0f0; color: #333; }
.fd-btn-danger  { background: #fff; color: #f44336; border: 1px solid #fcc; }

/* 信息列表区 */
.fd-section {
  background: #fff;
  margin-bottom: 10px;
}

.fd-row {
  display: flex;
  align-items: center;
  padding: 13px 20px;
  border-bottom: 1px solid #f5f5f5;
  font-size: 14px;
  cursor: pointer;
  transition: background .1s;
}
.fd-row:hover { background: #fafafa; }
.fd-row:last-child { border-bottom: none; }
.fd-row-label { color: #999; width: 70px; flex-shrink: 0; }
.fd-row-value { flex: 1; color: #222; }
.fd-row-edit  { color: #ccc; font-size: 12px; }

/* 删除好友 - 底部危险区 */
.fd-danger-section {
  background: #fff;
  margin-top: 10px;
}

/* 备注编辑行内展开 */
.fd-remark-editor {
  padding: 10px 20px 16px;
  background: #fafafa;
  border-top: 1px solid #f0f0f0;
  display: none;
}
.fd-remark-editor input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  margin-bottom: 8px;
}
.fd-remark-editor input:focus { border-color: var(--primary, #07c160); }
.fd-remark-editor-btns {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* 旧样式兼容 */
.friend-action-btn {
  padding: 8px 20px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: white;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}
.friend-action-btn.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.friend-action-btn:hover { opacity: 0.85; }

.remark-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}

.remark-input-row input {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  width: 160px;
}

.remark-input-row input:focus { border-color: var(--green); }

/* ══════════════════════════════════════════════
   弹窗（添加好友 / 图片预览）
══════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* 资料卡始终在所有弹窗最顶层 */
#profile-modal {
  z-index: 1200 !important;
}

.modal {
  background: white;
  border-radius: 12px;
  width: 400px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  overflow: hidden;
}

.modal-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 { font-size: 16px; font-weight: 600; }

.modal-close {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-sub);
  display: flex; align-items: center; justify-content: center;
}

.modal-close:hover { background: var(--hover); }

.modal-body { padding: 16px 20px; flex: 1; overflow-y: auto; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: nowrap; }
.modal-footer button { white-space: nowrap; flex-shrink: 0; }

/* ── 添加好友弹窗（全屏搜索风格）──────────────────────────── */
#add-friend-modal .modal {
  width: min(460px, 96vw);
  max-height: 72vh;
}

.add-friend-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px 14px;
  border-bottom: 1px solid var(--border);
}

.add-friend-search-wrap .search-icon {
  color: #aaa;
  flex-shrink: 0;
  font-size: 15px;
}

.modal-search {
  flex: 1;
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: 22px;
  font-size: 14px;
  outline: none;
  background: #f7f7f7;
  transition: border-color .2s, background .2s;
}

.modal-search:focus {
  border-color: var(--green);
  background: #fff;
}

/* 搜索提示占位 */
.friend-search-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 20px;
  color: #bbb;
  gap: 10px;
  font-size: 13px;
}

.friend-search-hint .hint-icon { font-size: 40px; opacity: .5; }

/* 搜索结果列表 */
#friend-search-results {
  padding: 8px 12px 0;
}

.search-result-item {
  display: flex;
  align-items: center;
  padding: 12px 10px;
  gap: 12px;
  border-radius: 10px;
  cursor: default;
  transition: background 0.12s;
}

.search-result-item:hover { background: var(--hover); }

.search-result-avatar {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.search-result-info { flex: 1; min-width: 0; }
.search-result-name {
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-username { font-size: 12px; color: var(--text-sub); margin-top: 2px; }

/* 添加按钮（状态机）*/
.add-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--green);
  color: var(--green);
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.add-btn:hover:not(:disabled) {
  background: var(--green);
  color: #fff;
}

.add-btn:disabled {
  cursor: default;
}

.add-btn.sent {
  border-color: #aaa;
  color: #aaa;
  background: #f5f5f5;
}

.add-btn.is-friend {
  border-color: #1a73e8;
  color: #1a73e8;
  background: #f0f5ff;
}

/* 待处理申请卡片 */
/* ── 群邀请卡片 ── */
.group-inv-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #ffe082;
  background: linear-gradient(135deg, #fffde7 0%, #fff8e1 100%);
  margin-bottom: 8px;
  box-shadow: 0 1px 4px rgba(255,160,0,.1);
}
.group-inv-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ff9800, #f57c00);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(255,152,0,.3);
}
.group-inv-body {
  flex: 1;
  min-width: 0;
}
.group-inv-name {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.group-inv-meta {
  font-size: 12px;
  color: #888;
  margin-bottom: 10px;
}
.group-inv-actions {
  display: flex;
  gap: 8px;
}
.inv-btn {
  flex: 1;
  padding: 6px 0;
  border-radius: 8px;
  border: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.inv-btn:active { transform: scale(.97); }
.inv-btn.accept {
  background: #07c160;
  color: #fff;
}
.inv-btn.accept:hover { opacity: .88; }
.inv-btn.reject {
  background: #f5f5f5;
  color: #666;
  border: 1px solid #e0e0e0;
}
.inv-btn.reject:hover { background: #ffe5e5; color: #e53935; border-color: #ffcdd2; }
.inv-btn:disabled { opacity: .5; cursor: default; }

.pending-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #f0f0f0;
  margin-bottom: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

.pending-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.pending-info { flex: 1; min-width: 0; }

.pending-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pending-desc {
  font-size: 12px;
  color: #aaa;
  margin-top: 2px;
}

.pending-actions { display: flex; gap: 6px; flex-shrink: 0; }

.pending-accept-btn {
  padding: 5px 14px;
  border-radius: 16px;
  border: none;
  background: var(--green);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity .15s;
}

.pending-accept-btn:hover { opacity: .85; }
.pending-accept-btn:disabled { opacity: .5; cursor: default; }

.pending-decline-btn {
  padding: 5px 14px;
  border-radius: 16px;
  border: 1.5px solid #ddd;
  background: #fff;
  color: #888;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}

.pending-decline-btn:hover { border-color: #f44336; color: #f44336; }
.pending-decline-btn:disabled { opacity: .5; cursor: default; }

/* 好友申请徽标 */
.friend-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f44336;
  border: 1.5px solid #fff;
  pointer-events: none;
}

/* 图片预览弹窗 */
.img-preview-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  cursor: zoom-out;
}

.img-preview-modal img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 4px;
  object-fit: contain;
}

/* ══════════════════════════════════════════════
   表情面板
══════════════════════════════════════════════ */
.emoji-panel {
  position: absolute;
  bottom: 110px;
  left: 10px;
  width: 320px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  padding: 10px;
  z-index: 500;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.emoji-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  background: transparent;
  transition: background 0.12s;
}

.emoji-btn:hover { background: var(--hover); }

/* ══════════════════════════════════════════════
   消息中的图片/文件
══════════════════════════════════════════════ */
.msg-image {
  max-width: 220px;
  max-height: 180px;
  border-radius: 8px;
  cursor: zoom-in;
  object-fit: cover;
  display: block;
}

.msg-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: white;
  border-radius: 8px;
  border: 1px solid var(--border);
  min-width: 180px;
  cursor: pointer;
  text-decoration: none;
}

.msg-file:hover { background: #f8f8f8; }
.msg-file-icon { font-size: 28px; }
.msg-file-info { flex: 1; min-width: 0; }
.msg-file-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-main); }
.msg-file-size { font-size: 11px; color: var(--text-sub); }

/* 进度条（上传中） */
.upload-progress {
  width: 100%;
  height: 3px;
  background: #e0e0e0;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.upload-progress-bar {
  height: 100%;
  background: var(--green);
  border-radius: 2px;
  transition: width 0.3s;
}

/* ══════════════════════════════════════════════
   朋友圈
══════════════════════════════════════════════ */
.moment-publish-box {
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.moment-card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}

.moment-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.moment-username { font-size: 14px; font-weight: 600; color: var(--green); }
.moment-time     { font-size: 12px; color: var(--text-sub); }

.moment-visibility-tag {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  background: #f0f0f0;
  color: #888;
}

.moment-system-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #fff3e0;
  color: #f57c00;
  font-weight: 600;
}

.moment-content {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-main);
  margin-bottom: 10px;
  white-space: pre-wrap;
  word-break: break-word;
}

.moment-media {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.moment-media img {
  width: calc(33% - 4px);
  min-width: 80px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  cursor: zoom-in;
}

.moment-media img:only-child {
  width: 200px;
  aspect-ratio: unset;
  max-height: 300px;
}

.moment-actions {
  display: flex;
  gap: 16px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
}

.moment-action-btn {
  background: transparent;
  border: none;
  font-size: 13px;
  color: var(--text-sub);
  cursor: pointer;
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s;
}

.moment-action-btn:hover  { color: var(--green); }
.moment-action-btn.liked  { color: #f44336; }

.moment-likes {
  font-size: 13px;
  color: #f44336;
  margin-bottom: 6px;
}

.moment-comments {
  border-top: 1px solid #f5f5f5;
  padding-top: 8px;
  margin-top: 6px;
}

.moment-comment-item {
  font-size: 13px;
  padding: 4px 0;
  line-height: 1.5;
}

.moment-comment-author { font-weight: 600; color: var(--green); }

.moment-comment-input {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.moment-comment-input input {
  flex: 1;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: 13px;
  outline: none;
}

.moment-comment-input input:focus { border-color: var(--green); }

.moment-comment-input button {
  padding: 6px 14px;
  background: var(--green);
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 13px;
  cursor: pointer;
}

/* ══════════════════════════════════════════════
   徽章系统
══════════════════════════════════════════════ */
.badge-official { display:inline-block; background:#1677ff; color:#fff; font-size:10px; padding:1px 4px; border-radius:3px; margin-left:3px; vertical-align:middle; font-style:normal; }
.badge-vip { display:inline-block; background:#f5a623; color:#fff; font-size:10px; padding:1px 4px; border-radius:3px; margin-left:3px; vertical-align:middle; }
.badge-member { display:inline-block; background:#ff6b35; color:#fff; font-size:10px; padding:1px 4px; border-radius:3px; margin-left:3px; vertical-align:middle; }
.badge-cs { display:inline-block; background:#07c160; color:#fff; font-size:10px; padding:1px 4px; border-radius:3px; margin-left:3px; vertical-align:middle; }
.badge-official-account { display:inline-block; background:#fa8c16; color:#fff; font-size:10px; padding:1px 4px; border-radius:3px; margin-left:3px; vertical-align:middle; }
.badge-system { display:inline-block; background:#FFD700; color:#000; font-size:10px; padding:1px 4px; border-radius:3px; margin-left:3px; vertical-align:middle; font-weight:bold; }

/* 官方客服/客服头像方形 */
.avatar-official { border-radius: 8px !important; background: #07c160 !important; }
.avatar-cs { border-radius: 8px !important; background: #1a73e8 !important; }
.tag-official { display:inline-block; background:#1677ff; color:#fff; font-size:10px; padding:1px 5px; border-radius:3px; margin-left:4px; vertical-align:middle; }
.tag-cs { display:inline-block; background:#FFD700; color:#000; font-size:10px; padding:1px 5px; border-radius:3px; margin-left:4px; vertical-align:middle; font-weight:bold; }
.tag-system { display:inline-block; background:#9c27b0; color:#fff; font-size:10px; padding:1px 5px; border-radius:3px; margin-left:4px; vertical-align:middle; }
.tag-system-cs { display:inline-block; background:#FFD700; color:#000; font-size:10px; padding:1px 5px; border-radius:3px; margin-left:4px; vertical-align:middle; font-weight:bold; }
.contacts-section-title { padding:6px 16px; font-size:12px; color:#999; background:#f5f5f5; font-weight:500; letter-spacing:0.5px; }

/* 响应式底部 tabbar */
.bottom-tabbar { display:none; position:fixed; bottom:0; left:0; right:0; height:56px; background:var(--tabbar-bg,#f7f7f7); border-top:1px solid #eee; z-index:200; }
.bottom-tabbar .btab { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; font-size:10px; color:#999; border:none; background:none; cursor:pointer; gap:1px; padding:0; }
.bottom-tabbar .btab .btab-icon { font-size:22px; line-height:1; display:flex; align-items:center; justify-content:center; }
.bottom-tabbar .btab .btab-icon .lc { width:22px; height:22px; }
.bottom-tabbar .btab.active { color:var(--tabbar-active,#07c160); }
.back-btn { display:none; background:none; border:none; font-size:22px; cursor:pointer; padding:0 10px; color:#333; line-height:1; }

@media (max-width: 768px) {
  /* ── 基础布局 ── */
  .sidebar { display:none !important; }
  /* tabbar 由 JS 在登录成功后通过 classList 控制显示（见 initMain） */
  .bottom-tabbar { display:none; }
  .bottom-tabbar.visible { display:flex !important; }
  .back-btn { display:block !important; }

  /* ── Tab 内容底部留出 tabbar 高度 ── */
  #tab-chats    { padding-bottom: 56px; }
  #tab-contacts { padding-bottom: 56px; }
  #tab-moments  { padding-bottom: 56px; }
  #tab-groups   { padding-bottom: 56px; }
  #tab-wallet   { padding-bottom: 56px; }

  /* ── 会话列表 & 聊天主区 全宽 ── */
  .conv-panel { width:100% !important; min-width:0 !important; max-width:100% !important; border-right:none !important; }
  .chat-main  { width:100% !important; min-width:0 !important; }

  /* ── 聊天全屏：进入聊天时隐藏列表，显示 chat-main ── */
  .mobile-in-chat .conv-panel  { display:none !important; }
  .mobile-in-chat .chat-main   { display:flex !important; }
  /* 聊天模式下 tab-chats 不需要给 tabbar 预留空间（tabbar 已隐藏） */
  .mobile-in-chat { padding-bottom: 0 !important; }

  /* ── 输入区 safe-area 兼容 ── */
  .input-area { padding-bottom: calc(8px + env(safe-area-inset-bottom,0px)); }

  /* ── 键盘适配核心：#main-page 固定定位，高度/top 由 JS 根据 visualViewport 控制 ── */
  /* 这样键盘弹出时容器高度自动收缩，子元素无需写死 dvh */
  #main-page {
    position: fixed !important;
    top: 0; left: 0; right: 0;
    /* height 由 JS applyViewportHeight 动态设置，initial = 100dvh */
    height: 100dvh !important;
  }

  /* tab-content 跟随父容器高度，不能自己写死 dvh */
  .tab-content {
    height: 100% !important;
    flex: 1 1 0 !important;
    min-height: 0 !important;
  }

  /* chat-messages 自动占满剩余空间，给输入区让路 */
  .chat-messages {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  /* 输入区：不压缩、贴底、安全区兼容 */
  .chat-input-area {
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    /* 确保在 flex 列里始终可见，不被裁剪 */
    position: relative;
    z-index: 10;
  }
  /* 输入框那行底部留出导航栏高度 */
  .chat-input-row {
    padding-bottom: max(env(safe-area-inset-bottom, 0px), 10px) !important;
  }

  /* chat-main 在移动端聊天模式下：flex 列，撑满视口 */
  .mobile-in-chat .chat-main {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    overflow: hidden !important;
  }

  /* ── 朋友圈图片双列 ── */
  .moment-media img { max-width: 48%; }

  /* ── 通讯录：左侧列表全宽，右侧资料卡隐藏（由 JS 控制 overlay） ── */
  .contacts-panel  { width:100% !important; min-width:0 !important; }
  #friend-detail   { display:none !important; }

  /* ── 好友资料卡 overlay（移动端） ── */
  #friend-detail.mobile-overlay {
    display: flex !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 500 !important;
    background: #f5f5f5 !important;
    flex-direction: column !important;
    overflow-y: auto !important;
  }
  /* 顶部关闭栏 */
  #friend-detail.mobile-overlay .fd-close-bar {
    display: flex !important;
  }

  /* 群聊：同会话列表全屏逻辑 */
  #tab-groups .conv-panel { width:100% !important; min-width:0 !important; max-width:100% !important; border-right:none !important; }
  #tab-groups .chat-main  { width:100% !important; min-width:0 !important; }
  .mobile-in-group-chat #group-list-panel  { display:none !important; }
  .mobile-in-group-chat #group-chat-main   { display:flex !important; }
  .mobile-in-group-chat #group-chat-empty  { display:none !important; }

  /* ── bottom tabbar 触摸优化 ── */
  .bottom-tabbar .btab { min-height: 56px; min-width: 44px; }
  .bottom-tabbar .btab:hover { color: inherit; } /* 去除 hover */
  .bottom-tabbar .btab:active { opacity: 0.6; }

  /* ── 通用触摸优化：移除 hover，加 active 反馈 ── */
  .conv-item:hover   { background: transparent; }
  .conv-item:active  { background: rgba(0,0,0,0.06); }
  .contact-item:hover  { background: transparent; }
  .contact-item:active { background: rgba(0,0,0,0.06); }
  .fd-btn:hover { opacity: 1; }
  .fd-btn:active { opacity: 0.7; }
  .fd-row:hover  { background: transparent; }
  .fd-row:active { background: rgba(0,0,0,0.06); }

  /* ── 最小点击区域 44px ── */
  .conv-item    { min-height: 44px; }
  .contact-item { min-height: 44px; }
  .fd-btn       { min-height: 44px; }
  .back-btn     { min-height: 44px; min-width: 44px; }

  /* ── 弹窗 bottom sheet 风格 ── */
  .modal-overlay { align-items: flex-end; }
  .modal {
    width: 100vw !important;
    max-width: 100vw !important;
    border-radius: 16px 16px 0 0 !important;
    max-height: 90vh !important;
    margin: 0 !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  }
}
@media (min-width:769px) and (max-width:1024px) {
  .conv-panel { width:220px !important; min-width:220px !important; }
  .contacts-panel { width:220px !important; min-width:220px !important; }
}

/* ════════════════════════════════════════════
   群聊 & 钱包 扩展样式
════════════════════════════════════════════ */

/* ══════════════════════════════════════════
   设置页 & 头像选择  ·  精美重设计版
══════════════════════════════════════════ */

/* ── 整体背景 ── */
#tab-settings {
  background: linear-gradient(180deg, #f0f4f8 0%, #f5f7fa 100%) !important;
}

/* ── 顶部 Hero 个人卡片 ── */
.settings-profile-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 28px 20px 22px;
  background: linear-gradient(135deg, var(--primary, #07c160) 0%, #05a04e 100%);
  cursor: pointer;
  margin: 0 0 16px;
  overflow: hidden;
  transition: filter .15s;
}
.settings-profile-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0) radial-gradient(circle at 80% 20%, rgba(255,255,255,.18) 0%, transparent 60%);
  pointer-events: none;
}
.settings-profile-card::after {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  pointer-events: none;
}
.settings-profile-card:hover { filter: brightness(1.05); }

.settings-avatar-wrap {
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.settings-avatar {
  width: 68px;
  height: 68px;
  border-radius: 16px;
  background: rgba(255,255,255,.25);
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2.5px solid rgba(255,255,255,.5);
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
}
.settings-profile-info { flex: 1; min-width: 0; position: relative; z-index: 1; }
.settings-profile-name {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.settings-profile-sub  { font-size: 13px; color: rgba(255,255,255,.8); margin-top: 3px; }
.settings-profile-bio  { font-size: 13px; color: rgba(255,255,255,.75); margin-top: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 卡片右侧箭头改白色 */
.settings-profile-card > span[style*="color:#ccc"] { color: rgba(255,255,255,.7) !important; }

/* ── Section 容器 ── */
.settings-section {
  background: #fff;
  margin: 0 12px 12px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0,0,0,.06), 0 0 0 .5px rgba(0,0,0,.04);
}

/* Section 标题 */
.settings-section-label {
  padding: 12px 16px 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  color: #8e9cad;
  text-transform: uppercase;
  background: transparent;
}

/* ── 功能行 ── */
.settings-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 16px;
  cursor: pointer;
  border-bottom: .5px solid rgba(0,0,0,.055);
  transition: background .12s;
  position: relative;
}
.settings-row:hover { background: #f7f9fc; }
.settings-row:active { background: #eef2f7; }
.settings-row:last-child { border-bottom: none; }

/* 图标背景胶囊 */
.settings-row-icon {
  font-size: 16px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f0f2f5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-align: center;
  line-height: 32px;
}
.settings-row-label { flex: 1; font-size: 15px; color: #1a1a1a; font-weight: 450; }
.settings-row-arrow {
  color: #b0bec5;
  font-size: 17px;
  font-weight: 300;
  line-height: 1;
}

/* 退出登录行特殊样式 */
.settings-row[onclick*="doLogoutUser"] .settings-row-icon { background: #fff1f0; }
.settings-row[onclick*="doLogoutUser"]:hover { background: #fff5f5; }

/* 上传按钮 */
.avatar-upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border: 2px dashed #e0e0e0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  color: #666;
  transition: all .15s;
  box-sizing: border-box;
}
.avatar-upload-btn:hover { border-color: var(--primary, #07c160); color: var(--primary, #07c160); background: #f9fff9; }

/* 预置头像网格 */
.preset-avatars {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.preset-avatar-item {
  aspect-ratio: 1;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  border: 2px solid transparent;
}
.preset-avatar-item:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  border-color: var(--primary, #07c160);
}

/* ══════════════════════════════════════════
   用户资料卡（微信风格）
══════════════════════════════════════════ */
.profile-card {
  background: #fff;
  border-radius: 16px;
  width: 320px;
  max-width: 92vw;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0,0,0,0.22);
}

.profile-card-banner {
  height: 100px;
  background: linear-gradient(135deg, var(--primary, #07c160) 0%, #059a4d 100%);
  position: relative;
  flex-shrink: 0;
}

.profile-close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  background: rgba(0,0,0,.15);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.profile-close-btn:hover { background: rgba(0,0,0,.28); }

.profile-card-body {
  padding: 0 20px 20px;
  position: relative;
}

.profile-card-avatar-wrap {
  position: absolute;
  top: -40px;
  left: 20px;
}

.profile-card-avatar {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  background: #1a73e8;
  color: #fff;
  font-size: 36px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  overflow: hidden;
}

.profile-card-info {
  padding-top: 48px;   /* 给头像让位 */
}

.profile-card-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.profile-card-name {
  font-size: 20px;
  font-weight: 700;
  color: #111;
}

.profile-card-username {
  font-size: 13px;
  color: #999;
  margin-top: 3px;
}

.profile-card-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.profile-card-bio {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  margin-top: 10px;
  min-height: 0;
  white-space: pre-wrap;
}

.profile-card-divider {
  height: 1px;
  background: #f0f0f0;
  margin: 14px 0;
}

.profile-card-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 16px;
}

.profile-card-row {
  display: flex;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid #f8f8f8;
}
.profile-card-row:last-child { border-bottom: none; }
.profile-card-row-label { color: #999; width: 64px; flex-shrink: 0; }
.profile-card-row-value { color: #333; flex: 1; }

.profile-card-actions {
  display: flex;
  gap: 10px;
}

.profile-action-btn {
  flex: 1;
  padding: 10px 8px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: opacity .15s;
  background: #f5f5f5;
  color: #333;
}
.profile-action-btn.primary {
  background: var(--primary, #07c160);
  color: #fff;
}
.profile-action-btn:hover { opacity: .85; }

.profile-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 500;
}
.profile-tag.blue   { background:#e8f4ff; color:#1677ff; }
.profile-tag.red    { background:#ffeaea; color:#e53935; }
.profile-tag.green  { background:#e8fff0; color:#07c160; }
.profile-tag.gold   { background:#fff8e6; color:#f5a623; }
.profile-tag.orange { background:#fff3ee; color:#ff6b35; }
.profile-tag.gray   { background:#f0f0f0; color:#666; }

/* ── 转账搜索结果列表 ── */
.transfer-user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background .1s;
  border-bottom: 1px solid #f5f5f5;
}
.transfer-user-item:last-child { border-bottom: none; }
.transfer-user-item:hover { background: #f5f9ff; }

/* ── tab pill ── */
.tab-pill {
  padding: 4px 14px;
  border-radius: 20px;
  border: 1px solid #e0e0e0;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  color: #666;
  transition: all .15s;
}
.tab-pill.active {
  background: var(--primary, #07c160);
  color: #fff;
  border-color: var(--primary, #07c160);
}

/* ── 群头像 ── */
.group-avatar {
  background: linear-gradient(135deg, #2aabee, #1b8fce) !important;
  border-radius: 8px !important;
}

/* 群聊列表未读角标 */
.conv-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f44336;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  margin-left: 6px;
  vertical-align: middle;
  line-height: 16px;
}

/* ── 成员面板 ── */
.group-members-panel {
  width: 220px;
  min-width: 220px;
  border-left: 1px solid #e8e8e8;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.group-members-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px;
  border-bottom: 1px solid #f0f0f0;
  font-weight: 600;
  font-size: 14px;
  color: #333;
}
#group-members-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}
.member-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background .1s;
}
.member-item:hover { background: #f5f5f5; }
.member-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1a73e8, #0d47a1);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.member-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.role-badge {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  flex-shrink: 0;
}
.role-badge.owner { background: #fff3e0; color: #e65100; }
.role-badge.admin { background: #e8f5e9; color: #2e7d32; }
.group-members-actions {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid #f0f0f0;
}

/* ── 消息区扩展 ── */
.msg-system {
  text-align: center;
  font-size: 12px;
  color: #999;
  background: rgba(0,0,0,0.04);
  border-radius: 10px;
  padding: 4px 12px;
  margin: 8px auto;
  max-width: 280px;
}
.msg-sender-name {
  font-size: 11px;
  color: #999;
  display: block;
  margin-bottom: 2px;
  padding-left: 2px;
}
.msg-deleted {
  text-align: center;
  font-size: 12px;
  color: #bbb;
  font-style: italic;
  padding: 4px;
}
.msg-reply-quote {
  background: rgba(0,0,0,0.06);
  border-left: 3px solid #aaa;
  padding: 4px 8px;
  border-radius: 4px;
  margin-bottom: 4px;
  cursor: pointer;
  font-size: 12px;
  max-width: 240px;
  overflow: hidden;
}
.reply-quote-name { color: #2aabee; font-weight: 600; margin-right: 4px; }
.reply-quote-text { color: #666; }
.msg-highlight {
  animation: highlight-flash .5s ease-in-out 2;
}
@keyframes highlight-flash {
  0%, 100% { background: transparent; }
  50% { background: #fff9c4; }
}
.msg-menu-btn {
  background: none;
  border: none;
  color: #bbb;
  cursor: pointer;
  font-size: 16px;
  padding: 0 4px;
  opacity: 0;
  transition: opacity .15s;
  flex-shrink: 0;
}
.msg-row:hover .msg-menu-btn { opacity: 1; }

/* ── 群聊消息气泡（微信风格）── */
/* 消息行复用现有 .msg-row / .msg-row.mine / .msg-avatar */

/* msg-content-wrap：消息体（发送者名 + 气泡 + 时间） */
.msg-content-wrap {
  max-width: 60%;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.msg-row.mine .msg-content-wrap {
  align-items: flex-end;
}

/* 气泡：他人（白色，左角圆） */
.msg-bubble {
  padding: 8px 12px;
  border-radius: 2px 8px 8px 8px;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  position: relative;
  color: #1a1a1a;
}

/* 气泡：自己（微信绿，右角圆） */
.msg-bubble.mine {
  background: #95ec69;
  border-radius: 8px 2px 8px 8px;
  color: #1a1a1a;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.msg-bubble.other {
  border-radius: 2px 8px 8px 8px;
}

/* 时间分隔线 */
.group-msg-time {
  text-align: center;
  font-size: 11px;
  color: #bbb;
  margin: 10px 0 4px;
  user-select: none;
}

/* 系统消息（居中灰色小字） */
.group-msg-system-wrap {
  text-align: center;
  margin: 6px 0;
}
.group-msg-system {
  display: inline-block;
  font-size: 12px;
  color: #999;
  background: rgba(0,0,0,0.05);
  border-radius: 10px;
  padding: 2px 10px;
  line-height: 1.6;
}

/* ── 群聊输入区（微信风格）── */
.group-input-area {
  border-top: 1px solid #e5e7eb;
  background: #f7f7f7;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.group-input-toolbar {
  padding: 6px 10px 2px !important;
  border-bottom: 1px solid #ebebeb;
}

.group-input-row {
  padding: 6px 10px 2px;
}

#group-msg-input {
  width: 100%;
  resize: none;
  border: none;
  outline: none;
  font-size: 14px;
  padding: 6px 8px;
  background: #f7f7f7;
  font-family: inherit;
  line-height: 1.5;
  color: var(--text-main);
  min-height: 64px;
  max-height: 140px;
  display: block;
  box-sizing: border-box;
}

#group-msg-input:focus {
  background: #fff;
}

.group-send-row {
  padding: 4px 10px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.group-send-hint {
  font-size: 11px;
  color: #c0c0c0;
}

/* ── 消息上下文菜单 ── */
.msg-context-menu {
  position: fixed;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  z-index: 9000;
  min-width: 140px;
  overflow: hidden;
}
.ctx-item {
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: background .1s;
  color: #333;
}
.ctx-item:hover { background: #f5f5f5; }
.ctx-item.danger { color: #f44336; }

/* ── 红包气泡 ── */
.redpacket-bubble {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #e53935, #b71c1c);
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  min-width: 160px;
  max-width: 220px;
  transition: opacity .15s;
  user-select: none;
}
.redpacket-bubble:hover { opacity: .9; }
.rp-icon { font-size: 28px; }
.rp-info { flex: 1; }
.rp-remark { color: #fff; font-size: 14px; font-weight: 600; }
.rp-hint { color: rgba(255,255,255,.7); font-size: 11px; margin-top: 2px; }

/* ── 红包类型按钮 ── */
.redpacket-type-btn {
  flex: 1;
  padding: 8px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
  color: #666;
}
.redpacket-type-btn.active {
  border-color: #e53935;
  color: #e53935;
  background: #fff5f5;
}

/* ── 弹窗扩展 ── */
.form-field {
  margin-bottom: 14px;
}
.form-field label {
  display: block;
  font-size: 13px;
  color: #666;
  font-weight: 500;
  margin-bottom: 6px;
}
.form-field input, .form-field textarea, .form-field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
  box-sizing: border-box;
}
.form-field input:focus, .form-field textarea:focus {
  border-color: var(--primary, #07c160);
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid #f0f0f0;
  flex-wrap: nowrap;    /* 不换行 */
}
.modal-footer .btn-secondary,
.modal-footer .btn-primary,
.modal-footer button {
  white-space: nowrap;  /* 按钮文字不换行 */
  flex-shrink: 0;
}
.btn-outline {
  padding: 8px 16px;
  border: 1px solid var(--primary, #07c160);
  border-radius: 8px;
  background: #fff;
  color: var(--primary, #07c160);
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
}
.btn-outline:hover { background: var(--primary, #07c160); color: #fff; }
.btn-danger {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: #f44336;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  font-weight: 600;
}
.btn-secondary {
  padding: 10px 20px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  color: #666;
  font-size: 14px;
  cursor: pointer;
}

/* ── 好友选择 checkbox ── */
.friend-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  cursor: pointer;
  border-radius: 8px;
  transition: background .1s;
  font-size: 13px;
  color: #333;
}
.friend-check-item:hover { background: #f5f5f5; }
.friend-check-item input[type=checkbox] {
  width: 16px !important;
  padding: 0 !important;
  border: none !important;
  flex-shrink: 0;
}

/* ── 钱包卡片 ── */
.wallet-card {
  background: linear-gradient(135deg, #1a73e8, #0d47a1);
  border-radius: 16px;
  padding: 24px;
  color: #fff;
  margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(26,115,232,0.3);
}
.wallet-card-label {
  font-size: 13px;
  opacity: 0.8;
  margin-bottom: 8px;
}
.wallet-balance {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -1px;
}
.wallet-balance::before { content: '¥'; font-size: 20px; vertical-align: super; margin-right: 2px; }
.wallet-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.wallet-btn {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 10px;
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s;
  backdrop-filter: blur(4px);
}
.wallet-btn:hover { background: rgba(255,255,255,0.3); }

/* ── 快捷功能 ── */
.wallet-shortcuts {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
.wallet-shortcut-item {
  flex: 1;
  background: #fff;
  border-radius: 12px;
  padding: 16px 8px;
  text-align: center;
  cursor: pointer;
  transition: box-shadow .15s;
  font-size: 12px;
  color: #666;
}
.wallet-shortcut-item:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.1); }
.wallet-shortcut-icon { font-size: 24px; margin-bottom: 6px; }

/* ── 交易记录 ── */
.tx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f5f5f5;
  transition: background .1s;
}
.tx-item:hover { background: #fafafa; }
.tx-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.tx-info { flex: 1; min-width: 0; }
.tx-label { font-size: 14px; font-weight: 500; color: #333; }
.tx-sub { font-size: 12px; color: #999; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-right { text-align: right; flex-shrink: 0; }
.tx-amount { font-size: 15px; font-weight: 700; }
.tx-time { font-size: 11px; color: #bbb; margin-top: 2px; }

/* SVG 图标在侧边栏里居中 */
.sidebar-btn .lc { color: inherit; }
.sidebar-btn[data-tab="wallet"] .lc { /* 钱包图标正常大小 */ }

/* ── 移动端适配（群聊 & 钱包） ── */
@media (max-width: 768px) {
  .group-members-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 60px;
    z-index: 100;
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
  }
  /* 钱包单列 */
  .wallet-shortcuts { flex-wrap: wrap; }
  .wallet-shortcut-item { min-width: calc(33% - 8px); }
}

/* ── 好友资料卡 overlay 关闭栏（默认隐藏，移动端显示） ── */
.fd-close-bar {
  display: none;
  align-items: center;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  z-index: 10;
}
.fd-close-bar-btn {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #333;
  padding: 0 8px 0 0;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* ── E2EE 加密标识 ───────────────────────────────────── */
.e2ee-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  margin-left: 4px;
  vertical-align: middle;
  cursor: pointer;
  position: relative;
  top: -1px;
  opacity: 0.85;
  transition: opacity 0.15s, transform 0.15s;
  user-select: none;
  filter: drop-shadow(0 0 3px rgba(80,200,120,0.55));
}
.e2ee-lock:hover {
  opacity: 1;
  transform: scale(1.2);
  filter: drop-shadow(0 0 5px rgba(80,200,120,0.85));
}

/* 点击说明 tooltip */
.e2ee-lock-tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30,30,30,0.92);
  color: #e8f5e9;
  font-size: 12px;
  line-height: 1.5;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 999;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  animation: e2ee-tip-in 0.18s ease;
}
.e2ee-lock-tip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(30,30,30,0.92);
}
@keyframes e2ee-tip-in {
  from { opacity: 0; transform: translateX(-50%) translateY(4px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* 加密消息解密中状态 */
.bubble.decrypting {
  opacity: 0.7;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  background-size: 200% 100%;
  animation: decrypting-shimmer 1.5s infinite;
}

@keyframes decrypting-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ── 置顶会话标识 ── */
.conv-item.pinned .conv-name::before {
  content: '📌';
  margin-right: 4px;
  font-size: 11px;
}

/* ── 钉住消息条 ── */
#pinned-msg-bar {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #f0f7ff;
  border-bottom: 1px solid #d0e8ff;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
}
#pinned-msg-bar.visible { display: flex; }
#pinned-msg-bar .pin-text {
  flex: 1;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#pinned-msg-bar .pin-close {
  color: #999;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color .15s, background .15s;
}
#pinned-msg-bar .pin-close:hover { color: #333; background: #e0efff; }

/* ── 通用右键菜单（复用 msg-context-menu 样式） ── */
.ctx-menu-separator {
  height: 1px;
  background: #f0f0f0;
  margin: 4px 0;
}

/* ── 红包消息气泡 */
.msg-redpacket{display:flex;align-items:center;gap:10px;background:linear-gradient(135deg,#e53935,#c62828);border-radius:12px;padding:12px 16px;cursor:pointer;min-width:180px;max-width:260px;color:#fff;box-shadow:0 2px 8px rgba(229,57,53,.3);transition:opacity .15s;}
.msg-redpacket:hover{opacity:.9;}
.msg-redpacket .rp-icon{font-size:28px;flex-shrink:0;}
.msg-redpacket .rp-body{flex:1;min-width:0;}
.msg-redpacket .rp-remark{font-size:15px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.msg-redpacket .rp-meta{font-size:12px;opacity:.8;margin-top:3px;}
.msg-redpacket .rp-arrow{font-size:20px;opacity:.6;flex-shrink:0;}
/* ── 转账消息气泡 */
.msg-transfer{display:flex;align-items:center;gap:12px;background:#fff;border:1px solid #e0e0e0;border-left:4px solid #1a73e8;border-radius:10px;padding:12px 16px;min-width:180px;max-width:260px;box-shadow:0 1px 4px rgba(0,0,0,.06);}
.msg-transfer .tx-icon-lg{font-size:28px;flex-shrink:0;}
.msg-transfer .tx-body-lg{flex:1;min-width:0;}
.msg-transfer .tx-amt-lg{font-size:18px;font-weight:700;color:#1a73e8;}
.msg-transfer .tx-rmk-sm{font-size:12px;color:#888;margin-top:3px;}
.msg-transfer .tx-ref-no{font-size:10px;color:#bbb;margin-top:4px;word-break:break-all;}

/* ── 语音消息气泡 */
.audio-bubble{display:flex;align-items:center;align-self:flex-start;gap:8px;padding:8px 12px;border-radius:20px;max-width:260px;min-width:120px;cursor:default;}
.audio-bubble.mine{background:var(--bg-msg-out,#07c160);color:#000;}
.audio-bubble.theirs{background:var(--bg-msg-in,#fff);color:#333;border:1px solid rgba(0,0,0,.08);}
.audio-play-btn{background:none;border:none;cursor:pointer;padding:0;display:flex;align-items:center;justify-content:center;width:28px;height:28px;flex-shrink:0;color:inherit;opacity:.9;}
.audio-play-btn:hover{opacity:1;}
.audio-progress-wrap{flex:1;position:relative;height:4px;border-radius:2px;background:rgba(0,0,0,.15);}
.audio-bubble.mine .audio-progress-wrap{background:rgba(0,0,0,.2);}
.audio-progress{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;margin:0;}
.audio-progress-fill{position:absolute;left:0;top:0;height:100%;border-radius:2px;background:currentColor;pointer-events:none;width:0%;}
.audio-dur{font-size:11px;flex-shrink:0;min-width:20px;opacity:.8;}

/* Toggle switch */
.toggle-switch{position:relative;display:inline-block;width:44px;height:24px;flex-shrink:0;}
.toggle-switch input{opacity:0;width:0;height:0;}
.toggle-slider{position:absolute;cursor:pointer;inset:0;background:#ccc;border-radius:24px;transition:.3s;}
.toggle-slider:before{position:absolute;content:"";height:18px;width:18px;left:3px;bottom:3px;background:#fff;border-radius:50%;transition:.3s;}
.toggle-switch input:checked+.toggle-slider{background:var(--theme-color,#07c160);}
.toggle-switch input:checked+.toggle-slider:before{transform:translateX(20px);}

/* ── 撤回消息样式 ─────────────────────────────────────── */
.msg-recalled {
  color: #999;
  font-size: 13px;
  font-style: italic;
  padding: 4px 0;
  display: inline-block;
}

/* 通话记录消息（仿微信，居中气泡） */
.call-record-row {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4px 0;
}
.msg-call-record-center {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,0.06);
  border-radius: 12px;
  padding: 4px 12px;
  font-size: 12px;
  color: #888;
  user-select: none;
}
.msg-call-time {
  font-size: 11px;
  color: #bbb;
  margin-left: 2px;
}
/* ⚠️ 通话记录颜色区分 — 勿删勿改，历史上多次被误删
 * 规则：绿=接通(answered) / 红=未接/拒绝(missed|rejected) / 灰=取消(cancelled)
 * 对应 app.js renderMessage call_record 分支里的 statusClass 逻辑
 */
.msg-call-record-center.call-status-answered {
  color: #07c160; /* 绿：已接听 */
}
.msg-call-record-center.call-status-missed {
  color: #f44336; /* 红：未接听 / 拒绝 */
}
.msg-call-record-center.call-status-cancelled {
  color: #999; /* 灰：已取消 */
}
/* END 通话记录颜色 ⚠️ */

/* 添加好友弹窗搜索中旋转动画 */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── 群文件库 Tabs ─────────────────────────────── */
.gf-tab {
  flex: 1;
  padding: 8px 4px;
  font-size: 12px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #6b7280;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.gf-tab:hover { color: #374151; }
.gf-tab.active { color: #6366f1; border-bottom-color: #6366f1; font-weight: 600; }

/* 文件列表项 */
.gf-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #f3f4f6;
  cursor: default;
}
.gf-item:hover { background: #f9fafb; }
.gf-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  background: #f3f4f6;
}
.gf-icon.img-thumb {
  background: #e5e7eb;
  overflow: hidden;
}
.gf-icon.img-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}
.gf-meta { flex: 1; min-width: 0; }
.gf-name {
  font-size: 13px;
  font-weight: 500;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gf-info { font-size: 11px; color: #9ca3af; margin-top: 2px; }
.gf-dl {
  font-size: 18px;
  color: #6366f1;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  flex-shrink: 0;
  text-decoration: none;
}
.gf-dl:hover { background: #ede9fe; }

/* 置顶消息条动效 */
#group-pinned-bar { transition: all .2s; }

/* ─── @ 提及高亮样式 ─────────────────────────────── */
.mention {
  font-weight: 600;
  padding: 1px 3px;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.mention-other {
  color: #1a73e8; /* 蓝色，仿微信 */
}

.mention-me {
  color: #1a73e8;
  background-color: rgba(26, 115, 232, 0.1); /* 浅蓝色背景，表示@自己 */
}

.mention:hover {
  text-decoration: underline;
}

/* @ 成员选择器 */
.mention-picker {
  position: fixed;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  width: 220px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
}

.mention-picker-header {
  padding: 10px 12px;
  font-size: 12px;
  color: #666;
  border-bottom: 1px solid #f0f0f0;
  background: #fafafa;
  border-radius: 8px 8px 0 0;
}

.mention-picker-list {
  max-height: 250px;
  overflow-y: auto;
}

.mention-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.mention-picker-item:hover {
  background-color: #f5f5f5;
}

.mention-picker-item .member-avatar.small {
  width: 24px;
  height: 24px;
  font-size: 12px;
  line-height: 24px;
}

/* 会话列表中的 @ 徽标 */
.conv-item[data-has-mention="true"] .conv-name::after {
  content: " [@]";
  color: #f44336; /* 红色提醒 */
  font-weight: bold;
  font-size: 12px;
}

/* 正在输入指示器动画 */
@keyframes typingDot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ── 直播分享消息卡片 ── */
.msg-live-share {
  border-radius: 12px;
  overflow: hidden;
  min-width: 220px;
  max-width: 280px;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  background: #fff;
}
.msg-live-share:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.msg-live-share .ls-header {
  background: linear-gradient(135deg, #ff4444, #ff7043);
  padding: 10px 14px 12px;
  color: #fff;
  position: relative;
}
.msg-live-share .ls-badge {
  display: inline-block;
  background: rgba(255,255,255,.25);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  margin-bottom: 6px;
  letter-spacing: .5px;
}
.msg-live-share .ls-cover {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
  background: #111;
}
.msg-live-share .ls-cover-placeholder {
  width: 100%;
  height: 100px;
  background: linear-gradient(135deg, #ff4444 0%, #ff7043 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}
.msg-live-share .ls-body {
  padding: 10px 14px;
}
.msg-live-share .ls-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg-live-share .ls-host {
  font-size: 12px;
  color: #888;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.msg-live-share .ls-watch-btn {
  display: block;
  width: 100%;
  padding: 8px;
  border: none;
  border-radius: 6px;
  background: #ff4444;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

/* ── 值班桥接会话样式 ── */
.conv-item.offhours-cs {
  border-left: 3px solid #ff9800;
  background: linear-gradient(90deg, rgba(255,152,0,.07) 0%, transparent 50%);
}
.conv-offhours-badge {
  display: inline-block;
  background: #ff9800;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 5px;
  vertical-align: middle;
  line-height: 1.5;
  flex-shrink: 0;
}
