/* =============================================================
   询盘客户信息管理系统 · 清爽后台风
   ============================================================= */
:root {
  --bg:        #f1f5f9;
  --surface:   #ffffff;
  --sidebar:   #ffffff;
  --border:    #e2e8f0;
  --border-2:  #cbd5e1;
  --text:      #0f172a;
  --text-2:    #334155;
  --muted:     #64748b;
  --muted-2:   #94a3b8;
  --primary:   #2563eb;
  --primary-d: #1d4ed8;
  --primary-l: #eff6ff;
  --green:     #16a34a;
  --green-l:   #f0fdf4;
  --amber:     #d97706;
  --amber-l:   #fffbeb;
  --red:       #dc2626;
  --red-l:     #fef2f2;
  --radius:    8px;
  --radius-lg: 12px;
  --shadow:    0 1px 2px rgba(15,23,42,.05);
  --font:      system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

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

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0; }

/* ---------------- 布局 ---------------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 216px; flex: 0 0 216px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 14px; border-bottom: 1px solid var(--border); }
.brand-mark {
  width: 34px; height: 34px; flex: 0 0 34px;
  background: var(--primary); color: #fff;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; letter-spacing: .5px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.brand-text strong { font-size: 14px; }
.brand-text span { font-size: 11px; color: var(--muted-2); }

.nav { flex: 1; overflow-y: auto; padding: 10px 10px 20px; }
.nav-group {
  font-size: 11px; color: var(--muted-2); text-transform: uppercase;
  letter-spacing: .6px; padding: 14px 8px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: var(--radius);
  color: var(--text-2); font-size: 13.5px;
  margin-bottom: 1px;
}
.nav-item:hover { background: #f8fafc; text-decoration: none; color: var(--text); }
.nav-item.active { background: var(--primary-l); color: var(--primary-d); font-weight: 500; }
.nav-item.active .ico { color: var(--primary); }
.ico { width: 17px; height: 17px; flex: 0 0 17px; color: var(--muted); }
.nav-badge {
  margin-left: auto; font-style: normal; font-size: 11px;
  background: var(--primary); color: #fff;
  border-radius: 9px; padding: 1px 7px;
}
.sidebar-foot { border-top: 1px solid var(--border); padding: 8px 10px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  position: sticky; top: 0; z-index: 20;
}
.topbar-left h1 { font-size: 17px; }
.topbar-left p { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.user-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: #f8fafc; border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 12px; font-size: 12.5px;
}
.user-chip em { font-style: normal; font-size: 11px; color: var(--muted); }

.content { padding: 20px 22px 48px; flex: 1; }

/* ---------------- 通用块 ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.card-head {
  padding: 13px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.card-head h3 { font-size: 14.5px; }
.card-head .sub { font-size: 12px; color: var(--muted); }
.card-body { padding: 16px 18px; }
.card-body.tight { padding: 0; }

/* 客户背调（详情页右栏）：标签左、内容右，长文本自动换行 */
.bg-list { display: block; }
.bg-item {
  display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 10px;
  padding: 9px 0; border-bottom: 1px solid #f1f5f9;
}
.bg-item:last-child { border-bottom: none; }
.bg-item .k { font-size: 12px; color: var(--muted); line-height: 1.7; }
.bg-item .v { font-size: 13px; color: var(--text); line-height: 1.7; word-break: break-word; }

