/* ============ 云客客服 · 基础样式 ============ */
:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --panel-soft: #fafbfd;
  --line: #e7eaf1;
  --line-strong: #d9dee9;
  --text: #171b26;
  --text-2: #4a5265;
  --muted: #8b93a7;
  --primary: #2b6cff;
  --primary-dark: #1d55d6;
  --primary-soft: #eef3ff;
  --green: #12a150;
  --green-soft: #e8f8ef;
  --amber: #c9780a;
  --amber-soft: #fdf3e3;
  --red: #d64545;
  --red-soft: #fdeeee;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(20, 32, 60, .05);
  --shadow: 0 8px 28px rgba(20, 32, 60, .08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font-family: inherit; font-size: 14px; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); text-decoration: none; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d7dce7; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #c3cad8; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 通用控件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--text-2);
  font-weight: 500; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: #c3cad8; background: #fbfcfe; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: #f0f3f9; color: var(--text); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn-danger { color: var(--red); border-color: #f2d3d3; background: #fff; }
.btn-danger:hover { background: var(--red-soft); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.input, .textarea, .select {
  width: 100%; border: 1px solid var(--line-strong); background: #fff;
  border-radius: 10px; padding: 9px 12px; outline: none; transition: .15s;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(43, 108, 255, .12); }
.textarea { resize: vertical; min-height: 84px; line-height: 1.6; }
.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 13px; color: var(--text-2); font-weight: 500; margin-bottom: 7px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.6; }

