/* 经营健康度系统 · 全局样式（2026-08-27 多页系统版）
 * 设计语言：老经营看板深蓝系（#1e3a5f→#2c5282）+ slate 中性色 + 供应链总灯条概念
 * 结构：桌面=左侧深色导航树；手机=顶栏+底部tab。报表页=页头+数据状态条+KPI卡行+页内tab+大表格
 * 可视化纪律：条形单系列蓝；红/绿/黄仅状态色且配文字；数字 tabular-nums */

:root {
  --navy-1: #1e3a5f; --navy-2: #2c5282; --navy-dark: #16283f;
  --bg: #f1f5f9; --card: #ffffff; --line: #e2e8f0;
  --text: #1e293b; --sub: #64748b; --muted: #94a3b8;
  --blue: #3182ce; --blue-deep: #2c5282;
  --green: #059669; --amber: #d97706; --red: #dc2626;
  --gold: #eab308; --bronze: #b45309;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
.num { font-variant-numeric: tabular-nums; }

/* ================= 登录页 ================= */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--navy-dark) 0%, var(--navy-1) 55%, var(--navy-2) 100%);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 380px; background: #fff; border-radius: 14px;
  padding: 32px 28px 26px; box-shadow: 0 12px 40px rgba(0,0,0,.3);
}
.login-logo {
  width: 52px; height: 52px; border-radius: 12px; margin-bottom: 14px;
  background: linear-gradient(135deg, var(--navy-1), var(--navy-2));
  color: #fff; font-size: 26px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.login-card h1 { font-size: 19px; }
.login-card .sub { font-size: 12px; color: var(--muted); margin: 4px 0 22px; }
.login-field { margin-bottom: 14px; }
.login-field label { display: block; font-size: 12px; font-weight: 600; color: var(--sub); margin-bottom: 6px; }
.login-field input {
  width: 100%; padding: 11px 12px; border: 1px solid #cbd5e1; border-radius: 8px;
  font-size: 15px; font-family: inherit; outline: none; transition: border .15s, box-shadow .15s;
}
.login-field input:focus { border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(44,82,130,.12); }
.login-btn {
  width: 100%; padding: 12px; border: none; border-radius: 8px; cursor: pointer;
  background: linear-gradient(135deg, var(--navy-1), var(--navy-2));
  color: #fff; font-size: 15px; font-weight: 700; letter-spacing: 4px; margin-top: 6px;
}
.login-btn:active { opacity: .9; }
.login-err { color: var(--red); font-size: 12px; min-height: 18px; margin-top: 8px; text-align: center; }

/* ================= 桌面布局：侧边导航 + 主区 ================= */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: 216px; z-index: 60;
  background: linear-gradient(180deg, var(--navy-dark) 0%, var(--navy-1) 100%);
  color: rgba(255,255,255,.82); display: flex; flex-direction: column;
}
.sb-brand { padding: 18px 16px 14px; border-bottom: 1px solid rgba(255,255,255,.10); }
.sb-brand .t { font-size: 16px; font-weight: 700; color: #fff; }
.sb-brand .s { font-size: 11px; color: rgba(255,255,255,.5); margin-top: 2px; }
.sb-nav { flex: 1; overflow-y: auto; padding: 8px 0; }
.sb-group { font-size: 11px; color: rgba(255,255,255,.42); padding: 14px 16px 5px; letter-spacing: 1px; }
.sb-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 16px; font-size: 13.5px;
  color: rgba(255,255,255,.82); border-left: 3px solid transparent;
}
.sb-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.sb-item.on { background: rgba(255,255,255,.12); color: #fff; border-left-color: #63b3ed; font-weight: 600; }
.sb-item .ico { width: 17px; text-align: center; font-size: 14px; }
.sb-foot { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.10); font-size: 12px; color: rgba(255,255,255,.55); }
.sb-foot a { color: rgba(255,255,255,.75); margin-left: 8px; }

.main { margin-left: 216px; padding: 0 20px 60px; min-height: 100vh; }

/* 页头：报表名 + 数据日期 + 操作 */
.page-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px 0 12px;
}
.page-head h2 { font-size: 19px; }
.page-head .ph-sub { font-size: 12px; color: var(--muted); }
.page-head .ph-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.btn-ghost {
  border: 1px solid var(--line); background: #fff; color: var(--sub); border-radius: 7px;
  padding: 6px 12px; font-size: 12px; cursor: pointer; font-family: inherit;
}
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }

