/* HireWise 数据控制台 · 核心 — 设计令牌 + 共享组件
 * （表单/按钮、KPI 卡、dt-table 表格、空态、分页器、cp-modal 弹窗、确认弹窗、toast）
 * 对应 console.core.js；全站加载，必须最先引入
 */

/* ─── Legacy Buttons (cp-btn) ──────────────────────────────── */

.cp-btn {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  background: #fff;
  color: #475569;
  text-align: center;
  transition: all 0.12s ease;
}
.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  letter-spacing: 0.2px;
  margin-bottom: 5px;
}
.form-input {
  box-sizing: border-box;
  width: 100%;
  padding: 9px 11px;
  border: 1.5px solid #E2E8F0;
  border-radius: 8px;
  font-size: 12px;
  font-family: inherit;
  color: #0F172A;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus {
  outline: none;
  border-color: #2563EB;
  box-shadow: 0 0 0 4px rgba(37,99,235,0.15);
}
.form-input.textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.5;
}
.tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border: 1.5px solid #E2E8F0;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  color: #64748B;
  background: #fff;
  cursor: pointer;
  transition: all 0.12s ease;
}
.tag:hover {
  border-color: #CBD5E1;
  background: #F8FAFC;
}
.tag.active {
  border-color: #BFDBFE;
  background: #EFF6FF;
  color: #2563EB;
  font-weight: 600;
}
.form-btn {
  box-sizing: border-box;
  flex: 1;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}
.form-btn.primary {
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  color: #fff;
  box-shadow: 0 1px 3px rgba(37,99,235,0.3);
}
.form-btn.primary:hover {
  background: linear-gradient(135deg, #1D4ED8, #1E40AF);
}
.form-btn.primary:active {
  transform: scale(0.98);
}

/* ══════════════════════════════════════════════════════════════
   总览页 v3 — Arco Design 规范 + 品牌色 #2563EB
   ── 色板由品牌色按 Arco 10 档结构推导；表头中性灰、hover 用 primary-1、
      圆角 4px、正文 14px/1.5715、无斑马纹、只用横线分隔
   ══════════════════════════════════════════════════════════════ */

/* Arco token（提升为全站令牌：候选人 / 详情等页面同样引用，原先局部作用域会导致变量解析失败）*/
:root,
#page-overview {
  --primary-1: #EFF4FF;  --primary-2: #DBEAFE;  --primary-3: #BFD4FA;
  --primary-4: #89AAF4;  --primary-5: #5988EF;  --primary-6: #2563EB;
  --primary-7: #1D4ED8;
  --gray-1: #F8FAFC;  --gray-2: #F1F5F9;  --gray-3: #E2E8F0;  --gray-4: #CBD5E1;
  --gray-5: #94A3B8;  --gray-6: #94A3B8;  --gray-8: #475569;  --gray-10: #0F172A;
  --success-6: #16A34A; --warning-6: #D97706; --danger-6: #DC2626;
  --arco-text-1: var(--gray-10);
  --arco-text-2: var(--gray-8);
  --arco-text-3: var(--gray-6);
  --arco-border: var(--gray-3);
  --arco-radius: 4px;
  --arco-shadow: 0 1px 2px rgba(0,0,0,.04);
}

/* ══════════════════════════════════════════════════════════════
   总览 — 方案 B 高级版（浅色 + hairline + 分层阴影 + tabular 数字）
   ══════════════════════════════════════════════════════════════ */

/* 共享令牌（提升为全站令牌，理由同上） */
:root,
#page-overview {
  --ov-line: #E2E8F0;
  --ov-line-soft: #EEF2F7;
  --ov-ink: #0F172A;
  --ov-ink-2: #334155;
  --ov-ink-3: #64748B;
  --ov-ink-4: #94A3B8;
  --ov-brand: #2563EB;
  --ov-brand-600: #1D4ED8;
  --ov-brand-50: #EFF4FF;
  --ov-green: #059669;
  --ov-green-bg: #ECFDF5;
  --ov-amber: #D97706;
  --ov-amber-bg: #FFFBEB;
  --ov-red: #DC2626;
  --ov-radius: 12px;
  --ov-shadow-sm: 0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.06);
  --ov-shadow-md: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px -8px rgba(15,23,42,.10);
}

