/* =====================================================================
   展脉通 LeadFair · 展会获客全流程数字化管理系统
   设计系统 / Design Tokens & Components
   一套代码，桌面（侧边栏）与移动（底部标签栏）双端自适应
   ===================================================================== */

:root {
  /* —— 色彩 —— */
  --ink:        #16202E;   /* 主文字 深石板 */
  --ink-2:      #56616F;   /* 次级文字 */
  --ink-3:      #93A0AF;   /* 弱化文字 */
  --line:       #E6EAF0;   /* 描边 */
  --line-2:     #F0F3F7;   /* 浅描边 */
  --bg:         #F4F6F9;   /* 应用底色 */
  --surface:    #FFFFFF;   /* 卡片底 */

  --brand:      #0E5C63;   /* 品牌主色 深青绿 */
  --brand-600:  #0A474D;
  --brand-700:  #07363B;
  --brand-50:   #E7F1F1;
  --brand-100:  #D2E6E6;

  --accent:     #E0922F;   /* 暖琥珀 强调/CTA */
  --accent-50:  #FBF1E2;

  /* 意向等级 */
  --lv-A:       #E0483B;   /* 高意向 红（热） */
  --lv-B:       #E0922F;   /* 中意向 琥珀 */
  --lv-C:       #3E7CC4;   /* 低意向 蓝 */
  --lv-D:       #98A4B0;   /* 无效   灰 */

  --ok:         #15A05A;   /* 成交/成功 */
  --ok-50:      #E6F5EC;
  --warn:       #E0922F;
  --danger:     #D6453F;
  --danger-50:  #FBEAE9;

  /* —— 间距 8px 栅格 —— */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 20px; --s6: 24px; --s7: 32px; --s8: 40px;

  /* —— 圆角 —— */
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px; --r-pill: 999px;

  /* —— 阴影 —— */
  --sh-1: 0 1px 2px rgba(22,32,46,.06);
  --sh-2: 0 4px 16px rgba(22,32,46,.08);
  --sh-3: 0 10px 36px rgba(22,32,46,.12);

  --sidebar-w: 232px;
  --topbar-h: 60px;

  font-synthesis: none;
}

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

html, body { height: 100%; }

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

.num { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.tnum { font-variant-numeric: tabular-nums; }

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--ink); }
a { color: inherit; text-decoration: none; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #D5DCE4; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #BFC9D4; }

/* =====================================================================
   应用骨架
   ===================================================================== */
.app { display: flex; min-height: 100vh; }

/* 桌面侧边栏 */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--brand-700);
  color: #C9D8D8;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: var(--s5) 0;
  z-index: 30;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 var(--s5) var(--s5);
}
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, #16A0A8, #0E5C63);
  display: grid; place-items: center;
  font-weight: 800; color: #fff; font-size: 19px;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
  position: relative; overflow: hidden;
}
.brand-mark::after {
  content:""; position:absolute; right:-6px; bottom:-8px;
  width:22px; height:22px; border-radius:50%;
  background: rgba(255,255,255,.16);
}
.brand-name { font-size: 17px; font-weight: 800; color: #fff; letter-spacing: .5px; }
.brand-sub  { font-size: 11px; color: #7FA0A0; letter-spacing: 1.5px; margin-top: 1px; }

.nav { display: flex; flex-direction: column; gap: 2px; padding: 0 var(--s3); margin-top: var(--s2); }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 9px;
  color: #B6CBCB; font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s;
  position: relative;
}
.nav-item .ic { width: 20px; height: 20px; flex: 0 0 20px; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.12); color: #fff; }
.nav-item.active::before {
  content:""; position:absolute; left:-12px; top:50%; transform:translateY(-50%);
  width:3px; height:18px; background: var(--accent); border-radius: 0 3px 3px 0;
}
.nav-badge {
  margin-left: auto; background: var(--accent); color:#fff;
  font-size: 11px; font-weight: 700; min-width: 18px; height: 18px;
  border-radius: 99px; display:grid; place-items:center; padding: 0 5px;
}
.sidebar-foot { margin-top: auto; padding: var(--s4) var(--s5) 0; }
.who {
  display:flex; align-items:center; gap:10px;
  padding: 10px 12px; border-radius: 10px;
  background: rgba(255,255,255,.06);
}
.who .av { width:34px; height:34px; border-radius:50%; background:#16A0A8; color:#fff;
  display:grid; place-items:center; font-weight:700; font-size:13px; }
.who .nm { color:#fff; font-weight:600; font-size:13px; }
.who .rl { color:#8FB0B0; font-size:11px; }

/* 主区 */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h); flex: 0 0 var(--topbar-h);
  background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: var(--s4);
  padding: 0 var(--s6); position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 17px; font-weight: 700; }
.topbar .crumb { color: var(--ink-3); font-size: 13px; }
.topbar .spacer { flex: 1; }
.topbar-search {
  display:flex; align-items:center; gap:8px;
  background: var(--bg); border:1px solid var(--line);
  border-radius: 99px; padding: 7px 14px; color: var(--ink-3);
  width: 240px; font-size: 13px;
}
.topbar-search input { border:none; background:none; outline:none; flex:1; }

.content { padding: var(--s6); flex: 1; }
.page-head { margin-bottom: var(--s5); }
.page-head .ph-title { font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.page-head .ph-desc { color: var(--ink-2); margin-top: 4px; font-size: 13.5px; }

/* =====================================================================
   通用组件
   ===================================================================== */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-1);
}
.card-pad { padding: var(--s5); }
.card-head {
  display:flex; align-items:center; justify-content:space-between;
  padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line-2);
}
.card-head h3 { font-size: 15px; font-weight: 700; }
.card-head .sub { color: var(--ink-3); font-size: 12.5px; }

