/* ============ 基础 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --wa-green: #00a884;
  --wa-green-dark: #008069;
  --header-bg: #008069; /* WhatsApp 顶栏深绿 */
  --bg-chat: #efeae2;
  --bg-side: #ffffff;
  --bg-header: #f0f2f5;
  --bubble-me: #d9fdd3;
  --bubble-other: #ffffff;
  --text: #111b21;
  --text-sub: #667781;
  --text-header: #54656f;
  --danger: #ff3b30;
  --radius: 7.5px;
}
html, body { height: 100%; }
body {
  font-family: "Segoe UI", "Helvetica Neue", "Microsoft YaHei", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: #f0f2f5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { cursor: pointer; font-family: inherit; }
input, textarea { font-family: inherit; outline: none; }
.hidden { display: none !important; }
.view { height: 100vh; width: 100vw; }

/* ============ 登录视图 ============ */
#login-view {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #00a884 0%, #008069 100%);
}
.login-card {
  width: min(420px, 92vw); background: #fff; border-radius: 16px;
  padding: 40px 32px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.wa-logo { line-height: 1; }
.login-card .wa-logo { margin-bottom: 16px; }
.login-card h1 { font-size: 24px; margin-bottom: 6px; }
.login-sub { color: var(--text-sub); font-size: 13px; margin-bottom: 28px; }
.login-field { text-align: left; margin-bottom: 16px; }
.login-field label { display: block; font-size: 13px; color: var(--text-sub); margin-bottom: 6px; }
.login-field input {
  width: 100%; padding: 12px 14px; font-size: 16px; border: 1.5px solid #e9edef;
  border-radius: 10px; transition: border-color .2s;
}
.login-field input:focus { border-color: var(--wa-green); }
.btn-primary {
  background: var(--wa-green); color: #fff; border: none; border-radius: 10px;
  padding: 12px 20px; font-size: 15px; font-weight: 600; width: 100%;
  transition: background .2s;
}
.btn-primary:hover { background: var(--wa-green-dark); }
.btn-primary:disabled { background: #cbd5d1; cursor: not-allowed; }
.login-status { margin-top: 14px; font-size: 14px; color: var(--text-sub); min-height: 20px; }
.login-status.error { color: var(--danger); }

/* QR 区域 */
.qr-area { margin-top: 20px; }
.qr-canvas { display: inline-block; padding: 12px; background: #fff; border: 1px solid #e9edef; border-radius: 12px; }
.qr-canvas canvas { display: block; }
.qr-hint { font-size: 13px; color: var(--text-sub); margin-top: 14px; line-height: 1.7; }
.qr-countdown { font-size: 13px; color: var(--danger); margin-top: 8px; }

/* ============ 主界面布局 ============ */
#main-view { display: flex; }

/* 左侧系统菜单栏(仿微信 PC 工具条) */
#systemNav {
  width: 64px; flex-shrink: 0; background: #202c33; color: #fff;
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 0; height: 100vh;
}
.nav-logo {
  width: 40px; height: 40px; border-radius: 50%; background: var(--wa-green);
  color: #fff; font-weight: 700; font-size: 20px; line-height: 40px;
  text-align: center; margin-bottom: 12px; user-select: none; flex-shrink: 0;
}
.nav-btns { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.nav-btn {
  width: 44px; height: 44px; border: none; border-radius: 50%;
  background: transparent; color: #aebac1; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s; position: relative;
}
.nav-btn:hover { background: #2a3942; color: #fff; }
.nav-btn.active { background: #37474f; color: #fff; }
.nav-btn.active::before {
  content: ''; position: absolute; left: -10px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px; border-radius: 0 3px 3px 0; background: var(--wa-green);
}
.nav-account {
  max-width: 52px; font-size: 11px; color: #aebac1; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 6px 3px; border-radius: 8px; cursor: pointer; flex-shrink: 0;
}
.nav-account:hover { background: #2a3942; color: #fff; }

/* 聊天主区(会话列表 + 聊天窗) */
#chatView { flex: 1; display: flex; min-width: 0; }
#sidebar {
  width: 420px; min-width: 300px; background: var(--bg-side);
  border-right: 1px solid #e9edef; display: flex; flex-direction: column; height: 100vh;
}
#chatPane { flex: 1; display: flex; flex-direction: column; min-width: 0; height: 100vh; }

/* ============ 通用头部与图标 ============ */
.pane-header {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--header-bg); height: 59px; padding: 10px 16px; flex-shrink: 0;
}
.avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--wa-green);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; flex-shrink: 0;
  position: relative; overflow: hidden;
  -webkit-user-select: none; user-select: none;
}
/* 真实头像图片:加载成功后盖住文字占位 */
.avatar-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border-radius: 50%;
}
.header-actions { display: flex; gap: 4px; }
.icon-btn {
  width: 40px; height: 40px; border: none; background: transparent; border-radius: 50%;
  color: var(--text-header); display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.icon-btn:hover { background: #d8dadd; }
.icon-btn svg { display: block; }
/* 绿色顶栏内的图标/文字/头像 */
.pane-header .icon-btn { color: #fff; }
.pane-header .icon-btn:hover { background: rgba(255,255,255,.16); }
.pane-header .avatar { border: 2px solid #fff; }
.pane-header .chat-title { color: #fff; }
.pane-header .chat-status { color: rgba(255,255,255,.85); }

/* ============ 侧边栏 ============ */
.search-bar {
  position: relative; background: #fff; padding: 8px 16px;
  display: flex; align-items: center; flex-shrink: 0;
}
.search-icon {
  position: absolute; left: 26px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; color: var(--text-header); z-index: 1;
  pointer-events: none;
}
#searchInput {
  width: 100%; height: 35px; border: none; background: var(--bg-header); border-radius: 8px;
  padding: 0 16px 0 40px; font-size: 14px; color: var(--text);
}
#searchInput::placeholder { color: var(--text-sub); }
#searchInput:focus { box-shadow: 0 1px 2px rgba(0,0,0,.05); }

.chat-list { flex: 1; overflow-y: auto; }
.chat-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 11px;
  cursor: pointer; border-bottom: 1px solid #f0f2f5; transition: background .12s;
}
.chat-item:hover { background: #f5f6f6; }
.chat-item.active { background: #f0f2f5; }
.chat-item .avatar { width: 49px; height: 49px; font-size: 18px; }
.chat-body { flex: 1; min-width: 0; }
.chat-top { display: flex; justify-content: space-between; align-items: baseline; }
.chat-name {
  font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; color: var(--text);
}
.chat-time { font-size: 12px; color: var(--text-sub); flex-shrink: 0; margin-left: 8px; }
.chat-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 3px; }
.chat-preview {
  font-size: 14px; color: var(--text-sub); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; flex: 1; min-width: 0;
}
.chat-unread {
  background: var(--wa-green); color: #fff; border-radius: 50%;
  min-width: 20px; height: 20px; padding: 0 5px; font-size: 11px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-left: 8px;
}
/* 未读会话:名字与预览加粗变深,时间高亮(仿 WhatsApp) */
.chat-item.unread .chat-name { font-weight: 700; }
.chat-item.unread .chat-preview { font-weight: 600; color: var(--text); }
.chat-time.has-unread { color: var(--wa-green); font-weight: 600; }
/* 消息气泡勾选 */
.tick { font-size: 11px; margin-right: 2px; align-self: flex-end; }
.tick.sending { color: rgba(17,27,33,.45); }
.tick.delivered { color: rgba(17,27,33,.55); }
.tick.read { color: #53bdeb; font-weight: 700; }

/* 气泡表情回应按钮 */
.react-btn {
  position: absolute; right: 6px; bottom: -12px; width: 26px; height: 26px;
  border: none; border-radius: 50%; background: #fff; font-size: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.2); opacity: 0; transition: opacity .12s;
  display: flex; align-items: center; justify-content: center; z-index: 3;
}
.msg-group:hover .react-btn { opacity: 1; }
.react-picker {
  position: absolute; right: 30px; bottom: -14px; display: flex; gap: 2px;
  background: #fff; border-radius: 18px; padding: 4px 6px; z-index: 5;
  box-shadow: 0 2px 8px rgba(0,0,0,.22); animation: pop .12s ease;
}
.react-emoji { border: none; background: transparent; font-size: 18px; padding: 2px 5px; border-radius: 50%; }
.react-emoji:hover { background: #f0f2f5; }
.bubble { position: relative; }

/* 右键本地删除菜单 */
.ctx-menu {
  position: fixed; background: #fff; border-radius: 10px; padding: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,.25); z-index: 300;
  /* 固定定位下 width:auto 配 button{width:100%} 会把菜单撑到 380px+,
     用 max-content 让宽度严格贴合文字,再用上下限兜底 */
  width: max-content; min-width: 160px; max-width: 260px;
}
.ctx-menu button {
  display: block; width: 100%; border: none; background: transparent; padding: 9px 12px;
  font-size: 14px; text-align: left; border-radius: 7px; color: var(--text);
  white-space: nowrap;
}
.ctx-menu button[data-act="delete"] { color: var(--danger); }
.ctx-menu button:hover { background: #f5f6f6; }
.chat-empty-list { padding: 30px; text-align: center; color: var(--text-sub); font-size: 14px; }

/* ============ 空状态(WhatsApp 原版) ============ */
.chat-empty {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: #f0f2f5;
  background-image: linear-gradient(180deg, #00a884 0%, #00997d 18%, #e7f0ec 62%, #f0f2f5 100%);
  color: var(--text-sub); overflow: hidden;
}
.empty-box { text-align: center; padding: 0 40px; }
.empty-box .wa-logo { margin-bottom: 8px; }
.empty-title { font-size: 28px; color: #41525d; font-weight: 400; margin-bottom: 14px; }
.empty-sub { font-size: 14px; color: var(--text-sub); line-height: 1.7; }
.encrypt-note {
  margin-top: 48px; font-size: 13px; color: var(--text-sub);
  display: inline-flex; align-items: center; gap: 6px;
}

/* ============ 聊天区 ============ */
#chatActive { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-header { justify-content: flex-start; gap: 12px; padding: 10px 16px; position: relative; }
.chat-back { display: none; margin-right: 4px; }
.chat-titles { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat-title {
  font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; min-width: 0;
}
.chat-status { font-size: 13px; color: var(--text-sub); }
.chat-avatar { width: 40px; height: 40px; cursor: pointer; }
.chat-avatar .avatar { width: 100%; height: 100%; }

.messages {
  flex: 1; overflow-y: auto; padding: 12px 16px;
  background-color: var(--bg-chat);
  background-image:
    linear-gradient(180deg, rgba(0,168,132,.16) 0%, rgba(0,168,132,.16) 110px, transparent 110px),
    url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23d1d7db' stroke-opacity='0.22'%3E%3Ccircle cx='8' cy='8' r='1.5'/%3E%3Ccircle cx='38' cy='38' r='1.5'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat-x, repeat;
  background-size: 100% 100%, auto;
}
.msg-group { display: flex; margin-bottom: 8px; }
.msg-group.me { justify-content: flex-end; }
.msg-group.other { justify-content: flex-start; }
.bubble {
  max-width: 65%; padding: 10px 12px; border-radius: var(--radius); position: relative;
  box-shadow: 0 1px 1px rgba(0,0,0,.08); word-break: break-word;
}
.msg-group.me .bubble { background: var(--bubble-me); border-top-right-radius: 2px; }
.msg-group.other .bubble { background: var(--bubble-other); border-top-left-radius: 2px; }
.bubble-text { font-size: 14.5px; line-height: 1.4; padding-right: 0; white-space: pre-wrap; }

/* 气泡内单条译文(消息右键 → 翻译这条) */
.bubble-tr {
  margin-top: 6px; padding: 7px 10px; border-radius: 8px;
  background: rgba(255,255,255,.72); border-left: 3px solid var(--wa-green);
  font-size: 13.5px; line-height: 1.5; color: var(--text);
  word-break: break-word;
}
.bubble-tr.pending { color: var(--text-sub); font-size: 13px; }
.btr-src { font-size: 12px; color: var(--text-sub); margin-bottom: 4px; }
.btr-text { white-space: pre-wrap; }
.btr-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-top: 4px; font-size: 11px; color: var(--text-sub);
}
.btr-copy {
  border: none; background: transparent; color: var(--wa-green-dark);
  font-size: 11px; padding: 2px 6px; border-radius: 4px; cursor: pointer;
}
.btr-copy:hover { background: rgba(0,168,132,.12); }
/* 时间戳统一放在消息内容下方右侧,不遮挡文字或图片 */
.bubble-meta {
  display: flex; align-items: center; justify-content: flex-end; gap: 3px;
  margin-top: 8px; min-width: max-content;
}
.bubble-time { font-size: 11px; color: #667781; white-space: nowrap; }
.bubble-media { display: block; max-width: 100%; margin-bottom: 4px; }
.bubble-media img { max-width: min(100%, 420px); max-height: 320px; border-radius: 6px; display: block; cursor: pointer; }
.bubble-audio { max-width: min(100%, 340px); width: 100%; }
.bubble-doc {
  display: flex; align-items: center; gap: 10px; background: #f5f6f6; border-radius: 6px;
  padding: 8px 12px; text-decoration: none; color: var(--text); margin-bottom: 4px;
  max-width: 100%;
}
.bubble-doc .doc-icon { font-size: 26px; }
.bubble-doc .doc-name { font-size: 13px; max-width: min(100%, 280px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bubble-loc { color: #027eb5; text-decoration: none; font-size: 14px; }
.media-download { font-size: 12px; color: #027eb5; cursor: pointer; }

/* 消息发送中 / 时间分隔 */
.day-divider {
  text-align: center; margin: 12px 0; color: var(--text-sub); font-size: 12px;
}
.day-divider span { background: #fff; padding: 3px 12px; border-radius: 8px; }

/* ============ 输入区 ============ */
.composer {
  display: flex; align-items: flex-end; gap: 8px; padding: 8px 16px;
  background: var(--bg-header); flex-shrink: 0; position: relative;
}
.composer-icon { color: var(--text-header); }
.msg-input {
  flex: 1; resize: none; border: none; border-radius: 20px; padding: 10px 16px;
  font-size: 15px; background: #fff; max-height: 120px; line-height: 1.4;
}
.send-btn {
  width: 42px; height: 42px; border: none; border-radius: 50%; background: var(--wa-green);
  color: #fff; display: flex; align-items: center; justify-content: center;
  transition: background .2s; flex-shrink: 0;
}
.send-btn:hover { background: var(--wa-green-dark); }
.send-btn:disabled { background: #cbd5d1; cursor: not-allowed; }
.typing-tip { padding: 4px 20px; font-size: 12px; color: var(--text-sub); }

/* ============ 消息搜索栏 & 加载更多 ============ */
.msg-search {
  display: flex; align-items: center; gap: 6px; padding: 8px 16px;
  background: var(--bg-header); border-bottom: 1px solid #e9edef; flex-shrink: 0;
}
.msg-search-input {
  flex: 1; height: 34px; border: none; border-radius: 8px; padding: 0 12px;
  font-size: 14px; background: #fff; min-width: 0;
}
.msg-search-date {
  height: 34px; border: 1.5px solid #e9edef; border-radius: 8px; padding: 0 6px;
  font-size: 12px; color: var(--text); background: #fff; width: 128px;
}
.msg-search-sep { color: var(--text-sub); font-size: 13px; }
.msg-search-btn {
  width: 34px; height: 34px; border: none; border-radius: 8px; background: #fff;
  color: var(--text-header); font-size: 14px; display: flex; align-items: center;
  justify-content: center; transition: background .15s; flex-shrink: 0;
}
.msg-search-btn:hover { background: #e6e9eb; }

.load-more-wrap { text-align: center; margin: 8px 0 12px; }
.load-more-btn {
  background: #fff; border: none; border-radius: 18px; padding: 8px 20px;
  font-size: 13px; color: var(--wa-green-dark); font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,.08); transition: background .15s;
}
.load-more-btn:hover { background: #f0f2f5; }

.search-result-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 4px 10px;
}
.search-result-count { font-size: 13px; color: var(--text-sub); }
.msg-search-exit-btn {
  background: #fff; border: none; border-radius: 14px; padding: 5px 14px;
  font-size: 12px; color: var(--wa-green-dark); font-weight: 600; cursor: pointer;
}
.msg-search-exit-btn:hover { background: #f0f2f5; }

/* ============ 版本更新提醒 ============ */
.update-banner {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 90; display: flex; align-items: center; gap: 10px;
  width: max-content; max-width: calc(100vw - 24px);
  padding: 10px 12px 10px 14px; border-radius: 12px;
  background: #fff8e1; border: 1px solid #ffe08a; color: #6b4e00;
  box-shadow: 0 6px 24px rgba(0,0,0,.16); font-size: 13.5px;
}
.update-banner.danger { background: #fff1f0; border-color: #ffb3ab; color: #a8071a; }
.ub-icon { font-size: 16px; flex: none; }
.ub-text { flex: 1; min-width: 0; line-height: 1.45; }
.ub-text b { font-weight: 600; }
.ub-btn {
  flex: none; border: none; border-radius: 8px; padding: 6px 12px;
  background: #008069; color: #fff; font-size: 12.5px;
}
.update-banner.danger .ub-btn { background: #d4380d; }
.ub-btn:hover { filter: brightness(1.06); }
.ub-close {
  flex: none; width: 26px; height: 26px; border: none; border-radius: 50%;
  background: transparent; color: inherit; font-size: 14px; opacity: .65;
}
.ub-close:hover { opacity: 1; background: rgba(0,0,0,.06); }
.modal-card.update-card { width: min(460px, 92vw); }
.update-status { font-size: 13px; color: var(--text-sub); margin: -6px 0 14px; line-height: 1.5; }
.update-status b { color: var(--text); }
.update-steps { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.update-step { display: flex; gap: 10px; font-size: 13.5px; line-height: 1.55; }
.update-step b {
  flex: none; width: 20px; height: 20px; border-radius: 50%;
  background: #e7f8f2; color: var(--wa-green-dark);
  font-size: 12px; display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.update-step code {
  background: #f0f2f5; padding: 1px 5px; border-radius: 4px;
  font-size: 12.5px; color: #3b4a54; overflow-wrap: break-word;
}
@media (max-width: 520px) {
  .update-banner { top: 8px; padding: 9px 10px; font-size: 13px; gap: 8px; }
  .ub-btn { padding: 6px 9px; }
}

/* ============ 网桥升级页(仅管理员端) ============ */
.mi-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #ff4d4f;
  flex: none; box-shadow: 0 0 0 2px rgba(255, 77, 79, .22);
}
.sys-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px; margin-bottom: 16px;
}
.sys-card {
  background: #fff; border: 1px solid #e9edef; border-radius: 14px;
  padding: 18px 20px; margin-bottom: 16px;
}
.sys-grid .sys-card { margin-bottom: 0; }
.sys-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 12px;
}
.sys-card-head h3 { font-size: 14.5px; font-weight: 600; color: var(--text); }
.sys-card-sub { font-size: 12px; color: var(--text-sub); }
.sys-badge {
  font-size: 11.5px; padding: 2px 9px; border-radius: 999px;
  background: #f0f2f5; color: #5b6b7b; white-space: nowrap;
}
.sys-badge.ok { background: #e7f8f2; color: #00674f; }
.sys-badge.warn { background: #fff4e5; color: #9a5b00; }
.sys-badge.bad { background: #fff1f0; color: #a8071a; }
.sys-kv {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; padding: 7px 0; border-top: 1px dashed #eef1f3;
  font-size: 13px; line-height: 1.45;
}
.sys-kv:first-of-type { border-top: none; }
.sys-kv span { color: var(--text-sub); flex: none; }
.sys-kv b {
  font-weight: 600; color: var(--text); text-align: right;
  overflow-wrap: anywhere; min-width: 0;
}
.sys-kv b.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.sys-danger {
  margin-top: 12px; padding: 10px 12px; border-radius: 9px;
  background: #fff1f0; border: 1px solid #ffccc7; color: #a8071a;
  font-size: 12.5px; line-height: 1.5; overflow-wrap: anywhere;
}
.sys-note {
  margin-top: 12px; font-size: 12.5px; color: var(--text-sub); line-height: 1.55;
}
/* 头部当前版本 chip */
.sys-head-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sys-head-ver {
  font-family: ui-monospace, Consolas, monospace; font-size: 11.5px;
  color: #00674f; background: #e7f8f2; border: 1px solid #cdeee2;
  padding: 2px 8px; border-radius: 999px;
  max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 卡片内完整版本号(块状,可逐字核对) */
.sys-ver { padding: 8px 0; border-top: 1px dashed #eef1f3; }
.sys-card-head + .sys-ver { border-top: none; }
.sys-ver > span { display: block; font-size: 12.5px; color: var(--text-sub); margin-bottom: 3px; }
.sys-ver code {
  display: block; font-family: ui-monospace, Consolas, monospace;
  font-size: 12.5px; color: var(--text); line-height: 1.5;
  overflow-wrap: anywhere; word-break: break-all;
}
.sys-ver em { display: block; font-style: normal; font-size: 11.5px; color: var(--text-sub); margin-top: 2px; }
/* 升级记录表 */
.sys-table-wrap { overflow-x: auto; }
.sys-table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 13px; }
.sys-table th {
  text-align: left; font-weight: 600; color: var(--text-sub); font-size: 12px;
  padding: 0 12px 8px 0; border-bottom: 1px solid #eef1f3; white-space: nowrap;
}
.sys-table td { padding: 9px 12px 9px 0; border-bottom: 1px solid #f4f6f7; vertical-align: top; }
.sys-table tr:last-child td { border-bottom: none; }
.sys-table code {
  font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: #3b4a54;
  background: #f6f8f9; padding: 1px 5px; border-radius: 4px; white-space: nowrap;
}
.sys-td-time { color: var(--text-sub); white-space: nowrap; }
.sys-td-ver { white-space: nowrap; }
.sys-td-msg {
  color: var(--text-sub); max-width: 260px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.45;
}
.sys-dim { color: #b0bcc6; }
.sys-arrow { color: #9aa7b2; margin: 0 4px; }
.sys-empty { color: var(--text-sub); text-align: center; padding: 18px 0; }
.sys-card .update-steps { margin-bottom: 10px; }
@media (max-width: 520px) {
  .sys-card { padding: 14px 14px; }
  .sys-grid { gap: 12px; }
}

/* ============ 弹窗 ============ */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.modal-card {
  width: min(380px, 92vw); background: #fff; border-radius: 14px; padding: 26px;
  animation: pop .15s ease;
}
@keyframes pop { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-card h3 { margin-bottom: 16px; font-size: 18px; }
.modal-card input {
  width: 100%; padding: 11px 13px; font-size: 15px; border: 1.5px solid #e9edef;
  border-radius: 9px; margin-bottom: 8px;
}
.modal-card input:focus { border-color: var(--wa-green); }
.modal-card .hint { font-size: 12px; color: var(--text-sub); margin-bottom: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.btn-ghost { background: transparent; border: 1px solid #e9edef; border-radius: 9px; padding: 10px 18px; font-size: 14px; color: var(--text); }
.btn-ghost:hover { background: #f5f6f6; }
.btn-block { width: 100%; margin-bottom: 12px; }
.loc-inputs { display: flex; gap: 8px; }
.loc-inputs input { flex: 1; }
.export-fmt-row { display: flex; gap: 20px; margin-bottom: 12px; font-size: 14px; }
.export-fmt-row label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.export-fmt-row input { width: auto; margin: 0; }

/* ============ 工具弹窗(定时 / 群发)============ */
.tools-card { width: min(440px, 94vw); }
.tools-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tools-tab {
  flex: 1; border: none; background: var(--bg-header); border-radius: 9px;
  padding: 9px; font-size: 14px; color: var(--text-sub); transition: all .15s;
}
.tools-tab.active { background: var(--wa-green); color: #fff; font-weight: 600; }
.tools-panel input, .tools-panel textarea {
  width: 100%; padding: 11px 13px; font-size: 14px; border: 1.5px solid #e9edef;
  border-radius: 9px; margin-bottom: 8px; resize: none; font-family: inherit;
}
.tools-panel input:focus, .tools-panel textarea:focus { border-color: var(--wa-green); }
.sched-list { max-height: 260px; overflow-y: auto; margin-top: 4px; }
.sched-empty { text-align: center; color: var(--text-sub); font-size: 13px; padding: 16px; }
.sched-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 6px; border-bottom: 1px solid #f0f2f5;
}
.sched-info { flex: 1; min-width: 0; }
.sched-jid { font-weight: 600; font-size: 14px; }
.sched-text { font-size: 13px; color: var(--text-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.sched-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.sched-time { font-size: 12px; color: var(--text-sub); }
.sched-status { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: #f0f2f5; color: var(--text-sub); }
.sched-status.sent { background: #d9fdd3; color: #008069; }
.sched-status.failed { background: #ffe0e0; color: #d63031; }
.sched-status.canceled { color: #bbb; }
.sched-del { border: none; background: transparent; color: var(--danger); font-size: 15px; cursor: pointer; padding: 4px; }
.bc-result { font-size: 13px; color: var(--text-sub); margin-top: 4px; max-height: 160px; overflow-y: auto; }
.bc-fail { color: var(--danger); font-size: 12px; margin-top: 3px; }

/* ============ AI 自动回复 ============ */
.ai-toggle {
  font-size: 13px; font-weight: 600; color: var(--text-sub);
  border-radius: 8px; padding: 4px 8px; letter-spacing: .3px;
}
.ai-toggle:hover { background: #d8dadd; }
.ai-toggle.ai-on { background: var(--wa-green); color: #fff; }
/* 绿色聊天顶栏内的 AI 开关 */
.pane-header .ai-toggle { background: rgba(255,255,255,.16); color: #fff; }
.pane-header .ai-toggle:hover { background: rgba(255,255,255,.26); }
.pane-header .ai-toggle.ai-on { background: #fff; color: var(--header-bg); }
.ai-form { border-bottom: 1px solid #f0f2f5; padding-bottom: 12px; }
.ai-lbl { display: block; font-size: 13px; color: var(--text-sub); margin: 8px 0 4px; }
.ai-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text); margin: 4px 0 8px; }
.ai-row input[type="checkbox"] { width: auto; margin: 0; }
.ai-num { display: flex; flex-direction: column; gap: 4px; flex: 1; font-size: 13px; color: var(--text-sub); }
.ai-num input { margin: 0; padding: 8px 10px; }
.ai-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.ai-actions .btn-primary, .ai-actions .btn-ghost { padding: 8px 16px; }
.ai-test-result { font-size: 13px; margin-top: 8px; color: var(--wa-green); word-break: break-all; }
.ai-rules { margin-top: 12px; }
.ai-rules h4 { margin: 0 0 8px; font-size: 14px; }
.ar-list { max-height: 220px; overflow-y: auto; margin-top: 4px; }
.ar-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 4px;
  border-bottom: 1px solid #f0f2f5; font-size: 13px;
}
.ar-item.disabled { opacity: .5; }
.ar-jid { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar-kw { flex: 1; min-width: 0; color: var(--text-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar-reply { flex: 1; min-width: 0; color: var(--wa-green); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar-toggle { border: 1px solid #e9edef; background: transparent; color: var(--text-sub); border-radius: 8px; padding: 3px 8px; cursor: pointer; font-size: 12px; }
.ar-del { border: none; background: transparent; color: var(--danger); font-size: 16px; cursor: pointer; padding: 2px 4px; }
.ar-empty { text-align: center; color: var(--text-sub); font-size: 13px; padding: 16px; }

/* ============ 副视图(AI 配置 / 号码管理) ============ */
.sub-view { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg-side); }
#aiView { overflow-y: auto; }
#accountsView { overflow-y: auto; }
/* 这几个子页面原来没有滚动条:内容一多就被 body 的 overflow:hidden 裁掉,看起来像「翻不了页」 */
#customersView, #contactsView, #membersView, #assignView {
  overflow-y: auto; min-height: 0;
}
/* 滚动时表头固定在顶部 */
.sub-view-head { position: sticky; top: 0; z-index: 3; }
.sub-view-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; background: var(--header-bg); border-bottom: 1px solid #005c4a;
  position: sticky; top: 0; z-index: 2; flex-shrink: 0;
}
.sub-view-head h2 { font-size: 18px; color: #fff; }
.sub-view-acct { font-size: 13px; color: rgba(255,255,255,.85); }
#aiView .ai-form, #aiView .ai-rules { padding: 16px 20px; }
#aiView .ai-rules { padding-top: 4px; }

/* 号码管理 */
#accountsView { background: #f0f2f5; }
.sub-head-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sub-view-sub { font-size: 12.5px; color: rgba(255,255,255,.82); }
.sub-head-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.btn-head {
  width: auto; padding: 9px 16px; font-size: 14px; border-radius: 9px;
  box-shadow: 0 1px 3px rgba(0,0,0,.14);
}
.accounts-body { width: 100%; max-width: 760px; margin: 0 auto; padding: 18px 20px 28px; }
.account-list { display: flex; flex-direction: column; gap: 10px; }
.account-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; background: #fff;
  border: 1px solid #e9edef; border-radius: 14px;
  box-shadow: 0 1px 2px rgba(11,20,26,.04);
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s, background .15s;
}
.account-item:hover { border-color: #d6dbdf; box-shadow: 0 4px 14px rgba(11,20,26,.08); }
.account-item.current { border-color: rgba(0,168,132,.45); background: #f7fdfa; }
.account-item .avatar { width: 48px; height: 48px; font-size: 17px; }
.account-body { flex: 1; min-width: 0; }
.account-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.account-name {
  font-weight: 600; font-size: 15.5px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.account-chip {
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
  font-size: 12px; line-height: 1.7; padding: 0 9px; border-radius: 20px;
}
.account-chip em { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: block; }
.account-chip.online { color: #0a7a5f; background: #e3f7ef; }
.account-chip.pending { color: #a06a00; background: #fff3d6; }
.account-chip.offline { color: #6b7a82; background: #eef1f3; }
/* 成员工作状态:在线 / 忙碌 / 离线(只有在线会接收新的客户分配) */
.presence-chip {
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
  font-size: 11.5px; line-height: 1.7; padding: 0 8px; border-radius: 20px;
  border: 1px solid transparent; background: #eef1f3; color: #6b7a82;
  cursor: pointer; font-family: inherit;
}
.presence-chip em { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: block; }
.presence-chip.online { color: #0a7a5f; background: #e3f7ef; border-color: #b7e4d4; }
.presence-chip.busy { color: #9a6400; background: #fff3d6; border-color: #f0d9a8; }
.presence-chip.offline { color: #6b7a82; background: #eef1f3; border-color: #e0e5e7; }
.presence-chip:hover { filter: brightness(.97); }

/* 成员排班弹窗 */
.modal-card.schedule-card { width: min(430px, 94vw); }
.sch-enable {
  display: flex; align-items: center; gap: 8px; margin: 12px 0 4px;
  font-size: 13.5px; color: var(--text); cursor: pointer;
}
.sch-enable input { width: auto; margin: 0; }
.sch-days { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 4px; }
.sch-days button { white-space: nowrap; }
#scheduleClear { margin-right: auto; }
.modal-actions button { white-space: nowrap; }
.sch-days button {
  border: 1px solid #d7dde1; background: #fff; color: #54656f;
  border-radius: 8px; padding: 6px 10px; font-size: 12.5px; cursor: pointer;
  font-family: inherit;
}
.sch-days button.on {
  background: #e3f7ef; border-color: #00a884; color: #0a7a5f; font-weight: 600;
}
.sch-times { display: flex; gap: 12px; }
.sch-times label { flex: 1; }
.sch-times input[type="time"] {
  width: 100%; margin-top: 5px; padding: 8px 10px; border: 1px solid #e0e5e7;
  border-radius: 8px; font-size: 13.5px; font-family: inherit;
}
.sch-times input[type="time"]:disabled { background: #f5f6f6; color: #9aa7ae; cursor: not-allowed; }
.sch-allday {
  display: flex; align-items: center; gap: 8px; margin: 2px 0 4px;
  font-size: 13px; color: var(--text-sub); cursor: pointer;
}
.sch-allday input { width: auto; margin: 0; }
.member-sch {
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
  font-size: 12px; color: #54656f; background: #f2f5f5;
  border-radius: 20px; padding: 0 8px;
}
.member-sch.on { color: #0a7a5f; background: #e3f7ef; }
.member-sch em { width: 6px; height: 6px; border-radius: 50%; background: #9aa7ae; display: block; }
.member-sch.on em { background: #22c55e; }
.account-tag {
  flex-shrink: 0; font-size: 11.5px; line-height: 1.7; padding: 0 8px;
  border-radius: 20px; color: #0a7a5f; background: rgba(0,168,132,.12);
}
.account-meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 6px; font-size: 12.5px; color: var(--text-sub);
}
.account-sep { color: #c5cdd3; }
.account-login.yes { color: #0a7a5f; font-weight: 600; }
.account-login.no { color: #8a949b; }
.acct-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.acct-btn {
  border: 1px solid #e0e5e7; background: #fff; color: var(--text);
  border-radius: 9px; padding: 7px 13px; font-size: 13px; line-height: 1.2;
  transition: background .15s, border-color .15s, color .15s;
}
.acct-btn:hover { background: #f5f6f6; border-color: #d3dade; }
.acct-btn.primary {
  background: var(--wa-green); border-color: var(--wa-green);
  color: #fff; font-weight: 600;
}
.acct-btn.primary:hover { background: var(--wa-green-dark); border-color: var(--wa-green-dark); }
.acct-btn.danger { color: var(--danger); border-color: #ffdcd9; }
.acct-btn.danger:hover { background: #ffecec; border-color: #ffc9c4; }
.acct-btn:disabled { opacity: .55; cursor: not-allowed; }
.accounts-empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 54px 20px; text-align: center; color: var(--text-sub);
}
.accounts-empty .empty-ico {
  width: 64px; height: 64px; border-radius: 50%; background: #e7ecef;
  display: flex; align-items: center; justify-content: center; font-size: 28px;
}
.accounts-empty h3 { font-size: 16px; font-weight: 600; color: var(--text); }
.accounts-empty p { font-size: 13px; line-height: 1.75; max-width: 36ch; }
.accounts-loading { text-align: center; color: var(--text-sub); font-size: 13px; padding: 28px 0; }
.accounts-hint {
  margin-top: 16px; padding: 10px 12px; border-radius: 10px;
  border: 1px dashed #dde3e6; background: rgba(255,255,255,.7);
  font-size: 12.5px; line-height: 1.8; color: var(--text-sub);
}

/* 添加号码弹窗二维码区 */
.add-acct-card { width: min(420px, 92vw); text-align: center; }
.add-acct-card h3 { text-align: left; }
.add-acct-card .hint { text-align: left; }
.add-qr-area { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 8px; }
.add-qr-area .login-status { min-height: 18px; margin-top: 0; }

.account-rename {
  flex-shrink: 0; border: none; background: transparent; color: #9aa6ad;
  font-size: 12px; line-height: 1; padding: 2px 4px; border-radius: 6px;
  transition: background .15s, color .15s;
}
.account-rename:hover { background: #eef1f3; color: var(--text); }
.chat-account-chip { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.contact-account { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============ 客户页 ============ */
#contactsView { background: #f0f2f5; }
.contacts-body { width: 100%; max-width: 820px; margin: 0 auto; padding: 16px 20px 28px; }
.contacts-search { margin-bottom: 12px; }
.contacts-search input {
  width: 100%; padding: 10px 14px; font-size: 14px;
  border: 1px solid #e0e5e7; border-radius: 10px; background: #fff;
}
.contacts-search input:focus { border-color: var(--wa-green); }
.contact-list { display: flex; flex-direction: column; gap: 8px; }
.contact-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: #fff; border: 1px solid #e9edef; border-radius: 12px;
  cursor: pointer; transition: box-shadow .15s, border-color .15s;
}
.contact-item:hover { border-color: #d6dbdf; box-shadow: 0 3px 10px rgba(11,20,26,.07); }
.contact-item .avatar { width: 44px; height: 44px; font-size: 16px; }
.contact-body { flex: 1; min-width: 0; }
.contact-top { display: flex; align-items: center; gap: 8px; }
.contact-name {
  font-weight: 600; font-size: 14.5px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.contact-unread {
  background: var(--wa-green); color: #fff; font-size: 11.5px;
  border-radius: 20px; padding: 1px 7px; flex-shrink: 0;
}
.contact-time { margin-left: auto; font-size: 12px; color: var(--text-sub); flex-shrink: 0; }
.contact-meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 5px; font-size: 12.5px; color: var(--text-sub);
}
.contact-account {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; line-height: 1.7; padding: 0 8px; border-radius: 20px;
  color: #2f6178; background: #eaf3f8; border: 1px solid #d9e8f0;
}
.contact-account::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: #2f9dd0; display: block;
}

/* 聊天头部的所属账号小标签 */
.chat-title-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.chat-phone {
  flex-shrink: 0; font-size: 12.5px; font-weight: 400;
  color: rgba(255,255,255,.78); white-space: nowrap;
}
.chat-head-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.chat-account-chip {
  flex-shrink: 0; font-size: 11px; line-height: 1.8; padding: 0 8px;
  border-radius: 20px; color: #fff; background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.25); white-space: nowrap;
}
.sub-select {
  border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.14);
  color: #fff; border-radius: 9px; padding: 7px 10px; font-size: 13px;
  cursor: pointer; max-width: 180px;
}
.sub-select option { color: var(--text); background: #fff; }

/* ============ 下拉菜单(聊天头部「更多」/ 会话右键) ============ */
.dd-menu {
  position: absolute; top: 56px; right: 8px; z-index: 40;
  background: #fff; border-radius: 10px; box-shadow: 0 2px 12px rgba(0,0,0,.25);
  padding: 6px; min-width: 190px;
}
.dd-menu button {
  width: 100%; border: none; background: transparent; text-align: left;
  padding: 10px 12px; font-size: 14px; border-radius: 7px; color: var(--text); white-space: nowrap;
}
.dd-menu button:hover { background: #f5f6f6; }

/* 引用回复条(输入框上方) */
.quote-bar {
  display: flex; align-items: center; gap: 8px;
  background: #f0f2f5; border-left: 4px solid var(--wa-green);
  padding: 8px 14px; flex-shrink: 0; font-size: 13px;
}
.quote-label { color: var(--wa-green-dark); font-weight: 600; flex-shrink: 0; }
.quote-text { color: var(--text-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.quote-close { border: none; background: transparent; color: var(--text-sub); font-size: 18px; cursor: pointer; flex-shrink: 0; }
.quote-close:hover { color: var(--text); }

/* 气泡内引用块 */
.bubble-quote {
  background: rgba(0,0,0,.06); border-left: 3px solid var(--wa-green);
  border-radius: 4px; padding: 4px 8px; margin-bottom: 4px; max-width: 100%;
}
.bq-name { display: block; font-size: 12px; color: var(--wa-green-dark); font-weight: 600; margin-bottom: 1px; }
.bq-text { display: block; font-size: 12px; color: var(--text-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* emoji 面板 */
.emoji-panel {
  position: absolute; bottom: 58px; left: 10px; z-index: 30;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px;
  background: #fff; border-radius: 12px; box-shadow: 0 2px 14px rgba(0,0,0,.25);
  padding: 8px;
}
.emoji-item { border: none; background: transparent; font-size: 20px; padding: 6px; border-radius: 8px; cursor: pointer; line-height: 1; }
.emoji-item:hover { background: #f0f2f5; }

/* 联系人信息弹窗 */
.info-rows { display: flex; flex-direction: column; gap: 12px; margin-bottom: 6px; }
.info-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.info-k { color: var(--text-sub); flex-shrink: 0; }
.info-v { color: var(--text); word-break: break-all; text-align: right; }
.info-v.unassigned { color: var(--text-sub); font-weight: 400; }
/* 客户资料右侧面板(仿 WhatsApp 原版:右侧滑出抽屉) */
.profile-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 340px; max-width: 92vw;
  background: #fff; z-index: 60; display: flex; flex-direction: column;
  box-shadow: -2px 0 14px rgba(0,0,0,.18);
  transform: translateX(105%); transition: transform .25s ease, visibility .25s;
  visibility: hidden;
}
.profile-panel.open { transform: translateX(0); visibility: visible; }
.profile-panel-head {
  background: var(--header-bg); color: #fff; display: flex; align-items: center;
  gap: 8px; padding: 12px 14px; flex-shrink: 0;
}
.profile-panel-back {
  border: none; background: transparent; color: #fff; font-size: 22px; cursor: pointer;
  padding: 4px 10px; border-radius: 50%; line-height: 1;
}
.profile-panel-back:hover { background: rgba(255,255,255,.16); }
.profile-panel-title { font-size: 17px; font-weight: 600; }
.profile-panel-refresh {
  margin-left: auto; border: none; background: transparent; color: #fff; cursor: pointer;
  font-size: 17px; line-height: 1; padding: 6px 10px; border-radius: 50%;
}
.profile-panel-refresh:hover { background: rgba(255,255,255,.16); }
.profile-panel-refresh:disabled { opacity: .5; cursor: default; }
.profile-panel-body { flex: 1; overflow-y: auto; background: #f0f2f5; padding: 24px 20px; }
.profile-big-avatar {
  width: 160px; height: 160px; margin: 8px auto 20px;
  border-radius: 12px; font-size: 56px;
}
.profile-big-avatar .avatar-img { border-radius: 12px; }
.profile-name { text-align: center; font-size: 20px; font-weight: 600; color: var(--text); }
.profile-status { text-align: center; font-size: 14px; color: var(--text-sub); margin: 4px 0 20px; }
.profile-card {
  background: #fff; border-radius: 10px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 12px;
}

/* 静音会话:未读徽标灰底 */
.chat-item.muted .chat-unread { background: #d1d7db; }

/* ============ Toast ============ */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: #323739; color: #fff; padding: 12px 22px; border-radius: 8px;
  font-size: 14px; z-index: 200; box-shadow: 0 4px 14px rgba(0,0,0,.3);
}

/* ============ 响应式 ============ */
@media (max-width: 860px) {
  #systemNav { width: 52px; }
  .nav-btn { width: 40px; height: 40px; font-size: 18px; }
  #sidebar { width: 100%; }
  #sidebar.phone-hidden { display: none; }
  #chatPane { width: 100%; }
  #chatPane.phone-hidden { display: none; }
  .chat-back { display: flex; }
  .bubble { max-width: 85%; }
  .accounts-body { padding: 14px 14px 22px; }
  .sub-view-head { padding: 12px 14px; }
  .btn-head { padding: 8px 12px; font-size: 13px; }
  .chat-account-chip { display: none; }   /* 窄屏优先保留客户号码 */
}

/* 窄屏:号码卡片改为上下两段,操作按钮换到第二行 */
@media (max-width: 620px) {
  .account-item { flex-direction: column; align-items: stretch; gap: 10px; padding: 13px 14px; }
  .account-item .avatar { width: 42px; height: 42px; font-size: 16px; }
  .acct-actions { justify-content: flex-end; gap: 8px; padding-top: 10px; border-top: 1px solid #f0f2f5; }
  .acct-btn { flex: 1; text-align: center; }
  .account-name { font-size: 15px; }
  .chat-title { font-size: 15px; }
  .chat-phone { font-size: 11.5px; }
}


/* 客户页:未识别徽标 / 隐藏(暂时删除)按钮 / 顶部开关 */
.contact-unknown {
  flex-shrink: 0; font-size: 11px; line-height: 1.7; padding: 0 7px;
  border-radius: 20px; color: #a06a00; background: #fff3d6;
}
  flex-shrink: 0; border: 1px solid #e0e5e7; background: #fff; color: #8a949b;
  border-radius: 8px; padding: 4px 9px; font-size: 12px; line-height: 1.4;
  transition: background .15s, color .15s, border-color .15s;
}
  display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px;
  color: rgba(255,255,255,.9); cursor: pointer; user-select: none;
}
  border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.14);
  color: #fff; border-radius: 9px; padding: 6px 10px; font-size: 12.5px;
  cursor: pointer; white-space: nowrap; transition: background .15s;
}
/* 号码管理:维护(危险操作)区 */
.danger-zone {
  margin-top: 20px; padding: 14px 16px; border-radius: 12px;
  border: 1px dashed #f0c7c3; background: #fffafa;
}
.danger-title { font-size: 13px; font-weight: 600; color: #b3261e; margin-bottom: 6px; }
.danger-text { font-size: 12.5px; line-height: 1.75; color: var(--text-sub); margin-bottom: 10px; }
.btn-danger-ghost {
  border: 1px solid #f0c7c3; background: #fff; color: #b3261e;
  border-radius: 9px; padding: 8px 14px; font-size: 13px;
  transition: background .15s, border-color .15s;
}
.btn-danger-ghost:hover { background: #ffecec; border-color: #e8a9a3; }

/* ============ 设置端:成员 / 分配 ============ */
.member-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: #fff; border: 1px solid #e9edef; border-radius: 14px; }
.member-item.disabled { opacity: .6; }
.member-item .avatar { width: 44px; height: 44px; font-size: 16px; }
.member-uname { font-size: 12.5px; color: var(--text-sub); }
.assign-block { margin-bottom: 26px; }
.assign-title { font-size: 14px; font-weight: 600; margin-bottom: 10px; color: var(--text); }
.assign-empty { font-size: 13px; color: var(--text-sub); padding: 8px 0; }
.rule-list { display: flex; flex-direction: column; gap: 8px; }
.rule-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: #fff; border: 1px solid #e9edef; border-radius: 12px; }
.rule-item.disabled { opacity: .55; }
.rule-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rule-name { font-weight: 600; font-size: 14px; }
.rule-meta { font-size: 12.5px; color: var(--text-sub); }
.assign-filter { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.assign-filter input { flex: 1; min-width: 160px; padding: 8px 12px;
  border: 1px solid #e0e5e7; border-radius: 9px; font-size: 13px; }
.form-select { border: 1px solid #e0e5e7; border-radius: 9px; padding: 7px 10px;
  font-size: 13px; background: #fff; color: var(--text); max-width: 100%; }
.assign-list { display: flex; flex-direction: column; gap: 6px; }
.assign-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: #fff; border: 1px solid #e9edef; border-radius: 12px; }
.assign-info { flex: 1; min-width: 0; }
.assign-name { font-weight: 600; font-size: 14px; }
.assign-meta { font-size: 12.5px; color: var(--text-sub); margin-top: 2px; }
.assign-owner { width: 180px; flex-shrink: 0; }
#memberApp .m-side-head .me-name { color: #fff; }
/* 聊天记录:所属挂机号码徽标 */
.chat-acct {
  flex-shrink: 0; font-size: 10.5px; line-height: 1.6; padding: 0 6px;
  border-radius: 10px; color: #2f6178; background: #eaf3f8; border: 1px solid #d9e8f0;
  max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* ============ 后台:左侧菜单 + 右侧内容 ============ */
#main-view { background: #f5f6f8; }

#adminMenu {
  width: 216px; flex-shrink: 0; background: #1f2d3d; color: #cfd8e3;
  display: flex; flex-direction: column; height: 100vh;
}
.admin-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.brand-logo {
  width: 30px; height: 30px; border-radius: 8px; background: var(--wa-green);
  color: #fff; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.brand-text { font-size: 15px; font-weight: 600; color: #fff; }
.admin-menu { flex: 1; padding: 6px 10px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border: none; border-radius: 9px; background: transparent;
  color: #c3cedb; font-size: 14px; text-align: left; cursor: pointer;
  transition: background .15s, color .15s;
}
.menu-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.menu-item.active { background: var(--wa-green); color: #fff; font-weight: 600; }
.mi-icon { width: 20px; text-align: center; font-size: 15px; }
.mi-text { flex: 1; }
.admin-foot { padding: 12px 14px 16px; border-top: 1px solid rgba(255,255,255,.08); }
.admin-user { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.au-name { color: #fff; font-size: 13.5px; font-weight: 600; }
.au-role { color: #8b9bb0; font-size: 11.5px; }
.admin-ver { display: inline-block; color: #6b7d92; font-size: 11px; margin-bottom: 8px; vertical-align: middle; }
.admin-ver-link {
  display: inline-block; margin: 0 0 8px 8px; padding: 1px 6px;
  border: none; background: transparent; color: #7fd1bd; font-size: 11px;
  border-radius: 4px; vertical-align: middle;
}
.admin-ver-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.menu-logout {
  width: 100%; padding: 8px; border: 1px solid rgba(255,255,255,.16);
  background: transparent; color: #cfd8e3; border-radius: 8px; font-size: 12.5px;
  transition: background .15s, color .15s;
}
.menu-logout:hover { background: rgba(255,255,255,.1); color: #fff; }

/* 管理页统一浅色头部(替代原来的深绿头) */
.sub-view-head {
  background: #fff; border-bottom: 1px solid #e6eaee;
  padding: 15px 24px;
}
.sub-view-head h2 { color: var(--text); font-size: 17px; }
.sub-view-sub { color: var(--text-sub); }
.sub-head-actions .sub-btn {
  border-color: #dce3e8; background: #fff; color: var(--text);
}
.sub-head-actions .sub-btn:hover { background: #f2f5f7; }
.sub-head-actions .icon-btn { color: var(--text-header); }
.sub-head-actions .icon-btn:hover { background: #eef2f5; }
.sub-select { background: #fff; color: var(--text); border-color: #dce3e8; }
.accounts-body { max-width: 1080px; }

/* 聊天模块:列表宽度收窄,更像后台 */
#sidebar { width: 340px; }
/* 聊天模块也统一成后台浅色头部(正文气泡保持 WhatsApp 风格) */
#sidebar .pane-header,
#chatPane .chat-header {
  background: #fff; border-bottom: 1px solid #e6eaee; height: 56px; padding: 8px 16px;
}
#sidebar .pane-header .icon-btn,
#chatPane .pane-header .icon-btn { color: var(--text-header); }
#sidebar .pane-header .icon-btn:hover,
#chatPane .pane-header .icon-btn:hover { background: #eef2f5; }
#chatPane .pane-header .chat-title { color: var(--text); }
#chatPane .pane-header .chat-status { color: var(--text-sub); }
#chatPane .pane-header .chat-phone { color: var(--text-sub); }
#chatPane .pane-header .chat-account-chip {
  color: #2f6178; background: #eaf3f8; border-color: #d9e8f0;
}
#chatPane .pane-header .ai-toggle { background: #eef2f5; color: var(--text); }
#chatPane .pane-header .ai-toggle.ai-on { background: var(--wa-green); color: #fff; }
#chatPane .pane-header .avatar { border: none; }
#sidebar .pane-header .avatar { border: none; }
/* 会话列表看起来更像后台表格 */
#sidebar { border-right: 1px solid #e6eaee; }
.chat-item { border-radius: 0; }
.chat-item.active { background: #eef7f3; }
/* 号码接待成员池 */
.pool-list { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; max-height: 260px; overflow-y: auto; }
.pool-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border: 1px solid #e9edef; border-radius: 9px; font-size: 13.5px; cursor: pointer; }
.pool-item:hover { background: #f7f9fa; }
.pool-item input { width: auto; margin: 0; }
.pool-empty { font-size: 13px; color: var(--text-sub); padding: 8px 0; }

/* ============ 号码「接待成员」弹窗 ============ */
.pool-card { width: min(470px, 94vw); }
.pool-desc { margin: 8px 0 12px; line-height: 1.55; }
.pool-tools { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pool-count { flex: 1; font-size: 12px; color: var(--text-sub); }
.pool-count.warn { color: #d9480f; font-weight: 600; }
.pool-desc-warn { color: #d9480f; }
.pool-warn {
  margin: 0 0 10px; padding: 8px 10px; border-radius: 8px;
  background: #fff4e5; border: 1px solid #ffd8a8; color: #9a5b00;
  font-size: 12px; line-height: 1.5;
}
#acctPoolList { max-height: 320px; overflow-y: auto; }
.pool-item-main { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.pool-item-name {
  font-size: 13.5px; font-weight: 500; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pool-item-meta {
  font-size: 11.5px; color: var(--text-sub);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pool-state {
  flex: none; font-size: 11px; padding: 1px 8px; border-radius: 999px;
  background: #f0f2f5; color: #6b7d92; white-space: nowrap;
}
.pool-state.online { background: #e7f8f2; color: #00674f; }
.pool-state.busy { background: #fff4e5; color: #9a5b00; }
.pool-state.offline { background: #f0f2f5; color: #6b7d92; }

/* 号码卡片上的接待成员行(可点开设置) */
.account-pool-btn {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  border: none; background: transparent; padding: 0; cursor: pointer;
  font-size: 12.5px; font-family: inherit; text-align: left;
}
.account-pool-btn:hover { color: var(--wa-green-dark); }
.ap-label { flex: none; color: #8a97a3; }
.ap-names {
  color: var(--text); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; max-width: 340px;
}
.ap-edit { flex: none; color: var(--wa-green-dark); opacity: .72; font-size: 11.5px; }
.ap-off { font-style: normal; color: #9a5b00; }
.account-pool-btn:hover .ap-edit { opacity: 1; text-decoration: underline; }
/* ============ 客户管理 ============ */
.sub-search {
  border: 1px solid #dce3e8; border-radius: 9px; padding: 7px 12px;
  font-size: 13px; background: #fff; min-width: 170px;
}
.sub-search:focus { border-color: var(--wa-green); }
.cust-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: #fff; border: 1px solid #e9edef; border-radius: 12px;
}
.cust-avatar {
  width: 40px; height: 40px; border-radius: 50%; color: #fff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
/* 客户管理:头像可点开客户资料 */
.cust-avatar-btn { cursor: pointer; transition: box-shadow .15s, transform .15s; }
.cust-avatar-btn:hover { box-shadow: 0 0 0 3px rgba(0, 168, 132, .22); }
.cust-avatar-btn:focus-visible { outline: 2px solid var(--wa-green); outline-offset: 2px; }
.cust-avatar-btn:active { transform: scale(.94); }
.cust-info { flex: 1; min-width: 0; }
.cust-name { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.cust-link { color: var(--text); text-decoration: none; }
.cust-link:hover { color: var(--wa-green-dark); text-decoration: underline; }
.cust-meta { font-size: 12.5px; color: var(--text-sub); margin-top: 3px; }
/* 分配方式单选卡片 */
.strategy-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.strategy-card {
  display: flex; gap: 10px; align-items: flex-start; padding: 14px;
  background: #fff; border: 1.5px solid #e6eaee; border-radius: 12px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.strategy-card:hover { border-color: #cfe6dd; box-shadow: 0 2px 8px rgba(11,20,26,.06); }
.strategy-card.active { border-color: var(--wa-green); background: #f5fdf9; }
.strategy-card input { margin-top: 3px; width: auto; }
.strategy-name { font-weight: 600; font-size: 14px; }
.strategy-desc { font-size: 12.5px; color: var(--text-sub); margin-top: 3px; line-height: 1.6; }
/* 分配缓冲池 */
.pool-card { background: #fff; border: 1px solid #e6eaee; border-radius: 12px; padding: 14px 16px; }
.pool-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.pool-stat {
  flex: 1 1 120px; display: flex; flex-direction: column; gap: 2px;
  background: #f8fafb; border: 1px solid #eef2f5; border-radius: 10px; padding: 10px 12px;
}
.pool-stat b { font-size: 20px; line-height: 1.2; color: var(--wa-green-dark); }
.pool-stat span { font-size: 12px; color: var(--text-sub); }
.pool-state {
  margin: 10px 0 12px; padding: 8px 10px; border-radius: 8px;
  background: #f5fdf9; font-size: 12.5px; line-height: 1.6; color: var(--text-sub);
}
.pool-config { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.pool-field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--text-sub); }
.pool-field input[type=number] { width: 140px; }
.pool-field select { min-width: 200px; }
.pool-switch {
  display: inline-flex; align-items: center; gap: 6px;
  padding-bottom: 8px; font-size: 13px; cursor: pointer;
}
.pool-switch input { width: auto; margin: 0; }
.pool-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.pool-list-wrap { min-height: 118px; padding: 12px 14px; background: #fff; border: 1px solid #e9edef; border-radius: 12px; }
.pool-sub-title { margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--text); }
.pool-sub-title span { font-size: 12px; font-weight: 400; color: var(--text-sub); }
.pool-list { display: flex; flex-direction: column; gap: 6px; }
.pool-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 9px; background: #f8fafb; border: 1px solid #eef2f5;
  border-radius: 8px; font-size: 12.5px;
}
.pool-item-main { min-width: 0; }
.pool-item-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--text); }
.pool-item-meta { font-size: 11.5px; color: var(--text-sub); }
.pool-item-tag { flex-shrink: 0; white-space: nowrap; font-size: 11.5px; color: var(--wa-green-dark); }
.pool-empty { padding: 14px 4px; font-size: 12.5px; color: var(--text-sub); }
@media (max-width: 720px) { .pool-columns { grid-template-columns: 1fr; } }

/* 分配管理:说明文字 */
.assign-tip {
  font-size: 12.5px; line-height: 1.9; color: var(--text-sub);
  background: #f8fafb; border: 1px solid #eef2f5; border-radius: 10px;
  padding: 10px 14px; margin-bottom: 12px;
}
.assign-tip b { color: var(--text); }
/* 客户管理:批量操作条 */
.batch-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fff; border: 1px solid #e9edef; border-radius: 12px;
  padding: 10px 14px; margin-bottom: 10px;
}
.batch-all { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.batch-all input { width: auto; margin: 0; }
.batch-count { font-size: 12.5px; color: var(--text-sub); }
.batch-bar .btn-head { padding: 7px 14px; font-size: 13px; }
.batch-bar .btn-head:disabled { background: #cbd5d1; cursor: not-allowed; }
.cust-row .cust-check { width: auto; margin: 0 2px 0 0; flex-shrink: 0; }
.cust-row.selected { background: #f5fdf9; border-color: #b9e5d5; }
/* 客户管理:分页器 */
.pager {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 14px 0 4px;
}
.pager-btn {
  background: #fff; border: 1px solid #dce3e8; border-radius: 9px;
  padding: 7px 16px; font-size: 13px; color: var(--text);
}
.pager-btn:hover:not(:disabled) { border-color: var(--wa-green); color: var(--wa-green-dark); }
.pager-btn:disabled { opacity: .45; cursor: not-allowed; }
.pager-info { font-size: 13px; color: var(--text-sub); }
.pager-info b { color: var(--text); }
/* 分配规则:「通吃」标记 */
.rule-warn {
  margin-left: 8px; padding: 1px 7px; border-radius: 999px;
  background: #fff4e5; color: #a35d00; font-size: 11.5px; font-weight: 600;
  vertical-align: 1px;
}
/* ============ 翻译设置(管理端) ============ */
.tr-block {
  background: #fff; border: 1px solid #e9edef; border-radius: 12px;
  padding: 16px 18px; margin-bottom: 14px;
}
.tr-block .assign-title { margin: 0 0 12px; }
.tr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.tr-field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-sub); }
.tr-field.tr-wide { grid-column: 1 / -1; }
.tr-field input, .tr-field select { width: 100%; box-sizing: border-box; }
.tr-field .sub-search { min-width: 0; }
.tr-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text); margin: 10px 0 2px; cursor: pointer; }
.tr-check input { width: auto; margin: 0; }/* ============ 客户标签 ============ */
/* 颜色由标签定义动态给出(chip 上用 inline style),这里只负责形状与布局 */
.tag-chip {
  display: inline-flex; align-items: center; flex-shrink: 0;
  font-size: 11px; line-height: 1.7; padding: 0 7px;
  border: 1px solid transparent; border-radius: 999px;
  white-space: nowrap; max-width: 130px; overflow: hidden; text-overflow: ellipsis;
}
.tag-chip-sm { font-size: 10.5px; padding: 0 6px; max-width: 110px; }
.tag-empty { font-size: 12px; color: var(--text-sub); flex-shrink: 0; }
.tag-add-btn {
  border: 1px dashed #cfd8dd; background: transparent; color: var(--text-sub);
  border-radius: 999px; font-size: 11.5px; line-height: 1.7; padding: 0 7px;
  cursor: pointer; flex-shrink: 0;
}
.tag-add-btn:hover { border-color: var(--wa-green); color: var(--wa-green-dark); }
/* 客户管理列表里的标签区域(整块可点) */
.cust-tags {
  display: inline-flex; align-items: center; gap: 4px; flex-wrap: nowrap;
  max-width: 240px; overflow: hidden; flex-shrink: 0;
  background: transparent; border: 1px dashed transparent; border-radius: 9px;
  padding: 5px 6px; cursor: pointer; text-align: left;
}
.cust-tags:hover { border-color: #dce3e8; background: #f8fafb; }
.chat-tags-bar {
  display: flex; align-items: center; gap: 4px; max-width: 220px; overflow: hidden;
}
.profile-tags-box {
  display: inline-flex; flex-wrap: wrap; justify-content: flex-end;
  align-items: center; gap: 4px;
}
/* 标签管理 */
.tag-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: #fff; border: 1px solid #e9edef; border-radius: 12px;
}
.tag-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.tag-count { font-size: 12.5px; color: var(--text-sub); flex: 1; }
.tag-actions { display: flex; gap: 6px; }
.sub-btn.danger { color: #c0392b; border-color: #f0d0cc; }
.sub-btn.danger:hover { background: #fdf2f1; }
/* 标签选择 / 编辑弹窗 */
.tag-picker-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 46vh; overflow-y: auto; margin: 10px 0 2px;
}
.tag-picker-item {
  display: flex; align-items: center; gap: 8px; font-size: 13.5px;
  cursor: pointer; padding: 3px 2px;
}
.tag-picker-item input { width: auto; margin: 0; }
.tag-color-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 2px; }
.tag-color-dot {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 0 0 1px #dce3e8; cursor: pointer; padding: 0;
}
.tag-color-dot.active { box-shadow: 0 0 0 2px var(--wa-green); }
#tagEditGroup { width: 100%; box-sizing: border-box; }
/* 个人标签:虚线边框,与系统标签区分 */
.tag-chip-personal { border-style: dashed; }
/* 标签管理:按大类分组 */
.tag-group { display: flex; flex-direction: column; gap: 8px; padding: 0 0 4px; }
.tag-group + .tag-group { margin-top: 14px; border-top: 1px solid #eef2f4; padding-top: 14px; }
.tag-group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 2px; }
.tag-group-title { font-size: 14px; font-weight: 700; color: var(--text); }
.tag-group-count { font-size: 12px; font-weight: 400; color: var(--text-sub); margin-left: 4px; }
.tag-group-hint { font-size: 12px; color: var(--text-sub); }
.tag-group-personal { background: #fafbfc; border-radius: 14px; padding: 14px; }
.tag-owner { font-size: 12px; color: var(--text-sub); flex-shrink: 0; }
.tag-readonly { font-size: 12px; color: #98a4ab; flex-shrink: 0; }
.tag-row-personal { background: #f4f6f8; }
.tag-owner-block { display: flex; flex-direction: column; gap: 8px; }
.tag-owner-name { font-size: 12.5px; font-weight: 600; color: var(--text-sub); margin-top: 6px; }
/* 标签选择弹窗:按大类分组 */
.tag-picker-group { display: flex; flex-direction: column; gap: 6px; }
.tag-picker-group + .tag-picker-group { margin-top: 10px; border-top: 1px solid #eef2f4; padding-top: 8px; }
.tag-picker-group-name { font-size: 12px; font-weight: 700; color: var(--text-sub); padding: 2px 0; }
@media (max-width: 860px) {
  .cust-tags { max-width: 140px; }
  .chat-tags-bar { max-width: 120px; }
}

/* ============ 翻译设置:密钥可见 ============ */
.tr-secret { display: flex; gap: 8px; align-items: stretch; }
.tr-secret .sub-search {
  flex: 1 1 auto; width: auto; min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
  letter-spacing: .2px;
}
.tr-secret .tr-eye {
  flex: 0 0 auto; min-width: 54px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12.5px; border-radius: 9px; background: #fff; cursor: pointer;
}
.tr-secret .tr-eye:hover { background: #f2f7f5; }
