/* 客户（业务）跟进管理系统 · 全局样式（浅色专业风） */
:root {
  --brand-700: #0f2f5c;
  --brand-600: #164a8c;
  --brand-500: #1a5fb4;
  --brand-400: #3d81d4;
  --brand-100: #e8f0fb;
  --gold: #c8892a;
  --gold-soft: #fdf4e6;
  --ok: #14875f;
  --ok-soft: #e8f7f0;
  --warn: #b9761a;
  --warn-soft: #fdf5e7;
  --danger: #c0392b;
  --danger-soft: #fdecea;
  --ink: #1b2431;
  --ink-2: #4a5768;
  --ink-3: #8592a5;
  --line: #e6ebf2;
  --bg: #f2f5fa;
  --card: #ffffff;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 38, 71, .05), 0 6px 20px rgba(16, 38, 71, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
[v-cloak] { display: none; }
a { color: var(--brand-500); text-decoration: none; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cdd7e5; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.side {
  width: 226px; flex: 0 0 226px; background: linear-gradient(180deg, #10305e 0%, #0b2346 100%);
  color: #cdd9ec; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  transition: width .2s ease, flex-basis .2s ease;
}
.side.fold { width: 64px; flex: 0 0 64px; }
.side .brand { padding: 18px 16px 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(255,255,255,.07); }
.side .logo {
  width: 34px; height: 34px; border-radius: 9px; flex: 0 0 34px; display: grid; place-items: center;
  background: linear-gradient(135deg, #2f7ade, #1a5fb4); color: #fff; font-weight: 700; font-size: 15px;
  box-shadow: 0 4px 12px rgba(26,95,180,.45);
}
.side .brand-t { line-height: 1.25; overflow: hidden; white-space: nowrap; }
.side .brand-t b { display: block; color: #fff; font-size: 14.5px; letter-spacing: .3px; }
.side .brand-t small { color: #7f96b8; font-size: 11px; letter-spacing: .6px; }
.side.fold .brand-t { display: none; }

.nav { flex: 1; overflow-y: auto; padding: 10px 8px 20px; }
.nav::-webkit-scrollbar { width: 4px; }
.nav-group { margin: 10px 0 4px; padding: 0 10px; color: #6c84a8; font-size: 11px; letter-spacing: 1px; }
.side.fold .nav-group { text-align: center; font-size: 9px; padding: 0; }
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 8px; cursor: pointer;
  color: #c2d0e6; font-size: 13.5px; margin-bottom: 2px; position: relative; transition: .16s;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: rgba(61,129,212,.22); color: #fff; font-weight: 600; }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: #4f9bf0;
}
.nav-item .glyph { width: 18px; text-align: center; font-size: 14px; opacity: .95; }
.nav-item .badge { margin-left: auto; background: #c0392b; color: #fff; font-size: 10px; padding: 0 5px; border-radius: 8px; line-height: 16px; }
.side.fold .nav-item { justify-content: center; padding: 10px 0; }
.side.fold .nav-item span.t { display: none; }
.side .side-foot { padding: 10px 12px; border-top: 1px solid rgba(255,255,255,.07); font-size: 11px; color: #6c84a8; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 58px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center;
  gap: 14px; padding: 0 18px; position: sticky; top: 0; z-index: 20;
}
.topbar .crumb { font-size: 14px; font-weight: 600; color: var(--ink); }
.topbar .crumb small { font-weight: 400; color: var(--ink-3); margin-left: 8px; font-size: 12px; }
.topbar .spacer { flex: 1; }
.month-pick { display: flex; align-items: center; gap: 6px; }
.user-chip { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px; border-radius: 20px; }
.user-chip:hover { background: #f4f7fb; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-100); color: var(--brand-600); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.user-chip .u-name { font-size: 13px; font-weight: 600; }
.user-chip .u-role { font-size: 11px; color: var(--ink-3); }

.content { flex: 1; padding: 16px 18px 32px; }
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
.page-head h2 { margin: 0; font-size: 19px; letter-spacing: .3px; }
.page-head .sub { color: var(--ink-3); font-size: 12.5px; padding-bottom: 3px; }
.page-head .spacer { flex: 1; }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.card-h h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.card-h .spacer { flex: 1; }
.card-h .hint { font-size: 12px; color: var(--ink-3); }
.card-b { padding: 16px; }
.card-b.tight { padding: 0; }

.grid { display: grid; gap: 14px; }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.g-1-2 { grid-template-columns: 1fr 2fr; }
@media (max-width: 1280px) {
  .g-4 { grid-template-columns: repeat(2, 1fr); }
  .g-2-1, .g-1-2 { grid-template-columns: 1fr; }
}

/* ---------- KPI ---------- */
.kpi { padding: 15px 16px; position: relative; overflow: hidden; }
.kpi .k-label { color: var(--ink-3); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.kpi .k-val { font-size: 26px; font-weight: 700; letter-spacing: -.5px; margin: 7px 0 3px; font-variant-numeric: tabular-nums; }
.kpi .k-val small { font-size: 13px; font-weight: 500; color: var(--ink-2); margin-left: 3px; }
.kpi .k-foot { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.kpi .k-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand-500); opacity: .85; }
.kpi.gold .k-bar { background: var(--gold); }
.kpi.ok .k-bar { background: var(--ok); }
.kpi.warn .k-bar { background: var(--warn); }
.delta { font-size: 12px; font-weight: 600; }
.delta.up { color: var(--danger); }   /* 涨=红（国内习惯） */
.delta.down { color: var(--ok); }
.delta.flat { color: var(--ink-3); }

/* ---------- 表格微调 ---------- */
.el-table th.el-table__cell { background: #f7f9fc !important; color: var(--ink-2); font-weight: 600; font-size: 12.5px; }
.el-table { font-size: 13px; }
.el-table .cell { line-height: 1.5; }
.t-strong { font-weight: 600; color: var(--ink); }
.t-mute { color: var(--ink-3); font-size: 12px; }
.t-num { font-variant-numeric: tabular-nums; }
.link { color: var(--brand-500); cursor: pointer; }
.link:hover { text-decoration: underline; }

/* ---------- 排行 ---------- */
.medal { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; }
.medal.m1 { background: linear-gradient(135deg, #e0a02a, #b9761a); }
.medal.m2 { background: linear-gradient(135deg, #9aa8ba, #77869a); }
.medal.m3 { background: linear-gradient(135deg, #c08457, #9a6539); }
.medal.mn { background: #dde4ee; color: var(--ink-2); }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px dashed var(--line); }
.rank-row:last-child { border-bottom: 0; }
.rank-row .rn { width: 26px; }
.rank-row .nm { flex: 1; min-width: 0; }
.rank-row .nm b { font-size: 13.5px; }
.rank-row .nm div { font-size: 11.5px; color: var(--ink-3); }
.rank-row .amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.rank-bar { height: 4px; background: #eef2f8; border-radius: 2px; overflow: hidden; margin-top: 4px; }
.rank-bar i { display: block; height: 100%; background: linear-gradient(90deg, #3d81d4, #1a5fb4); border-radius: 2px; }

/* ---------- 徽标 ---------- */
.pill { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11.5px; line-height: 18px; border: 1px solid transparent; }
.pill.blue { background: var(--brand-100); color: var(--brand-600); }
.pill.green { background: var(--ok-soft); color: var(--ok); }
.pill.orange { background: var(--warn-soft); color: var(--warn); }
.pill.red { background: var(--danger-soft); color: var(--danger); }
.pill.gray { background: #f0f3f8; color: var(--ink-2); }
.pill.gold { background: var(--gold-soft); color: var(--gold); }
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; margin-right: 5px; vertical-align: 1px; }

/* ---------- 时间线 ---------- */
.tl { position: relative; padding-left: 22px; }
.tl::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: #e8eef7; }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item::before {
  content: ''; position: absolute; left: -20px; top: 4px; width: 9px; height: 9px; border-radius: 50%;
  background: #fff; border: 2px solid var(--brand-400);
}
.tl-item.follow::before { border-color: #3d81d4; }
.tl-item.opp::before, .tl-item.opp-stage::before { border-color: var(--gold); }
.tl-item.contract::before, .tl-item.payment::before { border-color: var(--ok); }
.tl-item.lost::before, .tl-item.pool::before { border-color: var(--danger); }
.tl-item .tl-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-item .tl-h b { font-size: 13.5px; }
.tl-item .tl-time { font-size: 11.5px; color: var(--ink-3); }
.tl-item .tl-body { margin-top: 4px; font-size: 12.5px; color: var(--ink-2); white-space: pre-wrap; line-height: 1.6; }
.tl-item .tl-meta { margin-top: 4px; font-size: 11.5px; color: var(--ink-3); }

/* ---------- 看板 ---------- */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kb-col { flex: 0 0 232px; background: #f7f9fd; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.kb-col h4 { margin: 0 0 8px; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.kb-col h4 .cnt { color: var(--ink-3); font-weight: 400; font-size: 12px; }
.kb-col h4 .sum { margin-left: auto; font-size: 11.5px; color: var(--gold); font-weight: 600; }
.kb-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; margin-bottom: 8px; cursor: pointer; transition: .16s; }
.kb-card:hover { border-color: var(--brand-400); box-shadow: 0 4px 14px rgba(26,95,180,.12); transform: translateY(-1px); }
.kb-card .t { font-size: 12.8px; font-weight: 600; margin-bottom: 3px; }
.kb-card .m { font-size: 11.5px; color: var(--ink-3); display: flex; justify-content: space-between; }
.kb-card .a { color: var(--gold); font-weight: 700; font-size: 13px; }

/* ---------- 日历 ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.cal .hd { background: #f7f9fc; padding: 8px; font-size: 12px; color: var(--ink-2); text-align: center; font-weight: 600; }
.cal .cell { background: #fff; min-height: 92px; padding: 6px; }
.cal .cell.dim { background: #fbfcfe; color: #b9c3d2; }
.cal .cell.today { box-shadow: inset 0 0 0 2px var(--brand-400); }
.cal .d { font-size: 12px; color: var(--ink-3); margin-bottom: 3px; }
.cal .ev { font-size: 11px; padding: 1px 5px; border-radius: 4px; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.cal .ev.done { background: #eaf2fd; color: var(--brand-600); }
.cal .ev.plan { background: #fdf4e6; color: var(--gold); }

/* ---------- 进度条 ---------- */
.pbar { height: 8px; background: #eef2f8; border-radius: 4px; overflow: hidden; }
.pbar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #4f9bf0, #1a5fb4); }
.pbar i.warn { background: linear-gradient(90deg, #f0b45a, #c8892a); }
.pbar i.bad { background: linear-gradient(90deg, #e57373, #c0392b); }
.pbar i.ok { background: linear-gradient(90deg, #4cc295, #14875f); }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.native-date {
  width: 100%; height: 32px; padding: 0 10px; border: 1px solid #dcdfe6; border-radius: 4px;
  font-size: 13px; color: var(--ink); background: #fff; outline: none; font-family: inherit;
}
.native-date:focus { border-color: var(--brand-500); }
.el-form-item { margin-bottom: 14px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filter-bar .spacer { flex: 1; }

/* ---------- 工具 ---------- */
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; }
.muted { color: var(--ink-3); }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.el-tag { font-size: 11.5px; }

/* AI 分析 */
.ai-block { border-left: 3px solid var(--brand-400); padding: 2px 0 6px 12px; margin-bottom: 14px; }
.ai-block h4 { margin: 0 0 6px; font-size: 13.5px; }
.ai-block p { margin: 0; font-size: 13px; line-height: 1.85; color: var(--ink-2); white-space: pre-wrap; }
.ai-note { font-size: 11.5px; color: var(--ink-3); background: #f7f9fc; padding: 8px 10px; border-radius: 6px; }

/* 登录页 */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; background: #0d2544; }
.login-left { position: relative; padding: 56px; color: #fff; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.login-left::after {
  content: ''; position: absolute; right: -120px; top: -80px; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(79,155,240,.35), transparent 70%);
}
.login-left h1 { font-size: 34px; margin: 0 0 12px; letter-spacing: 1px; }
.login-left p.lead { color: #a9c0de; font-size: 14.5px; line-height: 2; margin: 0 0 28px; max-width: 520px; }
.login-left .flow { display: flex; flex-wrap: wrap; gap: 8px; max-width: 560px; }
.login-left .flow span { border: 1px solid rgba(255,255,255,.18); border-radius: 20px; padding: 5px 12px; font-size: 12.5px; color: #d5e3f5; }
.login-left .sign { position: absolute; bottom: 32px; font-size: 12px; color: #6f8db3; }
.login-right { background: #fff; display: grid; place-items: center; padding: 32px; }
.login-box { width: 340px; }
.login-box h2 { margin: 0 0 4px; font-size: 21px; }
.login-box .sub { color: var(--ink-3); font-size: 12.5px; margin-bottom: 22px; }
.login-err { color: var(--danger); font-size: 12.5px; min-height: 18px; margin-top: -6px; margin-bottom: 8px; }
.demo-acc { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 12px; }
.demo-acc .t { font-size: 12px; color: var(--ink-3); margin-bottom: 6px; }
.demo-acc .list { display: flex; flex-wrap: wrap; gap: 6px; }
.demo-acc .item { font-size: 12px; border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; cursor: pointer; color: var(--ink-2); }
.demo-acc .item:hover { border-color: var(--brand-400); color: var(--brand-600); background: var(--brand-100); }
@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-left { display: none; }
}

/* ---------- 拜访签到（定位 + 水印照片） ---------- */
.visit-box { border: 1px solid var(--line); border-radius: 10px; margin: 4px 0 14px; overflow: hidden; }
.visit-box .vb-head { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--brand-100); border-bottom: 1px solid var(--line); }
.visit-box .vb-head b { font-size: 13px; color: var(--brand-700); }
.visit-box .vb-body { padding: 10px 12px 12px; }
.visit-box .vb-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; padding: 3px 0; }
.visit-box .vb-k { width: 88px; color: var(--ink-3); flex: none; }
.visit-box .vb-ok { color: var(--ok); font-weight: 600; }
.visit-box .vb-bad { color: var(--danger); font-weight: 600; }
.visit-box .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.visit-box .vb-photos { margin-top: 8px; }
.visit-box .ph-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.visit-box .ph { position: relative; width: 96px; height: 72px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.visit-box .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.visit-box .ph .del { position: absolute; right: 2px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 13px; line-height: 17px; text-align: center; cursor: pointer; }
.visit-box .ph-add { width: 96px; height: 72px; border: 1px dashed var(--brand-400); border-radius: 8px; display: grid; place-items: center; color: var(--brand-600); font-size: 12px; cursor: pointer; background: var(--brand-100); }
.visit-box .ph-add.busy { opacity: .6; cursor: progress; }

/* ---------- 移动端入口提示 ---------- */
.topbar .mobile-link { white-space: nowrap; font-size: 12.5px; color: var(--brand-600); border: 1px solid var(--brand-400); border-radius: 14px; padding: 3px 10px; cursor: pointer; }
.topbar .mobile-link:hover { background: var(--brand-100); }

/* ---------- 流失分析 ---------- */
.loss-hero { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.loss-hero .h { background: #fff; border-radius: 12px; padding: 14px 16px; border-left: 4px solid var(--brand-500); }
.loss-hero .h .n { font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.loss-hero .h .l { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.loss-hero .h.warn { border-left-color: var(--danger); }
.loss-hero .h.warn .n { color: var(--danger); }
.loss-hero .h.good { border-left-color: var(--ok); }
.loss-hero .h.good .n { color: var(--ok); }
.insight-list li { font-size: 13px; line-height: 1.9; color: var(--ink-2); }
.insight-list li::marker { color: var(--brand-500); }

/* ---------- 免登配置卡片 / 绑定 ---------- */
.prov-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; cursor: pointer; min-width: 150px; background: #fff; transition: .15s; }
.prov-card:hover { border-color: var(--brand-400); }
.prov-card.on { border-color: var(--brand-500); box-shadow: 0 0 0 2px rgba(26,95,180,.12); }
.prov-card .pill { margin-top: 4px; display: inline-block; }
.bind-box { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 10px; }
.bind-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 12.5px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.pill { white-space: nowrap; }
.vb-ok { color: var(--ok); font-weight: 600; }
.vb-bad { color: var(--danger); font-weight: 600; }