/* 按钮 */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  padding: 9px 16px; border-radius: var(--r-sm); font-weight: 600; font-size: 13.5px;
  transition: all .15s; white-space: nowrap; border: 1px solid transparent;
}
.btn svg { width:16px; height:16px; }
.btn-primary { background: var(--brand); color:#fff; }
.btn-primary:hover { background: var(--brand-600); }
.btn-accent { background: var(--accent); color:#fff; }
.btn-accent:hover { filter: brightness(.96); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--bg); }
.btn-soft { background: var(--brand-50); color: var(--brand-600); }
.btn-soft:hover { background: var(--brand-100); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn:disabled { opacity:.5; cursor:not-allowed; }

/* 标签 / 徽章 */
.tag {
  display:inline-flex; align-items:center; gap:5px;
  padding: 3px 9px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600; line-height: 1.4;
}
.tag-soft { background: var(--bg); color: var(--ink-2); border:1px solid var(--line); }
.tag-A { background: #FBE9E7; color: var(--lv-A); }
.tag-B { background: var(--accent-50); color: var(--lv-B); }
.tag-C { background: #E8F0F9; color: var(--lv-C); }
.tag-D { background: #EEF1F4; color: var(--lv-D); }
.dot { width:7px; height:7px; border-radius:50%; display:inline-block; }
.dot-A{background:var(--lv-A)} .dot-B{background:var(--lv-B)}
.dot-C{background:var(--lv-C)} .dot-D{background:var(--lv-D)}

.chip {
  display:inline-flex; align-items:center; gap:6px;
  padding:5px 11px; border-radius: var(--r-pill);
  background: var(--bg); border:1px solid var(--line);
  font-size:12.5px; color:var(--ink-2); font-weight:500;
}
.chip.active { background: var(--brand); color:#fff; border-color: var(--brand); }

/* 表单 */
.field { margin-bottom: var(--s4); }
.field label { display:block; font-size:13px; font-weight:600; margin-bottom:6px; color:var(--ink); }
.field .req { color: var(--danger); margin-left:2px; }
.input, .select, .textarea {
  width:100%; padding: 10px 12px; border:1px solid var(--line);
  border-radius: var(--r-sm); background: var(--surface); outline:none;
  transition: border .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50);
}
.textarea { resize: vertical; min-height: 84px; }
.form-grid { display:grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.form-grid .full { grid-column: 1 / -1; }

/* 表格 */
.table { width:100%; border-collapse: collapse; }
.table th {
  text-align:left; font-size:12px; font-weight:600; color:var(--ink-3);
  padding: 11px var(--s4); border-bottom:1px solid var(--line); white-space:nowrap;
  background: var(--bg);
}
.table td { padding: 13px var(--s4); border-bottom:1px solid var(--line-2); font-size:13.5px; vertical-align: middle; }
.table tbody tr:hover { background: #FAFBFC; }
.table tbody tr:last-child td { border-bottom:none; }
.row-actions { display:flex; gap:8px; }

/* 列表项 */
.lead-row { display:flex; align-items:center; gap:12px; padding:14px var(--s4); border-bottom:1px solid var(--line-2); }
.lead-row:last-child { border-bottom:none; }
.lead-row:hover { background:#FAFBFC; }
.av-sm { width:38px; height:38px; border-radius:50%; flex:0 0 38px; display:grid; place-items:center;
  font-weight:700; color:#fff; font-size:14px; background:var(--brand); }
.av-sm.gray{background:#AEB8C2}

/* KPI 卡 */
.kpi { background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); padding:var(--s5); box-shadow:var(--sh-1); position:relative; overflow:hidden; }
.kpi .k-label { color:var(--ink-3); font-size:12.5px; font-weight:500; display:flex; align-items:center; gap:6px; }
.kpi .k-val { font-size:26px; font-weight:800; margin-top:8px; letter-spacing:-.5px; }
.kpi .k-val small { font-size:14px; font-weight:600; color:var(--ink-3); }
.kpi .k-foot { margin-top:8px; font-size:12px; color:var(--ink-2); display:flex; align-items:center; gap:6px; }
.kpi .k-ic { position:absolute; right:16px; top:16px; width:34px; height:34px; border-radius:10px; display:grid; place-items:center; background:var(--brand-50); color:var(--brand); }
.kpi.accent .k-ic { background:var(--accent-50); color:var(--accent); }
.kpi.ok .k-ic { background:var(--ok-50); color:var(--ok); }
.kpi.danger .k-ic { background:var(--danger-50); color:var(--danger); }
.up { color:var(--ok); font-weight:700; }
.down { color:var(--danger); font-weight:700; }

/* 空态 */
.empty { text-align:center; padding: 56px 20px; color:var(--ink-3); }
.empty .e-ic { width:64px; height:64px; margin:0 auto 14px; border-radius:18px; background:var(--bg); display:grid; place-items:center; color:var(--ink-3); }
.empty h4 { color:var(--ink-2); font-size:15px; margin-bottom:6px; }
.empty p { font-size:13px; max-width:320px; margin:0 auto; }

/* 进度条 */
.bar { height:8px; border-radius:99px; background:var(--line); overflow:hidden; }
.bar > span { display:block; height:100%; border-radius:99px; background:var(--brand); }

/* 模态 */
.modal-mask { position:fixed; inset:0; background:rgba(16,24,38,.45); display:none; align-items:center; justify-content:center; z-index:100; padding:20px; backdrop-filter: blur(2px); }
.modal-mask.show { display:flex; }
.modal { background:var(--surface); border-radius:var(--r-xl); width:100%; max-width:540px; max-height:90vh; overflow:auto; box-shadow:var(--sh-3); }
.modal.wide { max-width:720px; }
.modal-head { padding:var(--s5) var(--s5) var(--s3); display:flex; align-items:center; justify-content:space-between; }
.modal-head h3 { font-size:17px; font-weight:800; }
.modal-body { padding: 0 var(--s5) var(--s5); }
.modal-foot { padding: var(--s4) var(--s5); border-top:1px solid var(--line-2); display:flex; gap:10px; justify-content:flex-end; }
.x-close { width:32px; height:32px; border-radius:8px; display:grid; place-items:center; color:var(--ink-3); }
.x-close:hover { background:var(--bg); color:var(--ink); }

/* Toast */
.toast-wrap { position:fixed; top:18px; left:50%; transform:translateX(-50%); z-index:200; display:flex; flex-direction:column; gap:10px; align-items:center; }
.toast { background:var(--ink); color:#fff; padding:11px 18px; border-radius:10px; font-size:13.5px; box-shadow:var(--sh-3); display:flex; align-items:center; gap:9px; animation:pop .25s ease; }
.toast.ok { background:#0E5C63; }
.toast.warn { background:#B9761F; }
@keyframes pop { from{opacity:0; transform:translateY(-8px)} to{opacity:1; transform:none} }

/* 分段控制 */
.seg { display:inline-flex; background:var(--bg); border:1px solid var(--line); border-radius:99px; padding:3px; }
.seg button { padding:7px 16px; border-radius:99px; font-size:13px; font-weight:600; color:var(--ink-2); }
.seg button.active { background:var(--surface); color:var(--brand); box-shadow:var(--sh-1); }

/* 时间轴 */
.timeline { position:relative; padding-left:22px; }
.timeline::before { content:""; position:absolute; left:6px; top:4px; bottom:4px; width:2px; background:var(--line); }
.tl-item { position:relative; padding-bottom:18px; }
.tl-item:last-child { padding-bottom:0; }
.tl-item::before { content:""; position:absolute; left:-19px; top:4px; width:11px; height:11px; border-radius:50%; background:var(--surface); border:2px solid var(--brand); }
.tl-item.done::before { background:var(--ok); border-color:var(--ok); }
.tl-item .tl-t { font-size:13.5px; font-weight:600; }
.tl-item .tl-d { font-size:12.5px; color:var(--ink-3); margin-top:2px; }
.tl-item .tl-meta { font-size:12px; color:var(--ink-2); margin-top:4px; }

/* 二维码占位 */
.qr-box { width:200px; height:200px; border-radius:12px; background:#fff; border:1px solid var(--line); display:grid; place-items:center; margin:0 auto; padding:10px; }

/* 统计小格 */
.stat-mini { display:flex; flex-direction:column; gap:3px; padding:12px 14px; background:var(--bg); border-radius:10px; }
.stat-mini .sm-l { font-size:12px; color:var(--ink-3); }
.stat-mini .sm-v { font-size:18px; font-weight:800; }

/* 布局栅格 */
.grid { display:grid; gap:var(--s5); }
.cols-4 { grid-template-columns: repeat(4,1fr); }
.cols-3 { grid-template-columns: repeat(3,1fr); }
.cols-2 { grid-template-columns: repeat(2,1fr); }
.split { display:grid; grid-template-columns: 1.6fr 1fr; gap:var(--s5); align-items:start; }

/* 工具类 */
.flex { display:flex; } .between { justify-content:space-between; } .center { align-items:center; }
.gap2{gap:8px} .gap3{gap:12px} .gap4{gap:16px} .wrap{flex-wrap:wrap}
.mt2{margin-top:8px} .mt3{margin-top:12px} .mt4{margin-top:16px} .mt5{margin-top:20px} .mt6{margin-top:24px}
.mb2{margin-bottom:8px} .mb3{margin-bottom:12px} .mb4{margin-bottom:16px}
.muted{color:var(--ink-3)} .muted2{color:var(--ink-2)} .bold{font-weight:700}
.right{text-align:right} .center-t{text-align:center}
.nowrap{white-space:nowrap} .ellipsis{overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.divider{height:1px; background:var(--line-2); margin:var(--s4) 0}

/* =====================================================================
   登录 / 角色选择（首页）
   ===================================================================== */
.auth { min-height:100vh; display:flex; }
.auth-left {
  flex:1; background: linear-gradient(150deg, #07363B 0%, #0E5C63 55%, #16A0A8 130%);
  color:#fff; padding:64px 56px; display:flex; flex-direction:column; justify-content:space-between;
  position:relative; overflow:hidden;
}
.auth-left .ab-mark { width:54px; height:54px; border-radius:14px; background:rgba(255,255,255,.14);
  display:grid; place-items:center; font-weight:800; font-size:26px; backdrop-filter:blur(4px); }
.auth-left h1 { font-size:34px; font-weight:800; line-height:1.3; letter-spacing:.5px; }
.auth-left .lead { font-size:15px; color:#BFE0E0; margin-top:14px; max-width:420px; line-height:1.7; }
.auth-points { margin-top:36px; display:flex; flex-direction:column; gap:14px; }
.auth-points .p { display:flex; gap:12px; align-items:flex-start; }
.auth-points .p .pc { width:30px; height:30px; border-radius:8px; background:rgba(255,255,255,.13); display:grid; place-items:center; flex:0 0 30px; }
.auth-points .p b { font-size:14.5px; } .auth-points .p span { font-size:13px; color:#BFE0E0; display:block; margin-top:2px; }
.auth-deco { position:absolute; border-radius:50%; background:rgba(255,255,255,.06); }
.auth-right { width:460px; flex:0 0 460px; background:var(--surface); display:flex; align-items:center; justify-content:center; padding:48px; }
.auth-card { width:100%; max-width:360px; }
.auth-card .ac-t { font-size:22px; font-weight:800; }
.auth-card .ac-s { color:var(--ink-2); margin-top:6px; margin-bottom:26px; font-size:13.5px; }
.role-pick { display:flex; flex-direction:column; gap:12px; margin-bottom:22px; }
.role-opt { border:1.5px solid var(--line); border-radius:12px; padding:14px 16px; display:flex; gap:12px; align-items:center; transition:all .15s; }
.role-opt:hover { border-color:var(--brand-100); background:var(--brand-50); }
.role-opt.sel { border-color:var(--brand); background:var(--brand-50); }
.role-opt .ri { width:40px; height:40px; border-radius:10px; background:var(--brand-50); color:var(--brand); display:grid; place-items:center; flex:0 0 40px; }
.role-opt.sel .ri { background:var(--brand); color:#fff; }
.role-opt b { font-size:14.5px; } .role-opt span { font-size:12.5px; color:var(--ink-2); display:block; margin-top:2px; }
.user-pick { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:22px; }

/* 移动端底部标签栏 */
.tabbar { display:none; }

/* =====================================================================
   响应式：移动端
   ===================================================================== */
@media (max-width: 880px) {
  .sidebar { display:none; }
  .topbar { padding:0 16px; }
  .topbar-search { display:none; }
  .content { padding: 16px; }
  .grid.cols-4 { grid-template-columns: repeat(2,1fr); }
  .grid.cols-3 { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .auth { flex-direction:column; }
  .auth-left { padding:40px 24px; min-height:auto; }
  .auth-left .lead, .auth-points { display:none; }
  .auth-right { width:100%; flex:none; padding:32px 20px; }
  .auth-left h1 { font-size:24px; }

  .tabbar {
    display:flex; position:fixed; bottom:0; left:0; right:0; z-index:40;
    background:var(--surface); border-top:1px solid var(--line);
    padding:6px 4px calc(6px + env(safe-area-inset-bottom));
    justify-content:space-around;
  }
  .tabbar a { display:flex; flex-direction:column; align-items:center; gap:3px; font-size:10.5px; color:var(--ink-3); padding:4px 8px; position:relative; flex:1; }
  .tabbar a.active { color:var(--brand); }
  .tabbar a svg { width:22px; height:22px; }
  .tabbar .nav-badge { position:absolute; top:0; right:18px; width:16px; height:16px; font-size:10px; }
  .main { padding-bottom: 64px; }
  .hide-mobile { display:none !important; }
  .card-pad, .card-head { padding-left:14px; padding-right:14px; }
  .table-scroll { overflow-x:auto; }
}
@media (max-width: 380px) {
  .grid.cols-4 { grid-template-columns: 1fr; }
  .user-pick { grid-template-columns:1fr; }
}

/* 桌面隐藏移动元素 */
@media (min-width: 881px) {
  .hide-desktop { display:none !important; }
}
