:root {
  --page-bg: #f3f6f8;
  --panel-bg: #ffffff;
  --ink: #111827;
  --muted: #5f6b7a;
  --line: #dbe2e8;
  --teal: #0f766e;
  --amber: #e39a20;
  --green: #0f766e;
  --red: #b42318;
  --shadow: 0 10px 26px rgba(17, 24, 39, 0.07);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html,
body {
  margin: 0;
  background: var(--page-bg);
  color: var(--ink);
  font-family:
    "Segoe UI", "Avenir Next", "Helvetica Neue", "Microsoft YaHei", sans-serif;
}

.page {
  width: min(1500px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 16px 0 22px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.overline {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.15;
}

h2 {
  font-size: 20px;
  line-height: 1.2;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-text {
  color: var(--muted);
  font-size: 13px;
}

.refresh-button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-bg);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.refresh-button:hover {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.08);
}

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

.summary-card,
.panel {
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.summary-card {
  min-height: 108px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.summary-label {
  font-size: 14px;
  color: var(--muted);
}

.summary-value {
  font-size: 22px;
  line-height: 1.12;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.summary-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

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

.trend-wrap {
  padding: 12px;
}

.trend-svg {
  width: 100%;
  height: 210px;
  display: block;
}

.trend-axis {
  stroke: #d8dee5;
  stroke-width: 1;
}

.trend-line {
  fill: none;
  stroke: var(--amber);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.trend-value {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr);
  gap: 12px;
  align-items: start;
}

.panel {
  overflow: hidden;
}

.chart-panel {
  position: sticky;
  top: 12px;
}

.panel-head {
  min-height: 54px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-head span {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.table-wrap {
  overflow: auto;
  max-height: 72vh;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  font-size: 14px;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 2;
}

tbody tr:hover {
  background: #f9fbfc;
}

td strong {
  display: block;
  margin-bottom: 2px;
}

td small {
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.14);
  color: var(--green);
  font-weight: 700;
  font-size: 12px;
}

.pill.error {
  background: rgba(180, 35, 24, 0.14);
  color: var(--red);
}

.chart-list {
  padding: 10px;
  display: grid;
  gap: 10px;
  max-height: 72vh;
  overflow: auto;
}

.chart-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfa;
}

.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.chart-head strong {
  color: var(--ink);
  font-size: 16px;
}

svg {
  display: block;
  width: 100%;
  height: 120px;
}

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

.line {
  fill: none;
  stroke: var(--amber);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty {
  padding: 18px 14px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 1320px) {
  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1120px) {
  .global-charts-grid,
  .layout-grid {
    grid-template-columns: 1fr;
  }

  .chart-panel {
    position: static;
  }
}

@media (max-width: 860px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
  }

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

  h1 {
    font-size: 28px;
  }

  .summary-value {
    font-size: 20px;
  }

  .table-wrap,
  .chart-list {
    max-height: none;
  }
}

@media (max-width: 560px) {
  .page {
    width: min(100vw - 14px, 1420px);
    padding-top: 10px;
  }

  th,
  td {
    padding: 10px 12px;
    font-size: 13px;
  }
}
