/* ===== HELM · SeaBow 客户通信中枢 — 浅色专业后台 ===== */
:root {
  --bg: #eef1f5;
  --panel: #ffffff;
  --panel-2: #f7f9fb;
  --line: #e3e8ef;
  --line-strong: #d3dae5;
  --text: #1f2937;
  --text-2: #5b6779;
  --text-3: #8b97a8;
  --brand: #0b5ea8;
  --brand-dark: #084a85;
  --brand-soft: #e8f1fb;
  --wa: #0f7d6e;
  --wa-bubble: #dcf5ee;
  --danger: #c0392b;
  --danger-soft: #fdecea;
  --warn: #b7791f;
  --ok: #1f8a55;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--text-2); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 14px; color: var(--text); }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ===== 按钮 ===== */
.btn {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  transition: .15s;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); color: #fff; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { background: #a5301f; color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--panel-2); color: var(--text); }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn.block { width: 100%; padding: 11px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ===== 登录（HELM 品牌页） ===== */
.login-wrap {
  min-height: 100%;
  display: grid; place-items: center;
  padding: 24px; overflow: auto;
  background: #eef1f4;
}
.login-shell {
  width: min(1080px, 100%);
  min-height: 620px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(8, 26, 44, .35), 0 2px 8px rgba(8, 26, 44, .06);
}

/* 左：品牌区 */
.login-visual {
  position: relative;
  padding: 46px 46px 40px;
  display: flex; flex-direction: column;
  color: #E8EEF5;
  background:
    radial-gradient(680px 420px at 88% 8%, rgba(200, 169, 106, .16) 0%, transparent 62%),
    radial-gradient(520px 380px at 6% 96%, rgba(53, 160, 232, .18) 0%, transparent 66%),
    linear-gradient(158deg, #0C2740 0%, #071A2B 58%, #050F19 100%);
  overflow: hidden;
}
.helm-watermark {
  position: absolute; right: -70px; bottom: -60px;
  width: 380px; height: 380px; color: #C8A96A; opacity: .12;
  pointer-events: none;
}
.lv-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 54px; }
.lv-brand .brand-mark { width: 34px; height: 34px; color: #C8A96A; flex: none; }
.lv-name {
  font-size: 15px; font-weight: 600; letter-spacing: .42em; color: #F3E7CB;
}
.lv-headline {
  margin: 0 0 14px; font-size: 33px; line-height: 1.32;
  font-weight: 600; letter-spacing: .01em; color: #FFFFFF;
}
.lv-sub { margin: 0 0 34px; font-size: 13px; color: #9FB3C6; letter-spacing: .02em; }
.lv-points { list-style: none; margin: 0 0 auto; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.lv-points li {
  position: relative; padding-left: 18px; font-size: 12.8px; color: #B9C9D8; line-height: 1.6;
}
.lv-points li::before {
  content: ""; position: absolute; left: 0; top: 8px;
  width: 6px; height: 6px; border-radius: 50%;
  background: #C8A96A; box-shadow: 0 0 0 3px rgba(200, 169, 106, .15);
}
.lv-foot {
  margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .09);
  font-size: 11.5px; color: #7C90A4; letter-spacing: .04em;
}

/* 右：表单区 */
.login-panel {
  padding: 54px 52px 40px;
  display: flex; flex-direction: column; justify-content: center;
  background: #FFFFFF;
}
.lp-head { margin-bottom: 28px; }
.lp-head h2 { margin: 0 0 6px; font-size: 20px; font-weight: 600; letter-spacing: .01em; color: #0E1B28; }
.lp-head p { margin: 0; font-size: 12.5px; color: #7A8899; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-form label {
  display: flex; flex-direction: column; gap: 8px;
  font-size: 12px; color: #566575; font-weight: 500; letter-spacing: .02em;
}
.login-form input {
  padding: 13px 14px; border: 1px solid #DDE4EB; border-radius: 10px;
  background: #FBFCFD; outline: none; font-size: 14px; color: #0E1B28;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.login-form input::placeholder { color: #AFBAC6; }
.login-form input:focus {
  border-color: #C8A96A; background: #fff;
  box-shadow: 0 0 0 3px rgba(200, 169, 106, .16);
}
.login-form .btn.primary {
  margin-top: 6px; padding: 13px; border-radius: 10px;
  background: linear-gradient(120deg, #0E2C48 0%, #143D63 100%);
  color: #fff; font-size: 14px; letter-spacing: .12em;
  box-shadow: 0 10px 24px -12px rgba(14, 44, 72, .7);
}
.login-form .btn.primary:hover { background: linear-gradient(120deg, #12365A 0%, #1A4A78 100%); }
.form-error { color: #C0392B; font-size: 12.5px; min-height: 17px; margin-top: 2px; }
.login-hint {
  margin-top: 34px; padding-top: 18px; border-top: 1px dashed #E2E8EE;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  font-size: 11.5px; color: #8A97A6;
}
.login-hint code {
  font-family: var(--mono); background: #F4F7FA; border: 1px solid #E4EAF0;
  padding: 3px 8px; border-radius: 6px; color: #566575; font-size: 11px;
}

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; min-height: auto; }
  .login-visual { padding: 34px 30px 30px; }
  .lv-brand { margin-bottom: 26px; }
  .lv-headline { font-size: 25px; }
  .lv-points, .lv-foot, .helm-watermark { display: none; }
  .login-panel { padding: 34px 28px 30px; }
}

/* ===== 应用骨架 ===== */
.app { height: 100%; display: flex; overflow: hidden; }

.rail {
  width: 76px; flex: none; background: #0d2438;
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 0 12px; gap: 6px;
  height: 100%; overflow-y: auto;      /* 侧栏自己滚，不跟着页面滚走 */
}
.rail-logo {
  width: 40px; height: 40px; border-radius: 11px; margin-bottom: 16px;
  background: linear-gradient(150deg, #133C5F, #0A2135);
  border: 1px solid rgba(200, 169, 106, .45);
  color: #C8A96A;
  display: grid; place-items: center;
}
.rail-logo svg { width: 24px; height: 24px; }
.rail-nav { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.rail-btn {
  width: 100%; background: none; border: 0; color: #8fa6bb;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 9px 0; font-size: 10.5px; border-left: 3px solid transparent;
  transition: .15s;
}
.rail-btn:hover { color: #d8e6f2; background: rgba(255, 255, 255, .04); }
.rail-btn.active { color: #fff; border-left-color: #35a0e8; background: rgba(53, 160, 232, .12); }
.rail-user { margin-top: auto; text-align: center; color: #8fa6bb; font-size: 10.5px; padding: 10px 6px 0; }
.rail-user .who { color: #e6eef6; font-size: 11.5px; margin-bottom: 2px; display: block; }
.rail-user .role-tag {
  display: inline-block; margin-top: 5px; padding: 1px 7px; border-radius: 20px;
  background: rgba(53, 160, 232, .18); color: #7fc4f0; font-size: 10px;
}
.rail-user .logout { margin-top: 8px; background: none; border: 0; color: #8fa6bb; font-size: 10.5px; text-decoration: underline; padding: 0; }

.workspace { flex: 1; min-width: 0; min-height: 0; display: flex; overflow: hidden; }

/* ===== 会话三栏 ===== */
.chat-grid {
  flex: 1; display: grid;
  grid-template-columns: 316px minmax(360px, 1fr) 330px;
  /* 行高必须锁成 1fr，否则长列表会把整页撑高、侧栏跟着滚走 */
  grid-template-rows: minmax(0, 1fr);
  min-width: 0; min-height: 0;
}
.list-pane { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.pane-head { padding: 14px 14px 10px; border-bottom: 1px solid var(--line); }
.search-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px;
}
.search-wrap svg { color: var(--text-3); width: 15px; height: 15px; flex: none; }
.search-wrap input { border: 0; background: none; outline: none; width: 100%; font-size: 13px; }
.filters { display: flex; gap: 6px; margin-top: 10px; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--text-2);
  padding: 5px 10px; border-radius: 20px; font-size: 12px;
}
.chip.active { background: var(--brand-soft); border-color: #bcd8f2; color: var(--brand); font-weight: 500; }

.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.sum-card { background: var(--panel-2); border-radius: 8px; padding: 7px 8px; text-align: center; }
.sum-card b { display: block; font-size: 16px; font-weight: 600; letter-spacing: -.3px; }
.sum-card span { font-size: 10.5px; color: var(--text-3); }

.cust-list { overflow-y: auto; flex: 1; min-height: 0; }
.cust-item { padding: 12px 14px; border-bottom: 1px solid #f0f3f7; cursor: pointer; transition: .12s; border-left: 3px solid transparent; }
.cust-item:hover { background: var(--panel-2); }
.cust-item.active { background: var(--brand-soft); border-left-color: var(--brand); }
.cust-top { display: flex; align-items: center; gap: 9px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: #dbe7f3; color: var(--brand); font-weight: 600; font-size: 13px;
  display: grid; place-items: center;
}
.avatar.lg { width: 40px; height: 40px; font-size: 15px; }
.cust-main { min-width: 0; flex: 1; }
.cust-name { font-weight: 500; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust-sub { font-size: 11.5px; color: var(--text-3); display: flex; gap: 6px; margin-top: 2px; }
.cust-sub .masked { font-family: var(--mono); font-size: 11px; letter-spacing: -.2px; }
.badges { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.badge {
  font-size: 10.5px; padding: 1px 7px; border-radius: 20px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text-2);
}
.badge.owner { background: #eef7f0; border-color: #cfe8d7; color: var(--ok); }
.badge.unassign { background: #fff6e8; border-color: #f0dcbb; color: var(--warn); }
.badge.status-active { background: var(--brand-soft); border-color: #c5dcf3; color: var(--brand); }
.badge.status-won { background: #eef7f0; border-color: #cfe8d7; color: var(--ok); }

/* ===== 聊天区 ===== */
.chat-pane { display: flex; flex-direction: column; background: #f7f9fb; min-width: 0; }
.chat-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 30px; }
.empty-icon { font-size: 40px; opacity: .25; }
.chat-empty h3 { font-size: 15px; }
.chat-empty p { font-size: 12.5px; margin: 0; max-width: 300px; }
.chat-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-head {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 18px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.chat-head-info { min-width: 0; flex: 1; }
.chat-head-info h3 { font-size: 14.5px; }
.chat-head-info p { margin: 2px 0 0; font-size: 11.5px; font-family: var(--mono); }
.chat-head-actions { display: flex; gap: 8px; align-items: center; }
.waha-pill { font-size: 10.5px; padding: 3px 9px; border-radius: 20px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text-3); }
.waha-pill.ok { background: #eef7f0; border-color: #cfe8d7; color: var(--ok); }
.waha-pill.demo { background: #fff6e8; border-color: #f0dcbb; color: var(--warn); }
.waha-pill.bad { background: var(--danger-soft); border-color: #f3cfca; color: var(--danger); }

.messages { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.msg-row { display: flex; flex-direction: column; max-width: 74%; position: relative; }
.msg-row.out { align-self: flex-end; align-items: flex-end; }
.msg-row.in { align-self: flex-start; align-items: flex-start; }
.bubble {
  padding: 9px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word; box-shadow: 0 1px 1px rgba(16, 24, 40, .04);
}
.msg-row.in .bubble { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg-row.out .bubble { background: var(--wa-bubble); border: 1px solid #c3e9dd; border-bottom-right-radius: 4px; }
.msg-meta { font-size: 10.5px; color: var(--text-3); margin-top: 3px; display: flex; gap: 6px; align-items: center; }
.bubble.deleted {
  background: #f2f4f7 !important; border: 1px dashed var(--line-strong) !important;
  color: var(--text-3); font-size: 12.5px; font-style: italic;
}
/* 删除提示：一行灰字，不占气泡位置 */
.sys-note {
  align-self: center; text-align: center; font-size: 11px;
  color: var(--text-3); padding: 2px 0 4px; user-select: none;
}
.msg-del {
  position: absolute; top: -6px; right: -6px; opacity: 0; transition: .12s;
  background: #fff; border: 1px solid var(--line-strong); color: var(--danger);
  border-radius: 7px; padding: 2px 6px; font-size: 10.5px; box-shadow: var(--shadow);
}
.msg-row:hover .msg-del { opacity: 1; }
.msg-row.in .msg-del { right: auto; left: -6px; }

.composer { border-top: 1px solid var(--line); background: var(--panel); padding: 12px 18px; display: flex; gap: 10px; align-items: flex-end; }
.composer textarea {
  flex: 1; resize: none; border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 10px 13px; outline: none; max-height: 130px; line-height: 1.5; background: var(--panel-2);
}
.composer textarea:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-soft); }

/* ===== 资料面板 ===== */
.info-pane { background: var(--panel); border-left: 1px solid var(--line); overflow-y: auto; }
.info-empty { padding: 26px; text-align: center; font-size: 12.5px; }
.info-head { padding: 18px 18px 14px; border-bottom: 1px solid var(--line); text-align: center; }
.info-head .avatar { margin: 0 auto 9px; }
.info-head h3 { font-size: 15px; }
.info-head p { margin: 3px 0 0; font-size: 12px; color: var(--text-2); }
.info-section { padding: 15px 18px; border-bottom: 1px solid var(--line); }
.info-section h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-3); margin-bottom: 10px; font-weight: 600; }
.field { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.field .label { font-size: 11.5px; color: var(--text-3); width: 46px; flex: none; }
.field .value { flex: 1; font-size: 12.5px; font-family: var(--mono); word-break: break-all; }
.field .value.revealed { color: var(--danger); font-weight: 600; }
.icon-btn { background: none; border: 0; color: var(--text-3); padding: 3px; border-radius: 6px; display: grid; place-items: center; }
.icon-btn:hover { background: var(--panel-2); color: var(--brand); }
.icon-btn svg { width: 15px; height: 15px; }
.mask-note { font-size: 10.5px; color: var(--text-3); margin-top: -2px; margin-bottom: 8px; line-height: 1.5; }
.info-note { font-size: 12.5px; color: var(--text-2); line-height: 1.6; white-space: pre-wrap; }
.assign-row { display: flex; gap: 8px; }
.assign-row select { flex: 1; padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; outline: none; }
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; }
.stat-row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 4px 0; color: var(--text-2); }

/* ===== 管理视图 ===== */
.admin-view { flex: 1; overflow-y: auto; padding: 26px 30px 40px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 14px; flex-wrap: wrap; }
.admin-head h2 { font-size: 19px; letter-spacing: -.3px; }
.admin-head p { margin: 4px 0 0; font-size: 12.5px; color: var(--text-2); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; overflow: hidden; }
.card-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card-head h3 { font-size: 14px; }
.card-body { padding: 16px 18px; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th { text-align: left; font-weight: 500; color: var(--text-3); font-size: 11.5px; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--panel-2); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid #f0f3f7; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.mono, .mono { font-family: var(--mono); font-size: 11.5px; }
.pill { display: inline-block; font-size: 10.5px; padding: 2px 8px; border-radius: 20px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text-2); }
.pill.ok { background: #eef7f0; border-color: #cfe8d7; color: var(--ok); }
.pill.bad { background: var(--danger-soft); border-color: #f3cfca; color: var(--danger); }
.pill.warn { background: #fff6e8; border-color: #f0dcbb; color: var(--warn); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-2); }
.form-grid input, .form-grid select {
  padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel-2); outline: none;
}
.form-grid input:focus, .form-grid select:focus { border-color: var(--brand); background: #fff; }
.status-line { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(31, 138, 85, .15); }
.dot.bad { background: var(--danger); box-shadow: 0 0 0 3px rgba(192, 57, 43, .13); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(183, 121, 31, .15); }
.qr-box { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.qr-box img { width: 190px; height: 190px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 8px; }

/* ===== Toast / Modal ===== */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: #1f2937; color: #fff; padding: 10px 20px; border-radius: 10px;
  font-size: 13px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); z-index: 99; max-width: 80vw;
}
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }
.modal-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: grid; place-items: center; z-index: 100; padding: 20px; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 420px; padding: 22px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.modal h3 { font-size: 15.5px; margin-bottom: 8px; }
.modal p { font-size: 13px; color: var(--text-2); line-height: 1.6; margin: 0 0 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #cbd4e0; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b3bfcf; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 1200px) {
  .chat-grid { grid-template-columns: 280px minmax(340px, 1fr); }
  .info-pane { display: none; }
}

/* ===== 实时英译中 ===== */
.mt {
  font-size: 12.5px; line-height: 1.62; color: var(--text-2);
  background: #f7f3ea; border: 1px solid #e8ddc6; border-left: 2px solid #c8a96a;
  border-radius: 8px; padding: 6px 9px; margin-top: 4px; max-width: 100%;
}
.mt:empty { display: none; }
#mtToggle.on { color: #8a6d2f; background: #f7f3ea; border-color: #e8ddc6; }
#mtToggle.on:hover { color: #6f5620; background: #f1ebdc; }
#mtDraftBtn { flex: none; }

/* ===== 气泡里的图片 / 视频 / 文件 ===== */
.bubble.has-media { padding: 6px; max-width: 340px; }.bubble.has-media .cap { padding: 6px 4px 2px; font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.media-link { display: block; line-height: 0; }
.media-img {
  display: block; width: 100%; max-width: 320px; max-height: 320px;
  object-fit: cover; border-radius: 8px; background: #eef1f4;
}
.media-video { display: block; width: 100%; max-width: 320px; max-height: 360px; border-radius: 8px; background: #000; }
.media-audio { display: block; width: 260px; margin: 2px 0; }
.media-file {
  display: flex; align-items: center; gap: 7px; padding: 9px 11px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  font-size: 12.5px; color: var(--text); text-decoration: none; max-width: 300px;
}
.media-file:hover { border-color: var(--brand); color: var(--brand); }
.media-file .clip { font-size: 15px; }
.media-file .muted { font-size: 11px; margin-left: auto; white-space: nowrap; }
.media-missing {
  font-size: 12px; color: var(--text-3); font-style: italic;
  padding: 8px 10px; border: 1px dashed var(--line-strong); border-radius: 8px;
}
.bubble.has-media .media-missing { border: none; padding: 8px 4px; }

/* ===== 新消息提醒 ===== */
.rail-bell {
  width: 40px; height: 36px; margin: 4px 0 8px; border-radius: 10px;
  border: 1px solid transparent; background: rgba(255, 255, 255, .06);
  color: #e9eef4; font-size: 15px; line-height: 1; cursor: pointer;
  transition: background .15s, opacity .15s;
}
.rail-bell:hover { background: rgba(255, 255, 255, .14); }
.rail-bell.off { opacity: .45; }
.unread-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger); margin-left: 6px; vertical-align: middle;
}

/* ===== 邮件 ===== */
.chat-tabs { display: flex; gap: 6px; padding: 0 18px; border-bottom: 1px solid var(--line); background: var(--panel); }
.chat-tabs .tab {
  border: none; background: transparent; padding: 9px 14px; font-size: 13px; color: var(--text-2);
  border-bottom: 2px solid transparent; cursor: pointer;
}
.chat-tabs .tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.mail-pane { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.mail-toolbar { display: flex; gap: 8px; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--panel); }
.mail-toolbar .muted { font-size: 11.5px; margin-left: auto; }
.mail-list { flex: 1; overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; }
.mail-item { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.mail-item.out { border-left: 3px solid var(--brand); }
.mail-item.in { border-left: 3px solid #c8a96a; }
.mail-head { display: flex; gap: 8px; align-items: baseline; }
.mail-dir { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--panel-2); color: var(--text-2); }
.mail-subj { font-weight: 600; font-size: 13.5px; }
.mail-time { margin-left: auto; font-size: 11px; color: var(--text-3); }
.mail-meta { font-size: 11.5px; margin-top: 4px; }
.mail-body { margin-top: 8px; font-size: 13px; line-height: 1.65; white-space: pre-wrap; color: var(--text); max-height: 260px; overflow: auto; }
.mail-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.mail-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--text-2); }
.mail-form input, .mail-form textarea {
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; font: inherit;
  font-size: 13px; background: var(--panel-2); outline: none; resize: vertical;
}
.mail-form input:focus, .mail-form textarea:focus { border-color: var(--brand); background: #fff; }
