/* ==========================================================================
   云拓销售云 · 视觉系统
   方向：运单纸感 —— 冷的纸、细的线、绿色只做信号
   所有间距落在 4px 网格；字号只有 11/12/13/15/19/24/30 七级
   ========================================================================== */

:root {
  /* 中性：偏冷石墨，像报关单上的墨 */
  --ink: #15191B;
  --ink-2: #3C4448;
  --ink-3: #6B7378;
  --ink-4: #98A0A4;

  --line: #E2E5E4;
  --line-soft: #EDEFEE;
  --bg: #F3F4F3;
  --surface: #FFFFFF;
  --surface-2: #FAFBFA;

  /* 品牌绿：只做信号色 */
  --brand: #007A5C;
  --brand-ink: #005B45;
  --brand-wash: #E9F3EF;

  --amber: #8A570C;
  --amber-wash: #FAF1E2;
  --red: #A3342A;
  --red-wash: #FAEDEB;

  --r-card: 10px;
  --r-ctl: 8px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* 旧变量名保留，避免散落在视图内联样式里的引用失效 */
  --brand-dark: var(--brand-ink);
  --brand-light: var(--brand-wash);
  --brand-mid: #1F9C7B;
  --line-2: var(--line-soft);
  --white: #fff;
  --amber-bg: var(--amber-wash);
  --red-bg: var(--red-wash);
  --blue: #2C5C86;
  --blue-bg: #EEF3F7;
  --radius: var(--r-card);
  --shadow-sm: none;
  --shadow: 0 1px 2px rgba(21, 25, 27, .05);
  --shadow-lg: 0 12px 32px rgba(21, 25, 27, .14);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  line-height: 1.62;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-ink); text-decoration: none; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
small { font-size: 11.5px; }
.hidden { display: none !important; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* 数字与单号 */
.mono, .num-t { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ============================== 登录 ============================== */
.login { display: grid; grid-template-columns: 1.02fr .98fr; min-height: 100vh; }

.login-left {
  position: relative;
  background: #0E1917;
  color: #F2F3F1;
  padding: 48px 56px 40px;
  display: flex; flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.login-left .brandline {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 500; color: #F2F3F1;
}
.login-left .mark {
  width: 30px; height: 30px; border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, .22);
  display: grid; place-items: center; color: #6FD3B4;
}
.login-left h1 {
  font-size: 34px; line-height: 1.34; margin: 0 0 16px;
  font-weight: 500; letter-spacing: -.6px; color: #F7F8F6;
}
.login-left h1 span { color: #6FD3B4; }
.login-left .sub {
  font-size: 13.5px; color: rgba(242, 243, 241, .62);
  max-width: 420px; line-height: 1.85; margin: 0;
}

/* 签名：一条线路 —— 增城西 → 霍尔果斯 → 马拉 */
.route { margin-top: 40px; }
.route svg { display: block; width: 100%; max-width: 460px; height: auto; }
.route .rail-line { stroke: rgba(242, 243, 241, .22); stroke-width: 1; }
.route .rail-run { stroke: #6FD3B4; stroke-width: 2; }
.route .stn { fill: #6FD3B4; }
.route .stn-hollow { fill: #0E1917; stroke: #6FD3B4; stroke-width: 1.5; }
.route .cap { stroke: rgba(242, 243, 241, .3); stroke-width: 1; }
.route text {
  font-family: inherit; font-size: 10.5px; fill: rgba(242, 243, 241, .5);
}
.route text.name { font-size: 11.5px; fill: rgba(242, 243, 241, .86); }

.login-left .foot {
  font-size: 11.5px; color: rgba(242, 243, 241, .38);
  border-top: 1px solid rgba(242, 243, 241, .12);
  padding-top: 14px;
}

.login-right {
  background: var(--surface);
  display: grid; place-items: center; padding: 40px;
  border-left: 1px solid var(--line);
}
.login-card { width: 100%; max-width: 356px; }
.login-card h2 { font-size: 19px; font-weight: 500; margin: 0 0 6px; letter-spacing: -.2px; }
.login-card > p { color: var(--ink-3); margin: 0 0 24px; font-size: 12.5px; }

.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 11.5px; color: var(--ink-3);
  margin-bottom: 6px; font-weight: 400;
}
.field input, .field select, .field textarea {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--r-ctl);
  background: var(--surface); outline: none;
  transition: border-color .14s;
}
.field textarea { height: auto; padding: 10px 12px; line-height: 1.6; }
.field input::placeholder { color: var(--ink-4); }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--brand); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border-radius: var(--r-ctl); border: 1px solid var(--brand);
  background: var(--brand); color: #fff;
  font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: background-color .14s, border-color .14s, color .14s;
}
.btn:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
.btn:active { transform: translateY(.5px); }
.btn.block { width: 100%; height: 40px; }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); border-color: #CDD2D1; color: var(--ink); }
.btn.soft { background: var(--brand-wash); border-color: transparent; color: var(--brand-ink); }
.btn.soft:hover { background: #DEEDE7; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn.xs { height: 24px; padding: 0 8px; font-size: 12px; border-radius: 6px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { flex: 0 0 auto; }
/* 图标只有一个尺寸：正文/按钮 14，导航 16 */
.btn svg { width: 14px; height: 14px; }
.nav a svg { width: 16px; height: 16px; }
.card-h svg { width: 14px; height: 14px; }

.demo-accounts { margin-top: 24px; border-top: 1px solid var(--line-soft); padding-top: 16px; }
.demo-accounts h4 {
  font-size: 11.5px; color: var(--ink-4); font-weight: 400;
  margin: 0 0 10px; letter-spacing: 0;
}
.demo-accounts .row { display: flex; gap: 6px; flex-wrap: wrap; }
.demo-accounts button {
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 6px; height: 26px; padding: 0 9px;
  font-size: 11.5px; color: var(--ink-2);
  transition: border-color .14s, color .14s;
}
.demo-accounts button:hover { border-color: var(--brand); color: var(--brand-ink); }
.login-err { color: var(--red); font-size: 12px; margin-top: 10px; min-height: 18px; }

/* ---- 首次登录改密 ----
   深色左栏讲「为什么要改」，右侧表单实时给反馈：
   规则一条条亮起来比事后弹一个红字友好得多。 */
.login-left .pwd-points {
  margin: 30px 0 0; padding: 0; list-style: none;
  display: flex; flex-direction: column; gap: 15px; max-width: 380px;
}
.login-left .pwd-points li {
  padding-left: 14px; border-left: 1px solid rgba(111, 211, 180, .38);
}
.login-left .pwd-points b {
  display: block; font-size: 13px; font-weight: 500;
  color: #EAF3EF; letter-spacing: .1px;
}
.login-left .pwd-points span {
  display: block; margin-top: 3px; font-size: 12px;
  color: rgba(242, 243, 241, .5); line-height: 1.65;
}

.pwd-rules {
  margin: 2px 0 16px; padding: 10px 12px; list-style: none;
  display: grid; grid-template-columns: 1fr 1fr; gap: 7px 10px;
  background: var(--surface-2); border: 1px solid var(--line-soft);
  border-radius: 8px;
}
.pwd-rules li {
  position: relative; padding-left: 15px;
  font-size: 11.5px; color: var(--ink-4);
  transition: color .15s;
}
.pwd-rules li::before {
  content: ""; position: absolute; left: 1px; top: 6px;
  width: 6px; height: 6px; border-radius: 50%;
  border: 1px solid var(--ink-4);
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.pwd-rules li.ok { color: var(--brand-ink); }
.pwd-rules li.ok::before {
  background: var(--brand); border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-wash, #E7F2EE);
}

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

.sidebar {
  width: 248px; flex: 0 0 248px;
  background: var(--surface); border-right: 1px solid var(--line);
  position: fixed; top: 0; left: 0; bottom: 0;
  display: flex; flex-direction: column; z-index: 40;
}
.sidebar .brand { padding: 20px 18px 18px; display: flex; align-items: center; gap: 10px; }
.sidebar .brand .mark {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--brand); color: #fff;
  display: grid; place-items: center; flex: 0 0 auto;
}
.sidebar .brand b { font-size: 13.5px; font-weight: 500; display: block; line-height: 1.3; letter-spacing: .1px; }
.sidebar .brand small {
  font-size: 10.5px; color: var(--ink-4);
  letter-spacing: .8px; font-family: var(--mono);
}

.nav { flex: 1; overflow-y: auto; padding: 0 12px 12px; }
.nav .group {
  font-size: 11px; color: var(--ink-4); font-weight: 400;
  letter-spacing: 0; padding: 22px 8px 6px;
}
.nav .group:first-child { padding-top: 4px; }
.nav a {
  position: relative;
  display: flex; align-items: center; gap: 9px;
  height: 34px; padding: 0 8px; margin-bottom: 2px;
  border-radius: 6px;
  color: var(--ink-2); font-size: 13px;
  transition: background-color .12s, color .12s;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a svg { flex: 0 0 auto; color: var(--ink-4); }
.nav a:hover svg { color: var(--ink-3); }
.nav a.active { background: var(--brand-wash); color: var(--brand-ink); font-weight: 500; }
.nav a.active::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px;
  background: var(--brand); border-radius: 2px;
}
.nav a.active svg { color: var(--brand); }
.nav a .badge {
  margin-left: auto; background: var(--red); color: #fff;
  font-size: 10px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 4px; font-weight: 500; display: grid; place-items: center;
  font-family: var(--mono);
}

.sidebar .me {
  border-top: 1px solid var(--line-soft);
  padding: 12px 14px; display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--ink-2); display: grid; place-items: center;
  font-size: 11.5px; font-weight: 500; flex: 0 0 auto;
}
.sidebar .me .info { flex: 1; min-width: 0; }
.sidebar .me .info b { display: block; font-size: 12.5px; font-weight: 500; line-height: 1.35; }
.sidebar .me .info small { color: var(--ink-4); font-size: 11px; }
.icon-btn {
  border: none; background: transparent; color: var(--ink-4);
  width: 28px; height: 28px; border-radius: 6px;
  display: grid; place-items: center;
  transition: background-color .12s, color .12s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink-2); }