/* ── KPI 卡 ── */
.ov-kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-bottom: 16px;
}
.ov-kpi {
  background: #fff; border: 1px solid var(--ov-line); border-radius: var(--ov-radius);
  padding: 18px 20px; position: relative; overflow: hidden;
  box-shadow: var(--ov-shadow-sm);
  transition: box-shadow .2s, transform .2s;
}
.ov-kpi:hover { box-shadow: var(--ov-shadow-md); transform: translateY(-1px); }
.ov-kpi-label {
  font-size: 12.5px; color: var(--ov-ink-3); font-weight: 500;
  display: flex; align-items: center; gap: 5px;
}
.ov-kpi-help {
  width: 13px; height: 13px; border-radius: 50%;
  border: 1px solid var(--ov-line); color: var(--ov-ink-4);
  font-size: 10px; line-height: 1; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: help; user-select: none;
  transition: border-color .15s, color .15s, background .15s;
}
.ov-kpi-help:hover {
  border-color: var(--ov-brand); color: var(--ov-brand); background: var(--ov-brand-50);
}
.ov-kpi-val {
  font-size: 27px; font-weight: 680; letter-spacing: -.5px; line-height: 1.15;
  color: var(--ov-ink); margin: 7px 0 6px; font-variant-numeric: tabular-nums;
}
.ov-kpi-unit { font-size: 13px; font-weight: 480; color: var(--ov-ink-3); margin-left: 3px; }
.ov-kpi-foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ov-ink-4); flex-wrap: wrap; }
.ov-kpi-sub { color: var(--ov-ink-4); font-weight: 450; }
.ov-spark {
  position: absolute; right: 14px; top: 18px; opacity: .85; pointer-events: none;
}

/* ══════════════════════════════════════════════════════════════
   数据表格组件 dt-table（全站复用：总览排行 / 候选人 / 后续列表）
   宽度始终 100% 与容器对齐；单元格左右 20px 与卡片标题对齐
   ══════════════════════════════════════════════════════════════ */
.dt-wrap { width: 100%; }
.dt-table { width: 100%; border-collapse: collapse; table-layout: auto; }
.dt-table thead th {
  background: #F8FAFC; color: var(--ov-ink-3); text-align: left;
  font-size: 12.5px; font-weight: 560; letter-spacing: .2px;
  padding: 11px 20px; border-bottom: 1px solid var(--ov-line); white-space: nowrap;
}
.dt-table tbody td {
  padding: 14px 20px; font-size: 13.5px; color: var(--ov-ink);
  border-bottom: 1px solid var(--ov-line-soft); vertical-align: middle;
}
.dt-table tbody tr:last-child td { border-bottom: none; }
.dt-table tbody tr { transition: background .12s; }
.dt-table tbody tr[data-clickable] { cursor: pointer; }
.dt-table tbody tr[data-clickable]:hover td { background: #F8FAFF; }
.dt-table tbody tr[data-clickable]:hover .dt-main { color: var(--ov-brand); }
.dt-table th.num, .dt-table td.num { text-align: right; }
.dt-table td.num { font-variant-numeric: tabular-nums; font-weight: 500; }
.dt-table td.num .dt-na { color: var(--ov-ink-4); }
.dt-pct { font-size: 12px; color: var(--ov-ink-4); margin-left: 1px; font-weight: 450; }
.dt-main { font-weight: 540; color: var(--ov-ink); transition: color .12s; }
.dt-sub { font-size: 12px; color: var(--ov-ink-4); margin-top: 3px; font-weight: 450; }
.dt-na { color: var(--ov-ink-4); }
.ov-pos-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }

/* 空态（组件内置：图标 + 标题 + 说明 + 行动按钮） */
.dt-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 46vh; padding: 24px 20px; text-align: center; }
.dt-empty-ico { display: flex; justify-content: center; margin-bottom: 12px; }
.dt-empty-t { font-size: 15px; font-weight: 600; color: #334155; }
.dt-empty-d { font-size: 13px; color: var(--ov-ink-4); margin-top: 6px; line-height: 1.6; max-width: 380px; margin-left: auto; margin-right: auto; }
.dt-empty-btn {
  margin-top: 14px; height: 32px; padding: 0 14px;
  border: 1px solid var(--ov-line); border-radius: 6px; background: #fff;
  font-size: 12.5px; font-weight: 540; color: var(--ov-brand);
  cursor: pointer; font-family: inherit;
  transition: border-color .15s, background .15s;
}
.dt-empty-btn:hover { border-color: var(--ov-brand); background: var(--ov-brand-50); }

/* 场景适配 ── 卡片内（总览排行）：贴边无框，与卡片圆角融合 */
.ov-card .dt-table { font-size: 13px; }

/* 场景适配 ── 页面级（候选人列表 / 联系待办 / 账单）：独立成卡（11-30 待办页补齐，
   此前表格无卡片壳，底部裸奔与候选人页不一致；11-30 账单页同标——删 acc-card 双层壳，
   dt-wrap 本体成卡与其他表格页统一）。overflow-x:auto：表格总宽超卡时横向滚动，
   而非 hidden 把末列（操作）裁掉（11-30 反馈：候选人列表操作列消失） */
#page-candidates .dt-wrap, #page-contact-todo .dt-wrap, #page-billing .dt-wrap {
  background: #fff; border: 1px solid var(--ov-line);
  border-radius: var(--ov-radius); box-shadow: var(--ov-shadow-sm); overflow-x: auto;
}

