/* 在线客服 · 客服工作台 */
:root {
  --bg: #f4f6f9;
  --panel: #fff;
  --line: #e6e9f0;
  --text: #1f2430;
  --muted: #8a93a5;
  --brand: #1d8fea;
  --brand-dark: #1577c9;
  --ok: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(20, 30, 50, .06);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.hidden { display: none !important; }
button { font: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font: inherit; }

/* ---------------------------------------------------------- 登录 */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #eef4fb 0%, #f7f9fc 50%, #eaf1f8 100%); padding: 24px;
}
.login-card {
  width: min(1000px, 100%); background: #fff; border-radius: 20px; overflow: hidden;
  box-shadow: 0 24px 70px rgba(20,40,80,.16); display: grid;
  grid-template-columns: 1fr 1fr;
}

/* 左侧品牌区 */
.login-brand-side {
  position: relative; padding: 38px 40px; color: #fff; display: flex; flex-direction: column;
  background:
    radial-gradient(900px 500px at 110% -10%, rgba(96,165,250,.45), transparent 60%),
    radial-gradient(700px 420px at -20% 110%, rgba(59,130,246,.35), transparent 60%),
    linear-gradient(160deg, #123a9c 0%, #1b4fd0 48%, #2364e8 100%);
}
.lb-top { display: flex; align-items: center; gap: 12px; }
.lb-icon {
  width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.18); font-size: 19px;
}
.lb-name { font-size: 19px; font-weight: 700; letter-spacing: .5px; }
.lb-sub { font-size: 12px; opacity: .72; margin-top: 2px; }
.lb-hero { margin: 44px 0 30px; }
.lb-kicker { font-size: 11px; letter-spacing: .22em; opacity: .6; margin-bottom: 14px; }
.lb-title { font-size: 33px; line-height: 1.28; font-weight: 700; margin: 0 0 14px; }
.lb-desc { font-size: 13.5px; line-height: 1.75; opacity: .78; margin: 0; max-width: 330px; }
.lb-preview {
  margin-top: auto; background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.18);
  border-radius: 16px; padding: 16px 16px 0; backdrop-filter: blur(6px);
}
.lb-preview-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.lb-dot { width: 8px; height: 8px; border-radius: 50%; background: #7dd3fc; box-shadow: 0 0 0 4px rgba(125,211,252,.2); }
.lb-online { margin-left: auto; font-size: 11.5px; font-weight: 500; color: #86efac; }
.lb-chat { display: flex; flex-direction: column; gap: 8px; padding-bottom: 14px; }
.lb-msg { max-width: 78%; padding: 8px 13px; border-radius: 12px; font-size: 12.5px; }
.lb-msg-visitor { background: rgba(255,255,255,.92); color: #1f2430; border-bottom-left-radius: 4px; align-self: flex-start; }
.lb-msg-seat { background: #1d8fea; color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.lb-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(255,255,255,.16); padding: 12px 0; }
.lb-stats > div { text-align: center; }
.lb-stats b { display: block; font-size: 17px; font-weight: 700; }
.lb-stats span { font-size: 11px; opacity: .68; }
.lb-links { display: flex; gap: 18px; padding-top: 16px; font-size: 11.5px; opacity: .6; }
.lb-links span::before { content: "◦ "; }

/* 右侧表单区 */
.login-form-side { padding: 44px 46px 34px; display: flex; flex-direction: column; }
.lf-head { margin-bottom: 26px; }
.lf-head h2 { margin: 0 0 6px; font-size: 25px; font-weight: 700; }
.lf-head p { margin: 0; color: var(--muted); font-size: 13px; }
.input-icon { position: relative; display: flex; align-items: center; }
.input-icon svg { position: absolute; left: 12px; width: 17px; height: 17px; color: #a8b0c0; pointer-events: none; }
.input-icon input { padding-left: 38px; padding-right: 38px; }
.eye-btn { position: absolute; right: 6px; width: 30px; height: 30px; border-radius: 8px; color: #a8b0c0; font-size: 14px; }
.eye-btn:hover { background: #f1f4f9; color: var(--brand); }

.term-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.term-tab {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; text-align: left;
  display: grid; grid-template-columns: 22px 1fr; grid-template-rows: auto auto; gap: 2px 10px;
  align-items: center; background: #fbfcfe; transition: .15s;
}
.term-tab svg { width: 20px; height: 20px; grid-row: 1 / span 2; color: #a8b0c0; }
.term-tab b { font-size: 13.5px; font-weight: 600; }
.term-tab i { font-style: normal; font-size: 11.5px; color: var(--muted); }
.term-tab:hover { border-color: #b9d4f5; }
.term-tab.active { border-color: var(--brand); background: #f2f8ff; box-shadow: 0 0 0 3px rgba(29,143,234,.09); }
.term-tab.active svg { color: var(--brand); }

.lf-row { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 18px; }
.lf-row .check { margin: 0; }
.link-btn { color: var(--brand); font-size: 12.5px; }
.link-btn:hover { text-decoration: underline; }
.login-btn { width: 100%; padding: 13px 20px; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.login-btn .arrow { transition: transform .15s; }
.login-btn:hover .arrow { transform: translateX(3px); }

.lf-install {
  display: flex; align-items: center; gap: 12px; margin-top: 22px; padding: 13px 15px;
  background: #f6f9fd; border: 1px solid var(--line); border-radius: 12px;
}
.install-icon {
  width: 36px; height: 36px; border-radius: 10px; background: #1d8fea; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 16px; flex: none;
}
.lf-install > div { flex: 1; min-width: 0; }
.lf-install b { display: block; font-size: 13px; }
.lf-install p { margin: 2px 0 0; font-size: 11.5px; color: var(--muted); }

.lf-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 22px; font-size: 11.5px; color: var(--muted);
}
.lf-help a { color: var(--brand); text-decoration: none; }
.lf-help a:hover { text-decoration: underline; }

/* 旧版兼容 */
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.login-brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 5px rgba(29,143,234,.14); }
.login-title { font-size: 20px; font-weight: 700; }
.login-sub { font-size: 12px; color: var(--muted); }
.login-hint { color: var(--muted); font-size: 13px; margin: 10px 0 22px; }

@media (max-width: 860px) {
  .login-card { grid-template-columns: 1fr; }
  .login-brand-side { display: none; }
  .login-form-side { padding: 30px 24px; }
}

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  outline: none; background: #fbfcfe; transition: .15s; resize: vertical;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(29,143,234,.1); }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 13px; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 16px; }
.form-grid input[type="color"] { padding: 3px; height: 40px; }

.btn-primary { width: 100%; padding: 11px 20px; border-radius: 10px; color: #fff; background: var(--brand); font-weight: 600; transition: .15s; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary.inline { width: auto; padding: 9px 20px; }
.btn-primary.sm { width: auto; padding: 7px 16px; font-size: 13px; }
.btn-ghost { padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line); color: var(--text); background: #fff; transition: .15s; }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost.sm { padding: 6px 14px; font-size: 13px; }
.form-msg { font-size: 13px; color: var(--bad); margin-top: 10px; min-height: 18px; }

/* ---------------------------------------------------------- 布局 */
/* The workbench must not scroll as a whole: the conversation list, the
   message list and the side bar each scroll inside their own box. */
.app { display: flex; height: 100vh; overflow: hidden; }
@supports (height: 100dvh) { .app { height: 100dvh; } }
.side {
  width: 186px; flex: none; background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 16px 10px; overflow-y: auto; min-height: 0;
}
.side-brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; padding: 4px 10px 14px; }
.side-brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }
.side-brand .dot.off { background: var(--muted); }
.side-group { font-size: 11px; color: #b0b7c6; padding: 14px 12px 6px; letter-spacing: .04em; }
.nav-item {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 12px;
  border-radius: 9px; color: #4a5265; margin-bottom: 2px; text-align: left; font-size: 13.5px; transition: .15s;
}
.nav-item:hover { background: #f2f6fb; color: var(--brand); }
.nav-item.active { background: rgba(29,143,234,.1); color: var(--brand); font-weight: 600; }
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: .72; transition: opacity .15s; }
.nav-item:hover svg, .nav-item.active svg { opacity: 1; }
.side-foot { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 12px; }
.side-user { font-size: 12px; color: var(--muted); padding: 0 10px 8px; word-break: break-all; }
.side-foot .btn-ghost { width: 100%; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 52px; flex: none; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 18px; gap: 12px;
}
.top-left, .top-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.chip { padding: 4px 11px; border-radius: 999px; background: #f1f5fb; color: #4a5265; font-size: 12px; white-space: nowrap; }
.chip.ok { background: rgba(22,163,74,.1); color: var(--ok); }
.chip.off { background: #f1f3f7; color: var(--muted); }
.chip.dim { background: transparent; color: var(--muted); }
.chip.domain { background: rgba(29,143,234,.1); color: var(--brand); }
.content { flex: 1; min-height: 0; display: flex; }
.view { display: none; flex: 1; min-width: 0; overflow: auto; }
.view.active { display: flex; flex-direction: column; }

/* ---------------------------------------------------------- 工作台 */
.wb { flex: 1; display: flex; min-height: 0; }
.wb-list { width: 290px; flex: none; border-right: 1px solid var(--line); background: #fff; display: flex; flex-direction: column; }
.wb-toolbar { padding: 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.seg { display: flex; gap: 4px; background: #f2f5fa; padding: 3px; border-radius: 9px; overflow: hidden; }
.seg button { flex: 1; min-width: 0; padding: 5px 4px; border-radius: 7px; color: #5a6274; font-size: 12.5px; white-space: nowrap; }
.seg button.active { background: #fff; color: var(--brand); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.07); }
.seg-badge {
  display: inline-block; min-width: 15px; padding: 0 4px; margin-left: 2px;
  background: var(--brand); color: #fff; border-radius: 999px;
  font-size: 10px; line-height: 15px; text-align: center; vertical-align: 1px;
}
.seg button.active .seg-badge { background: var(--brand); }
.seg.small button { font-size: 12px; padding: 4px 10px; }
.search { padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; outline: none; width: 100%; }
.search.sm { font-size: 13px; padding: 7px 10px; }
.search:focus { border-color: var(--brand); }
.wb-convs { flex: 1; overflow-y: auto; min-height: 0; }
.wb-empty { padding: 40px 16px; text-align: center; color: var(--muted); font-size: 12.5px; }
.conv { padding: 10px 12px; border-bottom: 1px solid #f1f3f7; cursor: pointer; transition: .12s; display: flex; gap: 9px; align-items: flex-start; }
.conv:hover { background: #f8fbff; }
.conv.active { background: rgba(29,143,234,.08); }
.conv-avatar {
  width: 34px; height: 34px; border-radius: 50%; overflow: hidden; flex: none;
  background: #eef2f8; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: #7b8798;
}
.conv-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.conv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.conv-top { display: flex; align-items: center; gap: 8px; }
.conv-name { flex: 1; min-width: 46px; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-time { font-size: 11px; color: #b0b7c6; flex: none; }
.conv-last { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-remark { font-size: 11.5px; color: var(--brand); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; flex: none; }

.wb-chat { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); min-height: 0; }
.chat-head { height: 46px; flex: none; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; padding: 0 18px; font-size: 13.5px; }
.chat-head .dim { color: var(--muted); font-size: 12.5px; }

/* 访客资料条：IP / 设备 / 系统 / 浏览器 / 语言 / 来源 / 访问次数 */
.chat-info {
  flex: none; background: #fff; border-bottom: 1px solid var(--line);
  padding: 7px 18px; display: flex; flex-wrap: wrap; gap: 5px 18px;
  font-size: 12px; color: #5a6274;
}
.chat-info .ci-item { display: flex; align-items: center; gap: 5px; }
.chat-info .ci-key { color: var(--muted); }
.chat-info .ci-val { color: #38404f; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-info .ci-val.link { color: var(--brand); }

.chat-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 68%; display: flex; flex-direction: column; gap: 4px; }
.msg.from-visitor { align-self: flex-start; flex-direction: row; align-items: flex-start; gap: 8px; }
.msg.from-seat { align-self: flex-end; align-items: flex-end; }
.msg-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.msg.from-seat .msg-main { align-items: flex-end; }
.msg-avatar {
  width: 32px; height: 32px; border-radius: 50%; overflow: hidden; flex: none;
  background: #eef2f8; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: #7b8798;
}
.msg-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.msg-head { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); padding: 0 2px; }
.msg-name { font-size: 12px; font-weight: 600; color: #4a5265; }
.msg-bubble { padding: 9px 13px; border-radius: 12px; font-size: 13.5px; word-break: break-word; white-space: pre-wrap; line-height: 1.55; }
.from-visitor .msg-bubble { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.from-seat .msg-bubble { background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg.system { align-self: center; max-width: 80%; align-items: center; }
.msg.system .msg-bubble { background: #eef2f8; color: var(--muted); font-size: 12.5px; border-radius: 999px; padding: 5px 14px; }
.msg-time { font-size: 11px; color: #b0b7c6; }

/* 访客留言（留言板提交的内容） */
.from-visitor .bubble-inquiry { background: #fffdf4; border-color: #f0dca8; }
.inquiry-tag {
  display: inline-block; font-size: 11px; line-height: 16px; padding: 0 6px;
  border-radius: 4px; background: #fef3c7; color: #b45309; margin-bottom: 6px;
}
.inquiry-text { white-space: pre-wrap; }
.msg-foot { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #b0b7c6; padding: 0 2px; }
.msg-foot .msg-state { color: var(--brand); }
.chat-input { flex: none; background: #fff; border-top: 1px solid var(--line); padding: 10px 14px; }
.quick-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 9px; }
.quick-chip { padding: 4px 11px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; color: #4a5265; background: #fafbfd; }
.quick-chip:hover { border-color: var(--brand); color: var(--brand); }
.input-row { position: relative; display: flex; gap: 10px; align-items: flex-end; }
.input-row textarea {
  flex: 1; width: 100%;
  min-height: 122px; max-height: 320px;
  padding: 12px 58px 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; outline: none;
  resize: none; line-height: 1.6; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.input-row textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(29,143,234,.1); }

/* 圆形发送按钮：悬浮在输入框右下角 */
.send-fab {
  position: absolute; right: 14px; bottom: 14px;
  width: 38px; height: 38px; flex: none; padding: 0;
  border: none; border-radius: 50%; cursor: pointer;
  background: var(--brand); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(29,143,234,.32);
  transition: background .15s, transform .12s, box-shadow .15s;
}
.send-fab:hover { background: var(--brand-dark); transform: translateY(-1px); }
.send-fab:active { transform: translateY(0) scale(.93); }
.send-fab svg { width: 19px; height: 19px; }

/* ---------------------------------------------------------- 面板 */
.panel { flex: 1; padding: 20px 22px; overflow: auto; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head h2 { margin: 0; font-size: 17px; }
.notice { background: #f7f9fc; border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; font-size: 12.5px; color: #5a6274; margin-bottom: 16px; }
.notice.warn { background: #fff8e6; border-color: #fde3a7; color: #9a6700; }

/* 群聊右侧面板 */
.gp-info {
  padding: 14px 16px 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.gp-info-row {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; line-height: 1.6; padding: 5px 0;
}
.gp-info-key { color: var(--muted); flex: none; width: 62px; }
.gp-info-val { color: #38404f; flex: 1; min-width: 0; word-break: break-word; }
.gp-open-btn { width: calc(100% - 32px); margin: 0 16px 14px; }

.gp-members-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px 8px;
}
.gp-members-title { font-size: 13.5px; font-weight: 600; }
.gp-members { padding: 0 12px 16px; display: flex; flex-direction: column; gap: 4px; }
.gp-members-empty {
  font-size: 12.5px; color: var(--muted); text-align: center;
  padding: 26px 16px; line-height: 1.7;
}
.gp-member {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 6px; border-radius: 9px; transition: .12s;
}
.gp-member:hover { background: #f6f9fd; }
.gp-member-av {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: var(--brand); color: #fff; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.gp-member-av img { width: 100%; height: 100%; object-fit: cover; }
.gp-member-body { flex: 1; min-width: 0; }
.gp-member-name {
  font-size: 13.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gp-member-sub {
  font-size: 11.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gp-member-acts { flex: none; }
.gp-member-acts .link-btn { font-size: 12px; padding: 3px 8px; }

/* ---------------------------------------------------------- 群组管理 */
.conv.is-group { background: linear-gradient(90deg, rgba(29,143,234,.05), transparent 60%); }
.conv-avatar-group {
  background: linear-gradient(135deg, #1d8fea, #4aa8ff);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600;
}
.conv-flag.group { background: #e8f2ff; color: #1d8fea; font-weight: 600; }
.chat-head-avatar.gp-av {
  background: linear-gradient(135deg, #1d8fea, #4aa8ff);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600;
}
.gp-panel-info { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }

/* 群聊消息 */
.msg.gmsg { max-width: 68%; display: flex; flex-direction: column; gap: 5px; }
.msg.gmsg.from-visitor { align-self: flex-start; }
.msg.gmsg.from-seat { align-self: flex-end; align-items: flex-end; }
.gm-head { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.gm-av {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: var(--brand); color: #fff; font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.gm-av img { width: 100%; height: 100%; object-fit: cover; }
.gm-av.seat { background: #0d9488; }
.gm-name { font-weight: 600; color: #5a6274; }
.gm-tag {
  font-size: 10px; padding: 0 5px; border-radius: 4px; line-height: 15px;
  background: #e6fbf6; color: #0f766e;
}

.gp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.gp-card {
  border: 1px solid var(--line); border-radius: 14px; background: #fff;
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
  transition: .15s;
}
.gp-card:hover { border-color: #cfe3f7; box-shadow: 0 3px 14px rgba(29,143,234,.08); }
.gp-head { display: flex; gap: 11px; align-items: flex-start; }
.gp-av {
  width: 42px; height: 42px; border-radius: 11px; flex: none;
  background: linear-gradient(135deg, #1d8fea, #4aa8ff); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 600;
}
.gp-meta { flex: 1; min-width: 0; }
.gp-name { font-size: 15px; font-weight: 600; }
.gp-code { font-size: 11.5px; margin-top: 2px; word-break: break-all; }
.gp-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.gp-tag {
  font-size: 11px; padding: 1px 8px; border-radius: 999px; line-height: 17px;
  background: #eef2f7; color: #5a6274;
}
.gp-tag.ok { background: #e7f8ef; color: #0f8a4d; }
.gp-tag.bad { background: #fee2e2; color: #dc2626; }
.gp-tag.warn { background: #fef3c7; color: #b45309; }
.gp-tag.plain { background: #f2f5fa; color: #5a6274; }

.gp-notice {
  font-size: 12.5px; color: #5a6274; background: #f7f9fc;
  border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px;
  min-height: 36px; line-height: 1.5;
}

.gp-link-row { display: flex; gap: 12px; align-items: flex-start; }
.gp-qr { flex: none; }
.gp-qr img {
  width: 96px; height: 96px; display: block;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.gp-link-box { flex: 1; min-width: 0; }
.gp-link-label { font-size: 11.5px; margin-bottom: 4px; }
.gp-link { display: flex; align-items: center; gap: 8px; }
.gp-link .mono {
  flex: 1; min-width: 0; font-size: 11.5px; color: #5a6274;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.gp-acts { display: flex; flex-wrap: wrap; gap: 7px; }
.gp-foot {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid #f1f3f7; padding-top: 11px; font-size: 13px;
}

/* 群组二维码弹窗 */
#groupQrCanvas { border: 1px solid var(--line); border-radius: 8px; background: #fff; }
#groupQrUrl { font-size: 11.5px; margin: 6px 0 2px; }

/* ---------------------------------------------------------- 群发模板 */
.bt-list { display: flex; flex-direction: column; gap: 10px; }
.bt-card {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px;
  background: #fff; transition: .15s;
}
.bt-card:hover { border-color: #cfe3f7; box-shadow: 0 2px 10px rgba(29,143,234,.07); }
.bt-main { flex: 1; min-width: 0; }
.bt-top { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; flex-wrap: wrap; }
.bt-title { font-size: 14px; }
.bt-badge {
  font-size: 11px; padding: 1px 7px; border-radius: 999px;
  background: rgba(29,143,234,.1); color: var(--brand);
}
.bt-time { font-size: 11.5px; }
.bt-content {
  font-size: 13px; color: #5a6274; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
  max-height: 80px; overflow: hidden;
}
.bt-acts { display: flex; align-items: center; gap: 8px; flex: none; }

/* 群发弹窗 */
.bc-target { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 0; }
.bc-radio {
  display: flex; align-items: flex-start; gap: 9px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 13px;
  transition: .15s;
}
.bc-radio:hover { border-color: #bcdcf7; }
.bc-radio input { margin-top: 2px; accent-color: var(--brand); flex: none; }
.bc-radio:has(input:checked) { border-color: var(--brand); background: rgba(29,143,234,.05); }
.bc-radio-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bc-radio-body b { font-size: 13.5px; }
.bc-radio-body em { font-style: normal; font-size: 12px; color: var(--muted); }

.bc-picker { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.bc-picker .search { width: 100%; margin-bottom: 8px; }
.bc-picker-list {
  max-height: 190px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 8px; background: #fbfcfe;
}
.bc-target-row {
  display: flex; align-items: center; gap: 9px; padding: 7px 11px;
  border-bottom: 1px solid #f1f3f7; cursor: pointer; font-size: 13px;
}
.bc-target-row:last-child { border-bottom: none; }
.bc-target-row:hover { background: #f4f9ff; }
.bc-target-row input { accent-color: var(--brand); flex: none; }
.bc-target-av {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  background: var(--brand); color: #fff; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.bc-target-info { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-target-time { font-size: 11.5px; flex: none; }
.bc-picker-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.bc-picker-foot .dim { flex: 1; font-size: 12px; }

.card-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 17px; box-shadow: var(--shadow); }
.stat-num { font-size: 25px; font-weight: 700; line-height: 1.2; }
.stat-num.ok { color: var(--ok); }
.stat-cap { font-size: 12px; color: var(--muted); margin-top: 3px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 17px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card-title { font-size: 14px; font-weight: 650; margin-bottom: 13px; }

.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow); }
.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
.grid th, .grid td { padding: 11px 13px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid th { background: #fafbfd; font-weight: 600; color: #5a6274; font-size: 12px; white-space: nowrap; }
.grid tbody tr:last-child td { border-bottom: none; }
.grid td.actions { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.dim { color: var(--muted); }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; }
.tag.ok { background: rgba(22,163,74,.1); color: var(--ok); }
.tag.warn { background: rgba(217,119,6,.1); color: var(--warn); }
.tag.bad { background: rgba(220,38,38,.1); color: var(--bad); }
.tag.info { background: rgba(29,143,234,.1); color: var(--brand); }
.tag.muted { background: #f1f3f7; color: var(--muted); }
.link-btn { color: var(--brand); font-size: 12.5px; padding: 2px 5px; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--bad); }
.empty { padding: 38px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------------------------------------------------------- 客服码 */
.code-wrap { display: grid; grid-template-columns: 320px 1fr; gap: 22px; }
.code-box { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; text-align: center; box-shadow: var(--shadow); }
.code-name { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.qr { width: 200px; height: 200px; margin: 0 auto; display: flex; align-items: center; justify-content: center; background: #fafbfd; border-radius: 12px; overflow: hidden; }
.qr canvas, .qr img { max-width: 100%; max-height: 100%; }
.code-foot { margin-top: 12px; font-size: 13px; color: var(--muted); }
.code-actions { display: flex; gap: 8px; justify-content: center; margin: 14px 0 10px; flex-wrap: wrap; }
.code-url { font-size: 11.5px; color: var(--muted); word-break: break-all; text-align: center; }
.code-right h3 { font-size: 14px; margin: 0 0 10px; }
.domain-box { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; font-size: 13px; }
.code-pre { background: #1e2430; color: #d7dce6; padding: 13px; border-radius: 10px; font-size: 11.5px; overflow-x: auto; line-height: 1.6; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; margin: 12px 0; white-space: pre-wrap; word-break: break-all; }

.chart { height: 190px; display: flex; align-items: flex-end; gap: 10px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.chart-bar { width: 100%; max-width: 44px; background: linear-gradient(180deg, #4aa8f0, var(--brand)); border-radius: 6px 6px 0 0; min-height: 3px; }
.chart-label { font-size: 11px; color: var(--muted); }
.chart-value { font-size: 11px; color: #4a5265; }

/* ---------------------------------------------------------- 弹窗 */
.modal { position: fixed; inset: 0; background: rgba(15,25,45,.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 24px; }
.modal-card { background: #fff; border-radius: 16px; padding: 25px; width: min(440px, 100%); box-shadow: 0 24px 60px rgba(10,20,40,.25); max-height: 88vh; overflow: auto; }
.modal-card h2 { margin: 0 0 16px; font-size: 17px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.toast { position: fixed; top: 22px; left: 50%; transform: translateX(-50%); background: #1f2430; color: #fff; padding: 10px 20px; border-radius: 10px; font-size: 13px; z-index: 200; }
.toast.ok { background: var(--ok); }
.toast.bad { background: var(--bad); }

@media (max-width: 900px) {
  .side { width: 56px; }
  .nav-item, .side-brand span:last-child, .side-group, .side-user { font-size: 0; }
  .nav-item svg { width: 19px; height: 19px; }
  .wb-list { width: 220px; }
  .code-wrap { grid-template-columns: 1fr; }
  .input-row textarea { min-height: 88px; padding: 10px 50px 10px 12px; }
  .send-fab { width: 34px; height: 34px; right: 11px; bottom: 11px; }
  .send-fab svg { width: 17px; height: 17px; }
}

/* ---------------------------------------------------------- 客户资料面板 */
.wb-panel {
  width: 290px; flex: none; border-left: 1px solid var(--line); background: #fff;
  display: flex; flex-direction: column; overflow-y: auto; min-height: 0;
}
/* Narrow screens keep the panel closed until the seat asks for it. */
@media (max-width: 1023px) { .wb-panel { display: none; } }
.wb.force-panel .wb-panel { display: flex; }
.wb.hide-panel .wb-panel { display: none; }
/* Keep room for the chat when the window is not that wide. */
@media (max-width: 1300px) {
  .wb-list { width: 264px; }
  .wb-panel { width: 252px; }
}

.panel-tabs { display: flex; flex: none; border-bottom: 1px solid var(--line); }
.ptab {
  flex: 1; padding: 11px 0; font-size: 13.5px; color: var(--muted);
  border-bottom: 2px solid transparent; transition: .15s;
}
.ptab:hover { color: var(--brand); }
.ptab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.ptab-body { flex: 1; min-height: 0; overflow-y: auto; }

.vp-head { padding: 18px 16px 14px; text-align: center; border-bottom: 1px solid #f1f3f7; }
.vp-avatar {
  width: 58px; height: 58px; border-radius: 50%; overflow: hidden; margin: 0 auto 9px;
  background: #eef2f8; display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 600; color: #7b8798;
}
.vp-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vp-name { font-size: 15px; font-weight: 650; }
.vp-tags { margin-top: 7px; display: flex; gap: 6px; justify-content: center; }
.vp-tag { padding: 2px 9px; border-radius: 999px; font-size: 11.5px; background: #eef4fd; color: var(--brand); }
.vp-tag.off { background: #f1f3f7; color: var(--muted); }

.vp-list { padding: 6px 0; }
.vp-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 16px;
  font-size: 12.5px; border-bottom: 1px solid #f7f9fc;
}
.vp-row .vp-ico { width: 16px; height: 16px; flex: none; color: var(--brand); opacity: .85; }
.vp-row .vp-ico svg { width: 16px; height: 16px; display: block; }
.vp-row .vp-k { color: var(--muted); width: 52px; flex: none; }
.vp-row .vp-v { color: #38404f; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-row .vp-badge {
  padding: 1px 7px; border-radius: 999px; font-size: 11px;
  background: #eefaf1; color: var(--ok); flex: none;
}
.vp-row .vp-link { color: var(--brand); font-size: 12px; cursor: pointer; flex: none; }
.vp-row .vp-link:hover { text-decoration: underline; }

.vp-block { padding: 12px 16px 4px; border-top: 1px solid #f1f3f7; margin-top: 6px; }
.vp-block-title { font-size: 12.5px; font-weight: 600; color: #38404f; margin-bottom: 6px; }
.vp-contact .vp-row { padding: 7px 0; border-bottom: 1px solid #f7f9fc; }
.vp-edit {
  width: 20px; height: 20px; border-radius: 5px; color: #b6bdc9; flex: none;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.vp-edit:hover { background: #f1f4f9; color: var(--brand); }
.vp-edit svg { width: 13px; height: 13px; }

.vp-actions { display: flex; gap: 10px; padding: 14px 16px 20px; }
.vp-actions .btn-ghost { flex: 1; text-align: center; color: var(--bad); border-color: #f6d5d5; }
.vp-actions .btn-ghost:hover { border-color: var(--bad); color: var(--bad); background: #fff6f6; }

.vp-quick-list { padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.vp-quick-item {
  padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; font-size: 12.5px;
  color: #4a5265; background: #fbfcfe; cursor: pointer; text-align: left; line-height: 1.5;
}
.vp-quick-item:hover { border-color: var(--brand); color: var(--brand); }


/* ---------------------------------------------------------- 留言设置 */
.iq-layout { display: flex; gap: 18px; align-items: flex-start; }
.iq-config { flex: 1; min-width: 0; }
.iq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-bottom: 16px; }

.iq-hero {
  background: linear-gradient(135deg, #1b2540, #2b3a5c); color: #fff;
  border-radius: 14px; padding: 18px 20px; margin-bottom: 14px;
}
.iq-hero-title { font-size: 15px; font-weight: 700; }
.iq-hero-desc { font-size: 13.5px; margin-top: 6px; opacity: .95; }
.iq-hero-tip { font-size: 12px; margin-top: 8px; opacity: .68; line-height: 1.6; }

.iq-hint { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.6; }
.iq-color-row { display: flex; align-items: center; gap: 10px; }
.iq-color-row input[type="color"] {
  width: 42px; height: 30px; padding: 2px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; cursor: pointer;
}

/* 开关 */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; }
.switch { position: relative; width: 40px; height: 22px; flex: none; display: inline-block; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 2; }
.switch i {
  position: absolute; inset: 0; background: #d3dae4; border-radius: 999px;
  transition: background .18s; display: block;
}
.switch i::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.22);
  transition: transform .18s;
}
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(18px); }

/* 背景图 */
.iq-bg-row { display: flex; gap: 14px; margin-top: 8px; }
.iq-bg-preview {
  width: 96px; height: 66px; border-radius: 10px; border: 1px dashed var(--line);
  background: #fafbfd center/cover no-repeat; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; color: var(--muted); overflow: hidden;
}
.iq-bg-side { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

.iq-fields-head { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 10px; }

/* 实时预览 */
.iq-preview {
  width: 320px; flex: none; position: sticky; top: 0;
  border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden;
}
.iq-preview-head { padding: 13px 16px; border-bottom: 1px solid var(--line); }
.iq-preview-title { font-size: 13.5px; font-weight: 650; }
.iq-preview-tip { font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.6; }
.iq-stage {
  padding: 18px; background: linear-gradient(160deg, #e8eef8, #f4f7fc);
  min-height: 340px; display: flex; align-items: center; justify-content: center;
}
.iq-phone {
  width: 100%; max-width: 250px; background: #dfe7f2; border-radius: 16px; padding: 12px;
  box-shadow: 0 8px 24px rgba(20,30,50,.12);
}
.iq-phone-card {
  background: #fff; border-radius: 12px; padding: 18px 16px;
  box-shadow: 0 3px 10px rgba(20,30,50,.08);
}
.iq-phone-card.has-bg { background-image: linear-gradient(rgba(255,255,255,.86), rgba(255,255,255,.92)), var(--pv-bg); background-size: cover; background-position: center; }
.iq-phone-card.dark { background: #232b3d; color: #e8ecf4; }
.iq-phone-card.dark .iq-phone-sub { color: #9aa5bb; }
.iq-phone-title { font-size: 15px; font-weight: 700; text-align: center; }
.iq-phone-sub { font-size: 11.5px; color: var(--muted); text-align: center; margin: 6px 0 14px; line-height: 1.6; }
.iq-phone-field { margin-bottom: 10px; }
.iq-phone-field label { display: block; font-size: 10.5px; color: var(--muted); margin-bottom: 4px; }
.iq-phone-field.dark label { color: #9aa5bb; }
.iq-phone-field input, .iq-phone-field textarea {
  width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 11.5px; outline: none; background: #fbfcfe; resize: vertical;
}
.iq-phone-field.dark input, .iq-phone-field.dark textarea { background: #2d3648; border-color: #3c4760; color: #e8ecf4; }
.iq-phone-btn {
  width: 100%; padding: 9px; border-radius: 9px; color: #fff; background: var(--pv-accent, var(--brand));
  font-size: 12.5px; font-weight: 600; margin-top: 4px; border: none; cursor: pointer;
}
.iq-phone-empty { font-size: 11.5px; color: var(--muted); text-align: center; padding: 16px 0; }

@media (max-width: 1100px) {
  .iq-layout { flex-direction: column; }
  .iq-preview { width: 100%; position: static; }
}


/* ---------------------------------------------------------- 统计页 */
.panel-head-acts { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.date-input {
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; outline: none; font-size: 12.5px; color: var(--text);
}
.date-input:focus { border-color: var(--brand); }
.portrait-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.portrait-cell {
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px;
  background: #fbfcfe; text-align: center;
}
.portrait-num { font-size: 19px; font-weight: 700; color: var(--brand); line-height: 1.2; }
.portrait-cap { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

/* ---------------------------------------------------------- 客服码样式 */
/* 模板选择栏 */
.tpl-bar {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0 16px;
}
.tpl-item {
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: #fff; cursor: pointer; transition: .15s;
}
.tpl-item:hover { transform: translateY(-1px); border-color: var(--brand); }
.tpl-item.active { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(29,143,234,.18); }
.tpl-item i {
  width: 26px; height: 26px; border-radius: 8px; display: flex;
  align-items: center; justify-content: center; font-style: normal; font-size: 12px;
}

/* 预览舞台 */
.code-stage { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-bottom: 18px; }
.qr-card {
  width: 300px; border-radius: 18px; overflow: hidden; background: #fff;
  box-shadow: 0 14px 40px rgba(20,30,50,.12); display: flex; flex-direction: column;
}
.qr-card-head {
  padding: 13px 12px; text-align: center; font-size: 14px; font-weight: 700;
}
.qr-card-body { padding: 14px 16px; background: #fff; }
.qr-card-body canvas { width: 100%; height: auto; display: block; border-radius: 6px; }
.qr-card-foot { padding: 12px; text-align: center; font-size: 13px; font-weight: 600; }
.code-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.code-url {
  font-size: 12px; color: var(--muted); word-break: break-all; text-align: center;
  max-width: 620px;
}

/* 设计参数 */
.design-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 16px; }
.design-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 4px 16px; margin-top: 6px; }
.design-cell { margin-bottom: 14px; }
.design-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.color-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #5a6274; }
.color-row input[type="color"] {
  width: 42px; height: 30px; padding: 2px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; cursor: pointer;
}

.qr-logo-row { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.qr-logo-preview {
  width: 66px; height: 66px; border-radius: 12px; border: 1px dashed var(--line);
  background: #fafbfd; display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex: none; font-size: 11.5px;
}
.qr-logo-preview img { max-width: 100%; max-height: 100%; }
.frame-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.frame-chip {
  padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 12.5px; color: #4a5265; background: #fbfcfe; transition: .15s;
}
.frame-chip:hover { border-color: var(--brand); color: var(--brand); }
.frame-chip.active { border-color: var(--brand); background: rgba(29,143,234,.1); color: var(--brand); font-weight: 600; }
.frame-chip .dotmark { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

/* ---------------------------------------------------------- 头像 / 表情包 */
.avatar-row { display: flex; align-items: center; gap: 16px; }
.avatar-preview {
  width: 76px; height: 76px; border-radius: 50%; border: 1px dashed var(--line);
  background: #fafbfd; display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex: none; font-size: 12px;
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-ops { flex: 1; min-width: 0; }
.avatar-ops .btn-ghost { margin-right: 8px; }

.sticker-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 10px; margin-top: 14px;
}
.sticker-item {
  position: relative; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 12px;
  background: #fafbfd; overflow: hidden;
}
.sticker-item img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sticker-del {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(31,36,48,.62); color: #fff; font-size: 12px; line-height: 20px;
  text-align: center; opacity: 0; transition: .15s;
}
.sticker-item:hover .sticker-del { opacity: 1; }
.sticker-empty { grid-column: 1 / -1; color: var(--muted); font-size: 12.5px; padding: 10px 0; }

/* 聊天区客服头像 */
.chat-head-avatar {
  width: 34px; height: 34px; border-radius: 50%; overflow: hidden; flex: none;
  background: var(--brand); color: #fff; display: flex; align-items: center;
  justify-content: center; font-size: 12.5px; font-weight: 600;
}
.chat-head-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 消息内媒体 */
.msg-media { max-width: 220px; border-radius: 10px; overflow: hidden; display: block; }
.msg-image { max-width: 220px; max-height: 300px; border-radius: 10px; display: block; cursor: pointer; }
.msg-video { max-width: 240px; border-radius: 10px; display: block; background: #000; }
.msg-sticker { max-width: 130px; display: block; }
.msg-emoji { font-size: 34px; line-height: 1.2; padding: 2px 4px; }

/* 聊天工具栏 */
.chat-tools { display: flex; gap: 4px; align-items: center; }
.tool-btn {
  width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center;
  justify-content: center; color: var(--muted); font-size: 16px;
}
.tool-btn:hover { background: #f1f4f9; color: var(--brand); }
.tool-btn svg { width: 17px; height: 17px; }

.emoji-panel {
  border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 8px;
  margin-bottom: 8px; max-height: 240px; overflow-y: auto;
}
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 2px; }
.emoji-grid button { font-size: 22px; padding: 4px 0; border-radius: 6px; line-height: 1; }
.emoji-grid button:hover { background: #f1f4f9; }
.emoji-sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 6px; margin-top: 8px; }
.emoji-sticker-grid button { padding: 4px; border-radius: 8px; }
.emoji-sticker-grid img { width: 100%; display: block; }
.emoji-sticker-grid button:hover { background: #f1f4f9; }
/* 表情面板标签（对齐竞品的胶囊样式） */
.emoji-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.emoji-tabs button {
  font-size: 12.5px; padding: 4px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: #5a6273;
  transition: .15s;
}
.emoji-tabs button:hover { border-color: var(--brand); color: var(--brand); }
.emoji-tabs button.active {
  border-color: var(--brand); color: var(--brand);
  background: rgba(29,143,234,.07); font-weight: 600;
}
.emoji-tabs button { font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); }
.emoji-tabs button.active { border-color: var(--brand); color: var(--brand); background: rgba(29,143,234,.08); }

/* 图片全屏预览 */
.image-viewer {
  position: fixed; inset: 0; background: rgba(0,0,0,.82); z-index: 999;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.image-viewer img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }

/* -------------------------------------------------- 工作台工具栏 */
.composer-tools {
  display: flex; align-items: center; gap: 2px;
  padding: 3px 0 9px; margin-bottom: 9px;
  border-bottom: 1px solid var(--line);
}
.composer-tools .tool-btn { width: 34px; height: 34px; }
.composer-tools .tool-btn svg { width: 21px; height: 21px; }
.tool-btn.recording { background: #fee2e2; color: #dc2626; animation: recPulse 1.1s infinite; }
@keyframes recPulse { 0%,100% { opacity: 1 } 50% { opacity: .55 } }
.tool-sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }

/* 快捷回复面板 */
.quick-panel {
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
  padding: 10px; margin-bottom: 10px; max-height: 260px; display: flex; flex-direction: column;
}
.quick-panel-head { display: flex; gap: 10px; align-items: center; margin-bottom: 9px; }
.quick-panel-head .search { flex: 1; }
.quick-panel-list { overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.quick-item {
  text-align: left; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px;
  background: #fbfcfe; font-size: 13px; color: var(--text); line-height: 1.5;
}
.quick-item:hover { border-color: var(--brand); background: #f2f8ff; }
.quick-item b { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; margin-bottom: 2px; }
.quick-empty { color: var(--muted); font-size: 12.5px; padding: 14px 0; text-align: center; }

/* 消息撤回按钮 */
.msg-actions {
  position: absolute; top: 2px; right: -2px; display: none; gap: 4px; z-index: 2;
}
.msg.from-seat:hover .msg-actions { display: flex; }
.msg-wrap { position: relative; }
.msg-recall-btn {
  font-size: 11px; color: var(--muted); background: #fff; border: 1px solid var(--line);
  border-radius: 6px; padding: 1px 7px; white-space: nowrap;
}
.msg-recall-btn:hover { color: var(--bad); border-color: var(--bad); }
.msg.is-recalled .msg-bubble { color: var(--muted); font-style: italic; background: #f4f6f9; }
.msg.is-recalled.from-seat .msg-bubble { background: #eef1f6; color: var(--muted); }

/* 语音气泡 */
.msg-audio { max-width: 240px; height: 36px; }
.bubble-audio { padding: 6px 8px; }
.msg-file { display: inline-block; color: inherit; text-decoration: none; font-size: 13px; padding: 2px 4px; }
.msg-file:hover { text-decoration: underline; }
.bubble-file { padding: 6px 10px; }

/* ------------------------------------------------------ 访客右键菜单 */
.ctx-menu {
  position: fixed; z-index: 200; min-width: 168px; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 34px rgba(12, 22, 45, .18);
}
.ctx-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 11px; border-radius: 8px; font-size: 13.5px; color: var(--text);
  text-align: left;
}
.ctx-item svg { width: 16px; height: 16px; flex: none; color: #8a93a5; }
.ctx-item:hover { background: #f4f7fb; }
.ctx-item:hover svg { color: var(--brand); }
.ctx-item.danger { color: #dc2626; }
.ctx-item.danger svg { color: #dc2626; }
.ctx-item.danger:hover { background: #fef2f2; }
.ctx-item.active { color: var(--brand); font-weight: 600; }
.ctx-item.active svg { color: var(--brand); }
.ctx-sep { height: 1px; background: var(--line); margin: 5px 8px; }

/* 会话列表里的状态标记 */
.conv-top { display: flex; align-items: center; gap: 6px; }
.conv-flag {
  font-size: 10px; padding: 0 4px; border-radius: 4px; line-height: 16px; flex: none;
}
.conv-flag.top { color: #b45309; background: #fef3c7; }
.conv-flag.muted { color: #64748b; background: #eef2f7; }
.conv-flag.black { color: #dc2626; background: #fee2e2; }
.conv-flag.online { color: #16a34a; background: #e6f8ed; }
.conv-flag.offline { color: #dc2626; background: #fee2e2; }
.conv-flag.newv { color: #1d8fea; background: #e8f1fd; }
.conv.is-black { opacity: .62; }

/* 顶栏圆形图标按钮（刷新） */
.icon-btn {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); transition: .15s;
}
.icon-btn:hover { background: #f1f4f9; color: var(--brand); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn.spinning svg { animation: iconSpin .7s linear infinite; }
@keyframes iconSpin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
