:root {
  --bg: #0f1420;
  --bg-soft: #161d2c;
  --panel: #1b2333;
  --panel-2: #212b3d;
  --border: #2a3548;
  --border-soft: #232d3f;
  --text: #e6ecf5;
  --text-dim: #93a1b8;
  --text-mute: #6b7a93;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.14);
  --green: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;
  --purple: #8b5cf6;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ============ 登录页 ============ */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(59, 130, 246, 0.12), transparent 60%),
    radial-gradient(700px 500px at 85% 90%, rgba(139, 92, 246, 0.1), transparent 60%),
    var(--bg);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 400px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 36px 32px;
  box-shadow: var(--shadow);
}
.login-logo {
  display: flex; align-items: center; gap: 11px;
  margin-bottom: 26px;
}
.login-logo .mark {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  display: grid; place-items: center;
  font-size: 20px;
}
.login-logo h1 { font-size: 19px; font-weight: 650; letter-spacing: .3px; }
.login-logo p { font-size: 12px; color: var(--text-mute); }

/* ============ 表单 ============ */
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 12.5px; color: var(--text-dim);
  margin-bottom: 7px; font-weight: 500;
}
.input, .select, .textarea {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { resize: vertical; min-height: 76px; line-height: 1.6; }
.select { cursor: pointer; }
.input::placeholder, .textarea::placeholder { color: var(--text-mute); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--border-soft); border-color: #35425a; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #2f74e0; border-color: #2f74e0; }
.btn-danger { background: transparent; border-color: rgba(239,68,68,.4); color: #fca5a5; }
.btn-danger:hover:not(:disabled) { background: rgba(239,68,68,.12); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-lg { padding: 11px 20px; font-size: 15px; }

/* ============ 布局 ============ */
.app { display: none; min-height: 100vh; }
.app.active { display: block; }

.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: 216px;
  background: var(--bg-soft);
  border-right: 1px solid var(--border-soft);
  display: flex; flex-direction: column;
  z-index: 50;
}
/* 水印层已通过 left:216px 物理避开侧栏，无需 isolation（避免产生额外层叠上下文） */
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--border-soft);
}
.sidebar-brand .mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  display: grid; place-items: center; font-size: 16px; flex-shrink: 0;
}
.sidebar-brand .txt strong { display: block; font-size: 14.5px; font-weight: 600; }
.sidebar-brand .txt span { font-size: 11px; color: var(--text-mute); }

.nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 13.5px;
  cursor: pointer;
  margin-bottom: 2px;
  transition: background .15s, color .15s;
  user-select: none;
  /* flex 子项默认 min-width:auto，长文本会被压缩变形。
     侧栏固定 216px，导航文字需保证完整显示。 */
  min-width: 0;
  white-space: nowrap;
}
.nav-item .ico { flex-shrink: 0; }
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: #93c5fd; font-weight: 500; }
.nav-item .ico { width: 17px; text-align: center; font-size: 14px; flex-shrink: 0; }
.nav-item .badge {
  margin-left: auto;
  background: var(--red); color: #fff;
  font-size: 10.5px; padding: 1px 6px; border-radius: 9px; font-weight: 600;
}
.nav-divider { height: 1px; background: var(--border-soft); margin: 10px 4px; }
.nav-label {
  font-size: 10.5px; color: var(--text-mute);
  padding: 8px 12px 5px; font-weight: 600; letter-spacing: .6px;
}

.sidebar-foot {
  padding: 12px; border-top: 1px solid var(--border-soft);
  display: flex; align-items: center; gap: 9px;
}
.sidebar-foot .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: grid; place-items: center; font-size: 13px; font-weight: 600; color: #fff;
  flex-shrink: 0;
}
.sidebar-foot .info { flex: 1; min-width: 0; }
.sidebar-foot .info strong { display: block; font-size: 13px; font-weight: 550; }
.sidebar-foot .info span { font-size: 11px; color: var(--text-mute); }