/* 一键背调（v39）：卡片头右侧「状态标签 + 按钮」，以及按钮下方的进度 / 结果提示 */
.bg-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bg-mine-msg { margin: 10px 0 0; font-size: 12.5px; line-height: 1.7; color: var(--muted); }
.bg-mine-msg.ok  { color: #15803d; }
.bg-mine-msg.err { color: var(--red); }
.bg-edit { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.bg-edit > summary {
  display: inline-block; cursor: pointer; list-style: none;
  font-size: 12.5px; color: var(--primary-d); font-weight: 500;
}
.bg-edit > summary::-webkit-details-marker { display: none; }
.bg-edit[open] > summary { margin-bottom: 12px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* 统计卡 */
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 15px 17px; box-shadow: var(--shadow);
}
.stat .k { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 26px; font-weight: 600; letter-spacing: -.5px; margin-top: 4px; }
.stat .d { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }
.stat.accent { border-left: 3px solid var(--primary); }
.stat.warn   { border-left: 3px solid var(--amber); }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; font-weight: 500; color: var(--muted);
  background: #f8fafc; padding: 9px 12px; white-space: nowrap;
  border-bottom: 1px solid var(--border); font-size: 12.5px;
}
table.tbl td {
  padding: 9px 12px; border-bottom: 1px solid #f1f5f9;
  vertical-align: top; color: var(--text-2);
}
table.tbl tbody tr:hover { background: #f8fafc; }
table.tbl td.nowrap, table.tbl th.nowrap { white-space: nowrap; }
table.tbl td.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 12.5px; }
table.tbl .clamp { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty-row { text-align: center; color: var(--muted-2); padding: 36px 12px !important; }

/* ---------------- 徽章 ---------------- */
.tag {
  display: inline-block; font-size: 11.5px; line-height: 1.6;
  padding: 0 8px; border-radius: 999px;
  background: #f1f5f9; color: var(--text-2); white-space: nowrap;
}
.tag-blue  { background: var(--primary-l); color: var(--primary-d); }
.tag-green { background: var(--green-l);   color: var(--green); }
.tag-amber { background: var(--amber-l);   color: var(--amber); }
.tag-red   { background: var(--red-l);     color: var(--red); }
.tag-grey  { background: #f1f5f9;          color: var(--muted); }

.pill {
  display: inline-block; font-size: 12px; padding: 3px 11px;
  border-radius: 999px; white-space: nowrap;
}
.pill-info { background: var(--primary-l); color: var(--primary-d); }
.pill-info:hover { text-decoration: none; }
.pill-warn { background: var(--amber-l); color: var(--amber); }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; font-size: 13px; font-family: var(--font);
  border: 1px solid var(--border-2); background: var(--surface);
  color: var(--text-2); border-radius: var(--radius);
  cursor: pointer; line-height: 1.5; white-space: nowrap;
}
.btn:hover { background: #f8fafc; text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); border-color: var(--primary-d); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.tbl input[type="checkbox"] { vertical-align: middle; }
.mini-input { width: 100%; max-width: 200px; padding: 4px 8px; font-size: 13px; }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: #f1f5f9; }
.btn-sm { padding: 4px 10px; font-size: 12.5px; }
.btn-link { border: none; background: none; color: var(--primary); padding: 2px 4px; cursor: pointer; font-size: 12.5px; font-family: var(--font); }
.btn-link.danger { color: var(--red); }
.btn-link:hover { text-decoration: underline; }
/* 列表页信息编号 → 详情链接（保持等宽字体） */
.info-link { color: var(--primary); text-decoration: none; cursor: pointer; }
.info-link:hover { text-decoration: underline; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------------- 表单 ---------------- */
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .col-2 { grid-column: span 2; }
.form-grid .col-3 { grid-column: span 3; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field > label { font-size: 12.5px; color: var(--muted); }
.field > label .req { color: var(--red); margin-left: 2px; }
.field .hint { font-size: 11.5px; color: var(--muted-2); }

input[type=text], input[type=password], input[type=email], input[type=number],
input[type=date], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; padding: 7px 10px; font-size: 13.5px; font-family: var(--font);
  border: 1px solid var(--border-2); border-radius: var(--radius);
  background: var(--surface); color: var(--text); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
textarea { resize: vertical; min-height: 70px; line-height: 1.6; }
select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 9px center; padding-right: 28px; }

.filter-bar {
  display: flex; flex-wrap: wrap; gap: 9px; align-items: flex-end;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.filter-bar .field { min-width: 130px; }
.filter-bar .field.wide { min-width: 200px; flex: 1; }

/* 年份快捷按钮（数据分析） */
.year-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.year-pill {
  display: inline-block; padding: 3px 11px; font-size: 12.5px; line-height: 1.7;
  border: 1px solid var(--border); border-radius: 999px;
  color: var(--text-2); background: var(--surface); text-decoration: none; white-space: nowrap;
}
.year-pill:hover { border-color: var(--primary); color: var(--primary); }
.year-pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------------- 提示条 ---------------- */
.alert { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; font-size: 13px; border: 1px solid transparent; }
.alert-success { background: var(--green-l); color: var(--green); border-color: #bbf7d0; }
.alert-error   { background: var(--red-l);   color: var(--red);   border-color: #fecaca; }
.alert-warn    { background: var(--amber-l); color: var(--amber); border-color: #fde68a; }
.alert-info    { background: var(--primary-l); color: var(--primary-d); border-color: #bfdbfe; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------------- 一次性浮层提示（如「增加尼日利亚模具询盘一条」） ---------------- */
.flash-popup {
  position: fixed; left: 50%; top: 76px; z-index: 980;
  width: max-content; max-width: min(88vw, 560px);
  opacity: 0; transform: translate(-50%, -16px); pointer-events: none;
  transition: opacity .3s ease, transform .3s cubic-bezier(.22, 1, .36, 1);
}
.flash-popup.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.flash-popup-inner {
  position: relative; display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 42px 13px 16px; border-radius: 12px; color: #fff;
  background: linear-gradient(135deg, #16a34a, #0d9488);
  box-shadow: 0 16px 38px rgba(15, 23, 42, .24), 0 2px 6px rgba(15, 23, 42, .12);
}
.flash-popup-icon {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; line-height: 1;
  background: rgba(255, 255, 255, .22); border: 1.5px solid rgba(255, 255, 255, .72);
}
.flash-popup-body { min-width: 0; }
.flash-popup-msg { font-size: 16px; font-weight: 700; letter-spacing: .3px; line-height: 1.5; }
.flash-popup-sub { font-size: 12.5px; opacity: .88; margin-top: 3px; }
.flash-popup-close {
  position: absolute; top: 7px; right: 9px; padding: 2px 4px;
  border: 0; background: transparent; color: rgba(255, 255, 255, .85);
  font-size: 20px; line-height: 1; cursor: pointer;
}
.flash-popup-close:hover { color: #fff; }
@media (max-width: 600px) {
  .flash-popup { top: 62px; max-width: 92vw; }
  .flash-popup-inner { padding: 12px 38px 12px 14px; }
  .flash-popup-msg { font-size: 14.5px; }
}

/* ---------------- 分页 ---------------- */
.pager { display: flex; align-items: center; gap: 6px; padding: 13px 18px; flex-wrap: wrap; }
.pager-info { font-size: 12.5px; color: var(--muted); margin-right: auto; }
.pager-btn {
  min-width: 32px; height: 30px; padding: 0 9px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 12.5px; color: var(--text-2); background: var(--surface);
}
.pager-btn:hover { background: #f8fafc; text-decoration: none; }
.pager-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager-gap { color: var(--muted-2); padding: 0 2px; }

/* ---------------- 查重提示 ---------------- */
.dup-panel { margin-top: 8px; border-radius: var(--radius); font-size: 12.5px; overflow: hidden; border: 1px solid transparent; }
.dup-panel.confirmed { background: var(--red-l); border-color: #fecaca; }
.dup-panel.suspected { background: var(--amber-l); border-color: #fde68a; }
.dup-head { padding: 7px 11px; font-weight: 500; }
.dup-panel.confirmed .dup-head { color: var(--red); }
.dup-panel.suspected .dup-head { color: var(--amber); }
.dup-panel table { width: 100%; border-collapse: collapse; }
.dup-panel td, .dup-panel th { padding: 5px 11px; border-top: 1px solid rgba(148,163,184,.25); font-size: 12px; }
.dup-panel th { color: var(--muted); font-weight: 500; text-align: left; }
.dup-ok { margin-top: 8px; font-size: 12.5px; color: var(--green); }
.dup-checking { margin-top: 8px; font-size: 12.5px; color: var(--muted); }

/* ---------------- 详情页 ---------------- */
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.detail-item { padding: 11px 18px; border-bottom: 1px solid #f1f5f9; }
.detail-item .k { font-size: 12px; color: var(--muted); }
.detail-item .v { font-size: 13.5px; color: var(--text); word-break: break-all; }

.timeline { list-style: none; margin: 0; padding: 4px 0 0; }
.timeline li { position: relative; padding: 0 0 16px 20px; border-left: 2px solid var(--border); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: ''; position: absolute; left: -6px; top: 4px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary); border: 2px solid #fff;
}
.timeline .tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.timeline .tl-meta { font-size: 11.5px; color: var(--muted-2); }
.timeline .tl-body { font-size: 13px; color: var(--text-2); margin-top: 3px; white-space: pre-wrap; }

/* ---------------- 图表 ---------------- */
.chart-svg { display: block; width: 100%; height: auto; }
.chart-empty { padding: 40px 12px; text-align: center; color: var(--muted-2); font-size: 13px; }
.chart-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 8px; font-size: 12.5px; color: var(--text-2); }
.chart-legend .cl-item { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 2px; }
.chart-legend i.cl-line { width: 18px; height: 3px; border-radius: 2px; }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 190px; }
.donut-legend li { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 12.5px; border-bottom: 1px solid #f8fafc; }
.donut-legend i { width: 9px; height: 9px; border-radius: 2px; flex: 0 0 9px; }
.donut-legend .dl-label { flex: 1; color: var(--text-2); }
.donut-legend .dl-val { color: var(--muted); font-size: 12px; }

/* ---------------- 登录页 ---------------- */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); padding: 20px; }
.login-box { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 30px 28px; box-shadow: 0 4px 20px rgba(15,23,42,.06); }
.login-box .logo { width: 44px; height: 44px; border-radius: 11px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; margin-bottom: 16px; }
.login-box h1 { font-size: 19px; margin-bottom: 4px; }
.login-box .sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.login-box .field { margin-bottom: 14px; }
.login-box .btn { width: 100%; justify-content: center; padding: 9px; }

/* ---------------- 其他 ---------------- */
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
.nowrap { white-space: nowrap; }

.steps { display: flex; gap: 0; margin-bottom: 18px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; padding: 6px 16px 6px 0; font-size: 13px; color: var(--muted); }
.step i { width: 22px; height: 22px; border-radius: 50%; background: #e2e8f0; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-style: normal; }
.step.on { color: var(--primary-d); font-weight: 500; }
.step.on i { background: var(--primary); color: #fff; }

.login-tip { background: #f8fafc; border: 1px dashed var(--border-2); border-radius: var(--radius); padding: 10px 12px; font-size: 12.5px; color: var(--muted); margin-top: 18px; }

.dup-group { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.dup-group .g-head { background: #f8fafc; padding: 8px 13px; font-size: 12.5px; display: flex; justify-content: space-between; gap: 10px; }
.dup-group .g-body { padding: 10px 13px; font-size: 13px; white-space: pre-wrap; }

/* ---------------- 一轮分配顺序预览 ---------------- */
.cycle-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cycle-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; padding: 5px 10px; border-radius: var(--radius);
  font-size: 13px; line-height: 1.3;
  background: var(--bg); color: var(--text-2); border: 1px solid var(--border);
}
.cycle-chip.hot { background: var(--primary-l); color: var(--primary-d); border-color: #bfdbfe; font-weight: 500; }

/* 长文本单行省略（国家别名等） */
.ellip{display:block;max-width:280px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* 响应式 */
@media (max-width: 980px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid .col-3 { grid-column: span 2; }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .sidebar { position: fixed; left: -220px; z-index: 50; transition: left .2s; }
  .sidebar.open { left: 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .col-2, .form-grid .col-3 { grid-column: span 1; }
  .detail-grid { grid-template-columns: 1fr; }
  .content { padding: 14px; }
  .topbar { padding: 10px 14px; }
}
@media (min-width: 721px) { .menu-toggle { display: none; } }

/* 退回共享池：折叠式确认表单（放在操作行末尾，展开后独占一行） */
.return-box { flex-basis: 100%; }
.return-box > summary {
  display: inline-block; cursor: pointer; list-style: none;
  padding: 7px 14px; border: 1px solid #fecaca; border-radius: var(--radius);
  background: var(--red-l); color: var(--red); font-size: 13px; font-weight: 500;
}
.return-box > summary:hover { background: #fee2e2; }
.return-box > summary::-webkit-details-marker { display: none; }
.return-box[open] > summary { margin-bottom: 10px; }
.return-form {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 14px; max-width: 680px; margin-top: 4px;
}
.return-form textarea { width: 100%; }

/* 表头排序：可点击表头（客户列表「日期」列，按询盘日期升 / 降序） */
table.tbl th a.th-sort {
  display: inline-flex; align-items: center; gap: 3px;
  color: inherit; text-decoration: none; cursor: pointer;
}
table.tbl th a.th-sort:hover { color: var(--primary); }
table.tbl th a.th-sort.on { color: var(--text); font-weight: 600; }
table.tbl th a.th-sort .sort-ico { font-size: 10px; line-height: 1; opacity: .5; }
table.tbl th a.th-sort.on .sort-ico { opacity: 1; color: var(--primary); }

/* 企业微信设置页：接入步骤说明 */
.wx-steps { margin: 0 0 12px; padding-left: 20px; font-size: 13px; line-height: 1.9; color: var(--text-2); }
.wx-steps li { margin-bottom: 4px; }
.wx-steps b { font-weight: 600; color: var(--text); }

/* =============================================================
   共享池倒计时 / 二次开发池 / WhatsApp 一键直达
   ============================================================= */

/* 倒计时标签：>24h 灰、≤24h 橙、≤6h 红（轻微呼吸） */
.cd-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: #f1f5f9; color: #475569; border: 1px solid var(--border);
}
.cd-tag .cd-ico { font-size: 11px; line-height: 1; }
.cd-warn { background: var(--amber-l); color: #b45309; border-color: #fde68a; }
.cd-danger { background: var(--red-l); color: var(--red); border-color: #fecaca; animation: cdPulse 1.8s ease-in-out infinite; }
@keyframes cdPulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* WhatsApp 按钮（绿底白字圆标） */
.wa-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  width: 22px; height: 22px; margin-left: 5px;
  border-radius: 50%; background: #25d366; color: #fff;
  text-decoration: none; vertical-align: middle;
  transition: background .15s, transform .15s;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .18);
}
.wa-btn:hover { background: #1eb954; transform: translateY(-1px); color: #fff; }
.wa-btn.wa-btn-text { width: auto; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; }
.wa-btn.wa-btn-text span { line-height: 1; }

/* 点 WhatsApp 时的记录小弹框 */
.wa-modal {
  position: fixed; inset: 0; z-index: 999;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(15, 23, 42, .45);
}
.wa-modal[hidden] { display: none; }
.wa-modal-box {
  width: 100%; max-width: 400px; padding: 18px 18px 14px;
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(15, 23, 42, .28);
}
.wa-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.wa-modal-head h4 { margin: 0; font-size: 15px; }
.wa-close { background: none; border: 0; font-size: 22px; line-height: 1; color: var(--muted-2); cursor: pointer; }
.wa-num {
  margin-bottom: 12px; padding: 6px 10px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px;
  color: #047857; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 8px;
}

/* 刚记录过的那一行高亮一下 */
.row-hl { background: #fffbeb; }
.row-hl > td { background: #fffbeb; }
/* 处理人视角重点阶段整行高亮：意向客户=深红、深入沟通=浅红 */
.row-stage-intent > td { background: #f87171; }
.row-stage-talk   > td { background: #fecaca; }

/* 开发人员首页的使用说明 */
.guide-list { margin: 0; padding-left: 20px; font-size: 13.5px; line-height: 1.95; color: var(--text-2); }
.guide-list strong { color: var(--text); }

/* 表单底部的浅色提示（分配不可用等） */
.alert-inline { display: block; margin-top: 6px; padding: 6px 9px; border-radius: 6px;
  background: var(--amber-l); border: 1px solid #fde68a; color: #92400e; font-size: 12.5px; }