.main { margin-left: 248px; flex: 1; min-width: 0; padding-bottom: 80px; }

.topbar {
  height: 56px; border-bottom: 1px solid var(--line);
  background: var(--bg); position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px; padding: 0 28px;
}
.topbar h1 { font-size: 14px; margin: 0; font-weight: 500; letter-spacing: 0; }
.topbar .crumb { color: var(--ink-4); font-size: 12px; }
.topbar .spacer { flex: 1; }
.topbar .status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--ink-4);
  font-variant-numeric: normal;
}
.topbar .status i {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--brand); display: block;
}
.topbar .status.off i { background: var(--ink-4); }

/* 通用胶囊：默认安静，只有语义色带浅底 */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 21px; padding: 0 7px;
  border-radius: 5px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink-3);
  font-size: 11.5px; font-weight: 400; white-space: nowrap;
}
.chip.green { background: var(--brand-wash); border-color: transparent; color: var(--brand-ink); }
.chip.amber { background: var(--amber-wash); border-color: transparent; color: var(--amber); }
.chip.red { background: var(--red-wash); border-color: transparent; color: var(--red); }
.chip.blue { background: var(--blue-bg); border-color: transparent; color: var(--blue); }
.chip.gray { background: var(--surface-2); border-color: transparent; color: var(--ink-4); }
.dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }

/* 行内状态：点 + 文字，不加底色 */
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.st i { width: 5px; height: 5px; border-radius: 50%; background: var(--ink-4); flex: 0 0 auto; }
.st.ok i { background: var(--brand); }
.st.warn i { background: var(--amber); }
.st.bad i { background: var(--red); }
.st.quiet { color: var(--ink-4); }

/* 分级：等宽字母，细框 */
.lv {
  display: inline-grid; place-items: center;
  width: 20px; height: 20px; border-radius: 5px;
  border: 1px solid var(--line); color: var(--ink-2);
  font-family: var(--mono); font-size: 11px; line-height: 1;
}
.lv.a { border-color: #B9D8CB; color: var(--brand-ink); background: var(--brand-wash); }
.lv.d { color: var(--ink-4); }

/* ============================== 页面 / 卡片 ============================== */
.page { padding: 24px 28px 8px; max-width: 1560px; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.page-head h2 { font-size: 19px; font-weight: 500; margin: 0 0 4px; letter-spacing: -.2px; }
.page-head p { margin: 0; color: var(--ink-3); font-size: 12.5px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}
.card.pad { padding: 20px; }
.card-h {
  padding: 14px 18px; border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 10px; min-height: 46px;
}
.card-h h3 { margin: 0; font-size: 13px; font-weight: 500; letter-spacing: 0; }
.card-h .more {
  margin-left: auto; font-size: 11.5px; color: var(--ink-4);
  display: inline-flex; align-items: center; gap: 4px;
}
a.more:hover { color: var(--brand-ink); }
.card-b { padding: 16px 18px; }

.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* 数据条：一张纸被细线分成格子，不用四张卡 */
.stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px; background: var(--line-soft);
  border: 1px solid var(--line); border-radius: var(--r-card);
  overflow: hidden;
}
.stats.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stats .kpi, .stat {
  background: var(--surface); border: none; border-radius: 0;
  padding: 16px 18px 18px; box-shadow: none; min-width: 0;
}
.stat .label, .stats .kpi .label {
  font-size: 11.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px;
}
.stat .val, .stats .kpi .val {
  font-size: 24px; font-weight: 500; letter-spacing: -.5px;
  margin-top: 8px; line-height: 1.15; font-variant-numeric: tabular-nums;
}
.stat .val small, .stats .kpi .val small {
  font-size: 12px; font-weight: 400; color: var(--ink-4);
  margin-left: 4px; letter-spacing: 0;
}
.stat .foot, .stats .kpi .foot {
  font-size: 11.5px; color: var(--ink-4); margin-top: 6px;
  display: flex; align-items: center; gap: 6px;
}
.stats .kpi.brand { background: var(--surface); }
.stat .foot .up { color: var(--brand-ink); }
.stat .foot .down { color: var(--red); }

/* 普通 KPI 卡（团队 / 学习等页仍在用） */
.kpi {
  padding: 16px 18px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-card);
}
.kpi .label { font-size: 11.5px; color: var(--ink-3); }
.kpi .val { font-size: 24px; font-weight: 500; letter-spacing: -.5px; margin-top: 8px; line-height: 1.15; }
.kpi .val small { font-size: 12px; font-weight: 400; color: var(--ink-4); margin-left: 3px; }
.kpi .foot { font-size: 11.5px; color: var(--ink-4); margin-top: 6px; }
.kpi.amber .val { color: var(--amber); }
.kpi.green .val { color: var(--brand-ink); }
/* 通过的考核用绿色数字，靠颜色而不是深色底卡 */
.kpi.brand .val { color: var(--brand-ink); }