.main { margin-left: 216px; min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  height: 58px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(22, 29, 44, 0.85);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  position: sticky; top: 0; z-index: 40;
}
.topbar h2 { font-size: 16px; font-weight: 600; }
.topbar .spacer { flex: 1; }

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

/* ============ 卡片 / 面板 ============ */
.card {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; gap: 12px;
}
.card-head h3 { font-size: 14.5px; font-weight: 600; }
.card-head .spacer { flex: 1; }
.card-body { padding: 18px; }

/* ============ 统计卡 ============ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 15px 17px;
  position: relative; overflow: hidden;
}
.stat::after {
  content: ''; position: absolute; right: -18px; top: -18px;
  width: 68px; height: 68px; border-radius: 50%;
  background: var(--accent-soft);
}
.stat .label { font-size: 12px; color: var(--text-mute); margin-bottom: 6px; }
.stat .value { font-size: 25px; font-weight: 650; line-height: 1.15; letter-spacing: -.5px; }
.stat .value small { font-size: 13px; color: var(--text-mute); font-weight: 400; margin-left: 3px; }
.stat .hint { font-size: 11.5px; color: var(--text-mute); margin-top: 5px; }
.stat.c-green .value { color: var(--green); }
.stat.c-amber .value { color: var(--amber); }
.stat.c-red .value { color: var(--red); }
.stat.c-blue .value { color: var(--accent); }
.stat.c-purple .value { color: var(--purple); }

/* ============ 表格 ============ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--bg-soft);
  padding: 10px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
  position: sticky; top: 0; z-index: 2;
}
tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px;
  vertical-align: middle;
}
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--panel-2); }
tbody tr.selected { background: var(--accent-soft); }
tbody tr:last-child td { border-bottom: none; }
.cell-name { font-weight: 550; }
.cell-sub { font-size: 11.5px; color: var(--text-mute); margin-top: 2px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.td-nowrap { white-space: nowrap; }

/* ============ 状态标签 ============ */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2.5px 9px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid transparent;
}
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* 安全告警级别 */
.tag.c-red { background: rgba(239,68,68,.14); color: #fca5a5; border-color: rgba(239,68,68,.35); }
.tag.c-amber { background: rgba(245,158,11,.14); color: #fcd34d; border-color: rgba(245,158,11,.35); }

/* ============ 工具栏 ============ */
.toolbar {
  display: flex; align-items: center; gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.toolbar .input, .toolbar .select { width: auto; min-width: 130px; }
.search-box { position: relative; flex: 1; min-width: 190px; max-width: 340px; }
.search-box .input { width: 100%; padding-left: 33px; }
.search-box .ico {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--text-mute); font-size: 13px; pointer-events: none;
}

.chip-row { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12.5px;
  cursor: pointer;
  user-select: none;
  transition: all .15s;
  white-space: nowrap;
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 500; }
.chip .cnt { opacity: .7; margin-left: 3px; font-size: 11px; }

/* ============ 分页 ============ */
.pager {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 18px;
  border-top: 1px solid var(--border-soft);
  flex-wrap: wrap;
}
.pager .info { font-size: 12.5px; color: var(--text-mute); }
.pager .spacer { flex: 1; }

/* ============ 空态 ============ */
.empty { padding: 56px 20px; text-align: center; color: var(--text-mute); }
.empty .ico { font-size: 40px; opacity: .35; margin-bottom: 12px; }
.empty p { font-size: 13.5px; }

/* ============ 联系方式查看（核心交互）============ */
.phone-cell { display: flex; align-items: center; gap: 8px; }
.phone-masked {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: .4px;
  user-select: none;
}

.btn-reveal {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(59,130,246,.35);
  background: var(--accent-soft);
  color: #93c5fd;
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  user-select: none;
}
.btn-reveal:hover:not(:disabled) { background: rgba(59,130,246,.26); border-color: var(--accent); color: #bfdbfe; }
.btn-reveal:disabled { opacity: .4; cursor: not-allowed; }
.btn-reveal.revealed {
  background: rgba(16,185,129,.16);
  border-color: rgba(16,185,129,.45);
  color: #6ee7b7;
}

/* 明文弹层 */
.reveal-pop {
  position: fixed;
  z-index: 300;
  width: 420px;
  max-width: calc(100vw - 24px);
  background: var(--panel);
  border: 1px solid rgba(59,130,246,.4);
  border-radius: var(--radius);
  box-shadow: 0 16px 44px rgba(0,0,0,.55);
  padding: 14px;
  animation: popIn .16s ease-out;
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(-6px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.reveal-pop .rp-head {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--text-dim);
  padding-bottom: 9px; margin-bottom: 10px;
  border-bottom: 1px solid var(--border-soft);
}
.reveal-pop .rp-head .spacer { flex: 1; }
.reveal-pop .rp-close {
  background: none; border: none; color: var(--text-mute);
  cursor: pointer; font-size: 15px; padding: 0 2px; line-height: 1;
}
.reveal-pop .rp-close:hover { color: var(--text); }
.reveal-pop .rp-phone {
  font-family: var(--mono);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 1.2px;
  color: #6ee7b7;
  text-align: center;
  padding: 11px 8px;
  background: rgba(16,185,129,.09);
  border-radius: var(--radius-sm);
  margin-bottom: 9px;
  user-select: none;
  -webkit-user-select: none;
}
.reveal-pop .rp-extra {
  font-family: var(--mono); font-size: 12.5px;
  color: var(--text-dim); text-align: center;
  padding: 6px; margin-bottom: 8px;
  background: var(--bg-soft); border-radius: 6px;
  user-select: none; -webkit-user-select: none;
}
.reveal-pop .rp-actions {
  display: flex; gap: 8px; margin-bottom: 10px;
}
.reveal-pop .rp-actions .btn { flex: 1; }
.rp-timer {
  height: 3px; background: var(--border);
  border-radius: 2px; overflow: hidden; margin-bottom: 9px;
}
.rp-timer .bar {
  height: 100%; background: linear-gradient(90deg, var(--green), var(--amber));
  transition: width 1s linear;
}
.reveal-pop .rp-warn {
  font-size: 11px; color: var(--text-mute);
  text-align: center; line-height: 1.5;
}
.reveal-pop .rp-warn b { color: var(--amber); font-weight: 600; }

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(8, 11, 18, 0.72);
  backdrop-filter: blur(3px);
  z-index: 200;
  display: grid; place-items: center;
  padding: 20px;
  animation: fadeIn .15s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 13px;
  width: 100%; max-width: 560px;
  max-height: 88vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow);
  animation: popIn .18s ease-out;
}
.modal.wide { max-width: 800px; }
.modal.narrow { max-width: 420px; }
.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; gap: 12px;
}
.modal-head h3 { font-size: 15.5px; font-weight: 600; }
.modal-head .spacer { flex: 1; }
.modal-close {
  background: none; border: none; color: var(--text-mute);
  font-size: 20px; cursor: pointer; line-height: 1; padding: 0 3px;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border-soft);
  display: flex; gap: 9px; justify-content: flex-end;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* ============ 时间线 ============ */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border);
}
.tl-item { position: relative; padding-bottom: 17px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ''; position: absolute; left: -21px; top: 5px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--panel);
}
.tl-item.tl-green::before { background: var(--green); }
.tl-item.tl-amber::before { background: var(--amber); }
.tl-item.tl-red::before { background: var(--red); }
.tl-item.tl-gray::before { background: var(--text-mute); }
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.tl-time { font-size: 11.5px; color: var(--text-mute); font-variant-numeric: tabular-nums; }
.tl-body { font-size: 13px; color: var(--text-dim); line-height: 1.6; white-space: pre-wrap; }

