/* ============================================================
   外呼业务内部管理系统 — 全局样式（浅色专业风）
   ============================================================ */
:root {
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eff6ff;
  --bg: #f4f6fb;
  --panel: #ffffff;
  --line: #e6eaf2;
  --line-strong: #d3dae6;
  --text: #1f2937;
  --text-sub: #64748b;
  --text-muted: #94a3b8;
  --green: #16a34a;
  --green-soft: #ecfdf5;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --orange: #ea580c;
  --orange-soft: #fff7ed;
  --yellow: #ca8a04;
  --yellow-soft: #fefce8;
  --purple: #7c3aed;
  --purple-soft: #f5f3ff;
  --cyan: #0891b2;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 14px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .14);
  --sidebar-w: 218px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: 14px; color: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
::-webkit-scrollbar-track { background: transparent; }

.boot-loading, .page-loading { padding: 60px; text-align: center; color: var(--text-muted); }

/* ---------------- 布局 ---------------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar-brand {
  padding: 18px 18px 14px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-brand .logo {
  width: 32px; height: 32px; border-radius: 8px; flex: 0 0 32px;
  background: linear-gradient(135deg, var(--brand), #60a5fa);
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 15px;
}
.sidebar-brand .txt { min-width: 0; }
/* 系统名可以在「系统设置」里改成任意长度，长名要能折行，不能撑破侧边栏 */
.sidebar-brand .t1 { font-weight: 700; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.sidebar-brand .t2 { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.nav { flex: 1; overflow-y: auto; padding: 10px 8px; }
.nav-group-title {
  font-size: 11px; color: var(--text-muted); padding: 12px 12px 6px; letter-spacing: .5px;
}
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px; margin: 2px 0;
  border-radius: var(--radius-sm); cursor: pointer; color: var(--text-sub);
  font-size: 13.5px; border: none; background: none; width: 100%; text-align: left;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: #f1f5f9; color: var(--text); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-item .ico { width: 16px; height: 16px; flex: 0 0 16px; }
.nav-item .dot {
  margin-left: auto; background: var(--red); color: #fff; font-size: 10px;
  padding: 1px 5px; border-radius: 8px; font-weight: 700; line-height: 1.5;
}

/* 二级菜单：父项只负责展开，子项才是页面 */
.nav-parent .nav-arrow {
  margin-left: auto; opacity: .5; flex: 0 0 13px;
  transition: transform .16s ease;
}
.nav-parent.open .nav-arrow { transform: rotate(90deg); }
.nav-parent.active { background: none; color: var(--brand); font-weight: 600; }
.nav-parent.active:hover { background: #f1f5f9; }
.nav-sub { display: none; padding-left: 4px; }
.nav-sub.open { display: block; }
.nav-subitem {
  padding: 7px 12px 7px 20px; font-size: 13px; gap: 8px;
}
.nav-subitem .nav-dash {
  width: 5px; height: 5px; border-radius: 50%; background: currentColor;
  opacity: .35; flex: 0 0 5px;
}
.nav-subitem.active .nav-dash { opacity: 1; }

.sidebar-foot { border-top: 1px solid var(--line); padding: 10px; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 6px; border-radius: 8px; }
.user-chip .avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: 0 0 30px;
}
.user-chip .info { min-width: 0; flex: 1; }
.user-chip .n { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .r { font-size: 11px; color: var(--text-muted); }
.icon-btn {
  border: none; background: none; cursor: pointer; padding: 5px; border-radius: 6px; color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: #f1f5f9; color: var(--red); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 22px; position: sticky; top: 0; z-index: 20;
}

/* 移动端抽屉：汉堡按钮与遮罩只在窄屏出现，桌面端完全不占位 */
.nav-toggle { display: none; flex: 0 0 auto; }
.nav-mask { display: none; }
.topbar-title { min-width: 0; }
.topbar-title h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar h1 { font-size: 16px; margin: 0; font-weight: 700; }
.topbar .sub { font-size: 12px; color: var(--text-muted); }
.topbar .spacer { flex: 1; }
.content { padding: 20px 22px 40px; max-width: 1560px; width: 100%; }

/* ---------------- 站内通知（顶栏铃铛） ----------------
   面板绝对定位挂在按钮下方，不占布局；宽度收到 340，手机屏按视口减 24 兜底，
   否则右侧贴边、整页横向溢出。 */
.notice-wrap { position: relative; flex: 0 0 auto; }
.notice-btn { position: relative; }
.notice-btn.has-unread { color: var(--brand); }
.notice-dot {
  position: absolute; top: -1px; right: -3px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 9px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  line-height: 16px; text-align: center; box-shadow: 0 0 0 2px #fff;
}
.notice-panel {
  position: absolute; right: 0; top: calc(100% + 8px); width: 340px; max-width: calc(100vw - 24px);
  max-height: 60vh; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); z-index: 40; overflow: hidden;
}
/* hidden 属性碰到 display:flex 会被覆盖成「一直显示」，必须显式关掉 */
.notice-panel[hidden] { display: none; }
.notice-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-bottom: 1px solid var(--line); font-size: 13px;
}
.notice-head .spacer { flex: 1; }
.notice-list { overflow-y: auto; }
.notice-item {
  display: block; width: 100%; text-align: left; border: none; background: none; cursor: pointer;
  padding: 10px 12px; border-bottom: 1px solid #f1f5f9; font: inherit; color: inherit;
}
.notice-item:hover { background: #f8fafc; }
.notice-item.unread { background: var(--brand-soft); }
.notice-item .ni-t { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.notice-item .ni-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); flex: none; }
/* 正文最多 3 行：单据通知里带单号 / 客户 / 原因，正文可能很长，
   不截断会把面板撑到半屏，反而看不见下面几条通知 */
.notice-item .ni-b {
  font-size: 12px; color: var(--text-sub); margin-top: 3px; line-height: 1.5; word-break: break-all;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.notice-item .ni-time { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }
.notice-empty { padding: 26px 12px; text-align: center; color: var(--text-muted); font-size: 12.5px; }

/* ---------------- 窄屏（手机）外壳 ----------------
   以前侧边栏固定 218px 宽，390px 的手机上主内容只剩 170px，
   整页被挤成一条竖线、还横向溢出。窄屏改成「抽屉 + 遮罩」：
   侧边栏移出视口，点左上角汉堡滑出，选中菜单后自动收起。 */
@media (max-width: 820px) {
  .layout { display: block; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; height: 100%; width: 268px;
    flex: none; z-index: 80; transform: translateX(-100%);
    transition: transform .22s ease; box-shadow: 0 12px 44px rgba(15, 23, 42, .22);
  }
  .sidebar.open { transform: none; }
  .nav-mask {
    display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
    z-index: 70; opacity: 0; pointer-events: none; transition: opacity .22s ease;
  }
  .nav-mask.show { opacity: 1; pointer-events: auto; }
  .main { min-height: 100vh; }
  .topbar { height: 52px; padding: 0 12px; gap: 8px; }
  .nav-toggle { display: inline-flex; }
  .topbar h1 { font-size: 15px; }
  .topbar .sub { display: none; }
  .content { padding: 12px 12px 32px; }
  .card-body { padding: 14px; }
  .card-head { padding: 11px 14px; }
  /* 弹窗：小屏顶部留 48px 太空，收紧并让正文可滚动区更高 */
  .modal-mask { padding: 16px 10px; }
  .modal-body { padding: 14px; max-height: 72vh; }
  .modal-head, .modal-foot { padding: 12px 14px; }
}

@media (max-width: 560px) {
  .stat .val { font-size: 20px; }
  .inline-form { flex-direction: column; align-items: stretch; }
  .inline-form .field, .inline-form .select, .inline-form .input { width: 100% !important; min-width: 0 !important; }
}

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 16px;
}
.card-head {
  padding: 13px 18px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.card-head h3 { margin: 0; font-size: 14.5px; font-weight: 700; }
.card-head .spacer { flex: 1; }
.card-head .hint { font-size: 12px; color: var(--text-muted); }
.card-body { padding: 18px; }
.card-body.tight { padding: 12px 18px; }
.card-body.flush { padding: 0; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.g-1-2 { grid-template-columns: 1fr 2fr; }
@media (max-width: 1180px) { .g4, .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-2-1, .g-1-2 { grid-template-columns: 1fr; } }
@media (max-width: 820px) { .g2, .g3, .g4, .g5 { grid-template-columns: 1fr; } }

/* ---------------- 统计卡 ---------------- */
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--brand); opacity: .85; }
.stat.green::after { background: var(--green); }
.stat.orange::after { background: var(--orange); }
.stat.red::after { background: var(--red); }
.stat.purple::after { background: var(--purple); }
.stat.cyan::after { background: var(--cyan); }
.stat .lab { font-size: 12.5px; color: var(--text-sub); display: flex; align-items: center; gap: 5px; }
.stat .val { font-size: 25px; font-weight: 700; margin-top: 7px; letter-spacing: -.5px; line-height: 1.15; }
.stat .val small { font-size: 13px; font-weight: 500; color: var(--text-muted); margin-left: 3px; }
.stat .foot { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: #fff; color: var(--text); cursor: pointer; font-size: 13px; font-weight: 500;
  transition: all .12s; white-space: nowrap;
}
.btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-danger { border-color: #fca5a5; color: var(--red); }
.btn-danger:hover { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-sub); }
.btn-ghost:hover { background: #f1f5f9; color: var(--text); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-link { border: none; background: none; color: var(--brand); cursor: pointer; padding: 0 4px; font-size: 12.5px; }
.btn-link:hover { text-decoration: underline; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
table.tb, table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tb th, table.table th {
  text-align: left; padding: 10px 12px; background: #f8fafc; color: var(--text-sub);
  font-weight: 600; font-size: 12.5px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.tb td, table.table td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
table.tb tbody tr:hover, table.table tbody tr:hover { background: #fafbfe; }
/* 超时行（单据跟踪超 48 小时）：整行粉底，钉住的列要跟着变色，否则右侧会出现白色缺块 */
table.tb tbody tr.overdue, table.table tbody tr.overdue { background: #fff1f2; }
table.tb tbody tr.overdue:hover, table.table tbody tr.overdue:hover { background: #ffe4e6; }
table.tb tbody tr.overdue .col-pin, table.table tbody tr.overdue .col-pin { background: #fff1f2; }
table.tb tbody tr:last-child td, table.table tbody tr:last-child td { border-bottom: none; }
table.tb .num, table.table .num { font-variant-numeric: tabular-nums; font-weight: 600; }
table.tb .muted, table.table .muted { color: var(--text-muted); font-size: 12px; }
/* 合计行（数据池「积分值」这类派生字段的汇总）：跟表头同一套浅底，
   让眼睛知道它不是一条数据；数值用 tabular-nums 对齐，加粗的是分数本身。 */
table.tb tfoot td, table.table tfoot td {
  padding: 10px 12px; background: #f8fafc; font-size: 12.5px;
  border-top: 1px solid var(--line); white-space: nowrap; color: var(--text-sub);
}
table.tb tfoot td .num, table.table tfoot td .num {
  font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text);
}
table.tb td.actions, table.table td.actions { white-space: nowrap; }
/* 宽表把操作列钉在右侧：列多到需要横向滚动时，「删除」这类按钮不会滚出可视区
   （指标库加列后踩过：min-width 溢出，删除按钮只露半个字）。 */
table.tb .col-pin, table.table .col-pin {
  position: sticky; right: 0; background: #fff;
  box-shadow: -8px 0 8px -8px rgba(15, 23, 42, .18);
}
table.tb th.col-pin, table.table th.col-pin { background: #f8fafc; }
table.tb tbody tr:hover .col-pin, table.table tbody tr:hover .col-pin { background: #fafbfe; }
/* 数据池列表（外呼数据池页）：列多，手机号 / 姓名 / 证件 / 地址 / 备注挤在一行里。
   td 默认允许换行，列一窄就变成「每列一个汉字宽」的竖排，反而看不清；
   所以短字段一律不折行（放弃压缩、让表格变宽），长文本列才允许折行。
   表格的 min-width 由页面按列宽下限算好后内联写入，宽度不够时走 .table-wrap 横向滚动。 */
table.tb-pool td.nw { white-space: nowrap; }
table.tb-pool td.cw { word-break: break-word; }
/* 注意：不要给这里的操作列加 position:sticky（.col-pin 那种做法）。
   试过，sticky 是浮层，未滚到最右时它会盖住「备注 / 录入人 / 入库时间」三列，
   默认视图反而缺信息；数据池这张表是纯宽表，横向滚动本来就是正常操作。 */
/* ---------------- 列表页统一工具条（2026-11-07 客户口径） ----------------
   系统里所有「列表页」共用一套参数，基准 = 外呼数据池页（客户截图确认）。
   统一的是三件事：
     1) 卡头 = 标题 + 右侧动作按钮；筛选控件不进卡头
     2) 筛选条 = .list-bar：一行、gap 10、内边距 12/18、下边框分隔，控件一律 34px 高
     3) 分页 = .list-pager：上边框分隔、字号 12.5、右侧翻页按钮
   以前这些数字散在各页的内联 style 里，改一页漂一页；现在页面只写结构。 */
.list-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 18px; border-bottom: 1px solid #f1f5f9;
}
/* 控件高度统一 34px：input 默认 37、select 默认 39，并排会错位两像素；
   按钮也是 28，比输入框矮一截。统一后一行看起来才是「一条线」。 */
.list-bar .input,
.list-bar .select,
.list-bar .btn { height: 34px; }
.list-bar .input,
.list-bar .select { padding-top: 0; padding-bottom: 0; }
.list-bar .input[type="date"] { padding: 0 8px; }
.list-bar .btn { padding: 0 14px; font-size: 13px; }
.list-bar .btn-sm { padding: 0 12px; font-size: 12.5px; }
/* 筛选项不写字段标签：选项文案（全部状态 / 全部坐席）已自带含义，加标签会多占一行 */
.list-bar .field { display: block; min-width: 0; }
.list-bar .field > label { display: none; }
.list-bar .sep { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; }
.list-bar .grow { flex: 1 1 auto; }
.list-pager {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-top: 1px solid #f1f5f9;
  font-size: 12.5px; color: var(--text-muted);
}
.list-pager .grow { flex: 1; }
/* 卡头按钮统一 32px：列表页右上角那排按钮（导入 / 新增 / 导出）以前有 28 有 32 */
.card-head .btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; }

.empty { padding: 46px 20px; text-align: center; color: var(--text-muted); font-size: 13px; }
.empty .big { font-size: 30px; margin-bottom: 8px; opacity: .45; }

/* ---------------- 标签 ---------------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; line-height: 1.7; white-space: nowrap;
}
.tag-gray { background: #f1f5f9; color: #64748b; }
.tag-blue { background: var(--brand-soft); color: var(--brand); }
.tag-green { background: var(--green-soft); color: var(--green); }
.tag-red { background: var(--red-soft); color: var(--red); }
.tag-orange { background: var(--orange-soft); color: var(--orange); }
.tag-yellow { background: var(--yellow-soft); color: var(--yellow); }
.tag-purple { background: var(--purple-soft); color: var(--purple); }
.dot-mark { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------------- 表单 ---------------- */
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12.5px; color: var(--text-sub); font-weight: 600; }
.field > label .req { color: var(--red); margin-left: 2px; }
.field .tip { font-size: 11.5px; color: var(--text-muted); }
.input, .select, .textarea {
  width: 100%; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; outline: none; transition: border-color .12s, box-shadow .12s;
  /* 显式声明文字色：全局 button/input 继承 color，深色容器（如蓝色 hero）里会变成白底白字 */
  color: var(--text);
}
.input::placeholder, .textarea::placeholder { color: var(--text-sub); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.textarea { resize: vertical; min-height: 74px; line-height: 1.6; }
.input[readonly] { background: #f8fafc; color: var(--text-sub); }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .field { min-width: 130px; }
.checkline { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-sub); cursor: pointer; }
.checkline input { width: 15px; height: 15px; accent-color: var(--brand); }

/* ---------------- 弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 200;
  display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px; overflow-y: auto;
  animation: fadeIn .14s ease;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideUp { from { transform: translateY(10px); opacity: 0 } to { transform: none; opacity: 1 } }
.modal {
  background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); width: 100%; max-width: 620px;
  animation: slideUp .18s ease; margin-bottom: 40px;
}
.modal.wide { max-width: 860px; }
.modal.narrow { max-width: 440px; }
.modal-head {
  padding: 15px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px;
}
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.modal-head .spacer { flex: 1; }
.modal-body { padding: 20px; max-height: 66vh; overflow-y: auto; }
.modal-foot { padding: 13px 20px; border-top: 1px solid var(--line); display: flex; gap: 9px; justify-content: flex-end; }

/* ---------------- Toast ---------------- */
.toast-root { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 400; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  padding: 10px 18px; border-radius: 8px; background: #1f2937; color: #fff; font-size: 13px;
  box-shadow: var(--shadow-lg); animation: slideUp .18s ease; max-width: 520px;
}
.toast.success { background: #15803d; }
.toast.error { background: #b91c1c; }
.toast.warn { background: #b45309; }

/* ---------------- 进度条 ---------------- */
.bar { height: 7px; border-radius: 4px; background: #eef2f7; overflow: hidden; min-width: 54px; }
.bar > i { display: block; height: 100%; border-radius: 4px; background: var(--brand); transition: width .3s; }
.bar.green > i { background: var(--green); }
.bar.orange > i { background: var(--orange); }
.bar.red > i { background: var(--red); }
.bar-row { display: flex; align-items: center; gap: 8px; }
.bar-row .pct { font-size: 12px; font-weight: 600; min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------- 图表 ---------------- */
.chart-svg { width: 100%; display: block; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-sub); padding: 0 4px 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.rank-list { display: flex; flex-direction: column; gap: 2px; }
.rank-item { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 8px; }
.rank-item:hover { background: #fafbfe; }
.rank-item .no {
  width: 22px; height: 22px; border-radius: 6px; background: #f1f5f9; color: var(--text-sub);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: 0 0 22px;
}
.rank-item.top1 .no { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #fff; }
.rank-item.top2 .no { background: linear-gradient(135deg, #94a3b8, #cbd5e1); color: #fff; }
.rank-item.top3 .no { background: linear-gradient(135deg, #b45309, #d97706); color: #fff; }
.rank-item .nm { font-size: 13px; font-weight: 600; min-width: 56px; }
.rank-item .gr { font-size: 11px; color: var(--text-muted); }
.rank-item .val { margin-left: auto; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* 业绩排行榜：构成堆叠条（一段一个业务项目，宽度按该人内部占比） */
.rank-item { flex-wrap: wrap; }
.rank-item .seg-bar { display: flex; height: 6px; background: #f1f5f9; border-radius: 3px; overflow: hidden; min-width: 4px; }
.rank-item .seg-bar i { display: block; height: 100%; }
.rank-item .mix-line {
  font-size: 10.5px; color: var(--text-muted); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rank-item details.mix-dt { flex: 1 0 100%; min-width: 0; margin: 0 0 2px; padding-left: 32px; box-sizing: border-box; }
.rank-item details.mix-dt summary {
  cursor: pointer; font-size: 11px; color: var(--brand);
  list-style: none; user-select: none; padding: 1px 0;
}
.rank-item details.mix-dt summary::-webkit-details-marker { display: none; }
.rank-item details.mix-dt summary::before { content: '▸ 查看'; }
.rank-item details.mix-dt[open] summary::before { content: '▾ 收起'; }

/* ---------------- 其它 ---------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 18px; flex-wrap: wrap; }
.tab {
  padding: 10px 14px; font-size: 13.5px; color: var(--text-sub); cursor: pointer; border: none; background: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 700; }

.notice {
  padding: 11px 14px; border-radius: 8px; font-size: 12.5px; line-height: 1.7;
  background: var(--brand-soft); color: #1e40af; border: 1px solid #dbeafe;
}
.notice.warn { background: var(--yellow-soft); color: #854d0e; border-color: #fde68a; }
.notice.danger { background: var(--red-soft); color: #991b1b; border-color: #fecaca; }
.notice.ok { background: var(--green-soft); color: #166534; border-color: #bbf7d0; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; font-size: 13px; align-items: baseline; }
.kv dt { color: var(--text-muted); font-size: 12.5px; white-space: nowrap; }
.kv dd { margin: 0; }

.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1px; background: var(--line-strong); }
.tl-item { position: relative; padding: 0 0 16px 0; }
.tl-item::before {
  content: ""; position: absolute; left: -18px; top: 5px; width: 9px; height: 9px; border-radius: 50%;
  background: #fff; border: 2px solid var(--brand);
}
.tl-item.ok::before { border-color: var(--green); }
.tl-item.warn::before { border-color: var(--orange); }
.tl-item.bad::before { border-color: var(--red); }
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-head .who { font-weight: 600; font-size: 13px; }
.tl-head .when { font-size: 11.5px; color: var(--text-muted); }
.tl-body { font-size: 13px; color: var(--text-sub); margin-top: 5px; line-height: 1.65; white-space: pre-wrap; }

/* 登录页 */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(1200px 600px at 15% -10%, #dbeafe 0%, transparent 55%),
              radial-gradient(900px 500px at 100% 110%, #e0e7ff 0%, transparent 50%), var(--bg);
}
.login-card {
  width: 100%; max-width: 920px; display: grid; grid-template-columns: 1.05fr .95fr;
  background: #fff; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--line);
}
.login-left {
  position: relative; padding: 44px 40px; color: #fff;
  /* 客户服务主视觉铺满整块：竖版区域、按高度铺、裁两侧，人物始终在中间 */
  background: #0f2d6b url('../img/login-hero.jpg') center / cover no-repeat;
  display: flex; flex-direction: column;
}
/* 顶部/底部压一层深色渐变：图里亮起来的时候白字也读得清（不挡中间人物） */
.login-left::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(8, 23, 60, .62) 0%, rgba(8, 23, 60, 0) 34%,
              rgba(8, 23, 60, 0) 66%, rgba(8, 23, 60, .5) 100%);
}
.login-left h1 {
  position: relative; z-index: 1; font-size: 25px; margin: 0; line-height: 1.35;
  text-shadow: 0 2px 14px rgba(5, 18, 52, .6);
}
.login-right { padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; }
.login-right h2 { margin: 0 0 6px; font-size: 19px; }
.login-right .sub { color: var(--text-muted); font-size: 13px; margin-bottom: 24px; }
.login-right .field { margin-bottom: 15px; }
.login-right .btn { width: 100%; padding: 10px; font-size: 14px; margin-top: 6px; }
.quick-accounts { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line-strong); }
.quick-accounts .t { font-size: 12px; color: var(--text-muted); margin-bottom: 9px; }
.quick-accounts .row { display: flex; gap: 7px; flex-wrap: wrap; }
.quick-accounts button {
  padding: 5px 11px; border: 1px solid var(--line-strong); background: #fff; border-radius: 20px;
  font-size: 12px; cursor: pointer; color: var(--text-sub);
}
.quick-accounts button:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
@media (max-width: 780px) { .login-card { grid-template-columns: 1fr; } .login-left { display: none; } }

@media print { .sidebar, .topbar, .btn { display: none !important; } }

/* ============================================================
   智能知识库 / 智能助手
   ============================================================ */

/* 检索命中高亮 */
mark.kb-hl {
  background: #fef08a; color: #713f12; padding: 0 2px; border-radius: 3px;
  font-weight: 600; box-shadow: inset 0 -1px 0 #facc15;
}

/* 知识正文排版 */
.kb-body { font-size: 13.5px; line-height: 1.85; color: var(--text); }
.kb-h {
  margin: 16px 0 8px; font-size: 14px; font-weight: 700; color: #0f172a;
  padding-left: 9px; border-left: 3px solid var(--brand); line-height: 1.5;
}
.kb-h:first-child { margin-top: 0; }
.kb-p { margin: 0 0 9px; }
.kb-ul { margin: 0 0 10px; padding-left: 20px; }
.kb-ul li { margin-bottom: 5px; }

/* ---------------- 坐席端：智能助手 ---------------- */
.ak-hero {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 48%, #3b82f6 100%);
  border: none; color: #fff;
}
.ak-hero-inner { padding: 24px 26px 20px; }
.ak-hero h2 { margin: 0 0 5px; font-size: 19px; font-weight: 700; }
.ak-hero p { margin: 0 0 16px; font-size: 13px; color: rgba(255, 255, 255, .82); }
.ak-searchbar { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.ak-searchbar .input {
  flex: 1; min-width: 240px; height: 42px; font-size: 14px; border: none;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .12);
}
.ak-searchbar .btn { height: 42px; padding: 0 22px; background: #fff; color: var(--brand-dark); border-color: #fff; font-weight: 700; }
.ak-searchbar .btn:hover { background: #eff6ff; color: var(--brand-dark); }
.ak-modes { display: flex; background: rgba(255, 255, 255, .18); border-radius: 8px; padding: 3px; gap: 2px; }
.ak-mode {
  border: none; background: transparent; color: rgba(255, 255, 255, .85);
  padding: 7px 14px; border-radius: 6px; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.ak-mode.active { background: #fff; color: var(--brand-dark); font-weight: 700; }
.ak-chips { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 14px; }
.ak-chip {
  border: 1px solid rgba(255, 255, 255, .38); background: rgba(255, 255, 255, .1);
  color: #fff; border-radius: 20px; padding: 4px 12px; font-size: 12px; cursor: pointer;
}
.ak-chip:hover { background: #fff; color: var(--brand-dark); border-color: #fff; }

/* 答案卡 */
.ak-answer {
  font-size: 14.5px; line-height: 1.95; color: #0f172a; white-space: pre-wrap;
  background: var(--brand-soft); border-left: 3px solid var(--brand);
  border-radius: 8px; padding: 14px 16px;
}

/* 命中条目 */
.ak-hit { padding: 14px 18px; border-bottom: 1px solid #f1f5f9; }
.ak-hit:last-child { border-bottom: none; }
.ak-hit:hover { background: #fafbfe; }
.ak-hit-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 13.5px; }
.ak-hit-head .spacer { flex: 1; min-width: 8px; }
.ak-hit-heading {
  font-size: 12px; color: var(--brand); font-weight: 600; margin: 7px 0 4px;
  padding-left: 8px; border-left: 2px solid #bfdbfe;
}
.ak-snippet { font-size: 13px; line-height: 1.8; color: var(--text-sub); margin-top: 5px; }

/* 侧栏条目 */
.ak-side-item { padding: 10px 16px; border-bottom: 1px solid #f1f5f9; cursor: pointer; }
.ak-side-item:last-child { border-bottom: none; }
.ak-side-item:hover { background: #f5f8ff; }
.ak-side-item .t { font-size: 13px; font-weight: 600; line-height: 1.5; }
.ak-side-item .m { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }

/* 标签云 */
.ak-tag {
  display: inline-flex; align-items: center; gap: 5px; margin: 0 5px 5px 0;
  padding: 3px 10px; border-radius: 20px; border: 1px solid var(--line-strong);
  background: #fff; color: var(--text-sub); font-size: 12px; cursor: pointer;
}
.ak-tag:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.ak-tag i { font-style: normal; font-size: 10.5px; color: var(--text-muted); }


/* ---------------- 公开注册（外呼人员申请） ---------------- */
.reg-entry { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line);
  font-size: 13px; color: var(--text-sub); text-align: center; }
.reg-entry-tip { margin-top: 6px; font-size: 11.5px; color: var(--text-muted); line-height: 1.7; }
.reg-entry .btn-link { font-size: 13px; font-weight: 600; }

.reg-wrap { max-width: 1080px; margin: 0 auto; padding: 26px 20px 40px; }
.reg-head {
  display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 55%, #3b82f6 100%);
  color: #fff; border-radius: var(--radius); padding: 22px 24px;
  box-shadow: 0 6px 22px rgba(37, 99, 235, .18);
}
.reg-head h1 { margin: 0 0 6px; font-size: 20px; font-weight: 700; }
.reg-head p { margin: 0; font-size: 13px; color: rgba(255, 255, 255, .85); line-height: 1.7; }
.reg-head > button { margin-left: auto; flex: 0 0 auto; background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .35); color: #fff; }
.reg-head > button:hover { background: #fff; color: var(--brand-dark); }

.reg-body { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .reg-body { grid-template-columns: 1fr; } .reg-steps { order: 2; } }

.reg-steps { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 8px; }
.reg-step { display: flex; gap: 10px; padding: 10px 12px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius-sm); }
.reg-step i { width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%; background: var(--brand-soft);
  color: var(--brand); font-size: 12px; font-style: normal; font-weight: 700;
  display: flex; align-items: center; justify-content: center; }
.reg-step b { display: block; font-size: 13px; font-weight: 600; color: var(--text); }
.reg-step span { display: block; font-size: 11.5px; color: var(--text-muted); margin-top: 2px; line-height: 1.6; }

.reg-form { display: flex; flex-direction: column; gap: 14px; }
.reg-sec { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); transition: box-shadow .2s, border-color .2s; }
.reg-sec h3 { margin: 0 0 14px; font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.reg-sec h3 > span { width: 20px; height: 20px; border-radius: 6px; background: var(--brand);
  color: #fff; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.reg-sec-error { border-color: var(--red); box-shadow: 0 0 0 3px rgba(220, 38, 38, .12); }

.reg-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 720px) { .reg-photos { grid-template-columns: 1fr; } }
.reg-photo { position: relative; display: block; border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-sm); background: #fbfcfe; min-height: 148px; cursor: pointer;
  overflow: hidden; transition: border-color .15s, background .15s; }
.reg-photo:hover { border-color: var(--brand); background: var(--brand-soft); }
.reg-photo.has-photo { border-style: solid; border-color: var(--green); background: #fff; }
.reg-photo .ph-empty { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; height: 148px; padding: 10px; text-align: center; }
.reg-photo .ph-empty b { font-size: 13px; color: var(--text); }
.reg-photo .ph-empty span { font-size: 11px; color: var(--text-muted); line-height: 1.6; padding: 0 4px; }
.reg-photo .ph-empty em { font-size: 11.5px; color: var(--brand); font-style: normal; font-weight: 600; margin-top: 2px; }
.reg-photo img { display: block; width: 100%; height: 148px; object-fit: cover; }
.reg-photo .ph-done { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 8px;
  background: rgba(22, 163, 74, .92); color: #fff; font-size: 11px; text-align: center; }

/* ============================================================
   录音质检
   ============================================================ */
.qc-layout { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1080px) { .qc-layout { grid-template-columns: 1fr; } }

.qc-side { margin: 0; position: sticky; top: 16px; }
@media (max-width: 1080px) { .qc-side { position: static; } }
.qc-filters { display: flex; flex-direction: column; gap: 8px; }
.qc-filters .select { width: 100%; }
.qc-tabs { display: flex; gap: 6px; }
.qc-tab {
  padding: 5px 10px; border: 1px solid var(--line-strong); background: #fff; border-radius: 999px;
  font-size: 12px; color: var(--text-sub); cursor: pointer; transition: all .12s;
}
.qc-tab:hover { border-color: var(--brand); color: var(--brand); }
.qc-tab.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

.qc-list { max-height: calc(100vh - 330px); overflow-y: auto; padding: 8px; }
@media (max-width: 1080px) { .qc-list { max-height: 360px; } }
.qc-item {
  display: block; width: 100%; text-align: left; padding: 10px 12px; margin-bottom: 6px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; cursor: pointer;
  transition: all .12s;
}
.qc-item:hover { border-color: var(--brand); background: var(--brand-soft); }
.qc-item.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 2px rgba(37, 99, 235, .1); }
.qc-item-top { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.qc-item-agent { font-weight: 600; }
.qc-item-top .tag { margin-left: auto; }
.qc-item-sub { font-size: 12px; color: var(--text-sub); margin-top: 4px; line-height: 1.5; }

.qc-info {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px;
  font-size: 13px; padding-bottom: 12px; border-bottom: 1px dashed var(--line);
}
@media (max-width: 720px) { .qc-info { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.qc-info .muted { display: block; font-size: 11.5px; margin-bottom: 2px; }
.qc-note {
  font-size: 12.5px; color: var(--text); background: #f8fafc; border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 9px 12px; margin-top: 12px; line-height: 1.7;
}

.qc-player { margin-top: 14px; }
.qc-player-head { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; }
.qc-siblings { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

.qc-dim { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.qc-dim:first-child { padding-top: 0; }
.qc-dim-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13px; }
.qc-dim-val { font-size: 13px; color: var(--text-sub); white-space: nowrap; }
.qc-dim-val span { font-weight: 700; color: var(--brand); font-size: 15px; }
.qc-range { width: 100%; margin-top: 8px; accent-color: var(--brand); cursor: pointer; }

.qc-sec-title { font-size: 13px; font-weight: 600; margin: 18px 0 8px; }
.qc-sec-title .muted { font-weight: 400; font-size: 12px; }
.qc-violations { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
@media (max-width: 720px) { .qc-violations { grid-template-columns: 1fr; } }
.qc-violations .checkline { font-size: 12.5px; color: var(--text-sub); }

.qc-scorebar {
  display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 12px 14px;
  background: var(--brand-soft); border: 1px solid #dbeafe; border-radius: var(--radius-sm);
  font-size: 13px; flex-wrap: wrap;
}
.qc-scorebar b { font-size: 22px; color: var(--brand); }
.qc-textarea { width: 100%; resize: vertical; line-height: 1.7; font-size: 13px; }

/* ============================================================
   外呼数据池
   ============================================================ */
.btn-xs { padding: 2px 7px; font-size: 11.5px; border-radius: 5px; }
.pager { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }
.tb tr.row-on td { background: var(--brand-soft); }
.tb .cell-main { font-size: 13px; }
.tb .cell-sub { font-size: 11.5px; color: var(--text-sub); margin-top: 2px; line-height: 1.5; }
/* 退回原因（台账状态列第二/三行）：一眼看到「为什么被退回来」。
   限宽 + 省略号，避免一条长原因把整列撑开、把后面的操作列挤出屏幕；全文走 title 悬停。 */
.tb .cell-back { color: #b45309; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ld-drop {
  border: 2px dashed var(--line-strong); border-radius: 14px; padding: 34px 20px; text-align: center;
  cursor: pointer; transition: all .15s; background: #fbfdff;
}
.ld-drop:hover, .ld-drop.on { border-color: var(--brand); background: var(--brand-soft); }
.ld-drop-icon { font-size: 38px; line-height: 1; }

.ld-wiz-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 14px;
}
.ld-wiz-cols { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 18px; }
@media (max-width: 1100px) { .ld-wiz-cols { grid-template-columns: 1fr; } }
.ld-sec-title { font-size: 12.5px; font-weight: 600; margin-bottom: 8px; }
.ld-sec-title .muted { font-weight: 400; font-size: 11.5px; }

.ld-map { max-height: 380px; overflow-y: auto; padding-right: 4px; }
.ld-map-row { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; align-items: center; margin-bottom: 6px; }
.ld-map-row label { font-size: 12px; color: var(--text-sub); }
.ld-map-row.req label { color: var(--text); font-weight: 600; }
.ld-map-row .select { width: 100%; font-size: 12px; padding: 4px 6px; }
.ld-map-extra {
  font-size: 11.5px; color: var(--text-sub); margin-top: 10px; line-height: 1.7;
  padding-top: 8px; border-top: 1px dashed var(--line);
}

.ld-preview { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.ld-tb { border-collapse: collapse; font-size: 11.5px; white-space: nowrap; }
.ld-tb th, .ld-tb td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 5px 8px; text-align: left; }
.ld-tb th { background: #f8fafc; font-weight: 600; position: sticky; top: 0; z-index: 1; }
.ld-tb th.mapped { background: var(--brand-soft); color: #1d4ed8; }
.ld-th-sub { font-size: 10.5px; font-weight: 400; color: var(--text-sub); margin-top: 1px; }
.ld-tb .idx { background: #f8fafc; color: var(--text-sub); text-align: center; position: sticky; left: 0; }
.ld-tb td.phone { font-variant-numeric: tabular-nums; font-weight: 600; }
.ld-tb td.bad { background: var(--red-soft); color: var(--red); }

.ld-modes { display: flex; flex-direction: column; gap: 6px; }
.ld-mode {
  display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 12.5px;
}
.ld-mode:hover { border-color: var(--brand); }
.ld-mode.on { border-color: var(--brand); background: var(--brand-soft); }
.ld-mode input { margin-top: 3px; }

.ld-result { text-align: center; padding: 8px 0 2px; }
.ld-result-head { font-size: 15px; font-weight: 700; margin-bottom: 16px; }
.ld-result-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
@media (max-width: 720px) { .ld-result-grid { grid-template-columns: repeat(2, 1fr); } }
.ld-rc { border-radius: 10px; padding: 12px 6px; background: #f8fafc; border: 1px solid var(--line); }
.ld-rc .v { font-size: 22px; font-weight: 700; }
.ld-rc .l { font-size: 11.5px; color: var(--text-sub); margin-top: 2px; }
.ld-rc.green .v { color: var(--green); }
.ld-rc.blue .v { color: var(--brand); }
.ld-rc.orange .v { color: #ea580c; }
.ld-rc.red .v { color: var(--red); }
.ld-rc.gray .v { color: var(--text-sub); }

.ld-detail-top {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 12px;
}
.ld-kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px; font-size: 12.5px; }
@media (max-width: 780px) { .ld-kv { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ld-kv > div > span { display: block; font-size: 11.5px; margin-bottom: 2px; }
.ld-kv b { font-weight: 600; word-break: break-all; }

.modal.xwide { max-width: 1180px; }

/* 业务选项：一级（rowspan 合并的那格）里的整组操作 */
table.tb td.biz-cat-cell { vertical-align: top; width: 210px; min-width: 210px; }
/* 一级名可以很长（报价表里最长 35 字）。这里必须写死宽度：
   table-layout:auto 下浏览器会把这一列压到「一个词一行」，光设 max-width 没用。 */
table.tb td.biz-cat-cell > b {
  display: block; width: 200px; white-space: normal;
  word-break: break-word; line-height: 1.5;
}
.biz-cat-ops { display: flex; align-items: center; gap: 9px; margin-top: 7px; }
.biz-cat-ops .btn-link { font-size: 12px; padding: 0; line-height: 1.4; }

/* ============================================================
   组织架构（CR-01）
   ------------------------------------------------------------
   一行一个节点，靠 padding-left 表达层级（后端已按树的先序排好，
   前端不需要递归，也不用算路径）。操作按钮默认压暗，
   鼠标悬停才提亮 —— 一屏十几个节点，常亮会淹没层级本身。
   ============================================================ */
.org-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
@media (max-width: 1180px) { .org-layout { grid-template-columns: 1fr; } }

.org-tree { padding: 6px 0 10px; }
.org-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px 8px 12px; border-bottom: 1px solid #f1f4f9;
  font-size: 13px; min-height: 42px;
}
.org-row:last-child { border-bottom: none; }
.org-row:hover { background: #f8fafc; }
.org-row.sel { background: var(--brand-soft); }
.org-row.off { opacity: .55; }
/* 平台层（平台方自己）不是一家公司：底色和左侧竖条让它与公司行区分开，
   否则整棵树看起来像「第一个公司底下挂了一堆公司」。 */
.org-row.platform { background: #f7f9fd; border-left: 3px solid var(--brand); padding-left: 12px !important; }
.org-row.platform .org-name { font-size: 13.5px; }
.org-row.company .org-name { font-weight: 600; }
/* 折叠三角：常显（藏起来用户不知道能收），但压得很淡；无下级的行留同位空白，
   这样同一层的名字起始位置仍然对得齐。 */
.org-toggle {
  flex: 0 0 15px; width: 15px; height: 18px; margin-right: -3px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 0; background: transparent; border-radius: 3px; cursor: pointer;
  color: #8a97ab; font-size: 12px; line-height: 1;
  transition: background .12s, color .12s;
}
.org-toggle:hover { background: #e8eefb; color: var(--brand); }
.org-toggle.leaf { cursor: default; pointer-events: none; }
/* 收起的那一行用品牌色三角：一眼看出「这里的下级是被人为收起来的」 */
.org-row.folded .org-toggle { color: var(--brand); }
/* 收起时告诉人里面藏了多少条（「+12」），比空三角有用得多 */
.org-fold-note {
  display: none; padding: 0 7px; border-radius: 9px; font-size: 11px; line-height: 1.7;
  background: #eef1f6; color: var(--text-sub); white-space: nowrap;
}
.org-row.folded .org-fold-note { display: inline-block; }
.org-dot { color: var(--text-muted); font-size: 12px; flex: 0 0 12px; text-align: center; }
.org-name {
  font-weight: 600; color: var(--text); cursor: pointer;
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.org-name:hover { color: var(--brand); text-decoration: underline; }
.org-count { color: var(--text-muted); font-size: 12px; margin-left: 2px; white-space: nowrap; }
.org-ops { margin-left: auto; display: flex; align-items: center; gap: 2px; opacity: .35; transition: opacity .15s; }
.org-row:hover .org-ops, .org-row.sel .org-ops { opacity: 1; }
.org-ops .btn { font-size: 12px; padding: 3px 7px; white-space: nowrap; }
.org-ops .org-del { color: var(--red); }
.org-ops .org-del:hover { background: var(--red-soft); }

/* 右侧详情 */
.org-detail-body { padding: 12px 14px 4px; }
.org-detail-body .kv {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 7px 0; font-size: 13px; border-bottom: 1px dashed #eef1f6;
}
.org-detail-body .kv:last-child { border-bottom: none; }
.org-detail-body .kv > span { color: var(--text-sub); flex: 0 0 92px; }
.org-detail-body .kv > b { color: var(--text); font-weight: 600; }

.org-members { padding: 4px 14px 14px; }
.org-mem-head { font-size: 12px; color: var(--text-muted); padding: 10px 0 6px; }
.org-mem {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 0; border-bottom: 1px solid #f4f6fa; font-size: 13px;
}
.org-mem:last-child { border-bottom: none; }
.org-mem .nm { font-weight: 600; color: var(--text); }
.org-mem .u { color: var(--text-muted); font-size: 12px; }
.org-mem .tag { margin-left: auto; }

/* 职务标签：比普通 tag 更轻，避免和"停用/外部"抢注意力 */
.tag-line {
  background: transparent; border: 1px solid var(--line-strong);
  color: var(--text-sub); font-weight: 500;
}