/* ============ 签名细节：铁路区间条 ============
   任何表示进度 / 份额 / 健康度的条，都是「一条线 + 两端竖帽」 */
.rail, .hb {
  position: relative; display: block;
  height: 9px; min-width: 48px; width: 100%;
}
.rail::before, .hb::before {
  content: ""; position: absolute; left: 0; right: 0; top: 4px;
  height: 1px; background: var(--line);
}
.rail > i, .hb > i {
  position: absolute; left: 0; top: 4px; height: 2px;
  background: currentColor; border-radius: 1px;
  transition: width .3s ease;
}
.rail > i::after, .hb > i::after {
  content: ""; position: absolute; right: -1px; top: -3px;
  width: 0; height: 8px; border-right: 2px solid currentColor;
}
.hb { width: 56px; }
.bar { height: 9px; position: relative; }
.bar::before { content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 1px; background: var(--line); }
.bar > i {
  position: absolute; left: 0; top: 4px; height: 2px;
  background: var(--brand); color: var(--brand); display: block;
  transition: width .3s ease;
}
.bar > i::after {
  content: ""; position: absolute; right: -1px; top: -3px;
  width: 0; height: 8px; border-right: 2px solid currentColor;
}

/* ============================== 表格 ============================== */
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th {
  text-align: left; padding: 9px 14px;
  color: var(--ink-4); font-weight: 400; font-size: 11.5px;
  background: transparent; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.t td {
  padding: 11px 14px; border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
table.t tr:last-child td { border-bottom: none; }
table.t tbody tr { transition: background-color .1s; }
table.t tbody tr:hover { background: var(--surface-2); }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.t tr[data-row] { cursor: pointer; }
/* 表格里的操作按钮不该有边框，一屏三十个按钮会把表格压垮 */
table.t .btn.ghost { border-color: transparent; color: var(--ink-3); }
table.t .btn.ghost:hover { border-color: var(--line); color: var(--ink); background: var(--surface); }

.name-cell { display: flex; align-items: center; gap: 10px; }
.name-cell b { font-weight: 500; font-size: 13px; display: block; line-height: 1.4; }
.name-cell small { color: var(--ink-4); font-size: 11.5px; display: block; line-height: 1.4; }

.score-pill {
  display: inline-grid; place-items: center; min-width: 30px; height: 21px;
  padding: 0 6px; border-radius: 5px;
  font-family: var(--mono); font-weight: 500; font-size: 11.5px;
  border: 1px solid var(--line); color: var(--ink-2);
}
.score-hi { border-color: #B9D8CB; color: var(--brand-ink); background: var(--brand-wash); }
.score-mid { border-color: #E3D2B4; color: var(--amber); background: var(--amber-wash); }
.score-lo { border-color: var(--line); color: var(--ink-4); background: var(--surface-2); }

/* ============================== 表单 / 工具条 ============================== */
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.sel {
  height: 30px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 7px;
  background: var(--surface); color: var(--ink-2);
  font-size: 12.5px; outline: none;
  transition: border-color .14s;
}
.sel:hover { border-color: #CDD2D1; }
.sel:focus { border-color: var(--brand); }
.sel:disabled { background: var(--surface-2); color: var(--ink-4); }

.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.search { position: relative; display: flex; align-items: center; }
.search input {
  height: 30px; padding: 0 10px 0 29px; width: 232px;
  border: 1px solid var(--line); border-radius: 7px;
  background: var(--surface); outline: none; font-size: 12.5px;
  transition: border-color .14s;
}
.search input:focus { border-color: var(--brand); }
.search input::placeholder { color: var(--ink-4); }
.search svg { position: absolute; left: 9px; color: var(--ink-4); pointer-events: none; }

.seg {
  display: inline-flex; background: var(--surface);
  border: 1px solid var(--line); padding: 2px; border-radius: 8px; gap: 2px;
}
.seg button {
  border: none; background: transparent; height: 24px; padding: 0 10px;
  border-radius: 6px; font-size: 12.5px; color: var(--ink-3);
  transition: background-color .12s, color .12s;
}
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--brand-wash); color: var(--brand-ink); font-weight: 500; }

.rin {
  width: 108px; height: 30px; padding: 0 9px;
  border: 1px solid var(--line); border-radius: 7px; outline: none;
  text-align: right; background: var(--surface);
  font-size: 12.5px; font-variant-numeric: tabular-nums;
  transition: border-color .14s;
}
.rin:focus { border-color: var(--brand); }
.rin:disabled { background: var(--surface-2); color: var(--ink-4); border-style: dashed; }

/* ============================== 弹层 ============================== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(18, 22, 21, .38);
  display: grid; place-items: center; z-index: 90; padding: 24px;
}
.modal {
  background: var(--surface); border-radius: 12px;
  width: 100%; max-width: 560px; box-shadow: var(--shadow-lg);
  max-height: 88vh; display: flex; flex-direction: column;
  animation: pop .16s ease-out;
}
.modal.wide { max-width: 880px; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.modal-h { padding: 16px 20px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; }
.modal-h h3 { margin: 0; font-size: 15px; font-weight: 500; }
.modal-h .icon-btn { margin-left: auto; }
.modal-b { padding: 18px 20px; overflow-y: auto; }
.modal-f { padding: 12px 20px; border-top: 1px solid var(--line-soft); display: flex; gap: 8px; justify-content: flex-end; }

/* ============================== 客户详情 ============================== */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); gap: 12px; align-items: start; }

.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 3px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.tl { position: relative; padding-bottom: 18px; }
.tl::before {
  content: ""; position: absolute; left: -18px; top: 6px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--surface); border: 1.5px solid var(--ink-4);
}
.tl:first-child::before { border-color: var(--brand); background: var(--brand); }
.tl .meta { font-size: 11.5px; color: var(--ink-4); display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.tl .body { font-size: 13px; color: var(--ink-2); line-height: 1.7; }
.tl .ai-box {
  margin-top: 8px; background: var(--surface-2);
  border: 1px solid var(--line-soft); border-left: 2px solid var(--brand);
  border-radius: 0 6px 6px 0; padding: 9px 12px;
  font-size: 12px; color: var(--ink-2); line-height: 1.7;
}
.tl .ai-box b { color: var(--brand-ink); font-weight: 500; }

.kv { font-size: 12.5px; }
.kv dt, .kv span { color: var(--ink-4); }
.kv dd { margin: 0; color: var(--ink-2); }
dl.kv { display: grid; grid-template-columns: 76px 1fr; gap: 8px 12px; }

/* AI 评分块：整页唯一的深色「盖章」，不用渐变 */
.ai-panel {
  background: #151B19; color: #F2F3F1;
  border-radius: var(--r-card); padding: 16px 18px;
}
.ai-panel .tag { font-size: 11px; color: rgba(242, 243, 241, .5); letter-spacing: 0; }
.ai-panel .big {
  font-size: 30px; font-weight: 500; letter-spacing: -1px;
  line-height: 1.15; margin: 4px 0 2px; color: #fff;
  font-variant-numeric: tabular-nums;
}
.ai-panel .big small { font-size: 12px; font-weight: 400; color: rgba(242, 243, 241, .55); }
.ai-panel p { font-size: 12px; color: rgba(242, 243, 241, .68); margin: 8px 0 0; line-height: 1.75; }

/* 单客户盘面里的 12 格 */
.kv-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 20px; margin: 18px 0; }
.kv-grid .kv span { display: block; font-size: 11.5px; margin-bottom: 3px; }
.kv-grid .kv b { font-weight: 500; font-size: 13px; color: var(--ink); }

