/* ---------- L-WAY 风格浅色主题 ---------- */
:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-2: #f0f3f9;
  --border: #e6eaf2;
  --text: #1f2430;
  --muted: #8a94a6;
  --accent: #4f7cff;
  --accent-2: #25c4d6;
  --accent-grad: linear-gradient(135deg, #4f7cff 0%, #6ea8ff 100%);
  --ok: #2ecc71;
  --warn: #f5a623;
  --danger: #ff5c5c;
  --shadow: 0 4px 20px rgba(31, 42, 68, .08);
}
* { box-sizing: border-box; }
.agent-profile-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.agent-profile-fields > label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.agent-profile-fields .inp { width: 100%; }
.agent-profile-wide { grid-column: 1 / -1; }
.agent-profile-avatar { display: grid !important; grid-template-columns: 56px 1fr; align-items: center; }
.agent-profile-avatar-preview { grid-row: span 2; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--panel-2); color: var(--accent); overflow: hidden; }
.agent-profile-avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.agent-profile-preview { white-space: pre-wrap; max-height: 180px; overflow: auto; padding: 10px; border: 1px solid var(--border); color: var(--text); background: var(--panel-2); font: inherit; }
.agent-profile-kb { display: flex; flex-wrap: wrap; gap: 8px 16px; }
@media (max-width: 700px) { .agent-profile-fields { grid-template-columns: minmax(0, 1fr); } .agent-profile-wide { grid-column: auto; } }
body { display: flex; flex-direction: column; min-height: 100vh;
  margin: 0; font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); height: 100vh; overflow: hidden;
}
.topbar { height: auto !important; overflow: visible !important; 
  height: 56px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 20px 4px; overflow: visible;
  background: #1d2b4e; border-bottom: 1px solid #16223e;
 }