/* ============ 其他 ============ */
.alert {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
  display: flex; align-items: flex-start; gap: 9px;
  line-height: 1.6;
}
.alert-error { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.32); color: #fca5a5; }
.alert-ok { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.32); color: #6ee7b7; }
.alert-info { background: var(--accent-soft); border: 1px solid rgba(59,130,246,.3); color: #93c5fd; }
.alert-warn { background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.3); color: #fcd34d; }

.toast-box {
  position: fixed; top: 18px; right: 18px; z-index: 500;
  display: flex; flex-direction: column; gap: 9px;
}
.toast {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-size: 13px;
  box-shadow: var(--shadow);
  max-width: 380px;
  animation: slideIn .2s ease-out;
}
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.toast.ok { border-left-color: var(--green); }
.toast.err { border-left-color: var(--red); }
.toast.warn { border-left-color: var(--amber); }

.loading { text-align: center; padding: 40px; color: var(--text-mute); font-size: 13px; }
.spinner {
  width: 22px; height: 22px; margin: 0 auto 12px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.row { display: flex; gap: 9px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.muted { color: var(--text-mute); }
.dim { color: var(--text-dim); }
.small { font-size: 12px; }
.right { text-align: right; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }
/* ---------- 联系方式列表（一个客户多个号码时逐行展示） ---------- */
.contact-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 5px;
}
.contact-list.compact { gap: 3px; }
.contact-list .cl-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 9px; border-radius: var(--radius-sm);
  background: var(--bg-soft); border: 1px solid var(--border-soft);
  min-width: 0; flex-wrap: wrap;
}
.contact-list .cl-tag {
  flex: none; font-size: 10.5px; color: var(--text-mute);
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 6px; min-width: 42px; text-align: center;
}
.contact-list .cl-val {
  flex: 1; min-width: 0;
  font-family: var(--mono); font-size: 13.5px; color: var(--text);
  letter-spacing: .4px;
  /* 号码绝不能断行折断，宁可整行换行 */
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.5;
}
.contact-list .cl-act {
  flex: none; font-size: 11px; padding: 3px 8px;
  border-radius: 5px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text-dim); cursor: pointer;
  white-space: nowrap; transition: all .15s;
}
.contact-list .cl-act:hover { border-color: var(--accent); color: var(--accent); }
.contact-mask {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--text);
}
.contact-mask .cl-more {
  font-size: 11px; color: var(--text-mute);
  background: var(--bg-soft); border: 1px solid var(--border-soft);
  border-radius: 4px; padding: 1px 7px;
}

