/* =====================================================
   在线客服系统 · 样式（第一版）
   ===================================================== */

:root {
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eff6ff;
  --ink: #0f172a;
  --text: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-soft: #f1f5f9;
  --bg: #f8fafc;
  --card: #ffffff;
  --danger: #dc2626;
  --ok: #22c55e;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, .09);
  --shadow-lg: 0 24px 64px rgba(15, 23, 42, .18);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
img { max-width: 100%; display: block; }

/* -------- 头像 -------- */
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  overflow: hidden; flex: 0 0 auto;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  color: #fff; font-weight: 700; font-size: 15px;
  user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 30px; height: 30px; font-size: 12px; }
.avatar-md { width: 44px; height: 44px; font-size: 16px; }
.avatar-lg { width: 46px; height: 46px; font-size: 17px; }
.avatar-xl  { width: 84px; height: 84px; font-size: 30px; box-shadow: 0 10px 30px rgba(37, 99, 235, .25); }

/* -------- 按钮 -------- */
.primary-btn {
  border: 0; background: var(--brand); color: #fff;
  font-size: 14px; font-weight: 600; padding: 12px 20px;
  border-radius: 12px; box-shadow: 0 6px 16px rgba(37, 99, 235, .26);
  transition: background .15s, transform .12s;
}
.primary-btn:hover { background: var(--brand-dark); }
.primary-btn:active { transform: translateY(1px); }
.primary-btn.block { width: 100%; padding: 13px 20px; }
.primary-btn:disabled { opacity: .6; cursor: not-allowed; box-shadow: none; }