/* 数据状态条（照参考系统：绿=准确，红=降级） */
.databanner {
  border-radius: 8px; padding: 9px 14px; font-size: 12.5px; margin-bottom: 14px; line-height: 1.6;
}
.databanner.ok { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.databanner.warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.databanner.bad { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* 总灯条（驾驶舱首屏第一眼） */
.master {
  border-radius: 10px; padding: 13px 16px; font-size: 15px; font-weight: 700;
  box-shadow: var(--shadow); border-left: 6px solid transparent; line-height: 1.5; margin-bottom: 14px;
}
.master small { display: block; font-size: 12px; font-weight: 400; margin-top: 3px; }
.master.good { background: #ecfdf5; border-left-color: var(--green); color: #065f46; }
.master.good small { color: #059669; }
.master.warn { background: #fffbeb; border-left-color: var(--amber); color: #92400e; }
.master.bad  { background: #fef2f2; border-left-color: var(--red); color: #991b1b; }
.master.bad small { color: #b91c1c; }

/* ================= KPI 卡行 ================= */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }

/* 筛选联动加载反馈（2026-09-03 主人"选了筛选数字不变"事件：其实是即选即查但加载中无感知）——重查期间内容变淡+转圈光标，让"正在算"看得见 */
.tiles, .card { transition: opacity .15s; }
body.fb-loading .tiles, body.fb-loading .card { opacity: .4; }
body.fb-loading { cursor: progress; }
.tile {
  background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
  border: 1px solid var(--line); border-left: 4px solid var(--blue);
  border-radius: 10px; padding: 13px 14px; box-shadow: var(--shadow);
}
.tile.green { border-left-color: var(--green); }
.tile.amber { border-left-color: var(--amber); }
.tile.red   { border-left-color: var(--red); }
.t-label { font-size: 11px; color: var(--sub); font-weight: 600; }
.t-value { font-size: 24px; font-weight: 700; margin-top: 5px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.t-unit { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 3px; }
.tile.red .t-value { color: var(--red); }
.t-sub { font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.t-chip { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.t-chip.up   { background: #ecfdf5; color: var(--green); }
.t-chip.down { background: #fef2f2; color: var(--red); }

/* ================= 卡片 / 节标题 / 页内tab ================= */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); padding: 15px 15px 12px; margin-bottom: 14px;
}
.section-title {
  font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.section-title::before {
  content: ''; width: 4px; height: 17px; border-radius: 2px;
  background: linear-gradient(180deg, var(--navy-2) 0%, var(--navy-1) 100%);
}
.section-title.danger::before { background: linear-gradient(180deg, #ef4444, #b91c1c); }
.section-title.warn::before { background: linear-gradient(180deg, #f59e0b, #b45309); }
.tag-amber { color: var(--amber); font-weight: 700; }
.section-title .title-note { margin-left: auto; font-size: 11px; font-weight: 400; color: var(--muted); }

/* ================= 本周必做（首页行动清单，二期 2026-09-05） ================= */
.mustdo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 720px) { .mustdo-grid { grid-template-columns: 1fr; } }
.mustdo-col { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fafbfc; }
.mustdo-head { font-size: 13px; font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; }
.mustdo-more { margin-left: auto; font-size: 11px; font-weight: 400; }
.mustdo-list { list-style: none; margin: 0; padding: 0; }
.mustdo-list li { padding: 7px 0; border-top: 1px dashed var(--line); font-size: 12.5px; line-height: 1.5; }
.mustdo-list li:first-child { border-top: none; }
.mustdo-list .md-title { font-weight: 600; display: flex; gap: 6px; align-items: baseline; }
.mustdo-list .md-amt { margin-left: auto; color: var(--red); font-weight: 700; white-space: nowrap; }
.mustdo-list .md-meta { color: var(--sub); font-size: 11.5px; margin-top: 2px; }
.mustdo-list .md-action { color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.mustdo-list .md-empty { color: var(--muted); font-size: 12px; padding: 6px 0; }
.mustdo-tag { display: inline-block; padding: 0 5px; border-radius: 4px; font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.mustdo-tag.red { background: #fef2f2; color: var(--red); }
.mustdo-tag.amber { background: #fffbeb; color: var(--amber); }
.mustdo-tag.gold { background: #fefce8; color: var(--bronze); }

/* 机会挖掘·引导条（09-07 方案A去重：替代被撤的沉睡唤醒段） */
.opp-guide {
  background: #fffbeb; border: 1px solid var(--line); border-left: 4px solid var(--amber);
  border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-size: 12.5px; color: #92400e;
}

.subtabs { display: flex; gap: 2px; border-bottom: 2px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.subtab {
  padding: 9px 16px; font-size: 13.5px; color: var(--sub); cursor: pointer; white-space: nowrap;
  border-bottom: 3px solid transparent; margin-bottom: -2px; font-weight: 500;
  background: none; border-top: none; border-left: none; border-right: none; font-family: inherit;
}
.subtab:hover { color: var(--text); }
.subtab.on { color: var(--navy-2); border-bottom-color: var(--navy-2); font-weight: 700; }
.subtab .badge {
  display: inline-block; min-width: 17px; padding: 0 5px; border-radius: 999px; margin-left: 5px;
  font-size: 10.5px; font-weight: 700; background: var(--red); color: #fff; text-align: center;
}
/* CSS display 会覆盖 hidden 属性的 display:none——显式补刀（task-6 评审 P2-1：ar.html #lock-badge
   锁单客户=0 时渲染空红 pill；通用修复覆盖全站 badge，drill/fu 面板同款教训） */
.subtab .badge[hidden] { display: none; }

/* 目标过程·下钻引导（2026-10-10 主人反馈"点不动"）：排名/品牌行可点 + 切矩阵后定位高亮 */
.clickable { cursor: pointer; }
.rank-row.clickable:hover, .bp-row.clickable:hover { background: #f0f7ff; }
.mx-hint { padding: 8px 10px; margin-bottom: 8px; background: #f0f7ff; border-left: 3px solid var(--navy-2); border-radius: 4px; font-size: 12px; color: #475569; }
.mx-wrap th.hl-col { background: #fff7e6; }
.mx-wrap td.mx-cell.hl-col { background: #fffbe6; box-shadow: inset 2px 0 0 #faad14, inset -2px 0 0 #faad14; }
.mx-wrap tr.hl-row td.mx-sm { background: #e6f4ff; font-weight: 700; }

/* ================= 大表格 ================= */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th {
  background: #f8fafc; color: var(--sub); font-size: 12px; font-weight: 600;
  padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap;
  position: sticky; top: 0; z-index: 3;
}
/* 预算填报表：状态/操作列吸右常驻——窄屏(≤1440px)表格横向溢出时，保存按钮钉在右边缘不掉出可视区
   （2026-10-06 修复：同事1366屏找不到保存按钮，填的数全没入库）
   关键三点：①必须实心底色挡住左侧滑过来的列 ②z-index 高于普通td、低于表头 ③斑马纹/hover同步底色 */
table.grid td.bf-pin {
  position: sticky; right: 0; z-index: 2; white-space: normal;
  background: #fff; box-shadow: -1px 0 0 var(--line); min-width: 150px;
}
table.grid thead th.bf-pin {
  position: sticky; top: 0; right: 0; z-index: 4;
  background: #f8fafc; box-shadow: -1px 0 0 var(--line); min-width: 150px;
}
table.grid tr:nth-child(even) td.bf-pin { background: #fafbfd; }
table.grid tr:hover td.bf-pin { background: #f0f6fc; }
.bf-pinstat { display: flex; align-items: center; gap: 8px; }
.bf-pinnote {
  font-size: 11px; color: var(--muted); margin-top: 2px;
  max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bf-ro { color: var(--muted); font-size: 12px; }
table.grid td { padding: 8px 10px; border-bottom: 1px solid #f1f5f9; white-space: nowrap; }
table.grid tr:nth-child(even) td { background: #fafbfd; }
table.grid tr:hover td { background: #f0f6fc; }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid tfoot td { background: #f8fafc; font-weight: 700; border-top: 2px solid var(--line); border-bottom: none; }
table.grid td .cell-sub { font-size: 11px; color: var(--muted); }
.tag-red { color: var(--red); font-weight: 700; }
.tag-green { color: var(--green); font-weight: 600; }

/* 状态标（报表就绪度） */
.st { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.st-live { background: #ecfdf5; color: var(--green); }
.st-wait { background: #fffbeb; color: var(--amber); }
.st-src  { background: #eff6ff; color: var(--blue-deep); }

/* ================= 排行 / 趋势（沿用） ================= */
/* :not(tr) —— 2026-10-20：target.html 业务员排名的 <tr class="rank-row"> 撞名，flex 把表格行打碎
   （表头铺满全宽、数据行挤左，主人截图抓包）；此规则本意是 shell.js 的 div 卡片流排行 */
.rank-row:not(tr) { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 9px 2px; cursor: pointer; }
.rank-row:active { background: #f8fafc; }
.rank-row + .rank-row:not(tr) { border-top: 1px solid var(--line); }
.rank-no {
  flex: 0 0 20px; height: 20px; border-radius: 6px; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; background: #f1f5f9; color: var(--sub);
}
.rank-no.m1 { background: rgba(234,179,8,.16); color: var(--gold); }
.rank-no.m2 { background: rgba(148,163,184,.18); color: #64748b; }
.rank-no.m3 { background: rgba(180,83,9,.14); color: var(--bronze); }
.rank-name { flex: 0 0 108px; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-track { flex: 1; height: 10px; background: #eef2f7; border-radius: 999px; overflow: hidden; min-width: 40px; }
.rank-bar { height: 100%; border-radius: 999px; min-width: 3px; background: linear-gradient(90deg, var(--blue), var(--blue-deep)); }
.rank-value { flex: 0 0 78px; text-align: right; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rank-value .rv-unit { font-size: 11px; color: var(--muted); font-weight: 400; }
.rank-sub { flex: 0 0 100%; padding-left: 28px; font-size: 11px; color: var(--muted); line-height: 1.5; }

.trend { display: flex; align-items: flex-end; gap: 3px; height: 110px; padding: 6px 2px 0; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.trend-bar { width: 68%; min-height: 3px; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, #63b3ed, var(--blue-deep)); }
.trend-col.top .trend-bar { background: linear-gradient(180deg, var(--navy-2), var(--navy-1)); }
.trend-label { font-size: 9px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* 模块入口卡（驾驶舱） */
.entries { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-bottom: 14px; }
.entry {
  display: block; background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px; box-shadow: var(--shadow); color: var(--text); transition: all .15s;
}
.entry:hover { border-color: var(--blue); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(15,23,42,.10); }
.entry .e-ico { font-size: 22px; }
.entry .e-t { font-size: 15px; font-weight: 700; margin: 6px 0 3px; }
.entry .e-s { font-size: 12px; color: var(--muted); line-height: 1.5; }

.back-btn {
  margin-left: auto; border: 1px solid var(--line); background: #f8fafc; color: var(--blue-deep);
  border-radius: 7px; padding: 3px 11px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.note-card {
  margin-bottom: 14px; padding: 11px 13px; border-radius: 10px; font-size: 12px; line-height: 1.6;
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
}
.empty { padding: 26px 0; text-align: center; color: var(--muted); font-size: 13px; }

/* ================= 手机适配 ================= */
.mobile-topbar, .tabbar { display: none; }
@media (max-width: 899px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 0 14px calc(70px + env(safe-area-inset-bottom)); }
  .mobile-topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    position: sticky; top: 0; z-index: 50; margin: 0 -14px 12px; padding: 13px 16px;
    background: linear-gradient(135deg, var(--navy-1), var(--navy-2)); color: #fff;
  }
  .mobile-topbar .mt-t { font-size: 16px; font-weight: 700; }
  .mobile-topbar .mt-u { font-size: 11px; color: rgba(255,255,255,.7); }
  .tabbar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    display: flex; background: rgba(255,255,255,.97); border-top: 1px solid var(--line);
    box-shadow: 0 -2px 10px rgba(15,23,42,.06); padding-bottom: env(safe-area-inset-bottom);
  }
  .tab-btn {
    flex: 1; padding: 8px 0 7px; border: none; background: transparent; cursor: pointer;
    font-size: 10.5px; color: var(--sub); display: flex; flex-direction: column; align-items: center; gap: 2px;
    position: relative; font-family: inherit;
  }
  .tab-ico { font-size: 17px; line-height: 1; filter: grayscale(.6); opacity: .75; }
  .tab-btn.on { color: var(--navy-2); font-weight: 700; }
  .tab-btn.on .tab-ico { filter: none; opacity: 1; }
  .tab-btn.on::before {
    content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: var(--navy-2);
  }
}

/* ================= 筛选栏（1b 活报表地基） ================= */
.filterbar {
  background: var(--card); border-radius: 10px; box-shadow: var(--shadow);
  padding: 10px 14px 8px; margin-bottom: 14px;
}
.fb-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fb-quick { display: flex; gap: 4px; flex-wrap: wrap; }
.fb-q {
  border: 1px solid var(--line); background: #fff; color: var(--sub);
  border-radius: 999px; padding: 5px 12px; font-size: 12px; cursor: pointer; font-family: inherit;
}
.fb-q.on { background: var(--navy-2); border-color: var(--navy-2); color: #fff; font-weight: 600; }
.fb-dates { display: flex; align-items: center; gap: 4px; }
.fb-date {
  border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px;
  font-size: 12px; font-family: inherit; color: var(--text); background: #fff;
}
.fb-tilde { color: var(--muted); }
.fb-sel {
  border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px;
  font-size: 12px; font-family: inherit; color: var(--text); background: #fff; max-width: 180px;
}
.fb-cust { position: relative; }
.fb-cust-drop {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 80; min-width: 300px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(15,23,42,.14);
  max-height: 300px; overflow: auto;
}
.fb-cust-item { padding: 8px 12px; font-size: 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
.fb-cust-item:hover { background: #f0f6ff; }
.fb-cust-sm { color: var(--muted); flex-shrink: 0; }
.fb-clear {
  border: none; background: none; color: var(--muted); font-size: 12px; cursor: pointer; font-family: inherit;
}
.fb-clear:hover { color: var(--red); }
.fb-active { margin-top: 8px; font-size: 12px; color: var(--sub); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.fb-chip {
  background: #eef4fb; border: 1px solid #d4e2f2; color: var(--blue-deep);
  border-radius: 999px; padding: 2px 10px; font-weight: 600;
}
@media (max-width: 860px) {
  .fb-sel { max-width: 140px; }
  .fb-cust-drop { min-width: 240px; }
}

/* ===== 预算达成卡 + 周度节奏（老看板全量迁移 2026-09-01） ===== */
.bd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 10px; }
.bdc { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--card); box-shadow: var(--shadow); }
.bdc .bdc-label { font-size: 12px; color: var(--sub); display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.bdc .bdc-value { font-size: 20px; font-weight: 700; margin: 4px 0 2px; }
.bdc .bdc-value .u { font-size: 12px; font-weight: 400; color: var(--sub); margin-left: 2px; }
.bdc .bdc-meta { font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; }
.bdc .bdc-meta .rate { font-weight: 700; }
.bdc .bar { height: 5px; border-radius: 3px; background: #eef2f7; margin-top: 6px; overflow: hidden; }
.bdc .bar > i { display: block; height: 100%; border-radius: 3px; }
.lamp { display: inline-block; min-width: 18px; text-align: center; padding: 0 5px; border-radius: 999px; font-size: 11px; font-weight: 700; color: #fff; }
.lamp.green { background: var(--green); } .lamp.yellow { background: var(--amber); } .lamp.red { background: var(--red); }
.lamp.none { background: #cbd5e1; color: #fff; }
.rate.green { color: var(--green); } .rate.yellow { color: var(--amber); } .rate.red { color: var(--red); } .rate.none { color: var(--muted); }
.bar > i.green { background: var(--green); } .bar > i.yellow { background: var(--amber); } .bar > i.red { background: var(--red); } .bar > i.none { background: #cbd5e1; }
.attr-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--sub); }
.attr-row b { color: var(--text); }
.tier-tag { display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.tier-A { background: #fef2f2; color: var(--red); } .tier-B { background: #fffbeb; color: var(--amber); } .tier-C { background: #f1f5f9; color: var(--sub); }
.pri-tag { display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.pri-P0 { background: var(--red); color: #fff; } .pri-P1 { background: var(--amber); color: #fff; }
.pri-P2 { background: #fef3c7; color: #92400e; } .pri-P3 { background: #ecfdf5; color: var(--green); } .pri-P4 { background: #f1f5f9; color: var(--sub); }

/* ================= 首页图表舱（2026-09-03 定稿：浅色专业风+V5设计魂） =================
 * 色彩语义：涨红 #c0392b / 跌绿 #27ae60（中国习惯）/ 金强调 #d4a017 / 藏青主色 #1e3a5f */
:root {
  --up-red: #c0392b; --down-green: #27ae60; --gold-accent: #d4a017;
}

/* 第一层 · 一句话结论（3秒结论区，V5 DNA：结论先行大字置顶） */
.hero {
  background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
  border: 1px solid var(--line); border-left: 5px solid var(--gold-accent);
  border-radius: 10px; box-shadow: var(--shadow);
  padding: 14px 18px; margin-bottom: 14px;
}
.hero .hero-line { font-size: 17px; font-weight: 700; line-height: 1.7; color: var(--text); }
.hero .hero-line b.up { color: var(--up-red); }
.hero .hero-line b.down { color: var(--down-green); }
.hero .hero-sub { font-size: 11.5px; color: var(--muted); margin-top: 6px; }

/* KPI 卡同比/环比 chip（涨红跌绿，与图表语义统一；既有 up/down 绿红留给"好坏语义"场景） */
.t-chip.cup   { background: #fdf0ee; color: var(--up-red); }
.t-chip.cdown { background: #edf7f0; color: var(--down-green); }
.t-chip + .t-chip { margin-left: 5px; }
/* P0a 同环比分级（2026-09-07）：|Δ|<5%灰持平 / 5~15%浅 / 15~30%中 / >30%深（涨绿跌红）；新=本期新增 */
.t-chip.flat  { background: #f1f5f9; color: var(--muted); }
.t-chip.up.high   { background: #d1fae5; }
.t-chip.up.deep   { background: var(--green); color: #fff; }
.t-chip.down.high { background: #fee2e2; }
.t-chip.down.deep { background: var(--red); color: #fff; }
.t-chip.new   { background: #eff6ff; color: #2563eb; }

/* 图表卡 */
.chart-card { padding-bottom: 8px; }
.chart-box { width: 100%; }
.chart-foot { font-size: 11px; color: var(--muted); text-align: center; margin-top: 2px; line-height: 1.5; }
.chart-lg { height: 340px; }
.chart-md { height: 300px; }
.chart-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chart-grid-2 > .card { margin-bottom: 0; }
.chart-grid-2 { margin-bottom: 14px; }

/* 主图 13月/26月 切换 */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg-btn {
  border: none; background: #fff; color: var(--sub); font-size: 11.5px;
  padding: 3px 12px; cursor: pointer; font-family: inherit;
}
.seg-btn.on { background: var(--navy-2); color: #fff; font-weight: 600; }

/* 单客单品分析（2026-10-21）：诊断四象限 chip + 点行展开的掉品清单 */
.diag-chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.diag-red    { background: #fef2f2; color: var(--red); }
.diag-yellow { background: #fffbeb; color: #b45309; }
.diag-orange { background: #fff7ed; color: #c2410c; }
.diag-green  { background: #ecfdf5; color: var(--green); }
.diag-new    { background: #eff6ff; color: #2563eb; }
.diag-idle   { background: #f1f5f9; color: var(--muted); }
.cs-row { cursor: pointer; }
.cs-row:hover { background: #f8fafc; }
.cs-detail-row > td { background: #f8fafc; padding: 10px 12px; }
.cs-detail-hd { font-size: 12px; color: var(--sub); margin-bottom: 8px; line-height: 1.7; }
.cs-detail-table { background: #fff; }
.cs-detail-table th, .cs-detail-table td { font-size: 12px; }
/* 掉品品名列：最多显示4个，允许换行，悬停 title 看全部 */
.cs-drop-names { display: inline-block; max-width: 340px; text-align: left; line-height: 1.5; word-break: break-all; }

@media (max-width: 899px) {
  .hero .hero-line { font-size: 15px; }
  .chart-grid-2 { grid-template-columns: 1fr; gap: 0; }
  .chart-grid-2 > .card { margin-bottom: 14px; }
  .chart-lg { height: 260px; }
  .chart-md { height: 240px; }
}