.hidden { display: none !important; }

.nowrap { white-space: nowrap; }
.pointer { cursor: pointer; }

.kv { display: grid; grid-template-columns: 84px 1fr; gap: 9px 14px; font-size: 13px; }
.kv dt { color: var(--text-mute); }
.kv dd { color: var(--text); word-break: break-all; }

.progress {
  height: 5px; background: var(--bg-soft);
  border-radius: 3px; overflow: hidden;
}
.progress .bar { height: 100%; background: var(--accent); transition: width .3s; }

.trend-chart { display: flex; align-items: flex-end; gap: 4px; height: 108px; padding-top: 10px; }
.trend-bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; }
.trend-bar .col {
  width: 100%; background: linear-gradient(180deg, var(--accent), #2563eb);
  border-radius: 3px 3px 0 0; min-height: 2px;
  transition: height .3s;
}
.trend-bar .lbl { font-size: 10px; color: var(--text-mute); white-space: nowrap; }
.trend-bar .val { font-size: 10.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; }

/* ============ 数据中心 ============ */
/* ============ 动态水印（仅查看联系方式时出现） ============ */
/* 平时完全隐藏，不干扰日常操作；点击"查看联系方式"时动态浮现，
   数秒后淡出。目的：形成震慑而非变成背景噪音。 */
.wm-layer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  left: 216px;                    /* 初始值，渲染后由 JS 按侧栏实际宽度覆盖 */
  z-index: 2147483000;
  pointer-events: none; user-select: none;
  overflow: hidden;
  opacity: 0;
  transition: opacity .55s ease;
}
.wm-layer.wm-in { opacity: 1; }
/* 呼吸式明暗变化：位置不变 → 关闭按钮始终可精确点击；
   视觉上仍是"活的"，不会像静态污点被忽略。 */
.wm-layer.wm-in .wm-banner { animation: wmPulse 4.5s ease-in-out infinite; }
.wm-float { display: contents; }

