/* ===========================================================
   Telegram 风格客服系统 —— 共享样式(客服台 + 访客页)
   配色贴近 Telegram Web:蓝 #3390ec、出消息浅绿、暗色 #17212b
   =========================================================== */
:root {
  --blue: #3390ec; --blue-d: #2b7fd6;
  --bg: #ffffff; --bg-2: #f4f4f5;
  --sidebar: #ffffff; --side-border: #e6e6e8;
  --chat-bg: #d5dbe2;
  --hover: #f1f3f5; --active: #3390ec; --active-tx: #ffffff;
  --txt: #000000; --txt-2: #707579; --txt-3: #a8a8a8;
  --bub-in: #ffffff; --bub-out: #effdde; --bub-tx: #000000;
  --head: #ffffff; --head-border: #e6e6e8;
  --tick: #4fae4e; --badge: #c4c9cc; --badge-on: #3390ec;
  --link: #3390ec; --shadow: 0 1px 2px rgba(16,35,47,.12);
  --inp-bg: #ffffff;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
html[data-theme="dark"] {
  --blue: #6ab7ff; --blue-d: #4ea1f0;
  --bg: #17212b; --bg-2: #0e1621;
  --sidebar: #17212b; --side-border: #101921;
  --chat-bg: #0e1621;
  --hover: #202b36; --active: #2b5278; --active-tx: #ffffff;
  --txt: #ffffff; --txt-2: #82909c; --txt-3: #6c7883;
  --bub-in: #182533; --bub-out: #2b5278; --bub-tx: #ffffff;
  --head: #17212b; --head-border: #101921;
  --tick: #6ab7ff; --badge: #5b6772; --badge-on: #3e7fc1;
  --link: #6ab7ff; --shadow: 0 1px 2px rgba(0,0,0,.35);
  --inp-bg: #17212b;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font); background: var(--bg-2); color: var(--txt);
  font-size: 15px; -webkit-font-smoothing: antialiased; overflow: hidden;
}
a { color: var(--link); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(128,140,150,.4); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(128,140,150,.6); }
.hidden { display: none !important; }

/* TG 涂鸦图案背景(SVG,极淡) */
.tg-pattern {
  background-color: var(--chat-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420' viewBox='0 0 420 420'%3E%3Cg fill='%23000' fill-opacity='0.035'%3E%3Ccircle cx='60' cy='60' r='26'/%3E%3Ccircle cx='300' cy='120' r='38'/%3E%3Ccircle cx='160' cy='250' r='20'/%3E%3Ccircle cx='360' cy='330' r='30'/%3E%3Ccircle cx='90' cy='360' r='24'/%3E%3Crect x='220' y='280' width='44' height='44' rx='12'/%3E%3Crect x='20' y='180' width='34' height='34' rx='9'/%3E%3C/g%3E%3C/svg%3E");
}
html[data-theme="dark"] .tg-pattern {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420' viewBox='0 0 420 420'%3E%3Cg fill='%23fff' fill-opacity='0.03'%3E%3Ccircle cx='60' cy='60' r='26'/%3E%3Ccircle cx='300' cy='120' r='38'/%3E%3Ccircle cx='160' cy='250' r='20'/%3E%3Ccircle cx='360' cy='330' r='30'/%3E%3Ccircle cx='90' cy='360' r='24'/%3E%3Crect x='220' y='280' width='44' height='44' rx='12'/%3E%3Crect x='20' y='180' width='34' height='34' rx='9'/%3E%3C/g%3E%3C/svg%3E");
}

/* 头像 */
.avatar {
  width: 46px; height: 46px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 18px;
  background: linear-gradient(135deg, #5eb5f7, #3390ec); user-select: none;
}
.avatar.c0 { background: linear-gradient(135deg,#ff885e,#ff516a); }
.avatar.c1 { background: linear-gradient(135deg,#ffcd6a,#ffa85c); }
.avatar.c2 { background: linear-gradient(135deg,#82b1ff,#665fff); }
.avatar.c3 { background: linear-gradient(135deg,#a0de7e,#54cb68); }
.avatar.c4 { background: linear-gradient(135deg,#53edd6,#28c9b7); }
.avatar.c5 { background: linear-gradient(135deg,#e0a2f3,#d669ed); }
.avatar.sm { width: 38px; height: 38px; font-size: 15px; }

/* ============ 客服台布局 ============ */
.app { display: flex; height: 100%; background: var(--bg); }
.sidebar {
  width: 380px; flex: 0 0 380px; background: var(--sidebar);
  border-right: 1px solid var(--side-border); display: flex; flex-direction: column; min-width: 0;
}
.chat-pane { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }

/* 侧栏顶部 */
.s-head { height: 56px; display: flex; align-items: center; gap: 8px; padding: 0 14px; flex: 0 0 auto; }
.s-title { font-size: 18px; font-weight: 600; flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; }
.s-title .me { font-size: 13px; color: var(--txt-2); font-weight: 400; }
.icon-btn {
  width: 40px; height: 40px; border: 0; background: none; color: var(--txt-2); cursor: pointer;
  border-radius: 50%; display: grid; place-items: center; transition: background .15s, color .15s; flex: 0 0 auto;
}
.icon-btn:hover { background: var(--hover); color: var(--txt); }
.icon-btn svg { width: 22px; height: 22px; }
.search-wrap { padding: 4px 12px 8px; flex: 0 0 auto; position: relative; }
/* 聊天记录搜索结果下拉 */
.search-results { display: none; position: absolute; left: 12px; right: 12px; top: 100%; z-index: 60;
  background: var(--sidebar); border: 1px solid var(--side-border); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.22); max-height: 64vh; overflow-y: auto; }
.search-results.show { display: block; }
.sr-head { padding: 8px 12px; font-size: 12px; color: var(--txt-2); border-bottom: 1px solid var(--side-border); position: sticky; top: 0; background: var(--sidebar); }
.sr-item { padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--side-border); }
.sr-item:last-child { border-bottom: 0; }
.sr-item:hover { background: var(--hover); }
.sr-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; margin-bottom: 2px; }
.sr-top b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-top span { color: var(--txt-3); font-size: 11.5px; flex: 0 0 auto; }
.sr-text { font-size: 13.5px; color: var(--txt-2); line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-text mark { background: #ffe08a; color: inherit; padding: 0 1px; border-radius: 2px; }
.sr-empty { padding: 18px; text-align: center; color: var(--txt-3); font-size: 13px; }
/* 信息面板:一键拉黑 IP */
.ip-ban-link { color: #e53935; cursor: pointer; font-size: 12px; margin-left: 6px; }
.ip-ban-link:hover { text-decoration: underline; }
.ip-banned { color: #e53935; font-style: normal; font-size: 12px; margin-left: 6px; }
/* 顶部客服信息栏:加间距,避免拥挤 */
.s-head { gap: 8px; }
.s-head .s-title { flex: 1; min-width: 0; }
.s-head .s-title #meName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search { width: 100%; height: 40px; border: 0; border-radius: 20px; background: var(--bg-2); color: var(--txt);
  padding: 0 16px; font-size: 14px; font-family: inherit; outline: none; }
.search:focus { box-shadow: inset 0 0 0 1.5px var(--blue); background: var(--bg); }

/* 会话列表 */
.conv-list { flex: 1; overflow-y: auto; }
.conv {
  display: flex; gap: 11px; padding: 9px 12px; cursor: pointer; align-items: center;
  position: relative; transition: background .12s;
}
.conv:hover { background: var(--hover); }
.conv.on { background: var(--active); }
.conv.on .c-name, .conv.on .c-prev, .conv.on .c-time, .conv.on .c-prev b { color: var(--active-tx); }
.conv.on .c-prev { opacity: .85; }
.conv-main { flex: 1; min-width: 0; }
.conv-row { display: flex; align-items: baseline; gap: 8px; }
.c-name { font-weight: 600; font-size: 15px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-time { font-size: 12px; color: var(--txt-2); flex: 0 0 auto; }
.conv-row2 { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.c-prev { flex: 1; min-width: 0; color: var(--txt-2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-prev b { color: var(--txt-2); font-weight: 400; }
.badge {
  min-width: 21px; height: 21px; border-radius: 11px; background: var(--badge-on); color: #fff;
  font-size: 12px; font-weight: 600; display: grid; place-items: center; padding: 0 6px; flex: 0 0 auto;
}
.badge.muted { background: var(--badge); }
.conv.on .badge { background: #fff; color: var(--active); }

/* 会话头部 */
.c-head {
  height: 56px; min-height: 56px; display: flex; align-items: center; gap: 11px; padding: 0 14px;
  background: var(--head); border-bottom: 1px solid var(--head-border); z-index: 3; flex: 0 0 auto;
}
.c-head .back { display: none; }
.c-head .h-main { flex: 1; min-width: 0; cursor: pointer; }
.c-head .h-name { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-head .h-status { font-size: 13px; color: var(--txt-2); }
.c-head .h-status.online { color: var(--blue); }

/* 消息区 */
.c-body { flex: 1; overflow-y: auto; padding: 16px 4% 12px; display: flex; flex-direction: column; gap: 2px; }
.date-sep { align-self: center; margin: 10px 0; font-size: 13px; color: #fff; background: rgba(0,0,0,.18);
  padding: 3px 12px; border-radius: 14px; backdrop-filter: blur(2px); }
.msg { max-width: min(78%, 560px); display: flex; flex-direction: column; margin-top: 2px; }
.msg.out { align-self: flex-end; align-items: flex-end; }
.msg.in { align-self: flex-start; align-items: flex-start; }
.msg.system { align-self: center; max-width: 90%; }
.msg.system .bubble { background: rgba(0,0,0,.16); color: #fff; font-size: 13px; border-radius: 14px; padding: 5px 12px; }
.msg + .msg.same { margin-top: 1px; }
.bubble {
  position: relative; padding: 6px 10px 7px 11px; border-radius: 12px; font-size: 15px; line-height: 1.32;
  word-wrap: break-word; white-space: pre-wrap; box-shadow: var(--shadow); max-width: 100%;
}
.msg.in .bubble { background: var(--bub-in); color: var(--bub-tx); border-bottom-left-radius: 4px; }
.msg.out .bubble { background: var(--bub-out); color: var(--bub-tx); border-bottom-right-radius: 4px; }
.msg.same.in .bubble { border-top-left-radius: 12px; }
.bubble .meta { float: right; margin: 8px -3px -4px 10px; font-size: 11px; color: var(--txt-2); line-height: 1;
  display: inline-flex; align-items: center; gap: 3px; user-select: none; }
.msg.out .bubble .meta { color: #6a9b41; }
html[data-theme="dark"] .msg.out .bubble .meta { color: #8fc1ea; }
.tick { width: 16px; height: 11px; position: relative; display: inline-block; }
.tick svg { width: 16px; height: 11px; display: block; }
.tick .t2 { display: none; }
.tick.read .t1 { display: none; }
.tick.read .t2 { display: block; }

/* 输入栏 */
.c-input {
  flex: 0 0 auto; padding: 8px 14px 12px; display: flex; align-items: flex-end; gap: 10px;
  background: var(--head); border-top: 1px solid var(--head-border);
}
.input-box { flex: 1; background: var(--inp-bg); border: 1px solid var(--side-border); border-radius: 18px;
  display: flex; align-items: flex-end; padding: 0 6px 0 14px; min-height: 44px; }
.input-box.focus { border-color: var(--blue); }
.msg-input {
  flex: 1; border: 0; background: none; color: var(--txt); resize: none; outline: none;
  font-family: inherit; font-size: 15px; line-height: 1.35; padding: 11px 0; max-height: 140px; overflow-y: auto;
}
.send-btn {
  width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--blue); color: #fff;
  cursor: pointer; flex: 0 0 auto; display: grid; place-items: center; transition: transform .12s, background .15s;
}
.send-btn:hover { background: var(--blue-d); }
.send-btn:active { transform: scale(.92); }
.send-btn svg { width: 24px; height: 24px; }

/* 空状态 / 提示 */
.empty-chat { flex: 1; display: grid; place-items: center; color: var(--txt-2); }
.empty-chat .pill { background: rgba(0,0,0,.16); color: #fff; padding: 7px 16px; border-radius: 16px; font-size: 14px; }
.typing-row { font-size: 13px; color: var(--blue); height: 16px; padding: 0 0 4px 2px; }
.scroll-btn { position: absolute; right: 18px; bottom: 86px; width: 44px; height: 44px; border-radius: 50%;
  background: var(--head); box-shadow: 0 2px 8px rgba(0,0,0,.2); border: 1px solid var(--side-border);
  display: grid; place-items: center; cursor: pointer; color: var(--txt-2); opacity: 0; pointer-events: none; transition: opacity .2s; }
.scroll-btn.show { opacity: 1; pointer-events: auto; }

/* 信息侧栏(访客资料) */
.info-pane { width: 0; flex: 0 0 0; overflow: hidden; border-left: 1px solid var(--side-border);
  background: var(--sidebar); transition: width .2s, flex-basis .2s; }
.app.show-info .info-pane { width: 300px; flex-basis: 300px; }
.info-inner { width: 300px; padding: 18px; }
.info-inner h4 { margin: 18px 0 8px; font-size: 13px; color: var(--txt-2); text-transform: uppercase; letter-spacing: .04em; }
.info-row { font-size: 14px; padding: 5px 0; border-bottom: 1px solid var(--side-border); word-break: break-all; }
.info-row span { color: var(--txt-2); display: block; font-size: 12px; }

/* 登录页 */
.login-screen { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg-2); }
.login-card { width: 340px; max-width: 90vw; background: var(--bg); border-radius: 14px; padding: 30px 28px;
  box-shadow: 0 12px 40px rgba(0,0,0,.16); text-align: center; }
.login-logo { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 18px; display: grid; place-items: center;
  background: linear-gradient(135deg,#5eb5f7,#3390ec); }
.login-logo svg { width: 46px; height: 46px; color: #fff; }
.login-card h1 { font-size: 21px; margin: 0 0 6px; }
.login-card p { color: var(--txt-2); font-size: 14px; margin: 0 0 22px; }
.login-card input { width: 100%; height: 46px; border: 1px solid var(--side-border); border-radius: 10px;
  background: var(--inp-bg); color: var(--txt); padding: 0 14px; font-size: 15px; margin-bottom: 12px; outline: none; font-family: inherit; }
.login-card input:focus { border-color: var(--blue); }
.btn-primary { width: 100%; height: 46px; border: 0; border-radius: 10px; background: var(--blue); color: #fff;
  font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit; }
.btn-primary:hover { background: var(--blue-d); }
.login-err { color: #e53935; font-size: 13px; min-height: 18px; margin-bottom: 6px; }

/* 提示气泡 */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(10px); opacity: 0;
  background: rgba(20,24,30,.94); color: #fff; padding: 9px 18px; border-radius: 10px; font-size: 14px;
  pointer-events: none; transition: .2s; z-index: 999; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ 手机端自适应 ============ */
@media (max-width: 820px) {
  .sidebar { width: 100%; flex-basis: 100%; }
  .chat-pane { position: absolute; inset: 0; transform: translateX(100%); transition: transform .25s ease; background: var(--bg); z-index: 10; }
  .app[data-view="chat"] .chat-pane { transform: translateX(0); }
  .c-head .back { display: grid; }
  .app.show-info .info-pane { width: 100%; flex-basis: 100%; position: absolute; inset: 0; z-index: 20; }
  .info-inner { width: 100%; }
  .msg { max-width: 86%; }
}

/* ===========================================================
   访客端 —— 客服 widget(参考截图:皇家蓝 #1f50ff、? 头像、会话列表 + 新建按钮)
   =========================================================== */
.v-theme { --royal: #1f50ff; --royal-d: #1741e0; --av-blue: #1aa6f0; }
.v-app { display: flex; flex-direction: column; height: 100%; background: var(--bg); position: relative; }

/* 顶栏 */
.v-head { height: 60px; flex: 0 0 auto; display: flex; align-items: center; gap: 12px; padding: 0 16px;
  border-bottom: 1px solid var(--side-border); background: var(--head); }
.v-logo { width: 38px; height: 38px; border-radius: 11px; background: var(--royal); display: grid; place-items: center; flex: 0 0 auto; }
.v-logo svg { width: 22px; height: 22px; color: #fff; }
.v-brand { flex: 1; min-width: 0; font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-icon { width: 38px; height: 38px; border: 0; background: none; color: var(--txt-2); cursor: pointer; border-radius: 50%;
  display: grid; place-items: center; flex: 0 0 auto; transition: background .15s; }
.v-icon:hover { background: var(--hover); color: var(--txt); }
.v-icon svg { width: 22px; height: 22px; }

/* 会话列表 */
.v-list { flex: 1; overflow-y: auto; padding: 6px 0; }
.v-conv { display: flex; align-items: center; gap: 13px; padding: 13px 16px; cursor: pointer; transition: background .12s; }
.v-conv:hover { background: var(--hover); }
.v-av { width: 48px; height: 48px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center;
  background: var(--av-blue); color: #fff; font-size: 22px; font-weight: 700; }
.v-mid { flex: 1; min-width: 0; }
.v-title { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-sub { font-size: 13.5px; color: var(--txt-2); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-right { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.v-date { font-size: 12.5px; color: var(--txt-3); white-space: nowrap; }
.v-badge { min-width: 20px; height: 20px; border-radius: 10px; background: #ff3b30; color: #fff; font-size: 12px;
  font-weight: 600; display: grid; place-items: center; padding: 0 6px; }
.v-empty { text-align: center; color: var(--txt-2); padding: 60px 24px; }
.v-empty svg { width: 64px; height: 64px; color: var(--side-border); margin-bottom: 14px; }

/* 底部新建按钮 */
.v-foot { flex: 0 0 auto; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
.v-newbtn { width: 100%; height: 50px; border: 0; border-radius: 12px; background: var(--royal); color: #fff;
  font-size: 16px; font-weight: 600; cursor: pointer; font-family: inherit; transition: background .15s, transform .1s; }
.v-newbtn:hover { background: var(--royal-d); }
.v-newbtn:active { transform: scale(.985); }

/* 访客聊天视图(复用 TG 气泡;出消息=皇家蓝) */
.v-chat { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg);
  transform: translateX(100%); transition: transform .25s ease; z-index: 5; }
.v-app[data-view="chat"] .v-chat { transform: translateX(0); }
.v-theme .msg.out .bubble { background: var(--royal); color: #fff; border-bottom-right-radius: 4px; }
.v-theme .msg.out .bubble .meta { color: rgba(255,255,255,.8); }
.v-theme .send-btn { background: var(--royal); }
.v-theme .send-btn:hover { background: var(--royal-d); }
.v-theme .input-box.focus { border-color: var(--royal); }
.v-welcome { align-self: center; max-width: 80%; text-align: center; color: var(--txt-2); font-size: 13.5px;
  background: rgba(0,0,0,.05); padding: 8px 16px; border-radius: 12px; margin: 8px 0 4px; }
html[data-theme="dark"] .v-welcome { background: rgba(255,255,255,.06); }

/* 启动器悬浮气泡(standalone 最小化态 / widget) */
.v-launcher { position: fixed; right: 20px; bottom: 20px; width: 60px; height: 60px; border-radius: 50%;
  background: var(--royal, #1f50ff); box-shadow: 0 6px 22px rgba(31,80,255,.45); display: grid; place-items: center;
  cursor: pointer; z-index: 99; border: 0; transition: transform .15s; }
.v-launcher:hover { transform: scale(1.06); }
.v-launcher svg { width: 30px; height: 30px; color: #fff; }
.v-launcher .lb { position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; border-radius: 10px;
  background: #ff3b30; color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }

/* ===== 图片消息 / 上传 / 灯箱 / 快捷回复 / FAQ ===== */
.bubble.img { padding: 3px !important; overflow: hidden; }
.msg-img { max-width: 240px; max-height: 320px; border-radius: 10px; display: block; cursor: zoom-in; }
.bubble.img .meta { position: absolute; right: 8px; bottom: 7px; margin: 0; padding: 2px 7px; border-radius: 10px;
  background: rgba(0,0,0,.42); color: #fff !important; backdrop-filter: blur(2px); }
.bubble.img .meta .tick { color: #fff; }

.attach-btn { width: 42px; height: 42px; border: 0; background: none; color: var(--txt-2); cursor: pointer; flex: 0 0 auto;
  display: grid; place-items: center; border-radius: 50%; align-self: flex-end; transition: color .15s, background .15s; }
.attach-btn:hover { color: var(--blue); background: var(--hover); }
.attach-btn svg { width: 24px; height: 24px; }
/* 触屏:放大输入栏按钮,便于点按 */
@media (pointer: coarse) {
  .c-input { gap: 6px; padding: 8px 10px calc(12px + env(safe-area-inset-bottom)); }
  .send-btn { width: 50px; height: 50px; }
  .send-btn svg { width: 27px; height: 27px; }
  .attach-btn { width: 46px; height: 46px; }
  .attach-btn svg { width: 26px; height: 26px; }
  .input-box { min-height: 48px; }
}

.lightbox { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,.92); display: none;
  align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.lightbox.show { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; object-fit: contain; }

/* 客服常用语弹层 */
.canned-pop { position: absolute; left: 14px; right: 70px; bottom: 64px; max-height: 280px; overflow-y: auto;
  background: var(--head); border: 1px solid var(--side-border); border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.22);
  z-index: 20; padding: 6px; display: none; }
.canned-pop.show { display: block; }
.canned-pop .ch { font-size: 12px; color: var(--txt-2); padding: 6px 8px 4px; display: flex; justify-content: space-between; align-items: center; }
.canned-pop .ch a { cursor: pointer; font-size: 12px; }
.canned-item { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.canned-item:hover { background: var(--hover); }
.canned-item .ct { flex: 1; min-width: 0; }
.canned-item .cd { color: #e53935; opacity: 0; font-size: 12px; flex: 0 0 auto; }
.canned-item:hover .cd { opacity: .8; }
.canned-empty { padding: 16px; text-align: center; color: var(--txt-2); font-size: 13px; }
.canned-add { display: flex; gap: 6px; padding: 6px; }
.canned-add input { flex: 1; height: 34px; border: 1px solid var(--side-border); border-radius: 8px; background: var(--inp-bg);
  color: var(--txt); padding: 0 10px; font-size: 13px; outline: none; font-family: inherit; }
.canned-add button { height: 34px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--blue); color: #fff; cursor: pointer; font-size: 13px; }

/* 访客 FAQ 快捷问题 chips */
.faq-bar { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 14px 6px; }
.faq-chip { font-size: 13.5px; color: var(--royal, #1f50ff); background: rgba(31,80,255,.08);
  border: 1px solid rgba(31,80,255,.2); border-radius: 16px; padding: 7px 14px; cursor: pointer; transition: background .15s; }
.faq-chip:hover { background: rgba(31,80,255,.16); }

/* 设置弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: none; align-items: center; justify-content: center; z-index: 500; padding: 20px; }
.modal-mask.show { display: flex; }
.modal-card { width: 360px; max-width: 92vw; background: var(--bg); border-radius: 14px; padding: 22px; box-shadow: 0 16px 50px rgba(0,0,0,.3); }
.modal-card h3 { margin: 0 0 16px; font-size: 18px; }
.modal-card label { display: block; font-size: 13px; color: var(--txt-2); margin: 10px 0 5px; }
.modal-card input { width: 100%; height: 42px; border: 1px solid var(--side-border); border-radius: 9px; background: var(--inp-bg);
  color: var(--txt); padding: 0 12px; font-size: 14px; outline: none; font-family: inherit; }
.modal-card input:focus { border-color: var(--blue); }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions button { flex: 1; height: 42px; border: 0; border-radius: 9px; cursor: pointer; font-size: 14px; font-weight: 600; font-family: inherit; }
.modal-actions .ok { background: var(--blue); color: #fff; }
.modal-actions .cancel { background: var(--bg-2); color: var(--txt); }
.modal-err { color: #e53935; font-size: 13px; min-height: 16px; margin-top: 8px; }

/* ===== 智能助手 标签 + 智能回复管理 ===== */
.bot-tag { font-size: 11px; color: var(--blue); margin: 0 4px 1px 0; align-self: flex-end; opacity: .85; }
.msg.out .bot-tag { align-self: flex-end; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--side-border); border-radius: 24px; cursor: pointer; transition: .2s; }
.switch span::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--blue); }
.switch input:checked + span::before { transform: translateX(18px); }
.bot-ta { width: 100%; border: 1px solid var(--side-border); border-radius: 9px; background: var(--inp-bg); color: var(--txt);
  padding: 9px 11px; font-size: 14px; font-family: inherit; outline: none; resize: vertical; margin: 4px 0 6px; }
.bot-ta:focus { border-color: var(--blue); }
.rule { display: flex; gap: 10px; padding: 10px; border: 1px solid var(--side-border); border-radius: 10px; margin-bottom: 8px; align-items: flex-start; }
.rule.off { opacity: .5; }
.rule-main { flex: 1; min-width: 0; }
.rule-kw { font-size: 13px; }
.rule-kw b { display: inline-block; background: var(--hover); color: var(--blue); border-radius: 5px; padding: 1px 7px; margin: 0 4px 3px 0; font-weight: 600; }
.rule-reply { font-size: 13px; color: var(--txt-2); margin-top: 4px; line-height: 1.5; }
.rule-ops { display: flex; flex-direction: column; gap: 8px; align-items: center; flex: 0 0 auto; }
.rule-ops .del { color: #e53935; cursor: pointer; font-size: 12px; }
.rule-add { border-top: 1px solid var(--side-border); padding-top: 12px; margin-top: 4px; }
.rule-add input { width: 100%; height: 40px; border: 1px solid var(--side-border); border-radius: 9px; background: var(--inp-bg);
  color: var(--txt); padding: 0 11px; font-size: 14px; outline: none; font-family: inherit; margin-bottom: 8px; }
.rule-add button { width: 100%; height: 40px; border: 0; border-radius: 9px; background: var(--blue); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; }
.rule-empty { color: var(--txt-2); font-size: 13px; text-align: center; padding: 14px; }

/* ===== 访客信息收集表单 + 客服端访客资料/历史 ===== */
.info-form { padding: 10px 14px 4px; background: var(--head); border-top: 1px solid var(--side-border); }
.info-form-tip { font-size: 13px; color: var(--txt-2); margin-bottom: 8px; }
.info-form input { width: 100%; height: 38px; border: 1px solid var(--side-border); border-radius: 9px; background: var(--inp-bg);
  color: var(--txt); padding: 0 12px; font-size: 14px; outline: none; font-family: inherit; margin-bottom: 8px; }
.info-form input:focus { border-color: var(--royal, #1f50ff); }
.info-form button { width: 100%; height: 40px; border: 0; border-radius: 9px; background: var(--royal, #1f50ff); color: #fff;
  font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; }
/* 客服端:访客资料里的联系方式 + 历史会话 */
.info-note { width: 100%; border: 1px solid var(--side-border); border-radius: 8px; background: var(--inp-bg); color: var(--txt);
  padding: 8px 10px; font-size: 13px; font-family: inherit; resize: vertical; min-height: 52px; outline: none; margin-top: 4px; }
.info-note:focus { border-color: var(--blue); }
.hist-conv { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.hist-conv:hover { background: var(--hover); }
.hist-conv.cur { background: var(--hover); }
.hist-conv .ht { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--txt); }
.hist-conv .hd { flex: 0 0 auto; color: var(--txt-3); font-size: 12px; }
.hist-conv .hs { color: var(--txt-3); }
/* 预设问题管理 textarea */
.preset-ta { width: 100%; border: 1px solid var(--side-border); border-radius: 9px; background: var(--inp-bg); color: var(--txt);
  padding: 10px 12px; font-size: 14px; font-family: inherit; outline: none; resize: vertical; min-height: 88px; }
.preset-ta:focus { border-color: var(--blue); }
.chk-row { display: flex; gap: 16px; margin: 6px 0 10px; font-size: 14px; }
.chk-row label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.chk-row input { width: auto; height: auto; }

/* ===== 消息来源标注(机器人 / 人工)===== */
.msg-sender { font-size: 11.5px; color: var(--txt-2); margin: 3px 0 1px 6px; font-weight: 500; display: flex; align-items: center; gap: 4px; }
.msg-sender::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--txt-3); }
.msg-sender.bot { color: var(--royal, #1f50ff); }
.msg-sender.bot::before { background: var(--royal, #1f50ff); }

/* ===== 转人工 / 满意度评价 / 输入预知 ===== */
.human-btn { flex: 0 0 auto; border: 1px solid var(--royal, #1f50ff); background: none; color: var(--royal, #1f50ff);
  border-radius: 16px; padding: 5px 13px; font-size: 13px; cursor: pointer; font-family: inherit; transition: background .15s; }
.human-btn:hover { background: rgba(31,80,255,.08); }
.rate-card { align-self: center; max-width: 80%; text-align: center; background: var(--bub-in); border: 1px solid var(--side-border);
  border-radius: 14px; padding: 14px 22px; margin: 10px 0; box-shadow: var(--shadow); }
.rate-q { font-size: 14px; color: var(--txt); margin-bottom: 8px; }
.rate-stars { font-size: 30px; line-height: 1; letter-spacing: 4px; cursor: pointer; }
.rate-stars .star { color: var(--side-border); transition: color .1s; }
.rate-stars .star.on { color: #ffb400; }
/* 客服端:访客输入预知条 + 转人工列表标记 + 评分 */
.preview-bar { font-size: 13px; color: var(--blue); padding: 4px 16px; min-height: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--head); }
.preview-bar:empty { display: none; }
.tag-human { font-size: 11px; color: #fff; background: #ff3b30; border-radius: 5px; padding: 0 6px; margin-right: 5px; font-weight: 600; }
.conv.on .tag-human { background: #fff; color: var(--active); }
.rate-show { color: #ffb400; font-size: 13px; letter-spacing: 1px; }

/* ===== 会话过滤 tabs + 数据统计看板 ===== */
.conv-tabs { display: flex; gap: 4px; padding: 0 12px 6px; flex: 0 0 auto; }
.ct { flex: 1; border: 0; background: none; color: var(--txt-2); font-family: inherit; font-size: 13px; cursor: pointer;
  padding: 7px 4px; border-radius: 8px; transition: background .15s, color .15s; white-space: nowrap; }
.ct:hover { background: var(--hover); }
.ct.on { background: var(--blue); color: #fff; }
.ct-n { font-size: 11px; opacity: .8; }
.ct.on .ct-n { opacity: .95; }
.dash-sec { font-size: 12px; color: var(--txt-2); margin: 14px 0 8px; font-weight: 600; }
.dash-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.dash-grid:has(.dash-cell:nth-child(3):last-child) { grid-template-columns: repeat(3, 1fr); }
.dash-cell { background: var(--bg-2); border-radius: 10px; padding: 12px 6px; text-align: center; }
.dash-cell b { display: block; font-size: 22px; font-weight: 700; color: var(--blue); font-variant-numeric: tabular-nums; }
.dash-cell span { display: block; font-size: 11.5px; color: var(--txt-2); margin-top: 3px; }

/* ===== 加载/动效优化 ===== */
@keyframes appFade { from { opacity: 0 } to { opacity: 1 } }
.app, .v-app { animation: appFade .22s ease both; }
/* 消息入场(仅新消息加 .anim,历史不动) */
@keyframes msgPop { from { opacity: 0; transform: translateY(9px) scale(.985) } to { opacity: 1; transform: none } }
.msg.anim { animation: msgPop .26s cubic-bezier(.22,1,.36,1) both; }
/* 视图切换更顺滑 */
.chat-pane { transition: transform .3s cubic-bezier(.32,.72,0,1) !important; }
.v-chat { transition: transform .3s cubic-bezier(.32,.72,0,1) !important; }
/* 加载旋转 */
.spin { width: 26px; height: 26px; border: 2.5px solid var(--side-border); border-top-color: var(--blue); border-radius: 50%;
  animation: spin .7s linear infinite; margin: 30px auto; }
.v-theme .spin { border-top-color: var(--royal, #1f50ff); }
@keyframes spin { to { transform: rotate(360deg) } }
/* 正在输入 三点 */
.typing-dots { display: inline-flex; gap: 3px; vertical-align: middle; margin-left: 3px; }
.typing-dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: tdot 1s infinite; }
.typing-dots i:nth-child(2) { animation-delay: .15s } .typing-dots i:nth-child(3) { animation-delay: .3s }
@keyframes tdot { 0%, 60%, 100% { opacity: .3; transform: translateY(0) } 30% { opacity: 1; transform: translateY(-3px) } }
/* 列表/卡片淡入 */
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }
.v-conv, .conv { animation: fadeUp .18s ease both; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition-duration: .01s !important; } }

/* ===== 多客服:状态/认领/转接/团队 ===== */
.status-pill { border: 0; background: rgba(79,174,78,.15); color: #4fae4e; font-size: 12px; font-family: inherit;
  cursor: pointer; padding: 2px 9px; border-radius: 10px; font-weight: 500; }
.status-pill.busy { background: rgba(245,158,11,.15); color: #e6a23c; }
.status-pill.away { background: rgba(150,150,150,.18); color: var(--txt-2); }
.head-act { flex: 0 0 auto; border: 1px solid var(--side-border); background: none; color: var(--blue); border-radius: 14px;
  padding: 5px 12px; font-size: 13px; cursor: pointer; font-family: inherit; transition: background .15s; }
.head-act:hover { background: var(--hover); }
.head-act:disabled { opacity: .45; cursor: default; }
.transfer-menu { position: absolute; top: 54px; right: 14px; background: var(--head); border: 1px solid var(--side-border);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.2); z-index: 25; min-width: 190px; padding: 6px; display: none; }
.transfer-menu.show { display: block; }
.transfer-menu .tm-h { font-size: 12px; color: var(--txt-2); padding: 6px 8px; }
.transfer-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px;
  border-radius: 7px; cursor: pointer; font-size: 14px; }
.transfer-item:hover { background: var(--hover); }
.st-online { color: #4fae4e; font-size: 11px } .st-busy { color: #e6a23c; font-size: 11px } .st-away { color: var(--txt-3); font-size: 11px }
.team-item { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--side-border); border-radius: 10px; margin-bottom: 8px; }
.team-item .ti-main { flex: 1; min-width: 0 }
.team-item .ti-name { font-weight: 600; font-size: 14px }
.team-item .ti-sub { font-size: 12px; color: var(--txt-2) }
.team-item .ti-ops { display: flex; gap: 10px; font-size: 12px }
.team-item .ti-ops a { cursor: pointer; color: var(--blue) }
.team-item .ti-ops a.danger { color: #e53935 }
.assigned-tag { font-size: 11px; color: var(--txt-3); margin-left: 5px; font-weight: 400 }

/* 顶栏拥挤修复:名字省略号不换行 + 图标稍小 */
.s-title { overflow: hidden; min-width: 0; }
#meName { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.s-title .status-pill { flex: 0 0 auto; }
.s-head { gap: 4px; padding: 0 10px; }
.s-head .icon-btn { width: 36px; height: 36px; }
.s-head .icon-btn svg { width: 20px; height: 20px; }

/* 登录页底部链接 + 访客在线圆点 */
.login-foot { margin-top: 16px; font-size: 13px; color: var(--txt-2); line-height: 1.9; }
.login-foot b { color: var(--txt); }
.login-foot a { color: var(--blue); }
.av-wrap { position: relative; flex: 0 0 auto; }
.av-dot { position: absolute; right: -1px; bottom: -1px; width: 13px; height: 13px; border-radius: 50%;
  background: #9aa3ad; border: 2.5px solid var(--sidebar); }
.av-dot.on { background: #4fae4e; }

/* ===== 表单消息(客服发送 / 访客填写)===== */
.form-card { background: var(--bub-in); border: 1px solid var(--side-border); border-radius: 12px; padding: 12px 14px; min-width: 220px; max-width: 300px; }
.msg.out .form-card { background: rgba(255,255,255,.5); }
.v-theme .msg.in .form-card { background: #fff; }
html[data-theme="dark"] .form-card { background: rgba(255,255,255,.06); }
.fc-title { font-weight: 600; font-size: 14.5px; margin-bottom: 9px; color: var(--txt); }
.fc-field { font-size: 13.5px; color: var(--txt-2); padding: 3px 0; }
.fc-field em { color: #e6a23c; font-style: normal; font-size: 12px; }
.fc-note { font-size: 12px; color: var(--txt-3); margin-top: 8px; }
.fc-input { width: 100%; height: 38px; border: 1px solid var(--side-border); border-radius: 8px; background: var(--inp-bg);
  color: var(--txt); padding: 0 11px; font-size: 14px; outline: none; font-family: inherit; margin-bottom: 8px; }
.fc-input:focus { border-color: var(--royal, var(--blue)); }
.fc-submit { width: 100%; height: 40px; border: 0; border-radius: 9px; background: var(--royal, var(--blue)); color: #fff;
  font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; }
.fc-kv { font-size: 13.5px; padding: 4px 0; border-bottom: 1px dashed var(--side-border); display: flex; gap: 10px; }
.fc-kv:last-child { border: 0; }
.fc-kv span { color: var(--txt-2); flex: 0 0 72px; }
/* 表单构建器 */
.fb-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.fb-row input[type=text], .fb-row > input:first-child { flex: 1; height: 38px; border: 1px solid var(--side-border); border-radius: 8px;
  background: var(--inp-bg); color: var(--txt); padding: 0 11px; font-size: 14px; outline: none; font-family: inherit; }
.fb-row label { font-size: 13px; color: var(--txt-2); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.fb-row a { color: #e53935; cursor: pointer; font-size: 13px; flex: 0 0 auto; }
.fb-presets { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 14px; }
.fb-presets button { border: 1px solid var(--side-border); background: var(--bg-2); color: var(--txt); border-radius: 16px;
  padding: 6px 13px; font-size: 13px; cursor: pointer; font-family: inherit; }
.fb-presets button:hover { border-color: var(--blue); color: var(--blue); }

/* ============ 引用回复 / 撤回 / 表情 / 标签 / 看板 / 管理设置(第十一轮) ============ */
/* 消息悬浮操作(回复/撤回) */
.msg { position: relative; }
.msg-acts { position: absolute; top: -2px; display: none; gap: 2px; z-index: 3; }
.msg.in .msg-acts { left: 100%; margin-left: 4px; }
.msg.out .msg-acts { right: 100%; margin-right: 4px; flex-direction: row-reverse; }
.msg:hover .msg-acts { display: flex; }
.msg-acts button { width: 26px; height: 26px; border: none; border-radius: 50%; background: var(--head, #1c2733);
  color: var(--txt-2, #8a99a8); cursor: pointer; display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.msg-acts button:hover { color: var(--blue); background: var(--hover, #232f3d); }
.msg-acts svg { width: 15px; height: 15px; }
@media (max-width: 820px) { .msg-acts { display: flex; opacity: .55; } .msg:hover .msg-acts { opacity: 1; } }
/* 气泡内引用块 */
.msg-quote { display: block; border-left: 3px solid currentColor; padding: 2px 8px; margin: 0 0 5px; border-radius: 4px;
  background: rgba(127,127,127,.13); cursor: pointer; max-width: 260px; }
.msg.out .msg-quote { border-left-color: rgba(255,255,255,.6); }
.mq-name { display: block; font-size: 12px; font-weight: 600; opacity: .9; line-height: 1.5; }
.mq-text { display: block; font-size: 12.5px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 撤回 */
.msg.recalled .bubble { background: transparent !important; box-shadow: none !important; }
.recall-tx { font-size: 12.5px; color: var(--txt-3, #6b7785); font-style: italic; }
/* 输入区:回复预览条 */
.reply-bar { display: none; align-items: center; gap: 10px; padding: 7px 14px; background: var(--head, #1c2733);
  border-top: 1px solid var(--side-border, #2a3744); }
.reply-bar.show { display: flex; }
.reply-bar .rb-bd { flex: 1; min-width: 0; border-left: 3px solid var(--blue); padding-left: 9px; }
.reply-bar .rb-name { display: block; font-size: 12px; font-weight: 600; color: var(--blue); }
.reply-bar .rb-tx { display: block; font-size: 13px; color: var(--txt-2, #8a99a8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reply-bar .rb-x { border: none; background: none; color: var(--txt-3, #6b7785); cursor: pointer; font-size: 16px; padding: 4px 6px; }
.reply-bar .rb-x:hover { color: var(--txt); }
/* 定位高亮 */
@keyframes msgFlash { 0%,100% { background: transparent; } 30% { background: rgba(51,144,236,.16); } }
.msg.flash { animation: msgFlash 1.1s ease; border-radius: 10px; }
/* 表情选择器 */
.emoji-pop { display: none; position: absolute; bottom: 64px; right: 14px; width: 300px; max-height: 220px; overflow-y: auto;
  background: var(--sidebar, #17212b); border: 1px solid var(--side-border, #2a3744); border-radius: 12px; padding: 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,.3); z-index: 30; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emoji-pop.show { display: grid; }
.emoji-pop button { border: none; background: none; font-size: 21px; cursor: pointer; padding: 4px; border-radius: 7px; line-height: 1; }
.emoji-pop button:hover { background: var(--hover, #232f3d); }
.chat-pane, .v-chat { position: relative; }
/* 会话标签 */
.tag-box { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; position: relative; }
.tagc { display: inline-flex; align-items: center; gap: 4px; background: rgba(51,144,236,.14); color: var(--blue);
  border-radius: 12px; padding: 2px 5px 2px 9px; font-size: 12px; }
.tagc a { cursor: pointer; opacity: .65; font-size: 11px; }
.tagc a:hover { opacity: 1; }
.tag-add { border: 1px dashed var(--side-border, #2a3744); background: none; color: var(--txt-2, #8a99a8);
  border-radius: 12px; padding: 2px 10px; font-size: 12px; cursor: pointer; font-family: inherit; }
.tag-add:hover { border-color: var(--blue); color: var(--blue); }
.tag-menu { display: none; position: absolute; top: 100%; left: 0; margin-top: 6px; z-index: 20; flex-wrap: wrap; gap: 5px;
  background: var(--sidebar, #17212b); border: 1px solid var(--side-border, #2a3744); border-radius: 10px; padding: 9px; width: 220px;
  box-shadow: 0 6px 24px rgba(0,0,0,.28); }
.tag-menu.show { display: flex; }
.tag-menu span { background: var(--bg-2, #1c2733); border-radius: 11px; padding: 3px 11px; font-size: 12.5px; cursor: pointer; color: var(--txt); }
.tag-menu span:hover { background: var(--blue); color: #fff; }
.tag-menu input { flex: 1 0 100%; margin-top: 4px; background: var(--inp-bg, #131c26); border: 1px solid var(--side-border, #2a3744);
  border-radius: 8px; padding: 6px 9px; color: var(--txt); font-size: 13px; }
/* 列表内小标签 */
.lt { display: inline-block; background: rgba(51,144,236,.16); color: var(--blue); border-radius: 4px; padding: 0 5px;
  font-size: 11px; margin-right: 4px; vertical-align: 1px; }
/* 会话操作按钮 */
.info-ops { display: flex; flex-wrap: wrap; gap: 8px; }
.info-ops button { flex: 1; min-width: 88px; border: 1px solid var(--side-border, #2a3744); background: var(--bg-2, #1c2733);
  color: var(--txt); border-radius: 8px; padding: 8px 6px; font-size: 13px; cursor: pointer; font-family: inherit; }
.info-ops button:hover { border-color: var(--blue); color: var(--blue); }
.info-ops button.danger:hover { border-color: #e53935; color: #e53935; }
/* 看板:柱状趋势 */
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 110px; padding: 6px 2px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar-v { font-size: 11px; color: var(--txt-2, #8a99a8); margin-bottom: 3px; height: 14px; }
.bar { width: 70%; max-width: 26px; background: linear-gradient(180deg, var(--blue), var(--blue-d, #2b7fd6)); border-radius: 5px 5px 0 0; min-height: 4px; transition: height .4s; }
.bar-x { font-size: 11px; color: var(--txt-3, #6b7785); margin-top: 5px; }
/* 看板:绩效 / 来源 */
.perf-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 2px; border-bottom: 1px solid var(--side-border, #2a3744); font-size: 13px; }
.perf-n { font-weight: 600; }
.perf-d { color: var(--txt-2, #8a99a8); font-size: 12px; }
.src-row { display: flex; align-items: center; gap: 8px; padding: 5px 2px; font-size: 12.5px; }
.src-n { flex: 0 0 120px; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-bar { flex: 1; height: 7px; background: var(--bg-2, #1c2733); border-radius: 4px; overflow: hidden; }
.src-bar i { display: block; height: 100%; background: var(--blue); border-radius: 4px; }
.src-c { flex: 0 0 auto; color: var(--txt-2, #8a99a8); }
/* 管理设置 */
.adm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.adm-grid label, .adm-row label { display: flex; flex-direction: column; font-size: 12.5px; color: var(--txt-2, #8a99a8); gap: 4px; }
.adm-grid input, .adm-row input { background: var(--inp-bg, #131c26); border: 1px solid var(--side-border, #2a3744); border-radius: 8px;
  padding: 8px 10px; color: var(--txt); font-size: 14px; font-family: inherit; }
.adm-row { display: flex; gap: 12px; margin-bottom: 10px; }
.adm-hint { font-size: 12px; color: var(--txt-3, #6b7785); margin: 8px 0 0; }
.wdays { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.wdays label { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; background: var(--bg-2, #1c2733);
  border-radius: 7px; padding: 4px 9px; cursor: pointer; }
.blk-item { display: flex; align-items: center; gap: 8px; padding: 7px 2px; border-bottom: 1px solid var(--side-border, #2a3744); font-size: 13px; }
.blk-k { background: var(--bg-2, #1c2733); border-radius: 5px; padding: 1px 7px; font-size: 11px; color: var(--txt-2, #8a99a8); }
.blk-r { flex: 1; color: var(--txt-3, #6b7785); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk-item a { color: #e53935; cursor: pointer; font-size: 12.5px; }
.blk-add { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.blk-add select, .blk-add input { background: var(--inp-bg, #131c26); border: 1px solid var(--side-border, #2a3744);
  border-radius: 8px; padding: 8px 10px; color: var(--txt); font-size: 13px; font-family: inherit; }
.blk-add input { flex: 1; min-width: 90px; }
.blk-add button { background: var(--blue); color: #fff; border: none; border-radius: 8px; padding: 8px 16px; cursor: pointer; font-family: inherit; }
/* 离线留言卡 */
.leave-card { background: var(--bub-in, #1c2733); border: 1px solid var(--side-border, #2a3744); border-radius: 12px;
  padding: 14px; margin: 8px auto; max-width: 320px; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.leave-card .lc-title { font-size: 13.5px; color: var(--txt, #e6edf3); margin-bottom: 10px; line-height: 1.5; }
.leave-card input, .leave-card textarea { width: 100%; box-sizing: border-box; background: var(--inp-bg, #fff);
  border: 1px solid var(--side-border, #d4dbe2); border-radius: 8px; padding: 9px 11px; margin-bottom: 8px; font-size: 14px;
  font-family: inherit; color: var(--bub-tx, #1a2733); resize: none; }
.leave-card button { width: 100%; background: var(--royal, var(--blue)); color: #fff; border: none; border-radius: 8px;
  padding: 10px; font-size: 14px; cursor: pointer; font-family: inherit; font-weight: 600; }
.v-theme .leave-card { background: #fff; }

/* ============ 顶部菜单下拉(单管理员,替代一排图标)============ */
.menu-wrap { position: relative; flex: 0 0 auto; }
.head-menu { display: none; position: absolute; top: 100%; right: 0; margin-top: 6px; z-index: 60; min-width: 178px;
  background: var(--sidebar, #17212b); border: 1px solid var(--side-border, #2a3744); border-radius: 12px; padding: 6px;
  box-shadow: 0 10px 34px rgba(0,0,0,.34); }
.head-menu.show { display: block; animation: appFade .14s ease; }
.head-menu a { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 8px; cursor: pointer;
  color: var(--txt); font-size: 14px; white-space: nowrap; }
.head-menu a:hover { background: var(--hover, #232f3d); }
.head-menu a svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--txt-2, #8a99a8); }
.head-menu a:hover svg { color: var(--blue); }
.head-menu a.danger { color: #e5605e; }
.head-menu a.danger:hover { background: rgba(229,57,53,.12); }
.head-menu a.danger svg { color: #e5605e; }

/* ============ 聊天页顶部访客信息条(IP/归属地/浏览器 + 一键拉黑 IP)============ */
.conv-meta { display: flex; align-items: center; gap: 14px; padding: 6px 16px; font-size: 12px;
  color: var(--txt-2, #8a99a8); background: var(--head, #1c2733); border-bottom: 1px solid var(--side-border, #2a3744);
  overflow-x: auto; white-space: nowrap; flex: 0 0 auto; scrollbar-width: thin; }
.conv-meta:empty { display: none; }
.conv-meta .cm-i { flex: 0 0 auto; }
.conv-meta .cm-i b { color: var(--txt, #e6edf3); font-weight: 600; font-variant-numeric: tabular-nums; }
.conv-meta .cm-ban { margin-left: auto; flex: 0 0 auto; border: 1px solid rgba(229,57,53,.42);
  background: rgba(229,57,53,.08); color: #e5605e; border-radius: 7px; padding: 3px 13px; font-size: 12px;
  cursor: pointer; font-family: inherit; }
.conv-meta .cm-ban:hover { background: #e53935; color: #fff; border-color: #e53935; }

/* 撤回后「重新编辑」链接(TG 风) */
.recall-edit { margin-left: 8px; color: var(--blue); cursor: pointer; font-size: 12.5px; }
.recall-edit:hover { text-decoration: underline; }

/* ============ 手机端适配补充:资料栏返回键 / 可滚动 / 弹层不溢出 ============ */
.info-back { display: none; }
.info-pane { display: flex; flex-direction: column; }
.info-inner { overflow-y: auto; flex: 1; min-height: 0; }
@media (max-width: 820px) {
  .info-back { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; height: 52px; width: 100%;
    border: 0; border-bottom: 1px solid var(--side-border); background: var(--head); color: var(--txt);
    font-size: 15px; font-weight: 600; font-family: inherit; padding: 0 10px; cursor: pointer; }
  .info-back svg { width: 24px; height: 24px; }
  .conv-meta { gap: 10px; padding: 6px 12px; }
  .conv-meta .cm-ban { padding: 4px 12px; }
  .emoji-pop { width: auto; left: 10px; right: 10px; bottom: 70px; grid-template-columns: repeat(7, 1fr); }
  .modal-card { padding: 18px 16px; }
  .search-results { left: 8px; right: 8px; }
}