.brand {
  font-weight: 800; font-size: 17px; letter-spacing: .5px; color: #fff;
  display: flex; align-items: center; gap: 8px;
}
.brand::before {
  content: ""; width: 26px; height: 26px; border-radius: 8px;
  background: var(--accent-grad); display: inline-block;
  box-shadow: 0 2px 8px rgba(79,124,255,.5);
}
.conn { font-size: 12px; color: #aab6d0; padding: 3px 10px; border: 1px solid #2c3d63; border-radius: 12px; background: #25355c; }
.spacer { flex: 1; }
.layout { display: flex; flex: 1; min-height: 0; }
.sidebar {
  width: 220px; background: #1d2b4e; border-right: 1px solid #16223e;
  padding: 14px 10px; overflow-y: auto;
}
.side-title { font-size: 12px; color: #7e8db3; margin: 14px 6px 8px; letter-spacing: .5px; font-weight: 600; }
.account-list { display: flex; flex-direction: column; gap: 8px; }
.acc-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 12px; box-shadow: var(--shadow);
}
.acc-card .name { font-weight: 700; display: flex; align-items: center; gap: 6px; font-size: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #c3cad6; }
.dot.on { background: var(--ok); box-shadow: 0 0 6px rgba(46,204,113,.5); }
.acc-card .meta { font-size: 12px; color: var(--muted); margin: 4px 0; }
.acc-card .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.nav-item {
  padding: 10px 12px; border-radius: 10px; cursor: pointer; color: #b9c4de;
  font-size: 14px; font-weight: 500; transition: all .15s; margin-bottom: 2px;
}
.nav-item:hover { background: #25355c; color: #fff; }
.nav-item.active { background: var(--accent-grad); color: #fff; box-shadow: 0 4px 14px rgba(79,124,255,.35); }
.content { flex: 1; min-width: 0; overflow-y: auto; overflow-x: hidden; padding: 16px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
h2 { margin-top: 0; }
h3 { margin: 0 0 10px; font-size: 14px; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.row { display: flex; gap: 8px; align-items: center; margin: 8px 0; flex-wrap: wrap; }
.inp {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 9px 12px; width: 100%; font-size: 13px; resize: vertical;
  outline: none; transition: border .15s;
}
.inp:focus { border-color: var(--accent); }
textarea.inp { min-height: 64px; }
.sel {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 8px 10px; font-size: 13px; outline: none;
}
.btn {
  background: var(--accent-grad); color: #fff; border: none; border-radius: 10px;
  padding: 9px 16px; cursor: pointer; font-size: 13px; font-weight: 600;
  transition: filter .15s, transform .05s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.98); }
.btn.ghost { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
pre.out {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px; font-size: 12px; max-height: 320px; overflow: auto;
  white-space: pre-wrap; word-break: break-all; color: var(--muted);
}
.hint { color: var(--muted); font-size: 12px; }
details { margin: 8px 0; }
details summary { cursor: pointer; color: var(--accent); font-size: 13px; }
/* ---------- IM 三栏 ---------- */
.im-grid { display: grid; grid-template-columns: 0.9fr 1.3fr 0.9fr; gap: 14px; height: calc(100vh - 104px); }
.im-col {
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  padding: 12px; display: flex; flex-direction: column; overflow: hidden;
  min-width: 0; box-shadow: var(--shadow);
}
.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 700; margin-bottom: 10px; font-size: 14px; gap: 6px; flex-wrap: wrap;
}
.conv-new { display: flex; gap: 6px; margin-bottom: 8px; }
.conv-list { overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.conv-item {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 9px 10px; cursor: pointer; transition: all .15s;
}
.conv-item:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.conv-item.active { border-color: var(--accent); background: #f0f5ff; }
.conv-item .cn { font-weight: 600; font-size: 13.5px; }
.conv-item .cl { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-row { display: flex; gap: 9px; align-items: center; }
.conv-main { min-width: 0; flex: 1; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none;
  cursor: pointer; background: var(--panel-2); border: 1px solid var(--border);
}
.avatar-ph {
  display: flex; align-items: center; justify-content: center; color: #fff;
  font-size: 15px; background: var(--accent-grad); border: none;
}
.remark-btn { padding: 1px 5px; font-size: 11px; }
.thread {
  flex: 1; min-width: 0; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; gap: 8px; padding: 6px 4px;
  background: var(--bg); border-radius: 12px;
}
.msg {
  max-width: 78%; width: fit-content; padding: 9px 13px; border-radius: 14px;
  font-size: 13.5px; line-height: 1.55; white-space: pre-wrap;
  word-break: break-word; overflow-wrap: anywhere;
  box-shadow: 0 1px 4px rgba(31,42,68,.06);
}
.msg.in { background: var(--panel); border: 1px solid var(--border); align-self: flex-start; border-top-left-radius: 4px; }
.msg.out {
  background: var(--accent-grad); color: #fff; align-self: flex-end;
  border-top-right-radius: 4px;
}
.msg .t { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.msg.out .t { color: rgba(255,255,255,.75); }
.msg.out .read-flag { font-size: 10px; color: rgba(255,255,255,.9); margin-top: 2px; text-align: right; letter-spacing: 1px; }
.msg.in .read-flag { display: none; }
.undelivered-flag { font-size: 11px; color: var(--warn); font-weight: 700; }
.recall-btn {
  background: rgba(255,255,255,.25); border: none; color: #fff; cursor: pointer;
  font-size: 11px; padding: 1px 5px; border-radius: 6px; margin-left: 4px;
}
.msg.in .recall-btn { display: none; }
.composer { border-top: 1px solid var(--border); padding-top: 8px; }
.emoji-panel {
  display: none; grid-template-columns: repeat(10, 1fr); gap: 2px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 6px; margin-bottom: 6px; max-height: 168px; overflow-y: auto;
}
.emoji-item { background: transparent; border: none; font-size: 19px; cursor: pointer; padding: 3px; border-radius: 8px; line-height: 1.2; }
.emoji-item:hover { background: var(--border); }
.live-feed { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.feed-item {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 7px 9px; font-size: 12px;
}
.feed-item .fa { color: var(--accent); font-weight: 700; }
.feed-item .ft { color: var(--muted); font-size: 11px; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #2a3040; color: #fff; padding: 11px 18px; border-radius: 12px;
  display: none; z-index: 99; font-size: 13px; box-shadow: 0 8px 30px rgba(0,0,0,.25);
}
.toast.show { display: block; }
.empty { color: var(--muted); font-size: 13px; text-align: center; margin-top: 30px; }
/* ---------- 登录卡片 ---------- */
#qrBox { margin: 10px 0; min-height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
#qrBox img { display: block; border-radius: 10px; }
.qr-loading { color: var(--muted); font-size: 13px; }
.qr-state { margin-top: 10px; font-size: 13px; color: var(--accent); font-weight: 600; }
.qr-state.err { color: var(--danger); }
.qr-verify-tip {
  margin-top: 12px; padding: 10px 12px; border-radius: 10px;
  background: #fff8e8; border: 1px solid var(--warn);
  color: #8a6d1f; font-size: 13px; line-height: 1.7; text-align: left;
}
.qr-verify-tip b { color: var(--danger); }
.qr-verify-detail { margin-top: 6px; font-size: 12px; color: #a07c1e; word-break: break-all; }
.qr-verify-err { margin-top: 8px; font-size: 12px; color: var(--danger); text-align: center; word-break: break-all; }
#qrBox .btn { margin-top: 12px; }
/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(30, 40, 60, .35);
  backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; z-index: 200;
}
.modal-mask.show { display: flex; }
.modal {
  width: 460px; max-width: 92vw; max-height: 90vh; overflow-y: auto;
  background: var(--panel); border-radius: 18px;
  padding: 24px; box-shadow: 0 20px 60px rgba(31,42,68,.25);
}
.modal-title { font-size: 17px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.modal-desc { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 14px; }
.modal-desc b { color: var(--danger); }
.vm-opt { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; background: var(--panel-2); }
.vm-opt > summary { cursor: pointer; font-weight: 600; color: var(--accent); font-size: 14px; }
.vm-opt-h { font-weight: 700; color: var(--accent); font-size: 14px; margin-bottom: 8px; }
.vm-note { margin-top: 8px; font-size: 12px; white-space: pre-wrap; word-break: break-all; color: var(--muted); max-height: 140px; overflow-y: auto; }
.steps { margin: 8px 0 0; padding-left: 20px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 12px; }
/* ---------- 扫码登录弹窗 ---------- */
.qr-modal { width: 400px; }
.qr-modal-body { display: flex; flex-direction: column; align-items: center; min-height: 220px; justify-content: center; }
.modal-qr-box { text-align: center; width: 100%; }
.modal-qr-box img { width: 200px; height: 200px; border: 8px solid #fff; border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.modal-qr-box .qr-state { margin-top: 10px; font-size: 13px; color: var(--accent); font-weight: 600; }
.modal-qr-box .qr-verify-tip { text-align: left; }
.qr-modal { max-height: 88vh; overflow-y: auto; }
.modal-qr-box .qr-state.err { color: var(--danger); }
.modal-sms-box { width: 100%; }
.modal-sms-box .row { display: flex; gap: 8px; margin-bottom: 10px; }
.modal-sms-box .row .inp { flex: 1; }
#modalSmsNote { margin-top: 8px; font-size: 12px; color: var(--muted); max-height: 120px; overflow-y: auto; }
#modalAppHelp { margin-top: 12px; }

.conv-new .btn { white-space: nowrap; }
.panel-head .sel { max-width: 150px; }

.nav-ico { width: 22px; height: 22px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; margin-right: 2px; flex: none; }

/* ---------- 数据大屏 ---------- */
.func-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.func-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-weight: 600; font-size: 14px; cursor: pointer; box-shadow: var(--shadow); transition: all .15s;
}
.func-card:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(79,124,255,.18); border-color: var(--accent); }
.fc-ico { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.chart-legend { display: flex; gap: 18px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.chart-legend .lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.lg-blue { background: #4f7cff; }
.lg-green { background: #7bc96f; }
.stats-chart { display: flex; gap: 14px; align-items: flex-end; height: 220px; padding: 0 6px; overflow-x: auto; }
/* ---------- 数据大屏 ---------- */
.func-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.func-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-weight: 600; font-size: 14px; cursor: pointer; box-shadow: var(--shadow); transition: all .15s;
}
.func-card:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(79,124,255,.18); border-color: var(--accent); }
.fc-ico { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.chart-legend { display: flex; gap: 18px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.chart-legend .lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.lg-blue { background: #4f7cff; }
.lg-green { background: #7bc96f; }
.stats-chart { display: flex; gap: 14px; align-items: flex-end; height: 220px; padding: 0 6px; overflow-x: auto; }
.chart-col { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 46px; flex: 1; height: 100%; justify-content: flex-end; }
.chart-bars { display: flex; gap: 3px; align-items: flex-end; height: calc(100% - 22px); width: 100%; justify-content: center; }
.bar { width: 14px; border-radius: 5px 5px 0 0; min-height: 2px; }
.bar-sent { background: #4f7cff; }
.bar-recv { background: #7bc96f; }
.chart-label { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60px; text-align: center; }
.notice-list { display: flex; flex-direction: column; gap: 8px; }
.notice-item { background: var(--panel-2); border-radius: 8px; padding: 9px 12px; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.notice-badge { background: #e8f3ff; color: var(--accent); font-size: 11px; padding: 2px 8px; border-radius: 6px; font-weight: 600; flex: none; }

/* ---------- 自动回复 / 客户管理 ---------- */
.switch-row { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 6px 0; cursor: pointer; }
.rule-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.rule-item { display: flex; align-items: center; gap: 10px; background: var(--panel-2); border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.rule-kw { font-weight: 600; color: var(--accent); }
.rule-arrow { color: var(--muted); }
.rule-reply { flex: 1; }
.peer-table { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.peer-item { display: flex; align-items: center; gap: 10px; background: var(--panel-2); border-radius: 12px; padding: 8px 12px; }
.peer-main { min-width: 0; flex: 1; }
.peer-name { font-weight: 600; font-size: 13.5px; }
.peer-meta { font-size: 11px; color: var(--muted); }
.peer-stats { display: flex; align-items: center; gap: 6px; }
.pill { font-size: 11px; padding: 2px 8px; border-radius: 8px; font-weight: 600; }
.pill-blue { background: #e8f3ff; color: var(--accent); }
.pill-green { background: #e8fff0; color: #2ecc71; }


/* ---------- AI 智能体 / 系统管理 ---------- */
.sys-list { display: flex; flex-direction: column; gap: 6px; }
.proxy-status { font-size: 12px; min-width: 100px; text-align: right; }

/* ---------- 批量群发进度 ---------- */
.mass-progress { margin: 8px 0; }
.mass-bar { background: var(--panel-2); border-radius: 8px; height: 14px; overflow: hidden; }
.mass-bar-in { background: var(--accent-grad); height: 100%; width: 0; transition: width .4s; }
#massStat { margin-top: 6px; }

/* ---------- 群发表单 / 向导 / 内容步骤 ---------- */
.flabel { font-size: 13px; color: var(--muted); min-width: 80px; text-align: right; flex: none; }
.cstep { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px; margin-bottom: 8px; }
.cstep-tabs { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.cstep-no { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ctab { background: transparent; border: 1px solid var(--border); border-radius: 8px; padding: 3px 10px; font-size: 12px; cursor: pointer; color: var(--muted); }
.ctab.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.ctab:disabled { opacity: .45; cursor: not-allowed; }
.cstep-del { margin-left: auto; background: transparent; border: none; cursor: pointer; font-size: 14px; }
.mass-mode-row { display: flex; gap: 18px; margin: 8px 0; }
.wizard-steps { display: flex; align-items: center; gap: 8px; margin: 10px 0 18px; }
.wstep { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; font-weight: 600; }
.wstep i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; }
.wstep.active { color: var(--accent); }
.wstep.active i { border-color: var(--accent); background: var(--accent); color: #fff; }
.wstep small { font-weight: 400; font-size: 11px; }
.wstep-line { flex: 1; height: 2px; background: var(--border); margin: 0 6px 26px; }
.dropzone {
  display: block; border: 2px dashed var(--border); border-radius: 14px;
  padding: 34px; text-align: center; cursor: pointer; color: var(--muted);
  font-size: 13.5px; line-height: 1.9; transition: border .15s; background: var(--panel-2);
}
.dropzone:hover { border-color: var(--accent); }
.material-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.material-item { display: flex; align-items: center; gap: 8px; background: var(--panel-2); border-radius: 10px; padding: 7px 10px; font-size: 12.5px; }
.material-no { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; flex: none; }
.material-path { flex: 1; word-break: break-all; }

/* ---------- 多平台聚合 catbus ---------- */
.cb-platforms { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.cb-plat { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px; text-align: center; cursor: pointer; transition: all .15s; }
.cb-plat:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.cb-plat b { display: block; font-size: 13px; margin-bottom: 3px; }
.cb-plat .hint { font-size: 11px; }

/* ---------- 全平台登录状态 ---------- */
.cb-status-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.cb-status { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px; text-align: center; }
.cb-status b { font-size: 13px; }
.cb-status .method-badges { margin: 5px 0; }
.method-badge { font-size: 10px; background: var(--border); color: var(--muted); padding: 1px 6px; border-radius: 6px; margin: 1px; }
.cb-status .cb-acts { display: flex; gap: 4px; justify-content: center; margin-top: 6px; flex-wrap: wrap; }

/* ---------- 多平台聚合：横排平台 chips + 竖排功能区 ---------- */
.cb-chip-row { display: flex; gap: 8px; align-items: center; }
.cb-chips { display: flex; gap: 8px; overflow-x: auto; flex: 1; padding-bottom: 2px; }
.cb-chip {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 8px 16px; cursor: pointer; font-size: 13px; flex: none;
  transition: all .15s;
}
.cb-chip:hover { border-color: var(--accent); }
.cb-chip.on { background: var(--accent-grad); color: #fff; border-color: transparent; }
.cb-body { display: grid; grid-template-columns: 230px 1fr; gap: 14px; align-items: start; }
.cb-side { min-height: 560px; max-height: calc(100vh - 210px); overflow-y: auto; }
.cb-func-menu { display: flex; flex-direction: column; gap: 2px; }
.cb-func-res {
  padding: 9px 10px; border-radius: 9px; cursor: pointer; font-size: 13.5px;
  font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px;
}
.cb-func-res:hover { background: var(--panel-2); }
.cb-caret { color: var(--muted); font-size: 11px; }
.cb-func-acts { padding-left: 14px; }
.cb-func-act {
  padding: 6px 10px; border-radius: 8px; cursor: pointer; font-size: 13px;
  color: var(--muted);
}
.cb-func-act:hover { color: var(--accent); background: var(--panel-2); }
.cb-func-act.on { color: var(--accent); background: #eef3ff; font-weight: 600; }
.cb-main-col { min-height: 560px; }

/* ---------- 全局平台横排条 ---------- */
.plat-bar {
  display: flex; flex-wrap: nowrap; gap: 3px; overflow-x: auto; width: 100%; padding: 7px 8px;
  padding: 0 4px;
}
.plat-chip {
  background: #25355c; border: 1px solid #2c3d63; color: #c6d2ea;
  border-radius: 999px; padding: 3px 7px; cursor: pointer; font-size: 11px;
  font-weight: 600; flex: none; transition: all .15s; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px;
}
.plat-chip .chip-ico { font-size: 16px; line-height: 1; }
.plat-chip:hover { border-color: var(--accent); color: #fff; }
.plat-chip.on { background: var(--accent-grad); color: #fff; border-color: transparent; box-shadow: 0 2px 10px rgba(79,124,255,.45); }

.plat-bar { background: #1d2b4e; border-bottom: 1px solid #16223e; }
.plat-bar::-webkit-scrollbar { display: none; height: 0; }
.plat-bar { scrollbar-width: none; -ms-overflow-style: none; }

/* ---------- 按账号分组统计 ---------- */
.acc-stats-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin: 14px 0 6px; }
.acc-stats-head:first-child { margin-top: 2px; }

/* ---------- 平台功能区具体化 ---------- */
.act-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.act-card {
  background: var(--panel-2); border: 2px solid var(--border); border-radius: 12px;
  padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 3px;
  transition: all .15s;
}
.act-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.act-card.on { border-color: var(--accent); background: #eef3ff; }
.act-card b { font-size: 13.5px; }
.act-card .hint { font-size: 11px; }
.plat-guide {
  background: #f6f9ff; border: 1px solid #dbe7ff; border-radius: 12px;
  padding: 10px 14px; font-size: 12.5px; color: var(--text); line-height: 1.9; margin-bottom: 10px;
}

/* ---------- 每账号当天统计 ---------- */
.today-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--panel-2); border-radius: 12px; padding: 10px 14px; margin-bottom: 8px;
}
.today-name { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.today-nums { display: flex; gap: 8px; }
.today-nums .pill { font-size: 12px; padding: 3px 10px; }

/* ---------- 账号 dock / 基础信息 / 常用语 ---------- */
.acc-dock { display: flex; gap: 8px; overflow-x: auto; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.acc-dock::-webkit-scrollbar { display: none; }
.dock-chip {
  display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer;
  font-size: 10.5px; color: var(--muted); flex: none; width: 56px; text-align: center;
}
.dock-chip { position: relative; }
.unread-badge { display: inline-block; min-width: 18px; padding: 1px 5px; border-radius: 12px; background: #e5484d; color: #fff; font-size: 11px; line-height: 16px; text-align: center; }
.dock-chip > .unread-badge { position: absolute; top: 0; right: 0; }
.conv-main > .unread-badge { float: right; }
.dock-chip .avatar { width: 36px; height: 36px; border-radius: 50%; }
.dock-chip.on span { color: var(--accent); font-weight: 700; }
.dock-chip.on .avatar { outline: 2px solid var(--accent); outline-offset: 2px; }
.conv-acc { font-size: 10px; background: #eef3ff; color: var(--accent); padding: 1px 6px; border-radius: 6px; }
.peer-info { overflow-y: auto; }
.peer-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.phrase-panel {
  position: fixed; right: 268px; bottom: 90px; width: 280px; max-height: 380px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 12px 40px rgba(31,42,68,.25); z-index: 50; overflow-y: auto;
}
.phrase-list { display: flex; flex-direction: column; }
.phrase-item {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 10px; font-size: 13px; border-bottom: 1px solid var(--panel-2); cursor: pointer;
}
.phrase-item:hover { background: var(--panel-2); }
.phrase-text { flex: 1; word-break: break-all; }

/* ---------- 平台私信聊天 ---------- */
#tab-platim .im-grid { height: calc(100vh - 150px); }
#pimThread .msg-row { display: flex; margin: 6px 12px; }
#pimThread .msg-row.out { justify-content: flex-end; }
#pimThread .bubble {
  max-width: 70%; padding: 8px 12px; border-radius: 12px; font-size: 13.5px;
  background: #fff; box-shadow: var(--shadow); word-break: break-all;
}
#pimThread .bubble.out { background: #95ec69; }

/* ---------- 账号管理表格 ---------- */
.acct-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.acct-table th, .acct-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.acct-table th { color: var(--muted); font-weight: 600; background: var(--panel-2); }
.acct-table tr:hover td { background: var(--panel-2); }

.main { flex: 1; min-width: 0; overflow-y: auto; padding: 16px; }

.func-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.func-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; transition: transform .15s; }
.func-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.fc-ico { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; }

#platBar { flex: 0 0 100%; min-width: 100%; order: 3; padding: 6px 0 8px; }

/* ============ 聚合私信台三栏布局 ============ */
.im-layout { display: flex; height: calc(100vh - 130px); min-height: 500px; overflow: hidden; }
.im-left { width: 300px; min-width: 260px; display: flex; flex-direction: column; border-right: 1px solid var(--border); background: var(--panel); overflow: hidden; }
.im-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); overflow: hidden; }
.im-right { width: 300px; min-width: 260px; border-left: 1px solid var(--border); background: var(--panel); overflow-y: auto; }

/* dock：横向账号切换条 */
.dock { display: flex; gap: 6px; padding: 8px 10px; flex-wrap: nowrap; overflow-x: auto; border-bottom: 1px solid var(--border); }
.dock-chip { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 8px; border-radius: 8px; cursor: pointer; min-width: 52px; flex-shrink: 0; }
.dock-chip:hover { background: #f0f2f5; }
.dock-chip.on { background: #e8f4ff; }
.dock-chip .dock-av { width: 36px; height: 36px; border-radius: 50%; background: #dcdfe6; display: flex; align-items: center; justify-content: center; color: #909399; font-size: 14px; overflow: hidden; }
.dock-chip .dock-av img { width: 100%; height: 100%; object-fit: cover; }
.dock-chip .dock-name { font-size: 10px; color: var(--text2); max-width: 52px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 会话列表紧凑化 */
#convList { flex: 1; overflow-y: auto; }
.conv-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid #f0f2f5; }
.conv-item:hover { background: #f5f7fa; }
.conv-item.active { background: #e8f4ff; border-right: 3px solid #409EFF; }
.conv-avatar { width: 42px; height: 42px; border-radius: 8px; flex-shrink: 0; background: #dcdfe6; display: flex; align-items: center; justify-content: center; color: #909399; font-size: 18px; overflow: hidden; }
.conv-avatar img { width: 100%; height: 100%; object-fit: cover; }
.conv-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.conv-info .cn { font-size: 14px; font-weight: 500; color: #303133; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-info .cp { font-size: 12px; color: #909399; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 聊天线程 */
.thread-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--panel); }
.thread { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 12px 0; }
.composer { display: flex; flex-direction: column; flex: none; gap: 8px; padding: 8px 14px 12px; border-top: 1px solid var(--border); background: var(--panel); align-items: stretch; }
.composer-toolbar { display: flex; align-items: center; gap: 14px; min-height: 32px; }
.composer-toolbar .send-transport { margin-left: auto; }
.composer-tool { display: inline-flex; align-items: center; gap: 5px; padding: 4px 0; border: 0; background: transparent; color: #606c80; cursor: pointer; font-size: 12px; }
.composer-tool svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.composer-tool:hover, .composer-tool[aria-expanded="true"] { color: var(--accent); }
.composer-tool:disabled { opacity: .45; cursor: wait; }
.composer textarea { flex: none; width: 100%; min-height: 84px; max-height: 140px; resize: none; background: transparent; border: 0; border-radius: 0; padding: 4px 0; line-height: 1.6; }
.composer-footer { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.composer-footer #btnSend { min-width: 64px; background: #409eff; }
.send-transport { display: inline-flex; align-items: center; gap: 5px; color: var(--text2); font-size: 12px; white-space: nowrap; }
.send-transport .sel { min-width: 130px; height: 30px; padding: 3px 24px 3px 8px; }
.composer .emoji-panel { margin: 0; grid-template-columns: repeat(auto-fill, minmax(28px, 1fr)); }
.composer-card { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); max-height: 220px; overflow-y: auto; }
.composer-card[hidden], .composer-attachment[hidden] { display: none; }
.composer-card label { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 12px; color: #606c80; }
.composer-card .inp { background: var(--panel); padding: 6px 8px; }
.composer-card-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; }
.composer-attachment { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; background: #eef5ff; color: #486c9c; font-size: 12px; }
#composerAttachmentName { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#btnRemoveAttachment { border: 0; background: transparent; color: var(--accent); cursor: pointer; }
@media (max-width: 1000px) { .composer-tool { gap: 3px; } .composer-toolbar { gap: 10px; } .composer-footer .hint { font-size: 10px; } .composer-card { grid-template-columns: minmax(0, 1fr); } }
.composer-ai-toggle { padding: 2px 14px 8px; background: var(--panel); }
.msg-row.out .m-body { position: relative; }
.msg-row.out .send-status-failed { display: block; position: absolute; left: -16px; top: 15px; width: 7px; height: 7px; border-radius: 50%; background: #e74c3c; cursor: help; }
.msg-row.out .send-status-sent { display: block; position: absolute; left: -16px; top: 15px; width: 7px; height: 7px; border-radius: 50%; background: #9aa0a6; cursor: help; }
.send-status:not(.send-status-failed):empty { display: none; }

/* 右栏信息面板 */
.info-tabs { display: flex; border-bottom: 1px solid var(--border); background: var(--panel); }
.info-tab { flex: 1; padding: 10px 4px; text-align: center; font-size: 12px; cursor: pointer; border-bottom: 2px solid transparent; color: var(--text2); background: none; border-left: none; border-right: none; border-top: none; }
.info-tab.on { color: #409EFF; border-bottom-color: #409EFF; font-weight: 500; }
.info-panel { padding: 12px; }


/* 消息头像（v2 安全版） */
#thread .msg-row { display: flex; align-items: flex-start; gap: 8px; padding: 3px 14px; }
#thread .msg-row.in { flex-direction: row; }
#thread .msg-row.out { flex-direction: row-reverse; }
#thread .m-avatar { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; background: #e0e6ef; display: flex; align-items: center; justify-content: center; color: #7a8ba8; font-size: 14px; overflow: hidden; margin-top: 2px; }
#thread .m-avatar img { width: 100%; height: 100%; object-fit: cover; }
#thread .m-body { display: flex; flex-direction: column; max-width: 68%; }
/* 时间分隔线：居中 + 浅灰 */
.msg-divider { display: flex; justify-content: center; margin: 12px 0 6px; }
.msg-divider span { font-size: 11px; color: var(--text2, #94a3b8); background: rgba(148, 163, 184, .12); padding: 2px 12px; border-radius: 999px; }
/* 官方表情面板 + 气泡内联表情 */
.emoji-panel .emoji-item img { width: 30px; height: 30px; display: block; }
.emote-inline { width: 22px; height: 22px; vertical-align: -5px; margin: 0 1px; }
/* 富文本输入框（contenteditable）：emote 码显示为图；加大可视面积 */
.msg-input { min-height: 120px; max-height: 240px; overflow-y: auto; white-space: pre-wrap; word-break: break-word; line-height: 1.6; }
.msg-input:empty::before { content: attr(data-placeholder); color: var(--text2, #94a3b8); pointer-events: none; }
.msg-input img.emote-inline { width: 26px; height: 26px; vertical-align: -7px; }
#thread .msg-row.in .m-body { align-items: flex-start; }
#thread .msg-row.out .m-body { align-items: flex-end; }
#thread .bubble { padding: 8px 12px; border-radius: 10px; font-size: 14px; word-break: break-word; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
#thread .msg-row.in .bubble { background: #fff; border: 1px solid #e8ecf2; color: #303133; border-top-left-radius: 3px; }
#thread .msg-row.out .bubble { background: #409EFF; color: #fff; border-top-right-radius: 3px; }
#thread .bubble .recall-btn { margin-left: 6px; cursor: pointer; opacity: .7; }
/* 引用是悬停操作，不在每句话末尾常驻显示引号。 */
#thread .bubble .quote-btn { display: none; }
#thread .msg-row:hover .quote-btn { display: inline; cursor: pointer; }
#thread .bubble:focus-within .quote-btn { display: inline; }
#thread .m-time { font-size: 10px; color: #b8c0cc; margin-top: 2px; }
/* 引用条 */
.quote-bar { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: #f0f4f8; border-left: 3px solid #409EFF; font-size: 12px; color: #606c80; }
.quote-bar .quote-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.conv-filter { gap: 6px; }
.filter-tab { flex: 1; padding: 5px 0; text-align: center; font-size: 12px; border-radius: 6px; cursor: pointer; background: #f0f2f5; color: #606c80; border: none; }
.filter-tab.on { background: #409EFF; color: #fff; font-weight: 500; }

#tab-im { padding: 0 !important; height: calc(100vh - 130px); overflow: hidden; }

.reach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.reach-ch { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; background: var(--panel); }
.reach-ch:hover { border-color: #409EFF; }
.reach-ch .rc-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.reach-ch .rc-name { font-size: 13px; font-weight: 500; }
.reach-ch .rc-hint { font-size: 11px; color: var(--text2); }

/* ---- 消息右键菜单（复制/引用/撤回，仿官方客户端） ---- */
.ctx-menu {
  position: fixed;
  z-index: 9999;
  min-width: 96px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .16);
  padding: 5px;
  font-size: 13px;
  user-select: none;
}
.ctx-item {
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  color: #182536;
  white-space: nowrap;
}
.ctx-item:hover { background: #eef4ff; }

/* ---- 聊天消息内图片（收到的图片/表情包，走带 Cookie 的代理） ---- */
.msg-img {
  max-width: 200px;
  max-height: 240px;
  border-radius: 10px;
  display: block;
  cursor: pointer;
}

/* ---- 扫码弹窗二维码图片 ---- */
#modalQrBox img {
  width: 220px;
  height: 220px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
}
