:root {
  --primary: #1a6dd6;
  --primary-dark: #0f53a8;
  --bg: #f4f6fa;
  --card: #fff;
  --text: #1f2733;
  --muted: #7b8794;
  --border: #e3e8ef;
  --danger: #d64545;
  --ok: #2e9e5b;
  --warn: #d98324;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(20, 40, 80, .08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.55; }
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; }

/* 登录页 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(160deg, #1a6dd6 0%, #3a8bef 55%, #7bb3f5 100%); }
.login-card { background: #fff; border-radius: 16px; padding: 34px 28px; width: 100%; max-width: 380px; box-shadow: 0 18px 50px rgba(0,0,0,.22); }
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-tip { margin-top: 14px; font-size: 12px; color: var(--muted); background: #f0f5fc; padding: 10px; border-radius: 8px; }
.login-error { margin-bottom: 12px; padding: 10px 12px; border-radius: 8px; background: #fdecec; color: var(--danger);
  border: 1px solid #f5c2c2; font-size: 13px; font-weight: 600; line-height: 1.4; }
.login-disclaimer { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--border);
  font-size: 12px; color: var(--muted); text-align: center; line-height: 1.7; }
.login-icp { margin-top: 10px; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.7; }
.login-icp a { color: var(--muted); }

/* 免责声明与资料来源 */
.disclaimer { margin-top: 14px; padding: 10px 12px; border-radius: 8px; background: #fff7ec;
  border: 1px solid #f0d9b0; color: #8a5a12; font-size: 13px; line-height: 1.6; }
.source-link { margin: 4px 0; word-break: break-all; }
.source-link a { font-weight: 600; }

/* 职业资格证 */
.cert-preview { border: 1px solid var(--border); border-radius: 8px; padding: 10px; background: #fbfcfe;
  max-height: 360px; overflow: auto; }
.cert-img { max-width: 100%; display: block; margin: 0 auto; }

/* 通用表单 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fbfcfe; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); background: #fff; }
.field textarea { min-height: 84px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn { display: inline-block; padding: 10px 18px; border: none; border-radius: 8px; background: var(--primary); color: #fff; font-size: 15px; }
.btn:hover { background: var(--primary-dark); }
.btn.block { width: 100%; padding: 12px; }
.btn.ghost { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn.gray { background: #eef1f5; color: var(--text); }
.btn.danger { background: var(--danger); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 主框架 */
.topbar { background: var(--primary); color: #fff; padding: 0 18px; height: 54px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 20; box-shadow: var(--shadow); }
.topbar .brand { font-weight: 700; font-size: 17px; }
.topbar .who { font-size: 13px; opacity: .92; display: flex; align-items: center; gap: 10px; }
.topbar .who .role-tag { background: rgba(255,255,255,.22); padding: 2px 8px; border-radius: 20px; font-size: 12px; }
.logout-btn { background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.45);
  border-radius: 20px; padding: 4px 12px; font-size: 13px; line-height: 1.4; }
.logout-btn:hover { background: rgba(255,255,255,.3); }
.layout { max-width: 1080px; margin: 0 auto; padding: 18px 16px 90px; }
.pc-nav { display: flex; gap: 6px; margin-bottom: 16px; background: var(--card); padding: 8px; border-radius: var(--radius); box-shadow: var(--shadow);
  position: sticky; top: 54px; z-index: 19; }
.pc-nav a { padding: 8px 16px; border-radius: 8px; color: var(--text); font-weight: 600; }
.pc-nav a.active { background: var(--primary); color: #fff; }
.bottom-nav { display: none; }

/* 卡片/列表 */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.card h2 { font-size: 16px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.card h3 { font-size: 14px; margin: 14px 0 8px; color: var(--muted); }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 4px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.list-item:last-child { border-bottom: none; }
.list-item .main { flex: 1; min-width: 160px; }
.list-item .name { font-weight: 700; font-size: 16px; }
.list-item .meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.muted { color: var(--muted); font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* 状态标签 */
.tag { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.tag-POTENTIAL { background: #e9eff7; color: #4a6785; }
.tag-INTERESTED { background: #e6f4ea; color: #2e7d4f; }
.tag-INVITING { background: #fff4e0; color: #b36b00; }
.tag-INTENDED { background: #e3f0ff; color: #1261c4; }
.tag-NO_INTENTION { background: #f3f3f3; color: #888; }
.tag-FROZEN { background: #fde8e8; color: #b33; }
.tag-overdue { background: #fde8e8; color: var(--danger); }
.tag-today { background: #fff4e0; color: var(--warn); }
.stars { color: #f5a623; letter-spacing: 1px; font-size: 13px; }
.stars .dim { color: #d8dde4; }
.chip { display: inline-block; background: #eef4fc; color: var(--primary-dark); border-radius: 6px; padding: 2px 9px; font-size: 12px; margin: 2px 4px 2px 0; }
.chip-link { cursor: pointer; transition: background .15s; }
.chip-link:hover { background: #d8e8fb; }

/* 客户表单：按类别分组的产品多选 */
.pick-group { margin-bottom: 12px; }
.pick-group-title { font-size: 13px; font-weight: 700; color: var(--primary-dark); margin-bottom: 6px;
  padding-left: 8px; border-left: 3px solid var(--primary); }
.pick-item { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: #f7faff; padding: 8px 10px; border-radius: 8px; }
.pick-item label { display: flex; align-items: flex-start; gap: 6px; flex: 1; min-width: 0; cursor: pointer; }
.pick-item label span { line-height: 1.4; }

/* 漏斗统计 */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-box { background: #f7faff; border: 1px solid var(--border); border-radius: 10px; padding: 12px; text-align: center; }
.stat-box .num { font-size: 24px; font-weight: 800; color: var(--primary); }
.stat-box .lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* 时间线 */
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item::before { content: ''; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--primary); }
.tl-item .tl-time { font-size: 12px; color: var(--muted); }
.tl-item .tl-channel { font-size: 12px; background: #eef4fc; color: var(--primary-dark); padding: 1px 8px; border-radius: 12px; margin-left: 6px; }
.tl-item .tl-content { margin-top: 4px; }
.tl-item .tl-next { margin-top: 5px; font-size: 13px; color: var(--warn); }

/* 工具条 */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input, .toolbar select { padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.toolbar input { flex: 1; min-width: 140px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.page-head h1 { font-size: 19px; }
.back-link { font-size: 14px; color: var(--muted); }

/* 星级输入 */
.star-input { display: inline-flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
.star-input select { padding: 6px 8px; }
.scope-row, .rel-row { display: flex; gap: 8px; margin-bottom: 8px; }
.scope-row input, .rel-row input, .rel-row select { flex: 1; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(15,25,40,.45); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 18px; }
.modal { background: #fff; border-radius: 14px; padding: 22px; width: 100%; max-width: 460px; max-height: 88vh; overflow-y: auto; }
.modal h3 { margin-bottom: 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

/* 产品详情 */
.kv { display: grid; grid-template-columns: 88px 1fr; gap: 6px 10px; font-size: 14px; margin-bottom: 6px; }
.kv .k { color: var(--muted); }
.rich-text { white-space: pre-wrap; background: #f8fafd; border-radius: 8px; padding: 12px; font-size: 14px; }
.checkbox-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.checkbox-grid label { display: flex; gap: 6px; align-items: center; font-weight: 400; font-size: 14px; background: #f7faff; padding: 8px 10px; border-radius: 8px; }

/* 手机适配 */
@media (max-width: 720px) {
  .layout { padding: 12px 12px 84px; }
  .pc-nav { display: none; }
  .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: #fff; box-shadow: 0 -2px 12px rgba(0,0,0,.08); z-index: 30; }
  .bottom-nav a { flex: 1; text-align: center; padding: 8px 0 10px; font-size: 12px; color: var(--muted); }
  .bottom-nav a .ico { display: block; font-size: 20px; line-height: 1.3; }
  .bottom-nav a.active { color: var(--primary); font-weight: 700; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .row2 { grid-template-columns: 1fr; }
  .checkbox-grid { grid-template-columns: 1fr; }
  .topbar .who .uname { display: none; }
  .logout-btn { padding: 3px 10px; font-size: 12px; }
}

.toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%) translateY(-80px); background: rgba(20,30,45,.92); color: #fff;
  padding: 10px 22px; border-radius: 24px; font-size: 14px; z-index: 100; transition: transform .25s; max-width: 88vw; }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--danger); }

/* 客户跟进模块 */
.tl-actions { margin-top: 6px; display: flex; gap: 14px; }
.tl-actions a { font-size: 12px; cursor: pointer; color: var(--primary); text-decoration: none; font-weight: 600; }
.tl-actions a.danger { color: var(--danger); }
.toolbar input[type="date"] { min-width: 120px; flex: 0 1 140px; }
