:root {
  --bg: #fbfaf7; --fg: #1d1d1b; --muted: #6b6b66; --line: #e2dfd6; --accent: #7a1f1f;
  --tag-bg: #eee9dd; --ins: #d9f2d9; --del: #f7d9d9; --bar: #7a1f1f; --ok: #2f7a2f; --warn: #b3541e;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #17171a; --fg: #e8e6e1; --muted: #9a9892; --line: #33333a; --accent: #d98484;
    --tag-bg: #2a2a30; --ins: #1f3d1f; --del: #4a1f1f; --bar: #c46a6a; --ok: #6fbf6f; --warn: #e0894a; }
}
* { box-sizing: border-box; }
html { color-scheme: light dark; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
header { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; align-items: baseline; padding: 0.9rem 1.2rem; border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; text-decoration: none; color: var(--fg); font-size: 1.1rem; }
.brand span { color: var(--muted); font-weight: 400; }
nav a { margin-right: 1rem; text-decoration: none; }
nav a[aria-current] { font-weight: 600; border-bottom: 2px solid var(--accent); }
main { max-width: 72rem; margin: 0 auto; padding: 1rem 1.2rem 2rem; }
footer { max-width: 72rem; margin: 0 auto; padding: 1rem 1.2rem 2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; }
footer code { font-size: 0.9em; }
h1 { font-size: 1.5rem; line-height: 1.25; margin: 0.4rem 0 0.6rem; }
h2 { font-size: 1.1rem; margin: 1.6rem 0 0.5rem; }
h2 small { color: var(--muted); font-weight: 400; font-size: 0.8rem; margin-left: 0.4rem; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.search { display: flex; gap: 0.5rem; margin: 0.3rem 0 1rem; }
.search input { flex: 1; max-width: 24rem; padding: 0.4rem 0.6rem; border: 1px solid var(--line); border-radius: 4px; background: transparent; color: var(--fg); font: inherit; }
.search button { padding: 0.4rem 0.8rem; border: 1px solid var(--line); border-radius: 4px; background: var(--tag-bg); color: var(--fg); font: inherit; cursor: pointer; }
.filter { margin: 0 0 0.8rem; }
.tablewrap { overflow-x: auto; }
table.articles { width: 100%; border-collapse: collapse; }
table.articles th { text-align: left; font-weight: 600; font-size: 0.8rem; color: var(--muted); padding: 0.3rem 0.5rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.articles th small { font-weight: 400; }
table.articles td { padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
td.when, td.date { white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 0.9rem; }
td.date { color: var(--muted); }
td.title a { text-decoration: none; color: var(--fg); }
td.title a:hover { text-decoration: underline; }
td.orig a { text-decoration: none; }
.unknown { color: var(--muted); }
.tag { display: inline-block; background: var(--tag-bg); color: var(--fg); text-decoration: none; padding: 0 0.45rem; border-radius: 3px; font-size: 0.8rem; margin: 0.1rem 0; }
.tag:hover { background: var(--line); }
.badge { display: inline-block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); border: 1px solid var(--accent); border-radius: 3px; padding: 0 0.3rem; vertical-align: middle; }
.pager { display: flex; justify-content: space-between; margin-top: 1rem; color: var(--muted); }
.empty { color: var(--muted); }
.detail .orig { margin: 0 0 1rem; }
dl.meta { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; margin: 0 0 1rem; }
dl.meta dt { color: var(--muted); }
dl.meta dd { margin: 0; }
ul.plain { list-style: none; margin: 0; padding: 0; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 2px solid var(--line); }
.timeline li { position: relative; margin: 0 0 1rem; padding-left: 0.6rem; }
.timeline li::before { content: ""; position: absolute; left: -1.45rem; top: 0.5rem; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--line); }
.timeline li.v-page::before { background: var(--accent); }
.v-head time { font-variant-numeric: tabular-nums; }
.src { display: inline-block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 0 0.3rem; margin: 0 0.3rem; }
.retitle { margin: 0.3rem 0; }
.diff { white-space: pre-wrap; margin: 0.4rem 0 0; padding: 0.6rem 0.8rem; border: 1px solid var(--line); border-radius: 4px; font-size: 0.92rem; }
.diff ins, .retitle ins { background: var(--ins); text-decoration: none; }
.diff del, .retitle del { background: var(--del); }
.diff .skip { color: var(--muted); font-style: italic; }
ul.taglist { list-style: none; padding: 0; margin: 0; columns: 3 14rem; }
ul.taglist li { margin: 0.2rem 0; break-inside: avoid; }
ul.taglist .count { color: var(--muted); font-size: 0.85rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0.8rem; margin: 0.5rem 0 1rem; }
.card { border: 1px solid var(--line); border-radius: 6px; padding: 0.7rem 0.9rem; font-size: 0.9rem; }
.card b { display: block; font-size: 1.6rem; line-height: 1.2; }
.card small { display: block; color: var(--muted); }
.card.ok b { color: var(--ok); }
.card.warn b { color: var(--warn); }
svg.chart { width: 100%; height: auto; max-height: 220px; display: block; }
svg.chart rect { fill: var(--bar); }
svg.chart rect:hover { opacity: 0.7; }
svg.chart text { fill: var(--muted); font-size: 11px; }
ol.bars { list-style: none; padding: 0; margin: 0; max-width: 40rem; }
ol.bars li { display: grid; grid-template-columns: 14rem 1fr; gap: 0.6rem; align-items: center; margin: 0.2rem 0; font-size: 0.9rem; }
ol.bars .label { text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
ol.bars .bar { display: block; height: 0.9rem; background: var(--bar); border-radius: 2px; min-width: 2px; }
@media (max-width: 600px) {
  dl.meta { grid-template-columns: 1fr; gap: 0 0; }
  dl.meta dt { margin-top: 0.4rem; }
  ol.bars li { grid-template-columns: 8rem 1fr; }
}
