:root {
  --ink: #14202a;
  --muted: #65717b;
  --line: #dce2e5;
  --page: #f8f8f5;
  --surface: #ffffff;
  --teal: #1c766d;
  --teal-dark: #14564f;
  --warm: #d9744f;
  --font: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  letter-spacing: 0;
}

button, select { font: inherit; letter-spacing: 0; }

.page-shell { width: min(1040px, calc(100% - 48px)); margin: 0 auto; padding: 68px 0 90px; }

.page-header { display: flex; justify-content: space-between; align-items: end; gap: 28px; padding-bottom: 26px; border-bottom: 2px solid var(--ink); }
.eyebrow, .section-kicker { margin: 0; color: var(--teal); font-size: 11px; font-weight: 700; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 34px; line-height: 1.22; font-weight: 700; }

.toolbar { display: flex; align-items: end; gap: 10px; }
.month-picker { display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
.month-picker select { width: 148px; height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink); cursor: pointer; }
#export-button { height: 38px; padding: 0 15px; border: 0; border-radius: 4px; background: var(--teal); color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; }
#export-button:hover { background: var(--teal-dark); }

.window-label { margin: 15px 0 46px; color: var(--muted); font-size: 13px; }
.content-section { padding: 0 0 42px; }
.section-heading { display: flex; align-items: baseline; gap: 13px; margin-bottom: 14px; }
.section-heading h2 { margin-bottom: 0; font-size: 21px; line-height: 1.25; font-weight: 700; }
.topic-list, .etf-list { background: var(--surface); border: 1px solid var(--line); }
.topic-row, .etf-row { display: grid; align-items: start; gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.topic-row:last-child, .etf-row:last-child { border-bottom: 0; }
.topic-row { grid-template-columns: 38px minmax(0, 1fr); }
.etf-row { grid-template-columns: 38px minmax(0, 1fr) minmax(180px, .8fr); }
.rank { width: 30px; height: 30px; display: grid; place-items: center; background: #e8f2ef; color: var(--teal-dark); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.topic-row h3, .etf-row h3 { margin-bottom: 6px; font-size: 16px; line-height: 1.42; font-weight: 700; }
.topic-row p, .etf-row p { margin-bottom: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.topic-link { padding-top: 3px; color: var(--warm); font-size: 13px; line-height: 1.5; text-align: right; }
.empty-state { padding: 36px 20px; margin: 0; color: var(--muted); font-size: 14px; text-align: center; }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: min(360px, calc(100% - 48px)); padding: 12px 14px; background: var(--ink); color: #fff; border-radius: 4px; font-size: 13px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .18s, transform .18s; }
.toast.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 720px) {
  .page-shell { width: min(100% - 32px, 1040px); padding-top: 34px; }
  .page-header { align-items: start; flex-direction: column; gap: 22px; }
  h1 { font-size: 28px; }
  .toolbar { width: 100%; }
  .month-picker { flex: 1; }
  .month-picker select { width: 100%; }
  #export-button { flex: 0 0 auto; }
  .window-label { margin-bottom: 32px; }
  .etf-row { grid-template-columns: 34px minmax(0, 1fr); gap: 12px; }
  .topic-link { grid-column: 2; padding-top: 0; text-align: left; }
}
