:root {
  --bg: #F7F8FA; --surface: #FFF; --surface-alt: #F0F1F4;
  --border: #E2E4E9; --border-light: #ECEEF2;
  --text-1: #1A1E2C; --text-2: #5A6178; --text-3: #8E95A9;
  --accent: #E85D3A; --accent-soft: rgba(232,93,58,.07);
  --teal: #0EA5A0; --teal-soft: rgba(14,165,160,.07);
  --gold: #D4940A; --gold-soft: rgba(212,148,10,.08);
  --radius: 12px;
  --shadow-s: 0 1px 2px rgba(26,30,44,.04), 0 2px 8px rgba(26,30,44,.03);
  --shadow-m: 0 2px 6px rgba(26,30,44,.05), 0 8px 24px rgba(26,30,44,.06);
  --shadow-l: 0 4px 12px rgba(26,30,44,.06), 0 16px 40px rgba(26,30,44,.08);
}
@media (prefers-color-scheme: dark) { :root {
  --bg: #111318; --surface: #1C1F26; --surface-alt: #24272F;
  --border: #2E323C; --border-light: #262A33;
  --text-1: #E4E7EE; --text-2: #9BA1B4; --text-3: #636A7E;
  --accent: #F0754E; --accent-soft: rgba(240,117,78,.1);
  --teal: #2DD4BF; --teal-soft: rgba(45,212,191,.08);
  --gold: #FBBF24; --gold-soft: rgba(251,191,36,.08);
  --shadow-s: 0 1px 2px rgba(0,0,0,.2); --shadow-m: 0 2px 6px rgba(0,0,0,.2), 0 8px 24px rgba(0,0,0,.15);
  --shadow-l: 0 4px 12px rgba(0,0,0,.25), 0 16px 40px rgba(0,0,0,.2);
}}
:root[data-theme="dark"] {
  --bg: #111318; --surface: #1C1F26; --surface-alt: #24272F;
  --border: #2E323C; --border-light: #262A33;
  --text-1: #E4E7EE; --text-2: #9BA1B4; --text-3: #636A7E;
  --accent: #F0754E; --accent-soft: rgba(240,117,78,.1);
  --teal: #2DD4BF; --teal-soft: rgba(45,212,191,.08);
  --gold: #FBBF24; --gold-soft: rgba(251,191,36,.08);
  --shadow-s: 0 1px 2px rgba(0,0,0,.2); --shadow-m: 0 2px 6px rgba(0,0,0,.2), 0 8px 24px rgba(0,0,0,.15);
  --shadow-l: 0 4px 12px rgba(0,0,0,.25), 0 16px 40px rgba(0,0,0,.2);
}
:root[data-theme="light"] {
  --bg: #F7F8FA; --surface: #FFF; --surface-alt: #F0F1F4;
  --border: #E2E4E9; --border-light: #ECEEF2;
  --text-1: #1A1E2C; --text-2: #5A6178; --text-3: #8E95A9;
  --accent: #E85D3A; --accent-soft: rgba(232,93,58,.07);
  --teal: #0EA5A0; --teal-soft: rgba(14,165,160,.07);
  --gold: #D4940A; --gold-soft: rgba(212,148,10,.08);
  --shadow-s: 0 1px 2px rgba(26,30,44,.04), 0 2px 8px rgba(26,30,44,.03);
  --shadow-m: 0 2px 6px rgba(26,30,44,.05), 0 8px 24px rgba(26,30,44,.06);
  --shadow-l: 0 4px 12px rgba(26,30,44,.06), 0 16px 40px rgba(26,30,44,.08);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: var(--bg); color: var(--text-1);
  font-family: -apple-system, "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  line-height: 1.65; -webkit-font-smoothing: antialiased;
}
.page { max-width: 980px; margin: 0 auto; padding: 48px 28px 80px; }

/* ── Header ── */
.header { margin-bottom: 44px; }
.header-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.header-logo { height: 28px; width: auto; }
.eyebrow {
  display: inline-block; font-size: 11px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft);
  padding: 4px 10px; border-radius: 5px;
}
.header h1 {
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: 32px; font-weight: 700; line-height: 1.25;
  letter-spacing: -.01em; text-wrap: balance;
}
.subtitle { font-size: 15px; color: var(--text-2); margin-top: 6px; }