.wm-banner {
  position: absolute;
  /* 位置由 JS 动态计算（以号码元素为锚点），
     不能写死百分比——竖屏/4K 等分辨率下会与号码错位。
     这里的 0/50% 只是首帧兜底，渲染后立刻被 JS 覆盖。 */
  left: 50%; top: 0;
  transform: translateX(-50%);
  text-align: center;
  white-space: nowrap;
  padding: 14px 34px;
  border: 2px solid rgba(248, 113, 113, .5);
  border-radius: 14px;
  /* 半透明叠加：号码仍可读，但截图必然带上水印 */
  background: rgba(18, 10, 14, .3);
  pointer-events: auto;   /* 仅水印框可交互，不挡页面其他操作 */
}
/* 关闭按钮在 .wm-banner 内，banner 本身无动画，点击稳定 */
.wm-close {
  position: absolute; top: 6px; right: 8px;
  width: 22px; height: 22px; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(248, 113, 113, .18);
  color: rgba(248, 113, 113, .95);
  font-size: 16px; line-height: 1;
  display: grid; place-items: center;
}
.wm-close:hover { background: rgba(248, 113, 113, .32); }
.wm-banner-name {
  font-size: 30px; font-weight: 700; letter-spacing: 5px;
  color: rgba(252, 211, 77, .95);
  text-shadow: 0 2px 12px rgba(0, 0, 0, .8);
  font-family: var(--mono);
}
.wm-banner-warn {
  margin-top: 8px;
  font-size: 16px; font-weight: 600; letter-spacing: 6px;
  color: rgba(248, 113, 113, .92);
  text-shadow: 0 2px 10px rgba(0, 0, 0, .8);
}
.wm-banner-meta {
  margin-top: 10px;
  font-size: 13px; letter-spacing: 1px;
  color: rgba(226, 232, 240, .7);
  font-family: var(--mono);
}
@keyframes wmPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .62; }
}
/* 尊重系统「减少动态效果」 */
@media (prefers-reduced-motion: reduce) {
  .wm-layer.wm-in .wm-banner { animation: none; }
  .wm-layer { transition: opacity .3s ease; }
}
@media (max-width: 1280px) {
  .wm-banner-name { font-size: 30px; letter-spacing: 4px; }
  .wm-banner-warn { font-size: 15px; letter-spacing: 5px; }
  .wm-banner { padding: 12px 26px; }
}
@media (max-width: 860px) {
  .wm-layer { left: 0; }
  .wm-banner-name { font-size: 24px; letter-spacing: 2px; }
  .wm-banner-warn { font-size: 13px; letter-spacing: 3px; }
  .wm-banner { padding: 10px 20px; }
}

