/* ============================================================
   客服工作台样式
   主色统一走 --brand，后台可以改挂件颜色，这里保持一致
   ============================================================ */

:root {
  --brand: #2f6fed;
  --brand-dark: #2457c4;
  --brand-soft: #eaf1fe;
  --bg: #f4f6fa;
  --panel: #ffffff;
  --line: #e5e8ef;
  --line-soft: #f0f2f7;
  --text: #1f2430;
  --text-2: #5b6472;
  --text-3: #939cab;
  --green: #17a673;
  --amber: #e8930c;
  --red: #e5484d;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 12px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .18);
  --font: "Microsoft YaHei UI", "Microsoft YaHei", -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------------- 通用控件 ---------------- */

.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: .15s;
  white-space: nowrap;
}
.btn:hover { background: #f7f9fc; border-color: #d7dce6; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--line-soft); }

.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-block { width: 100%; padding: 11px; font-size: 15px; }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--text-3); }
.dot-online { background: var(--green); }
.dot-busy { background: var(--amber); }
.dot-away { background: #a0a8b6; }
.dot-offline { background: #c9cfd9; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; flex: 0 0 auto;
}

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.field input, .field select, textarea, input[type=search], input[type=text], input[type=password] {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; outline: none; transition: .15s;
}
.field input:focus, textarea:focus, input:focus, select:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
textarea { resize: vertical; line-height: 1.6; }

.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; max-width: 100%; }
.empty-note { color: var(--text-3); font-size: 13px; padding: 16px; text-align: center; }
code { background: var(--line-soft); padding: 2px 6px; border-radius: 5px; font-size: 12px; }

/* ---------------- 登录 ---------------- */