.advice { background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 8px; padding: 12px 14px; }
.advice b { font-size: 11.5px; color: var(--brand-ink); font-weight: 500; }
.advice p { margin: 5px 0 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.8; }

/* ============================== 课程 / 课时 ============================== */
.course-card { overflow: hidden; display: flex; flex-direction: column; }
.course-card .cover {
  height: 72px; display: flex; align-items: center; padding: 0 16px; gap: 12px;
  background: var(--surface-2); border-bottom: 1px solid var(--line-soft);
}
/* 课程/播客封面用字标代替 emoji：一个细分隔框里放品类首字 */
.mk, .pcast-mk {
  width: 30px; height: 30px; flex: 0 0 auto;
  border: 1px solid var(--line); border-radius: 7px;
  background: var(--surface); color: var(--ink-3);
  display: grid; place-items: center;
  font-size: 12.5px; line-height: 1;
}
.pcast-mk { width: 40px; height: 40px; border-radius: 9px; color: var(--ink-3); }
.course-card .cover .lv { margin-left: auto; }
.course-card .body { padding: 14px 16px 16px; flex: 1; display: flex; flex-direction: column; }
.course-card h4 { margin: 0 0 6px; font-size: 13.5px; font-weight: 500; line-height: 1.45; }
.course-card p { margin: 0 0 12px; font-size: 12px; color: var(--ink-3); flex: 1; line-height: 1.7; }
.course-card .meta { display: flex; gap: 10px; font-size: 11px; color: var(--ink-4); margin-bottom: 10px; }

.lesson-list { display: flex; flex-direction: column; }
.lesson-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft); cursor: pointer;
  transition: background-color .1s;
}
.lesson-item:last-child { border-bottom: none; }
.lesson-item:hover { background: var(--surface-2); }
.lesson-item.on { background: var(--brand-wash); }
.lesson-item .idx {
  width: 20px; height: 20px; border-radius: 5px;
  border: 1px solid var(--line); color: var(--ink-4);
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 10.5px; flex: 0 0 auto;
}
.lesson-item.on .idx, .lesson-item.done .idx { background: var(--brand); border-color: var(--brand); color: #fff; }
.lesson-item .tt { flex: 1; font-size: 13px; }
.lesson-item .mm { font-size: 11px; color: var(--ink-4); font-family: var(--mono); }

/* ============================== Markdown 正文 ============================== */
.md { font-size: 13.5px; color: var(--ink-2); line-height: 1.85; }
.md h2 {
  font-size: 16px; font-weight: 500; color: var(--ink);
  margin: 28px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft);
}
.md h3 { font-size: 14px; font-weight: 500; color: var(--ink); margin: 22px 0 8px; }
.md h2:first-child, .md h3:first-child { margin-top: 0; }
.md p { margin: 9px 0; }
.md ul, .md ol { margin: 9px 0; padding-left: 20px; }
.md li { margin: 4px 0; }
.md strong { color: var(--ink); font-weight: 500; }
.md blockquote {
  margin: 12px 0; padding: 10px 14px;
  background: var(--brand-wash); border-left: 2px solid var(--brand);
  border-radius: 0 6px 6px 0; color: var(--ink-2);
}
.md table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 12.5px; }
.md th {
  background: var(--surface-2); text-align: left; padding: 8px 11px;
  border: 1px solid var(--line); font-weight: 500; color: var(--ink);
}
.md td { padding: 8px 11px; border: 1px solid var(--line-soft); }
.md code {
  background: var(--surface-2); border: 1px solid var(--line-soft);
  padding: 0 4px; border-radius: 4px; font-size: 12px; font-family: var(--mono);
}
.md .quote { color: var(--brand-ink); }
.md hr { border: none; border-top: 1px solid var(--line-soft); margin: 20px 0; }

/* ============================== 对话 ============================== */
.chat-wrap { display: flex; flex-direction: column; height: calc(100vh - 56px - 40px); min-height: 460px; }
.chat-body { flex: 1; overflow-y: auto; padding: 18px 2px; display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 10px; max-width: 84%; }
.msg .av {
  width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center;
  flex: 0 0 auto; font-size: 10.5px; font-weight: 500;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-3);
}
.msg.ai .av { background: var(--brand-wash); border-color: transparent; color: var(--brand-ink); }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg.me .av { background: var(--surface-2); color: var(--ink-3); }
.bubble {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 9px; padding: 11px 14px;
  font-size: 13px; line-height: 1.8; white-space: pre-wrap; word-break: break-word;
}
.msg.me .bubble { background: var(--brand); border-color: var(--brand); color: #fff; }
.bubble .srcs {
  margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line-soft);
  font-size: 11px; color: var(--ink-4); display: flex; gap: 6px; flex-wrap: wrap;
}
.bubble .srcs span { background: var(--surface-2); padding: 2px 6px; border-radius: 4px; }
.chat-input { border-top: 1px solid var(--line); padding: 12px 0 4px; display: flex; gap: 10px; align-items: flex-end; }
.chat-input textarea {
  flex: 1; resize: none; border: 1px solid var(--line); border-radius: 9px;
  padding: 10px 12px; outline: none; max-height: 140px; min-height: 42px;
  line-height: 1.6; background: var(--surface); font-size: 13px;
  transition: border-color .14s;
}
.chat-input textarea:focus { border-color: var(--brand); }
.typing { display: inline-flex; gap: 4px; align-items: center; height: 18px; }
.typing i { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-4); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .2; } 30% { opacity: 1; } }

.score-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin: 4px 0; }
.score-card .head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.score-card .total { font-size: 30px; font-weight: 500; letter-spacing: -1px; line-height: 1; }
.score-card .dims { display: flex; flex-direction: column; gap: 9px; }
.score-card .dim { display: grid; grid-template-columns: 88px 1fr 40px; align-items: center; gap: 10px; font-size: 12px; }