.wb-shell { max-width: 900px; margin: 0 auto; }
.wb-current {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(59,130,246,.06), transparent 60%), var(--panel);
  padding: 22px; position: relative; overflow: hidden;
}
.wb-current::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--accent), #2563eb);
}
.wb-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 3px 10px; border-radius: 999px;
  background: var(--accent-soft); color: #93c5fd; font-weight: 500;
}
.wb-lock {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 3px 10px; border-radius: 999px;
  background: rgba(245,158,11,.16); color: #fbbf24;
}
.wb-company { font-size: 19px; font-weight: 500; margin: 10px 0 4px; line-height: 1.4; color: var(--text); }
.wb-contact {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 2px 0 4px;
}
.wb-contact .name {
  font-size: 17px; font-weight: 500; color: var(--text);
  padding: 2px 10px; border-radius: 6px; background: var(--accent-soft);
}
.wb-contact .title { font-size: 14px; color: var(--text-dim); }
.wb-contact .meta { font-size: 12px; color: var(--text-mute); }
.wb-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; font-size: 13px; color: var(--text-dim); }
.wb-meta b { color: var(--text); font-weight: 500; }
.wb-phone {
  margin: 16px 0; font-size: 15px; padding: 14px 16px; border-radius: 10px;
  background: var(--bg-soft); display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.wb-phone .num { font-family: var(--mono); font-size: 20px; letter-spacing: 1px; color: var(--text); }
.wb-phone .dial-name { font-size: 18px; font-weight: 500; color: var(--text); }
/* 号码区：掩码态与解密后的多行列表 */
.wb-nums { display: flex; align-items: flex-start; gap: 12px; flex: 1; min-width: 0; justify-content: flex-end; }
.wb-nums > div { flex: 1; min-width: 0; max-width: 420px; }
.wb-nums .contact-list .cl-val { font-size: 16px; }
.wb-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.wb-steps { display: flex; align-items: flex-start; margin: 18px 0 6px; }
.wb-step-wrap { display: flex; flex-direction: column; align-items: center; flex: 1; }
.wb-step { display: flex; align-items: center; width: 100%; }
.wb-step-wrap:first-child .wb-step { justify-content: flex-start; }
.wb-step-wrap:last-child .wb-step { justify-content: flex-end; }
.wb-step .dot {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 12px;
  background: var(--bg-soft); color: var(--text-mute); border: 1.5px solid var(--border);
}
.wb-step.done .dot { background: rgba(16,185,129,.15); border-color: rgba(16,185,129,.5); color: var(--green); }
.wb-step.active .dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.wb-step .bar { flex: 1; height: 2px; background: var(--border); margin: 0 8px; }
.wb-step.done .bar { background: rgba(16,185,129,.4); }
.wb-step .txt { font-size: 11px; color: var(--text-mute); margin-top: 6px; white-space: nowrap; }
.wb-step-wrap { display: flex; flex-direction: column; align-items: center; }
.wb-queue-note { font-size: 13px; color: var(--text-dim); }
.wb-queue-note b { color: var(--text); }
.wb-empty { text-align: center; padding: 40px 20px; color: var(--text); }

/* 强制顺序提示条 */
.seq-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 10px; margin-bottom: 12px;
  background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.3);
  font-size: 13px; color: var(--text-dim);
}
.seq-bar b { color: var(--text); }

/* ============ 我的线索（销售端） ============ */
.fn-phone {
  padding: 12px 14px; border-radius: var(--radius);
  background: var(--bg-soft); border: 1px solid var(--border-soft);
}
.fn-phone .num {
  font-family: var(--mono); font-size: 19px; letter-spacing: 1px;
  color: var(--text);
}

.lead-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 760px) { .lead-cards { grid-template-columns: repeat(2, 1fr); } }
.lead-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
  text-align: center; cursor: pointer;
  transition: border-color .15s, transform .1s, background .15s;
}
.lead-card:hover { transform: translateY(-1px); border-color: var(--accent); }
.lead-card.active { border-color: var(--accent); background: var(--accent-soft); }
.lead-card .lc-icon { font-size: 20px; }
.lead-card .lc-num {
  font-size: 26px; font-weight: 600; line-height: 1.2; margin: 4px 0 2px;
  font-variant-numeric: tabular-nums;
}
.lead-card .lc-t { font-size: 12.5px; color: var(--text-dim); }
/* 超期待定行：红底警示，让积压暴露出来 */
.lead-overdue-row { background: rgba(239, 68, 68, .07); }
.lead-overdue-row:hover { background: rgba(239, 68, 68, .11); }

.analytics-grid { display: grid; grid-template-columns: 340px 1fr; gap: 14px; align-items: start; }
@media (max-width: 1100px) { .analytics-grid { grid-template-columns: 1fr; } }

.stream-list { max-height: 560px; overflow-y: auto; }
.stream-item {
  display: flex; gap: 11px; padding: 11px 16px;
  border-bottom: 1px solid var(--border-soft);
  animation: slideIn .25s ease-out;
}
.stream-item:last-child { border-bottom: none; }
.stream-item .s-ico {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 16px;
  background: var(--bg-soft);
}
.stream-item .s-body { flex: 1; min-width: 0; }
.stream-item .s-title { font-size: 13px; line-height: 1.45; }
.stream-item .s-title b { font-weight: 600; }
.stream-item .s-time { font-size: 11px; color: var(--text-mute); margin-top: 2px; font-variant-numeric: tabular-nums; }
.stream-item.is-new { background: rgba(59,130,246,.06); }