/* ── Stats ── */
.stats {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 10px;
  margin-bottom: 40px;
}
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2,1fr); } }
.stat {
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-s);
}
.stat-label {
  font-size: 11px; font-weight: 600; color: var(--text-3);
  letter-spacing: .06em; text-transform: uppercase;
}
.stat-val {
  font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums;
  line-height: 1.2; margin-top: 2px;
}
.stat-val .u { font-size: 13px; font-weight: 500; color: var(--text-3); margin-left: 2px; }

/* ── Sections ── */
.section { margin-bottom: 44px; }
.section-title {
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: 20px; font-weight: 700; margin-bottom: 18px;
}

/* ── Word cloud ── */
.cloud-container {
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: var(--radius); box-shadow: var(--shadow-m);
  overflow: hidden;
}
#wordcloud { width: 100%; height: 460px; display: block; }
@media (max-width: 640px) { #wordcloud { height: 300px; } }

/* ── Top 10 masonry cards ── */
.top-list { columns: 2; column-gap: 16px; }
@media (max-width: 680px) { .top-list { columns: 1; } }
.top-card {
  break-inside: avoid; margin-bottom: 16px;
  display: block; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border-light);
  box-shadow: var(--shadow-s); text-decoration: none; color: inherit;
  transition: transform .2s ease, box-shadow .2s ease;
  overflow: hidden;
}
.top-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-l); }
.top-card-stripe {
  height: 3px; background: var(--border-light);
}
.rank-1 .top-card-stripe {
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #F59E0B);
}
.rank-2 .top-card-stripe {
  height: 4px;
  background: linear-gradient(90deg, var(--gold), #EAB308);
}
.rank-3 .top-card-stripe {
  height: 4px;
  background: linear-gradient(90deg, var(--teal), #06B6D4);
}
.top-card-inner { padding: 20px 22px 18px; }
.top-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.top-avatar {
  width: 22px; height: 22px; border-radius: 50%; object-fit: cover;
  background: var(--surface-alt); flex-shrink: 0;
}
.top-author { font-size: 13px; font-weight: 600; color: var(--text-2); }
.top-date {
  font-size: 11px; color: var(--text-3); margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.top-title {
  font-size: 16px; font-weight: 700; color: var(--text-1);
  line-height: 1.5; margin-bottom: 10px;
}
.top-card:hover .top-title { color: var(--accent); }
.top-content {
  font-size: 13.5px; color: var(--text-2); line-height: 1.7;
  margin-bottom: 16px; word-break: break-word;
}
.top-foot { display: flex; gap: 8px; }
.top-badge {
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
  padding: 3px 10px; border-radius: 6px;
}
.top-badge.up { color: var(--accent); background: var(--accent-soft); }
.top-badge.fl { color: var(--teal); background: var(--teal-soft); }

/* ── Table ── */
.controls { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.search {
  font-size: 13px; padding: 7px 14px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-1); outline: none; width: 220px;
  transition: border-color .15s, box-shadow .15s;
}
.search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search::placeholder { color: var(--text-3); }
.btn-group { display: flex; gap: 4px; }
.btn {
  font-size: 12px; padding: 6px 14px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); cursor: pointer; font-weight: 600;
  transition: all .15s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.table-wrap {
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: var(--radius); box-shadow: var(--shadow-s); overflow-x: auto;
}
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; padding: 12px 16px; font-weight: 700; font-size: 11px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--text-3);
  border-bottom: 1px solid var(--border); background: var(--surface-alt);
  position: sticky; top: 0; white-space: nowrap;
}
.table td {
  padding: 11px 16px; border-bottom: 1px solid var(--border-light); vertical-align: top;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--surface-alt); }
.r { text-align: right; }
.post-t {
  font-weight: 500; max-width: 340px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; cursor: pointer; color: var(--text-1);
}
.post-t:hover { color: var(--accent); }
.post-a {
  color: var(--text-2); white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.post-av {
  width: 18px; height: 18px; border-radius: 50%; object-fit: cover;
  background: var(--surface-alt); flex-shrink: 0;
}
.post-d { color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.post-n { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── Tooltip ── */
.tip {
  position: fixed; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px; font-size: 13px; box-shadow: var(--shadow-m);
  pointer-events: none; z-index: 100; max-width: 240px; opacity: 0;
  transition: opacity .15s; color: var(--text-1);
}
.tip.show { opacity: 1; }
.tip-word { font-weight: 700; font-size: 16px; }
.tip-count { color: var(--text-2); font-variant-numeric: tabular-nums; margin-top: 1px; }

.footer {
  text-align: center; padding-top: 28px;
  font-size: 12px; color: var(--text-3); letter-spacing: .02em;
}
