/* ============ 基础 ============ */
:root {
  --bg: #eaf0f9;
  --card: #ffffff;
  --line: #e6ecf6;
  --ink: #1d2742;
  --ink-2: #4a5670;
  --muted: #8b95a8;
  --blue: #2b5fe3;
  --blue-soft: #eaf1ff;
  --blue-deep: #1b3f9c;
  --green: #10a86a;
  --red: #e8453c;
  --shadow: 0 16px 44px rgba(24, 45, 92, .10);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, select, input { font-family: inherit; }
button { cursor: pointer; }

.app-shell {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card);
}

/* ============ 顶栏 ============ */
.topbar {
  position: relative;
  flex: none;
  z-index: 20;
  height: 124px;
  background: linear-gradient(105deg, #0a1428 0%, #101d38 55%, #152550 100%);
  overflow: hidden;
  color: #fff;
}
.topbar-pattern {
  position: absolute;
  inset: 0;
  opacity: .5;
  background-image: radial-gradient(circle, rgba(120,165,255,.38) 1px, transparent 1.4px);
  background-size: 13px 13px;
  -webkit-mask-image: radial-gradient(ellipse 55% 180% at 88% 60%, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse 55% 180% at 88% 60%, #000 0%, transparent 72%);
}
.topbar-inner {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.topbar-main {
  height: 78px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.banner-tabs {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 0 26px;
  background: rgba(5, 13, 30, .42);
  border-top: 1px solid rgba(255,255,255,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  overflow-x: auto;
  scrollbar-width: none;
}
.banner-tabs::-webkit-scrollbar { display: none; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand h1 { margin: 0; font-size: 23px; font-weight: 700; letter-spacing: .5px; }
.brand-divider { width: 1px; height: 18px; background: rgba(255,255,255,.35); }
.brand-tag { font-size: 13px; color: #a9b8d8; letter-spacing: 1px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.data-status {
  font-size: 12px;
  color: #9fc0ff;
  background: rgba(80,130,230,.16);
  border: 1px solid rgba(120,165,255,.25);
  padding: 5px 10px;
  border-radius: 20px;
}
.top-btn {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  color: #dce6fb;
  border-radius: 7px;
  padding: 6px 13px;
  font-size: 12px;
  transition: .15s;
}
.top-btn:hover { background: rgba(255,255,255,.18); color: #fff; }
.dots { display: flex; gap: 6px; margin-left: 8px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.35); }
.dots i.active { background: #fff; }

/* ============ 工具栏 ============ */
.content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 26px 0;
  scrollbar-gutter: stable;
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.toolbar-left { display: flex; gap: 10px; }
.toolbar-right { color: var(--muted); font-size: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 8px;
  padding: 9px 15px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: .15s;
}
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 4px 12px rgba(43,95,227,.24); }
.btn-primary:hover { background: #1f52cc; }
.btn-ghost { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { border-color: #b9caf0; color: var(--blue); }

/* ============ 面板 ============ */
.panel {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 18px 20px 20px;
  margin-bottom: 18px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.panel-title { display: flex; align-items: center; gap: 9px; }
.panel-title h2 { margin: 0; font-size: 17px; font-weight: 700; color: var(--ink); }
.title-icon {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 7px;
}

/* ============ 筛选器 ============ */
.filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.filter-item { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.filter-item select, .filter-item input[type="date"] {
  height: 30px;
  border: 1px solid #d8e1f2;
  background: #f8faff;
  border-radius: 6px;
  padding: 0 9px;
  color: var(--ink-2);
  font-size: 12px;
  outline: none;
}
.filter-item select { min-width: 106px; max-width: 180px; text-overflow: ellipsis; }
.filter-item select:focus, .filter-item input:focus { border-color: var(--blue); background: #fff; }
.filter-item select option.placeholder { color: var(--blue); }
.date-sep { color: #c3cddd; }
.filter-date input { width: 112px; }

/* ============ KPI 卡片 ============ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.kpi-card {
  background: #fff;
  padding: 17px 18px 15px;
  min-height: 116px;
  transition: background .15s;
}
.kpi-card:hover { background: #fbfcff; }
.kpi-label { font-size: 12.5px; color: var(--muted); margin-bottom: 11px; white-space: nowrap; }
.kpi-value {
  font-size: 25px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi-card.blue .kpi-value { color: var(--blue); }
.kpi-card.dark .kpi-value { color: var(--ink); }
.kpi-deltas { margin-top: 12px; display: flex; flex-direction: column; gap: 3px; }
.delta-line { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 3px; }
.delta-line b { font-weight: 600; }
.delta-up { color: var(--green); }
.delta-down { color: var(--red); }
.delta-flat { color: var(--muted); }
.delta-arrow { font-size: 10px; }

/* ============ 销售达成 ============ */
.analysis-period-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #f8faff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 18px 10px;
  margin-bottom: 18px;
}
.analysis-period-bar .time-progress { flex: 1; min-width: 0; margin-bottom: 0; }
.analysis-period-label {
  flex: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue-deep);
  background: var(--blue-soft);
  border-radius: 6px;
  padding: 6px 10px;
}
.analysis-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.analysis-card { border: 1px solid var(--line); border-radius: 11px; padding: 16px 18px 18px; }
.analysis-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.analysis-card h3 { margin: 0; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.accent-bar { display: inline-block; width: 3px; height: 14px; background: var(--blue); border-radius: 2px; }

.time-progress { margin-bottom: 22px; }
.tp-label { font-size: 11px; color: var(--muted); margin-bottom: 9px; }
.scale-wrap { position: relative; padding-bottom: 17px; }
.scale-track {
  position: relative; height: 9px; border-radius: 5px;
  background: linear-gradient(90deg, #dfe7f5, #eef2f9);
}
.scale-ticks {
  position: absolute; left: 0; right: 0; bottom: -14px; height: 12px;
  background-image: repeating-linear-gradient(90deg, #c8d2e4 0 1px, transparent 1px 10%);
  background-size: 100% 6px;
  background-repeat: no-repeat;
  background-position: bottom;
}
.scale-labels {
  position: absolute; left: 0; right: 0; top: 13px;
  display: flex; justify-content: space-between;
  font-size: 9.5px; color: #a3aec0;
}
.scale-thumb {
  position: absolute; top: -3px; width: 15px; height: 15px;
  border-radius: 50%; background: #22b8cf;
  border: 3px solid #e6fbfd;
  box-shadow: 0 1px 4px rgba(20,120,150,.35);
  transform: translateX(-50%);
}

.entity-progress { display: flex; flex-direction: column; gap: 9px; }
.entity-entry { display: block; }
.entity-row { display: flex; align-items: center; gap: 10px; }
.entity-cost { margin: 1px 0 3px 54px; font-size: 10px; line-height: 1.35; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entity-name { width: 44px; flex: none; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entity-track { flex: 1; height: 13px; background: #eef2f9; border-radius: 3px; overflow: hidden; }
.entity-fill { height: 100%; background: linear-gradient(90deg, #3a72ee, #2b5fe3); border-radius: 3px; min-width: 0; transition: width .5s ease; }
.entity-fill.over { background: linear-gradient(90deg, #2b5fe3, #1639a8); }
.entity-pct { width: 62px; flex: none; text-align: right; font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.entity-meta { width: 128px; flex: none; text-align: right; font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-row .entity-name { width: 96px; font-weight: 600; color: var(--blue-deep); }
.channel-row { padding: 2px 0; }
.entity-empty { font-size: 12px; color: var(--muted); padding: 8px 0; }

/* ============ 产品销售分析 ============ */
.product-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 18px; }
.hint-inline { font-size: 11px; color: var(--muted); font-weight: 400; }
.sub-label { font-size: 11px; color: var(--muted); }
.mini-link { border: none; background: transparent; color: var(--blue); font-size: 11px; padding: 4px 6px; }
.mini-link:hover { text-decoration: underline; }

.rank-list { display: flex; flex-direction: column; gap: 11px; }
.rank-item { display: flex; align-items: center; gap: 10px; }
.rank-no { width: 20px; flex: none; text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); }
.rank-item:nth-child(1) .rank-no { color: #e8a317; }
.rank-item:nth-child(2) .rank-no { color: #8f9bb3; }
.rank-item:nth-child(3) .rank-no { color: #c88452; }
.rank-name { width: 112px; flex: none; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-cat { width: 62px; flex: none; font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-track { flex: 1; height: 14px; background: #eef2f9; border-radius: 3px; overflow: hidden; }
.rank-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, #4a80f0, #2b5fe3); transition: width .5s ease; }
.rank-item:nth-child(1) .rank-fill { background: linear-gradient(90deg, #f0b64a, #e89116); }
.rank-item:nth-child(2) .rank-fill { background: linear-gradient(90deg, #b8c4d8, #8f9bb3); }
.rank-item:nth-child(3) .rank-fill { background: linear-gradient(90deg, #e0aa80, #c88452); }
.rank-value { width: 74px; flex: none; text-align: right; font-size: 11.5px; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.rank-empty { font-size: 12px; color: var(--muted); padding: 16px 0; text-align: center; }

.category-layout { display: flex; gap: 20px; align-items: center; }
.donut-wrap { flex: none; width: 148px; display: flex; justify-content: center; }
.donut {
  width: 140px; height: 140px; border-radius: 50%;
  background: conic-gradient(#dfe6f2 0 100%);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.donut::after {
  content: ''; position: absolute; width: 96px; height: 96px;
  border-radius: 50%; background: #fff;
}
.donut-center { position: relative; z-index: 1; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.donut-center b { font-size: 16px; color: var(--ink); }
.donut-center span { font-size: 10px; color: var(--muted); }
.category-list { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cat-item { display: flex; align-items: center; gap: 8px; font-size: 11.5px; }
.cat-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.cat-name { width: 68px; flex: none; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-share { width: 44px; flex: none; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.cat-bar { flex: 1; height: 7px; background: #eef2f9; border-radius: 4px; overflow: hidden; min-width: 30px; }
.cat-bar i { display: block; height: 100%; border-radius: 4px; }
.cat-rate { width: 48px; flex: none; text-align: right; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.target-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.cost-grid { max-height: 52vh; overflow-y: auto; padding-right: 4px; gap: 8px 18px; }
.cost-grid .target-item { align-items: flex-start; }
.cost-grid .target-item label { width: auto; flex: 1 1 120px; min-width: 0; white-space: normal; line-height: 1.3; font-size: 11px; }
.cost-grid .target-item input { flex: 0 0 88px; width: 88px; }
.target-item { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.target-item label { width: 96px; flex: none; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.target-item input { flex: 1; height: 32px; border: 1px solid #d8e1f2; border-radius: 6px; padding: 0 10px; font-size: 12px; color: var(--ink); outline: none; }
.target-item input:focus { border-color: var(--blue); }
.target-item span { color: var(--muted); font-size: 11px; }

.footer {
  display: flex; justify-content: space-between;
  padding: 6px 2px 20px; font-size: 11px; color: #a6b0c2;
}

/* ============ 遮罩 / 弹窗 / Toast ============ */
.drop-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(16,30,60,.55);
  display: none; align-items: center; justify-content: center;
}
.drop-overlay.show { display: flex; }
.drop-box {
  width: 380px; padding: 48px; text-align: center;
  background: #fff; border-radius: 16px; color: var(--blue);
  border: 2px dashed #9db8f0;
}
.drop-box p { margin: 14px 0 0; font-size: 15px; font-weight: 600; color: var(--ink); }

.modal { position: fixed; inset: 0; z-index: 110; display: flex; align-items: center; justify-content: center; }
.modal[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(14,26,52,.55); }
.modal-box {
  position: relative; z-index: 1;
  width: 520px; max-width: calc(100vw - 40px); max-height: 88vh;
  background: #fff; border-radius: 14px;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 70px rgba(0,0,0,.28);
}
.modal-wide { width: 720px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 17px 22px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 16px; }
.icon-close { border: none; background: transparent; font-size: 24px; color: var(--muted); line-height: 1; }
.icon-close:hover { color: var(--ink); }
.modal-body { padding: 20px 22px; overflow: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 22px; border-top: 1px solid var(--line);
}
.mapping-summary { font-size: 12px; color: var(--ink-2); background: #f4f7fd; padding: 10px 13px; border-radius: 8px; margin-bottom: 12px; }
.mapping-tip { font-size: 12px; color: var(--muted); margin: 0 0 12px; }
.mapping-tip b { color: var(--red); }
.mapping-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.mapping-item { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.mapping-item label { width: 82px; flex: none; color: var(--ink-2); }
.mapping-item label b { color: var(--red); }
.mapping-item select { flex: 1; height: 31px; border: 1px solid #d8e1f2; border-radius: 6px; padding: 0 8px; font-size: 12px; color: var(--ink-2); background: #fff; }
.clean-options { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 18px; padding-top: 15px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--ink-2); }
.clean-options label { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.help-body h4 { margin: 16px 0 6px; font-size: 13px; color: var(--ink); }
.help-body h4:first-child { margin-top: 0; }
.help-body p, .help-body li { font-size: 12.5px; color: var(--ink-2); line-height: 1.7; }
.help-body ul { margin: 6px 0; padding-left: 20px; }

.toast {
  position: fixed; left: 50%; bottom: 36px; transform: translate(-50%, 20px);
  background: #1d2742; color: #fff; padding: 11px 20px; border-radius: 8px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #c8392f; }

/* ============ Banner 页签 ============ */
.tab-btn {
  position: relative;
  flex: 0 0 auto;
  min-width: 178px;
  margin-top: 6px;
  border: 1px solid rgba(255,255,255,.12);
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  background: var(--tab-bg);
  color: rgba(255,255,255,.82);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .2px;
  padding: 0 18px 2px 36px;
  text-align: center;
  white-space: nowrap;
  transition: background .18s, color .18s, transform .18s, box-shadow .18s;
}
.tab-btn::before {
  content: '';
  position: absolute;
  left: 16px; top: 50%;
  width: 7px; height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: var(--tab-dot);
  box-shadow: 0 0 10px var(--tab-dot);
}
.tab-btn::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: var(--tab-accent);
  opacity: .35;
  transition: opacity .18s, height .18s;
}
.tab-btn:hover { background: var(--tab-hover); color: #fff; transform: translateY(-1px); }
.tab-btn.active {
  background: var(--tab-active);
  border-color: var(--tab-accent);
  color: #fff;
  box-shadow: 0 -2px 18px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.2);
}
.tab-btn.active::after { opacity: 1; height: 4px; }
.tab-btn:focus-visible { outline: 2px solid var(--tab-dot); outline-offset: -3px; }

.tab-sales {
  --tab-bg: rgba(43,95,227,.20);
  --tab-hover: rgba(43,95,227,.34);
  --tab-active: linear-gradient(135deg, #2b5fe3, #1b3f9c);
  --tab-dot: #8fb4ff;
  --tab-accent: #4d86ff;
}
.tab-product {
  --tab-bg: rgba(34,184,207,.18);
  --tab-hover: rgba(34,184,207,.32);
  --tab-active: linear-gradient(135deg, #17aec8, #0c6f88);
  --tab-dot: #7ce6f4;
  --tab-accent: #22b8cf;
}
.tab-cost {
  --tab-bg: rgba(240,169,40,.18);
  --tab-hover: rgba(240,169,40,.32);
  --tab-active: linear-gradient(135deg, #f0a928, #b36a06);
  --tab-dot: #ffd17a;
  --tab-accent: #f0a928;
}
.tab-profit {
  --tab-bg: rgba(16,168,106,.20);
  --tab-hover: rgba(16,168,106,.34);
  --tab-active: linear-gradient(135deg, #14b777, #0c7650);
  --tab-dot: #7ce0b2;
  --tab-accent: #10a86a;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============ 数据表格 ============ */
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th { text-align: right; padding: 10px 12px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); background: #f8faff; white-space: nowrap; }
.data-table td { padding: 10px 12px; text-align: right; border-bottom: 1px solid #f0f3f9; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table th:first-child, .data-table td:first-child,
.data-table th:nth-child(2), .data-table td:nth-child(2) { text-align: left; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #f7faff; }
.stock-name { font-weight: 600; color: var(--ink); }
.stock-summary { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.stock-summary .stat { flex: 1; min-width: 170px; background: #f8faff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; }
.stock-stat-label { font-size: 11px; color: var(--muted); }
.stock-stat-value { margin-top: 4px; font-size: 20px; font-weight: 700; color: var(--blue-deep); font-variant-numeric: tabular-nums; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.badge-ok { background: #e6f7f0; color: var(--green); }
.badge-warn { background: #fff4e0; color: #b87800; }
.badge-danger { background: #fdeceb; color: var(--red); }

/* ============ 费用分析 ============ */
.fee-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.fee-card { background: #f8faff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.fee-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.fee-card-name { font-size: 14px; font-weight: 700; color: var(--ink); }
.fee-card-owner { font-size: 11px; color: var(--muted); }
.fee-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.fee-metric-label { font-size: 11px; color: var(--muted); }
.fee-metric-value { margin-top: 2px; font-size: 16px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.fee-bar { margin-top: 14px; height: 8px; background: #e6ecf6; border-radius: 4px; overflow: hidden; }
.fee-bar i { display: block; height: 100%; background: linear-gradient(90deg, #3a72ee, #2b5fe3); transition: width .5s ease; }
.fee-bar i.over { background: linear-gradient(90deg, #f08a3c, #e8453c); }
.fee-card-foot { margin-top: 7px; font-size: 11px; color: var(--muted); }

/* ============ 利润分析 ============ */
.profit-kpi-grid {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
}
.profit-kpi-grid .kpi-card { min-height: 94px; padding: 14px 16px 12px; }
.profit-kpi-grid .kpi-label { margin-bottom: 8px; }

.profit-rank { display: flex; flex-direction: column; gap: 12px; }
.profit-rank-item { display: flex; align-items: center; gap: 10px; }
.profit-rank-name { width: 190px; flex: none; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-fill.loss { background: linear-gradient(90deg, #f5a25a, #e8453c); }
.profit-rank-rate { width: 72px; flex: none; text-align: right; font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.profit-rank-rate.loss { color: var(--red); }

.profit-table { min-width: 1080px; }
.profit-table-wide { min-width: 1480px; }
.profit-table td { cursor: default; }
#profitShopBody tr[data-shop] { cursor: pointer; }
.loss-text { color: var(--red) !important; font-weight: 600; }
.profit-text { color: var(--green); font-weight: 600; }
.data-table .total-row td { background: #f8faff; color: var(--ink); font-weight: 700; }
.profit-shop-name { font-weight: 600; color: var(--ink); }

.price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.price-item {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; background: #f8faff;
  border: 1px solid var(--line); border-radius: 8px;
}
.price-item label { width: 92px; flex: none; font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.price-item input {
  width: 68px; flex: none; height: 30px;
  border: 1px solid #d8e1f2; border-radius: 6px;
  padding: 0 6px; font-size: 12px; color: var(--ink); outline: none;
}
.price-item input:focus { border-color: var(--blue); background: #fff; }

/* ============ 响应式 ============ */
@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .profit-kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .analysis-grid, .product-grid, .fee-grid { grid-template-columns: 1fr; }
  .entity-meta { display: none; }
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .profit-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .profit-rank-name { width: 120px; }
  .panel-head { align-items: flex-start; }
  .filters { width: 100%; }
}
@media (max-width: 620px) {
  .app-shell { margin: 0; border-radius: 0; }
  .content { padding: 14px; }
  .topbar { height: 112px; }
  .topbar-main { height: 68px; padding: 0 16px; }
  .topbar-actions { gap: 6px; }
  .top-btn { padding: 5px 9px; }
  .data-status { display: none; }
  .banner-tabs { padding: 0 10px; gap: 5px; }
  .tab-btn { flex: 1 1 0; min-width: 0; padding: 0 6px; font-size: 11px; }
  .tab-btn::before { display: none; }
  .brand h1 { font-size: 18px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profit-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-value { font-size: 21px; }
  .mapping-grid, .target-grid, .price-grid { grid-template-columns: 1fr; }
  .filter-date input { width: 100px; }
  .rank-name { width: 88px; }
  .rank-cat { display: none; }
  .category-layout { flex-direction: column; }
  .donut-wrap { width: 100%; }
}
