:root {
  --bg: #f2f5fb;
  --panel: #ffffff;
  --panel-soft: #f8fafd;
  --line: #d9e2ee;
  --line-strong: #cad6e5;
  --ink: #1d2433;
  --muted: #738198;
  --blue: #2667ff;
  --blue-deep: #153a8a;
  --blue-soft: #edf3ff;
  --nav-bg: #1d2533;
  --nav-panel: #232d3d;
  --nav-active: #2c73ff;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #eff4fb 0%, var(--bg) 280px);
  color: var(--ink);
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: linear-gradient(180deg, #1a2230, #202c3e);
  color: white;
  padding: 28px 18px;
  border-right: 1px solid rgba(255,255,255,0.06);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, #4082ff, #2258d8);
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(38, 103, 255, 0.28);
}
.brand-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.brand-subtitle {
  margin-top: 3px;
  font-size: 12px;
  color: rgba(255,255,255,0.62);
}
.sidebar nav { display: grid; gap: 10px; }
.sidebar a {
  color: white;
  text-decoration: none;
  padding: 13px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid transparent;
  font-weight: 600;
}
.sidebar a:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.08);
}
.sidebar .nav-active {
  background: linear-gradient(135deg, #2d76ff, #1e5be2);
  border-color: rgba(115, 163, 255, 0.38);
  box-shadow: 0 14px 28px rgba(27, 92, 235, 0.22);
}
.main { padding: 30px 36px; }
.page-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 22px;
}
.header-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: end;
}
.page-header h1 { margin: 0 0 8px; font-size: 34px; letter-spacing: -0.02em; }
.page-header p { margin: 0; color: var(--muted); font-size: 14px; }
.freshness-chip {
  min-width: 230px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.86);
  box-shadow: 0 10px 24px rgba(33, 58, 102, 0.06);
}
.freshness-chip span {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.freshness-chip strong {
  display: block;
  font-size: 14px;
  line-height: 1.35;
}
.freshness-chip em {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  font-style: normal;
}
.hero-note {
  min-width: 320px;
  max-width: 460px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #1f6feb, #4f8cff);
  color: white;
  border-radius: 18px;
  box-shadow: 0 18px 36px rgba(31, 111, 235, 0.22);
}
.hero-note strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 18px;
}
.hero-note p {
  color: rgba(255,255,255,0.9);
  line-height: 1.6;
}
.hero-chip {
  display: inline-block;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
}
.actions, .search-box { display: flex; gap: 10px; flex-wrap: wrap; }
.filter-bar { margin-bottom: 18px; }
.filter-form {
  display: block;
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  grid-column: span 2;
}
.field-wide {
  grid-column: span 3;
}
.field-actions {
  justify-content: end;
}
.field span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.view-toggle {
  display: flex;
  gap: 8px;
  align-items: center;
}
.view-toggle a {
  text-decoration: none;
  color: var(--muted);
  background: rgba(255,255,255,0.74);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 15px;
  font-weight: 600;
}
.view-toggle .toggle-active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
button, input[type="file"], input[type="text"] {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  background: white;
  min-height: 44px;
  font-size: 14px;
}
select {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  background: white;
  min-width: 160px;
  min-height: 44px;
  font-size: 14px;
}
button {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(38, 103, 255, 0.2);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 18px;
}
.report-stats {
  grid-template-columns: repeat(3, minmax(0, 220px));
  justify-content: start;
  gap: 12px;
}
.stat-card, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 34px rgba(32, 55, 95, 0.06);
}
.stat-card { padding: 18px; }
.stat-card span { color: var(--muted); display: block; margin-bottom: 10px; }
.stat-card strong { font-size: 28px; }
.report-stats .stat-card {
  padding: 14px 16px;
  border-radius: 16px;
}
.report-stats .stat-card span {
  margin-bottom: 8px;
  font-size: 12px;
}
.report-stats .stat-card strong {
  font-size: 22px;
}
.panel { padding: 20px; margin-bottom: 18px; overflow: auto; background: rgba(255,255,255,0.94); }
.panel h2 { margin: 0 0 16px; font-size: 20px; }
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.panel-meta {
  font-size: 12px;
  color: var(--muted);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid #edf1f7; text-align: left; vertical-align: top; }
thead th { font-size: 13px; color: var(--muted); }
.muted { color: var(--muted); font-size: 12px; margin-top: 4px; }
.chart-note { color: var(--muted); margin-bottom: 12px; }
.chart-shell {
  position: relative;
  height: 380px;
  min-height: 380px;
  max-height: 380px;
  width: 100%;
}
.chart-shell canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}
.empty-row { color: var(--muted); text-align: center; padding: 24px 10px; }
.table-wrap { overflow-x: auto; }
.report-table {
  min-width: 1320px;
  table-layout: fixed;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.report-table .col-date { width: 112px; }
.report-table .col-plan { width: 390px; }
.report-table .col-num { width: 96px; }
.report-table th,
.report-table td {
  padding: 12px 10px;
  font-size: 13px;
  border-right: 1px solid #e6edf6;
  text-align: center;
  vertical-align: middle;
}
.report-table thead th {
  white-space: nowrap;
  background: #f6f9fd;
  color: #6d7a8f;
  font-size: 12px;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--line-strong);
}
.report-table th:last-child,
.report-table td:last-child {
  border-right: 0;
}
.report-table tbody td {
  border-bottom: 1px solid #edf2f8;
}
.report-table tbody tr:nth-child(even) {
  background: #fbfcff;
}
.report-table tbody tr:hover {
  background: #eef5ff;
}
.report-table .num {
  text-align: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.plan-cell {
  min-width: 0;
  text-align: center;
}
.primary-line,
.secondary-line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}
.primary-line {
  font-weight: 600;
}
.filter-panel {
  padding: 18px;
}
.report-card {
  background: linear-gradient(180deg, #ffffff, #f9fbfe);
}
.report-card strong {
  font-size: 20px;
}
.tag { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 12px; }
.active { background: #e8fff1; color: #18794e; }
.muted-tag { background: #f3f5f8; color: #6b778c; }
@media (max-width: 980px) {
  body { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; }
  .header-tools { width: 100%; justify-content: flex-start; }
  .hero-note { min-width: 0; width: 100%; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .report-stats { grid-template-columns: 1fr 1fr; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .field,
  .field-wide,
  .field-actions { grid-column: span 1; }
  .chart-shell {
    height: 300px;
    min-height: 300px;
    max-height: 300px;
  }
}
