:root {
  --bg: #eef2f8;
  --panel: #ffffff;
  --panel-2: #f6f8fc;
  --text: #1f2a44;
  --text-2: #566078;
  --muted: #8993a8;
  --line: #e6ebf4;
  --line-strong: #d8e0ee;
  --primary: #2f7ee6;
  --primary-2: #5b9bf5;
  --primary-soft: #eaf2ff;
  --green: #22b573;
  --green-soft: #e8f8f1;
  --danger: #e5484d;
  --danger-soft: #fdecec;
  --warn: #d68a00;
  --warn-soft: #fff6e5;
  --shadow: 0 10px 30px rgba(38, 61, 102, 0.07);
  --shadow-lg: 0 24px 70px rgba(28, 48, 85, 0.18);
  --radius: 18px;
  --radius-sm: 12px;
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.mobile-only { display: none !important; }
.spacer { flex: 1; }
.version {
  font-size: 11px;
  color: var(--muted);
  background: #f1f4fa;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 7px;
  font-weight: 600;
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: #b7c1d2; display: inline-block; }
.dot.online { background: var(--green); box-shadow: 0 0 0 4px rgba(34, 181, 115, 0.12); }
.dot.offline { background: #b7c1d2; }

/* buttons */
.btn {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 600;
  transition: 0.16s ease;
}
.btn:hover { border-color: #b9c8e2; background: #fbfdff; }
.btn.primary {
  border: none;
  color: #fff;
  background: linear-gradient(135deg, #3d86ee, #2f6fe0);
  box-shadow: 0 8px 18px rgba(47, 126, 230, 0.22);
}
.btn.primary:hover { filter: brightness(1.04); }
.btn.danger { color: var(--danger); border-color: #f2c4c6; background: #fff; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--primary); }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.mini-btn {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text-2);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: 0.15s ease;
}
.mini-btn:hover { border-color: #b9c8e2; color: var(--text); }
.mini-btn.primary { color: var(--primary); border-color: #cfe0fb; background: #f6faff; }
.mini-btn.danger { color: var(--danger); border-color: #f0cccd; background: #fffafa; }
.mini-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.icon-btn {
  border: none; background: transparent; color: var(--muted); font-size: 20px; line-height: 1;
  width: 34px; height: 34px; border-radius: 10px;
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.link-btn { border: none; background: transparent; color: var(--primary); font-size: 13px; padding: 6px; }
.link-btn:hover { text-decoration: underline; }

/* login */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(700px 420px at 8% 0%, rgba(120, 162, 255, 0.28), transparent 60%),
    radial-gradient(600px 500px at 100% 100%, rgba(126, 205, 255, 0.24), transparent 60%),
    linear-gradient(150deg, #eef3fb, #e9eef8 60%, #f6f8fc);
}
.login-card {
  width: 100%;
  max-width: 460px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  padding: 34px 36px 22px;
  backdrop-filter: blur(16px);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.login-brand img { border-radius: 12px; }
.login-brand h1 { font-size: 22px; margin: 0; letter-spacing: 0.5px; }
.login-brand .version { display: inline-block; margin-top: 3px; }
.login-card h2 { font-size: 17px; margin: 0 0 8px; }
.login-hint { font-size: 12.5px; color: var(--muted); line-height: 1.7; margin: 0 0 20px; }
.login-card label, .field label { display: block; font-size: 12.5px; color: var(--text-2); font-weight: 600; margin: 12px 0 7px; }
.login-card input, .field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  font-size: 14px;
  transition: 0.15s ease;
}
.login-card input:focus, .field input:focus, .field select:focus, .field textarea:focus {
  border-color: #8db8f5;
  box-shadow: 0 0 0 4px rgba(47, 126, 230, 0.1);
}
.login-card .btn { margin-top: 16px; }
.login-card .link-btn { display: block; margin: 14px auto 4px; }
.login-foot { text-align: center; color: #a8b2c4; font-size: 11px; margin-top: 16px; }

/* topbar */
.app { height: 100vh; padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.topbar {
  height: 56px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid rgba(230, 235, 244, 0.8);
  border-radius: 16px;
  padding: 0 14px;
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; }
.brand img { border-radius: 9px; }
.conn { display: flex; align-items: center; gap: 7px; margin-left: 8px; font-size: 11.5px; color: var(--text-2); background: #f5f8fd; padding: 5px 10px; border-radius: 999px; }
.conn .dot.online + span { color: #16a169; }
.expiry-chip {
  font-size: 12px;
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid #f3dca6;
  padding: 6px 11px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}
.expiry-chip.ok { color: #16875f; background: var(--green-soft); border-color: #c3ebd9; }
.expiry-chip.danger { color: var(--danger); background: var(--danger-soft); border-color: #f4c6c7; }
.top-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 10px;
  white-space: nowrap;
}
.top-btn:hover { background: var(--panel-2); color: var(--text); }
.top-btn.alert-on { color: var(--primary); background: var(--primary-soft); }
#callAlertBtn.blocked { color: var(--warn); }

/* workspace */
.workspace { flex: 1; min-height: 0; display: flex; gap: 14px; }
.panel {
  background: var(--panel);
  border: 1px solid rgba(230, 235, 244, 0.85);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-height: 0;
}
.sidebar { width: 300px; flex: none; display: flex; flex-direction: column; overflow: hidden; }
.sidebar-head { padding: 14px 14px 10px; border-bottom: 1px solid var(--line); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat {
  border: 1px solid var(--line);
  background: #fbfcff;
  border-radius: 12px;
  padding: 9px 4px 7px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
}
.stat:hover { border-color: #cfdaee; }
.stat.active { background: var(--primary-soft); border-color: #c9ddfa; }
.stat b { display: block; color: var(--text); font-size: 17px; line-height: 1.2; }
.stat.active b { color: var(--primary); }
.group-filter-row { display: flex; gap: 8px; margin-top: 10px; }
.group-filter-row select {
  flex: 1; min-width: 0; border: 1px solid var(--line-strong); background: #fff;
  border-radius: 10px; padding: 8px 10px; outline: none; font-size: 12.5px; color: var(--text-2);
}
.group-filter-row button {
  border: 1px solid var(--line-strong); background: #fff; border-radius: 10px; padding: 0 11px;
  font-size: 12px; color: var(--text-2); font-weight: 600;
}
.group-filter-row button:hover { border-color: #b9c8e2; }
.search {
  width: 100%; margin-top: 10px; border: 1px solid var(--line-strong); background: #f8fafd;
  border-radius: 10px; padding: 9px 12px; font-size: 12.5px; outline: none;
}
.search:focus { background: #fff; border-color: #8db8f5; }
.conversation-list { flex: 1; overflow-y: auto; padding: 6px; }
.list-empty { padding: 36px 16px; text-align: center; color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.conv-item {
  display: flex; gap: 10px; padding: 11px 10px; border-radius: 13px; width: 100%;
  border: 1px solid transparent; background: transparent; text-align: left; position: relative;
}
.conv-item:hover { background: #f8faff; }
.conv-item.active { background: #f2f7ff; border-color: #dce9fd; }
.conv-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: linear-gradient(145deg, #eef4ff, #e1ebfb); color: var(--primary);
  font-weight: 700; font-size: 13px; position: relative;
}
.conv-avatar .online-dot {
  position: absolute; right: 0; bottom: 1px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--green); border: 2px solid #fff;
}
.conv-main { flex: 1; min-width: 0; }
.conv-line1 { display: flex; align-items: center; gap: 6px; }
.conv-name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { margin-left: auto; font-size: 10.5px; color: var(--muted); flex: none; }
.conv-line2 { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.conv-preview { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.unread-badge {
  min-width: 17px; height: 17px; border-radius: 9px; background: #ff5c5c; color: #fff;
  font-size: 10px; display: grid; place-items: center; padding: 0 5px; font-weight: 700;
}
.closed-tag { font-size: 10px; color: var(--muted); background: #f1f3f8; border-radius: 999px; padding: 1px 7px; }
.group-tag { font-size: 10px; padding: 1px 6px; border-radius: 999px; background: #eef4ff; color: var(--primary); max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-empty-line { font-size: 11px; color: #a1aabd; margin-top: 4px; }

/* chat */
.chat { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.chat-head {
  height: 66px; flex: none; display: flex; align-items: center; gap: 10px;
  padding: 0 16px; border-bottom: 1px solid var(--line);
}
.back-btn { display: none; }
.chat-title {
  border: none; background: transparent; text-align: left; padding: 4px 0; min-width: 0; flex: 1;
  border-radius: 8px;
}
.chat-title:hover { background: #fafcff; }
.chat-title b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-title span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.chat-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.message-list {
  flex: 1; overflow-y: auto; padding: 20px 22px; background:
    radial-gradient(600px 300px at 100% 0%, rgba(228, 238, 255, 0.55), transparent 60%),
    #f7f9fd;
  display: flex; flex-direction: column; gap: 4px;
}
.chat-placeholder { margin: auto; color: var(--muted); font-size: 13px; }
.date-sep { align-self: center; font-size: 10.5px; color: #9aa5ba; background: rgba(255,255,255,0.9); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; margin: 10px 0 6px; }
.msg-row { display: flex; gap: 9px; margin: 5px 0; max-width: 82%; align-self: flex-start; }
.msg-row.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar { width: 30px; height: 30px; border-radius: 50%; flex: none; background: #edf2fb; display: grid; place-items: center; color: var(--primary); font-size: 11px; font-weight: 700; overflow: hidden; }
.msg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.msg-content { min-width: 0; }
.msg-bubble {
  background: #fff; border: 1px solid #edf0f6; border-radius: 4px 14px 14px 14px;
  padding: 10px 13px; font-size: 13.5px; line-height: 1.65; word-break: break-word;
  box-shadow: 0 4px 12px rgba(31, 50, 84, 0.04); white-space: pre-wrap;
}
.msg-row.mine .msg-bubble {
  background: linear-gradient(135deg, #4a77f0, #5b8bf5); color: #fff; border: none;
  border-radius: 14px 4px 14px 14px; box-shadow: 0 6px 16px rgba(74, 119, 240, 0.2);
}
.msg-row.system { align-self: center; max-width: 92%; }
.msg-row.system .msg-bubble { background: #eef1f7; color: #7b859a; font-size: 11.5px; border-radius: 999px; padding: 5px 12px; box-shadow: none; border: none; }
.msg-row.system .msg-avatar { display: none; }
.msg-meta { font-size: 10px; color: #9aa5ba; margin-top: 4px; display: flex; gap: 6px; align-items: center; }
.msg-row.mine .msg-meta { justify-content: flex-end; }
.msg-meta .auto-tag { color: var(--primary); }
.msg-meta .unread-tag { color: var(--warn); }
.msg-meta .delete-msg { border: none; background: transparent; color: #a0a9bb; font-size: 10px; padding: 0 2px; cursor: pointer; }
.msg-meta .delete-msg:hover { color: var(--danger); }
.msg-image-grid { display: grid; gap: 4px; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 340px; }
.msg-image-grid.single { grid-template-columns: 1fr; }
.msg-image-grid img { width: 100%; max-height: 260px; object-fit: cover; border-radius: 11px; cursor: pointer; display: block; border: 1px solid #e9eef7; }
.msg-row.mine .msg-image-grid img { border-color: rgba(255,255,255,0.22); }
.msg-video { max-width: 360px; }
.msg-video video { width: 100%; border-radius: 11px; display: block; background: #000; max-height: 300px; }
.msg-voice { display: flex; align-items: center; gap: 8px; min-width: 170px; }
.msg-voice audio { height: 30px; max-width: 220px; }
.msg-file {
  display: flex; align-items: center; gap: 10px; min-width: 220px; text-decoration: none; color: inherit;
}
.msg-file + .msg-file { margin-top: 8px; }
.msg-file .file-icon { width: 38px; height: 42px; border-radius: 8px; background: #eef4ff; color: var(--primary); display: grid; place-items: center; font-size: 10px; font-weight: 800; flex: none; }
.msg-row.mine .msg-file + .msg-file { margin-top: 8px; }
.msg-file .file-icon { background: rgba(255,255,255,0.2); color: #fff; }
.msg-file > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.msg-file .file-name { display: block; font-weight: 600; font-size: 12.5px; line-height: 1.4; word-break: break-all; }
.msg-file .file-size { display: block; color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.msg-row.mine .msg-file .file-size { color: rgba(255,255,255,0.75); }
.msg-call { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.msg-call .call-icon { width: 34px; height: 34px; border-radius: 50%; background: #e8f8f1; color: #16a169; display: grid; place-items: center; }
.msg-call.missed .call-icon { background: #fdecec; color: var(--danger); }
.msg-call .call-title { font-weight: 600; font-size: 12.5px; }
.msg-call .call-sub { color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.msg-row.mine .msg-call .call-sub { color: rgba(255,255,255,0.75); }
.msg-recalled { color: #98a2b5; font-style: italic; }

.composer { flex: none; border-top: 1px solid var(--line); background: #fff; padding: 10px 14px 12px; }
.composer-tools { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.tool-btn {
  border: 1px solid var(--line); background: #fbfcff; color: var(--text-2); border-radius: 9px;
  padding: 6px 10px; font-size: 11.5px;
}
.tool-btn:hover { border-color: #bcd0ee; color: var(--primary); }
.tool-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.upload-status { margin-bottom: 8px; padding: 8px 10px; background: #f5f9ff; border: 1px solid #dce9fd; border-radius: 10px; }
.upload-status-head { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-2); }
.upload-track { height: 4px; border-radius: 2px; background: #e3ebf8; margin-top: 6px; overflow: hidden; }
.upload-track span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #4a8ff5, #2f7ee6); transition: width 0.2s; }
.compose-row { display: flex; gap: 10px; align-items: flex-end; }
.compose-row textarea {
  flex: 1; resize: none; border: 1px solid var(--line-strong); background: #f8fafd; border-radius: 12px;
  padding: 10px 14px; min-height: 46px; max-height: 120px; outline: none; font-size: 13.5px; line-height: 1.5;
}
.compose-row textarea:focus { background: #fff; border-color: #8db8f5; }
.send-btn {
  border: none; border-radius: 12px; padding: 0 22px; height: 44px; color: #fff; font-weight: 700;
  background: linear-gradient(135deg, #4a8ff5, #2f6fe0); box-shadow: 0 8px 18px rgba(47, 126, 230, 0.22);
}
.send-btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

/* tools */
.tools { width: 340px; flex: none; display: flex; flex-direction: column; overflow: hidden; }
.tools-head { padding: 14px 16px 8px; display: flex; align-items: baseline; gap: 8px; }
.tools-head b { font-size: 14px; }
.tools-head span { font-size: 10.5px; color: var(--muted); flex: 1; }
.tools-head .icon-btn { margin-left: auto; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 6px 12px 10px; }
.tab {
  border: 1px solid var(--line); background: #fbfcff; color: var(--text-2); border-radius: 9px;
  padding: 7px 4px; font-size: 11.5px; font-weight: 600;
}
.tab:hover { border-color: #c6d8f2; }
.tab.active { background: var(--primary-soft); border-color: #c9ddfa; color: var(--primary); }
.tool-body { flex: 1; overflow-y: auto; padding: 4px 14px 20px; font-size: 12.5px; }
.tool-body h3 { font-size: 14px; margin: 14px 0 4px; }
.tool-body h4 { font-size: 12.5px; margin: 16px 0 8px; color: var(--text-2); }
.tool-hint { color: var(--muted); font-size: 11px; line-height: 1.65; margin: 4px 0 10px; }
.section-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin: 10px 0; background: #fdfefe; }
.section-card h4 { margin: 0 0 6px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.field { margin: 10px 0; }
.field label { margin-top: 0; }
.field textarea { min-height: 66px; resize: vertical; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; min-width: 0; }
.switch-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; }
.switch-row .switch-label { flex: 1; font-weight: 600; font-size: 12.5px; }
.switch-row .switch-sub { color: var(--muted); font-size: 10.5px; font-weight: 400; margin-top: 2px; }
.switch { position: relative; width: 40px; height: 23px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #d8e0ee; transition: 0.18s; pointer-events: none; }
.switch span:after { content: ""; position: absolute; width: 17px; height: 17px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.15); transition: 0.18s; }
.switch input:checked + span { background: #2f7ee6; }
.switch input:checked + span:after { transform: translateX(17px); }
.pill-group { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  border: 1px solid var(--line-strong); background: #fff; color: var(--text-2); border-radius: 9px;
  padding: 7px 10px; font-size: 11.5px;
}
.pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.quick-item { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin: 8px 0; background: #fff; }
.quick-item .q-main { flex: 1; min-width: 0; }
.quick-item b { display: block; font-size: 12.5px; }
.quick-item p { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; white-space: pre-wrap; }
.quick-item button { border: none; background: transparent; color: #a0a9bb; font-size: 11px; }
.quick-item button:hover { color: var(--danger); }
.rule-card { border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin: 8px 0; background: #fff; }
.rule-head { display: flex; align-items: center; gap: 8px; }
.rule-head b { flex: 1; font-size: 12px; }
.rule-card .thumb { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); }
.thumb-empty { width: 42px; height: 42px; border-radius: 8px; border: 1px dashed var(--line-strong); display: grid; place-items: center; color: var(--muted); font-size: 10px; }
.img-pick { display: flex; gap: 8px; align-items: center; }
.img-pick .preview { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-2); margin: 8px 0; }
.check-line input { accent-color: var(--primary); }
.save-bar { position: sticky; bottom: -20px; background: linear-gradient(180deg, rgba(255,255,255,0), #fff 30%); padding: 12px 0 4px; margin-top: 10px; }
.btn.small { padding: 7px 12px; font-size: 11.5px; border-radius: 9px; }
.group-item { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 11px; padding: 9px 10px; margin: 7px 0; background: #fff; }
.group-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.group-item .g-name { flex: 1; font-weight: 600; font-size: 12px; }
.group-item .g-count { color: var(--muted); font-size: 10.5px; }
.group-item button { border: none; background: transparent; color: #a0a9bb; font-size: 11px; }
.group-item button:hover { color: var(--danger); }
.announcement-item { border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; margin: 8px 0; background: #fff; }
.announcement-item .a-meta { font-size: 10px; color: var(--muted); display: flex; gap: 6px; margin-bottom: 4px; }
.announcement-item .a-title { font-weight: 700; font-size: 12.5px; display: flex; gap: 6px; align-items: center; }
.announcement-item .a-body { color: var(--text-2); font-size: 11.5px; line-height: 1.7; margin-top: 6px; white-space: pre-wrap; max-height: 82px; overflow: hidden; }
.announcement-item.expanded .a-body { max-height: none; }
.announcement-item .a-actions { display: flex; gap: 10px; margin-top: 6px; }
.announcement-item .a-actions button { border: none; background: transparent; color: var(--primary); font-size: 11px; padding: 0; }
.announcement-item .unread-mark { width: 6px; height: 6px; background: #ff5c5c; border-radius: 50%; display: inline-block; }
.feature-list { margin: 0; padding-left: 16px; color: var(--text-2); font-size: 11.5px; line-height: 1.9; }
.brand-summary { display: flex; gap: 12px; align-items: center; }
.brand-summary img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); }
.brand-summary .bs-main { flex: 1; }
.brand-summary b { font-size: 13px; display: block; }
.brand-summary span { font-size: 11px; color: var(--muted); }
.link-box { background: #f7faff; border: 1px dashed #c8daf6; border-radius: 10px; padding: 10px 12px; font-size: 11.5px; color: var(--primary); word-break: break-all; line-height: 1.6; }
.qr-wrap { display: flex; justify-content: center; padding: 12px 0 4px; }
.qr-wrap img, .qr-wrap canvas { width: 168px; height: 168px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.template-card { border: 1px solid #cfe0fb; border-radius: 12px; padding: 11px; background: #f8fbff; margin: 8px 0; }
.template-card .t-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; }
.template-card .t-meta { color: var(--muted); font-size: 10.5px; margin-top: 4px; line-height: 1.6; }
.badge { display: inline-block; font-size: 10px; border-radius: 999px; padding: 2px 7px; background: #eef4ff; color: var(--primary); }

/* visitor panel */
.visitor-panel { position: relative; width: 340px; flex: none; display: flex; flex-direction: column; overflow: hidden; }
.visitor-body { flex: 1; overflow-y: auto; padding: 4px 16px 20px; }
.visitor-hero { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.visitor-hero .vh-avatar { width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(145deg, #eef4ff, #dce8fb); color: var(--primary); display: grid; place-items: center; font-weight: 800; }
.visitor-hero b { display: block; font-size: 14px; }
.visitor-hero span { font-size: 11px; color: var(--muted); }
.info-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed #eef1f7; font-size: 11.5px; }
.info-row .k { color: var(--muted); flex: none; }
.info-row .v { color: var(--text-2); text-align: right; word-break: break-all; }
.net-quality { font-weight: 600; color: var(--green); }
.net-quality.bad { color: var(--warn); }

/* modal */
.modal-root { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(21, 33, 56, 0.42); backdrop-filter: blur(4px); }
.modal-card {
  position: relative; width: min(94vw, 560px); max-height: 90vh; overflow: auto; background: #fff;
  border-radius: 20px; box-shadow: var(--shadow-lg); padding: 22px 24px;
  animation: pop 0.18s ease;
}
.modal-card.wide { width: min(94vw, 760px); }
.modal-card.xwide { width: min(96vw, 1080px); padding: 0; overflow: hidden; }
@keyframes pop { from { transform: translateY(8px) scale(0.985); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.65; }
.modal-head .icon-btn { margin-left: auto; }
.modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.modal-note { background: #f7faff; border: 1px solid #dfeafb; color: var(--text-2); border-radius: 10px; padding: 9px 11px; font-size: 11px; line-height: 1.7; }
.modal-error { color: var(--danger); font-size: 11.5px; min-height: 16px; margin-top: 8px; }
.danger-zone { border: 1px solid #f6cdce; background: #fffafa; border-radius: 14px; padding: 12px; margin-top: 12px; }
.danger-zone h4 { margin: 0 0 4px; color: var(--danger); }
.danger-zone p { margin: 0 0 10px; color: #9b6b6c; font-size: 11px; line-height: 1.6; }

/* brand editor */
.modal-card.nopad { padding: 0; overflow: hidden; }
.brand-editor { display: grid; position: relative; grid-template-columns: 1fr 380px; height: min(88vh, 780px); }
.brand-form { padding: 24px 26px; overflow-y: auto; }
.editor-close { position: absolute; top: 12px; right: 12px; z-index: 5; background: #fff; border: 1px solid var(--line); }
.brand-form h2 { margin: 0 0 4px; font-size: 20px; }
.brand-form .sub { color: var(--muted); font-size: 11.5px; margin-bottom: 10px; }
.brand-preview { background: #eef3fb; padding: 22px; display: flex; flex-direction: column; overflow: hidden; }
.brand-preview .preview-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.preview-phone {
  flex: 1; border-radius: 26px; background: #fff; border: 6px solid #dbe4f2; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(36, 60, 105, 0.13); max-height: 640px;
}
.preview-head { padding: 14px 14px 12px; border-bottom: 1px solid #edf1f8; background: #fff; }
.preview-head.gradient { background: linear-gradient(135deg, #2f7ee6, #5b9bf5); color: #fff; border: none; }
.preview-head.soft { background: linear-gradient(180deg, #f2f7ff, #fff); }
.preview-brandline { display: flex; align-items: center; gap: 8px; }
.preview-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #eef4ff; }
.preview-name { font-weight: 700; font-size: 13px; }
.preview-tag { display: inline-block; font-size: 9px; border: 1px solid #cfe0fb; color: #2f7ee6; border-radius: 999px; padding: 1px 6px; margin-bottom: 2px; }
.preview-status { font-size: 10px; color: #8c96ab; margin-top: 1px; }
.preview-head.gradient .preview-status { color: rgba(255,255,255,0.8); }
.preview-head.gradient .preview-tag { color: #fff; border-color: rgba(255,255,255,0.5); }
.preview-announce { background: #fff8e8; color: #8a6416; font-size: 10px; padding: 7px 10px; border-bottom: 1px solid #f4e3b7; }
.preview-messages { flex: 1; background: #f6f8fc; padding: 12px; overflow: hidden; }
.preview-bubble { background: #fff; border: 1px solid #edf0f6; border-radius: 4px 12px 12px 12px; padding: 9px 10px; font-size: 10.5px; line-height: 1.6; max-width: 88%; box-shadow: 0 4px 10px rgba(31,50,84,0.04); }
.preview-composer { border-top: 1px solid #edf1f8; padding: 9px 10px; display: flex; gap: 6px; align-items: center; background: #fff; }
.preview-input { flex: 1; border: 1px solid #e3e9f3; border-radius: 8px; padding: 7px 9px; color: #a6afc0; font-size: 10px; }
.preview-send { background: #2f7ee6; color: #fff; border-radius: 8px; padding: 7px 11px; font-size: 10px; }
.preview-tools { display: flex; gap: 8px; color: #7c879d; font-size: 12px; padding: 7px 10px 0; background: #fff; }
.preview-brand { margin-left: auto; display: flex; align-items: center; gap: 4px; color: #2f7ee6; font-size: 10px; font-weight: 700; }
.preview-brand img { height: 18px; max-width: 90px; object-fit: contain; }
.theme-swatch { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: #fff; border-radius: 999px; padding: 5px 10px 5px 6px; font-size: 11px; color: var(--text-2); }
.swatch i { width: 16px; height: 16px; border-radius: 50%; display: block; }
.swatch.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.upload-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.upload-line .hint { color: var(--muted); font-size: 10.5px; }
.avatar-edit { display: flex; align-items: center; gap: 12px; }
.avatar-edit img { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }

/* bulk send */
.bulk-layout { display: grid; grid-template-columns: 1.1fr 1fr; gap: 14px; align-items: start; }
.bulk-layout > div { min-width: 0; }
.bulk-list { max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.bulk-item { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 8px; font-size: 12px; }
.bulk-item:hover { background: #f8fbff; }
.bulk-item input { accent-color: var(--primary); }
.bulk-item .status { margin-left: auto; font-size: 10px; color: var(--muted); }
.drop-zone {
  display: block; width: 100%; min-height: 108px; box-sizing: border-box;
  border: 1px dashed #b9ccec; background: #f8fbff; border-radius: 12px;
  padding: 22px 16px; text-align: center; color: var(--muted); font-size: 11.5px;
  line-height: 1.8; cursor: pointer;
}
.drop-zone b { display: block; color: var(--text); font-size: 12.5px; margin-bottom: 5px; }
.drop-zone:hover { border-color: var(--primary); color: var(--primary); }
.file-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.file-chip { background: #f1f5fc; border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px; font-size: 10.5px; display: flex; gap: 5px; align-items: center; }
.file-chip button { border: none; background: transparent; color: #a0a9bb; padding: 0; }

/* qr modal */
.qr-modal { display: grid; grid-template-columns: 260px 1fr; gap: 20px; }
.qr-preview { background: #f7f9fd; border-radius: 14px; padding: 16px; display: grid; place-items: center; }
.qr-preview canvas { max-width: 220px; width: 100%; height: auto; border-radius: 8px; background: #fff; }
.qr-settings .field textarea { min-height: 54px; }

/* call */
.call-overlay { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(14, 22, 40, 0.62); backdrop-filter: blur(8px); padding: 20px; }
.call-card {
  width: min(92vw, 420px); background: linear-gradient(170deg, #1f2c4a, #111a2e); color: #fff;
  border-radius: 26px; padding: 30px 24px 24px; text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,0.4);
  position: relative; overflow: hidden;
}
.call-avatar-wrap { width: 82px; height: 82px; margin: 0 auto 18px; position: relative; }
.call-avatar { width: 82px; height: 82px; border-radius: 50%; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18); display: grid; place-items: center; font-size: 30px; }
.call-live-dot { position: absolute; right: 4px; bottom: 4px; width: 14px; height: 14px; border-radius: 50%; background: #2ed184; border: 3px solid #18233c; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(46,209,132,0.12); } }
.call-kicker { font-size: 10px; letter-spacing: 2px; color: rgba(255,255,255,0.45); text-transform: uppercase; }
.call-card h3 { margin: 8px 0 4px; font-size: 20px; }
.call-status { color: rgba(255,255,255,0.68); font-size: 12.5px; margin: 0 0 8px; min-height: 18px; }
.call-duration { font-size: 24px; font-weight: 300; letter-spacing: 2px; margin: 8px 0; font-variant-numeric: tabular-nums; }
.call-security { font-size: 10px; color: rgba(255,255,255,0.4); margin-bottom: 14px; }
.call-video-stage { position: relative; border-radius: 16px; overflow: hidden; background: #000; margin: 10px 0 16px; aspect-ratio: 3 / 4; }
.call-remote-video { width: 100%; height: 100%; object-fit: cover; }
.call-local-video { position: absolute; right: 10px; bottom: 10px; width: 84px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.35); background: #111; }
.call-incoming-actions { display: flex; justify-content: center; gap: 50px; margin-top: 20px; }
.call-round { border: none; background: transparent; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 10px; }
.call-round span { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; }
.call-round.reject span { background: #e5484d; }
.call-round.accept span { background: #22b573; }
.call-enable-media { display:block; width:100%; border:none; border-radius:12px; padding:10px 12px; margin:0 0 12px; color:#fff; background:linear-gradient(135deg,var(--v-primary,#2f7ee6),var(--v-primary-2,#5b9bf5)); font-size:11.5px; font-weight:700; box-shadow:0 8px 18px rgba(47,126,230,.25); }
.call-controls { display: flex; justify-content: center; gap: 16px; margin-top: 18px; flex-wrap: wrap; }
.call-control { border: none; background: transparent; color: rgba(255,255,255,0.85); display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 9.5px; }
.call-control span { width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,0.1); display: grid; place-items: center; font-size: 18px; }
.call-control.danger span { background: #e5484d; }

/* image overlay */
.image-overlay { position: fixed; inset: 0; z-index: 95; background: rgba(9, 15, 27, 0.92); display: flex; align-items: center; justify-content: center; padding: 30px; }
.image-overlay img, .image-overlay video { max-width: 94vw; max-height: 88vh; border-radius: 12px; }
.image-overlay video { display: none; }
.image-overlay.video img { display: none; }
.image-overlay.video video { display: block; }
.overlay-close { position: absolute; top: 16px; right: 20px; border: none; background: rgba(255,255,255,0.12); color: #fff; font-size: 24px; width: 42px; height: 42px; border-radius: 50%; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 14px); z-index: 120;
  background: rgba(25, 36, 58, 0.94); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 12.5px; opacity: 0; pointer-events: none; transition: 0.22s ease; max-width: 80vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: rgba(190, 48, 55, 0.96); }

/* misc */
.empty-state { padding: 40px 16px; text-align: center; color: var(--muted); font-size: 12px; line-height: 1.8; }
.loading-line { padding: 20px; text-align: center; color: var(--muted); font-size: 12px; }
.kbd { background: #f1f4fa; border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; font-size: 10px; }

@media (max-width: 1280px) {
  .tools, .visitor-panel { width: 310px; }
}
@media (max-width: 1120px) {
  .workspace { gap: 10px; }
  .sidebar { width: 270px; }
  .tools, .visitor-panel { width: 292px; }
  .brand .version { display: none; }
}
@media (max-width: 980px) {
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 16px !important; }
  .app { padding: 10px; gap: 10px; }
  .topbar { height: auto; min-height: 52px; flex-wrap: wrap; padding: 9px 10px; }
  .conn { display: none; }
  .top-btn { padding: 7px 8px; font-size: 12px; }
  .expiry-chip { font-size: 10.5px; padding: 5px 8px; }
  .workspace { position: relative; }
  .sidebar { width: 100%; }
  .chat { display: none; width: 100%; }
  .workspace.chat-open .sidebar { display: none; }
  .workspace.chat-open .chat { display: flex; }
  .workspace.chat-open .tools, .workspace.chat-open .visitor-panel { display: none; }
  .tools, .visitor-panel {
    position: absolute; z-index: 30; inset: 0; width: 100%; border-radius: var(--radius);
    display: none;
  }
  .tools.open, .visitor-panel.open { display: flex; }
  .back-btn { display: inline-block; }
  .chat-actions .mini-btn { padding: 7px 8px; font-size: 11px; }
  .mobile-only { display: inline-flex !important; }
  .message-list { padding: 14px 12px; }
  .msg-row { max-width: 90%; }
  .brand-form { padding: 18px; }
  .brand-editor { grid-template-columns: 1fr; height: auto; max-height: 88vh; overflow-y: auto; }
  .brand-preview { min-height: 520px; }
  .qr-modal { grid-template-columns: 1fr; }
  .bulk-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .app { padding: 0; gap: 0; height: 100dvh; }
  .topbar { border-radius: 0; border-left: none; border-right: none; border-top: none; box-shadow: none; }
  .brand img { width: 30px; height: 30px; }
  .brand { font-size: 14px; }
  .top-btn { font-size: 11.5px; }
  .panel { border-radius: 0; border-left: none; border-right: none; box-shadow: none; }
  .sidebar, .chat { border-radius: 0; }
  .stats { gap: 6px; }
  .chat-head { height: auto; min-height: 56px; flex-wrap: wrap; padding: 8px 10px; row-gap: 6px; }
  .chat-title { flex: 1 1 55%; }
  .chat-actions { order: 4; width: 100%; justify-content: flex-end; gap: 5px; }
  .chat-actions .mini-btn { padding: 7px 9px; font-size: 11px; }
  .chat-actions .mini-btn:nth-child(3) { display: inline-block; }
  .composer { padding: 8px 10px 10px; }
  .send-btn { padding: 0 16px; }
  .login-card { padding: 26px 22px 18px; border-radius: 20px; }
  .modal-card { padding: 18px; border-radius: 16px; }
  .modal-card.xwide { border-radius: 14px; }
}

/* 手机端通话窗口：限制高度，避免超出屏幕 */
@media (max-width: 640px), (max-height: 720px) {
  .call-overlay { padding: 8px; }
  .call-card {
    width: min(96vw, 380px);
    max-height: calc(100dvh - 16px);
    overflow-y: auto;
    padding: 18px 14px 16px;
    border-radius: 22px;
  }
  .call-avatar-wrap { width: 64px; height: 64px; margin: 0 auto 10px; }
  .call-avatar { width: 64px; height: 64px; font-size: 24px; }
  .call-kicker { font-size: 8px; letter-spacing: 1.5px; }
  .call-card h3 { font-size: 18px; margin: 5px 0 2px; }
  .call-status { font-size: 11.5px; margin-bottom: 4px; }
  .call-duration { font-size: 20px; margin: 4px 0; }
  .call-security { font-size: 9px; margin-bottom: 8px; }
  .call-video-stage { height: min(40dvh, 300px); aspect-ratio: auto; margin: 6px 0 10px; }
  .call-local-video { width: 62px; right: 6px; bottom: 6px; }
  .call-incoming-actions { gap: 38px; margin-top: 10px; }
  .call-round span { width: 48px; height: 48px; font-size: 19px; }
  .call-controls { gap: 10px; margin-top: 10px; }
  .call-control span { width: 40px; height: 40px; font-size: 16px; }
  .call-enable-media { margin-bottom: 8px; padding: 8px 10px; font-size: 10.5px; }
}

/* ===== 全屏通话：视频铺满、语音大屏，不超出手机屏幕 ===== */
.call-overlay, .call-dialog {
  padding: 0 !important;
  background: #0b1220 !important;
}
.call-overlay .call-card, .call-dialog .call-card {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: 100dvh;
  border-radius: 0;
  padding: calc(22px + env(safe-area-inset-top)) 18px calc(20px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(600px 480px at 50% 0%, rgba(74, 112, 180, 0.5), transparent 70%),
    linear-gradient(165deg, #223552, #0b1220 75%);
}
.call-overlay .call-card > *, .call-dialog .call-card > * { position: relative; z-index: 2; }
.call-overlay .call-card .call-avatar-wrap, .call-dialog .call-card .call-avatar-wrap {
  width: 96px; height: 96px; margin: auto auto 18px;
}
.call-overlay .call-card .call-avatar, .call-dialog .call-card .call-avatar {
  width: 96px; height: 96px; font-size: 34px; background: rgba(255,255,255,0.1);
}
.call-overlay .call-card h3, .call-dialog .call-card h2 { font-size: 24px; margin: 0 0 6px; color: #fff; }
.call-overlay .call-card .call-status, .call-dialog .call-card .call-status,
.call-dialog .call-card #callStatus { font-size: 13px; color: rgba(255,255,255,0.68); margin: 0 0 8px; }
.call-overlay .call-card .call-duration, .call-dialog .call-card .call-duration { font-size: 28px; color: #fff; margin: 4px 0 8px; }
.call-overlay .call-card .call-security, .call-dialog .call-card .call-security { font-size: 10px; color: rgba(255,255,255,0.4); margin-bottom: 10px; }
.call-overlay .call-card .call-controls, .call-dialog .call-card .call-controls {
  margin-top: auto; width: 100%; display: flex; justify-content: center; flex-wrap: wrap;
  gap: 18px; padding-top: 18px; z-index: 3;
}
.call-overlay .call-card .call-control, .call-dialog .call-card .call-control { color: #fff; }
.call-overlay .call-card .call-control span, .call-dialog .call-card .call-control span {
  width: 54px; height: 54px; background: rgba(255,255,255,0.13); font-size: 21px;
}
.call-overlay .call-card .call-control.danger span, .call-dialog .call-card .call-control.danger span { background: #e5484d; }
.call-overlay .call-card .call-incoming-actions, .call-dialog .call-card .call-incoming-actions {
  margin-top: auto; display: flex; justify-content: center; gap: 62px; width: 100%; padding: 24px 0 10px; z-index: 3;
}
.call-overlay .call-card .call-round span, .call-dialog .call-card .call-round span { width: 64px; height: 64px; font-size: 25px; }
.call-overlay .call-card .call-round b, .call-dialog .call-card .call-round b { font-size: 11px; color: #fff; }
.call-overlay .call-card .call-enable-media, .call-dialog .call-card .call-enable-media {
  display: block; width: auto; min-width: 220px; margin: 8px auto 0; padding: 9px 16px;
  font-size: 11.5px; z-index: 4; background: rgba(255,255,255,0.16); box-shadow: none;
  border: 1px solid rgba(255,255,255,0.22); color: #fff;
}
.call-overlay .call-card.audio-mode, .call-dialog .call-card.audio-mode { justify-content: flex-start; }
.call-overlay .call-card.audio-mode .call-avatar-wrap, .call-dialog .call-card.audio-mode .call-avatar-wrap { margin-top: auto; }
.call-overlay .call-card.audio-mode .call-controls, .call-dialog .call-card.audio-mode .call-controls { margin-top: auto; }
.call-overlay .call-card.audio-mode .call-incoming-actions, .call-dialog .call-card.audio-mode .call-incoming-actions { margin-top: auto; }

.call-overlay .call-card.video-mode, .call-dialog .call-card.video-mode {
  padding: 0;
  justify-content: flex-end;
  background: #000;
}
.call-overlay .call-card.video-mode::before, .call-dialog .call-card.video-mode::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 160px; z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,0.7), rgba(0,0,0,0));
}
.call-overlay .call-card.video-mode::after, .call-dialog .call-card.video-mode::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 230px; z-index: 1;
  background: linear-gradient(0deg, rgba(0,0,0,0.75), rgba(0,0,0,0));
}
.call-overlay .call-card.video-mode .call-avatar-wrap,
.call-overlay .call-card.video-mode .call-kicker,
.call-overlay .call-card.video-mode .call-security,
.call-dialog .call-card.video-mode .call-avatar-wrap,
.call-dialog .call-card.video-mode .call-kicker,
.call-dialog .call-card.video-mode .call-security { display: none !important; }
.call-overlay .call-card.video-mode .call-video-stage, .call-dialog .call-card.video-mode .call-video-stage {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; border-radius: 0; aspect-ratio: auto; z-index: 0;
}
.call-overlay .call-card.video-mode .call-remote-video, .call-dialog .call-card.video-mode .call-remote-video {
  width: 100%; height: 100%; object-fit: cover;
}
.call-overlay .call-card.video-mode .call-local-video, .call-dialog .call-card.video-mode .call-local-video {
  position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 14px; bottom: auto;
  width: 100px; height: 136px; border-radius: 12px; object-fit: cover; z-index: 4;
  border: 1px solid rgba(255,255,255,0.35); background: #111;
}
.call-overlay .call-card.video-mode h3, .call-dialog .call-card.video-mode h2 {
  position: absolute; top: calc(18px + env(safe-area-inset-top)); left: 16px; right: 128px;
  margin: 0; font-size: 17px; text-align: left; color: #fff; z-index: 3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.call-overlay .call-card.video-mode .call-status, .call-dialog .call-card.video-mode .call-status,
.call-dialog .call-card.video-mode #callStatus {
  position: absolute; top: calc(46px + env(safe-area-inset-top)); left: 16px; right: 128px;
  margin: 0; font-size: 11.5px; text-align: left; color: rgba(255,255,255,0.75); z-index: 3;
}
.call-overlay .call-card.video-mode .call-duration, .call-dialog .call-card.video-mode .call-duration {
  position: absolute; top: calc(68px + env(safe-area-inset-top)); left: 16px; right: 128px;
  margin: 0; font-size: 20px; text-align: left; color: #fff; z-index: 3;
}
.call-overlay .call-card.video-mode .call-enable-media, .call-dialog .call-card.video-mode .call-enable-media {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(108px + env(safe-area-inset-bottom));
  margin: 0; z-index: 4; background: rgba(0,0,0,0.5);
}
.call-overlay .call-card.video-mode .call-controls, .call-dialog .call-card.video-mode .call-controls {
  position: relative; z-index: 3; padding: 12px 0 calc(8px + env(safe-area-inset-bottom)); margin: 0;
}
.call-overlay .call-card.video-mode .call-incoming-actions, .call-dialog .call-card.video-mode .call-incoming-actions {
  position: relative; z-index: 3; padding: 20px 0 calc(22px + env(safe-area-inset-bottom)); margin: 0;
}
@media (min-width: 768px) {
  .call-overlay .call-card.video-mode .call-local-video, .call-dialog .call-card.video-mode .call-local-video {
    width: 140px; height: 190px; top: 22px; right: 22px;
  }
  .call-overlay .call-card.video-mode .call-controls, .call-dialog .call-card.video-mode .call-controls { gap: 26px; }
}
@media (max-width: 400px) {
  .call-overlay .call-card .call-avatar-wrap, .call-dialog .call-card .call-avatar-wrap { width: 82px; height: 82px; }
  .call-overlay .call-card .call-avatar, .call-dialog .call-card .call-avatar { width: 82px; height: 82px; font-size: 28px; }
  .call-overlay .call-card h3, .call-dialog .call-card h2 { font-size: 21px; }
  .call-overlay .call-card .call-controls, .call-dialog .call-card .call-controls { gap: 12px; }
  .call-overlay .call-card .call-control span, .call-dialog .call-card .call-control span { width: 48px; height: 48px; }
  .call-overlay .call-card .call-incoming-actions, .call-dialog .call-card .call-incoming-actions { gap: 48px; }
  .call-overlay .call-card .call-round span, .call-dialog .call-card .call-round span { width: 58px; height: 58px; }
}

/* ===== 通话最小化 ===== */
.call-minimize {
  position: absolute; top: calc(14px + env(safe-area-inset-top)); left: 14px;
  width: 38px; height: 38px; border-radius: 50%; z-index: 6;
  border: 1px solid rgba(255,255,255,0.25); background: rgba(0,0,0,0.35);
  color: #fff; font-size: 20px; line-height: 1; display: grid; place-items: center;
}
.call-card:not(.video-mode) .call-minimize { background: rgba(255,255,255,0.12); }
.call-overlay.minimized, .call-dialog.minimized { background: transparent !important; pointer-events: none !important; }
.call-overlay.minimized .call-card, .call-dialog.minimized .call-card { opacity: 0 !important; pointer-events: none !important; }
.call-mini-bar {
  position: fixed; right: 14px; bottom: calc(116px + env(safe-area-inset-bottom)); z-index: 75;
  display: flex; align-items: center; gap: 6px; padding: 6px 7px 6px 13px;
  background: rgba(20, 32, 52, 0.95); color: #fff; border-radius: 999px;
  box-shadow: 0 10px 28px rgba(15, 27, 48, 0.28); border: 1px solid rgba(255,255,255,0.12);
}
.call-mini-bar .mini-call-return {
  border: none; background: transparent; color: #fff; display: flex; align-items: center;
  gap: 7px; padding: 0; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.mini-call-dot { width: 8px; height: 8px; border-radius: 50%; background: #2ed184; box-shadow: 0 0 0 4px rgba(46,209,132,0.12); }
.mini-call-hangup { border: none; background: #e5484d; color: #fff; border-radius: 999px; padding: 6px 10px; font-size: 10.5px; font-weight: 600; }
@media (min-width: 981px) {
  .call-mini-bar { bottom: 22px; right: 22px; }
}
@media (max-width: 400px) {
  .call-mini-bar { bottom: calc(110px + env(safe-area-inset-bottom)); right: 10px; }
  .call-mini-bar .mini-call-return { font-size: 11px; }
}
/* 视频模式标题避开左上角最小化按钮 */
.call-overlay .call-card.video-mode h3,
.call-dialog .call-card.video-mode h2,
.call-overlay .call-card.video-mode .call-status,
.call-dialog .call-card.video-mode .call-status,
.call-dialog .call-card.video-mode #callStatus,
.call-overlay .call-card.video-mode .call-duration,
.call-dialog .call-card.video-mode .call-duration { left: 62px; }

/* ===== 最小化：彻底移除遮罩模糊 + 右上角汉字按钮 ===== */
.call-overlay.minimized, .call-dialog.minimized {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  pointer-events: none !important;
}
.call-overlay.minimized .call-card, .call-dialog.minimized .call-card {
  opacity: 0 !important;
  pointer-events: none !important;
}
.call-minimize {
  left: auto !important;
  right: 14px !important;
  top: calc(14px + env(safe-area-inset-top)) !important;
  width: auto !important;
  min-width: 68px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.28);
}
.call-card:not(.video-mode) .call-minimize {
  background: rgba(255, 255, 255, 0.14);
}
/* 视频小窗放到最小化按钮下方，避免重叠 */
.call-overlay .call-card.video-mode .call-local-video,
.call-dialog .call-card.video-mode .call-local-video {
  top: calc(56px + env(safe-area-inset-top));
  right: 14px;
}
@media (min-width: 768px) {
  .call-minimize { right: 22px !important; top: 22px !important; }
  .call-overlay .call-card.video-mode .call-local-video,
  .call-dialog .call-card.video-mode .call-local-video { top: 66px; right: 22px; }
}
/* 修复：全屏卡片直接子元素的 relative 规则覆盖了最小化按钮定位 */
.call-overlay .call-card > .call-minimize,
.call-dialog .call-card > .call-minimize {
  position: absolute !important;
  left: auto !important;
  right: 14px !important;
  top: calc(14px + env(safe-area-inset-top)) !important;
  z-index: 8 !important;
}
@media (min-width: 768px) {
  .call-overlay .call-card > .call-minimize,
  .call-dialog .call-card > .call-minimize { right: 22px !important; top: 22px !important; }
}
