/* 获客雷达 —— 移动优先。深色导航 + 浅色内容，卡片化 */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }  /* 兜底：类样式里的 display 会盖掉 hidden 属性，弹层曾因此罩死全页 */
:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --ink: #1a2233;
  --sub: #6b7488;
  --line: #e6e9f0;
  --brand: #2b5cff;
  --brand-ink: #fff;
  --danger: #e5484d;
  --ok: #18a058;
  --warn: #d97706;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(20, 30, 60, .06), 0 6px 18px rgba(20, 30, 60, .06);
}
html { font-size: 16px; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.55;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}
h1 { font-size: 1.25rem; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }

/* ---------- 登录 ---------- */
.center-page { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-box { width: 100%; max-width: 340px; text-align: center; padding: 32px 22px; }
.logo { font-size: 44px; }
.login-box .sub { color: var(--sub); font-size: .85rem; margin: 6px 0 20px; }
input, textarea, select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font-size: .95rem; font-family: inherit; background: #fff; color: var(--ink); margin-bottom: 10px;
}
input:focus, textarea:focus { outline: 2px solid rgba(43, 92, 255, .25); border-color: var(--brand); }
.err { color: var(--danger); font-size: .8rem; min-height: 1.2em; }

/* ---------- 按钮 ---------- */
.btn {
  border: none; border-radius: 10px; padding: 10px 14px; font-size: .92rem; font-weight: 600;
  background: #eef1f7; color: var(--ink); cursor: pointer; font-family: inherit;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.danger { background: #fdecec; color: var(--danger); }
.btn.ok { background: #e6f6ee; color: var(--ok); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- 底部 tab ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
  flex: 1; border: none; background: none; padding: 8px 0 6px; font-size: 20px; cursor: pointer;
  color: var(--sub); font-family: inherit;
}
.tabbar button span { display: block; font-size: .68rem; font-weight: 600; }
.tabbar button.on { color: var(--brand); }

/* ---------- 页头 ---------- */
main { padding: 14px 14px 20px; max-width: 640px; margin: 0 auto; }
.pagehead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.pagehead h1 { font-size: 1.15rem; }
.pagehead .sub { color: var(--sub); font-size: .78rem; }

/* ---------- 线索卡 ---------- */
.lead-list { display: flex; flex-direction: column; gap: 10px; }
.lead {
  display: flex; gap: 10px; align-items: flex-start; cursor: pointer; position: relative;
}
.pbadge {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px; display: flex;
  align-items: center; justify-content: center; font-size: 20px; color: #fff;
}
.pbadge.dy { background: #101828; }
.pbadge.xhs { background: #d3293a; }
.lead .body { flex: 1; min-width: 0; }
.lead .t { font-weight: 700; font-size: .92rem; display: flex; gap: 6px; align-items: baseline; }
.lead .t .score { color: var(--warn); font-size: .78rem; white-space: nowrap; }
.lead .q { color: var(--sub); font-size: .84rem; overflow: hidden; text-overflow: ellipsis;
           display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lead .f { display: flex; gap: 8px; align-items: center; margin-top: 4px; font-size: .72rem; color: var(--sub); }
.chip { padding: 1px 8px; border-radius: 999px; font-size: .68rem; font-weight: 600; background: #eef1f7; }
.chip.hot { background: #fff1e0; color: var(--warn); }
.chip.contacted { background: #e8efff; color: var(--brand); }
.chip.replied { background: #e6f6ee; color: var(--ok); }
.chip.won { background: #fdeec9; color: #92610a; }
.chip.dropped { background: #f1f2f5; color: #9aa1b0; }
.chip.bell { background: #fdecec; color: var(--danger); }

/* 筛选条 */
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters button {
  flex-shrink: 0; border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 5px 13px; font-size: .8rem; color: var(--sub); cursor: pointer; font-family: inherit;
}
.filters button.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- 弹层 ---------- */
.sheet-mask {
  position: fixed; inset: 0; background: rgba(12, 18, 34, .45); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  background: #fff; width: 100%; max-width: 640px; border-radius: 18px 18px 0 0;
  padding: 10px 18px calc(20px + env(safe-area-inset-bottom));
  max-height: 88dvh; overflow-y: auto;
}
.sheet-bar { display: flex; justify-content: center; padding: 4px 0 10px; cursor: pointer; }
.sheet-bar i { width: 40px; height: 4px; border-radius: 4px; background: #d5d9e2; }
.sheet h2 { font-size: 1rem; margin-bottom: 6px; }
.sheet .quote {
  background: #f6f8fc; border-left: 3px solid var(--brand); padding: 10px 12px;
  border-radius: 8px; font-size: .9rem; margin: 10px 0; white-space: pre-wrap; word-break: break-all;
}
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.status-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.note-box label { font-size: .78rem; color: var(--sub); }

/* ---------- 绑定页 ---------- */
.bind-card { margin-bottom: 12px; }
.bind-card .row { display: flex; align-items: center; gap: 12px; }
.bind-card h2 { font-size: 1rem; flex: 1; }
.state-ok { color: var(--ok); font-size: .8rem; font-weight: 600; }
.state-bad { color: var(--danger); font-size: .8rem; font-weight: 600; }
.qr-wrap { text-align: center; padding: 14px 0 4px; }
.qr-wrap img {
  width: 220px; height: 220px; border: 8px solid #fff; border-radius: 12px;
  box-shadow: var(--shadow); background: #fff;
}
.qr-msg { color: var(--sub); font-size: .82rem; margin-top: 8px; }

/* ---------- 配置页 ---------- */
.cfg-group { margin-bottom: 14px; }
.cfg-group h3 { font-size: .9rem; margin-bottom: 8px; }
.cfg-group .hint { font-size: .74rem; color: var(--sub); margin-bottom: 8px; }
.target-row { display: flex; gap: 8px; margin-bottom: 8px; }
.target-row input:first-child { flex: 2; }
.target-row input:last-child { flex: 3; margin-bottom: 0; }
.target-row button { flex-shrink: 0; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag-list .tag { background: #eef1f7; border-radius: 8px; padding: 3px 10px; font-size: .8rem; }

/* ---------- 状态页 ---------- */
.stat-card { margin-bottom: 12px; }
.stat-card .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stat-card .msg { color: var(--sub); font-size: .82rem; margin: 8px 0; }
.hist { list-style: none; }
.hist li { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .82rem; color: var(--sub);
           display: flex; justify-content: space-between; gap: 10px; }
.hist li b { color: var(--ink); }
.banner {
  background: #fdeec9; color: #92610a; border-radius: 10px; padding: 10px 12px;
  font-size: .8rem; margin-bottom: 12px;
}

/* ---------- toast / 空态 ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: rgba(20, 28, 48, .92); color: #fff; padding: 9px 18px; border-radius: 999px;
  font-size: .84rem; z-index: 99; max-width: 86vw; text-align: center;
}
.empty { text-align: center; color: var(--sub); padding: 48px 20px; font-size: .88rem; }
.empty .big { font-size: 40px; margin-bottom: 8px; }

/* ================= 外呼模式 ================= */
.call-mask {
  position: fixed; inset: 0; background: #f6f7fb; z-index: 60; overflow-y: auto;
}
.call-box {
  max-width: 640px; margin: 0 auto;
  padding: 12px 16px calc(24px + env(safe-area-inset-bottom));
}
.call-top {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  margin-bottom: 10px; color: var(--sub); font-size: .82rem;
}
.pbadge.bd { background: #92610a; }
.chip.funnel { background: #ede9fe; color: #6d28d9; }
