:root {
  color-scheme: light;
  --bg: #f3f5f7;
  --panel: #ffffff;
  --line: #d7dde5;
  --soft-line: #e8edf3;
  --text: #1d2733;
  --muted: #667085;
  --blue: #175cd3;
  --green: #047857;
  --red: #b42318;
  --amber: #a15c07;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

h1 {
  font-size: 24px;
  line-height: 1.25;
}

h2 {
  font-size: 17px;
}

h3 {
  font-size: 14px;
}

.topbar p,
.panel-head p,
.panel-head span,
.metric span {
  color: var(--muted);
  font-size: 13px;
}

.nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-links a,
button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 7px 12px;
  font: inherit;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}

.nav-links a:hover,
button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

main {
  padding: 18px 24px 30px;
}

.toolbar,
.summary-grid,
.panel,
.notice {
  margin-bottom: 14px;
}

.toolbar {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

input {
  min-width: 160px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
  font: inherit;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metric,
.panel,
.notice {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric {
  padding: 12px 14px;
}

.metric strong {
  display: block;
  margin-top: 6px;
  min-height: 26px;
  font-size: 20px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.notice {
  padding: 10px 14px;
  color: var(--amber);
  font-size: 13px;
  line-height: 1.6;
}

.notice p + p {
  margin-top: 4px;
}

.panel {
  padding: 14px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  color: var(--muted);
  text-align: left;
  font-weight: 700;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--soft-line);
  white-space: nowrap;
}

td span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  white-space: normal;
}

td strong {
  display: block;
}

tbody tr:hover {
  background: #f8fafc;
}

.empty-row {
  white-space: normal;
  line-height: 1.6;
  color: var(--muted);
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.chart-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  min-width: 0;
}

.chart-card h3 {
  margin-bottom: 8px;
}

.chart-card svg {
  display: block;
  width: 100%;
  height: auto;
  background: #fbfcfe;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
}

.axis {
  stroke: #cbd5e1;
  stroke-width: 1;
}

.axis-label {
  fill: var(--muted);
  font-size: 11px;
}

.axis-label.end {
  text-anchor: end;
}

.legend {
  display: flex;
  gap: 10px 14px;
  flex-wrap: wrap;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 5px;
}

.empty-chart {
  display: grid;
  min-height: 180px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: #fafbfc;
}

@media (max-width: 980px) {
  .topbar,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  main {
    padding: 14px;
  }

  .summary-grid,
  .chart-grid {
    grid-template-columns: 1fr;
  }

  input {
    min-width: min(220px, calc(100vw - 42px));
  }
}