.login-wrap {
  height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, #eef3fd 0%, #f7f9fc 45%, #eaf1fe 100%);
}
.login-card {
  width: 360px; background: #fff; border-radius: var(--radius-lg);
  padding: 34px 32px 26px; box-shadow: var(--shadow-lg);
}
.login-brand { text-align: center; margin-bottom: 26px; }
.login-logo {
  width: 54px; height: 54px; border-radius: 15px; margin: 0 auto 14px;
  background: var(--brand); color: #fff; font-size: 24px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.login-brand h1 { margin: 0 0 5px; font-size: 20px; }
.login-sub { margin: 0; color: var(--text-3); font-size: 13px; }
/* 「保存用户名和密码」勾选框。默认勾上（index.html 里写死 checked）。 */
.save-creds {
  display: flex; align-items: center; gap: 7px;
  margin: 0 0 14px; font-size: 13px; color: var(--text-2);
  cursor: pointer; user-select: none;
}
.save-creds input[type=checkbox] {
  width: 15px; height: 15px; margin: 0; flex: none;
  accent-color: var(--brand); cursor: pointer;
}
.login-error {
  background: #fdecec; color: var(--red); border: 1px solid #f8d5d6;
  padding: 9px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 14px;
}
.login-foot { text-align: center; color: var(--text-3); font-size: 12px; margin: 14px 0 0; min-height: 16px; }

/* ---------------- 布局 ---------------- */

.app { height: 100%; display: flex; flex-direction: column; }

.topbar {
  height: 56px; flex: 0 0 auto;
  background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; gap: 16px;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.brand-dot { width: 9px; height: 9px; border-radius: 3px; background: var(--brand); }

.conn-badge {
  font-size: 12px; padding: 3px 9px; border-radius: 20px;
  background: #fff5e6; color: var(--amber); border: 1px solid #ffe1b8;
}
.conn-badge.on { background: #e8f7f0; color: var(--green); border-color: #c4ead9; }
.conn-badge.off { background: #fdecec; color: var(--red); border-color: #f8d5d6; }

.topbar-right { display: flex; align-items: center; gap: 10px; }
.stat {
  display: flex; flex-direction: column; align-items: center; line-height: 1.15;
  padding: 0 10px; border-right: 1px solid var(--line-soft);
}
.stat b { font-size: 16px; }
.stat span { font-size: 11px; color: var(--text-3); }
.stat b.hot { color: var(--red); }

.status-wrap, .me-wrap { position: relative; }
.me-wrap { margin-left: 4px; }
.btn-me { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; border-radius: 20px; }
.btn-me .avatar { width: 26px; height: 26px; font-size: 12px; }

.status-menu, .me-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); min-width: 190px; padding: 6px; 
}
.status-menu button, .me-menu button {
  display: flex; align-items: center; gap: 9px; width: 100%;
  border: 0; background: transparent; padding: 9px 10px; border-radius: 7px;
  cursor: pointer; text-align: left; font-size: 13px;
}
.status-menu button:hover, .me-menu button:hover { background: var(--line-soft); }
.status-menu small { color: var(--text-3); margin-left: auto; font-size: 11px; }
.me-menu-head { padding: 9px 10px 10px; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; }
.me-menu-head b { display: block; }
.me-menu-head small { color: var(--text-3); }
.me-menu button.danger { color: var(--red); }

.body { flex: 1; display: flex; min-height: 0; }
.pane { background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.pane-list { width: 288px; flex: 0 0 auto; border-right: 1px solid var(--line); }
.pane-chat { flex: 1; min-width: 0; background: var(--bg); }
.pane-info { width: 290px; flex: 0 0 auto; border-left: 1px solid var(--line); overflow-y: auto; }

/* ---------------- 会话列表 ---------------- */

.list-tabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 6px; overflow-x: auto; }
.tab {
  border: 0; background: transparent; padding: 12px 9px 10px;
  cursor: pointer; color: var(--text-2); font-size: 13px;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tab i {
  font-style: normal; background: var(--line-soft); color: var(--text-2);
  border-radius: 9px; padding: 1px 6px; font-size: 11px; margin-left: 3px;
}
.tab.active i { background: var(--brand-soft); color: var(--brand); }
.tab i.hot { background: #fdecec; color: var(--red); }

/* 待接入有人在等 → 角标闪红。
 *
 * ⚠️ 只在一个条件下闪：**「待接入」有数字**（app.js 的 renderCounts 里加 .pulse）。
 *    常闪的角标两周之后就没人看得见了 —— 这个效果的全部价值就在于"它平时不闪"。
 *    另外「我接待中」用 .hot 变红但**不闪**：那是我自己的事，不需要抢注意力。
 */
@keyframes kfPulse {
  0%, 100% { background: #fdecec; color: var(--red); box-shadow: 0 0 0 0 rgba(229, 72, 77, .55); }
  50%      { background: var(--red);   color: #fff;      box-shadow: 0 0 0 5px rgba(229, 72, 77, 0); }
}
.tab i.pulse { animation: kfPulse 1.15s ease-in-out infinite; }
/* 前庭功能障碍 / 晕动敏感的用户：不闪，但仍然整块变红，信息不丢 */
@media (prefers-reduced-motion: reduce) {
  .tab i.pulse { animation: none; background: var(--red); color: #fff; }
}

.list-search { padding: 10px; border-bottom: 1px solid var(--line-soft); }
.list-search input { padding: 7px 11px; font-size: 13px; }

.conv-list { flex: 1; overflow-y: auto; }
.conv {
  padding: 11px 13px; border-bottom: 1px solid var(--line-soft);
  cursor: pointer; display: flex; gap: 10px; transition: .12s;
}
.conv:hover { background: #f8fafd; }
.conv.active { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.conv-main { flex: 1; min-width: 0; }
.conv-line1 { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.conv-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-time { margin-left: auto; font-size: 11px; color: var(--text-3); flex: 0 0 auto; }
.conv-line2 { display: flex; align-items: center; gap: 6px; }
.conv-preview {
  color: var(--text-2); font-size: 12.5px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0;
}
.conv-unread {
  background: var(--red); color: #fff; font-size: 11px; font-weight: 600;
  min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.avatar-wrap { position: relative; flex: 0 0 auto; }
.avatar-wrap .online-dot {
  position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--green); border: 2px solid #fff;
}
.tag {
  font-size: 11px; padding: 1px 7px; border-radius: 5px;
  background: var(--line-soft); color: var(--text-2); flex: 0 0 auto;
}
.tag-pending { background: #fff5e6; color: var(--amber); }
.tag-active { background: #e8f7f0; color: var(--green); }
.tag-closed { background: #f1f3f7; color: var(--text-3); }
.tag-src { background: #f0e9ff; color: #7b52d3; }
.tag-offline { background: #eef4ff; color: #3b6fd4; }
/* 「原客服已离线」：一条有主、但主人已经断线的会话。
   和 tag-pending 的橙色区分开 —— 橙色是"还没人管"（正常的新会话），
   这条是"本来有人管，那个人不在了"（异常，需要有人补位）。 */
.tag-orphan { background: #fdecec; color: #d64545; }

/* ---------------- 聊天区 ---------------- */

.chat-empty { flex: 1; display: flex; align-items: center; justify-content: center; }
.chat-empty-inner { text-align: center; color: var(--text-3); max-width: 420px; }
.chat-empty-inner .big { font-size: 46px; margin-bottom: 10px; }
.chat-empty-inner h2 { font-size: 16px; color: var(--text-2); font-weight: 600; margin: 0 0 8px; }
.chat-empty-inner p { font-size: 13px; line-height: 1.7; margin: 0 0 18px; }

.chat-box { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-head {
  flex: 0 0 auto; background: #fff; border-bottom: 1px solid var(--line);
  padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.chat-head-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.chat-title { display: flex; align-items: center; gap: 7px; }
.chat-title b { font-size: 15px; }
.chat-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.chat-head-actions { display: flex; gap: 7px; flex: 0 0 auto; }

.msg-scroll { flex: 1; overflow-y: auto; padding: 18px 20px; }
.load-more { text-align: center; margin-bottom: 14px; }

.msg { display: flex; gap: 9px; margin-bottom: 15px; align-items: flex-start; }
.msg.visitor { flex-direction: row; }
.msg.agent { flex-direction: row-reverse; }
.msg .avatar { width: 30px; height: 30px; font-size: 12px; }
.msg.agent .avatar { background: #5b6472; }

.bubble-wrap { max-width: 62%; min-width: 0; }
.bubble {
  padding: 9px 13px; border-radius: 12px; line-height: 1.6;
  word-break: break-word; white-space: pre-wrap; font-size: 13.5px;
}
.msg.visitor .bubble { background: #fff; border: 1px solid var(--line); border-top-left-radius: 3px; }
.msg.agent .bubble { background: var(--brand); color: #fff; border-top-right-radius: 3px; }
.msg.system { justify-content: center; }
.msg.system .bubble {
  background: transparent; color: var(--text-3); font-size: 12px;
  padding: 2px 10px; text-align: center;
}
.msg.note .bubble {
  background: #fff8e1; border: 1px dashed #e8c96a; color: #8a6d1a;
  border-radius: 8px; font-size: 13px;
}
.msg.note .note-tag {
  display: inline-block; font-size: 11px; background: #f5e3a8; color: #7a5f10;
  padding: 0 6px; border-radius: 4px; margin-bottom: 5px; font-weight: 600;
}
.msg-meta { font-size: 11px; color: var(--text-3); margin-top: 4px; display: flex; gap: 8px; }
.msg.agent .msg-meta { justify-content: flex-end; }
.msg-meta .err { color: var(--red); }
.msg-meta .sending { color: var(--amber); }

.bubble img.att { max-width: 230px; max-height: 230px; border-radius: 8px; display: block; cursor: zoom-in; }
.bubble .file-att {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  background: rgba(0,0,0,.05); border-radius: 8px; text-decoration: none; color: inherit;
}
.msg.agent .bubble .file-att { background: rgba(255,255,255,.16); color: #fff; }
.bubble.recalled { font-style: italic; opacity: .6; }

.typing-hint { font-size: 12px; color: var(--text-3); padding: 4px 4px 10px; height: 20px; }

/* ---------------- 「接待」入口 ---------------- */

/* 标题栏那个：同事那排按钮（历史/拉黑/结束会话）都是中性的，
   这个必须一眼看见 —— 它是公共池会话唯一的"接手"入口。 */
.btn-claim-cta { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.btn-claim-cta:hover { background: #1f9d6b; border-color: #1f9d6b; }
/* 「接管」（原客服已离线的会话）。用橙色而不是绿色，和「接待」区分开：
   绿色 = 这条新会话归我了（正常流程）；橙色 = 替一个不在的同事补位
   （异常流程，会话里还会留下一条"X 已接管"的系统消息，访客看得见）。 */
.btn-takeover-cta { background: var(--amber); border-color: var(--amber); color: #fff; font-weight: 600; }
.btn-takeover-cta:hover { background: #d9821a; border-color: #d9821a; }

/* 输入框上方那条：会话还没人接的时候出现。
   放在这里（而不是藏进标题栏）是因为客服点开一条待接入会话之后，
   视线就在输入框上 —— 他准备打字，得先告诉他"这条还不归你"。 */
.claim-bar {
  display: flex; align-items: center; gap: 10px;
  background: #fff8e6; border: 1px solid #ffe0a3; border-radius: 8px;
  padding: 8px 10px; margin-bottom: 9px;
}
.claim-bar-text { flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.45; color: #8a5a00; }

.composer { flex: 0 0 auto; background: #fff; border-top: 1px solid var(--line); padding: 10px 14px 12px; position: relative; }
.composer-tools { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.tool {
  border: 1px solid var(--line); background: #fff; padding: 4px 10px;
  border-radius: 7px; cursor: pointer; font-size: 12.5px; color: var(--text-2);
}
.tool:hover { background: #f7f9fc; }
.tool-toggle { display: inline-flex; align-items: center; gap: 5px; user-select: none; }
.tool-toggle input { margin: 0; }
.composer-hint { margin-left: auto; font-size: 11.5px; color: var(--text-3); }
.composer-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.file-chip { font-size: 12px; color: var(--text-2); background: var(--line-soft); padding: 3px 9px; border-radius: 6px; }
#input { min-height: 68px; }

.canned-pop {
  position: absolute; left: 14px; right: 14px; bottom: calc(100% - 6px);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); z-index: 40; max-height: 330px; display: flex; flex-direction: column;
}
.canned-pop > input { border: 0; border-bottom: 1px solid var(--line-soft); border-radius: 0; }
.canned-list { overflow-y: auto; padding: 6px; }
.canned-item { padding: 9px 11px; border-radius: 7px; cursor: pointer; }
.canned-item:hover { background: var(--brand-soft); }
.canned-item b { display: block; font-size: 12.5px; margin-bottom: 3px; color: var(--brand); }
.canned-item span { font-size: 12.5px; color: var(--text-2); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- 访客资料 ---------------- */

.info-empty { padding: 20px; color: var(--text-3); text-align: center; font-size: 13px; }
.info-sec { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.info-sec h3 {
  margin: 0 0 11px; font-size: 12px; color: var(--text-3); font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
}
.info-sec h3 small { text-transform: none; font-weight: 400; letter-spacing: 0; }
.info-row { display: flex; gap: 10px; margin-bottom: 8px; font-size: 12.5px; align-items: flex-start; }
.info-row label { color: var(--text-3); flex: 0 0 62px; }
.info-row span { flex: 1; min-width: 0; word-break: break-all; }
#v-note { font-size: 12.5px; margin-bottom: 8px; }

/* 名字备注：一行输入框 + 保存按钮，跟上面「称呼」那一行对齐。
   span 上的 word-break: break-all 会让输入框里的字乱断，这里改回 normal。 */
.info-row .remark-edit { display: flex; gap: 6px; align-items: center; word-break: normal; }
.info-row .remark-edit input {
  flex: 1; min-width: 0; font-size: 12.5px; padding: 3px 6px;
  border: 1px solid var(--border); border-radius: 4px;
  background: var(--bg-1); color: var(--text-1);
}
.info-row .remark-edit .btn { flex: 0 0 auto; white-space: nowrap; }
.history-list { display: flex; flex-direction: column; gap: 7px; }
.history-item {
  padding: 8px 10px; background: #f8fafd; border-radius: 7px;
  cursor: pointer; border: 1px solid var(--line-soft);
}
.history-item:hover { border-color: var(--brand); }
.history-item .hi-top { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 3px; }
.history-item .hi-date { color: var(--text-3); }
.history-item .hi-prev { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- 网站传来的用户信息（用户ID / 会员等级 / 订单号…）---- */

.extra-list { display: flex; flex-direction: column; gap: 6px; }
.extra-row {
  display: flex; gap: 10px; font-size: 12.5px; align-items: flex-start;
  background: #f5f8fe; border: 1px solid #e3ebf9; border-radius: 7px;
  padding: 7px 10px; cursor: default;
}
.extra-row:hover { border-color: var(--brand); }
.extra-row label {
  color: var(--brand); flex: 0 0 auto; max-width: 45%;
  font-weight: 600; word-break: break-all;
}
.extra-row span {
  flex: 1; min-width: 0; word-break: break-all; text-align: right;
  color: var(--text-1);
}
.extra-row span.extra-empty { color: var(--text-3); font-style: italic; }

/* ---- 话术库管理弹窗 ---- */

.canned-manage { display: flex; flex-direction: column; gap: 10px; }
.canned-manage .cm-tabs { display: flex; gap: 6px; }
.canned-manage .cm-tabs button {
  flex: 1; padding: 7px 10px; border-radius: 7px; cursor: pointer; font: inherit;
  font-size: 12.5px; border: 1px solid var(--line-soft); background: #fff; color: var(--text-2);
}
.canned-manage .cm-tabs button.active {
  background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 600;
}
.canned-manage .cm-list { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; }
.canned-manage .cm-item { border: 1px solid var(--line-soft); border-radius: 8px; padding: 10px 12px; }
.canned-manage .cm-item-top {
  display: flex; align-items: center; gap: 8px; margin-bottom: 5px;
}
.canned-manage .cm-item-top b { font-size: 13px; }
.canned-manage .cm-item-top .cm-actions { margin-left: auto; display: flex; gap: 6px; }
.canned-manage .cm-content {
  font-size: 12.5px; color: var(--text-2); white-space: pre-wrap; word-break: break-word;
}
.canned-manage .cm-form { border-top: 1px dashed var(--line-soft); padding-top: 12px; }
.canned-manage .cm-form h4 { margin: 0 0 9px; font-size: 13px; }
.canned-manage .cm-form .field { margin-bottom: 9px; }
.canned-manage .cm-form textarea { width: 100%; font-size: 12.5px; }
.canned-manage .cm-hint { font-size: 11.5px; color: var(--text-3); margin: 6px 0 0; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* ---------------- 弹窗 ---------------- */

.modal {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .45);
  display: flex; align-items: center; justify-content: center; z-index: 200; padding: 24px;
}
.modal-card {
  background: #fff; border-radius: var(--radius-lg); width: 620px; max-width: 100%;
  max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.modal-sm { width: 440px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.modal-head h2 { margin: 0; font-size: 16px; }
.btn-close { border: 0; background: transparent; font-size: 17px; cursor: pointer; color: var(--text-3); padding: 4px 8px; border-radius: 6px; }
.btn-close:hover { background: var(--line-soft); }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-desc { font-size: 13px; color: var(--text-2); line-height: 1.7; margin: 0 0 16px; }

/* ---------------- 转接 / 指派面板 ----------------
   复用通用弹窗（.modal-sm 宽 440px，和"改密码""话术库"同一个），一行一个同事。 */
.xfer-list {
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  overflow-y: auto; max-height: 320px;
}
.xfer-row {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line-soft);
  background: #fff; cursor: pointer; text-align: left;
  font-family: inherit; font-size: 13.5px; color: var(--text);
}
.xfer-row:last-child { border-bottom: 0; }
.xfer-row:hover:not(:disabled) { background: var(--brand-soft); }
/* 选中的那一行。**不能只靠 hover 表示选中** —— 选完之后手一移开就没了，
   用户根本不知道"我到底选中了谁"，然后不敢点确认。 */
.xfer-row.picked { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.xfer-row:disabled { cursor: default; opacity: .5; }
.xfer-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.xfer-dot.on { background: var(--green); }
.xfer-dot.off { background: var(--text-3); }
.xfer-name { font-weight: 600; flex: 0 0 auto; }
.xfer-sub {
  color: var(--text-3); font-size: 12px; flex: 1 1 auto; min-width: 0;
  /* 副标题可能很长（@账号名 · 角色 · 我 · 在线 · 接待中 N），
     必须压住不换行 —— 否则一行同事占两行高度，列表一屏看不完几个。 */
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.xfer-tag { font-size: 11.5px; color: var(--text-2); background: var(--line-soft); border-radius: 999px; padding: 2px 8px; }
.xfer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.xfer-pick { font-size: 12.5px; color: var(--text-3); }

.invite-form { background: #f8fafd; border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 14px 14px 4px; }
.invite-form-row { display: flex; gap: 12px; align-items: flex-start; }
.invite-form-row .field { flex: 1; }
.invite-form-row .btn { margin-top: 25px; }

.invite-result { margin-top: 16px; padding: 13px; background: #e8f7f0; border: 1px solid #c4ead9; border-radius: var(--radius); }
.invite-result-label { font-size: 12.5px; color: #10704e; margin-bottom: 8px; font-weight: 600; }
.invite-result-row { display: flex; gap: 8px; }
.invite-result-row input { background: #fff; font-size: 12.5px; }
.invite-result-tip { font-size: 12px; color: #2c7a5c; margin-top: 8px; }

.invite-list-title { font-size: 13px; margin: 20px 0 10px; color: var(--text-2); }
.invite-list { display: flex; flex-direction: column; gap: 9px; }
.invite-item {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 13px;
  display: flex; gap: 12px; align-items: center;
}
.invite-item.off { opacity: .55; }
.invite-item-main { flex: 1; min-width: 0; }
.invite-item-label { font-weight: 600; font-size: 13px; margin-bottom: 3px; display: flex; gap: 7px; align-items: center; }
.invite-item-url { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite-item-meta { font-size: 11.5px; color: var(--text-3); margin-top: 4px; display: flex; gap: 12px; flex-wrap: wrap; }
.invite-item-actions { display: flex; gap: 6px; flex: 0 0 auto; }

/* ---------------- 提示条 ---------------- */

.toast-wrap { position: fixed; top: 68px; right: 18px; z-index: 300; display: flex; flex-direction: column; gap: 9px; }
.toast {
  background: #1f2430; color: #fff; padding: 11px 15px; border-radius: 9px;
  font-size: 13px; box-shadow: var(--shadow-lg); max-width: 350px;
  animation: slideIn .18s ease-out;
}
.toast.err { background: var(--red); }
.toast.ok { background: var(--green); }
@keyframes slideIn { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }

/* ---------------- 滚动条 ---------------- */

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cfd6e2; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #b6bfcf; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 窄屏 ---------------- */

@media (max-width: 1180px) {
  .pane-info { width: 250px; }
  .pane-list { width: 258px; }
}
@media (max-width: 900px) {
  .pane-info { display: none; }
  .stat { display: none; }
}