/* ── 分页器（在 .ov-card 内嵌时去掉外框，避免双层） ── */
.ov-card .ov-pager { border: none; border-top: 1px solid var(--ov-line-soft); border-radius: 0; padding: 12px 16px; }

/* 分页器收进表格卡片（11-30）：作为 .dt-wrap 的 footer 渲染，去外框只留分隔线，
   底部圆角由卡片的 overflow:hidden + border-radius 自然裁出 */
.dt-wrap .ov-pager { border: none; border-top: 1px solid var(--ov-line-soft); border-radius: 0; padding: 12px 20px; }

/* 透明变体（11-30）：卡片列表页（岗位列表等）无整体卡壳，分页条去白底描边，
   避免孤零零一条壳悬在列表下方 */
.ov-pager-plain { background: transparent; border: none; border-radius: 0; padding: 12px 4px; }

/* 工具行弹性占位（11-30 全局化）：夹在筛选控件与右侧操作按钮之间，把按钮推到行尾 */
.spacer { flex: 1 1 auto; }

/* ══════════════════════════════════════════════════════════════
   分页器（Arco Pagination 风格）
   ══════════════════════════════════════════════════════════════ */
.ov-pager {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: #fff;
  border: 1px solid var(--arco-border, #E2E8F0); border-top: none;
  border-radius: 0 0 4px 4px;
}
.ov-pager-inner { border-top: 1px solid #F1F5F9; border-radius: 0; }
.ov-pager-total { font-size: 13px; color: #94A3B8; margin-right: auto; }
.ov-pager-btns { display: flex; align-items: center; gap: 4px; }
.ov-pg {
  min-width: 28px; height: 28px; padding: 0 6px;
  border: 1px solid #E2E8F0; background: #fff; border-radius: 4px;
  font-size: 13px; color: #475569; cursor: pointer; font-family: inherit;
  font-variant-numeric: tabular-nums; transition: all .12s ease;
}
.ov-pg:hover:not(.dis):not(.on) { border-color: #2563EB; color: #2563EB; }
.ov-pg.on { background: #2563EB; border-color: #2563EB; color: #fff; font-weight: 500; }
.ov-pg.dis { color: #CBD5E1; cursor: not-allowed; background: #F8FAFC; }
.ov-pg-dots { padding: 0 4px; color: #94A3B8; font-size: 13px; }
.ov-pager-size {
  height: 28px; padding: 0 6px; border: 1px solid #E2E8F0; border-radius: 4px;
  font-size: 13px; color: #475569; background: #fff; font-family: inherit; cursor: pointer;
}

/* ══════════════════════════════════════════════════════════════
   隐式要求 编辑弹窗（新增 / 编辑共用）
   ══════════════════════════════════════════════════════════════ */
.cp-modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
}
.cp-modal {
  width: 720px; max-width: 100%; max-height: 90vh;
  background: #fff; border-radius: 8px; overflow: hidden;
  box-shadow: 0 8px 32px rgba(15,23,42,.16);
  display: flex; flex-direction: column;
}
.cp-modal-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid #E2E8F0; flex-shrink: 0;
}
.cp-modal-head h3 { font-size: 16px; font-weight: 600; color: #0F172A; margin-bottom: 3px; }
.cp-modal-head .sub { font-size: 12px; color: #94A3B8; }
.cp-x {
  width: 28px; height: 28px; border: none; background: transparent; border-radius: 6px;
  color: #94A3B8; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.cp-x:hover { background: #F1F5F9; color: #0F172A; }

.cp-modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.cp-modal-foot {
  display: flex; align-items: center; gap: 10px; padding: 16px 24px;
  border-top: 1px solid #E2E8F0; background: #F8FAFC; flex-shrink: 0;
}
.cp-modal-foot .left { font-size: 12px; color: #94A3B8; margin-right: auto; }

.cp-field-label {
  font-size: 13px; font-weight: 600; color: #0F172A; margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.cp-field-label .hint { font-size: 11px; font-weight: 400; color: #94A3B8; }

#rulesText {
  width: 100%; min-height: 88px; padding: 10px 12px;
  border: 1px solid #E2E8F0; border-radius: 6px;
  font-size: 13px; font-family: inherit; color: #0F172A;
  line-height: 1.7; resize: vertical; outline: none; background: #fff;
}
#rulesText:focus { border-color: #2563EB; box-shadow: 0 0 0 3px rgba(37,99,235,.10); }
#rulesText::placeholder { color: #CBD5E1; }

.cp-input-acts { display: flex; align-items: center; gap: 8px; margin-top: 10px; }

.cp-btn {
  height: 32px; padding: 0 16px; border-radius: 6px; border: 1px solid #E2E8F0;
  background: #fff; font-size: 13px; color: #475569; cursor: pointer;
  font-family: inherit; display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; line-height: 1;
}
.cp-btn:hover { border-color: #2563EB; color: #2563EB; }
.cp-btn.pri { background: #2563EB; border-color: #2563EB; color: #fff; font-weight: 500; }
.cp-btn.pri:hover { background: #1D4ED8; border-color: #1D4ED8; color: #fff; }
.cp-btn:disabled { opacity: .5; cursor: not-allowed; }
.cp-btn:disabled:hover { border-color: #E2E8F0; color: #475569; }
.cp-btn.pri:disabled:hover { background: #2563EB; color: #fff; }
.cp-btn.danger { background: #DC2626; border-color: #DC2626; color: #fff; font-weight: 500; }
.cp-btn.danger:hover { background: #B91C1C; border-color: #B91C1C; color: #fff; }

/* 统一确认弹窗（confirmDialog / promptDialog 共用）：紧凑头部（无分隔线），按钮统一右下 */
.cf-modal { width: 400px; }
.cf-modal .cp-modal-head { padding: 20px 24px 0; border-bottom: none; }
.cf-modal .cp-modal-body { padding: 8px 24px 20px; }
.cf-modal .cp-modal-foot { border-top: none; background: transparent; padding: 0 24px 20px;
  gap: 8px; justify-content: flex-end; }
.cf-modal .cp-modal-foot .cp-btn { margin: 0; min-width: 88px; }
.cf-msg { font-size: 13px; color: #475569; line-height: 1.7; margin: 0; }
/* 轻量提示 toast：顶部居中，不阻断操作 */
/* 11-29 恢复：bb440d8 死代码清扫误杀——host 由 toast() 运行时动态创建，
   静态可达性分析看不到它；样式缺失后 host 以 static 流式排在 body 末尾，
   全站 toast 全部弹在视口外不可见（复制/标记成功失败提示均"消失"） */
#toastHost { position: fixed; top: 68px; left: 50%; transform: translateX(-50%);
  z-index: 2000; display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none; }
/* 11-30 终版尺寸：top 68 = 让开 56px 粘性顶栏（此前 20px 压在顶栏毛玻璃上）；
   max 400（业界顶中反馈甜点区，480 是 Material 底栏 snackbar 规格误用）；
   宽度贴合内容（11-30 反馈：min-width 220 + 居中让"已复制"两侧大片留白）；
   overflow-wrap 修长链接（邀请链接 toast）横向溢出；
   高度 38px 维持不动（= 字号 × 2.9，与 AntD message 同比例，业界最轻一档）。 */
.toast { max-width: min(400px, calc(100vw - 32px));
  padding: 9px 16px; border-radius: 8px; font-size: 13px;
  line-height: 1.5; overflow-wrap: anywhere;
  display: inline-flex; align-items: center; gap: 7px;
  box-shadow: 0 8px 24px rgba(15,23,42,.12);
  opacity: 0; transform: translateY(-8px); transition: opacity .22s ease, transform .22s ease; }
.toast-ic { display: inline-flex; flex-shrink: 0; }
.toast-ic svg { width: 14px; height: 14px; stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.toast-tx { overflow-wrap: anywhere; }
.toast.show { opacity: 1; transform: translateY(0); }

/* KPI 问号点击弹层（11-30）：深色气泡，z 高于 toast（2000），点空白/滚动即收 */
.kpi-tip { position: fixed; z-index: 2100; max-width: 320px; padding: 8px 12px;
  background: #0F172A; color: #F8FAFC; font-size: 12.5px; line-height: 1.6;
  border-radius: 8px; box-shadow: 0 8px 24px rgba(15,23,42,.18); }
.toast.info { background: #0F172A; color: #F8FAFC; }
.toast.success { background: #F0FDF4; color: #15803D; border: 1px solid #BBF7D0; }
.toast.error { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; }

.cp-result { margin-top: 18px; padding-top: 18px; border-top: 1px solid #E2E8F0; display: none; }
.cp-result.show { display: block; }
.cp-grp { margin-bottom: 14px; }
.cp-grp:last-child { margin-bottom: 0; }
.cp-grp-title { font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.cp-grp-title.hf { color: #DC2626; }
.cp-grp-title.sp { color: #D97706; }
.cp-grp-title.ec { color: #2563EB; }
.cp-grp-list { list-style: none; padding-left: 2px; margin: 0; }
.cp-grp-list li {
  font-size: 13px; color: #475569; line-height: 1.9;
  padding-left: 14px; position: relative; word-break: break-word;
}
.cp-grp-list li::before { content: '·'; position: absolute; left: 4px; color: #94A3B8; font-weight: 700; }
.cp-grp-list.ec li { padding-left: 2px; }
.cp-grp-list.ec li::before { content: ''; }

.cp-loading {
  display: none; align-items: center; gap: 8px;
  font-size: 13px; color: #94A3B8; padding: 14px 0;
}
.cp-loading.show { display: flex; }
.cp-loading .spinner {
  width: 14px; height: 14px; border: 2px solid #E2E8F0; border-top-color: #2563EB;
  border-radius: 50%; animation: cpSpin .7s linear infinite;
}
@keyframes cpSpin { to { transform: rotate(360deg); } }

.cp-noresult {
  display: none; margin-top: 14px; padding: 14px;
  background: #FEF3C7; border-radius: 6px;
  font-size: 12px; color: #92400E; line-height: 1.7;
}
.cp-noresult.show { display: block; }

/* ══════════════════════════════════════════════════════════════
   打招呼阈值 chip + 编辑弹层 + 阈值滑条
   ══════════════════════════════════════════════════════════════ */
.th-chip {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;
  border-radius: 4px; font-size: 12px; font-weight: 500; cursor: pointer;
  border: 1px solid transparent; transition: all .12s ease;
  background: #EFF4FF; color: #2563EB; flex-shrink: 0;
}
.th-chip:hover { border-color: #2563EB; }
.th-chip svg { flex-shrink: 0; }
.th-chip.static { cursor: default; }
.th-chip.static:hover { border-color: transparent; }

/* 阈值滑条（弹层 / 账户页共用） */
.thr-slider-row { width: 100%; }
.thr-slider-head {
  display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px;
}
.thr-slider-val {
  font-size: 20px; font-weight: 700; color: #2563EB; font-variant-numeric: tabular-nums;
}
.thr-slider-val small { font-size: 11px; font-weight: 400; color: #94A3B8; margin-left: 2px; }
.thr-range {
  width: 100%; -webkit-appearance: none; appearance: none; height: 4px; border-radius: 2px;
  background: linear-gradient(to right, #2563EB 0 var(--fill, 57%), #E2E8F0 var(--fill, 57%) 100%);
  outline: none;
}
.thr-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 2px solid #2563EB; box-shadow: 0 1px 4px rgba(37,99,235,.35);
  cursor: grab;
}
.thr-range:active::-webkit-slider-thumb { cursor: grabbing; box-shadow: 0 0 0 6px rgba(37,99,235,.15); }
.thr-range-scale {
  display: flex; justify-content: space-between; font-size: 12px; color: #94A3B8; margin-top: 4px;
}
.thr-modal { width: 400px; }
.thr-modal .cp-modal-body { padding-top: 24px; }
.thr-reset-btn {
  font-size: 12px; color: #64748B; background: none; border: none; cursor: pointer;
  margin-right: auto; padding: 6px 4px;
}
.thr-reset-btn:hover { color: #DC2626; }
