/* =====================================================================
   B端推品中台 · 设计系统
   基调：深空蓝侧栏 + 浅雾背景 + 细边卡片，信息密度优先
   ===================================================================== */
:root {
  /* 中性色 */
  --bg: #f4f6fb;
  --bg-2: #eef1f8;
  --card: #ffffff;
  --ink: #101828;
  --ink-2: #475467;
  --ink-3: #8f9bb0;
  --line: #e7ebf3;
  --line-2: #f1f4f9;

  /* 品牌色 */
  --brand: #2f54eb;
  --brand-dark: #1d3fc9;
  --brand-soft: #eef2ff;
  --brand-line: #d6e0ff;

  /* 功能色 */
  --ok: #129b5e;
  --warn: #e08700;
  --danger: #e04a4f;
  --purple: #7a5af8;
  --cyan: #0e9bb5;

  /* 侧栏 */
  --side: #0a1120;
  --side-2: #131e33;
  --side-ink: #c2cddf;
  --side-ink-2: #6b7b95;

  /* 尺寸 */
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 14px 30px -24px rgba(16, 24, 40, .35);
  --shadow-lg: 0 28px 70px -28px rgba(16, 24, 40, .38);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; overflow-x: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 13.5px/1.6 -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; }
::selection { background: rgba(47, 84, 235, .16); }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #cdd5e4; border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #b3bed3; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(47, 84, 235, .18), transparent 62%),
    radial-gradient(760px 460px at 96% 104%, rgba(122, 90, 248, .14), transparent 60%),
    linear-gradient(180deg, #f6f8fd, #eef1f9);
  position: relative;
}
.login-wrap::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(16, 24, 40, .07) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(600px 400px at 50% 40%, #000 30%, transparent 75%);
}
.login-card {
  position: relative; width: 408px; background: #fff; border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 20px; padding: 36px 34px 26px;
  box-shadow: 0 30px 80px -32px rgba(16, 24, 40, .34), 0 1px 0 rgba(255, 255, 255, .8) inset;
}
.login-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 26px; }
.login-brand h1 { font-size: 20px; margin: 0; letter-spacing: -.2px; font-weight: 700; }
.login-brand p { margin: 3px 0 0; color: var(--ink-3); font-size: 12px; letter-spacing: .2px; }
.brand-mark {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  background: linear-gradient(145deg, #4a72ff, #1d3fc9); color: #fff; font-weight: 700; font-size: 21px;
  box-shadow: 0 12px 26px -12px rgba(47, 84, 235, .85), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.brand-mark.sm { width: 34px; height: 34px; font-size: 15px; border-radius: 10px; }
.login-card label { display: block; margin-bottom: 15px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.login-card input { margin-top: 7px; padding: 10px 12px; }
.login-hint { margin: 16px 0 0; font-size: 11.5px; color: var(--ink-3); text-align: center; line-height: 1.7; }
.login-card .btn-block { margin-top: 6px; padding: 11px; font-size: 14px; border-radius: 10px; }
.err { color: var(--danger); font-size: 13px; margin: 0 0 12px; }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; flex: 0 0 236px; color: var(--side-ink);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  background:
    radial-gradient(420px 220px at 0% 0%, rgba(74, 114, 255, .28), transparent 70%),
    linear-gradient(180deg, #0a1120 0%, #0d1627 60%, #0a1120 100%);
  border-right: 1px solid rgba(255, 255, 255, .04);
}
.logo { display: flex; align-items: center; gap: 11px; padding: 20px 18px 18px; }
.logo-text { display: flex; flex-direction: column; line-height: 1.25; }
.logo-text strong { color: #fff; font-size: 15px; letter-spacing: .6px; font-weight: 650; }
.logo-text span { font-size: 9px; letter-spacing: 2.4px; color: #5f7291; margin-top: 2px; }
#nav { flex: 1; padding: 6px 12px 16px; overflow-y: auto; }
#nav::-webkit-scrollbar { width: 6px; }
#nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border: none; }
.nav-group {
  font-size: 10px; color: #55678a; padding: 16px 10px 7px; letter-spacing: 1.6px; font-weight: 600;
  text-transform: uppercase;
}
.nav-item {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 11px;
  border-radius: 9px; color: #b6c2d6; cursor: pointer; font-size: 13px; margin-bottom: 1px;
  transition: background .16s, color .16s; border: none; background: none; width: 100%; text-align: left;
}
.nav-item:hover { background: rgba(255, 255, 255, .055); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(70, 110, 255, .28), rgba(70, 110, 255, .07));
  color: #fff; font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(110, 145, 255, .22);
}
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: linear-gradient(180deg, #7fa2ff, #3f6bff);
}
.nav-ico { width: 18px; height: 18px; display: grid; place-items: center; flex: none; opacity: .92; }
.nav-ico svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.active .nav-ico { color: #9db8ff; opacity: 1; }
.nav-item .ico { width: 16px; text-align: center; opacity: .9; }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .badge-dot { margin-left: auto; background: #ff5a5f; color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 9px; }
.side-foot { padding: 12px 14px 16px; border-top: 1px solid rgba(255, 255, 255, .06); }
.side-user { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.user-avatar {
  width: 32px; height: 32px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: linear-gradient(145deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .06));
  border: 1px solid rgba(255, 255, 255, .12); color: #fff; font-size: 13px; font-weight: 600;
}
.user-meta { min-width: 0; line-height: 1.35; }
.user-meta strong { display: block; color: #fff; font-size: 12.5px; font-weight: 600; }
.user-meta span { display: block; font-size: 11px; color: #8ea0bd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-link { background: none; border: none; color: #8296b5; font-size: 11.5px; cursor: pointer; padding: 0; transition: color .15s; }
.btn-link:hover { color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.topbar {
  min-height: 66px; background: rgba(255, 255, 255, .78); backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line); display: flex; align-items: center;
  justify-content: space-between; gap: 16px; padding: 10px 26px; position: sticky; top: 0; z-index: 20;
}
.crumb { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
.crumb-sub { font-size: 11.5px; color: var(--ink-3); letter-spacing: .3px; white-space: nowrap; }
.crumb-sep { color: #d3dae7; font-size: 12px; }
.page-title { font-size: 17px; font-weight: 650; letter-spacing: -.2px; color: var(--ink); }
.top-actions { display: flex; gap: 10px; align-items: center; flex: none; }
.top-actions select { width: 140px; padding: 7px 10px; font-size: 12.5px; }
.view { padding: 24px 26px 44px; max-width: 1440px; width: 100%; margin: 0 auto; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0;
}
.card-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 15px 20px; border-bottom: 1px solid var(--line-2);
  background: linear-gradient(180deg, #fcfdff, #fff);
  border-radius: var(--radius) var(--radius) 0 0;
}
.card-hd h3 { margin: 0; font-size: 14.5px; font-weight: 650; letter-spacing: -.1px; }
.card-hd .sub { color: var(--ink-3); font-size: 12px; margin-left: 8px; font-weight: 400; }
.card-hd .hd-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-bd { padding: 18px 20px; }
.card-bd.flush { padding: 0; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: #fff; color: #344054; cursor: pointer;
  font-size: 13px; font-weight: 500; transition: background .15s, border-color .15s, box-shadow .15s, transform .06s;
  white-space: nowrap; line-height: 1.5;
}
.btn:hover { border-color: #cfd8ea; background: #f8faff; color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, #4166f5, #2f54eb); border-color: #2c4fdf; color: #fff; font-weight: 600;
  box-shadow: 0 6px 14px -8px rgba(47, 84, 235, .9), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-primary:hover { background: linear-gradient(180deg, #365cf0, #2447d6); border-color: #2447d6; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: #f2f5fb; }
.btn-danger { color: var(--danger); border-color: #f4cdcf; background: #fff; }
.btn-danger:hover { background: #fff5f5; border-color: #eeb4b7; color: #c93a3f; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; justify-content: center; padding: 10px; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn:focus-visible { outline: 2px solid rgba(47, 84, 235, .35); outline-offset: 1px; }

/* ---------- 表单 ---------- */
input, select, textarea {
  width: 100%; padding: 8px 11px; border: 1px solid #e2e7f1; border-radius: var(--radius-sm);
  font: inherit; color: var(--ink); background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s; line-height: 1.5;
}
input::placeholder, textarea::placeholder { color: #b0b9c9; }
input:hover, select:hover, textarea:hover { border-color: #d3dbe9; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3.5px rgba(47, 84, 235, .12); }
select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238f9bb0' stroke-width='2.2' stroke-linecap='round'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--brand); }
textarea { resize: vertical; min-height: 76px; }
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 12px; color: var(--ink-2); font-weight: 600; margin-bottom: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

/* ---------- 标签 ---------- */
.tag {
  display: inline-block; padding: 1.5px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 500;
  background: var(--brand-soft); color: var(--brand-dark); margin: 1px 4px 1px 0; white-space: nowrap;
  border: 1px solid rgba(47, 84, 235, .1);
}
.tag.gray { background: #f4f6fa; color: #5b6779; border-color: #e9edf4; }
.tag.blue { background: #edf3ff; color: #2456d8; border-color: #dbe6ff; }
.tag.green { background: #ebf8f1; color: #0b7a48; border-color: #d2efdf; }
.tag.orange { background: #fff6e8; color: #a85a00; border-color: #ffe6c2; }
.tag.red { background: #ffefef; color: #bf3439; border-color: #ffdcdc; }
.tag.purple { background: #f3efff; color: #5b3de0; border-color: #e5dcff; }

.badge-level { font-weight: 700; font-size: 11px; padding: 1px 7px; border-radius: 5px; }
.lv-A { background: #ffe9e3; color: #c73a17; }
.lv-B { background: #e7f0ff; color: #1a4fd0; }
.lv-C { background: #f0f2f7; color: #6b7488; }
.lv-S { background: #f3e8ff; color: #7b2fd1; }

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.8px; }
.card-bd.flush { overflow-x: auto; }
.card-bd.flush table { width: 100%; }
.tb-nw { min-width: 720px; }
thead th {
  text-align: left; font-weight: 600; color: #667085; font-size: 11.5px; letter-spacing: .2px;
  padding: 10px 16px; background: #fafbfe; border-bottom: 1px solid var(--line); white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
tbody td { padding: 11px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; word-break: keep-all; color: #344054; }
.tb-nw tbody td { white-space: nowrap; }
.tb-nw tbody td[data-wrap] { white-space: normal; overflow-wrap: anywhere; word-break: break-word; min-width: 90px; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #f8faff; }
tbody tr:last-child td { border-bottom: none; }
tbody td .strong { color: var(--ink); }

/* 表头筛选 */
.filt-btn { border: none; background: none; cursor: pointer; font-size: 10px; color: #a3adbf; padding: 0 2px; line-height: 1; }
.filt-btn:hover { color: var(--brand); }
.filt-btn.on { color: var(--brand); font-weight: 700; }
.filt-panel {
  position: fixed; z-index: 1000; width: 300px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 18px 50px -18px rgba(20, 40, 80, .32); overflow: hidden;
}
.filt-hd { padding: 11px 13px; font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--line-2); }
.filt-search { width: calc(100% - 24px); box-sizing: border-box; margin: 10px 12px 0; padding: 6px 10px; font-size: 12.5px; border: 1px solid var(--line); border-radius: 7px; }
.filt-actions { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.filt-actions .filt-count { margin-left: auto; font-size: 12px; }
.filt-list { max-height: 240px; overflow-y: auto; padding: 0 12px; }
.filt-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 12.5px; cursor: pointer; }
.filt-item:hover { color: var(--brand); }
.filt-item input { width: auto; flex: none; margin: 0; }
.filt-item .filt-val { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.filt-item .filt-num { flex: none; color: #9aa5b8; font-size: 11.5px; }
.filt-ft { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line-2); background: #fbfcff; }
.filt-ft .spacer { flex: 1; }

/* ---------- 文本工具 ---------- */
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.muted { color: var(--ink-3); font-size: 12px; }
.strong { font-weight: 600; }
.right { text-align: right; }
.center { text-align: center; }
.empty {
  padding: 48px 20px; text-align: center; color: #98a2b3; font-size: 12.5px;
  background: radial-gradient(300px 120px at 50% 0%, #f8faff, transparent 70%);
}

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi {
  --k-accent: var(--brand);
  position: relative; background-color: #fff; background-image:
    radial-gradient(160px 90px at 100% -10%, rgba(47, 84, 235, .10), transparent 72%);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 17px 18px 15px;
  box-shadow: var(--shadow); overflow: hidden; transition: transform .18s, box-shadow .18s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 22px 40px -28px rgba(16,24,40,.45); }
.kpi::before { content: ""; position: absolute; left: 18px; top: 0; width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: var(--k-accent); opacity: .9; }
.kpi .k-label { font-size: 12px; color: var(--ink-3); letter-spacing: .2px; }
.kpi .k-value {
  font-size: 25px; font-weight: 700; letter-spacing: -.6px; margin-top: 6px; color: var(--ink);
  font-variant-numeric: tabular-nums; line-height: 1.25;
}
.kpi .k-foot { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; }
.kpi .k-value small { font-size: 12px; font-weight: 500; color: var(--ink-3); margin-left: 3px; }
.kpi.g { --k-accent: var(--ok); background-image: radial-gradient(160px 90px at 100% -10%, rgba(18, 155, 94, .12), transparent 72%); }
.kpi.o { --k-accent: var(--warn); background-image: radial-gradient(160px 90px at 100% -10%, rgba(224, 135, 0, .14), transparent 72%); }
.kpi.p { --k-accent: var(--purple); background-image: radial-gradient(160px 90px at 100% -10%, rgba(122, 90, 248, .13), transparent 72%); }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .search { max-width: 260px; }
.toolbar .spacer { flex: 1; }

/* ---------- 图表 ---------- */
.funnel { display: flex; flex-direction: column; gap: 9px; }
.funnel-row { display: flex; align-items: center; gap: 12px; margin-bottom: 0; }
.funnel-label { width: 76px; flex: 0 0 76px; font-size: 12px; color: var(--ink-2); text-align: right; }
.funnel-bar-wrap { flex: 1; background: #f3f5fa; border-radius: 7px; height: 30px; position: relative; overflow: hidden; }
.funnel-bar {
  height: 100%; border-radius: 7px; display: flex; align-items: center; padding: 0 11px;
  color: #fff; font-size: 11.5px; font-weight: 600; min-width: 56px; transition: width .45s cubic-bezier(.4,0,.2,1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}
.funnel-num { font-variant-numeric: tabular-nums; min-width: 96px; text-align: right; font-size: 12px; color: var(--ink-2); font-weight: 500; }
.funnel .f0 { background: linear-gradient(90deg, #5b7cff, #2f54eb); }
.funnel .f1 { background: linear-gradient(90deg, #6d8bff, #3f66f5); }
.funnel .f2 { background: linear-gradient(90deg, #8f74ff, #6b4af0); }
.funnel .f3 { background: linear-gradient(90deg, #f5a623, #e08700); }
.funnel .f4 { background: linear-gradient(90deg, #2fc07f, #0f9a5c); }
.funnel .f5 { background: linear-gradient(90deg, #a3adbf, #7b8494); }
.funnel-track { flex: 1; height: 26px; background: #f3f5fa; border-radius: 7px; overflow: hidden; }
.funnel-fill { height: 100%; border-radius: 7px; color: #fff; font-size: 11.5px; font-weight: 600; display: flex; align-items: center; padding-left: 10px; transition: width .3s; }

.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: flex; align-items: center; gap: 10px; font-size: 12.3px; margin-bottom: 0; }
.bar-row > span:first-child, .bar-name {
  width: 96px; flex: 0 0 96px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bar-track { flex: 1; height: 8px; background: #f1f4f9; border-radius: 6px; overflow: hidden; display: block; }
.bar-fill, .bar-track i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #7f9bff, #2f54eb); transition: width .4s; }
.bar-row > span:last-child, .bar-val { width: 76px; flex: 0 0 76px; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }

/* 表格可点击行 */
.row-click { cursor: pointer; }

/* ---------- 推品工作台 ---------- */
.push-layout { display: grid; grid-template-columns: 302px 1fr; gap: 16px; align-items: start; }
.push-side { position: sticky; top: 82px; }
.push-cust {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px;
  cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; background: #fff;
}
.push-cust:hover { border-color: #c3d1ff; background: #fbfcff; }
.push-cust.active { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(47, 84, 235, .1); }
.push-cust .n { font-weight: 600; font-size: 13px; }
.push-cust .m { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score-pill {
  display: inline-flex; align-items: center; gap: 4px; background: var(--brand-soft); color: var(--brand-dark);
  border: 1px solid var(--brand-line); border-radius: 20px; padding: 1px 9px; font-size: 11px; font-weight: 600;
}
.cart-bar {
  position: sticky; bottom: 0; background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; display: flex; align-items: center; gap: 14px;
  box-shadow: 0 -10px 30px -20px rgba(16, 24, 40, .3); margin-top: 12px; z-index: 10; flex-wrap: wrap;
}
.cart-bar .cart-info { flex: 1; font-size: 12.5px; min-width: 240px; }
.cart-bar .cart-info b { font-size: 17px; color: var(--brand); font-weight: 700; }
.cart-bar select { width: auto; min-width: 170px; padding: 6px 8px; }

/* ---------- 抽屉 / 弹窗 ---------- */
.drawer-mask { position: fixed; inset: 0; background: rgba(10, 17, 32, .46); backdrop-filter: blur(2px); z-index: 60; display: flex; justify-content: flex-end; }
.drawer {
  width: 640px; max-width: 94vw; background: #fff; height: 100%; overflow-y: auto;
  animation: slidein .24s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column;
  box-shadow: -30px 0 70px -40px rgba(0, 0, 0, .5);
}
.drawer-hd {
  padding: 18px 22px; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between;
  align-items: flex-start; position: sticky; top: 0; background: #fff; z-index: 2; font-weight: 600; font-size: 15px;
}
.drawer-bd { padding: 20px 22px; flex: 1; }
@keyframes slidein { from { transform: translateX(40px); opacity: .6; } to { transform: none; opacity: 1; } }

.modal-mask { position: fixed; inset: 0; background: rgba(10, 17, 32, .45); backdrop-filter: blur(3px); z-index: 70; display: grid; place-items: center; padding: 20px; }
.modal {
  background: #fff; border-radius: 16px; width: 640px; max-width: 96vw; max-height: 92vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); animation: pop .2s cubic-bezier(.2,.8,.2,1);
}
@keyframes pop { from { transform: translateY(10px) scale(.985); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-hd { padding: 17px 22px; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; align-items: center; }
.modal-hd h3 { margin: 0; font-size: 15.5px; font-weight: 650; }
.modal-bd { padding: 20px 22px; }
.modal-ft { padding: 14px 22px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 10px; background: #fbfcff; border-radius: 0 0 16px 16px; }
.x-btn { background: none; border: none; font-size: 20px; color: var(--ink-3); cursor: pointer; line-height: 1; padding: 0 4px; border-radius: 6px; }
.x-btn:hover { color: var(--ink); background: #f2f4f9; }

/* ---------- toast ---------- */
.toast-root { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #101828; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 12.5px;
  box-shadow: 0 16px 40px -16px rgba(0, 0, 0, .5); animation: pop .18s ease-out; border: 1px solid rgba(255,255,255,.08);
}
.toast.ok { background: #0b7a46; }
.toast.err { background: #bf3439; }
.toast.warn { background: #a85a00; }

/* ---------- 打印 ---------- */
@media print {
  .sidebar, .topbar, .no-print, .cart-fab { display: none !important; }
  .view { padding: 0; }
  .card { box-shadow: none; border: none; }
  body { background: #fff; }
}

/* ---------- 布局辅助 ---------- */
.dash-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; align-items: start; }

/* ---------- 推品中台 2.0 ---------- */
.grid-kpi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.grid-kpi .card { margin: 0; }

.scene-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 12px; }
.scene-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-xs); padding: 13px 15px; display: flex; flex-direction: column;
  transition: border-color .16s, transform .16s, box-shadow .16s;
}
.scene-card:hover { border-color: #c7d5ff; transform: translateY(-2px); box-shadow: 0 10px 24px -18px rgba(16,24,40,.4); }
.scene-card.hit { border-color: #c2d4ff; background: linear-gradient(180deg, #f7faff, #fff); }
.scene-card.focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 84, 235, .12); }
.scene-top { display: flex; align-items: center; gap: 8px; }
.scene-hd { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.scene-desc { margin: 8px 0 10px; line-height: 1.75; min-height: 42px; color: var(--ink-2); font-size: 12.5px; }
.scene-signal {
  background: #f7f9ff; border: 1px solid #e6ecff; border-left: 2px solid var(--brand);
  border-radius: 7px; padding: 7px 10px; font-size: 12px; color: var(--ink-2);
}
.scene-signal .muted { margin-right: 6px; font-size: 11.5px; }
.scene-foot {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  border-top: 1px dashed var(--line); margin-top: auto; padding-top: 10px;
  font-size: 12px; color: var(--ink-2);
}
.scene-foot b { color: var(--ink); }
.scene-group-hd { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #344054; margin: 2px 0 10px; }
.scene-group-hd span { font-weight: 500; font-size: 11.5px; color: #6b7488; background: #f1f4f9; border-radius: 10px; padding: 1px 8px; }

.bulk-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: linear-gradient(90deg, #f3f6ff, #f8faff); border: 1px solid var(--brand-line);
  border-radius: 10px; padding: 9px 12px; margin-bottom: 12px; font-size: 12.5px;
}
.bulk-bar.on { display: flex; }

.mini-box { flex: 1; min-width: 120px; background: #f8fafd; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; }

.weight-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.weight-row:last-child { border-bottom: none; }
.weight-row .muted { font-size: 12px; }

/* ---------- 推品引擎：客户选择 / 手动添加 ---------- */
.pinned-wrap { background: #f8fafd; border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; margin-bottom: 10px; }
.pinned-hd { font-size: 12px; color: var(--ink-2); font-weight: 600; display: flex; align-items: baseline; gap: 6px; margin-bottom: 8px; }
.pinned-hd .muted { font-size: 11px; font-weight: 400; }
.pinned-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pin-chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: 20px;
  padding: 3px 9px; font-size: 12px; color: var(--ink-2); transition: .15s;
}
.pin-chip:hover { border-color: #bfd0ff; color: var(--brand-dark); }
.pin-chip.active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); font-weight: 600; }
.pin-chip b { font-weight: 400; color: var(--ink-3); font-size: 13px; line-height: 1; padding: 0 1px; border-radius: 50%; }
.pin-chip b:hover { color: var(--danger); }

.seg-tabs { display: flex; gap: 8px; }
.ac-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; margin-bottom: 7px;
  cursor: pointer; transition: .15s; background: #fff;
}
.ac-row:hover { border-color: var(--brand); background: var(--brand-soft); }
.ac-meta { font-size: 11.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 选品决策器 ---------- */
.sel-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px 14px; }
.sel-flags {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  border-top: 1px dashed var(--line); margin-top: 14px; padding-top: 12px; font-size: 12.5px;
}
.sel-flags .chk { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; color: var(--ink-2); }
.sel-flags .chk input { width: auto; margin: 0; }
.sel-flags .sep { width: 1px; height: 16px; background: var(--line); }
.sel-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.sel-foot .cart-info { margin-right: auto; font-size: 12.5px; color: var(--ink-2); }
.sel-foot .cart-info b { color: var(--ink); }

/* ---------- 页签 ---------- */
.tabbar {
  display: inline-flex; align-items: center; gap: 4px; margin: 0 0 14px; padding: 4px;
  background: #eef1f8; border-radius: 11px; border: 1px solid #e6eaf3;
}
.tabbar .tab {
  border: none; background: transparent; padding: 7px 16px; border-radius: 8px; font-size: 13px;
  font-weight: 600; color: #667085; cursor: pointer; transition: .15s;
}
.tabbar .tab:hover { color: var(--ink); }
.tabbar .tab.active { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(16, 24, 40, .1), 0 0 0 1px rgba(16,24,40,.02); }
.tabbar .spacer { flex: 1; }

/* ---------- 清单分页 / 悬浮入口 ---------- */
.rec-pager {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line-2);
  background: #fbfcff; border-radius: 0 0 var(--radius) var(--radius);
}
.rec-pager .spacer { flex: 1; }
.cart-fab {
  position: fixed; right: 26px; bottom: 26px; z-index: 45; cursor: pointer;
  background: linear-gradient(180deg, #4166f5, #2f54eb); color: #fff; border-radius: 24px; padding: 10px 18px; font-size: 12.5px;
  box-shadow: 0 14px 30px -12px rgba(47, 84, 235, .75), inset 0 1px 0 rgba(255,255,255,.2); transition: filter .18s, transform .18s;
}
.cart-fab b { font-size: 15px; }
.cart-fab:hover { filter: brightness(1.06); transform: translateY(-1px); }

/* ---------- 响应式 ---------- */
@media (max-width: 1400px) { .sel-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1180px) {
  .dash-grid { grid-template-columns: 1fr; }
  .kpis, .grid-kpi { grid-template-columns: repeat(2, 1fr); }
  .grid4 { grid-template-columns: repeat(2, 1fr); }
  .push-layout { grid-template-columns: 262px 1fr; }
  .two-col { grid-template-columns: 1fr !important; }
}
@media (max-width: 900px) {
  .sidebar { width: 74px; flex: 0 0 74px; }
  .logo { justify-content: center; padding: 18px 8px; }
  .logo-text, .nav-group, .nav-label, .side-user .user-meta { display: none; }
  .nav-item { justify-content: center; padding: 10px 0; }
  .nav-item.active::before { left: -12px; }
  .side-user { justify-content: center; margin-bottom: 8px; }
  .side-foot { text-align: center; padding: 10px 6px 14px; }
  .sel-grid { grid-template-columns: repeat(2, 1fr); }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .push-layout { grid-template-columns: 1fr; }
  .push-side { position: static; }
  .view { padding: 16px 14px 36px; }
  .topbar { padding: 10px 14px; }
  .crumb-sub, .crumb-sep { display: none; }
}
@media (max-width: 640px) {
  .kpis, .grid-kpi { grid-template-columns: 1fr; }
  .scene-grid { grid-template-columns: 1fr; }
  .sel-grid { grid-template-columns: 1fr; }
  .view { padding: 12px 10px 30px; }
  .card-hd { padding: 13px 14px; }
  .card-bd { padding: 14px; }
}
