:root {
  color-scheme: dark;
  --bg: #04102b;
  --bg-deep: #020a20;
  --panel: rgba(7, 25, 61, 0.92);
  --panel-strong: #0a2557;
  --line: rgba(66, 143, 255, 0.34);
  --line-soft: rgba(74, 153, 255, 0.16);
  --cyan: #28d7ff;
  --cyan-soft: #6ee7ff;
  --blue: #2f76ff;
  --blue-soft: #6b9dff;
  --magenta: #ef58b7;
  --purple: #8a5cff;
  --amber: #ffc857;
  --green: #4ce6a1;
  --text: #e9f4ff;
  --muted: #8da9cf;
  --dim: #59749a;
  --border: 1px solid var(--line);
}

* { box-sizing: border-box; }

html { background: var(--bg-deep); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}

button { font: inherit; }

.dashboard-shell {
  position: relative;
  z-index: 0;
  min-height: 100vh;
  padding: 0 22px 12px;
  overflow: hidden;
  background-color: var(--bg);
}

.dashboard-shell::before,
.dashboard-shell::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
}

.dashboard-shell::before {
  inset: 84px 0 auto;
  height: 1px;
  background: rgba(65, 161, 255, 0.72);
  box-shadow: 0 0 18px rgba(40, 215, 255, 0.7);
}

.dashboard-shell::after {
  width: 36vw;
  height: 36vw;
  left: 34%;
  top: 18%;
  border: 1px solid rgba(33, 132, 255, 0.08);
  border-radius: 50%;
  box-shadow: 0 0 120px rgba(27, 119, 255, 0.08) inset;
}

.ambient-lines { position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .5; }
.ambient-lines i { position: absolute; display: block; background: rgba(51, 125, 230, 0.08); }
.ambient-lines i:nth-child(1) { width: 1px; height: 82%; left: 27%; top: 12%; }
.ambient-lines i:nth-child(2) { width: 1px; height: 86%; left: 73%; top: 9%; }
.ambient-lines i:nth-child(3) { height: 1px; width: 94%; left: 3%; top: 52%; }
.ambient-lines i:nth-child(4) { height: 1px; width: 82%; left: 9%; top: 79%; }

.topbar {
  height: 85px;
  display: grid;
  grid-template-columns: minmax(330px, 1fr) auto;
  align-items: center;
  gap: 18px;
}

