/* One warm, printed-poster look to match the reference chart. Single theme by choice. */
:root {
  --bg: #FAF5E6;
  --surface: #FFFCF3;
  --line: #EDE1C4;
  --ink: #4A3B2A;
  --muted: #9A8468;
  --gold: #E8A93A;
  --blue: #B9CCD8;
  --red: #C8322F;
  --orange: #E97A3B;
  --orange-rim: #F2B35C;
  --serif: "Noto Serif SC", "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}
.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding-inline: 16px;
  padding-block: calc(24px + env(safe-area-inset-top, 0px)) calc(40px + env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: 20px;
}

.head { display: grid; justify-items: center; gap: 10px; text-align: center; }
.pill-title {
  margin: 0;
  padding: 10px 40px;
  background: var(--orange);
  color: #FFF8EC;
  border: 4px solid var(--orange-rim);
  border-radius: 999px;
  font-size: clamp(1.5rem, 4.5vw, 2.2rem);
  font-weight: 700;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
}
.sub { margin: 0; color: var(--muted); font-size: 0.9rem; text-wrap: balance; }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  display: grid;
  gap: 2px;
  min-width: 0;
}
.card-label { margin: 0; font-size: 0.78rem; font-weight: 600; color: var(--muted); letter-spacing: 0.08em; }
.card-value {
  margin: 0;
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.card:first-child .card-value { color: var(--red); }
.card-sub { margin: 0; font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.card-sub .up { color: var(--red); }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  display: grid;
  gap: 10px;
  min-width: 0;
}
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; font-size: 0.9rem; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.sw { display: inline-block; width: 16px; height: 16px; border-radius: 4px; }
.sw-pm { background: var(--gold); }
.sw-am { background: var(--blue); }
.sw-line { width: 22px; height: 3px; border-radius: 2px; background: var(--red); }
.chart { width: 100%; height: 520px; }
.note { margin: 0; text-align: center; color: var(--muted); font-size: 0.82rem; text-wrap: balance; }

.table-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-title { margin: 0; font-size: 1.05rem; font-weight: 700; }
.count { color: var(--muted); font-size: 0.82rem; }
.table-box { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { font-size: 0.78rem; font-weight: 600; color: var(--muted); letter-spacing: 0.06em; }
tbody tr:last-child td { border-bottom: 0; }
td.delta { color: var(--red); }
td .gap { color: var(--muted); font-size: 0.78rem; margin-left: 6px; }
td .tag {
  display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: 999px;
  font-size: 0.72rem; color: #FFF8EC; background: var(--orange); vertical-align: 1px;
}
td .tag.red { background: var(--red); }
td.empty { text-align: center; color: var(--muted); padding: 24px; }
.more {
  justify-self: center;
  font: inherit; font-size: 0.88rem;
  padding: 6px 18px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer;
}
.more:hover { border-color: var(--muted); }
.more:focus-visible, a:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; color: var(--muted); font-size: 0.82rem; }
.foot a { color: var(--ink); }

@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr; }
  .card { grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: baseline; }
  .card-label { grid-row: 1 / span 2; align-self: center; min-width: 4.5em; }
  .chart { height: 440px; }
  .panel { padding: 12px; }
  th, td { padding: 8px 6px; }
  td .gap { display: block; margin-left: 0; font-size: 0.7rem; line-height: 1.2; }
  td .tag { margin-left: 4px; padding: 0 6px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
