:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --line: #e5e8ef;
  --text: #1f2329;
  --muted: #646a73;
  --brand: #3370ff;
  --brand-dark: #245bdb;
  --green: #00a870;
  --orange: #f59a23;
  --red: #f54a45;
  --radius: 8px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 0; border-radius: 6px; padding: 9px 14px; background: #f2f4f8; color: var(--text); }
button:disabled { cursor: not-allowed; opacity: .45; }
button.primary { background: var(--brand); color: white; }
button.primary:hover { background: var(--brand-dark); }
button.ghost { background: transparent; border: 1px solid var(--line); }
button.danger { color: white; background: var(--red); }
button.danger-ghost { color: #c9342f; background: #fff1f0; border: 1px solid #f3c2bf; }
button.small { padding: 5px 9px; font-size: 12px; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; background: white; color: var(--text); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(51,112,255,.12); }
/* ===== 下拉框统一美化 ===== */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  padding-right: 34px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23646a73' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
select:hover { border-color: #b6c4e0; background-color: #fbfcff; }
select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(51,112,255,.12); background-color: #fff; }
select:disabled { cursor: not-allowed; opacity: .55; background-color: #f5f7fa; }
select option {
  background: #fff;
  color: var(--text);
  padding: 6px 10px;
}
select option:checked { background: #edf3ff; color: var(--brand); }
select optgroup { background: #f5f7fa; color: var(--muted); font-style: normal; }
select::-ms-expand { display: none; }
/* 小号下拉（表格内）保持紧凑 */
.table-wrap select, .actions select { padding-top: 5px; padding-bottom: 5px; padding-right: 28px; background-position: right 8px center; background-size: 10px 7px; font-size: 12px; }
textarea { min-height: 96px; resize: vertical; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }

.hidden { display: none !important; }
.login-screen { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; padding: 0; background: #fff; }
.login-left { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 0 72px; color: #fff; background: linear-gradient(160deg, #0b2a6b 0%, #1747b8 55%, #2d6fd4 100%); overflow: hidden; }
.login-left::before { content: ""; position: absolute; top: -15%; right: -10%; width: 480px; height: 480px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.12) 0%, rgba(255,255,255,0) 70%); }
.login-left::after { content: ""; position: absolute; bottom: -20%; left: -8%; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(77,143,255,.25) 0%, rgba(77,143,255,0) 70%); }
.login-brand { display: flex; align-items: center; gap: 16px; position: relative; z-index: 1; }
.login-brand .login-logo { width: 56px; height: 56px; border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.login-brand h1 { margin: 0; font-size: 38px; letter-spacing: 3px; }
.login-brand-center { justify-content: flex-start; margin-bottom: 18px; }
.login-brand-center .login-logo { width: 44px; height: 44px; border-radius: 10px; box-shadow: 0 6px 18px rgba(51,112,255,.2); }
.login-brand-center h1 { font-size: 26px; color: var(--text); letter-spacing: 2px; }
.login-slogan { margin: 0 0 6px; font-size: 24px; font-weight: 600; position: relative; z-index: 1; }
.login-hero-card { position: relative; z-index: 1; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); border-radius: 16px; padding: 30px 34px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 16px 40px rgba(0,0,0,.18); }
.login-hero { margin: 0; font-size: 40px; font-weight: 700; line-height: 1.45; letter-spacing: 1px; }
.login-hero-line { height: 2px; width: 44px; background: linear-gradient(90deg, rgba(255,255,255,.85), rgba(255,255,255,0)); margin: 18px 0 16px; border-radius: 2px; }
.login-desc { margin: 0; font-size: 15px; opacity: .8; position: relative; z-index: 1; }
.login-panel { display: flex; flex-direction: column; justify-content: flex-start; align-items: center; background: #fff; padding: 24vh 48px 0; }
.login-card { width: min(380px, 100%); background: #fff; border-radius: 14px; padding: 0; box-shadow: none; }
.login-panel-title h2 { margin: 0 0 8px; font-size: 26px; color: var(--text); }
.login-panel-title p { margin: 0 0 30px; color: var(--muted); font-size: 14px; }
.login-btn { padding: 13px 0; font-size: 16px; border-radius: 8px; margin-top: 6px; }
.login-foot { margin-top: 24px; text-align: center; color: #b0b7c3; font-size: 12px; }
@media (max-width: 920px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-left { display: none; }
  .login-panel { padding: 24px; min-height: 100vh; }
}
.form-stack { display: grid; gap: 14px; margin-top: 22px; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; color: white; background: var(--brand); font-weight: 800; }
.brand-mark.small { width: 30px; height: 30px; border-radius: 7px; }
.login-logo { width: 72px; height: 72px; border-radius: 16px; object-fit: cover; box-shadow: 0 8px 24px rgba(51,112,255,.18); }
.side-logo { width: 88px; height: 88px; border-radius: 16px; object-fit: cover; }
.logo-line strong { font-size: 22px; font-style: italic; letter-spacing: 1px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 224px 1fr; }
.sidebar { background: #fff; border-right: 1px solid var(--line); padding: 18px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.logo-line { display: flex; gap: 10px; align-items: center; padding: 0 6px 18px; }
.sidebar nav { display: grid; gap: 6px; }
.nav-btn { width: 100%; text-align: left; background: transparent; padding: 12px 14px; color: var(--muted); border-radius: 8px; font-size: 14px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 10px; }
.nav-btn .nav-icon { width: 18px; height: 18px; flex: 0 0 18px; color: #9aa3b2; }
.nav-btn:hover { background: #f2f5fc; color: var(--text); }
.nav-btn:hover .nav-icon { color: var(--brand); }
.nav-btn.active { background: #edf3ff; color: var(--brand); font-weight: 700; }
.nav-btn.active .nav-icon { color: var(--brand); }
.workspace { min-width: 0; }
.topbar { height: 76px; background: rgba(255,255,255,.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; position: sticky; top: 0; z-index: 2; }
.topbar h2 { margin: 0 0 4px; font-size: 20px; }
.topbar p { margin: 0; color: var(--muted); font-size: 13px; }
.user-chip { display: flex; align-items: center; gap: 8px; }
.user-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: #edf3ff; border: 1px solid var(--line); flex: 0 0 auto; }
.user-avatar[src=""], .user-avatar:not([src]) { display: none; }
.user-avatar + #userName { margin-left: 0; }
/* 顶栏按钮：飞书式商务简洁风（无按压位移、无发光阴影、hover 浅灰） */
.topbar .user-chip button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  border-radius: 6px;
  font-size: 13px;
  line-height: 1;
  transition: background-color .12s ease, color .12s ease;
  transform: none !important;
  box-shadow: none !important;
}
.topbar .user-chip button svg { width: 17px; height: 17px; display: block; }
.topbar .user-chip button:hover:not(:disabled) { background: #f2f3f5; }
.topbar .user-chip button:active:not(:disabled) { transform: none !important; }
.topbar .user-chip button.ghost { border: 0; background: transparent; }
.topbar .user-chip button.primary { background: var(--brand); color: #fff; box-shadow: none !important; }
.topbar .user-chip button.primary:hover:not(:disabled) { background: var(--brand-dark); }
/* 悬停显示文字提示（data-tip 气泡） */
.topbar .user-chip button[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(31,35,41,.92);
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  padding: 5px 9px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 50;
  transition: opacity .12s ease, visibility .12s ease;
  box-shadow: 0 4px 12px rgba(31,35,41,.18);
}
.topbar .user-chip button[data-tip]:hover::after { opacity: 1; visibility: visible; }
body.dark .topbar .user-chip button:hover:not(:disabled) { background: #2a3040; }
body.dark .topbar .user-chip button.primary { background: var(--brand); }
body.dark .topbar .user-chip button[data-tip]::after { background: rgba(255,255,255,.92); color: #1f2329; box-shadow: 0 4px 12px rgba(0,0,0,.35); }
#content { padding: 24px 28px 36px; display: grid; gap: 18px; }

.stats { display: grid; grid-template-columns: repeat(6, minmax(110px, 1fr)); gap: 14px; }
.call-stats-panel { padding-bottom: 18px; }
.call-stats { display: grid; grid-template-columns: repeat(5, minmax(110px, 1fr)); gap: 14px; }

/* ===== 工作台新样式：彩色统计卡片 ===== */
.dash-section { padding: 16px; }
.color-stats { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 12px; }
.color-stats.four { grid-template-columns: repeat(4, minmax(140px, 1fr)); }
.color-stat { border-radius: 12px; color: #fff; padding: 16px 14px; display: grid; gap: 8px; box-shadow: 0 8px 20px rgba(31,35,41,.10); }
.color-stat span { font-size: 12px; opacity: .9; }
.color-stat strong { font-size: 26px; line-height: 1; }
.color-stat em { font-size: 11px; font-style: normal; opacity: .85; }
.rank-tabs { display: flex; gap: 6px; }
.rank-tab { padding: 6px 14px; border-radius: 999px; background: #f2f4f8; color: var(--muted); font-size: 13px; border: 0; cursor: pointer; }
.rank-tab.active { background: var(--brand); color: #fff; }

@media (max-width: 1100px) {
  .color-stats { grid-template-columns: repeat(3, 1fr); }
  .color-stats.four { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .color-stats { grid-template-columns: repeat(2, 1fr); }
  .color-stat strong { font-size: 20px; }
}

/* ===== 工作台左右两栏 ===== */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.dash-left { display: grid; gap: 18px; min-width: 0; }
.dash-right { display: grid; gap: 18px; position: sticky; top: 94px; }
.dash-user { background: #fff; color: var(--text); border: 1px solid var(--line); }
.dash-user .dash-user-head { display: flex; align-items: center; gap: 12px; }
.dash-avatar { width: 44px; height: 44px; border-radius: 50%; background: #eef4ff; color: var(--brand); display: grid; place-items: center; font-size: 20px; font-weight: 700; }
.dash-user-head strong { font-size: 16px; display: block; }
.dash-user-head .muted { color: var(--muted); font-size: 12px; }
.dash-user-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.dash-user-stats > div { background: #f5f7fa; border-radius: 10px; padding: 10px 8px; text-align: center; }
.dash-user-stats span { display: block; font-size: 11px; color: var(--muted); }
.dash-user-stats strong { display: block; margin-top: 4px; font-size: 17px; }
.dash-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dash-quick button { padding: 13px 0; border-radius: 8px; font-size: 14px; background: #f2f4f8; color: var(--text); }
.dash-quick button:hover { background: #e8edf5; }
.dash-quick button.primary { background: var(--brand); color: #fff; }
.dash-quick button.primary:hover { background: var(--brand-dark); }
.dash-status-list { display: grid; gap: 9px; }
.dash-status-item { display: grid; grid-template-columns: 74px 1fr 34px; align-items: center; gap: 10px; }
.dash-status-item .badge { justify-content: center; }
.dash-status-bar { height: 8px; background: #eef1f6; border-radius: 99px; overflow: hidden; }
.dash-status-bar i { display: block; height: 100%; border-radius: 99px; transition: width .4s; }
.dash-status-item strong { text-align: right; font-size: 14px; }
.dash-rank .lb-item { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.dash-rank .lb-item:last-child { border-bottom: 0; }
.lb-rank { width: 24px; height: 24px; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; flex: 0 0 24px; }
.lb-main { flex: 1; min-width: 0; }
.lb-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lb-row strong { font-size: 13px; }
.lb-rate { font-size: 13px; font-weight: 700; color: var(--brand); }
.lb-bar { height: 6px; background: #eef1f6; border-radius: 99px; margin: 6px 0 4px; overflow: hidden; }
.lb-bar i { display: block; height: 100%; border-radius: 99px; }
.lb-sub { font-size: 11px; color: var(--muted); }

@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-right { position: static; grid-template-columns: repeat(2, 1fr); }
}
.stat-card, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.stat-card { padding: 16px; }
.stat-card span { color: var(--muted); font-size: 13px; }
.stat-card strong { display: block; margin-top: 8px; font-size: 28px; }
.panel { padding: 16px; overflow: hidden; }
.panel-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-head h3 { margin: 0; font-size: 16px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar input, .toolbar select { width: auto; min-width: 150px; }
.toolbar .compact-field { min-width: 150px; color: var(--muted); }
.toolbar .compact-field input { width: 100%; min-width: 0; }

/* ===== 筛选区规整布局 ===== */
.filter-block { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fbfcff; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.filter-row:last-child { margin-bottom: 0; }
.filter-search { flex: 1; min-width: 200px; }
.filter-toggle { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.filter-adv { display: none; }
.filter-adv.open { display: block; }
.filter-grid { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 10px; padding: 10px 0; }
.filter-grid label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
.filter-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px dashed var(--line); padding-top: 10px; }
.filter-spacer { flex: 1; }
@media (max-width: 920px) {
  .filter-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-search { min-width: 100%; }
}
.grid-form { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 10px; align-items: end; margin-bottom: 14px; }
.grid-form .wide { grid-column: span 2; }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.rec-cell { display: flex; align-items: center; gap: 8px; }
.rec-download { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--brand); text-decoration: none; white-space: nowrap; padding: 3px 8px; border: 1px solid var(--brand); border-radius: 6px; }
.rec-download:hover { background: #edf3ff; }
table { width: 100%; border-collapse: collapse; min-width: 860px; background: white; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: 13px; }
td { max-width: 360px; overflow-wrap: anywhere; word-break: break-word; }
th { color: var(--muted); font-weight: 600; background: #fbfcff; position: sticky; top: 0; }
.phone-cell { white-space: nowrap; word-break: normal; }
.dial-btn { margin-left: 6px; padding: 3px 8px; font-size: 12px; background: #e8f8f2; color: var(--green); border: 1px solid #bfe8d8; border-radius: 6px; }
.dial-btn:hover { background: var(--green); color: #fff; }
tr:hover td { background: #fbfdff; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 8px; font-size: 12px; background: #eef1f6; color: var(--muted); white-space: nowrap; }
.badge.seat-on { background: #00c97e; color: #fff; font-weight: 600; box-shadow: 0 0 8px rgba(0,201,126,.55), 0 0 2px rgba(0,201,126,.8), 0 1px 2px rgba(31,35,41,.08); }
.badge.seat-off { background: #eef1f6; color: var(--muted); box-shadow: none; }
.badge.added, .badge.connected { background: #e8f8f2; color: var(--green); }
.badge.not_added, .badge.not_connected { background: #fff3e0; color: #b76b00; }
.badge.blacklisted { background: #ffeceb; color: #c9342f; }
.badge.pending { background: #edf3ff; color: var(--brand); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.toast { position: fixed; right: 22px; bottom: 22px; background: #1f2329; color: white; padding: 12px 14px; border-radius: 8px; box-shadow: 0 10px 30px rgba(31,35,41,.18); z-index: 9; }

/* ===== 软电话拨号盘 ===== */
.softphone-fab { position: fixed; left: 20px; bottom: 24px; width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(135deg, #00c97e 0%, #00a870 100%); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0,168,112,.4); cursor: pointer; z-index: 30; border: 0; font-size: 22px; transition: transform .15s; }
.softphone-fab:hover { transform: scale(1.06); }
.softphone-fab.active { background: linear-gradient(135deg, #00b070 0%, #008a5c 100%); box-shadow: 0 8px 24px rgba(0,168,112,.5); }
.softphone-fab .fab-dot { position: absolute; top: 2px; right: 2px; width: 12px; height: 12px; border-radius: 50%; background: #00d68f; border: 2px solid #fff; display: none; }
.softphone-fab .fab-dot.on { display: block; background: #00d68f; }
.softphone-fab .fab-dot.busy { display: block; background: #ff9f43; }
.softphone-panel { position: fixed; left: 20px; bottom: 88px; width: 300px; background: #fff; border: 1px solid #eef0f4; border-radius: 16px; box-shadow: 0 20px 60px rgba(31,35,41,.18); z-index: 31; overflow: hidden; display: none; max-height: calc(100vh - 110px); flex-direction: column; }
.softphone-panel.open { display: flex; }
.softphone-head, .softphone-sipbar, .softphone-number, .softphone-kb, .softphone-actions, .softphone-foot, .sp-call-panel { flex: 0 0 auto; }
.sp-settings-tab { position: absolute; right: -70px; top: 50%; transform: translateY(-50%); background: linear-gradient(135deg, #00c97e 0%, #00a870 100%); color: #fff; font-size: 13px; font-weight: 600; padding: 10px 8px; border-radius: 0 10px 10px 0; cursor: pointer; box-shadow: 0 4px 12px rgba(0,168,112,.35); writing-mode: vertical-rl; letter-spacing: 3px; z-index: 2; }
.sp-settings-tab:hover { filter: brightness(1.08); }
.softphone-head { background: var(--panel); color: var(--text); padding: 14px 16px 0; display: flex; align-items: center; justify-content: space-between; }
.softphone-sipbar { text-align: center; padding: 8px 16px 10px; border-bottom: 1px solid #f3f5f9; }
.softphone-sipbar .sp-status { display: inline-block; font-size: 13px; font-weight: 600; color: #c9342f; background: #fff1f0; border: 1px solid #f3c2bf; border-radius: 999px; padding: 3px 14px; }
.softphone-sipbar .sp-status.on { color: #00875a; background: #e8f8f2; border-color: #bfe8d8; }
.softphone-sipbar .sp-status.warn { color: #b76b00; background: #fff3e0; border-color: #f5d9a8; }
.sp-head-right { display: flex; align-items: center; gap: 10px; }
.sp-signal { color: #00c97e; display: grid; place-items: center; }
.call-settings-modal { width: min(480px, 100%); }
.softphone-number { padding: 14px 16px 6px; text-align: center; }
.softphone-number .sp-display { font-size: 24px; font-weight: 700; letter-spacing: 2px; min-height: 32px; color: var(--text); word-break: break-all; }
.softphone-number .sp-sub { font-size: 12px; color: var(--muted); min-height: 18px; margin-top: 4px; }
.softphone-kb { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px 16px 14px; }
.softphone-kb button { padding: 0; height: 56px; width: 56px; justify-self: center; border-radius: 50%; font-size: 20px; background: #f5f7fb; border: 0; cursor: pointer; color: var(--text); display: grid; place-items: center; }
.softphone-kb button:hover { background: #eaf0ff; color: var(--brand); }
.softphone-kb button.sp-del { font-size: 15px; color: #c9342f; }
.softphone-kb button.sp-paste { font-size: 13px; }
.softphone-actions { display: flex; gap: 10px; padding: 0 16px 14px; justify-content: center; }
.softphone-actions button { padding: 13px 0; border-radius: 999px; font-size: 15px; border: 0; cursor: pointer; flex: 1; max-width: 140px; }
.sp-call { background: linear-gradient(135deg, #00c97e 0%, #00a870 100%); color: #fff; }
.sp-call:hover { filter: brightness(1.05); }
.sp-hangup { background: #e93b3b; color: #fff; }
.sp-hangup:hover { filter: brightness(1.05); }
.softphone-timer { text-align: center; font-size: 26px; font-weight: 700; color: var(--text); padding: 8px 0 2px; }
.sp-call-panel { padding: 10px 14px 14px; display: none; }
.sp-call-panel.on { display: block; }
.softphone-foot { font-size: 11px; color: var(--muted); text-align: center; padding-bottom: 10px; }

/* ===== 通话结果标记弹窗 ===== */
.call-mark-modal { width: min(460px, 100%); }
.call-mark-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.call-mark-info > div { background: #f5f7fb; border-radius: 10px; padding: 10px; text-align: center; }
.call-mark-info span { display: block; font-size: 11px; color: var(--muted); }
.call-mark-info strong { display: block; margin-top: 4px; font-size: 15px; }
.call-mark-section { margin-bottom: 12px; }
.call-mark-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.call-mark-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.mark-opt { padding: 9px 14px; border-radius: 8px; background: #f5f7fb; border: 1px solid var(--line); font-size: 13px; color: var(--text); }
.mark-opt:hover { border-color: var(--brand); color: var(--brand); }
.mark-opt.sel { background: var(--brand); color: #fff; border-color: var(--brand); }
.mark-opt.mark-intent { min-width: 48px; text-align: center; font-weight: 700; }
#markRemark { min-height: 64px; }

/* ===== 跟进记录 ===== */
.follow-write { display: grid; gap: 8px; margin-bottom: 14px; }
.follow-write textarea { min-height: 72px; }
.follow-write button { justify-self: end; }
.follow-list { display: grid; gap: 10px; max-height: 320px; overflow: auto; }
.follow-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fbfcff; }
.follow-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 12px; }
.follow-content { font-size: 13px; color: var(--text); line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.list-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.list-summary span { color: var(--muted); font-size: 13px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; color: var(--muted); font-size: 13px; }
.pager > div { display: flex; align-items: center; gap: 8px; }
.pager strong { color: var(--text); font-weight: 600; white-space: nowrap; }
.modal-layer { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(31,35,41,.28); z-index: 20; }
.modal { width: min(520px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: white; border-radius: 10px; border: 1px solid var(--line); box-shadow: 0 24px 80px rgba(31,35,41,.22); overflow: hidden; }
.modal-large { width: min(1120px, 100%); }
.modal-head, .modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { display: grid; gap: 14px; padding: 16px; overflow: auto; }
.modal-foot { justify-content: flex-end; border-top: 1px solid var(--line); border-bottom: 0; }
.check-list { display: grid; gap: 8px; max-height: 280px; overflow: auto; }
.check-row { display: flex; grid-template-columns: none; flex-direction: row; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--text); }
.check-row input { width: auto; }


.allocation-grid { display: grid; grid-template-columns: 1.2fr .9fr 1fr; gap: 18px; align-items: stretch; }
.allocation-grid > .panel { min-width: 0; border-radius: 12px; display: flex; flex-direction: column; }
.allocation-grid > .panel > .panel-head { flex: 0 0 auto; }
.allocation-grid > .panel > *:not(.panel-head) { flex: 0 0 auto; }
.allocation-grid > .panel > #allocationEmployeeList { flex: 1 1 auto; min-height: 120px; }
.allocation-grid > .panel:last-child { justify-content: space-between; }
.allocation-grid .panel-head h3 { display: flex; align-items: center; gap: 8px; }
.allocation-grid .panel-head h3::before { content: attr(data-step); display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 12px; flex: 0 0 22px; }
.allocation-form { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
.allocation-form button { align-self: end; }
.allocation-employees { display: grid; gap: 10px; max-height: 420px; overflow: auto; padding-right: 4px; }
.allocation-employee { display: flex; grid-template-columns: none; flex-direction: row; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcff; color: var(--text); }
.allocation-employee input { width: auto; }
.allocation-employee strong { display: block; font-size: 14px; }
.allocation-employee span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.allocation-preview-table { margin-top: 12px; max-height: 360px; }
.allocation-preview-table table { min-width: 520px; }
.allocation-confirm { justify-content: flex-end; margin-top: 12px; }

.pool-switches { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 14px; }
.pool-switch { display: grid; gap: 8px; justify-items: start; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: white; text-align: left; box-shadow: 0 8px 24px rgba(31,35,41,.04); }
.pool-switch span { color: var(--muted); font-size: 14px; }
.pool-switch strong { color: var(--text); font-size: 30px; line-height: 1; }
.pool-switch.active { border-color: var(--brand); background: #edf3ff; box-shadow: 0 10px 28px rgba(51,112,255,.12); }
.pool-switch.active span, .pool-switch.active strong { color: var(--brand); }
.detail-stats { display: grid; grid-template-columns: repeat(6, minmax(100px, 1fr)); gap: 10px; }
.detail-stats div { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fbfcff; }
.detail-stats span { display: block; color: var(--muted); font-size: 12px; }
.detail-stats strong { display: block; margin-top: 4px; font-size: 20px; }
.detail-table { max-height: 440px; }
.mobile-only { display: none; }
.mobile-cards { display: grid; gap: 12px; }
.customer-card { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 14px; display: grid; gap: 12px; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-top > div { min-width: 0; }
.card-top strong { display: block; font-size: 17px; }
.card-top span:not(.badge) { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; word-break: break-word; }
.phone-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 8px; color: var(--brand); background: #edf3ff; text-decoration: none; font-weight: 700; }
.phone-link b { padding: 6px 10px; border-radius: 6px; color: white; background: var(--brand); font-size: 13px; }
.card-meta { color: var(--muted); font-size: 13px; line-height: 1.5; }
.card-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.card-actions button { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 8px; color: #1f2329; background: #f2f4f8; border: 1px solid #e5e8ef; font-weight: 600; line-height: 1.25; white-space: nowrap; appearance: none; -webkit-appearance: none; }
.card-actions .mark-added { color: #087f5b; background: #e8f8f2; border-color: #c9ecdf; }
.card-actions .mark-not-added, .card-actions .mark-not-connected { color: #9a5b00; background: #fff3e0; border-color: #f3d7ad; }
.card-actions .mark-blacklisted { color: #c9342f; background: #ffeceb; border-color: #f3c2bf; }
.card-actions .note-action { grid-column: 1 / -1; color: var(--brand); background: #edf3ff; border-color: #d5e2ff; }
.employee-list-toolbar { margin-bottom: 12px; }

.offboarding-person { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 16px; border: 1px solid #d5e2ff; border-radius: 8px; background: #f6f9ff; }
.offboarding-person > div { display: grid; gap: 4px; }
.offboarding-person > div:last-child { text-align: right; }
.offboarding-person span { color: var(--muted); font-size: 13px; }
.offboarding-person strong { font-size: 18px; }
.offboarding-shortcuts { padding-bottom: 2px; }
.offboarding-status-list { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.offboarding-status-head, .offboarding-status-row { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(260px, 1.2fr); gap: 14px; align-items: center; padding: 11px 14px; }
.offboarding-status-head { color: var(--muted); background: #fbfcff; font-size: 12px; font-weight: 600; }
.offboarding-status-row { border-top: 1px solid var(--line); }
.offboarding-status-row > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.offboarding-status-row span { color: var(--muted); font-size: 13px; }
.offboarding-status-row strong { white-space: nowrap; }
.offboarding-status-row select { min-width: 0; }
.field-help { color: var(--muted); font-size: 12px; line-height: 1.5; }
.offboarding-warning { padding: 10px 12px; border-radius: 6px; color: #9a5b00; background: #fff3e0; font-size: 13px; }
.offboarding-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.offboarding-summary > span { padding: 11px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fbfcff; color: var(--muted); font-size: 13px; line-height: 1.5; }
.offboarding-summary strong { color: var(--text); }
.summary-error { color: #c9342f; }
.confirm-row { display: flex; grid-template-columns: none; flex-direction: row; align-items: flex-start; gap: 9px; padding: 12px; border: 1px solid #f3c2bf; border-radius: 6px; color: var(--text); background: #fff8f7; }
.confirm-row input { width: auto; margin-top: 2px; }

@media (max-width: 920px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar nav { grid-template-columns: repeat(2, 1fr); }
  .nav-btn { text-align: center; white-space: normal; }
  .topbar { position: static; padding: 14px 16px; height: auto; gap: 12px; align-items: flex-start; }
  #content { padding: 16px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .call-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-form { grid-template-columns: 1fr; }
  .grid-form .wide { grid-column: span 1; }
  


  .allocation-grid { grid-template-columns: 1fr; }
  .allocation-form { grid-template-columns: 1fr; }
  .allocation-employees { max-height: none; }
  .pool-switches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pool-switch { padding: 14px; }
  .pool-switch strong { font-size: 24px; }
  .detail-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .offboarding-summary { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; }
  .toolbar input, .toolbar select, .toolbar button { width: 100%; min-width: 0; }
  .toolbar .compact-field { width: 100%; min-width: 0; }
  .desktop-only { display: none; }
  .mobile-only { display: block; }
  .mine-panel { padding: 12px; border: 0; background: transparent; }
  .mine-panel .panel-head { padding: 0 2px; }
  .login-panel { padding: 24px; }
  .topbar { flex-direction: column; }
  .user-chip { width: 100%; justify-content: space-between; }
  .pager { align-items: flex-start; flex-direction: column; }
  .pager > div { width: 100%; justify-content: space-between; }
  .pager button { min-height: 42px; }
}

@media (max-width: 560px) {
  .sidebar { padding: 14px 10px; }
  .sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-btn { min-width: 0; padding: 11px 8px; text-align: center; white-space: normal; }
  #content { padding: 12px; }
  .stats { gap: 10px; }
  .stat-card { padding: 13px; }
  .stat-card strong { font-size: 24px; }
  .panel-head { align-items: flex-start; }
  .card-top { align-items: flex-start; }
  .modal-layer { padding: 8px; }
  .modal { max-height: calc(100vh - 16px); }
  .offboarding-person { align-items: flex-start; flex-direction: column; }
  .offboarding-person > div:last-child { text-align: left; }
  .offboarding-status-head { display: none; }
  .offboarding-status-row { grid-template-columns: 1fr; gap: 8px; }
  /* 移动端客户卡片 */
  .desktop-table { display: none; }
  .m-card-list { display: grid; gap: 10px; }
  .m-card { position: relative; display: flex; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; box-shadow: 0 4px 14px rgba(31,35,41,.05); }
  .m-card-check { display: flex; align-items: flex-start; padding-top: 2px; }
  .m-card-check input { width: 18px; height: 18px; }
  .m-card-body { flex: 1; min-width: 0; display: grid; gap: 8px; }
  .m-card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .m-card-top strong { font-size: 16px; }
  .m-card-phone { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--text); }
  .m-dial { margin-left: 0; padding: 6px 14px; font-size: 13px; border-radius: 999px; }
  .m-card-meta { font-size: 12px; color: var(--muted); }
  .m-actions { gap: 6px; }
  .m-actions button { padding: 7px 12px; font-size: 13px; border-radius: 999px; }
  .m-card-list + .table-wrap, .m-card-list ~ .table-wrap { display: none; }
}
@media (min-width: 561px) {
  .m-card-list { display: none; }
}

/* ===== 细节质感美化（v2） ===== */

/* 1. 自定义滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cdd3de; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #a9b4c4; }
* { scrollbar-width: thin; scrollbar-color: #cdd3de transparent; }

/* 2. 按钮过渡与按压反馈 */
button { transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .08s ease, filter .15s ease; }
button:active:not(:disabled) { transform: translateY(1px); }
button.primary { box-shadow: 0 4px 12px rgba(51,112,255,.22); }
button.primary:hover { box-shadow: 0 6px 16px rgba(51,112,255,.30); }
button.danger { box-shadow: 0 4px 12px rgba(245,74,69,.20); }
button.small { box-shadow: none; }

/* 3. 弹窗弹出动画 */
.modal { animation: modalIn .18s ease-out; }
@keyframes modalIn { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-layer { animation: layerIn .15s ease-out; }
@keyframes layerIn { from { opacity: 0; } to { opacity: 1; } }

/* 4. 提示气泡动画 */
.toast { animation: toastIn .2s ease-out; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* 5. 分页器美化 */
.pager button { border-radius: 999px; padding: 6px 14px; font-size: 13px; background: #f2f4f8; border: 1px solid var(--line); color: var(--text); }
.pager button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); background: #edf3ff; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }
.pager strong { background: #edf3ff; color: var(--brand); padding: 3px 12px; border-radius: 999px; font-weight: 600; }

/* 6. 复选框/单选上色（保持原生形态但统一品牌色；不覆盖移动端卡片的大勾选框） */
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); cursor: pointer; }
.m-card-check input, .table-wrap input[type="checkbox"] { width: 16px; height: 16px; }

/* 7. 输入框占位符颜色统一 */
::placeholder { color: #b6bdc9; opacity: 1; }

/* 8. 隐藏数字输入框默认箭头 */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

/* 9. 面板层次：主面板带轻微阴影 */
.panel { box-shadow: 0 2px 10px rgba(31,35,41,.04); transition: box-shadow .18s ease; }
.panel:hover { box-shadow: 0 4px 16px rgba(31,35,41,.07); }

/* 10. 表格行 hover 过渡 */
tr { transition: background .1s ease; }
tr:hover td { background: #f6f9ff; }

/* 11. 表头吸顶加下阴影 */
th { box-shadow: 0 1px 0 var(--line); }

/* 12. 空状态图标感（仅 div 空态，避免破坏表格 td.empty） */
div.empty { font-size: 14px; color: #9aa3b2; display: grid; place-items: center; gap: 8px; padding: 36px 20px; }
div.empty::before { content: "📭"; font-size: 26px; }
td.empty { padding: 28px 12px; text-align: center; }

/* 13. 状态标签微调：加轻投影更立体 */
.badge { box-shadow: 0 1px 2px rgba(31,35,41,.05); }

/* 14. 彩色统计卡片 hover 轻微上浮 */
.color-stat { transition: transform .15s ease, box-shadow .15s ease; }
.color-stat:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(31,35,41,.14); }

/* 15. 移动端卡片 hover 反馈（桌面端也生效） */
.customer-card { transition: box-shadow .15s ease, transform .15s ease; }
.customer-card:hover { box-shadow: 0 6px 18px rgba(31,35,41,.08); }

/* ===== 优化项新增样式（v3） ===== */
/* 跟进记录编辑/删除按钮 */
.follow-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 8px; }
.follow-actions button { padding: 4px 10px; font-size: 12px; }
/* 手机端卡片标签组 */
.card-meta-tags { display: flex; flex-wrap: wrap; gap: 6px; }
/* 分配中心分页 */
.alloc-pager { display: inline-flex; gap: 6px; margin-left: 10px; }
.alloc-pager button:disabled { opacity: .4; cursor: not-allowed; }

/* ===== 优化项新增样式（v3） ===== */
/* 跟进记录编辑/删除按钮 */
.follow-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 8px; }
.follow-actions button { padding: 4px 10px; font-size: 12px; }
/* 手机端卡片标签组 */
.card-meta-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
/* 分配中心分页 */
.alloc-pager { display: inline-flex; gap: 6px; margin-left: 10px; vertical-align: middle; }
.alloc-pager button:disabled { opacity: .4; cursor: not-allowed; }
/* 分配摘要行 */
#allocCandidateSummary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ===== 第二批优化新增样式（v4） ===== */
/* 最近通话快速重拨 */
.sp-recent { display: none; padding: 0 16px 10px; border-top: 1px solid #f3f5f9; margin-top: 4px; overflow-y: auto; max-height: 170px; flex: 0 1 auto; }
.sp-recent.has-items { display: block; }
.sp-recent::-webkit-scrollbar { width: 6px; }
.sp-recent::-webkit-scrollbar-thumb { background: #cdd3de; border-radius: 99px; }
.sp-recent-title { font-size: 12px; color: var(--muted); margin: 10px 0 6px; }
.sp-recent-item { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 8px 10px; margin-bottom: 4px; border-radius: 8px; background: #f5f7fb; border: 1px solid transparent; font-size: 13px; }
.sp-recent-item:hover { border-color: var(--brand); color: var(--brand); }
.sp-recent-item b { color: var(--green); font-size: 12px; font-weight: 600; }
/* 客户流转历史时间线 */
.history-list { display: grid; gap: 8px; max-height: 420px; overflow: auto; }
.history-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fbfcff; }
.history-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12px; }
.history-action { display: inline-block; padding: 2px 10px; border-radius: 999px; background: #edf3ff; color: var(--brand); font-weight: 600; font-size: 12px; }
.history-detail { margin-top: 6px; font-size: 13px; color: var(--text); line-height: 1.5; }
/* 工作台未跟进提醒卡片 */
.dash-unfollow { display: grid; gap: 8px; }
.dash-unfollow strong { font-size: 28px; line-height: 1; }
.dash-unfollow p { margin: 0; font-size: 13px; line-height: 1.5; }
.dash-unfollow button { justify-self: start; }

/* ===== 第三批优化新增样式（v5） ===== */
/* 近7天外呼趋势图 */
.dash-trend { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; padding-top: 10px; }
.dash-trend-col { display: grid; gap: 4px; justify-items: center; text-align: center; }
.dash-trend-bar { height: 64px; display: flex; align-items: flex-end; width: 100%; max-width: 34px; }
.dash-trend-bar i { display: block; width: 100%; background: linear-gradient(180deg, var(--brand) 0%, #7fa8ff 100%); border-radius: 6px 6px 2px 2px; min-height: 4px; transition: height .3s; }
.dash-trend-col span { font-size: 11px; color: var(--muted); }
.dash-trend-col strong { font-size: 13px; color: var(--text); }
/* 公告横幅 */
.notice-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid #f5d9a8; background: #fffaf0; border-radius: 10px; }
.notice-badge { flex: 0 0 auto; padding: 3px 10px; border-radius: 999px; background: var(--orange); color: #fff; font-size: 12px; font-weight: 700; }
.notice-text { flex: 1; min-width: 0; font-size: 13px; line-height: 1.5; }
.notice-text strong { color: var(--text); }
.notice-bar .ghost { flex: 0 0 auto; border: 0; background: transparent; font-size: 16px; color: var(--muted); }
/* 深色模式 */
body.dark { --bg: #151821; --panel: #1d212c; --line: #2c3240; --text: #e6e9ef; --muted: #9aa3b2; background: var(--bg); color: var(--text); }
body.dark .panel, body.dark .stat-card, body.dark .customer-card, body.dark .m-card { background: var(--panel); }
body.dark .sidebar, body.dark .topbar { background: var(--panel); }
body.dark th { background: #232836; }
body.dark tr:hover td { background: #232836; }
body.dark input, body.dark select, body.dark textarea { background: #232836; color: var(--text); border-color: var(--line); }
body.dark .filter-block, body.dark .follow-item, body.dark .history-item, body.dark .allocation-employee { background: #232836; }
body.dark .softphone-panel { background: var(--panel); border-color: var(--line); }
body.dark .toast { background: #e6e9ef; color: #1f2329; }
/* 移动端底部导航 */
@media (max-width: 920px) {
  .app-shell { grid-template-columns: 1fr; padding-bottom: 64px; }
  .sidebar { position: fixed; bottom: 0; left: 0; right: 0; top: auto; height: 60px; z-index: 40; border-top: 1px solid var(--line); border-bottom: 0; display: block; }
  .sidebar .logo-line { display: none; }
  .sidebar nav { grid-template-columns: repeat(4, 1fr); gap: 2px; }
  .nav-btn { flex-direction: column; gap: 2px; padding: 6px 2px; font-size: 10px; border-radius: 8px; }
  .nav-btn .nav-icon { width: 18px; height: 18px; }
  .sidebar nav .nav-btn:nth-child(n+5) { display: none; } /* 最多显示4个主要菜单 */
}

/* ===== 深色模式补充适配（v6 修复：按钮/表格/弹窗/下拉框/标签） ===== */
/* 滚动条与占位符 */
body.dark ::-webkit-scrollbar-thumb { background: #3a4256; }
body.dark ::-webkit-scrollbar-thumb:hover { background: #4a5468; }
body.dark * { scrollbar-color: #3a4256 transparent; }
body.dark ::placeholder { color: #6b7488; }

/* 按钮基础：默认按钮深色化，主/危险按钮保持品牌色 */
body.dark button { color: var(--text); }
body.dark button:not(.primary):not(.danger):not(.ghost):not(.cs-trigger) { background: #2a3040; }
body.dark button:not(.primary):not(.danger):not(.ghost):not(.cs-trigger):hover:not(:disabled) { background: #333b4f; }
body.dark button.ghost { background: transparent; border-color: var(--line); }
body.dark button.ghost:hover:not(:disabled) { background: #232836; }
body.dark button.danger-ghost { color: #ff8a85; background: #3a2626; border-color: #6b3a3a; }
body.dark button.primary { background: var(--brand); color: #fff; }
body.dark button.danger { background: var(--red); color: #fff; }

/* 导航 */
body.dark .nav-btn:hover { background: #232836; }
body.dark .nav-btn.active { background: #26314d; }
body.dark .nav-btn.active .nav-icon { color: #7fa8ff; }

/* 分页器 */
body.dark .pager button { background: #2a3040; color: var(--text); }
body.dark .pager button:hover:not(:disabled) { background: #26314d; border-color: var(--brand); color: #7fa8ff; }
body.dark .pager strong { background: #26314d; color: #7fa8ff; }

/* 工作台 */
body.dark .rank-tab { background: #2a3040; color: var(--muted); }
body.dark .rank-tab.active { background: var(--brand); color: #fff; }
body.dark .dash-quick button { background: #2a3040; color: var(--text); }
body.dark .dash-quick button:hover { background: #333b4f; }
body.dark .dash-user-stats > div { background: #232836; }
body.dark .dash-status-bar { background: #2c3240; }
body.dark .lb-bar { background: #2c3240; }
body.dark .dash-avatar { background: #26314d; color: #7fa8ff; }

/* 表格 */
body.dark table { background: #1d212c; }
body.dark td { border-color: var(--line); }

/* 弹窗与遮罩 */
body.dark .modal { background: #1d212c; border-color: var(--line); }
body.dark .modal-head, body.dark .modal-foot { border-color: var(--line); }

/* 面板/卡片/统计块 */
body.dark .detail-stats div { background: #232836; }
body.dark .pool-switch { background: #1d212c; }
body.dark .pool-switch.active { background: #26314d; }
body.dark .phone-link { background: #26314d; }
body.dark .call-mark-info > div { background: #232836; }
body.dark .sp-recent-item { background: #232836; }
body.dark .sp-recent { border-color: var(--line); }
body.dark .offboarding-person { background: #1f2637; border-color: #35436b; }
body.dark .offboarding-status-head { background: #232836; }
body.dark .offboarding-warning { color: #f0b429; background: #3a2f1f; }
body.dark .offboarding-summary > span { background: #232836; }
body.dark .confirm-row { background: #332427; border-color: #6b3a3a; color: var(--text); }
body.dark .notice-bar { background: #2b2416; border-color: #5c4a2c; }
body.dark .notice-text strong { color: var(--text); }
body.dark .notice-bar .ghost { color: var(--muted); }

/* 状态标签 */
body.dark .badge { background: #2c3240; color: var(--muted); }
body.dark .badge.seat-on { background: #00c97e; color: #fff; box-shadow: 0 0 10px rgba(0,201,126,.6); }
body.dark .badge.seat-off { background: #2c3240; color: #8a93a5; }
body.dark .badge.added, body.dark .badge.connected { background: #1f3a33; color: #4ade80; }
body.dark .badge.not_added, body.dark .badge.not_connected { background: #3a2f1f; color: #f0b429; }
body.dark .badge.blacklisted { background: #3a2626; color: #ff8a85; }
body.dark .badge.pending { background: #26314d; color: #7fa8ff; }

/* 拨打按钮与卡片操作按钮 */
body.dark .dial-btn { background: #1f3a33; color: #4ade80; border-color: #2c5c4b; }
body.dark .dial-btn:hover { background: var(--green); color: #fff; }
body.dark .rec-download:hover { background: #26314d; }
body.dark .card-actions button { background: #2a3040; border-color: #3a4152; color: var(--text); }
body.dark .card-actions .mark-added { color: #4ade80; background: #1f3a33; border-color: #2c5c4b; }
body.dark .card-actions .mark-not-added, body.dark .card-actions .mark-not-connected { color: #f0b429; background: #3a2f1f; border-color: #5c4a2c; }
body.dark .card-actions .mark-blacklisted { color: #ff8a85; background: #3a2626; border-color: #6b3a3a; }
body.dark .card-actions .note-action { color: #7fa8ff; background: #26314d; border-color: #35436b; }

/* 通话标记弹窗选项与拨号盘 */
body.dark .mark-opt { background: #2a3040; color: var(--text); }
body.dark .mark-opt:hover { border-color: var(--brand); color: #7fa8ff; }
body.dark .softphone-kb button { background: #2a3040; color: var(--text); }
body.dark .softphone-kb button:hover { background: #333b4f; color: #7fa8ff; }
body.dark .softphone-kb button.sp-del { color: #ff8a85; }
body.dark .softphone-sipbar { border-color: var(--line); }
body.dark .sp-status { color: #ff8a85; background: #3a2626; border-color: #6b3a3a; }
body.dark .sp-status.on { color: #4ade80; background: #1f3a33; border-color: #2c5c4b; }
body.dark .sp-status.warn { color: #f0b429; background: #3a2f1f; border-color: #5c4a2c; }

/* 筛选区 */
body.dark .filter-toggle { background: transparent; border-color: var(--line); color: var(--muted); }
body.dark .filter-toggle:hover { background: #232836; }

/* 下拉框深色美化：箭头换亮色 + 选项深色底 */
body.dark select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23aab4c4' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
body.dark select:hover { border-color: #4a5a7a; background-color: #2a3040; }
body.dark select:focus { background-color: #232836; }
body.dark select option { background: #1d212c; color: var(--text); }
body.dark select option:checked { background: #26314d; color: #7fa8ff; }
body.dark select optgroup { background: #232836; color: var(--muted); }

/* 登录页保持浅色（深色模式只作用于系统内） */
body.dark .login-screen { background: #fff; }
body.dark .login-panel { background: #fff; }
body.dark .login-card { background: #fff; }
body.dark .login-panel-title h2 { color: #1f2329; }
body.dark .login-panel-title p { color: #646a73; }
body.dark .login-btn { background: var(--brand); color: #fff; }
/* ===== 鑷畾涔変笅鎷夋锛坴6锛?===== */
.cs { position: relative; display: block; width: 100%; }
.cs > select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; border: 0; appearance: none; -webkit-appearance: none; margin: 0; }
.cs-trigger { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; background: #fff; color: var(--text); cursor: pointer; font-size: 14px; line-height: 1.4; text-align: left; transition: border-color .15s, box-shadow .15s, background-color .15s; }
.cs-trigger::after { content: ""; flex: 0 0 auto; width: 12px; height: 8px; background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23646a73' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / 12px 8px; transition: transform .15s; }
.cs.open .cs-trigger::after { transform: rotate(180deg); }
.cs-trigger:hover { border-color: #b6c4e0; background-color: #fbfcff; }
.cs.open .cs-trigger { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(51,112,255,.12); background-color: #fff; }
.cs-trigger.cs-disabled { cursor: not-allowed; opacity: .55; }
.cs-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 涓嬫媺鑿滃崟锛坒ixed 鎸?body锛岄伩鍏嶈瀹瑰櫒瑁佸壀锛?*/
.cs-menu { position: fixed; z-index: 1000; min-width: 140px; max-height: 230px; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 32px rgba(31,35,41,.16); padding: 4px; }
.cs-menu .cs-group { padding: 6px 10px 3px; font-size: 11px; color: var(--muted); font-weight: 600; }
.cs-opt { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; font-size: 13px; color: var(--text); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-opt:hover { background: #f2f5fc; color: var(--brand); }
.cs-opt.sel { background: #edf3ff; color: var(--brand); font-weight: 600; }
.cs-opt.disabled { opacity: .5; cursor: not-allowed; }
.cs-menu::-webkit-scrollbar { width: 6px; }
.cs-menu::-webkit-scrollbar-thumb { background: #cdd3de; border-radius: 99px; }
/* 琛ㄦ牸鍐呭皬鍙蜂笅鎷?*/
.table-wrap .cs, .actions .cs { display: inline-block; width: auto; min-width: 96px; vertical-align: middle; }
.table-wrap .cs-trigger, .actions .cs-trigger { padding: 4px 8px; font-size: 12px; }
.toolbar .cs { width: auto; min-width: 150px; }
/* 娣辫壊妯″紡 */
body.dark .cs-trigger { background: #232836; border-color: var(--line); color: var(--text); }
body.dark .cs-trigger::after { background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23aab4c4' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
body.dark .cs-trigger:hover { background-color: #2a3040; border-color: #4a5a7a; }
body.dark .cs.open .cs-trigger { background-color: #232836; }
body.dark .cs-menu { background: #1d212c; border-color: var(--line); }
body.dark .cs-opt { color: var(--text); }
body.dark .cs-opt:hover { background: #2a3040; color: #7fa8ff; }
body.dark .cs-opt.sel { background: #26314d; color: #7fa8ff; }

/* ===== 鑷畾涔夋棩鏈熼€夋嫨鍣紙v6锛?===== */
.cd { position: relative; display: block; width: 100%; min-width: 130px; }
.cd > input[type="date"], .cd > input[type="datetime-local"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; border: 0; appearance: none; -webkit-appearance: none; margin: 0; }
.cd-trigger { display: flex; align-items: center; gap: 8px; width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; background: #fff; color: var(--text); cursor: pointer; font-size: 14px; line-height: 1.4; text-align: left; transition: border-color .15s, box-shadow .15s, background-color .15s; }
.cd-trigger::after { content: ""; flex: 0 0 auto; width: 15px; height: 15px; background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23646a73' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 10h18'/%3E%3C/svg%3E") no-repeat center / 15px 15px; }
.cd-trigger:hover { border-color: #b6c4e0; background-color: #fbfcff; }
.cd-trigger.cd-empty { color: var(--muted); }
.cd-trigger.cd-empty::after { opacity: .75; }
.cd-val { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 鏃ュ巻闈㈡澘锛坒ixed 鎸?body锛岄伩鍏嶈瀹瑰櫒瑁佸壀锛?*/
.cd-menu { position: fixed; z-index: 1001; width: 264px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(31,35,41,.16); padding: 12px; }
.cd-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.cd-title { font-size: 14px; font-weight: 700; color: var(--text); }
.cd-nav { width: 28px; height: 28px; border-radius: 6px; border: 0; background: #f2f4f8; color: var(--text); cursor: pointer; font-size: 14px; line-height: 1; display: grid; place-items: center; }
.cd-nav:hover { background: #e8edf5; color: var(--brand); }
.cd-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cd-dow { text-align: center; font-size: 11px; color: var(--muted); padding: 4px 0; font-weight: 600; }
.cd-day { text-align: center; padding: 6px 0; border-radius: 6px; font-size: 13px; color: var(--text); cursor: pointer; }
.cd-day:hover { background: #f2f5fc; color: var(--brand); }
.cd-day.out { color: #c2c8d2; }
.cd-day.today { border: 1px solid var(--brand); }
.cd-day.sel { background: var(--brand); color: #fff; font-weight: 700; }
.cd-day.sel:hover { background: var(--brand); color: #fff; }
.cd-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.cd-foot button { padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.cd-time { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.cd-time select { appearance: auto; border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; font-size: 13px; background: #fff; color: var(--text); cursor: pointer; }
.cd-time select:hover { border-color: #b6c4e0; }
.cd-time-sep { color: var(--muted); font-size: 14px; }
body.dark .cd-time { border-color: var(--line); }
body.dark .cd-time select { background: #2a3040; border-color: var(--line); color: var(--text); }
body.dark .cd-time select:hover { border-color: #4a5a7a; }
/* 娣辫壊妯″紡 */
body.dark .cd-trigger { background: #232836; border-color: var(--line); color: var(--text); }
body.dark .cd-trigger::after { background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23aab4c4' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 10h18'/%3E%3C/svg%3E"); }
body.dark .cd-trigger:hover { background-color: #2a3040; border-color: #4a5a7a; }
body.dark .cd-menu { background: #1d212c; border-color: var(--line); }
body.dark .cd-nav { background: #2a3040; color: var(--text); }
body.dark .cd-nav:hover { background: #333b4f; color: #7fa8ff; }
body.dark .cd-day { color: var(--text); }
body.dark .cd-day:hover { background: #2a3040; color: #7fa8ff; }
body.dark .cd-day.out { color: #5b6370; }
body.dark .cd-day.today { border-color: var(--brand); }
body.dark .cd-day.sel { background: var(--brand); color: #fff; }
body.dark .cd-foot { border-color: var(--line); }


/* ===== 操作列下拉菜单（员工账号总览） ===== */
.uo-wrap { position: relative; display: inline-block; }
.uo-trigger { white-space: nowrap; }
.uo-caret { font-size: 10px; opacity: .7; }
.uo-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 136px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(31,35,41,.14); padding: 6px; display: none; }
.uo-menu::before { content: ""; position: absolute; top: -6px; right: 16px; width: 10px; height: 10px; background: #fff; border-left: 1px solid var(--line); border-top: 1px solid var(--line); transform: rotate(45deg); }
.uo-item { display: block; width: 100%; text-align: left; padding: 8px 10px; font-size: 13px; border-radius: 6px; background: transparent; border: 0; color: var(--text); cursor: pointer; transition: background-color .1s ease, color .1s ease; }
.uo-item:hover { background: #f2f4f8; color: var(--brand); }
.uo-item.danger { background: #f5222d; color: #fff; font-weight: 600; }
.uo-item.danger:hover { background: #d01820; color: #fff; }
body.dark .uo-menu { background: #1d212c; border-color: var(--line); box-shadow: 0 8px 24px rgba(0,0,0,.4); }
body.dark .uo-menu::before { background: #1d212c; border-color: var(--line); }
body.dark .uo-item { color: var(--text); }
body.dark .uo-item:hover { background: #2a3040; color: #7fa8ff; }
body.dark .uo-item.danger { background: #f5222d; color: #fff; }
body.dark .uo-item.danger:hover { background: #ff4d4f; color: #fff; }

/* ===== 个人资料头像（对标主流平台：圆形、固定尺寸、居中裁剪） ===== */
.profile-avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  background: #eef4ff;
  color: var(--brand);
  display: grid; place-items: center;
  font-size: 36px; font-weight: 700;
  border: 2px solid var(--line);
  box-shadow: 0 2px 8px rgba(31,35,41,.06);
}
.profile-avatar-empty { user-select: none; }
.profile-avatar-edit {
  position: absolute; right: -6px; bottom: -6px;
  width: 30px; height: 30px; border-radius: 50%;
  background: #fff; border: 1px solid var(--line);
  display: grid; place-items: center;
  cursor: pointer; font-size: 14px;
  box-shadow: 0 2px 6px rgba(31,35,41,.12);
  transition: background-color .12s ease, transform .12s ease;
}
.profile-avatar-edit:hover { background: #f2f4f8; }
body.dark .profile-avatar { background: #26314d; color: #7fa8ff; border-color: var(--line); }
body.dark .profile-avatar-edit { background: #2a3040; border-color: var(--line); }

/* ===== 深色模式：软键盘顶部/数字区自适应（修复发白） ===== */
body.dark .softphone-head { background: var(--panel); color: var(--text); }
body.dark .softphone-head strong { color: var(--text); }
body.dark .softphone-head .ghost { color: var(--text); border-color: var(--line); }
body.dark .softphone-number .sp-display { color: var(--text); }
body.dark .softphone-number .sp-sub { color: var(--muted); }
body.dark .sp-signal { color: #00c97e; }


/* ===== 表单元素统一对齐（2026-08-10）===== */
/* 1. label 文字固定单行：文字长短不一不再导致控件错位 */
.grid-form label,
.filter-grid label,
.toolbar .compact-field,
.grid-form > label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
/* 2. 所有输入控件统一高度 + 盒模型，左右上下严格对齐 */
.grid-form input:not([type="checkbox"]):not([type="radio"]),
.grid-form select,
.filter-grid input:not([type="checkbox"]):not([type="radio"]),
.filter-grid select,
.toolbar input:not([type="checkbox"]):not([type="radio"]),
.toolbar select,
.grid-form .cs-trigger,
.grid-form .cd-trigger,
.filter-grid .cs-trigger,
.filter-grid .cd-trigger,
.toolbar .cs-trigger,
.toolbar .cd-trigger {
  height: 40px;
  box-sizing: border-box;
}
/* 3. 自定义下拉/日期触发器与原生控件对齐（padding 一致） */
.grid-form .cs-trigger,
.grid-form .cd-trigger,
.filter-grid .cs-trigger,
.filter-grid .cd-trigger {
  padding-top: 0;
  padding-bottom: 0;
  align-items: center;
}
/* 4. 文本域保持可拉伸，但初始高度统一 */
.grid-form textarea,
.filter-grid textarea,
.toolbar textarea {
  min-height: 96px;
}
/* 5. 表格内小号下拉/日期不被误伤（保持紧凑） */
.table-wrap .cs-trigger,
.actions .cs-trigger,
.table-wrap .cd-trigger,
.actions .cd-trigger {
  height: auto;
  padding: 4px 8px;
}


/* ===== toolbar 内带文字标签的控件与其他控件对齐（2026-08-10 v2）===== */
/* 核心问题：label.compact-field 的文字占一行，把输入框往下推（如工作台搜索区）*/
/* 解决：compact-field 改为横向布局（文字在左、控件在右），总高度与其他控件一致 */
.toolbar .compact-field {
  display: inline-flex !important;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  height: 40px;
  min-width: 0;
  margin: 0;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}
.toolbar .compact-field input,
.toolbar .compact-field .cd {
  width: 118px;
  min-width: 0;
  height: 40px;
  box-sizing: border-box;
}
.toolbar .compact-field .cd-trigger {
  height: 40px;
  padding-top: 0;
  padding-bottom: 0;
}
/* 搜索按钮高度统一，与输入框一致 */
.toolbar > button {
  height: 40px;
  box-sizing: border-box;
}