.ghost-btn {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  font-size: 13px; font-weight: 500; padding: 8px 14px; border-radius: 10px;
  transition: border-color .15s, color .15s, background .15s;
}
.ghost-btn:hover { border-color: #bfdbfe; background: #f8fbff; }
.ghost-btn.danger { color: var(--danger); border-color: #fecaca; }

.link-btn {
  border: 0; background: none; color: var(--muted); font-size: 12.5px;
  padding: 6px 8px; border-radius: 8px; text-decoration: none;
}
.link-btn:hover { color: var(--brand); background: var(--brand-soft); }

.icon-btn {
  border: 0; background: none; color: #94a3b8;
  width: 32px; height: 32px; border-radius: 8px;
  font-size: 15px; line-height: 1; display: inline-grid; place-items: center;
}
.icon-btn:hover { background: var(--line-soft); color: var(--ink); }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.icon-btn.danger:hover { background: #fef2f2; color: var(--danger); }

.brand-mark {
  width: 36px; height: 36px; border-radius: 11px;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  display: grid; place-items: center;
  box-shadow: 0 6px 14px rgba(37, 99, 235, .28); flex: 0 0 auto;
}
.brand-mark svg { width: 18px; height: 18px; fill: #fff; }

.dot { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; display: inline-block; flex: 0 0 auto; }
.dot.on  { background: var(--ok); box-shadow: 0 0 0 3px rgba(34, 197, 94, .16); }
.dot.off { background: #94a3b8; }

/* =====================================================
   访客聊天页
   ===================================================== */
.visitor-page {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(1200px 600px at 10% -10%, #dbeafe 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 110%, #e0f2fe 0%, transparent 55%),
    #f1f5f9;
}

.chat-shell {
  width: min(460px, 100%);
  height: min(820px, calc(100dvh - 48px));
  background: var(--card);
  border-radius: 22px;
  box-shadow: var(--shadow-lg), 0 2px 6px rgba(15, 23, 42, .05);
  display: flex; flex-direction: column; overflow: hidden;
}

.chat-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; background: #fff;
  border-bottom: 1px solid var(--line-soft);
}
.head-text { flex: 1; min-width: 0; }
.agent-name { font-size: 15.5px; font-weight: 700; }
.agent-status { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); margin-top: 3px; }

.announce-bar {
  padding: 9px 18px; background: var(--brand-soft); color: #1e40af;
  font-size: 12.5px; line-height: 1.5; border-bottom: 1px solid #dbeafe;
}

.chat-body {
  flex: 1; overflow-y: auto; padding: 18px; background: #fbfdff;
}

.stage-welcome {
  height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 12px 6px 24px;
}
.welcome-title { font-size: 18px; margin: 16px 0 6px; }
.welcome-text {
  font-size: 14px; color: var(--text); line-height: 1.7;
  max-width: 320px; margin: 0 0 8px;
  background: #fff; border: 1px solid var(--line-soft);
  padding: 14px 18px; border-radius: 16px; box-shadow: var(--shadow-sm);
}
.welcome-offline {
  font-size: 12.5px; color: #b45309; background: #fffbeb;
  border: 1px solid #fde68a; border-radius: 10px;
  padding: 9px 14px; max-width: 320px; line-height: 1.6; margin: 4px 0 0;
}
.start-box { display: flex; gap: 8px; width: 100%; max-width: 340px; margin-top: 22px; }
.start-box input {
  flex: 1; min-width: 0; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; font-size: 14px;
  background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.start-box input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.start-box .primary-btn { border-radius: 12px; padding: 0 18px; }
.welcome-tip { font-size: 11.5px; color: #94a3b8; margin: 18px 0 0; line-height: 1.6; }

.messages { display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 8px; max-width: 84%; align-items: flex-end; }
.msg .bubble {
  padding: 10px 14px; border-radius: 16px; font-size: 14.5px;
  line-height: 1.55; white-space: pre-wrap; word-break: break-word;
}
.msg .time { font-size: 10.5px; color: #94a3b8; margin-bottom: 3px; flex: 0 0 auto; }
.msg.in .bubble {
  background: #fff; border: 1px solid var(--line-soft);
  border-top-left-radius: 6px; box-shadow: var(--shadow-sm); color: var(--ink);
}
.msg.out { margin-left: auto; flex-direction: row-reverse; }
.msg.out .bubble {
  background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff;
  border-top-right-radius: 6px; box-shadow: 0 6px 16px rgba(37, 99, 235, .2);
}
.msg.sys { max-width: 100%; width: 100%; justify-content: center; }
.msg.sys .bubble {
  background: #eef2f7; color: var(--muted);
  font-size: 12px; padding: 5px 12px; border-radius: 999px;
}
.msg .avatar-sm { margin-bottom: 2px; }

.day-divider { text-align: center; font-size: 11px; color: #94a3b8; margin: 4px 0 10px; }

.composer { border-top: 1px solid var(--line-soft); background: #fff; padding: 10px 14px 14px; }
.composer-inner { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea {
  flex: 1; resize: none; border: 1px solid var(--line); border-radius: 14px;
  padding: 11px 14px; font-size: 14.5px; line-height: 1.5;
  max-height: 120px; outline: none; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.composer textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.composer-hint { font-size: 11px; color: #94a3b8; padding: 6px 4px 0; min-height: 14px; }

.send-btn {
  width: 42px; height: 42px; flex: 0 0 auto; border: 0; border-radius: 50%;
  background: var(--brand); display: grid; place-items: center;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .3);
  transition: background .15s, transform .12s;
}
.send-btn:hover { background: var(--brand-dark); }
.send-btn:active { transform: scale(.96); }
.send-btn svg { width: 19px; height: 19px; fill: #fff; }
.send-btn:disabled { background: #cbd5e1; box-shadow: none; cursor: not-allowed; }

/* =====================================================
   登录 / 安装
   ===================================================== */
.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100dvh; padding: 24px;
  background:
    radial-gradient(1000px 500px at 15% 0%, #dbeafe 0%, transparent 60%),
    radial-gradient(800px 400px at 100% 100%, #e0f2fe 0%, transparent 55%),
    #f1f5f9;
}
.login-card {
  width: min(400px, 100%); background: #fff; border-radius: 22px;
  padding: 32px 30px 26px; box-shadow: var(--shadow-lg);
}
.login-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 26px; }
.login-brand h1 { font-size: 18px; margin: 0 0 3px; }
.login-brand p { margin: 0; font-size: 12.5px; color: var(--muted); }
.login-foot { text-align: center; font-size: 11.5px; color: #94a3b8; margin: 18px 0 0; line-height: 1.7; }

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); margin-bottom: 7px; }
.field input[type="text"], .field input[type="password"], .field input[type="email"],
.field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: 11px; font-size: 14px; color: var(--ink);
  background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; line-height: 1.55; }
.field input:focus, .field textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}
.field small, .field .hint { display: block; font-size: 11.5px; color: #94a3b8; margin-top: 6px; line-height: 1.5; }
.field .hint.error { color: var(--danger); }

.form-error {
  background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca;
  padding: 10px 12px; border-radius: 9px; font-size: 13px; margin-bottom: 14px;
}
.form-ok {
  background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0;
  padding: 10px 12px; border-radius: 9px; font-size: 13px; margin-bottom: 14px;
}

/* =====================================================
   客服工作台
   ===================================================== */
body.admin-page { background: #eef2f7; overflow: hidden; }

.admin-shell {
  height: 100dvh; display: flex; flex-direction: column;
  padding: 14px; gap: 12px;
}

.admin-top {
  display: flex; align-items: center; gap: 14px; flex: 0 0 auto;
  background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow-sm);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 14.5px; }
.brand-text span { font-size: 11.5px; color: var(--muted); }

.online-chip {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 6px 10px; font-size: 12.5px; color: var(--text);
}
.online-chip:hover { border-color: #bfdbfe; background: #f8fbff; }
.online-chip.is-off { color: var(--muted); background: #f8fafc; }
.caret { width: 14px; height: 14px; fill: none; stroke: #94a3b8; stroke-width: 2; }

.quota { font-size: 12px; color: #94a3b8; }
.quota b { color: var(--ink); font-weight: 600; }

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.admin-main {
  flex: 1; min-height: 0; display: flex; gap: 12px;
}

/* 会话列表 */
.conv-side {
  width: 300px; flex: 0 0 300px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 14px; display: flex; flex-direction: column;
  min-height: 0; overflow: hidden; box-shadow: var(--shadow-sm);
}
.side-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 10px; border-bottom: 1px solid var(--line-soft);
}
.side-head > span { font-size: 13px; font-weight: 600; }
.side-tabs { display: flex; gap: 4px; }
.itab {
  border: 0; background: transparent; color: var(--muted);
  font-size: 12.5px; padding: 6px 10px; border-radius: 8px;
}
.itab.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }

.conv-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.conv-item {
  display: flex; gap: 10px; padding: 11px 10px; border-radius: 11px;
  cursor: pointer; position: relative; transition: background .12s;
}
.conv-item:hover { background: #f8fafc; }
.conv-item.active { background: var(--brand-soft); }
.conv-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: #eff6ff;
  color: var(--brand); display: grid; place-items: center;
  font-size: 14px; font-weight: 600; flex: 0 0 auto;
}
.conv-info { flex: 1; min-width: 0; }
.conv-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.conv-name {
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.conv-time { font-size: 10.5px; color: #94a3b8; flex: 0 0 auto; }
.conv-preview {
  font-size: 12px; color: var(--muted); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 26px;
}
.conv-unread {
  position: absolute; right: 10px; bottom: 12px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: #ef4444; color: #fff;
  font-size: 10.5px; line-height: 18px; text-align: center; font-weight: 600;
}
.list-empty { padding: 40px 20px; text-align: center; font-size: 12.5px; color: #94a3b8; }
.side-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; border-top: 1px solid var(--line-soft);
  font-size: 11.5px; color: #94a3b8;
}
.conn { display: flex; align-items: center; gap: 6px; }

/* 聊天区 */
.chat-pane {
  flex: 1; min-width: 0; background: #fff;
  border: 1px solid var(--line); border-radius: 14px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.chat-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; color: #94a3b8; text-align: center; padding: 24px;
}
.ce-icon {
  width: 64px; height: 64px; border-radius: 20px; background: var(--brand-soft);
  display: grid; place-items: center; margin-bottom: 10px;
}
.ce-icon svg { width: 30px; height: 30px; fill: none; stroke: var(--brand); stroke-width: 1.6; }
.chat-empty p { margin: 0; font-size: 14px; color: var(--text); }
.chat-empty small { font-size: 11.5px; }

.chat-main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.conv-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-bottom: 1px solid var(--line-soft);
  background: #fff;
}
.ch-text { flex: 1; min-width: 0; }
.ch-name { font-size: 15px; font-weight: 700; }
.ch-meta { font-size: 11.5px; color: #94a3b8; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-actions { display: flex; align-items: center; gap: 2px; }

.msg-list {
  flex: 1; overflow-y: auto; padding: 20px 22px 10px;
  display: flex; flex-direction: column; gap: 14px; background: #fbfdff;
}
.msg-list .msg { display: flex; gap: 8px; max-width: 80%; align-items: flex-end; }
.msg-list .msg .bubble {
  padding: 10px 14px; border-radius: 16px; font-size: 14.5px;
  line-height: 1.55; white-space: pre-wrap; word-break: break-word;
}
.msg-list .msg .time { font-size: 10.5px; color: #94a3b8; margin-bottom: 3px; flex: 0 0 auto; }
.msg-list .msg.in .bubble {
  background: #fff; border: 1px solid var(--line-soft);
  border-top-left-radius: 6px; box-shadow: var(--shadow-sm);
}
.msg-list .msg.out { margin-left: auto; flex-direction: row-reverse; }
.msg-list .msg.out .bubble {
  background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff;
  border-top-right-radius: 6px; box-shadow: 0 6px 16px rgba(37, 99, 235, .2);
}
.msg-list .msg.sys { max-width: 100%; width: 100%; justify-content: center; }
.msg-list .msg.sys .bubble {
  background: #eef2f7; color: var(--muted); font-size: 12px;
  padding: 5px 12px; border-radius: 999px;
}

.chat-main .composer { border-top: 1px solid var(--line-soft); background: #fff; padding: 10px 16px 14px; }
.chat-main .composer-inner { display: flex; gap: 8px; align-items: flex-end; }
.chat-main .composer textarea {
  flex: 1; resize: none; border: 1px solid var(--line); border-radius: 14px;
  padding: 11px 14px; font-size: 14.5px; line-height: 1.5;
  max-height: 130px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.chat-main .composer textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.chat-main .composer textarea:disabled { background: var(--line-soft); color: var(--muted); }
.chat-main .composer-hint { font-size: 11px; color: #94a3b8; padding: 6px 4px 0; min-height: 14px; }
.chat-main .composer-hint.error { color: var(--danger); }

.chat-main .send-btn {
  width: 42px; height: 42px; flex: 0 0 auto; border: 0; border-radius: 50%;
  background: var(--brand); display: grid; place-items: center;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .28);
  transition: background .15s, transform .12s;
}
.chat-main .send-btn:hover { background: var(--brand-dark); }
.chat-main .send-btn:active { transform: scale(.96); }
.chat-main .send-btn svg { width: 19px; height: 19px; fill: #fff; }
.chat-main .send-btn:disabled { background: #cbd5e1; box-shadow: none; cursor: not-allowed; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; z-index: 60; background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  width: min(560px, 100%); max-height: 88vh; background: #fff; border-radius: 18px;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-lg);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.modal-head h2 { font-size: 16px; margin: 0; }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line-soft); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input {
  flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 12.5px; color: var(--muted); background: #f8fafc; outline: none;
}
.avatar-upload { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.file-btn { display: inline-flex; align-items: center; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: rgba(15, 23, 42, .94); color: #fff;
  padding: 10px 18px; border-radius: 10px; font-size: 13px;
  z-index: 80; box-shadow: var(--shadow-md);
}

/* -------- 聊天附件（图片 / 视频 / 文档） -------- */
.attach-btn {
  width: 36px; height: 36px; flex: 0 0 auto; border: 0; background: transparent;
  color: #94a3b8; border-radius: 10px; display: grid; place-items: center;
  transition: background .15s, color .15s;
}
.attach-btn:hover { background: var(--brand-soft); color: var(--brand); }
.attach-btn:disabled { opacity: .4; cursor: not-allowed; }
.attach-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* 工作台：发送语言选择（原文 / English / Español / Français / Deutsch / 日本語 / Русский） */
.chat-main .lang-select {
  flex: 0 0 auto; height: 42px; padding: 0 26px 0 12px; border-radius: 12px;
  border: 1px solid #bfdbfe; background-color: #eff6ff; color: #2563eb;
  font-size: 12.5px; font-weight: 600; cursor: pointer; outline: none;
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 12px;
  transition: background-color .15s, border-color .15s;
}
.chat-main .lang-select:hover { background-color: #dbeafe; border-color: #93c5fd; }
.chat-main .lang-select:disabled { opacity: .5; cursor: not-allowed; }

.msg-list .msg .bubble-zh.bubble-en { border-top-color: rgba(255, 255, 255, .28); color: #e6f0ff; }

/* 工作台：访客原文 + 下方中文译文 */
.bubble-text { white-space: pre-wrap; word-break: break-word; }
.bubble-zh {
  display: block; margin-top: 7px; padding-top: 7px;
  border-top: 1px dashed #e2e8f0;
  font-size: 12.5px; line-height: 1.55; color: #64748b;
  white-space: pre-wrap; word-break: break-word;
}
.msg-list .msg.in .bubble-zh { border-top-color: #e6edf7; }

/* 访客页：附件按钮单独一行，放在输入框上方 */
.composer-inner.stacked { flex-direction: column; align-items: stretch; gap: 2px; }
.attach-row { display: flex; align-items: center; gap: 2px; margin-left: -8px; }
.composer-main { display: flex; align-items: flex-end; gap: 8px; }
.composer-main textarea { flex: 1; min-width: 0; }
.attach-row .attach-btn { width: 34px; height: 34px; }

.msg .bubble.attach,
.msg-list .msg .bubble.attach {
  background: none; border: 0; box-shadow: none; padding: 0;
  border-radius: 0;
}
.msg-media img {
  max-width: 230px; max-height: 300px; width: auto; height: auto;
  border-radius: 14px; cursor: zoom-in;
  border: 1px solid var(--line-soft); background: #fff;
}
.msg-video {
  max-width: 250px; max-height: 300px; border-radius: 14px;
  background: #0f172a; display: block;
}
.file-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 13px; text-decoration: none;
  background: #fff; border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); max-width: 260px; color: inherit;
  transition: border-color .15s, background .15s;
}
.file-card:hover { border-color: #bfdbfe; background: #f8fbff; }
.file-icon {
  width: 38px; height: 38px; flex: 0 0 auto; border-radius: 10px;
  background: var(--brand-soft); color: var(--brand);
  font-size: 9.5px; font-weight: 700; letter-spacing: .5px;
  display: grid; place-items: center; text-transform: uppercase;
}
.file-meta { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.file-name {
  font-size: 12.5px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px;
}
.file-size { font-size: 11px; color: #94a3b8; }
.attach-caption {
  display: block; margin-top: 6px; font-size: 12.5px;
  color: var(--text); line-height: 1.5;
}
.msg.out .attach-caption { color: #dbeafe; text-align: right; }

/* 响应式 */
@media (max-width: 860px) {
  .admin-shell { padding: 8px; gap: 8px; }
  .conv-side { width: 240px; flex-basis: 240px; }
  .quota { display: none; }
  .brand-text span { display: none; }
}
@media (max-width: 640px) {
  .admin-main { flex-direction: column; }
  .conv-side { width: auto; flex: 0 0 auto; max-height: 34vh; }
  .chat-pane { flex: 1; }
  .admin-top { flex-wrap: wrap; }
  .visitor-page { padding: 0; }
  .chat-shell { width: 100%; height: 100dvh; border-radius: 0; }
  .start-box { max-width: none; }
  .grid-2 { grid-template-columns: 1fr; }
}