.brand-block { position: relative; display: flex; align-items: center; gap: 13px; min-width: 0; padding: 0; border: 0; color: inherit; background: transparent; cursor: pointer; }
.brand-title { margin: 0; font-size: clamp(20px, 1.55vw, 30px); letter-spacing: 1px; font-weight: 600; white-space: nowrap; }
.warehouse-filter-panel { position: absolute; z-index: 20; top: 64px; left: 22px; display: grid; grid-template-columns: 280px 280px; min-height: 180px; border: var(--border); background: rgba(4, 18, 48, .98); box-shadow: 0 14px 34px rgba(0, 0, 0, .46); }
.warehouse-filter-panel[hidden] { display: none; }
.warehouse-filter-column { max-height: 300px; padding: 14px; overflow-y: auto; }
.warehouse-filter-empty { display: block; padding: 9px; color: var(--dim); font-size: 12px; }
.warehouse-all-option { margin-bottom: 5px; border-bottom: 1px solid var(--line-soft) !important; color: var(--cyan-soft) !important; }
.warehouse-filter-column + .warehouse-filter-column { border-left: 1px solid var(--line-soft); }
.warehouse-filter-column > strong { display: block; margin-bottom: 9px; color: var(--cyan); font-size: 12px; }
.warehouse-filter-column button { display: block; width: 100%; padding: 8px 9px; border: 0; color: var(--muted); background: transparent; text-align: left; white-space: nowrap; cursor: pointer; }
.warehouse-filter-column button:hover, .warehouse-filter-column button.is-active { color: #fff; background: rgba(47, 118, 255, .28); }
.brand-block p { margin: 5px 0 0; color: var(--cyan-soft); font-size: 10px; letter-spacing: 2.6px; }
.brand-mark { width: 43px; height: 43px; position: relative; flex: 0 0 auto; border: 1px solid var(--cyan); transform: rotate(45deg); box-shadow: 0 0 18px rgba(40, 215, 255, .34) inset; }
.brand-mark span { position: absolute; width: 7px; height: 7px; background: var(--cyan); box-shadow: 0 0 9px var(--cyan); }
.brand-mark span:nth-child(1) { left: 8px; top: 8px; }
.brand-mark span:nth-child(2) { right: 8px; top: 8px; background: var(--blue); }
.brand-mark span:nth-child(3) { left: 8px; bottom: 8px; background: var(--blue-soft); }

.topbar-meta { justify-self: end; display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.system-state { display: flex; align-items: center; gap: 7px; }
.system-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 9px var(--green); }

.command-strip { display: grid; grid-template-columns: 188px 1fr; align-items: stretch; gap: 12px; margin: 12px 0 14px; }
.period-switch { position: relative; z-index: 10; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(130px, 1.8fr); border: var(--border); background: rgba(6, 23, 57, .92); align-self: stretch; }
.period-button { min-width: 0; border: 0; border-right: 1px solid var(--line); color: var(--muted); background: transparent; cursor: pointer; transition: color .2s ease, background-color .2s ease; }
.period-button[data-period="custom"] { white-space: nowrap; }
.period-button:last-of-type { border-right: 0; }
.period-button:hover { color: var(--text); background: rgba(47, 118, 255, .12); }
.period-button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.period-button.is-active { color: #fff; background: #1457bd; box-shadow: 0 0 18px rgba(43, 132, 255, .3) inset; }
.custom-date-panel { position: absolute; z-index: 20; top: calc(100% + 8px); left: 0; width: 330px; padding: 12px; border: var(--border); background: rgba(5, 23, 58, .98); box-shadow: 0 12px 28px rgba(0, 8, 29, .62); }
.custom-date-panel[hidden] { display: none; }
.custom-date-panel label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; }
.custom-date-panel > span { display: block; margin: 8px 0; color: var(--dim); font-size: 10px; }
.custom-date-panel input { width: 100%; height: 34px; padding: 0 8px; border: 1px solid var(--line); color: var(--text); background: rgba(12, 48, 103, .42); color-scheme: dark; }
.custom-date-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.custom-date-actions button { height: 30px; padding: 0 16px; border: 1px solid var(--cyan); color: var(--cyan-soft); background: transparent; cursor: pointer; }
.custom-date-actions #custom-date-confirm { color: #fff; background: #1478e7; }

.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.kpi-card { position: relative; min-height: 98px; padding: 15px 14px 13px 52px; display: flex; align-items: center; border: var(--border); background: rgba(7, 28, 68, .92); box-shadow: 0 0 20px rgba(11, 80, 180, .08) inset; overflow: hidden; }
.kpi-card::after { content: ""; position: absolute; right: 0; top: 0; width: 26px; height: 4px; background: var(--cyan); }
.kpi-index { position: absolute; left: 14px; top: 15px; color: rgba(87, 174, 255, .48); font-size: 11px; writing-mode: vertical-rl; letter-spacing: 2px; }
.kpi-card p { margin: 0 0 6px; color: var(--muted); font-size: 12px; }
.kpi-card strong { display: block; color: #fff; font-size: clamp(18px, 1.45vw, 26px); line-height: 1.1; letter-spacing: .3px; }
.kpi-card small { display: block; margin-top: 8px; color: var(--dim); font-size: 10px; }
.kpi-card small b { color: var(--green); font-weight: 500; margin-right: 4px; }
.kpi-card.warning small b { color: var(--green); }
.kpi-card.live::after { background: var(--green); }

.dashboard-grid { display: grid; grid-template-columns: minmax(290px, 0.92fr) minmax(620px, 2.08fr) minmax(310px, 1fr); gap: 14px; height: calc(100vh - 244px); min-height: 720px; }
.column { display: grid; gap: 14px; min-width: 0; min-height: 0; }
.left-column { grid-template-rows: minmax(0, 1.04fr) minmax(0, .96fr); }
.center-column { grid-template-rows: minmax(0, 1.35fr) minmax(0, .85fr); }
.right-column { grid-template-rows: minmax(0, 1.08fr) minmax(0, .92fr); }

.data-panel { position: relative; min-width: 0; border: var(--border); background: var(--panel); box-shadow: 0 0 36px rgba(0, 8, 29, .42) inset; overflow: hidden; }
.data-panel::before,
.data-panel::after { content: ""; position: absolute; width: 16px; height: 16px; pointer-events: none; }
.data-panel::before { left: -1px; top: -1px; border-left: 2px solid var(--cyan); border-top: 2px solid var(--cyan); }
.data-panel::after { right: -1px; bottom: -1px; border-right: 2px solid rgba(54, 133, 255, .8); border-bottom: 2px solid rgba(54, 133, 255, .8); }

.panel-header { position: relative; height: 47px; padding: 0 14px 0 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(72, 145, 255, .28); background: rgba(11, 42, 92, .66); }
.panel-header::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 104px; height: 2px; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.panel-header > div:first-child { display: flex; align-items: center; min-width: 0; }
.panel-header h2 { margin: 0; font-size: 15px; font-weight: 500; letter-spacing: .4px; white-space: nowrap; }
.panel-no { margin-right: 10px; color: var(--cyan); font-size: 10px; letter-spacing: 1px; }
.panel-unit { color: var(--dim); font-size: 10px; white-space: nowrap; }

.table-wrap { padding: 8px 12px 0; }
.ranking-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ranking-table th { color: var(--dim); font-size: 10px; font-weight: 500; padding: 7px 5px; text-align: right; }
.ranking-table th:nth-child(1) { width: 40px; text-align: center; }
.ranking-table th:nth-child(2) { width: 43%; text-align: left; }
.ranking-table td { padding: 9px 5px; border-top: 1px solid var(--line-soft); color: #aac1df; font-size: 11px; text-align: right; }
.ranking-table td:nth-child(1) { text-align: center; color: var(--dim); }
.ranking-table td:nth-child(2) { text-align: left; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-table tr:nth-child(-n+3) td:first-child { color: var(--cyan); }
.rank-badge { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 1px solid rgba(40, 215, 255, .36); }

.warehouse-panel .panel-header h2 { font-size: 18px; }
.warehouse-panel .panel-no { font-size: 11px; }
.warehouse-panel .panel-unit { font-size: 12px; }
.warehouse-tabs button { font-size: 14px; }
.warehouse-panel .ranking-table th { font-size: 12px; }
.warehouse-panel .ranking-table td { font-size: 13px; }

.marketing-panel { display: grid; grid-template-rows: 47px 41px 80px minmax(0, 1fr); }
.marketing-tabs { margin: 8px 14px 0; }
.marketing-tabs button { min-width: 76px; height: 33px; padding: 0 16px; font-size: 12px; }
.marketing-overview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; padding: 8px 14px 0; }
.marketing-stat { min-width: 0; padding: 8px 9px; border: 1px solid var(--line-soft); background: rgba(12, 48, 103, .28); }
.marketing-stat span, .marketing-stat small { display: block; color: var(--dim); font-size: 10px; }
.marketing-stat strong { display: block; margin: 4px 0 2px; overflow: hidden; color: var(--cyan); font-size: 20px; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.marketing-table-wrap { min-height: 0; margin: 8px 14px 0; overflow: auto; }
.marketing-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.marketing-table th { padding: 6px 4px; color: var(--dim); font-size: 10px; font-weight: 500; text-align: right; }
.marketing-table th:first-child { width: 42%; text-align: left; }
.marketing-table td { padding: 9px 4px; border-top: 1px solid var(--line-soft); color: #aac1df; font-size: 11px; text-align: right; }
.marketing-table td:first-child { overflow: hidden; color: var(--text); text-align: left; text-overflow: ellipsis; white-space: nowrap; }

.funnel-overview { margin: 12px 14px 8px; display: flex; align-items: baseline; justify-content: space-between; color: var(--muted); font-size: 11px; }
.funnel-overview strong { color: var(--cyan); font-size: 20px; }
.funnel-list { display: grid; gap: 5px; padding: 0 14px 14px; }
.funnel-step { display: grid; grid-template-columns: 36px 1fr 58px; align-items: center; gap: 8px; }
.funnel-step > span { color: var(--muted); font-size: 10px; }
.funnel-step > strong { color: #b8cce6; font-size: 10px; text-align: right; font-weight: 500; }
.funnel-bar { position: relative; height: 18px; }
.funnel-bar i { position: absolute; inset: 0 auto 0 50%; width: var(--bar-width); transform: translateX(-50%); background: rgba(39, 128, 255, .28); border: 1px solid rgba(55, 175, 255, .48); }
.funnel-step:first-child .funnel-bar i { background: rgba(40, 215, 255, .3); border-color: var(--cyan); }
.funnel-step:last-child .funnel-bar i { background: rgba(76, 230, 161, .24); border-color: var(--green); }

.trend-panel { display: grid; grid-template-rows: 47px minmax(0, 1fr); }
.combined-trend-body { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 0; }
.revenue-zone { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(170px, 1fr); }
.chart-legend { display: flex; align-items: center; gap: 13px; color: var(--muted); font-size: 9px; }
.chart-legend span { display: flex; align-items: center; gap: 5px; }
.chart-legend i { position: relative; display: inline-block; width: 18px; height: 8px; }
.chart-legend i::before { content: ""; position: absolute; left: 0; right: 0; top: 3px; height: 2px; }
.revenue-key::before { background: var(--cyan); box-shadow: 0 0 6px rgba(40, 215, 255, .8); }
.active-key::before { background: repeating-linear-gradient(90deg, var(--amber) 0 5px, transparent 5px 8px); }
.added-key::before { background: repeating-linear-gradient(90deg, var(--green) 0 5px, transparent 5px 8px); }
.blue-dot { background: var(--blue); }
.green-dot { background: var(--green); box-shadow: 0 0 7px rgba(76, 230, 161, .62); }
.magenta-dot { background: var(--magenta); }
.chart-highlight { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); padding: 13px 18px 8px; border-bottom: 1px solid var(--line-soft); }
.chart-highlight div { min-width: 0; padding: 0 14px; border-right: 1px solid var(--line-soft); }
.chart-highlight div:first-child { padding-left: 0; }
.chart-highlight div:last-child { padding-right: 0; border-right: 0; }
.chart-highlight span { display: block; color: var(--dim); font-size: 10px; }
.chart-highlight strong { display: block; margin-top: 4px; overflow: hidden; color: var(--text); font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.chart-highlight div:first-child strong { color: var(--cyan); }
.chart-highlight div:nth-child(n+2) strong { color: var(--green); }
.chart-highlight div:nth-child(4) strong { color: var(--amber); }
.chart-highlight div:nth-child(5) strong { color: var(--magenta); }
.chart-highlight div:nth-child(6) strong { color: var(--blue-soft); }
.canvas-wrap { position: relative; min-height: 190px; padding: 0 8px; }
.chart-tooltip { position: absolute; z-index: 2; min-width: 142px; padding: 8px 10px; border: 1px solid rgba(40, 215, 255, .7); color: var(--text); background: rgba(3, 16, 43, .94); box-shadow: 0 6px 18px rgba(0, 8, 29, .5); pointer-events: none; font-size: 10px; line-height: 1.7; white-space: nowrap; }
.chart-tooltip[hidden] { display: none; }
.chart-tooltip strong { display: block; margin-bottom: 3px; color: var(--cyan-soft); font-size: 11px; }
.chart-tooltip span { display: block; }
.chart-tooltip i { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; }
.chart-tooltip .tooltip-revenue { background: var(--cyan); }
.chart-tooltip .tooltip-added { background: var(--green); }
.chart-tooltip .tooltip-active { background: var(--amber); }
#revenue-chart { display: block; width: 100%; height: 100%; min-height: 190px; }

.center-bottom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; min-height: 0; }
.category-content { height: calc(100% - 47px); display: grid; grid-template-columns: minmax(130px, .92fr) 1.08fr; align-items: center; gap: 8px; padding: 8px 14px 12px; }
.donut-chart { position: relative; width: min(160px, 100%); aspect-ratio: 1; justify-self: center; }
.donut-chart svg { width: 100%; height: 100%; }
.donut-base, .donut-segment { fill: none; stroke-width: 13; }
.donut-base { stroke: rgba(54, 100, 166, .24); }
.donut-segment { stroke-linecap: butt; }
.cat-1 { stroke: var(--cyan); }
.cat-2 { stroke: var(--blue); }
.cat-3 { stroke: var(--purple); }
.cat-4 { stroke: var(--magenta); }
.cat-5 { stroke: var(--amber); }
.donut-chart > div { position: absolute; inset: 32%; display: grid; place-content: center; text-align: center; }
.donut-chart strong { font-size: 13px; white-space: nowrap; }
.donut-chart span { margin-top: 3px; color: var(--dim); font-size: 8px; }
.category-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.category-legend li { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.category-legend i { width: 7px; height: 7px; }
.category-legend strong { color: var(--text); font-weight: 500; }
.cat-1-bg { background: var(--cyan); }.cat-2-bg { background: var(--blue); }.cat-3-bg { background: var(--purple); }.cat-4-bg { background: var(--magenta); }.cat-5-bg { background: var(--amber); }

.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; padding: 9px 14px 7px; }
.mini-stats div { padding: 7px 5px; border: 1px solid var(--line-soft); background: rgba(12, 48, 103, .28); text-align: center; }
.mini-stats span, .mini-stats small { display: block; color: var(--dim); font-size: 8px; }
.mini-stats strong { display: block; margin: 3px 0 2px; font-size: 13px; color: var(--cyan-soft); }
.tier-bars { display: grid; gap: 5px; padding: 1px 15px 6px; }
.tier-bars > div { display: grid; grid-template-columns: 76px 1fr 34px; align-items: center; gap: 7px; color: var(--muted); font-size: 8px; }
.tier-bars i { height: 5px; background: rgba(52, 99, 165, .28); }
.tier-bars b { display: block; height: 100%; background: var(--blue); }
.tier-bars > div:nth-child(1) b { background: var(--cyan); }
.tier-bars > div:nth-child(2) b { background: var(--purple); }
.tier-bars > div:nth-child(4) b { background: var(--magenta); }
.tier-bars strong { color: var(--text); font-weight: 500; text-align: right; }
.structure-notes { margin: 0 14px; padding-top: 5px; display: grid; gap: 4px; border-top: 1px solid var(--line-soft); color: var(--dim); font-size: 7px; }
.structure-notes p { margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 7px; white-space: nowrap; }
.structure-notes b { color: var(--green); font-weight: 500; }

.structure-tabs { display: flex; align-items: center; align-self: start; width: max-content; margin: 7px 14px 4px; border: 1px solid rgba(40, 215, 255, .65); border-radius: 4px; overflow: hidden; background: rgba(3, 18, 48, .72); }
.structure-tab { min-width: 58px; height: 31px; padding: 0 10px; border: 0; border-right: 1px solid rgba(40, 215, 255, .45); border-radius: 0; color: var(--cyan-soft); background: transparent; cursor: pointer; font: inherit; font-size: 12px; }
.structure-tab:last-child { border-right: 0; }
.structure-tab:hover, .structure-tab:focus-visible { color: var(--text); background: rgba(47, 118, 255, .14); }
.structure-tab.is-active { color: #fff; border-color: transparent; background: #1478e7; box-shadow: 0 0 14px rgba(40, 215, 255, .22) inset; }
.structure-chart { display: grid; grid-template-columns: minmax(160px, .95fr) 1.05fr; align-items: center; gap: 8px; min-height: 0; padding: 3px 14px 8px; }
.structure-donut { position: relative; width: min(160px, 100%); aspect-ratio: 1; justify-self: center; border-radius: 50%; background: conic-gradient(var(--cyan) 0 18%, var(--purple) 18% 42%, var(--blue) 42% 88%, var(--magenta) 88% 100%); box-shadow: 0 0 18px rgba(40, 215, 255, .14); }
.structure-legend { list-style: none; display: grid; gap: 9px; margin: 0; padding: 0; }
.structure-legend li { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.structure-legend i { width: 7px; height: 7px; background: var(--segment-color); }
.structure-legend strong { color: var(--text); font-weight: 500; }

.product-ranking { display: grid; gap: 2px; padding: 4px 12px; }
.product-row { height: 19px; display: grid; grid-template-columns: 22px minmax(0, 1fr) 150px; align-items: center; gap: 6px; }
.product-rank { color: var(--dim); font-size: 9px; line-height: 1; text-align: center; }
.product-row:nth-child(-n+3) .product-rank { color: var(--cyan); font-size: 10px; }
.product-info { min-width: 0; }
.product-info > div { display: flex; height: 14px; justify-content: space-between; align-items: center; gap: 7px; }
.product-info span { overflow: hidden; color: #cbdcf0; font-size: 13px; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.product-info small { flex: 0 0 auto; color: var(--green); font-size: 6px; line-height: 1; }
.product-bar { height: 2px; margin-top: 2px; background: rgba(53, 102, 169, .26); }
.product-bar i { display: block; width: var(--width); height: 100%; background: var(--cyan); }
.product-row:nth-child(n+4) .product-bar i { background: var(--blue); }
.product-value { text-align: right; }
.product-value strong { display: block; color: var(--text); font-size: 11px; line-height: 1; font-weight: 500; text-align: right; white-space: nowrap; }

.behavior-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 11px 12px 7px; }
.behavior-summary div { text-align: center; }
.behavior-summary span { display: block; color: var(--dim); font-size: 10px; }
.behavior-summary strong { display: block; margin-top: 4px; color: var(--text); font-size: 16px; }
.heatmap-title { display: flex; align-items: center; justify-content: space-between; padding: 2px 13px 5px; color: var(--muted); font-size: 9px; }
.heatmap-title small { display: flex; align-items: center; gap: 4px; color: var(--dim); font-size: 7px; }
.legend-key { display: inline-block; width: 7px; height: 7px; border-radius: 1px; }
.legend-visit { background: var(--cyan); }
.legend-order { background: var(--magenta); }
.heatmap { display: grid; grid-template-columns: 38px repeat(24, minmax(3px, 1fr)); gap: 2px; padding: 0 12px 8px; }
.heat-label { color: var(--dim); font-size: 7px; text-align: right; padding-right: 3px; align-self: center; }
.heat-cell { height: 6px; min-height: 3px; background: rgba(40, 215, 255, var(--heat)); }
.heat-cell-order { background: rgba(239, 88, 183, var(--heat)); }
.heat-cell:hover { outline: 1px solid var(--cyan-soft); outline-offset: 1px; }
.heatmap-axis { grid-column: 2 / -1; display: flex; justify-content: space-between; color: var(--dim); font-size: 7px; }

.dashboard-footer { display: flex; justify-content: space-between; gap: 20px; padding: 9px 2px 0; color: rgba(98, 128, 168, .72); font-size: 9px; letter-spacing: .2px; }

.brand-chevron { width: 11px; height: 11px; margin-left: 22px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-3px) rotate(45deg); }
.segmented-control { display: flex; align-items: center; width: max-content; border: 1px solid rgba(40, 215, 255, .65); border-radius: 4px; overflow: hidden; background: rgba(3, 18, 48, .72); }
.segmented-control button { min-width: 76px; height: 31px; padding: 0 15px; border: 0; border-right: 1px solid rgba(40, 215, 255, .45); color: var(--cyan-soft); background: transparent; cursor: pointer; font-size: 12px; }
.segmented-control button:last-child { border-right: 0; }
.segmented-control button:hover { background: rgba(47, 118, 255, .14); }
.segmented-control button:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }
.segmented-control button.is-active { color: #fff; background: #1478e7; box-shadow: 0 0 14px rgba(40, 215, 255, .22) inset; }
.warehouse-tabs { margin: 12px 14px 4px; }
.product-rank-tabs { margin: 12px 12px 8px; }
.product-rank-tabs button { min-width: 58px; padding-inline: 10px; font-size: 10px; }

@media (min-width: 1181px) {
  .dashboard-shell { height: 100vh; min-height: 760px; padding: 0; }
  .dashboard-shell::before { top: 73px; }
  .dashboard-shell::after, .ambient-lines { display: none; }
  .topbar { height: 74px; padding: 0 32px; grid-template-columns: 1fr auto; border-bottom: 1px solid var(--line); background: rgba(4, 16, 43, .96); }
  .brand-block { gap: 0; }
  .brand-block h1 { font-size: 24px; font-weight: 500; }
  .brand-block p, .brand-mark, .system-state { display: none; }
  .topbar-meta { font-size: 15px; }
  .command-strip { height: 174px; margin: 0; padding: 14px 12px 15px; display: grid; grid-template-columns: 1fr; grid-template-rows: 34px minmax(0, 1fr); gap: 14px; border-bottom: 1px solid var(--line); }
  .period-switch { z-index: 10; width: 430px; height: 34px; align-self: start; border-color: rgba(40, 215, 255, .72); border-radius: 4px; overflow: visible; }
  .period-button { font-size: 14px; }
  .period-button.is-active { background: #1478e7; }
  .kpi-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: clamp(10px, 1.8vw, 34px); align-items: stretch; }
  .kpi-card { min-height: 88px; padding: 12px 12px 12px 42px; }
  .kpi-card p { margin-bottom: 8px; font-size: 13px; }
  .kpi-card strong { font-size: clamp(22px, 1.55vw, 30px); line-height: 1; }
  .kpi-index { left: 11px; top: 12px; }
  .dashboard-grid { height: calc(100vh - 248px); min-height: 512px; grid-template-columns: 20% 55% 25%; gap: 0; }
  .column { gap: 0; }
  .left-column { grid-template-rows: 54% 46%; }
  .center-column { grid-template-rows: 65% 35%; }
  .right-column { grid-template-rows: 70% 30%; }
  .data-panel { border-right: 0; border-bottom: 0; }
  .right-column .data-panel { border-right: var(--border); }
  .left-column .data-panel:last-child, .center-bottom-grid .data-panel, .right-column .data-panel:last-child { border-bottom: var(--border); }
  .data-panel::before, .data-panel::after { opacity: .65; }
  .panel-header { height: 48px; }
  .center-bottom-grid { grid-template-columns: 1fr 1fr; gap: 0; }
  .category-panel { display: grid; grid-template-rows: 48px minmax(0, 1fr); }
  .category-panel .panel-header h2,
  .product-structure-panel .panel-header h2 { font-size: 17px; }
  .category-panel .panel-unit,
  .product-structure-panel .panel-unit { font-size: 11px; }
  .product-structure-panel .panel-unit { color: #fff; font-size: 14px; font-weight: 700; }
  .category-content { height: auto; min-height: 0; grid-template-columns: minmax(190px, .95fr) 1.05fr; gap: 18px; padding: 10px 18px 12px; }
  .donut-chart { width: min(198px, 100%); }
  .donut-base, .donut-segment { stroke-width: 15; }
  .donut-chart strong { font-size: 18px; }
  .donut-chart span { margin-top: 5px; font-size: 11px; }
  .category-legend { align-self: stretch; grid-template-rows: repeat(5, 1fr); gap: 0; }
  .category-legend li { grid-template-columns: 11px 1fr auto; gap: 11px; padding: 0 4px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
  .category-legend li:last-child { border-bottom: 0; }
  .category-legend i { width: 10px; height: 10px; }
  .category-legend strong { font-size: 14px; }
  .structure-legend { align-self: stretch; grid-template-rows: repeat(4, 1fr); gap: 0; }
  .structure-legend li { grid-template-columns: 11px 1fr auto; gap: 11px; padding: 0 4px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
  .structure-legend li:last-child { border-bottom: 0; }
  .structure-legend i { width: 10px; height: 10px; }
  .structure-legend strong { font-size: 14px; }
  .product-structure-panel { display: grid; grid-template-rows: 48px 42px minmax(0, 1fr); }
  .mini-stats { min-height: 0; gap: 9px; padding: 10px 14px 8px; }
  .mini-stats div { display: grid; place-content: center; padding: 7px; }
  .mini-stats span, .mini-stats small { font-size: 10px; }
  .mini-stats strong { margin: 5px 0 4px; font-size: 18px; }
  .tier-bars { min-height: 0; grid-template-rows: repeat(4, 1fr); gap: 5px; padding: 2px 16px 8px; }
  .tier-bars > div { grid-template-columns: 100px 1fr 42px; gap: 10px; font-size: 11px; }
  .tier-bars i { height: 9px; }
  .tier-bars strong { font-size: 12px; }
  .structure-notes { min-height: 0; margin: 0 16px; padding: 6px 0 7px; gap: 5px; font-size: 9px; }
  .structure-notes p { gap: 9px; }
  .trend-panel { grid-template-rows: 48px minmax(0, 1fr); }
  .revenue-zone { grid-template-rows: 82px minmax(190px, 1fr); }
  .chart-highlight { align-items: center; padding: 13px 18px 12px; }
  .chart-highlight span { font-size: 12px; }
  .chart-highlight strong { margin-top: 7px; font-size: 21px; }
  .canvas-wrap { min-height: 190px; }
  .warehouse-panel { display: grid; grid-template-rows: 48px auto minmax(0, 1fr); }
  .warehouse-panel .panel-header h2,
  .funnel-panel .panel-header h2,
  .product-rank-panel .panel-header h2 { font-size: 17px; }
  .warehouse-tabs { margin-block: 11px 5px; }
  .warehouse-tabs button { min-width: 88px; height: 36px; font-size: 15px; }
  .warehouse-panel .table-wrap { min-height: 0; padding: 3px 14px 10px; }
  .warehouse-panel .ranking-table { height: auto; }
  .warehouse-panel .ranking-table tbody { vertical-align: top; }
  .warehouse-panel .ranking-table th { padding-block: 8px; font-size: 12px; }
  .warehouse-panel .ranking-table td { padding-block: 12px; font-size: 13px; }
  .warehouse-panel .rank-badge { width: 28px; height: 28px; font-size: 12px; }
  .funnel-panel { display: grid; grid-template-rows: 48px auto minmax(0, 1fr); }
  .funnel-overview { margin: 14px 16px 8px; font-size: 13px; }
  .funnel-overview strong { font-size: 25px; }
  .funnel-list { min-height: 0; grid-template-rows: repeat(7, minmax(0, 1fr)); gap: 6px; padding: 0 16px 14px; }
  .funnel-step { grid-template-columns: 46px 1fr 72px; gap: 10px; }
  .funnel-step > span, .funnel-step > strong { font-size: 12px; }
  .funnel-bar { height: 25px; }
  .product-rank-panel { display: grid; grid-template-rows: 48px auto minmax(0, 1fr); }
  .product-rank-tabs { margin-block: 12px 8px; }
  .product-rank-tabs button { min-width: 72px; height: 34px; padding-inline: 12px; font-size: 12px; }
  .product-ranking { min-height: 0; grid-template-rows: repeat(10, minmax(0, 1fr)); gap: 3px; padding: 3px 14px 12px; }
  .product-row { height: auto; grid-template-columns: 28px minmax(0, 1fr) 152px; gap: 9px; }
  .product-rank { font-size: 11px; }
  .product-row:nth-child(-n+3) .product-rank { font-size: 13px; }
  .product-info > div { height: 17px; }
  .product-info span { font-size: 15px; }
  .product-info small { font-size: 9px; }
  .product-bar { height: 4px; margin-top: 3px; }
  .product-value strong { font-size: 12px; }
  .behavior-panel { display: grid; grid-template-rows: 48px 56px 28px minmax(0, 1fr); }
  .behavior-panel .panel-header h2 { font-size: 17px; }
  .behavior-panel .panel-unit { font-size: 11px; }
  .behavior-summary { min-height: 0; gap: 0; padding: 6px 12px 5px; border-bottom: 1px solid var(--line-soft); }
  .behavior-summary div { display: grid; place-content: center; border-right: 1px solid var(--line-soft); }
  .behavior-summary div:last-child { border-right: 0; }
  .behavior-summary span { font-size: 11px; }
  .behavior-summary strong { margin-top: 4px; color: var(--cyan-soft); font-size: 20px; }
  .heatmap-title { padding: 4px 14px 3px; font-size: 11px; }
  .heatmap-title small { gap: 4px; font-size: 9px; }
  .legend-key { width: 11px; height: 11px; }
  .heatmap { min-height: 0; grid-template-columns: 38px repeat(24, minmax(3px, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)) 16px; gap: 3px; padding: 2px 14px 8px; }
  .heat-label { padding-right: 5px; font-size: 10px; }
  .heat-cell { width: 100%; height: 100%; min-height: 8px; }
  .heatmap-axis { align-items: end; font-size: 9px; }
  .dashboard-footer { display: none; }
}

@media (min-width: 1181px) and (max-width: 1500px) {
  .dashboard-shell { padding-inline: 14px; }
  .topbar { grid-template-columns: minmax(300px, 1fr) auto; }
  .panel-header h2 { font-size: 13px; }
}

@media (max-width: 1180px) {
  .topbar { height: auto; min-height: 88px; grid-template-columns: 1fr auto; }
  .command-strip { grid-template-columns: 1fr; }
  .period-switch { height: 42px; width: min(100%, 430px); }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr 1fr; height: auto; }
  .center-column { grid-column: 1 / -1; grid-row: 1; }
  .left-column, .right-column { min-height: 760px; }
}

@media (max-width: 760px) {
  .dashboard-shell { padding-inline: 10px; }
  .topbar { padding-block: 12px; grid-template-columns: 1fr; gap: 10px; }
  .brand-mark { width: 35px; height: 35px; }
  .brand-block h1 { font-size: 18px; white-space: normal; }
  .brand-block p { letter-spacing: 1.2px; }
  .topbar-meta { justify-self: start; flex-wrap: wrap; }
  .command-strip { margin-top: 8px; }
  .period-switch { width: 100%; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-card { min-height: 88px; padding-left: 40px; }
  .dashboard-grid { display: block; }
  .column, .left-column, .center-column, .right-column { display: block; min-height: 0; }
  .data-panel { margin-bottom: 12px; }
  .warehouse-panel, .funnel-panel, .product-rank-panel, .behavior-panel { min-height: 320px; }
  .trend-panel { min-height: 520px; }
  .center-bottom-grid { display: block; }
  .category-panel, .product-structure-panel { min-height: 300px; }
  .chart-highlight { grid-template-columns: repeat(2, 1fr); gap: 10px 0; }
  .chart-highlight div { padding-inline: 10px; }
  .chart-highlight div:nth-child(even) { border-right: 0; }
  .chart-highlight strong { font-size: 14px; }
  .dashboard-footer { flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: no-preference) {
  .period-button, .funnel-bar i, .product-bar i { transition-duration: .22s; }
}

/* 1552 × 860 专用桌面大屏适配 */
@media (min-width: 1181px) and (max-height: 900px) {
  .dashboard-shell { height: 100vh; min-height: 700px; }
  .dashboard-shell::before { top: 60px; }
  .topbar { height: 60px; padding-inline: 26px; }
  .brand-block h1 { font-size: 21px; }
  .brand-chevron { width: 9px; height: 9px; margin-left: 18px; }
  .topbar-meta { font-size: 13px; }

  .command-strip { height: 140px; padding: 10px 10px 12px; grid-template-rows: 30px minmax(0, 1fr); gap: 10px; }
  .period-switch { width: 430px; height: 30px; }
  .period-button { font-size: 12px; }
  .kpi-grid { gap: 12px; }
  .kpi-card { min-height: 78px; padding: 9px 8px 9px 34px; }
  .kpi-index { left: 9px; top: 10px; font-size: 9px; }
  .kpi-card p { margin-bottom: 7px; font-size: 11px; }
  .kpi-card strong { font-size: clamp(18px, 1.5vw, 24px); }

  .dashboard-grid { height: calc(100vh - 200px); min-height: 500px; grid-template-columns: 21% 54% 25%; }
  .left-column { grid-template-rows: 55% 45%; }
  .center-column { grid-template-rows: 64% 36%; }
  .right-column { grid-template-rows: 68% 32%; }
  .panel-header { height: 42px; padding-inline: 12px; }
  .panel-header h2,
  .warehouse-panel .panel-header h2,
  .funnel-panel .panel-header h2,
  .product-rank-panel .panel-header h2,
  .category-panel .panel-header h2,
  .product-structure-panel .panel-header h2,
  .behavior-panel .panel-header h2 { font-size: 14px; }
  .panel-no { margin-right: 7px; font-size: 9px; }
  .panel-unit,
  .category-panel .panel-unit,
  .behavior-panel .panel-unit { font-size: 9px; }
  .product-structure-panel .panel-unit { font-size: 11px; }

  .trend-panel { grid-template-rows: 42px minmax(0, 1fr); }
  .revenue-zone { grid-template-rows: 65px minmax(150px, 1fr); }
  .chart-highlight { padding: 9px 14px 8px; }
  .chart-highlight div { padding-inline: 9px; }
  .chart-highlight span { font-size: 9px; }
  .chart-highlight strong { margin-top: 4px; font-size: 16px; }
  .chart-legend { gap: 14px; font-size: 12px; font-weight: 600; }
  .chart-legend span { gap: 7px; white-space: nowrap; }
  .chart-legend i { width: 24px; height: 10px; }
  .chart-legend i::before { top: 4px; height: 3px; }
  .canvas-wrap, #revenue-chart { min-height: 150px; }

  .warehouse-panel { grid-template-rows: 42px auto minmax(0, 1fr); }
  .marketing-panel { grid-template-rows: 42px 41px 88px minmax(0, 1fr); }
  .marketing-panel .marketing-tabs { margin: 7px 14px 0; }
  .marketing-panel .marketing-overview { padding-top: 7px; }
  .marketing-panel .marketing-table-wrap { margin-top: 7px; }
  .warehouse-tabs { margin: 8px 10px 3px; }
  .warehouse-tabs button { min-width: 72px; height: 28px; font-size: 12px; }
  .warehouse-panel .table-wrap { padding: 2px 10px 7px; }
  .warehouse-panel .ranking-table th { padding-block: 4px; font-size: 9px; }
  .warehouse-panel .ranking-table td { padding-block: 7px; font-size: 10px; }
  .warehouse-panel .rank-badge { width: 23px; height: 23px; font-size: 10px; }
  .warehouse-panel .panel-header h2 { font-size: 16px; }
  .warehouse-panel .panel-no { font-size: 10px; }
  .warehouse-panel .panel-unit { font-size: 11px; }
  .warehouse-tabs button { height: 30px; font-size: 14px; }
  .warehouse-panel .ranking-table th { font-size: 11px; }
  .warehouse-panel .ranking-table td { font-size: 12px; }

  .funnel-panel { grid-template-rows: 42px auto minmax(0, 1fr); }
  .funnel-overview { margin: 9px 12px 5px; font-size: 10px; }
  .funnel-overview strong { font-size: 20px; }
  .funnel-list { gap: 3px; padding: 0 12px 9px; }
  .funnel-step { grid-template-columns: 37px 1fr 60px; gap: 7px; }
  .funnel-step > span, .funnel-step > strong { font-size: 9px; }
  .funnel-bar { height: 18px; }

  .product-rank-panel { grid-template-rows: 42px auto minmax(0, 1fr); }
  .product-rank-tabs { margin: 8px 8px 5px; }
  .product-rank-tabs button { min-width: 56px; height: 28px; padding-inline: 8px; font-size: 10px; }
  .product-ranking { gap: 1px; padding: 2px 10px 7px; }
  .product-row { grid-template-columns: 23px minmax(0, 1fr) 145px; gap: 6px; }
  .product-rank { font-size: 9px; }
  .product-row:nth-child(-n+3) .product-rank { font-size: 10px; }
  .product-info > div { height: 14px; }
  .product-info span { font-size: 13px; }
  .product-info small { font-size: 7px; }
  .product-bar { height: 3px; margin-top: 2px; }
  .product-value strong { font-size: 11px; }

  .center-bottom-grid { grid-template-columns: 1fr 1fr; }
  .category-panel { grid-template-rows: 42px minmax(0, 1fr); }
  .category-content { grid-template-columns: minmax(160px, .95fr) 1.05fr; gap: 10px; padding: 6px 12px 8px; }
  .donut-chart { width: min(160px, 100%); }
  .donut-base, .donut-segment { stroke-width: 13; }
  .donut-chart strong { font-size: 14px; }
  .donut-chart span { font-size: 8px; }
  .category-legend li { grid-template-columns: 8px 1fr auto; gap: 8px; font-size: 12px; }
  .category-legend i { width: 8px; height: 8px; }
  .category-legend strong { font-size: 13px; }

  .product-structure-panel { grid-template-rows: 42px 66px minmax(0, 1fr) 40px; }
  .mini-stats { gap: 5px; padding: 7px 10px 5px; }
  .mini-stats div { padding: 4px; }
  .mini-stats span, .mini-stats small { font-size: 8px; }
  .mini-stats strong { margin: 3px 0 2px; font-size: 14px; }
  .tier-bars { gap: 3px; padding: 1px 11px 5px; }
  .tier-bars > div { grid-template-columns: 78px 1fr 34px; gap: 7px; font-size: 8px; }
  .tier-bars i { height: 6px; }
  .tier-bars strong { font-size: 9px; }
  .structure-notes { margin-inline: 11px; padding: 4px 0 5px; gap: 3px; font-size: 7px; }
  .product-structure-panel { grid-template-rows: 42px 34px minmax(0, 1fr); }
  .structure-tabs { margin: 3px 10px 3px; }
  .structure-tab { height: 28px; font-size: 12px; }
  .structure-chart { grid-template-columns: 160px 1fr; gap: 10px; padding: 3px 10px 7px; }
  .structure-donut { width: 160px; }
  .structure-legend { align-self: stretch; grid-template-rows: repeat(4, 1fr); gap: 0; }
  .structure-legend li { grid-template-columns: 8px 1fr auto; gap: 8px; padding: 0 4px; border-bottom: 1px solid var(--line-soft); font-size: 12px; }
  .structure-legend li:last-child { border-bottom: 0; }
  .structure-legend i { width: 8px; height: 8px; }
  .structure-legend strong { font-size: 13px; }

  .behavior-panel { grid-template-rows: 42px 48px 24px minmax(0, 1fr); }
  .behavior-summary { padding: 4px 8px; }
  .behavior-summary span { font-size: 10px; }
  .behavior-summary strong { margin-top: 3px; font-size: 18px; }
  .heatmap-title { padding: 3px 10px 2px; font-size: 9px; }
  .heatmap-title small { font-size: 7px; }
  .legend-key { width: 8px; height: 8px; }
  .heatmap { grid-template-columns: 34px repeat(24, minmax(2px, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)) 13px; gap: 2px; padding: 1px 10px 5px; }
  .heat-label { padding-right: 3px; font-size: 8px; }
  .heat-cell { min-height: 5px; }
  .heatmap-axis { font-size: 7px; }
}