.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 500; }
.pill-blue { background: var(--primary-soft); color: var(--primary); }
.pill-green { background: var(--green-soft); color: var(--green); }
.pill-amber { background: var(--amber-soft); color: var(--amber); }
.pill-gray { background: #f0f2f7; color: var(--muted); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.hidden { display: none !important; }

/* ---------- 登录页 ---------- */
.login-page { min-height: 100%; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1000px 500px at 15% -10%, #e7eeff 0%, transparent 60%),
              radial-gradient(800px 500px at 100% 100%, #e9f7f0 0%, transparent 55%), var(--bg); }
.login-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 34px 32px 28px; box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, #3d7bff, #1e50d8); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 17px; letter-spacing: .5px; box-shadow: 0 6px 16px rgba(43,108,255,.28); }
.brand-name { font-size: 16px; font-weight: 650; letter-spacing: .2px; }
.brand-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.login-title { font-size: 22px; font-weight: 650; margin: 26px 0 6px; }
.login-desc { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.login-card .btn-primary { width: 100%; height: 42px; border-radius: 11px; font-size: 15px; margin-top: 6px; }
.login-error { background: var(--red-soft); color: var(--red); border-radius: 9px; padding: 9px 12px; font-size: 13px; margin-bottom: 14px; }
.demo-accounts { margin-top: 22px; border-top: 1px dashed var(--line); padding-top: 16px; }
.login-foot { margin-top: 22px; border-top: 1px dashed var(--line); padding-top: 14px; font-size: 12px; color: var(--muted); text-align: center; }
.demo-accounts .t { font-size: 12px; color: var(--muted); margin-bottom: 9px; }
.demo-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--panel-soft); border-radius: 8px; padding: 5px 10px; font-size: 12px; color: var(--text-2); }
.chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* ---------- 控制台骨架 ---------- */
.app { display: flex; height: 100%; overflow: hidden; }
.rail { width: 216px; flex: 0 0 216px; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.rail-top { padding: 18px 16px 14px; }
.rail-nav { padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; color: var(--text-2); font-weight: 500; border: 0; background: transparent; text-align: left; width: 100%; }
.nav-item:hover { background: #f4f6fb; }
.nav-item.active { background: var(--primary-soft); color: var(--primary); }
.nav-item svg { flex: 0 0 18px; }
.nav-badge { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; height: 18px; min-width: 18px; padding: 0 5px; border-radius: 9px; display: grid; place-items: center; font-weight: 600; }
.nav-count { margin-left: auto; background: #eef1f7; color: var(--text-2); font-size: 11px; height: 18px; min-width: 18px; padding: 0 6px; border-radius: 9px; display: grid; place-items: center; font-weight: 600; }
.nav-item.active .nav-count { background: #dfe9ff; color: var(--primary); }
.rail-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.me:hover { background: var(--panel-soft); }
.me-name { font-weight: 600; font-size: 13px; line-height: 1.3; }
.me-role { font-size: 11px; color: var(--muted); }
.avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 13px; flex: 0 0 auto; user-select: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-lg { width: 42px; height: 42px; border-radius: 12px; font-size: 15px; }

.stage { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 62px; flex: 0 0 62px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; padding: 0 22px; }
.topbar h1 { font-size: 16px; font-weight: 650; margin: 0; }
.stats { display: flex; gap: 8px; margin-left: 6px; }
.stat { display: flex; align-items: baseline; gap: 6px; background: var(--panel-soft); border: 1px solid var(--line); border-radius: 9px; padding: 5px 10px; font-size: 12px; color: var(--muted); }
.stat b { font-size: 14px; color: var(--text); font-weight: 650; }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.views { flex: 1; min-height: 0; position: relative; }
.view { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; }

/* ---------- 会话视图 ---------- */
.chat-layout { flex: 1; min-height: 0; display: flex; }
.conv-col { width: 320px; flex: 0 0 320px; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.conv-head { padding: 14px 14px 10px; border-bottom: 1px solid var(--line); }
.search { position: relative; }
.search input { width: 100%; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-soft); padding: 0 12px 0 32px; outline: none; }
.search input:focus { border-color: var(--primary); background: #fff; }
.search svg { position: absolute; left: 10px; top: 9px; color: var(--muted); }
.tabs { display: flex; gap: 4px; margin-top: 10px; background: var(--panel-soft); padding: 3px; border-radius: 9px; border: 1px solid var(--line); }
.tab { flex: 1; height: 28px; border: 0; background: transparent; border-radius: 7px; font-size: 12.5px; color: var(--text-2); }
.tab.active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: var(--shadow-sm); }
.conv-list { flex: 1; overflow-y: auto; padding: 6px; }
.conv-item { display: flex; gap: 10px; padding: 10px; border-radius: 11px; cursor: pointer; position: relative; }
.conv-item:hover { background: var(--panel-soft); }
.conv-item.active { background: var(--primary-soft); }
.conv-main { min-width: 0; flex: 1; }
.conv-row1 { display: flex; align-items: center; gap: 6px; }
.conv-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { margin-left: auto; font-size: 11px; color: var(--muted); flex: 0 0 auto; }
.conv-row2 { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.conv-last { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.badge { flex: 0 0 auto; background: var(--red); color: #fff; font-size: 11px; font-weight: 600; height: 17px; min-width: 17px; padding: 0 5px; border-radius: 9px; display: grid; place-items: center; }
.conv-sub { font-size: 11px; color: var(--muted); margin-top: 4px; display: flex; gap: 6px; align-items: center; }
.empty-list { text-align: center; color: var(--muted); font-size: 13px; padding: 40px 16px; line-height: 1.8; }

.chat-col { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--panel-soft); }
.chat-top { height: 60px; flex: 0 0 60px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 18px; }
.chat-title { font-weight: 650; font-size: 14px; }
.chat-meta { font-size: 12px; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.chat-actions { margin-left: auto; display: flex; gap: 8px; }
.msgs { flex: 1; overflow-y: auto; padding: 22px 24px 8px; display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 9px; max-width: 74%; }
.msg.agent { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar { width: 30px; height: 30px; border-radius: 9px; flex: 0 0 auto; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 600; }
.msg-body { min-width: 0; }
.msg-who { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.msg.agent .msg-who { text-align: right; }
.bubble { background: #fff; border: 1px solid var(--line); padding: 9px 13px; border-radius: 12px; border-top-left-radius: 4px; line-height: 1.62; white-space: pre-wrap; word-break: break-word; box-shadow: var(--shadow-sm); font-size: 13.5px; }
.msg.agent .bubble { background: var(--primary); border-color: var(--primary); color: #fff; border-top-left-radius: 12px; border-top-right-radius: 4px; }
.msg-time { font-size: 10.5px; color: var(--muted); margin-top: 4px; }
.msg.agent .msg-time { text-align: right; }
.msg-system { align-self: center; font-size: 12px; color: var(--muted); background: #eef1f7; padding: 5px 12px; border-radius: 20px; max-width: 80%; text-align: center; line-height: 1.6; }
.typing { font-size: 12px; color: var(--muted); padding: 0 24px 4px; height: 18px; }
.composer { background: #fff; border-top: 1px solid var(--line); padding: 12px 18px 14px; }
.composer textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 11px; padding: 10px 12px; resize: none; outline: none; height: 74px; line-height: 1.6; transition: .15s; }
.composer textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(43,108,255,.1); }
.composer-bar { display: flex; align-items: center; gap: 10px; margin-top: 9px; }
.composer-bar .hint { margin: 0; }
.composer-bar .btn { margin-left: auto; }
.chat-empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--muted); }
.chat-empty .box { line-height: 1.9; }
.chat-empty .big { font-size: 15px; color: var(--text-2); font-weight: 600; margin-bottom: 4px; }

/* ---------- 账号管理 ---------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.scroll-area { flex: 1; overflow-y: auto; padding: 22px; }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 15px; margin: 0; font-weight: 650; }
.panel-head .desc { font-size: 12px; color: var(--muted); }
.panel-head .right { margin-left: auto; display: flex; gap: 8px; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 11px 16px; border-bottom: 1px solid var(--line); background: var(--panel-soft); white-space: nowrap; }
.tbl td { padding: 12px 16px; border-bottom: 1px solid #f1f3f8; font-size: 13px; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: #fbfcff; }
.cell-user { display: flex; align-items: center; gap: 9px; }
.cell-user .n { font-weight: 600; }
.cell-user .u { font-size: 11.5px; color: var(--muted); }
.tree-line { color: #cfd5e2; margin-right: 6px; font-family: monospace; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.mono { font-variant-numeric: tabular-nums; }

/* ---------- 设置 ---------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
@media (max-width: 1080px) { .settings-grid { grid-template-columns: 1fr; } }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.card-head { padding: 15px 18px; border-bottom: 1px solid var(--line); font-weight: 650; font-size: 14px; }
.card-body { padding: 18px; }
.switch-row { display: flex; align-items: flex-start; gap: 12px; padding: 4px 0 14px; }
.switch-row .txt { flex: 1; }
.switch-row .t { font-weight: 600; margin-bottom: 3px; }
.switch-row .d { font-size: 12px; color: var(--muted); line-height: 1.6; }
.switch { position: relative; width: 46px; height: 26px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track { position: absolute; inset: 0; background: #dfe3ec; border-radius: 20px; transition: .2s; pointer-events: none; }
.switch .track:after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .2s; }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track:after { transform: translateX(20px); }
.qr-box { display: grid; place-items: center; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.qr-box img { width: 100%; max-width: 240px; display: block; }
.link-box { display: flex; gap: 8px; margin-top: 12px; }
.link-box input { flex: 1; font-size: 12px; }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(16, 22, 38, .38); backdrop-filter: blur(2px); display: grid; place-items: center; padding: 20px; z-index: 60; }
.modal { width: 100%; max-width: 460px; background: #fff; border-radius: 18px; box-shadow: 0 24px 60px rgba(16,22,38,.22); overflow: hidden; animation: pop .16s ease-out; }
.modal.wide { max-width: 560px; }
@keyframes pop { from { transform: translateY(8px) scale(.985); opacity: .6; } }
.modal-head { display: flex; align-items: center; padding: 18px 20px 0; font-weight: 650; font-size: 16px; }
.modal-head .x { margin-left: auto; border: 0; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; padding: 4px 6px; border-radius: 6px; }
.modal-head .x:hover { background: #f2f4f9; }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 20px 20px; }
.modal-foot .btn { min-width: 84px; }

/* ---------- 访客端 ---------- */
.v-body { height: 100%; background: #eceff5; display: flex; justify-content: center; }
.v-app { width: 100%; max-width: 480px; background: #fff; display: flex; flex-direction: column; height: 100%; box-shadow: 0 0 50px rgba(20,32,60,.08); }
.v-top { background: linear-gradient(135deg, #2f6cf0, #1c4fd0); color: #fff; padding: 16px 18px; display: flex; align-items: center; gap: 11px; flex: 0 0 auto; }
.v-top .avatar { background: rgba(255,255,255,.2) !important; border: 1px solid rgba(255,255,255,.28); }
.v-name { font-weight: 650; font-size: 15px; }
.v-status { font-size: 11.5px; opacity: .85; display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.v-status .dot { background: #6ee7a8; }
.v-status.off .dot { background: #ffd08a; }
.v-msgs { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; background: #f6f7fb; }
.v-item { display: flex; flex-direction: column; align-items: flex-start; max-width: 80%; gap: 3px; }
.v-item.me { align-self: flex-end; align-items: flex-end; }
.v-bubble { max-width: 100%; padding: 10px 13px; border-radius: 14px; line-height: 1.62; font-size: 14px; white-space: pre-wrap; word-break: break-word; box-shadow: var(--shadow-sm); }
.v-bubble.agent { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.v-bubble.me { background: var(--primary); color: #fff; border-bottom-right-radius: 5px; }
.v-time { font-size: 10.5px; color: var(--muted); }
.v-bubble.me + .v-time { text-align: right; }.v-sys { align-self: center; font-size: 11.5px; color: var(--muted); background: #e9edf5; padding: 5px 12px; border-radius: 20px; max-width: 85%; text-align: center; line-height: 1.6; }
.v-notice { background: var(--amber-soft); color: #8a5a10; font-size: 12px; padding: 8px 16px; text-align: center; border-bottom: 1px solid #f5e6cd; }
.v-composer { flex: 0 0 auto; background: #fff; border-top: 1px solid var(--line); padding: 10px 12px 14px; }
.v-input-row { display: flex; align-items: flex-end; gap: 8px; }
.v-input-row textarea { flex: 1; border: 1px solid var(--line-strong); border-radius: 12px; padding: 9px 12px; height: 40px; max-height: 110px; resize: none; outline: none; line-height: 1.5; font-size: 14px; background: var(--panel-soft); }
.v-input-row textarea:focus { border-color: var(--primary); background: #fff; }
.v-send { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--primary); color: #fff; display: grid; place-items: center; flex: 0 0 auto; }
.v-send:disabled { background: #c9d3e6; cursor: not-allowed; }
.v-foot { text-align: center; font-size: 10.5px; color: #b3bacb; padding-top: 8px; }
.v-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 40px 20px; line-height: 1.9; }

/* ---------- 已读回执 / 头像设置 ---------- */
.msg-status { font-size: 10.5px; color: var(--muted); margin-left: 6px; }
.msg-status.read { color: var(--primary); }.v-status-text { font-size: 10.5px; color: var(--muted); margin-top: 3px; text-align: right; }
.v-status-text.read { color: var(--primary); }
.swatches { display: flex; gap: 9px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 9px; border: 2px solid transparent; cursor: pointer; position: relative; }
.swatch.on { border-color: #fff; box-shadow: 0 0 0 2px var(--primary); }
.me { cursor: pointer; }
.unread-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); flex: 0 0 auto; }
.tbl .avatar { width: 30px; height: 30px; border-radius: 9px; font-size: 12px; }
.tbl .cell-user { cursor: default; }
.user-self { font-size: 11px; color: var(--muted); margin-left: 4px; }

@media (max-width: 900px) {
  .rail { width: 64px; flex: 0 0 64px; }
  .rail .brand-text, .rail .nav-item span, .rail .me-name, .rail .me-role, .rail .nav-badge, .rail .nav-count { display: none; }
  .rail-top { padding: 14px 12px; }
  .rail .brand { justify-content: center; }
  .nav-item { justify-content: center; padding: 11px; }
  .me { justify-content: center; padding: 6px; }
  .conv-col { width: 240px; flex: 0 0 240px; }
  .stats { display: none; }
}

/* ---------- 图片 / 快捷语 / 撤回 ---------- */
.tool-btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 32px; padding: 0 10px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff; color: var(--text-2); font-size: 13px;
}
.tool-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.composer { position: relative; }
.quick-panel {
  position: absolute; left: 18px; right: 18px; bottom: calc(100% + 8px);
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 16px 40px rgba(20, 32, 60, .14); z-index: 30; overflow: hidden;
}
.quick-head { display: flex; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--text-2); }
.quick-head .x { margin-left: auto; border: 0; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; }
.quick-list { max-height: 260px; overflow-y: auto; padding: 6px; }
.quick-item { display: block; width: 100%; text-align: left; border: 0; background: transparent; border-radius: 9px; padding: 8px 10px; }
.quick-item:hover { background: var(--primary-soft); }
.quick-item .t { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.quick-item .c { font-size: 12.5px; color: var(--muted); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.quick-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 13px; }

.bubble.img { padding: 5px; background: #fff; border-color: var(--line); line-height: 0; }
.msg.agent .bubble.img { background: #fff; border-color: var(--line); }
.bubble.img img { max-width: 240px; max-height: 240px; border-radius: 8px; cursor: zoom-in; display: block; }
.bubble.recalled { background: #f2f4f9; border-color: transparent; color: var(--muted); font-size: 12.5px; font-style: normal; padding: 7px 12px; }
.msg.agent .bubble.recalled { background: #eef1f7; border-color: transparent; color: var(--muted); }
.msg-act { border: 0; background: transparent; color: var(--muted); font-size: 10.5px; margin-left: 8px; padding: 0; cursor: pointer; }
.msg-act:hover { color: var(--red); }
.lightbox { position: fixed; inset: 0; background: rgba(10, 14, 24, .78); display: grid; place-items: center; z-index: 90; padding: 30px; cursor: zoom-out; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.quick-editor { display: flex; flex-direction: column; gap: 8px; }
.q-row { display: grid; grid-template-columns: 150px 1fr auto 32px; gap: 8px; align-items: start; }
.q-row .input, .q-row .textarea { font-size: 13px; padding: 7px 10px; }
.q-row .textarea { min-height: 38px; height: 38px; }
.q-del { border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 8px; height: 34px; width: 32px; }
.q-del:hover { color: var(--red); border-color: #f2d3d3; background: var(--red-soft); }

/* 快捷语图片 */
.q-media { display: flex; align-items: center; gap: 6px; }
.q-thumb { position: relative; width: 46px; height: 34px; border-radius: 7px; overflow: hidden; border: 1px solid var(--line); line-height: 0; flex: 0 0 auto; background: #f6f8fc; }
.q-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.q-thumb-x { position: absolute; right: 0; top: 0; width: 15px; height: 15px; border: 0; padding: 0; border-radius: 0 6px 0 7px; background: rgba(15, 22, 38, .62); color: #fff; font-size: 11px; line-height: 15px; cursor: pointer; }
.q-btn-img { border: 1px dashed var(--line-strong); background: #fff; color: var(--text-2); border-radius: 8px; height: 34px; padding: 0 10px; font-size: 12.5px; white-space: nowrap; cursor: pointer; }
.q-btn-img:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.quick-item.img { display: flex; gap: 10px; align-items: center; }
.qi-img { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); flex: 0 0 auto; display: block; }
.qi-main { min-width: 0; flex: 1; }
.quick-item.img .c { -webkit-line-clamp: 1; }
.danger-card { border-color: #f2d3d3; }

/* ---------- 访客端：图片 / 撤回 / 会话重置 ---------- */
.v-app { position: relative; }
.v-tool { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line-strong); background: #fff; color: var(--text-2); display: grid; place-items: center; flex: 0 0 auto; }
.v-tool:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.v-bubble.img { padding: 4px; line-height: 0; background: #fff; border: 1px solid var(--line); }
.v-bubble.me.img { background: var(--primary); border-color: var(--primary); }
.v-bubble img { max-width: 200px; max-height: 200px; border-radius: 10px; display: block; cursor: zoom-in; }
.v-bubble.recalled, .v-bubble.me.recalled { background: #eef1f7; color: var(--muted); border-color: transparent; font-size: 12.5px; }
.v-act { border: 0; background: transparent; color: var(--muted); font-size: 10.5px; padding: 0; margin-top: 2px; cursor: pointer; }
.v-act:hover { color: var(--red); }
.v-blocked { position: absolute; inset: 0; background: rgba(246, 247, 251, .97); display: grid; place-items: center; text-align: center; padding: 24px; z-index: 20; }
.v-blocked .t { font-size: 16px; font-weight: 650; margin-bottom: 6px; }
.v-blocked .d { font-size: 13px; color: var(--muted); margin-bottom: 16px; line-height: 1.7; }
.q-row .textarea { resize: none; }
.v-blocked .btn-primary { color: #fff; }

/* ---------- 我的快捷消息：面板「管理」入口 ---------- */
.quick-manage {
  margin-left: auto;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-2);
  border-radius: 7px;
  height: 24px;
  padding: 0 9px;
  font-size: 12px;
  cursor: pointer;
}
.quick-manage:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.quick-head .x { margin-left: 6px; }
#quickModal .modal { width: 720px; max-width: calc(100vw - 40px); }
#quickModal .modal-body { max-height: min(62vh, 560px); overflow-y: auto; }
#quickModal .q-row .textarea { height: auto; min-height: 58px; }
#quickModal .q-thumb { width: 60px; height: 44px; }

/* ---------- 会话筛选标签：未读计数 ---------- */
.tab .tab-count {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 10.5px;
  line-height: 1;
  vertical-align: 1px;
}
