/* Shared styling: warm paper background, serif CJK, one accent per chapter. */
:root {
  --bg: #faf9f7;
  --bg-card: #ffffff;
  --text: #1f2320;
  --text-dim: #5b6560;
  --border: #e4e1da;
  --accent: #2f6f5e;
  --accent-soft: #e8f2ee;
  font-family: "Songti SC", "Noto Serif SC", "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161915; --bg-card: #1f231e; --text: #e8e6e0;
    --text-dim: #a3a89e; --border: #333a32; --accent-soft: #23342c;
  }
}
:root[data-theme="dark"] {
  --bg: #161915; --bg-card: #1f231e; --text: #e8e6e0;
  --text-dim: #a3a89e; --border: #333a32; --accent-soft: #23342c;
}

* { box-sizing: border-box; }
body { background: var(--bg); color: var(--text); margin: 0; line-height: 1.75; }
a { color: var(--accent); }
.page { max-width: 900px; margin: 0 auto; padding: 48px 24px 96px; }

.cover h1 { font-size: 2.1rem; margin: 0 0 8px; letter-spacing: 0.02em; }
.cover .subtitle { color: var(--text-dim); font-size: 1rem; margin: 0 0 20px; }
.back { display: inline-block; font-size: 0.85rem; color: var(--text-dim); text-decoration: none; margin-bottom: 16px; }
.back:hover { color: var(--accent); }
.scope { color: var(--text-dim); font-size: 0.9rem; margin: 24px 0 12px; }
.empty { color: var(--text-dim); padding: 32px 0; }

/* ---- theme legend on the front page ---- */
.legend { list-style: none; padding: 0; margin: 24px 0 8px; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 6px 18px; }
.legend li { font-size: 0.9rem; display: flex; align-items: baseline; gap: 7px; }
.legend em { color: var(--text-dim); font-style: normal; font-size: 0.8rem; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }

/* ---- chapter filter ---- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 8px; position: sticky;
  top: 0; background: var(--bg); padding: 10px 0; z-index: 5; }
.chip {
  --chip: var(--accent);
  font: inherit; font-size: 0.85rem; cursor: pointer;
  padding: 5px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text-dim);
}
.chip:hover { border-color: var(--chip); color: var(--chip); }
.chip.is-on { background: var(--chip); border-color: var(--chip); color: #fff; font-weight: 600; }
.chip-n { margin-left: 6px; opacity: 0.7; font-size: 0.78em; }

/* ---- listings ---- */
.year { margin: 32px 0; }
.year h2 { font-size: 1.05rem; color: var(--text-dim); font-weight: 600;
  border-bottom: 1px solid var(--border); padding-bottom: 6px; margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }

.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-top: 3px solid var(--accent); border-radius: 10px;
  padding: 16px 18px; display: flex; flex-direction: column;
}
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; background: var(--accent); color: #fff; }
.card-head time { color: var(--text-dim); font-size: 0.8rem; }
.card h3 { font-size: 1.05rem; margin: 10px 0 8px; line-height: 1.5; }
.card h3 a { text-decoration: none; color: var(--text); }
.card h3 a:hover { color: var(--accent); }
.card-counts { list-style: none; padding: 0; margin: 0 0 12px; font-size: 0.82rem;
  color: var(--text-dim); display: grid; grid-template-columns: 1fr 1fr; gap: 1px 10px; }
.card-counts li { display: flex; align-items: center; gap: 6px; }
.card-counts b { margin-left: auto; color: var(--text); font-weight: 600; }
.card-foot { margin-top: auto; display: flex; justify-content: space-between;
  align-items: center; font-size: 0.8rem; color: var(--text-dim); }
.card-foot .go { text-decoration: none; font-weight: 600; }

/* ---- a single weekly report ---- */
.report .meta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  font-size: 0.85rem; color: var(--text-dim); margin-bottom: 8px; }
.report .lede { font-size: 1.02rem; margin: 24px 0 8px; padding: 16px 20px;
  background: var(--accent-soft); border-radius: 10px; }
.report .lede p:first-child { margin-top: 0; }
.report .lede p:last-child { margin-bottom: 0; }

section.top { margin: 20px 0 8px; padding: 4px 22px 16px; border: 1px solid var(--border);
  border-left: 4px solid #c08a2e; border-radius: 10px; background: var(--bg-card); }
section.top h2 { font-size: 1.1rem; margin: 16px 0 4px; }
ol.picks { padding-left: 1.4em; margin: 8px 0; }
ol.picks li { margin: 6px 0; font-size: 0.95rem; }

.chapter { margin: 36px 0; }
.chapter[hidden] { display: none; }
.chapter > h2 { font-size: 1.3rem; margin: 0 0 4px; padding-bottom: 6px;
  border-bottom: 2px solid var(--accent); display: flex; align-items: baseline; gap: 10px; }
.chapter-n { font-size: 0.78rem; font-weight: 400; color: var(--text-dim); margin-left: auto; }
.chapter-sub { color: var(--text-dim); font-size: 0.85rem; margin: 0 0 12px; }

section.paper {
  background: var(--bg-card); border: 1px solid var(--border);
  border-left: 4px solid var(--accent); border-radius: 10px;
  padding: 4px 22px 16px; margin: 14px 0;
}
section.paper h3 { font-size: 1.08rem; margin: 16px 0 6px; line-height: 1.5; }
section.paper h3 .num { color: var(--accent); font-weight: 700; margin-right: 8px; }
/* The line right under a paper heading is the English title + heat + link. */
section.paper > p:first-of-type { margin: 4px 0 10px; font-size: 0.88rem; color: var(--text-dim); }
ul.facets { margin: 8px 0; padding-left: 1.2em; }
ul.facets li { margin: 5px 0; font-size: 0.93rem; }
blockquote { margin: 10px 0; padding: 8px 14px; color: var(--text-dim);
  border-left: 2px solid var(--border); font-size: 0.92rem; }
code { background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; font-size: 0.88em; }

.pager { display: flex; justify-content: space-between; gap: 12px; margin: 48px 0 0; font-size: 0.9rem; }
.pager a { text-decoration: none; }
.foot { margin-top: 56px; padding-top: 16px; border-top: 1px solid var(--border);
  color: var(--text-dim); font-size: 0.85rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

@media (max-width: 600px) {
  .page { padding: 32px 16px 64px; }
  .cover h1 { font-size: 1.6rem; }
  .grid { grid-template-columns: 1fr; }
  .card-counts { grid-template-columns: 1fr; }
  .pager { flex-direction: column; }
}
