/* TROJIN Desk v0.34 高级色阶层次分区样式（Cici 真人小头像 · WCAG AA 对比度达标 · 0 AI 泛紫 · 0 重度模糊 · 手机/平板纯阿语 RTL 全适配） */
:root {
  --canvas: #e4ebf4;          /* 聊天舞台底色：更明确衬托中间纯净白聊天主卡！ */
  --sidebar-bg: #ecf1f7;      /* 1区：沉稳冷灰导航左栏 */
  --list-bg: #f6f8fc;         /* 2区：柔和浅灰工单队列 */
  --chat-bg: #ffffff;         /* 3区：纯净高亮白核心聊天焦点 */
  --copilot-bg: #f0f4fb;      /* 4区：清爽淡蓝灰右侧辅助区 */
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --border: #dce3ee;
  --border-strong: #c7d2e2;
  --text: #0f172a;
  --text-secondary: #334155;
  --text-muted: #475569;      /* 加深至 WCAG AA ≥ 6.5:1 */
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-soft: #eff6ff;
  --green: #047857;           /* 加深至 WCAG AA ≥ 5.4:1 */
  --green-soft: #ecfdf5;
  --teal: #0f766e;            /* TROJIN 品牌青绿强调色，替代通用 AI 紫 */
  --teal-soft: #f0fdfa;
  --red: #b91c1c;             /* 加深至 WCAG AA ≥ 5.5:1 */
  --red-soft: #fef2f2;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-card: 0 6px 22px rgba(15, 23, 42, 0.07), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 28px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }
::selection { background: #dbeafe; color: #0f172a; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Tahoma", sans-serif;
  background: var(--canvas);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

audio { direction: ltr; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.mobile-only { display: none !important; }
.mobile-tablet-only { display: none !important; }

.brand-svg { width: 17px; height: 17px; flex-shrink: 0; display: inline-block; vertical-align: middle; }
.brand-svg-sm { width: 14px; height: 14px; flex-shrink: 0; display: inline-block; vertical-align: -2px; }

/* 官方拓境 Logo */
.topbar-logo-img { height: 28px; width: auto; object-fit: contain; display: block; }
.login-logo-img { height: 42px; width: auto; object-fit: contain; display: block; }
.brand-divider { width: 1px; height: 16px; background: var(--border-strong); margin: 0 2px; }
.brand-product { font-weight: 700; font-size: 14px; color: #1e293b; letter-spacing: -0.01em; }

/* ================= 登录页 ================= */
.login-screen {
  height: 100%;
  height: 100dvh;
  width: 100%;
  overflow-y: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px 14px;
  background: linear-gradient(135deg, #e2e8f0 0%, #f8fafc 48%, #dbeafe 100%);
}
.login-card {
  width: 100%;
  max-width: 460px;
  margin: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-md);
}
.login-top-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.login-heading { margin: 0 0 4px; font-size: 19px; }
.login-desc { margin: 0 0 16px; font-size: 13px; color: var(--text-muted); }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-submit { width: 100%; justify-content: center; padding: 10px 14px; font-size: 14px; }
.login-error { background: var(--red-soft); color: var(--red); border: 1px solid #fecaca; border-radius: 8px; padding: 8px 10px; font-size: 12.5px; }
.demo-accounts-box { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border-strong); }
.demo-accounts-title { font-size: 12.5px; color: var(--text-muted); margin-bottom: 8px; }
.demo-account-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; min-height: 118px; }
.demo-chip { border: 1px solid var(--border); background: var(--surface-muted); border-radius: 10px; padding: 8px 10px; text-align: start; cursor: pointer; }
.demo-chip:hover { border-color: var(--primary); background: var(--primary-soft); }
.demo-chip strong { display: block; font-size: 12.5px; }
.demo-chip small { display: block; font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* ================= 顶栏 ================= */
.app-shell { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }

.topbar {
  height: 52px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  gap: 10px;
  flex-shrink: 0;
  z-index: 25;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.brand-home { cursor: pointer; border-radius: 8px; padding: 2px 4px; border: none; background: transparent; font: inherit; color: inherit; }
.brand-home:hover { background: var(--surface-muted); }
.badge-ver { font-size: 11.5px; font-weight: 700; background: #dbeafe; color: #1e40af; padding: 1.5px 7px; border-radius: 6px; font-variant-numeric: tabular-nums; }

.sync-dot-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: #065f46; padding: 2px 9px; border-radius: 99px; background: var(--green-soft); border: 1px solid #a7f3d0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sync-dot-pill.offline { color: #92400e; background: var(--amber-soft); border-color: #fde68a; }
.dot-live { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.clock-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: #334155; padding: 2px 9px; border-radius: 99px; background: #f1f5f9; border: 1px solid #d5dfe9; white-space: nowrap; font-variant-numeric: tabular-nums; cursor: help; }

.zh-trans-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 9px;
  cursor: pointer;
  white-space: nowrap;
}

.lang-switch { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface-muted); flex-shrink: 0; }
.lang-btn { border: none; background: transparent; padding: 4.5px 9px; font-size: 12px; cursor: pointer; color: var(--text-secondary); white-space: nowrap; }
.lang-btn.active { background: #0f172a; color: #fff; font-weight: 600; }

.dropdown-wrap { position: relative; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  min-width: 230px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  box-shadow: var(--shadow-md);
  padding: 6px;
  z-index: 95;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dropdown-item {
  border: none;
  background: transparent;
  padding: 8.5px 10px;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--text);
  text-align: start;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.dropdown-item:hover { background: var(--primary-soft); color: var(--primary); }
.dd-badge { font-size: 11px; font-weight: 700; background: #dbeafe; color: #1e40af; padding: 1px 6px; border-radius: 99px; font-variant-numeric: tabular-nums; }

.user-badge { font-size: 12px; font-weight: 600; color: var(--text); padding: 4px 9px; background: var(--sidebar-bg); border: 1px solid var(--border); border-radius: 8px; white-space: nowrap; max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; width: 32px; height: 32px; font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }

.btn-primary, .btn-primary-soft, .btn-ghost, .btn-warning, .btn-danger-soft {
  border-radius: 8px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.btn-primary:disabled, .btn-primary-soft:disabled, .btn-ghost:disabled, .btn-warning:disabled, .btn-danger-soft:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-primary { background: var(--primary); color: #fff; border: 1px solid var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary-soft { background: var(--primary-soft); color: var(--primary); border: 1px solid #bfdbfe; }
.btn-ghost { background: var(--surface); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-muted); color: var(--text); }
.btn-warning { background: var(--amber-soft); color: #b45309; border: 1px solid #fcd34d; }
.btn-danger-soft { background: var(--red-soft); color: var(--red); border: 1px solid #fecaca; }

/* ================= 1区：沉稳冷灰左栏 ================= */
.workspace { display: flex; flex: 1; min-height: 0; overflow: hidden; position: relative; }

.sidebar {
  width: 226px;
  background: var(--sidebar-bg);
  border-inline-end: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 10px 9px;
  gap: 11px;
  flex-shrink: 0;
  overflow-y: auto;
}
.nav-section { display: flex; flex-direction: column; gap: 2px; }
.nav-title { font-size: 11px; font-weight: 700; color: var(--text-muted); padding: 2px 8px 3px; letter-spacing: 0.02em; }

.nav-item, .ch-item {
  border: 1px solid transparent;
  background: transparent;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6.5px 9px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 12.5px;
  text-align: start;
}
.nav-item:hover, .ch-item:hover { background: rgba(255, 255, 255, 0.72); color: var(--text); }
.nav-item.active, .ch-item.active {
  background: #ffffff;
  color: var(--primary);
  font-weight: 700;
  border-color: #dbeafe;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}
.nav-label, .ch-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 7px; }

.nav-icon-badge {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-icon-badge svg { width: 13.5px; height: 13.5px; display: block; }
.ni-red { background: #fee2e2; color: #b91c1c; }
.ni-blue { background: #dbeafe; color: #1d4ed8; }
.ni-rose { background: #ffe4e6; color: #be123c; }
.ni-amber { background: #fef3c7; color: #b45309; }
.ni-green { background: #d1fae5; color: #065f46; }
.ni-teal { background: #ccfbf1; color: #0f766e; }

.nav-count { font-size: 11.5px; font-weight: 700; padding: 1px 6px; border-radius: 99px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.nav-count.danger { background: #fee2e2; color: #991b1b; }
.nav-count.blue { background: #dbeafe; color: #1e40af; }
.nav-count.teal { background: #ccfbf1; color: #115e59; }
.nav-count.amber { background: #fef3c7; color: #92400e; }
.nav-count.green { background: #d1fae5; color: #065f46; }
.nav-count.neutral { background: #e2e8f0; color: var(--text-secondary); }

.ch-right { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.mode-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.mode-dot.auto { background: #10b981; }
.mode-dot.semi { background: #f59e0b; }
.mode-dot.manual { background: #cbd5e1; }
.ch-cnt { font-size: 11px; color: var(--text-muted); min-width: 14px; text-align: end; }

.reserved-group { margin-top: 5px; border-top: 1px solid #d9e2ec; padding-top: 5px; }
.reserved-group summary { font-size: 11.5px; color: var(--text-muted); cursor: pointer; padding: 4px 8px; user-select: none; }
.reserved-list { display: flex; flex-direction: column; gap: 2px; padding-top: 3px; }
.ch-reserved { opacity: 0.72; }

.sidebar-footer { margin-top: auto; padding-top: 8px; border-top: 1px solid #d9e2ec; }
.mini-status { font-size: 11px; color: var(--text-secondary); padding: 6px 8px; background: rgba(255, 255, 255, 0.72); border: 1px solid var(--border); border-radius: 8px; }

/* ================= 三栏分区工作台 ================= */
.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--canvas); }
.inbox-grid { display: grid; grid-template-columns: 312px minmax(0, 1fr) 338px; height: 100%; min-height: 0; }

/* 2区：柔白浅灰列表栏 */
.ticket-list-pane { background: var(--list-bg); border-inline-end: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; min-width: 0; max-width: 100%; overflow: hidden; }

.channel-mode-bar { padding: 9px 11px; background: #ffffff; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 5px; }
.cm-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.cm-title { font-size: 12.5px; font-weight: 700; display: flex; align-items: center; gap: 6px; min-width: 0; }
.seg-switch { display: inline-flex; background: #e8edf4; border-radius: 7px; padding: 2px; gap: 2px; }
.seg-btn { border: none; background: transparent; padding: 3.5px 7.5px; font-size: 11px; font-weight: 600; color: var(--text-secondary); border-radius: 5px; cursor: pointer; white-space: nowrap; }
.seg-btn.active { background: #ffffff; color: var(--text); box-shadow: var(--shadow-sm); }
.seg-btn.active-auto { background: var(--green); color: #fff; }
.seg-btn.active-semi { background: var(--amber); color: #fff; }
.seg-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.cm-desc { font-size: 11px; color: var(--text-muted); line-height: 1.4; }

.lock-policy-bar { padding: 6.5px 10px; border-bottom: 1px solid var(--border); background: #f8fafc; }
.lock-policy-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 5px; font-size: 11px; color: var(--text-secondary); white-space: nowrap; }
.quota-wrap { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; flex-shrink: 0; }
.quota-dots { display: inline-flex; gap: 2.5px; }
.q-dot { width: 6.5px; height: 6.5px; border-radius: 50%; background: #cbd5e1; }
.q-dot.used { background: var(--primary); }
.q-dot.full { background: var(--red); }
.link-btn { border: none; background: none; color: var(--primary); font-size: 11px; font-weight: 600; cursor: pointer; padding: 0; white-space: nowrap; flex-shrink: 0; }
.toggle-mini { display: inline-flex; align-items: center; gap: 3px; cursor: pointer; font-size: 11px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }

.search-box { padding: 7px 10px; border-bottom: 1px solid var(--border); background: #f8fafc; }
.search-box input { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 12.5px; background: #ffffff; outline: none; }
.search-box input:focus { border-color: var(--primary); }

.ticket-list { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }

.ticket-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 9px 10px;
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: background-color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
.ticket-card:hover { border-color: #cbd5e1; box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06); }
.ticket-card.urgent-handoff { background: #fffbf5; border-color: #fdba74; }
.ticket-card.active {
  background: #f5f9ff;
  border: 1.5px solid var(--primary);
  box-shadow: 0 3px 12px rgba(29, 78, 216, 0.13);
}
.ticket-card.locked-other { background: #f1f5f9; border-style: dashed; border-color: #94a3b8; }
.ticket-card.locked-me { border-color: #047857; background: #f2fcf7; }

.ticket-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 3px; }
.ticket-name { font-weight: 600; font-size: 13px; flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
.ticket-name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.ticket-wait { font-size: 11.5px; font-weight: 600; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.ticket-wait.urgent { color: var(--red); }
.ticket-wait.warn { color: var(--amber); }
.ticket-wait.done { color: var(--green); }
.ticket-preview { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 5px; }
.ticket-meta-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 11.5px; }

.pill { font-size: 11.5px; font-weight: 600; padding: 1.5px 7px; border-radius: 5px; white-space: nowrap; }
.pill-red { background: #fee2e2; color: #991b1b; }
.pill-human-req { background: #ffedd5; color: #9a3412; border: 1px solid #fdba74; }
.cici-avatar-sm { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; border: 1.5px solid #93c5fd; flex-shrink: 0; vertical-align: middle; }
.cici-avatar-md { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 1.5px solid #60a5fa; flex-shrink: 0; }
.cici-copilot-head { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 10px; background: #f0f7ff; border: 1px solid #bfdbfe; }
.cici-copilot-head strong { font-size: 12.5px; color: #1e3a8a; display: block; line-height: 1.3; }
.cici-copilot-head small { font-size: 11px; color: #334155; display: block; margin-top: 2px; line-height: 1.35; }
.msg-meta-cici { display: inline-flex; align-items: center; gap: 5px; }
.banner-human-req { padding: 8px 14px; background: #fff7ed; border-bottom: 1px solid #fdba74; color: #9a3412; font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.banner-human-req.soft { background: #eff6ff; border-bottom-color: #bfdbfe; color: #1e40af; }
.pill-amber { background: #fef3c7; color: #92400e; }
.pill-green { background: #d1fae5; color: #065f46; }
.pill-teal { background: #ccfbf1; color: #115e59; }
.pill-blue { background: #dbeafe; color: #1e40af; }
.pill-gray { background: #e2e8f0; color: #334155; }

/* ================= 3区（视觉焦点！）：纯净高亮白核心聊天卡片 ================= */
.chat-stage {
  background: var(--canvas);
  padding: 10px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
}
.chat-card-shell {
  flex: 1;
  min-height: 0;
  background: var(--chat-bg);
  border: 1px solid #d8e1ec;
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  padding: 2px;
  overflow: hidden;
}
.chat-active { display: flex; flex-direction: column; height: 100%; min-height: 0; border-radius: 12px; overflow: hidden; }
.empty-state { margin: auto; padding: 24px 20px; color: var(--text-muted); font-size: 13.5px; }

.mobile-chat-nav { background: var(--surface); border-bottom: 1px solid var(--border); padding: 7px 12px; display: flex; justify-content: space-between; align-items: center; }

.chat-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.chat-user-info { min-width: 0; flex: 1; }
.chat-user-name { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 7px; min-width: 0; }
.chat-user-name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chat-user-meta { font-size: 11.5px; color: var(--text-muted); display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.chat-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.banner-escalated { background: #fff7ed; border-bottom: 1px solid #fed7aa; color: #9a3412; padding: 8px 15px; font-size: 12px; font-weight: 600; }
.banner-drive-alert { background: #991b1b; color: #fff; padding: 8px 15px; font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.banner-drive-alert.warn { background: #b45309; }
.banner-drive-alert.ok { background: #047857; }
.banner-subtle { background: #f8fafc; border-bottom: 1px solid var(--border); color: var(--text-secondary); padding: 7px 15px; font-size: 11.5px; }
.banner-window { background: #ecfdf5; border-bottom: 1px solid #a7f3d0; color: #065f46; padding: 6px 15px; font-size: 11.5px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.banner-window.expired { background: #fff7ed; border-bottom-color: #fed7aa; color: #9a3412; font-weight: 600; }

/* Chatwoot 风格收件箱状态筛选条 */
.status-tabs-bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 6px 10px 4px; background: var(--list-bg); border-bottom: 1px solid var(--border); }
.st-tab { border: 1px solid transparent; background: transparent; border-radius: 7px; padding: 5px 4px; font-size: 11.5px; font-weight: 600; color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 3px; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.st-tab span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.st-tab:hover { background: #ffffff; color: var(--text); }
.st-tab.active { background: #ffffff; color: var(--primary); border-color: #bfdbfe; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05); }
.st-tab b { font-size: 11px; font-weight: 700; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.st-tab.active b { color: var(--primary); }

.dual-head-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.dual-box.dimmed { opacity: 0.45; }
.dual-box.dimmed textarea { pointer-events: none; background: #f1f5f9; }
.dual-box-dm { border-color: #99f6e4; background: #f2fcfb; }
.dm-voice-opt { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; color: #115e59; background: #ccfbf1; border: 1px dashed #5eead4; border-radius: 7px; padding: 6px 8px; cursor: pointer; line-height: 1.45; }
.dm-voice-opt input { margin-top: 2px; flex-shrink: 0; }

.copied-pending-bar {
  margin: 0 14px 8px;
  padding: 9px 12px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  color: #78350f;
  flex-shrink: 0;
}
.copied-pending-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ext-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
}
.ext-status-chip.online { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.ext-status-chip:hover { border-color: var(--primary); color: var(--primary); }

.expired-window-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: #fff7ed; border: 1.5px solid #fdba74; border-radius: 10px; padding: 11px 13px; flex-shrink: 0; }
.exp-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 200px; font-size: 12px; color: #9a3412; }
.exp-text strong { font-size: 12.5px; }

.history-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.history-filters select, .history-filters input { padding: 7px 10px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 12.5px; background: #ffffff; font-family: inherit; }
.banner-redline { background: var(--red-soft); border-bottom: 1px solid #fecaca; color: #991b1b; padding: 8px 15px; font-size: 12px; font-weight: 600; }
.banner-lock { background: #f1f5f9; border-bottom: 1px solid var(--border); color: #334155; padding: 7px 15px; font-size: 12px; }

/* 聊天背景极微弱冷白底，让气泡、顶栏、底栏三层立体清晰、视觉专注度拉满 */
.chat-messages { flex: 1; min-height: 140px; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 13px; background: #f8fafd; }
.msg-row { display: flex; flex-direction: column; max-width: 82%; }
.msg-row.candidate { align-self: flex-start; }
.msg-row.agent { align-self: flex-end; }
.msg-row.system { align-self: center; max-width: 92%; }

.msg-bubble { padding: 10px 14px; border-radius: 13px; white-space: pre-wrap; overflow-wrap: break-word; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05); }
.msg-row.candidate .msg-bubble { background: #ffffff; border: 1px solid #dce5f0; border-start-start-radius: 4px; }
.msg-row.agent .msg-bubble { background: #e6f7ef; border: 1px solid #a7e3c6; border-start-end-radius: 4px; }
.msg-row.agent.auto-bot .msg-bubble { background: #eef5ff; border: 1px solid #93c5fd; box-shadow: 0 1px 4px rgba(37, 99, 235, 0.08); }
.msg-system-pill { background: #e2e8f0; color: #334155; font-size: 11.5px; padding: 4px 12px; border-radius: 99px; text-align: center; }

.msg-tag-head { font-size: 11px; font-weight: 700; color: #1d4ed8; margin-bottom: 4px; }
.msg-ar { direction: rtl; text-align: right; font-size: 14px; line-height: 1.6; }
.msg-link { color: #1d4ed8; text-decoration: underline; word-break: break-all; direction: ltr; unicode-bidi: embed; }
.msg-link:hover { color: #1e40af; }
.copy-handle-btn { border: none; background: #eff6ff; color: #1d4ed8; border-radius: 5px; padding: 1px 6px; font-size: 11px; font-weight: 600; cursor: pointer; font-family: inherit; }
.copy-handle-btn:hover { background: #dbeafe; }
.search-global-hint { font-size: 11px; color: #1d4ed8; background: #eff6ff; padding: 4px 10px; border-bottom: 1px solid #bfdbfe; text-align: center; font-weight: 600; }
.msg-zh-box { margin-top: 7px; padding-top: 7px; border-top: 1px dashed rgba(15, 23, 42, 0.14); font-size: 12px; color: var(--text-secondary); direction: ltr; text-align: left; }
.msg-meta { font-size: 11px; color: var(--text-muted); margin-top: 3px; padding: 0 3px; }

.voice-bubble { margin-top: 8px; background: #ecfdf5; border: 1px solid #86efac; border-radius: 9px; padding: 7px 10px; }
.voice-bubble-title { font-size: 11.5px; font-weight: 700; color: #065f46; margin-bottom: 4px; }
.voice-bubble audio { width: 100%; height: 32px; }

.incoming-voice-box { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 9px; padding: 7px 10px; margin-bottom: 7px; }
.incoming-voice-head { font-size: 11.5px; font-weight: 700; color: #1e40af; margin-bottom: 5px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.incoming-voice-box audio { width: 100%; height: 32px; direction: ltr; }
.stt-tag { font-size: 11px; font-weight: 700; color: #475569; margin-bottom: 2px; }

.pending-voice-bar { margin: 0 14px 6px; padding: 6px 10px; background: var(--green-soft); border: 1px solid #86efac; border-radius: 8px; display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: #065f46; flex-shrink: 0; }

.composer {
  background: #ffffff;
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 10px rgba(15, 23, 42, 0.03);
  padding: 10px 15px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  max-height: 60%;
  overflow-y: auto;
}
.composer.disabled-composer { opacity: 0.52; pointer-events: none; }
.composer-toolbar { display: flex; flex-wrap: wrap; gap: 6px; flex-shrink: 0; }
#singleComposerWrap { flex-shrink: 0; }

.chip-btn { border: 1px solid var(--border); background: var(--surface-muted); color: var(--text-secondary); border-radius: 7px; padding: 5px 10px; font-size: 12px; font-weight: 600; cursor: pointer; }
.chip-btn:hover { background: #e5e9f0; color: var(--text); }
.chip-btn.chip-green { background: var(--green-soft); color: #065f46; border-color: #a7f3d0; }
.chip-btn.chip-green:hover { background: #d1fae5; color: #064e3b; }
.chip-btn.chip-blue { background: var(--primary-soft); color: var(--primary); border-color: #bfdbfe; }
.chip-btn.chip-teal { background: var(--teal-soft); color: #115e59; border-color: #99f6e4; }
.chip-btn.chip-teal:hover { background: #ccfbf1; color: #134e4a; }

/* 宽敞自适应撑高输入框（单框 & 评论双框通用，告别拥挤！） */
.composer textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.55;
  resize: vertical;
  min-height: 92px;
  max-height: 230px;
  overflow-y: auto;
  outline: none;
  background: #fafbfd;
}
.composer textarea:focus { border-color: var(--primary); background: #ffffff; }
.ar-input { direction: rtl; text-align: right; }

/* 评论双框改为上下 100% 全宽叠放 + 自动撑高，一眼全看完！ */
.dual-composer { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.dual-box { background: #f8fafc; border: 1px solid var(--border); border-radius: 9px; padding: 7px 9px; display: flex; flex-direction: column; gap: 5px; flex-shrink: 0; }
.dual-box textarea { min-height: 62px; max-height: 165px; background: #ffffff; }
.dual-head { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text-secondary); cursor: pointer; }

.composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }
.composer-tip { font-size: 11px; color: var(--text-muted); }
.composer-btns { display: flex; align-items: center; gap: 7px; }

/* WhatsApp Web 同款极简圆形麦克风按钮 + 原地一键录音条（零弹窗！） */
.btn-mic {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.12s;
}
.btn-mic svg { width: 16px; height: 16px; }
.btn-mic:hover { background: #dbeafe; color: #1d4ed8; transform: scale(1.04); }

.inline-record-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  min-height: 62px;
  background: #fff5f5;
  border: 1.5px solid #fca5a5;
  border-radius: 11px;
  flex-wrap: wrap;
}
.rec-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #fecaca;
  background: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.rec-icon-btn:hover { background: #fee2e2; }
.rec-center { flex: 1; min-width: 160px; }
.rec-live-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rec-live-dot { width: 9px; height: 9px; border-radius: 50%; background: #b91c1c; box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.16); flex-shrink: 0; }
.rec-timer { font-family: Consolas, monospace; font-size: 13.5px; font-weight: 700; color: #991b1b; min-width: 44px; font-variant-numeric: tabular-nums; }
.rec-waves { display: inline-flex; align-items: center; gap: 2.5px; height: 18px; }
.rec-waves span { width: 3px; background: #dc2626; border-radius: 99px; animation: waveLevel 1.1s infinite cubic-bezier(0.22, 1, 0.36, 1); }
.rec-waves span:nth-child(1) { height: 7px; animation-delay: 0s; }
.rec-waves span:nth-child(2) { height: 14px; animation-delay: 0.1s; }
.rec-waves span:nth-child(3) { height: 18px; animation-delay: 0.2s; }
.rec-waves span:nth-child(4) { height: 10px; animation-delay: 0.3s; }
.rec-waves span:nth-child(5) { height: 16px; animation-delay: 0.4s; }
.rec-waves span:nth-child(6) { height: 9px; animation-delay: 0.5s; }
.rec-waves span:nth-child(7) { height: 15px; animation-delay: 0.6s; }
.rec-waves span:nth-child(8) { height: 8px; animation-delay: 0.7s; }
@keyframes waveLevel { 0%, 100% { transform: scaleY(0.45); } 50% { transform: scaleY(1); } }
.rec-hint { font-size: 12px; color: #7f1d1d; }
.rec-preview-row audio { width: 100%; height: 32px; }
.rec-send-btn { background: #15803d; border-color: #15803d; color: #ffffff; }
.rec-send-btn:hover { background: #166534; border-color: #166534; }

/* ================= 4区：淡蓝灰右侧辅助区 ================= */
.copilot-pane { background: var(--copilot-bg); border-inline-start: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.copilot-tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 8px; gap: 4px; background: #ffffff; }
.cp-tab { border: none; background: transparent; padding: 10px 8px; font-size: 12px; font-weight: 600; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.cp-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.copilot-content { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }

.panel-card { border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px; background: #ffffff; box-shadow: var(--shadow-sm); min-width: 0; max-width: 100%; }
.panel-card.soft-blue { background: #f8fbff; border-color: #93c5fd; }
.panel-card.soft-green { background: #f4fdf9; border-color: #6ee7b7; }
.panel-card.soft-red { background: #fff8f8; border-color: #fca5a5; }
.panel-card.soft-amber { background: #fffbf2; border-color: #fcd34d; }
.panel-card.soft-teal { background: #f2fcfb; border-color: #5eead4; }
.panel-title { font-size: 12.5px; font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.draft-box { background: #ffffff; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; direction: rtl; text-align: right; margin-bottom: 6px; min-width: 0; }
.zh-sub { font-size: 12px; color: var(--text-secondary); background: #f1f5f9; padding: 6px 9px; border-radius: 7px; white-space: pre-wrap; overflow-wrap: anywhere; direction: ltr; text-align: left; }

.tree-box {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 9px 11px;
  font-family: Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.65;
  direction: ltr;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  margin: 7px 0;
}
.issue-list { margin: 6px 0; padding-inline-start: 18px; font-size: 12px; color: #991b1b; }
.issue-list li { margin-bottom: 3px; }

/* ================= 全屏管理页 ================= */
.full-view { flex: 1; overflow-y: auto; padding: 18px 22px; background: var(--list-bg); }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.page-header h2 { margin: 0 0 3px; font-size: 18px; }
.page-sub { color: var(--text-muted); font-size: 12.5px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card { background: #ffffff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.stat-label { font-size: 12px; color: var(--text-muted); }
.stat-value { font-size: 24px; font-weight: 800; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.stat-note { font-size: 12px; color: var(--green); }

.two-col-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.voice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.voice-card { background: #ffffff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow-sm); }
.voice-card.ready { border-color: #6ee7b7; background: #f4fdf9; }
.arabic-prompt-box { direction: rtl; text-align: right; background: var(--surface-muted); border: 1px dashed var(--border-strong); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; }

.bar-track { width: 100%; height: 7px; background: #e5e9f0; border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--primary); }
.bar-fill.green { background: var(--green); }

.table-scroll { overflow-x: auto; max-width: 100%; min-width: 0; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; background: #ffffff; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); min-width: 540px; }
.data-table th, .data-table td { padding: 9px 11px; border-bottom: 1px solid var(--border); text-align: start; font-size: 12.5px; }
.data-table th { background: var(--surface-muted); color: var(--text-secondary); font-weight: 600; }
.kb-ar-cell { direction: rtl; text-align: right; max-width: 320px; white-space: pre-line; line-height: 1.55; }

.user-perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.user-card { background: #ffffff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-sm); }
.user-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.perm-check-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.perm-check { display: flex; align-items: center; gap: 6px; font-size: 12px; padding: 5px 7px; border-radius: 7px; background: var(--surface-muted); border: 1px solid var(--border); cursor: pointer; }
.perm-check.checked { background: var(--primary-soft); border-color: #bfdbfe; color: #1e40af; font-weight: 600; }
.perm-check:has(input:disabled) { opacity: 0.7; cursor: not-allowed; }

/* 弹窗 & Toast */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); display: flex; align-items: center; justify-content: center; z-index: 120; padding: 14px; }
.modal-card { background: #ffffff; border-radius: 14px; width: 100%; max-width: 540px; box-shadow: var(--shadow-md); overflow: hidden; }
.modal-header { padding: 13px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-header h2, .modal-header h3 { margin: 0; font-size: 15px; }
.icon-close { border: none; background: transparent; font-size: 16px; cursor: pointer; color: var(--text-muted); padding: 4px; }
.modal-body { padding: 15px 16px; max-height: 70vh; overflow-y: auto; font-size: 13px; }
.modal-footer { padding: 11px 16px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.rule-item { border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; margin-bottom: 8px; background: var(--surface-muted); }
.rule-item strong { display: block; margin-bottom: 2px; color: var(--primary); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-field { display: flex; flex-direction: column; gap: 4px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.form-field input, .form-field select, .form-field textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit; outline: none; }

.toast-stack { position: fixed; bottom: 64px; inset-inline-end: 16px; display: flex; flex-direction: column; gap: 7px; z-index: 200; pointer-events: none; }
.toast { background: #0f172a; color: #fff; padding: 9px 13px; border-radius: 9px; font-size: 12.5px; box-shadow: var(--shadow-md); max-width: 380px; }
.toast.success { background: #065f46; }
.toast.warn { background: #92400e; }
.toast.error { background: #991b1b; }
.drawer-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.38); z-index: 50; transform: translateZ(0); will-change: opacity; }

/* ================= 小屏笔电 (1280x720) 紧凑优化 ================= */
@media (max-width: 1320px) and (min-width: 1101px) {
  .topbar { padding: 0 10px; gap: 6px; }
  .topbar-right { gap: 5px; }
  .clock-pill { display: none !important; }
  .zh-trans-toggle { padding: 3.5px 7px; font-size: 11.5px; }
  .sidebar { width: 206px; }
  .inbox-grid { grid-template-columns: 280px minmax(0, 1fr) 295px; }
}
@media (max-height: 760px) and (min-width: 769px) {
  .composer { max-height: 54%; padding: 8px 13px 10px; gap: 6px; }
  .composer textarea { min-height: 74px; max-height: 165px; }
  .dual-box textarea { min-height: 50px; max-height: 115px; }
}

/* ================= 平板适配 ================= */
@media (max-width: 1100px) {
  .desktop-only { display: none !important; }
  .mobile-tablet-only { display: flex !important; }
  .topbar { padding: 0 10px; gap: 6px; }
  .topbar-right { gap: 5px; }
  .brand-divider, .brand-product { display: none; }
  .zh-trans-toggle { max-width: 145px; overflow: hidden; text-overflow: ellipsis; padding: 3.5px 6px; font-size: 11px; }
  .zh-trans-toggle span { overflow: hidden; text-overflow: ellipsis; }
  .user-badge { max-width: 108px; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; padding: 3.5px 7px; }
  /* 手机/平板抽屉采用显式 display + 独立 GPU 合成层切换：关闭态移出焦点树，打开态强制独立分层置顶于遮罩之上（杜绝 RTL 平板合成器跳过重绘！） */
  .sidebar { display: none; position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: min(280px, 84vw); z-index: 60; box-shadow: var(--shadow-md); background: var(--sidebar-bg); }
  .sidebar.open { display: flex !important; position: fixed !important; visibility: visible !important; opacity: 1 !important; transform: translateZ(0); isolation: isolate; will-change: transform; }
  [dir="rtl"] .sidebar.open { right: 0; left: auto; }
  [dir="ltr"] .sidebar.open { left: 0; right: auto; }
  .sidebar-mobile-head, .copilot-mobile-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; border-bottom: 1px solid var(--border); }
  .inbox-grid { grid-template-columns: 296px minmax(0, 1fr); }
  .copilot-pane { display: none; position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: min(370px, 92vw); z-index: 65; box-shadow: var(--shadow-md); background: var(--copilot-bg); }
  .copilot-pane.open { display: flex !important; position: fixed !important; visibility: visible !important; opacity: 1 !important; transform: translateZ(0); isolation: isolate; will-change: transform; }
  [dir="rtl"] .copilot-pane.open { left: 0; right: auto; }
  [dir="ltr"] .copilot-pane.open { right: 0; left: auto; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col-grid, .voice-grid, .user-perm-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) and (min-width: 769px) {
  .badge-ver { display: none; }
  .zh-trans-toggle { display: none; }
  .user-badge { max-width: 88px; }
}

/* ================= 手机适配 ================= */
@media (max-width: 768px) {
  .desktop-tablet-only { display: none !important; }
  .mobile-only { display: inline-flex !important; }
  .topbar { padding: 0 8px; gap: 5px; }
  .topbar-left, .topbar-right { gap: 5px; }
  .topbar-logo-img { height: 22px; }
  .brand-divider, .brand-product, .badge-ver { display: none; }
  .topbar .user-badge { display: none; }
  .icon-btn { width: 36px; height: 36px; }
  .lang-btn { padding: 4px 7px; font-size: 11.5px; }
  .btn-mic, .rec-icon-btn { width: 40px; height: 40px; }
  #manageMenuBtn { padding: 5px 8px; font-size: 11.5px; }
  #manageMenuBtn span { max-width: 72px; overflow: hidden; text-overflow: ellipsis; display: inline-block; }
  .btn-logout { padding: 5px 8px; font-size: 11.5px; }
  /* 关键：必须用 minmax(0, 1fr) 防止 nowrap 子元素把手机列表横向撑爆至 1400px！ */
  .inbox-grid { grid-template-columns: minmax(0, 1fr); }
  .chat-stage { padding: 0; }
  .chat-card-shell { border-radius: 0; border: none; box-shadow: none; padding: 0; }
  .app-shell.mobile-stage-list .chat-stage { display: none; }
  .app-shell.mobile-stage-chat .ticket-list-pane { display: none; }
  /* 进入具体聊天页后隐藏底栏（与 WhatsApp/Telegram 一致），释放 56px 空间彻底消除双框发送键被遮挡！ */
  .app-shell.mobile-stage-chat .mobile-bottom-nav { display: none !important; }
  .composer { max-height: 68%; padding: 8px 10px 10px; gap: 6px; }
  .dual-box textarea { min-height: 46px; max-height: 96px; }
  .composer-footer { position: sticky; bottom: 0; background: #ffffff; padding-top: 6px; z-index: 2; }
  .full-view { padding: 14px 12px 72px; min-width: 0; }
  .form-grid, .perm-check-list, .demo-account-chips { grid-template-columns: minmax(0, 1fr); }
  .demo-account-chips { min-height: 224px; }
  .mobile-bottom-nav { display: flex !important; justify-content: space-around; align-items: stretch; height: 56px; background: #ffffff; border-top: 1px solid var(--border); flex-shrink: 0; z-index: 30; }
  .mb-nav-item { flex: 1; border: none; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 15px; color: var(--text-muted); cursor: pointer; }
  .mb-nav-item small { font-size: 11px; font-weight: 600; }
  .mb-nav-item.active { color: var(--primary); }
  .dropdown-menu { position: fixed; top: 54px; inset-inline-end: 10px; max-width: calc(100vw - 20px); }
}

@media (prefers-reduced-motion: reduce) {
  .rec-waves span { animation: none; }
  .sidebar, .copilot-pane, .btn-mic { transition: none; }
}
