:root {
  --ink: #10233f;
  --muted: #6d7a90;
  --line: #dfe7f1;
  --surface: #ffffff;
  --background: #f3f7fb;
  --blue: #1967d2;
  --cyan: #18a9c7;
  --gold: #e7a528;
  --shadow: 0 14px 35px rgba(38, 63, 99, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 0%, rgba(24, 169, 199, 0.10), transparent 28rem),
    linear-gradient(180deg, #f7faff, var(--background));
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  min-height: 100vh;
}
button, input { font: inherit; }
.shell { max-width: 1500px; margin: 0 auto; padding: 38px 42px 28px; }
.hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 7px; color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .18em; }
h1 { margin: 0; font-size: clamp(30px, 4vw, 46px); letter-spacing: -.04em; }
.subtitle { margin: 10px 0 0; color: var(--muted); }
.status { padding: 10px 14px; border: 1px solid #dce8f5; border-radius: 999px; background: rgba(255,255,255,.8); color: #41607f; font-size: 13px; white-space: nowrap; }
.status span { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: #26b779; box-shadow: 0 0 0 4px rgba(38,183,121,.12); }
.search-panel, .panel, .kpi, .mini-card, .empty-state { background: rgba(255,255,255,.96); border: 1px solid rgba(218,228,240,.95); box-shadow: var(--shadow); }
.search-panel { position: relative; padding: 22px 24px 16px; border-radius: 18px; margin-bottom: 18px; }
.search-panel label { display: block; margin-bottom: 10px; font-size: 13px; font-weight: 800; }
.filter-labels { display: grid; grid-template-columns: minmax(0, 1fr) 250px 132px; gap: 12px; }
.search-row { display: flex; gap: 12px; }
.search-box { position: relative; flex: 1; }
.category-box { position: relative; width: 250px; }
#categoryFilter { width: 100%; height: 52px; padding: 0 40px 0 14px; border: 1px solid #cfdae8; border-radius: 12px; outline: none; color: var(--ink); background: #fbfdff; }
#categoryFilter:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(25,103,210,.10); background: white; }
#categoryToggle { position: absolute; right: 8px; top: 50%; width: 34px; height: 34px; transform: translateY(-50%); border: 0; border-radius: 8px; color: #6f8197; background: transparent; cursor: pointer; font-size: 20px; }
#categoryToggle:hover { background: #edf3f9; }
.category-suggestions { position: absolute; z-index: 12; top: 58px; left: 0; right: 0; max-height: 300px; overflow: auto; padding: 7px; border: 1px solid #d9e3ef; border-radius: 12px; background: white; box-shadow: 0 18px 45px rgba(25,51,85,.18); }
.category-option { width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; text-align: left; color: var(--ink); background: transparent; cursor: pointer; }
.category-option:hover, .category-option.active { color: var(--blue); background: #eef5fd; }
.category-empty { padding: 12px; color: var(--muted); font-size: 12px; }
.search-box svg { position: absolute; left: 16px; top: 50%; width: 21px; transform: translateY(-50%); fill: none; stroke: #72849c; stroke-width: 2; }
.search-box input { width: 100%; height: 52px; padding: 0 48px; border: 1px solid #cfdae8; border-radius: 12px; outline: none; color: var(--ink); background: #fbfdff; transition: .2s; }
.search-box input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(25,103,210,.10); background: white; }
#clearSearch { position: absolute; right: 10px; top: 50%; width: 32px; height: 32px; transform: translateY(-50%); border: 0; border-radius: 50%; color: #7a889a; background: transparent; font-size: 23px; cursor: pointer; }
#clearSearch:hover { background: #edf3f9; }
.primary-button { min-width: 132px; border: 0; border-radius: 12px; color: white; background: linear-gradient(135deg, #1967d2, #1556b0); font-weight: 800; cursor: pointer; box-shadow: 0 8px 18px rgba(25,103,210,.2); }
.primary-button:hover { filter: brightness(1.06); }
.search-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; color: var(--muted); font-size: 12px; }
#filterLabel { color: #34597e; font-weight: 700; }
.suggestions { position: absolute; z-index: 10; left: 24px; right: 168px; top: 92px; max-height: 280px; overflow: auto; padding: 7px; border: 1px solid #d9e3ef; border-radius: 12px; background: white; box-shadow: 0 18px 45px rgba(25,51,85,.18); }
.suggestion { width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; text-align: left; color: var(--ink); background: transparent; cursor: pointer; }
.suggestion:hover { background: #eef5fd; }
.suggestion small { display: block; color: var(--muted); margin-top: 2px; }
.empty-state { padding: 48px 24px; margin: 22px 0; border-radius: 18px; text-align: center; }
.empty-state strong { font-size: 22px; }
.empty-state p { color: var(--muted); }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi { position: relative; min-height: 174px; padding: 22px; border-radius: 16px; overflow: hidden; }
.kpi::after { content: ""; position: absolute; right: -38px; bottom: -55px; width: 120px; height: 120px; border-radius: 50%; background: rgba(25,103,210,.035); }
.kpi-primary { color: white; border-color: transparent; background: linear-gradient(145deg, #163a69, #1766aa); }
.kpi-primary p { color: #c8dcf2 !important; }
.kpi-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 700; }
.tag { padding: 5px 9px; border-radius: 99px; color: #dff7ff; background: rgba(255,255,255,.13); font-size: 11px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.delivery { background: var(--cyan); box-shadow: 0 0 0 5px rgba(24,169,199,.12); }
.dot.storage { background: var(--gold); box-shadow: 0 0 0 5px rgba(231,165,40,.12); }
.kpi-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--blue); background: #eaf2fd; font-size: 11px; }
.kpi-value { margin-top: 25px; font-family: "Segoe UI", "Microsoft YaHei", sans-serif; font-size: clamp(30px, 3.2vw, 43px); font-weight: 750; letter-spacing: -.04em; }
.kpi-value .currency { margin-right: 3px; font-size: .48em; vertical-align: 35%; opacity: .72; }
.kpi p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.secondary-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.mini-card { display: flex; align-items: center; justify-content: space-between; padding: 17px 19px; border-radius: 13px; }
.mini-card span { color: var(--muted); font-size: 12px; }
.mini-card strong { font-size: 18px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(320px, .8fr); gap: 16px; }
.panel { border-radius: 17px; }
.panel-header { display: flex; justify-content: space-between; gap: 18px; padding: 21px 22px 0; }
.panel h2 { margin: 0; font-size: 16px; }
.panel-header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.legend { display: flex; align-items: center; gap: 15px; color: var(--muted); font-size: 11px; }
.legend span { display: flex; align-items: center; gap: 5px; }
.line { display: inline-block; width: 16px; height: 3px; border-radius: 2px; }
.line.total { background: var(--blue); }.line.delivery { background: var(--cyan); }.line.storage { background: var(--gold); }
.chart { height: 320px; padding: 10px 14px 8px; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.grid-line { stroke: #e5ebf3; stroke-width: 1; }
.axis-label { fill: #8491a3; font-size: 10px; }
.chart-line { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5; }
.chart-area { opacity: .07; }
.chart-point { stroke: white; stroke-width: 2; }
.chart-tooltip { position: fixed; z-index: 30; pointer-events: none; padding: 9px 11px; border-radius: 9px; color: white; background: #112a49; box-shadow: 0 8px 22px rgba(16,35,63,.24); font-size: 12px; transform: translate(-50%, -115%); }
.ranking { padding: 13px 22px 22px; max-height: 320px; overflow: auto; }
.rank-item { display: grid; grid-template-columns: 25px 1fr auto; gap: 10px; align-items: center; padding: 11px 0; border-bottom: 1px solid #edf1f5; }
.rank-item:last-child { border-bottom: 0; }
.rank-number { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; color: #59718d; background: #eef3f8; font-size: 11px; font-weight: 800; }
.rank-item:nth-child(-n+3) .rank-number { color: #fff; background: var(--blue); }
.rank-name { min-width: 0; font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-name small { display: block; margin-top: 3px; color: var(--muted); font-weight: 400; }
.rank-cost { font-size: 14px; font-weight: 800; }
.table-panel { margin-top: 16px; overflow: hidden; }
.table-wrap { max-height: 430px; overflow: auto; margin-top: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { position: sticky; top: 0; z-index: 2; padding: 12px 16px; text-align: left; color: #60738a; background: #f3f7fb; border-bottom: 1px solid #dae4ef; }
td { padding: 12px 16px; border-bottom: 1px solid #edf1f5; }
tbody tr:hover { background: #f8fbff; }
.number { text-align: right; font-variant-numeric: tabular-nums; }
.cost-strong { color: var(--blue); font-weight: 800; }
.no-value { color: #9aa6b6; }
footer { display: flex; justify-content: space-between; gap: 15px; padding: 22px 3px 0; color: #8491a3; font-size: 11px; }

@media (max-width: 1050px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .secondary-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 650px) {
  .shell { padding: 24px 15px; }
  .hero { display: block; }.status { display: inline-block; margin-top: 16px; }
  .filter-labels { display: block; }.filter-labels label:nth-child(2) { display: none; }
  .search-row { display: block; }.category-box { width: 100%; margin-top: 10px; }.primary-button { width: 100%; height: 48px; margin-top: 10px; }
  .suggestions { right: 24px; top: 150px; }
  .search-meta, footer { display: block; }.search-meta span, footer span { display: block; margin-top: 7px; }
  .kpi-grid, .secondary-grid { grid-template-columns: 1fr; }
  .kpi { min-height: 150px; }
  .panel-header { display: block; }.legend { margin-top: 12px; }
  .table-wrap { overflow-x: auto; } table { min-width: 760px; }
}
