:root {
  --bg: #f7f3ea;
  --card: #fffdf8;
  --ink: #2b2620;
  --muted: #7a6f60;
  --line: #e6dccb;
  --accent: #9b2c1f;
  --accent-soft: #f3e3d9;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1916; --card: #24211d; --ink: #ece4d6; --muted: #a39887;
    --line: #3a352e; --accent: #e08a6d; --accent-soft: #3a2a23;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.8 "Songti SC", "Noto Serif SC", "Source Han Serif SC", STSong, SimSun, serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

.top { border-bottom: 1px solid var(--line); background: var(--card); }
.top .wrap { padding-top: 12px; padding-bottom: 12px; }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { font-size: 20px; font-weight: 700; color: var(--ink); letter-spacing: 2px; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 16px; font-size: 15px; }
.nav a { color: var(--ink); }
.nav a:hover { color: var(--accent); text-decoration: none; }

h1 { font-size: 28px; line-height: 1.4; margin: 20px 0 6px; letter-spacing: 1px; }
h2 { font-size: 20px; margin: 32px 0 10px; padding-left: 10px; border-left: 4px solid var(--accent); }
.lead, .byline { color: var(--muted); margin: 4px 0 16px; }
.crumb { font-size: 14px; color: var(--muted); margin-top: 14px; }

.stage h2 { margin-top: 28px; }
.grade-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.grade-grid a { display: flex; justify-content: space-between; align-items: baseline; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; color: var(--ink); }
.grade-grid a:hover { border-color: var(--accent); text-decoration: none; }
.grade-grid span { font-size: 13px; color: var(--muted); }

.poem-list { list-style: none; padding: 0; margin: 0; counter-reset: n; }
.poem-list li { counter-increment: n; border-bottom: 1px solid var(--line); }
.poem-list a { display: block; padding: 12px 0 12px 2.2em; position: relative; color: var(--ink); }
.poem-list a::before { content: counter(n); position: absolute; left: 0; width: 1.6em; text-align: right; color: var(--muted); font-size: 14px; top: 15px; }
.poem-list a:hover { text-decoration: none; }
.poem-list a:hover .t { color: var(--accent); }
.poem-list .t { font-weight: 700; margin-right: 8px; }
.poem-list .a { color: var(--muted); font-size: 14px; }
.poem-list .badge { margin-left: 8px; font-size: 12px; color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 1px 6px; vertical-align: 2px; }
.poem-list .h { display: block; color: var(--muted); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.poem h1 { text-align: center; margin-top: 24px; }
.poem .byline { text-align: center; }
.tags { text-align: center; font-size: 14px; color: var(--muted); }
.tags a { margin: 0 4px; }
.text { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px 16px; margin: 18px 0; text-align: center; font-size: 19px; line-height: 2.1; }
.text p { margin: 0; }
.notes { padding-left: 0; list-style: none; font-size: 15px; color: var(--ink); }
.notes li { margin: 4px 0; }
.poem section p { margin: 8px 0; text-indent: 0; }

.pager { display: flex; justify-content: space-between; gap: 12px; margin: 28px 0; font-size: 15px; }
.related ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.related li a { display: inline-block; padding: 4px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; font-size: 15px; }

.cta { margin-top: 36px; }
.cta { background: var(--accent-soft); border-radius: 10px; padding: 16px; max-width: 728px; }
.cta p { margin: 4px 0; }
.cta-title { font-weight: 700; font-size: 18px; }
.cta-links a { display: inline-block; margin: 8px 10px 0 0; padding: 6px 14px; background: var(--accent); color: #fff; border-radius: 6px; font-size: 15px; }
.cta-links a:hover { text-decoration: none; opacity: .9; }
@media (max-width: 760px) { .cta { margin-left: 16px; margin-right: 16px; } }

.foot { margin-top: 32px; padding: 20px 0 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; text-align: center; }
.foot p { margin: 4px 0; }
.foot a { color: var(--muted); }

.hero { text-align: center; padding: 28px 0 8px; }
.hero h1 { font-size: 34px; letter-spacing: 6px; margin: 0; }
.sub { color: var(--muted); font-size: 15px; margin: 4px 0 12px; }
.stage-row { display: flex; gap: 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.stage-name { flex: none; width: 2.6em; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 15px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.tabs a { padding: 2px 10px; border: 1px solid var(--line); border-radius: 14px; font-size: 14px; color: var(--ink); background: var(--card); }
.tabs a.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tabs a:hover { text-decoration: none; border-color: var(--accent); }
.pages { display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 0; }
.pages a, .pages span { min-width: 2.2em; text-align: center; padding: 2px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; }
.pages span { background: var(--accent); color: #fff; border-color: var(--accent); }
.related small { color: var(--muted); font-size: 12px; }
.foot-links a { margin: 0 8px; }
