:root {
  color-scheme: light;
  --ink: #25313d;
  --muted: #71808d;
  --line: #dfe6e8;
  --soft: #f4f7f7;
  --paper: #ffffff;
  --accent: #9d6673;
  --accent-soft: #f6e9ec;
  --blue: #6f8eaa;
  --blue-soft: #eaf1f6;
  --green: #6d9382;
  --green-soft: #eaf3ef;
  --amber: #a9825e;
  --amber-soft: #f7f0e8;
  --danger: #a75e66;
  --shadow: 0 12px 34px rgba(42, 55, 65, .07);
}

* { box-sizing: border-box; }
body { margin: 0; background: #f4f6f5; color: var(--ink); font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 14px; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); padding: 22px max(28px, calc((100vw - 1540px) / 2)); display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.eyebrow { margin: 0 0 3px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
h1 { margin: 0; font-size: 26px; line-height: 1.2; }
.source-meta { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.header-actions { flex: 0 0 auto; }
.upload-button { display: inline-flex; min-height: 38px; align-items: center; padding: 0 15px; border: 1px solid #c9aeb5; border-radius: 8px; background: var(--accent-soft); color: #744b55; font-weight: 700; cursor: pointer; }

main { width: min(1540px, calc(100% - 40px)); margin: 22px auto 48px; }
.filter-bar, .panel, .method-note { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.filter-bar { padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; position: sticky; top: 0; z-index: 4; }
.filter-title { display: flex; flex-direction: column; gap: 2px; }
.filter-title span, .section-note { color: var(--muted); font-size: 12px; }
.filters { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
label { color: #5a6874; display: grid; gap: 5px; font-size: 12px; font-weight: 700; }
select, input[type="date"] { min-width: 132px; height: 36px; border: 1px solid #cfd8dd; border-radius: 7px; background: #fff; color: var(--ink); padding: 0 10px; font: inherit; }
select:disabled { color: var(--muted); background: var(--soft); }
.panel { margin-top: 18px; padding: 22px; }
.heading, .table-heading, .heading-main { display: flex; align-items: center; gap: 13px; }
.table-heading { justify-content: space-between; align-items: flex-end; }
.heading h2 { margin: 0; font-size: 20px; }
.section-number { color: var(--accent); font-weight: 800; font-size: 12px; letter-spacing: .12em; }
.section-note { margin: 5px 0 0; }
.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)); gap: 10px; margin-top: 18px; }
.kpi { padding: 14px 15px; border-left: 3px solid #cdaeb5; background: #fafbfb; }
.kpi span { display: block; color: var(--muted); font-size: 12px; }
.kpi strong { display: block; margin-top: 6px; font-size: 23px; line-height: 1; font-variant-numeric: tabular-nums; }
.insights { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.insights h3 { margin: 0 0 8px; font-size: 15px; }
.insights ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; line-height: 1.65; }
.sample-note { color: var(--muted); }
.quadrant-chart, .trend-chart { margin-top: 14px; min-width: 0; overflow-x: auto; }
.quadrant-chart svg, .trend-chart svg { display: block; width: 100%; min-width: 720px; height: auto; }
svg text { fill: #65737f; font: 12px Inter, "PingFang SC", "Microsoft YaHei", sans-serif; }
.chart-frame { fill: #fbfcfc; stroke: #cfdadd; }
.grid { stroke: #e4e9eb; stroke-width: 1; }
.average { stroke: #87949e; stroke-width: 1.4; stroke-dasharray: 7 6; }
.average-label { fill: #687783; font-weight: 700; }
.axis-title { fill: var(--ink); font-weight: 700; }
.point-label { fill: var(--ink); font-weight: 800; paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.quadrant-caption { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: 12px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 4px 0 4px 72px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; color: #52616c; font-size: 12px; }
.chart-legend i { width: 18px; height: 3px; border-radius: 2px; }
.table-wrap { margin-top: 15px; overflow-x: auto; border-top: 1px solid var(--line); }
table { width: 100%; min-width: 1420px; border-collapse: collapse; table-layout: fixed; }
th, td { border-bottom: 1px solid #e6ebed; padding: 9px 8px; text-align: right; vertical-align: middle; font-variant-numeric: tabular-nums; }
thead th { position: sticky; top: 0; z-index: 2; background: #f4f7f7; color: #566570; font-size: 11px; font-weight: 800; }
thead tr:first-child th { text-align: center; border-bottom-color: #cfd9dc; }
thead th:first-child, tbody th { width: 118px; text-align: left; position: sticky; left: 0; z-index: 1; background: #fff; }
thead th:first-child { z-index: 3; background: #f4f7f7; }
tbody th { color: var(--ink); font-size: 13px; }
tbody th small { display: block; margin-top: 3px; color: var(--amber); font-size: 10px; font-weight: 700; }
td { position: relative; min-width: 86px; overflow: hidden; }
td span { position: relative; z-index: 1; }
td i { position: absolute; left: 7px; bottom: 5px; width: var(--bar); height: 3px; border-radius: 3px; background: #d5b2ba; opacity: .8; }
.total-row th, .total-row td { background: #f6f8f8; font-weight: 800; border-bottom-color: #cad4d8; }
.total-row th { z-index: 2; }
.method-note { margin-top: 18px; padding: 18px 22px; color: #64727d; line-height: 1.7; }
.method-note h2 { margin: 0 0 5px; color: var(--ink); font-size: 14px; }
.method-note p { margin: 0; }
.message { margin-bottom: 12px; padding: 11px 14px; border-radius: 8px; border: 1px solid #cbd9df; background: var(--blue-soft); }
.message.success { border-color: #b9d2c8; background: var(--green-soft); }
.message.warning { border-color: #dfc9aa; background: var(--amber-soft); }
.message.error { border-color: #ddb8bc; background: #f8e9eb; color: #8f424b; }
.empty { color: var(--muted); padding: 24px 0; text-align: center; }

@media (max-width: 1000px) {
  .topbar { align-items: flex-start; }
  .filter-bar { position: static; align-items: flex-start; }
  .kpi-grid { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
}

@media (max-width: 700px) {
  body { font-size: 13px; }
  .topbar { padding: 18px 16px; flex-direction: column; }
  main { width: calc(100% - 24px); margin-top: 12px; }
  .filter-bar, .panel, .method-note { border-radius: 9px; }
  .filter-bar, .table-heading { align-items: stretch; flex-direction: column; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; }
  .filters label:last-child { grid-column: 1 / -1; }
  select, input[type="date"] { width: 100%; min-width: 0; }
  .panel { padding: 17px 14px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi strong { font-size: 20px; }
  .quadrant-chart svg, .trend-chart svg { min-width: 680px; }
  .chart-legend { margin-left: 0; }
}
