:root {
  color-scheme: light;
  --bg: #f7f8f5;
  --panel: #fff;
  --ink: #172822;
  --muted: #596760;
  --edge: #e0e7e0;
  --green: #17684e;
  --green-soft: #e9f4ee;
  --negative: #a24940;
  font: 15px/1.5 system-ui, -apple-system, "PingFang SC", "Microsoft Yahei", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: default; opacity: .62; }
button:focus-visible, select:focus-visible, canvas:focus-visible, a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}
[hidden] { display: none !important; }
a { color: var(--green); text-underline-offset: 3px; }
p, h1, h2 { margin: 0; }
.shell { width: min(1160px, calc(100% - 64px)); margin-inline: auto; }
.topbar { background: var(--panel); border-bottom: 1px solid var(--edge); }
.topbar-inner { min-height: 62px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.source-brand { display: flex; align-items: center; gap: 10px; font-weight: 650; white-space: nowrap; }
.brand-icon { background: var(--green); width: 29px; height: 29px; border-radius: 8px; display: flex; align-items: end; justify-content: center; padding-bottom: 7px; gap: 3px; }
.brand-icon span { width: 3px; height: 6px; background: #fff; border-radius: 2px; }
.brand-icon span:nth-child(2) { height: 10px; }
.brand-icon span:nth-child(3) { height: 14px; }
.update-controls, .status { display: flex; align-items: center; gap: 12px; }
.status { gap: 7px; color: var(--muted); font-size: .82rem; }
.status-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 100%; background: #558b74; }
.status[data-state="warn"] .status-dot { background: #aa6f29; }
.refresh { border: 1px solid var(--edge); background: var(--panel); border-radius: 8px; padding: 7px 12px; font-size: .82rem; white-space: nowrap; }
.refresh:hover:not(:disabled) { border-color: #9ebbab; }
.refresh span { margin-right: 3px; font-size: 1rem; }

.page-heading { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin: 32px 0 23px; }
.coverage { display: flex; align-items: center; gap: 9px; color: var(--green); font-size: .86rem; font-weight: 600; margin-bottom: 6px; }
.separator { color: #8ca596; font-weight: 400; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.52rem); font-weight: 720; letter-spacing: -.04em; line-height: 1.25; }
h2 { font-size: 1.13rem; font-weight: 670; }
.product-field { display: grid; gap: 5px; width: min(225px, 40%); color: var(--muted); font-size: .83rem; font-weight: 600; }
.product-field select { width: 100%; border: 1px solid var(--edge); border-radius: 8px; padding: 9px 10px; background: var(--panel); color: var(--ink); font-size: .96rem; }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.metric, .panel { background: var(--panel); border: 1px solid var(--edge); border-radius: 13px; }
.metric { padding: 16px 18px; min-width: 0; }
.metric-label { color: var(--muted); font-size: .88rem; font-weight: 570; }
.metric-value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin: 5px 0 2px; font-variant-numeric: tabular-nums; }
.metric-value strong { font-size: clamp(1.34rem, 3.6vw, 2rem); letter-spacing: -.055em; line-height: 1.25; }
.metric-value span, .metric-note, .muted { color: var(--muted); font-size: .81rem; }
.metric-note { margin-top: 4px; }
.positive { color: var(--green); }
.negative { color: var(--negative); }

.panel { padding: 20px 22px; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 13px; }
.panel-heading .muted { margin-top: 3px; }
.ranges, .chart-mode { display: inline-flex; gap: 2px; padding: 3px; background: var(--bg); border-radius: 8px; }
.ranges button, .chart-mode button { background: transparent; border: 1px solid transparent; border-radius: 6px; color: var(--muted); padding: 5px 9px; font-size: .83rem; white-space: nowrap; }
.ranges button[aria-pressed="true"] { color: var(--ink); background: var(--panel); border-color: var(--edge); font-weight: 600; }
.chart-mode { background: transparent; padding: 0; gap: 4px; }
.chart-mode button[aria-pressed="true"] { background: var(--green-soft); color: var(--green); font-weight: 650; }
.chart-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 15px; gap: 8px; }
.chart-unit { white-space: nowrap; }
.chart-wrap { position: relative; height: clamp(260px, 34vw, 360px); margin-top: 3px; }
#trend { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.tooltip { pointer-events: none; position: absolute; z-index: 1; top: 12px; min-width: 150px; display: grid; gap: 4px; padding: 9px 11px; background: var(--panel); border: 1px solid var(--edge); border-radius: 8px; box-shadow: 0 5px 22px #10281d12; color: var(--muted); font-size: .8rem; }
.tooltip strong { color: var(--ink); font-size: .94rem; }

.report-panel { margin-top: 16px; }
.report-panel table { border-collapse: collapse; width: 100%; margin-top: 13px; font-variant-numeric: tabular-nums; }
.report-panel th, .report-panel td { padding: 9px 8px; border-bottom: 1px solid var(--edge); text-align: right; }
.report-panel th:first-child, .report-panel td:first-child { text-align: left; padding-left: 0; }
.report-panel th { color: var(--muted); font-size: .82rem; font-weight: 590; }
.report-panel tbody tr:last-child td { border-bottom: 0; }
footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 20px; padding: 17px 0 30px; color: var(--muted); font-size: .8rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 680px) {
  .shell { width: calc(100% - 28px); }
  .page-heading { margin-top: 24px; gap: 12px; }
  .topbar-inner { min-height: 55px; }
  .metrics { gap: 6px; }
  .metric { padding: 10px 8px; }
  .metric-label, .metric-note { font-size: .72rem; }
  .metric-value { gap: 3px; }
  .metric-value strong { font-size: clamp(1.05rem, 4.2vw, 1.45rem); }
  .metric-value span { font-size: .72rem; }
  .panel { padding: 14px 11px; }
  .panel-heading { flex-wrap: wrap; }
  .ranges button { padding: 5px 8px; }
  .update-controls { gap: 6px; }
  .status { font-size: .72rem; }
  .refresh { padding: 6px 8px; }
}