/* ============================== 考试 / 刷题 ============================== */
.q-card { padding: 20px; }
.q-stem { font-size: 14px; line-height: 1.75; margin-bottom: 16px; color: var(--ink); }
.q-stem .no { color: var(--ink-4); font-family: var(--mono); font-weight: 400; margin-right: 8px; }
.opt {
  display: flex; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  margin-bottom: 8px; cursor: pointer; background: var(--surface); align-items: flex-start;
  transition: border-color .12s, background-color .12s;
}
.opt:hover { border-color: #CDD2D1; background: var(--surface-2); }
.opt.sel { border-color: var(--brand); background: var(--brand-wash); }
.opt .k {
  width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 10.5px; font-family: var(--mono);
  color: var(--ink-4); flex: 0 0 auto; margin-top: 2px;
}
.opt.sel .k { border-color: var(--brand); background: var(--brand); color: #fff; }
.opt.right { border-color: var(--brand); background: var(--brand-wash); }
.opt.right .k { border-color: var(--brand); background: var(--brand); color: #fff; }
.opt.wrong { border-color: var(--red); background: var(--red-wash); }
.opt.wrong .k { border-color: var(--red); background: var(--red); color: #fff; }
.opt .tx { font-size: 13px; line-height: 1.65; }
.explain {
  margin-top: 14px; background: var(--surface-2);
  border: 1px solid var(--line-soft); border-left: 2px solid var(--brand);
  border-radius: 0 6px 6px 0; padding: 11px 14px;
  font-size: 12.5px; color: var(--ink-2); line-height: 1.8;
}
.explain b { color: var(--brand-ink); font-weight: 500; }

.exam-nav { display: flex; flex-wrap: wrap; gap: 5px; }
.exam-nav button {
  width: 28px; height: 28px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 11.5px; color: var(--ink-4); font-family: var(--mono);
  transition: border-color .12s, color .12s;
}
.exam-nav button.done { background: var(--brand-wash); border-color: transparent; color: var(--brand-ink); }
.exam-nav button.cur { border-color: var(--ink); color: var(--ink); }
.timer { font-family: var(--mono); font-weight: 500; font-size: 15px; color: var(--ink); }

/* ============================== 播客播放器 ============================== */
.player {
  position: fixed; left: 248px; right: 0; bottom: 0;
  background: var(--surface); border-top: 1px solid var(--line);
  z-index: 50; padding: 10px 24px;
  display: flex; align-items: center; gap: 14px;
}
.player .info { flex: 0 0 224px; min-width: 0; }
.player .info b { display: block; font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .info small { color: var(--ink-4); font-size: 11px; font-family: var(--mono); }
.player .line { flex: 1; font-size: 12px; color: var(--ink-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .line b { color: var(--ink-2); font-weight: 500; }
.play-btn {
  width: 32px; height: 32px; border-radius: 8px; border: none;
  background: var(--brand); color: #fff; display: grid; place-items: center; flex: 0 0 auto;
  transition: background-color .12s;
}
.play-btn:hover { background: var(--brand-ink); }
.player .pbar { flex: 1; height: 12px; cursor: pointer; position: relative; }
.player .pbar::before { content: ""; position: absolute; left: 0; right: 0; top: 5px; height: 1px; background: var(--line); }
.player .pbar i { position: absolute; left: 0; top: 4px; height: 2px; background: var(--brand); }
.player .pbar i::after {
  content: ""; position: absolute; right: -1px; top: -3px;
  width: 0; height: 8px; border-right: 2px solid var(--brand);
}
.player .rate {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font-size: 11.5px; font-family: var(--mono);
  height: 26px; padding: 0 8px; border-radius: 6px;
}
.player .rate:hover { border-color: var(--brand); color: var(--brand-ink); }

/* ============================== Toast ============================== */
.toast {
  position: fixed; left: 50%; bottom: 88px;
  transform: translateX(-50%) translateY(8px);
  background: var(--ink); color: #fff;
  padding: 9px 16px; border-radius: 8px; font-size: 12.5px;
  opacity: 0; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================== 其他 ============================== */
.empty {
  text-align: center; padding: 28px 20px;
  color: var(--ink-4); font-size: 12.5px; line-height: 1.8;
}
.empty b { display: block; color: var(--ink-3); font-size: 13px; font-weight: 400; margin-bottom: 4px; }

.list-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px;
}
.list-row:last-child { border-bottom: none; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .grow b { display: block; font-weight: 500; font-size: 13px; line-height: 1.45; }
.list-row .grow small { color: var(--ink-4); font-size: 11.5px; line-height: 1.5; }
.clickable { cursor: pointer; }
.list-row.clickable:hover { background: var(--surface-2); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button {
  border: none; background: transparent; padding: 9px 13px;
  font-size: 13px; color: var(--ink-3);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button.on { color: var(--ink); border-bottom-color: var(--brand); font-weight: 500; }

.legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--ink-4); flex-wrap: wrap; }
.legend i { display: inline-block; width: 6px; height: 6px; border-radius: 1px; margin-right: 5px; }
.hint { font-size: 11.5px; color: var(--ink-4); line-height: 1.75; }
.section-title { font-size: 11.5px; font-weight: 400; color: var(--ink-4); margin: 0 0 10px; letter-spacing: 0; }
.divider { height: 1px; background: var(--line-soft); margin: 12px 0; }
.loading { padding: 56px; text-align: center; color: var(--ink-4); font-size: 12.5px; }
.riskrow { display: flex; gap: 6px; flex-wrap: wrap; }
tr.dim { opacity: .5; }
.tag-move {
  font-size: 11.5px; font-weight: 400; color: var(--amber);
  background: var(--amber-wash); padding: 3px 8px; border-radius: 5px; white-space: nowrap;
}
.tag-move.up { color: var(--brand-ink); background: var(--brand-wash); }

/* 横向条形：标签 / 条 / 个数 / 货量四列，数字右对齐，永不溢出 */
.bars { display: flex; flex-direction: column; gap: 11px; }
.brow {
  display: grid; grid-template-columns: 68px minmax(0, 1fr) 34px 84px;
  align-items: center; gap: 12px; font-size: 12.5px;
}
.brow .bk { color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brow .bn {
  text-align: right; color: var(--ink-2); font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.brow .bv {
  text-align: right; color: var(--ink-4); font-size: 11.5px;
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.funnel-bar { display: flex; flex-direction: column; gap: 10px; }
.funnel-row {
  display: grid; grid-template-columns: 68px minmax(0, 1fr) 44px;
  align-items: center; gap: 12px; font-size: 12.5px;
}
.funnel-row .b { height: 2px; background: var(--brand); opacity: .8; position: relative; }
.funnel-row .b::after {
  content: ""; position: absolute; right: 0; top: -3px;
  width: 0; height: 8px; border-right: 2px solid var(--brand);
}

/* ============================================================
   业务扩展页：客户决策 / AI 策略 / 账号管理 / 规则设置
   ============================================================ */
.focus-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 20px;
  padding-bottom: 16px; border-bottom: 1px solid var(--line-soft);
}
.focus-head h4 { margin: 0 0 4px; font-size: 15px; font-weight: 500; letter-spacing: -.1px; }
.health-big { text-align: right; flex: 0 0 132px; }
.health-big .hb { width: 100%; height: 9px; margin-bottom: 6px; }
.health-big span { font-size: 11.5px; color: var(--ink-4); }
.health-big span b { color: var(--ink); font-weight: 500; font-family: var(--mono); font-size: 12.5px; }

/* 结论：像批示，不像卡片 */
.conc {
  font-size: 12.5px; color: var(--ink-2); line-height: 1.85;
  padding: 0 0 0 12px; border-left: 1px solid var(--line);
  margin-bottom: 14px;
}
.conc:last-child { margin-bottom: 0; }
.conc.lead { border-left: 2px solid var(--brand); color: var(--ink); }
.conc p { margin: 0; }
.conc strong { font-weight: 500; color: var(--ink); }

/* 客户列表筛选标签 */
.tagbar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.tchip {
  border: 1px solid transparent; background: transparent;
  color: var(--ink-3); height: 24px; padding: 0 8px;
  border-radius: 5px; font-size: 12px;
  transition: background-color .12s, color .12s;
}
.tchip:hover { background: var(--surface); color: var(--ink-2); }
.tchip.on { background: var(--brand-wash); color: var(--brand-ink); font-weight: 500; }
.sumline { font-size: 11.5px; color: var(--ink-4); margin-bottom: 10px; }
.sumline b { color: var(--ink-2); font-weight: 500; font-variant-numeric: tabular-nums; }

/* AI 策略 */
.strat-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 12px; align-items: start; }
.strat-grid .search input { width: 100%; }
.pick-list { max-height: 340px; overflow: auto; }
.pick {
  display: flex; gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: 7px; cursor: pointer;
  border: 1px solid transparent;
  transition: background-color .12s;
}
.pick:hover { background: var(--surface-2); }
.pick.on { background: var(--brand-wash); }
.pick .grow b { font-size: 12.5px; font-weight: 500; display: block; line-height: 1.45; }
.pick .grow small { font-size: 11px; color: var(--ink-4); }
.q-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qcard {
  text-align: left; border: 1px solid var(--line); background: var(--surface);
  border-radius: 8px; padding: 10px 12px;
  transition: border-color .14s, background-color .14s;
}
.qcard b { display: block; font-size: 12.5px; font-weight: 500; line-height: 1.5; color: var(--ink); }
.qcard small { display: block; font-size: 11px; color: var(--ink-4); margin-top: 3px; line-height: 1.55; }
.qcard:hover { border-color: #CDD2D1; background: var(--surface-2); }
.qcard.on { border-color: var(--brand); background: var(--brand-wash); }
.result-card { border-color: var(--line); }
.res-sec { padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.res-sec:first-child { padding-top: 0; }
.res-sec:last-of-type { border-bottom: none; padding-bottom: 0; }
.res-sec h4 {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; margin: 0 0 9px;
  color: var(--ink-4); font-weight: 400; letter-spacing: 0;
}
.res-sec .md { font-size: 12.5px; }
.action-list { display: flex; flex-direction: column; gap: 1px; }
.act { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.act:last-child { border-bottom: none; }
.act .idx {
  width: 17px; height: 17px; border-radius: 4px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-3);
  font-size: 10px; display: grid; place-items: center;
  flex: 0 0 auto; font-family: var(--mono); margin-top: 2px;
}
.act .grow b { font-size: 12.5px; font-weight: 400; display: block; line-height: 1.65; }
.act .grow small { font-size: 11px; color: var(--ink-4); font-family: var(--mono); }

/* 账号管理 */
.perm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.perm-card { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.perm-card b { font-size: 12.5px; font-weight: 500; display: block; }
.perm-card small { font-size: 11px; color: var(--ink-4); line-height: 1.6; display: block; margin-top: 2px; }
.perm-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.menu-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 10px; margin-top: 4px; }
.mchk { font-size: 12px; display: flex; align-items: center; gap: 6px; color: var(--ink-2); }

/* 规则设置 */
/* 规则卡片：两列流式（masonry 效果），短卡片不会被长卡片拉出空洞 */
.rule-grid { columns: 2; column-gap: 12px; }
.rule-grid > .card { break-inside: avoid; margin: 0 0 12px; }
.rule-row {
  display: flex; gap: 14px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--line-soft);
}
.rule-row:last-child, .rule-row:last-of-type { border-bottom: none; }
.rule-row .grow b { font-size: 12.5px; font-weight: 400; display: block; line-height: 1.55; }
.rule-row .grow small { font-size: 10.5px; color: var(--ink-4); font-family: var(--mono); letter-spacing: -.2px; }

/* ============================== 响应式 ============================== */
@media (max-width: 1320px) {
  .stats.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .g4, .g6, .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .layout-2, .detail-grid { grid-template-columns: 1fr; }
  .strat-grid, .perm-grid { grid-template-columns: 1fr; }
  .rule-grid { columns: 1; }
  .kv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .q-grid, .menu-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .player { left: 0; }
  .login { grid-template-columns: 1fr; }
  .login-left { display: none; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .page { padding: 18px 16px 8px; }
  .topbar { padding: 0 16px; }
}

/* 商机看板：泳道浅底，卡片浮在上面 */
.lane {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  min-height: 200px;
  overflow: hidden;
}
.lane .card-h { border-bottom: 1px solid var(--line-soft); }
.lane .card { border-color: var(--line); }

/* ============================== 资料上传 ============================== */
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger:hover { background: #8E2C23; border-color: #8E2C23; }

.up-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; align-items: stretch; }
@media (max-width: 1180px) { .up-grid { grid-template-columns: 1fr; } }

/* 虚线像运单上的撕口，拖进来时整块变绿 —— 只给一个信号 */
.drop {
  border: 1.5px dashed #C9CFCE; border-radius: var(--r-card);
  background: var(--surface-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center; padding: 26px 20px; min-height: 148px;
  cursor: pointer; transition: border-color .14s, background-color .14s;
}
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-wash); }
.drop.pulse { animation: dropPulse .9s ease; }
@keyframes dropPulse { 0%,100% { border-color: #C9CFCE; } 40% { border-color: var(--brand); background: var(--brand-wash); } }
.drop b { font-size: 13px; font-weight: 500; color: var(--ink); }
.drop small { color: var(--ink-4); font-size: 11.5px; max-width: 320px; line-height: 1.6; }

.up-side { display: flex; flex-direction: column; justify-content: center; }
.up-targets { display: flex; gap: 8px; flex-wrap: wrap; }
.tgt {
  display: flex; align-items: flex-start; gap: 8px;
  border: 1px solid var(--line); border-radius: var(--r-ctl);
  padding: 8px 10px; cursor: pointer; min-width: 148px; background: var(--surface);
  transition: border-color .12s, background-color .12s;
}
.tgt:hover { border-color: #CDD2D1; }
.tgt input {
  width: 14px; height: 14px; margin: 3px 0 0;
  accent-color: var(--brand); flex: 0 0 auto;
}
.tgt-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tgt-txt b { font-size: 12.5px; font-weight: 400; color: var(--ink); line-height: 1.35; }
.tgt-txt small { color: var(--ink-4); font-size: 10.5px; line-height: 1.4; }
.tgt:has(input:checked) { border-color: var(--brand); background: var(--brand-wash); }

.filetag {
  width: 34px; height: 26px; flex: 0 0 auto;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 4px;
  background: var(--surface-2); color: var(--ink-3);
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .3px;
}

.chunk-list { max-height: 320px; overflow-y: auto; border-top: 1px solid var(--line-soft); }
.chunk { padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.chunk b { font-size: 12px; font-weight: 500; color: var(--brand-ink); display: block; }
.chunk p { margin: 3px 0 0; font-size: 12px; color: var(--ink-3); line-height: 1.7; }

/* 标签块：可多选，选中态给品牌绿；右侧小号计数沿用等宽数字 */
.tagbar { row-gap: 4px; }
.tagbar-label {
  font-size: 11px; color: var(--ink-4); letter-spacing: .2px;
  margin-right: 2px; padding-right: 6px; border-right: 1px solid var(--line);
  align-self: center; height: 14px; line-height: 14px;
}
.tchip { display: inline-flex; align-items: center; gap: 5px; }
.tchip i {
  font-style: normal; font-family: var(--mono); font-size: 9.5px;
  color: var(--ink-4); background: var(--surface-2);
  border-radius: 3px; padding: 0 3px; min-width: 14px; text-align: center;
}
.tchip.on i { background: rgba(0, 122, 92, .12); color: var(--brand-ink); }
.tchip.clear { color: var(--ink-4); text-decoration: underline; text-underline-offset: 2px; }

/* 新建客户里的平台多选 */
.pick-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pick-chips .tchip { border-color: var(--line); background: var(--surface); height: 28px; padding: 0 10px; }
.pick-chips .tchip:hover { border-color: #CDD2D1; }
.pick-chips .tchip.on { border-color: var(--brand); background: var(--brand-wash); }

/* ============================== 个人看板 ============================== */
/* 五格数据条：一行放得下，不拆成两张图 */
.stats.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stats .kpi .val .up, .stats .kpi .foot .up { color: var(--brand-ink); }
.stats .kpi .foot .down { color: var(--red); }
.stats .kpi .foot b { font-weight: 500; }

/* ---- 四季度同比：一对柱，去年是纸、今年是墨 ---- */
.qchart { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.qcol { display: flex; flex-direction: column; padding: 0 10px; border-left: 1px solid var(--line-soft); min-width: 0; }
.qcol:first-child { border-left: none; padding-left: 0; }
.qcol:last-child { padding-right: 0; }
.qtop { min-height: 42px; padding: 2px 0 8px; }
.qpct { display: block; font-size: 15px; font-weight: 500; letter-spacing: -.2px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.qdelta { display: block; font-size: 10.5px; color: var(--ink-4); font-variant-numeric: tabular-nums; line-height: 1.4; }
.qpct.up { color: var(--brand-ink); }
.qpct.down { color: var(--red); }
.qpct.flat { color: var(--ink-4); font-size: 12.5px; }
.qbars { display: flex; align-items: flex-end; justify-content: center; gap: 7px; height: 148px; border-bottom: 1px solid var(--line); }
.qbar { flex: 1; max-width: 54px; min-height: 2px; }
.qbar.cur { background: var(--brand); }
.qbar.prev { background: var(--surface-2); border: 1px solid var(--line); border-bottom: 0; }
.qfoot { display: flex; align-items: baseline; gap: 6px; padding-top: 9px; min-width: 0; }
.qfoot b { font-family: var(--mono); font-size: 11.5px; font-weight: 500; color: var(--ink-2); }
.qfoot i {
  font-style: normal; font-size: 9.5px; color: var(--ink-4);
  border: 1px solid var(--line); border-radius: 3px; padding: 0 3px; line-height: 1.5;
}
.qfoot small { margin-left: auto; font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.qfoot small span { color: var(--ink-4); }
.qlegend { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding-top: 14px; font-size: 11.5px; color: var(--ink-3); }
.qlegend .sw { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; }
.qlegend .sw.cur { background: var(--brand); }
.qlegend .sw.prev { background: var(--surface-2); border: 1px solid var(--line); }
.qlegend .hint { margin-left: auto; color: var(--ink-4); }

/* ---- 客户发货节奏 ---- */
.board-cust .cv { display: block; font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums; }
.board-cust .cs { display: block; font-size: 10.5px; color: var(--ink-4); line-height: 1.55; font-variant-numeric: tabular-nums; }
.board-cust .pct { display: block; font-weight: 500; font-size: 12.5px; }
.board-cust tfoot td { background: var(--surface-2); border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-2); border-bottom: none; }
.board-cust tbody tr { cursor: pointer; }
.pct.up { color: var(--brand-ink); }
.pct.down { color: var(--red); }
.pct.flat { color: var(--ink-4); }
.spark-th { width: 100px; }
.spark6 { display: flex; align-items: flex-end; gap: 3px; height: 26px; width: 86px; }
.spark6 i { flex: 1; min-height: 2px; background: #DDE2E0; }
.spark6 i.on { background: var(--brand); }
.newdot, .rol {
  font-style: normal; font-size: 9.5px; border-radius: 3px;
  padding: 0 3px; margin-left: 5px; vertical-align: 1px; line-height: 1.6;
}
.newdot { color: var(--brand-ink); background: var(--brand-wash); }
.rol { color: var(--ink-4); border: 1px solid var(--line); }

/* ---- 增量来源 ---- */
.gain-group { display: flex; flex-direction: column; gap: 10px; }
.brow.gain { grid-template-columns: 126px minmax(0, 1fr) 62px; gap: 10px; }
.brow.gain .bk { font-size: 12px; }
.brow.gain .bn { font-size: 12px; text-align: right; }
.brow.gain .bn.up { color: var(--brand-ink); }
.brow.gain .bn.down { color: var(--red); }

/* ---- 销售同比排名 ---- */
.card-h .seg { margin-left: auto; }
.board-rank th.rk, .board-rank td.rk {
  width: 30px; padding-left: 14px; padding-right: 0;
  font-family: var(--mono); font-size: 11px; color: var(--ink-4);
}
.board-rank td.rk { color: var(--ink-3); }
.board-rank tbody tr[data-rep] { cursor: pointer; }
.board-rank tbody tr.me { background: var(--brand-wash); }
.board-rank tbody tr.me:hover { background: var(--brand-wash); }
.board-rank tbody tr.me td:first-child { box-shadow: inset 2px 0 0 var(--brand); }
.board-rank th.on { color: var(--ink-2); background: var(--surface-2); }
.board-rank td .pct { display: block; font-weight: 500; font-size: 12.5px; }
.board-rank .cs { display: block; font-size: 10.5px; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.board-rank tbody tr:first-child td.rk { color: var(--brand-ink); font-weight: 500; }
/* 折叠后接上「我自己」那一行：用虚线断开，别让人以为排名连续 */
.board-rank tbody tr.cut td { border-top: 2px dashed var(--line); }

/* ---- 空数据（新人 / 未出货） ---- */
.empty-board { display: flex; gap: 16px; align-items: flex-start; }
.eb-mark {
  width: 40px; height: 40px; flex: 0 0 auto;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-2); color: var(--ink-4);
}
.empty-board b { font-size: 14px; font-weight: 500; }
.empty-board p { margin: 6px 0 0; color: var(--ink-3); font-size: 12.5px; line-height: 1.8; max-width: 620px; }
.eb-facts { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 12px; font-size: 12px; color: var(--ink-3); }
.eb-facts b { font-weight: 500; color: var(--ink); margin-left: 4px; }

.footnote {
  margin: 16px 0 4px; font-size: 11px; color: var(--ink-3);
  line-height: 1.85; max-width: 1040px;
}

@media (max-width: 1320px) {
  .stats.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .stats.five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qbars { height: 120px; }
  .qlegend .hint { margin-left: 0; flex-basis: 100%; }
}
/* 停发货的客户：这一行退到背景里，不要和正常客户抢注意力 */
.board-cust .name-cell small.muted { color: var(--ink-4); opacity: .75; }

/* 客户表折叠：只铺前 12 行，剩下的收进按钮 */
.cust-more {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-top: 1px solid var(--line-soft);
  background: var(--paper-2, #F6F7F6);
}
.cust-more .btn { flex: none; }

/* ---- 同步状态条：数据从哪来、什么时候同步的、能不能手动按一下 ---- */
.syncbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; padding: 9px 14px; border-radius: 10px;
  background: var(--paper-2, #F6F7F6); border: 1px solid var(--line-soft);
  font-size: 12px; color: var(--ink-3);
}
.syncbar.on { background: color-mix(in srgb, var(--brand) 7%, transparent); border-color: color-mix(in srgb, var(--brand) 26%, transparent); }
.sb-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); flex: none; }
.sb-dot.off { background: var(--ink-4); }
.sb-dot.live { background: var(--amber, #C8871A); animation: sbpulse 1.4s ease-in-out infinite; }
@keyframes sbpulse { 0%,100% { opacity: 1; } 50% { opacity: .28; } }
.sb-main { color: var(--ink-2); }
.sb-side { margin-left: auto; color: var(--ink-4); font-size: 11.5px; }
.sb-rail { flex-basis: 100%; height: 3px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.sb-rail i { display: block; height: 100%; background: var(--brand); transition: width .4s ease; }
.syncbar .btn.sm { flex: none; }
@media (max-width: 900px) { .sb-side { margin-left: 0; flex-basis: 100%; } }

/* ==========================================================================
   消息中心 / 公海池
   ========================================================================== */

/* 侧栏未读小红点：不用 .newdot（那是带文字的徽标，空内容会渲染成一个小方块） */
.nav-dot {
  margin-left: auto; width: 6px; height: 6px; border-radius: 50%;
  background: var(--red); flex: 0 0 auto;
}
.sidebar .nav a { display: flex; align-items: center; gap: 10px; }

/* ---- 消息中心 ---- */
.msg-tabs { margin: 0; padding: 0 6px; }
.msg-tabs button { display: inline-flex; align-items: center; gap: 5px; }
.msg-tabs button i {
  font-style: normal; font-size: 10.5px; color: var(--ink-4);
  background: var(--surface-2); border-radius: 4px; padding: 0 4px; line-height: 1.5;
}
.msg-tabs button.on i { color: var(--brand-ink); background: var(--brand-wash); }

.msglist { display: flex; flex-direction: column; }
.msgitem {
  display: flex; gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  align-items: flex-start;
}
.msgitem:last-child { border-bottom: none; }
.msgitem:hover { background: var(--surface-2); }
.msgitem.is-read { opacity: .62; }
.msgitem-ic {
  width: 28px; height: 28px; border-radius: 7px; flex: 0 0 auto;
  display: grid; place-items: center; margin-top: 1px;
  background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--line-soft);
}
.msgitem-ic.bad { background: var(--red-wash); color: var(--red); border-color: transparent; }
.msgitem-ic.warn { background: var(--amber-wash); color: var(--amber); border-color: transparent; }
.msgitem-main { flex: 1 1 auto; min-width: 0; }
.msgitem-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.msgitem-h b { font-size: 13.5px; font-weight: 500; }
.msgitem-h .newdot { color: var(--red); background: var(--red-wash); }
.msgitem-b { font-size: 12px; color: var(--ink-3); line-height: 1.7; margin-top: 3px; }
.msgitem-side {
  flex: 0 0 auto; text-align: right;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-end;
}
.msgitem-act { display: flex; gap: 6px; }

/* ---- 公海池 ---- */
.banner {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 14px 16px; border-radius: var(--r-card);
  background: var(--amber-wash); border: 1px solid rgba(138, 87, 12, .16);
  margin-bottom: 12px;
}
.banner.on { background: var(--brand-wash); border-color: rgba(0, 122, 92, .16); }
.banner b { font-size: 13px; font-weight: 500; color: var(--ink); }
.banner p { font-size: 12px; color: var(--ink-2); line-height: 1.75; margin: 5px 0 0; max-width: 780px; }

.noticebar {
  padding: 12px 16px; border-radius: var(--r-card); margin-bottom: 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  font-size: 12.5px; color: var(--ink-2); line-height: 1.7;
}

/* 公海 KPI 第一格用深色：它是这页的主语，其余三格是注脚 */
.kpi.dark { background: var(--brand-ink); border-color: transparent; }
.kpi.dark .label { color: rgba(255, 255, 255, .72); }
.kpi.dark .val { color: #fff; }
.kpi.dark .val small { color: rgba(255, 255, 255, .6); }
.kpi.dark .foot { color: rgba(255, 255, 255, .62); }
/* 可点的 KPI：光有 cursor:pointer 用户看不出来，得给悬停反馈和一个「查看」提示 */
.kpi.clickable {
  cursor: pointer; position: relative;
  transition: background .15s, box-shadow .15s;
}
.kpi.clickable::after {
  content: '查看 ›'; position: absolute; right: 14px; top: 13px;
  font-size: 11px; color: var(--ink-4); opacity: 0; transition: opacity .15s;
}
.kpi.clickable:hover { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.kpi.clickable:hover::after { opacity: 1; }
/* 当前正在看的那一格：内描边而不是外阴影，.stats 是 overflow:hidden 的网格 */
.kpi.clickable.is-on { box-shadow: inset 0 0 0 2px var(--brand); }
.kpi.dark.clickable:hover { background: var(--brand); }
.kpi.dark.clickable::after { color: rgba(255, 255, 255, .8); }
.kpi.dark.clickable.is-on { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .9); }

@media (max-width: 860px) {
  .msgitem { flex-wrap: wrap; }
  .msgitem-side { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
  .banner { flex-direction: column; }
}

/* ---- 客户详情：联系人与运单时间线 ---- */
.ctrow {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px solid var(--line-soft);
}
.ctrow:last-child { border-bottom: none; }
.ctrow b { font-size: 13px; font-weight: 500; display: block; line-height: 1.5; }
.ctrow small { display: block; color: var(--ink-4); font-size: 11.5px; margin-top: 1px; line-height: 1.5; }
.ct-phone { margin-top: 4px; font-family: var(--mono); font-size: 12.5px; letter-spacing: .2px; }
.ct-phone a { color: var(--brand-ink); text-decoration: none; }
.ct-phone a:hover { text-decoration: underline; }

/* 运单节点：比人工跟进更「实」，所以正文用正文色，不压成灰 */
.tl.is-ship .body { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tl.is-ship .meta .chip.green { font-weight: 400; }
/* 正文最多两行：消息是「扫一眼就知道要不要处理」，不是阅读材料 */
.msgitem-b {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; text-overflow: ellipsis;
}
.msgitem-ic.quiet { background: var(--surface-2); color: var(--ink-3); }