/* 双系列柱状图 */
.bar-group {
  display: flex; align-items: flex-end; gap: 3px; height: 160px;
  padding: 10px 6px 0;
}
.bar-group .bg-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.bar-group .bg-bars { display: flex; align-items: flex-end; gap: 2px; height: 118px; width: 100%; justify-content: center; }
.bar-group .bg-bars .col { width: 40%; max-width: 14px; border-radius: 2px 2px 0 0; transition: height .3s; }
.bar-group .bg-bars .col.follow { background: linear-gradient(180deg, #10b981, #059669); }
.bar-group .bg-bars .col.view { background: linear-gradient(180deg, #3b82f6, #2563eb); }
.bar-group .bg-lbl { font-size: 9.5px; color: var(--text-mute); white-space: nowrap; transform: rotate(-30deg); transform-origin: center; }
.bar-group .bg-val { font-size: 9px; color: var(--text-dim); }

.legend-row { display: flex; gap: 16px; justify-content: center; padding: 8px 0 2px; font-size: 12px; color: var(--text-dim); }
.legend-row .lg { display: flex; align-items: center; gap: 6px; }
.legend-row .dot { width: 9px; height: 9px; border-radius: 3px; }

/* 团队对比表高亮 */
.team-row-top { background: rgba(16,185,129,.05); }
.rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; font-size: 12px; font-weight: 700;
}
.rank-1 { background: rgba(245,158,11,.2); color: #fbbf24; }
.rank-2 { background: rgba(148,163,184,.2); color: #cbd5e1; }
.rank-3 { background: rgba(217,119,6,.2); color: #d97706; }


@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .form-grid, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .content { padding: 14px; }
}

/* 打印时隐藏敏感内容，防打印留存 */
@media print {
  body * { visibility: hidden; }
  .reveal-pop, .toast-box { display: none !important; }
}
.tag.c-green { background: rgba(16,185,129,.14); color: #6ee7b7; border-color: rgba(16,185,129,.35); }

/* ============ 多租户：登录页企业标识 / 顶栏企业徽标 ============ */
.login-foot {
  text-align: center;
  margin-top: 14px;
  line-height: 1.7;
}
#tenantHint:empty { display: none; }
#tenantHint { margin-top: 5px; font-size: 12px; }
#regEmailHint:empty { display: none; }
#regEmailHint { font-size: 12px; }

/* ============ 注册 / 找回密码面板 ============ */
.auth-head { margin-bottom: 22px; }
.auth-head h2 { font-size: 18px; font-weight: 650; }
.auth-head p { font-size: 12.5px; color: var(--text-mute); margin-top: 5px; }
.auth-head p b { color: var(--accent); font-weight: 650; }

.auth-links {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-mute);
}
.auth-links a { color: var(--accent); text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }
.auth-links .link-dot { margin: 0 8px; opacity: .5; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row .field { margin-bottom: 16px; }

.captcha-row { display: flex; gap: 10px; align-items: stretch; }
.captcha-row .input { flex: 1; min-width: 0; letter-spacing: 2px; }
.captcha-img {
  flex: 0 0 132px;
  height: 42px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  display: grid;
  place-items: center;
}
.captcha-img svg { display: block; width: 100%; height: 100%; }

/* 「获取验证码」按钮：和验证码图同宽同高，视觉上对齐成一列 */
.code-btn {
  flex: 0 0 132px;
  height: 42px;
  padding: 0 8px;
  font-size: 13px;
  white-space: nowrap;
}
.code-btn:disabled { opacity: .55; cursor: not-allowed; }

@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .login-card { padding: 26px 20px; }
}

.tenant-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--text-dim);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tenant-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex: none;
}
.tenant-badge.hidden { display: none; }

/* 平台后台的统计卡在窄屏下自动换行 */
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .tenant-badge { display: none; }
}
.tag.c-blue { background: rgba(59,130,246,.14); color: #93c5fd; border-color: rgba(59,130,246,.35); }
