:root {
  --bg: #fdfcfa; --fg: #222; --muted: #6b6b6b; --accent: #b0412e; --rule: #e4e0d8;
  --code-bg: #f2efe9; --star: #c98a00;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #18191b; --fg: #e4e2de; --muted: #9a9894; --accent: #e8836f; --rule: #33353a;
    --code-bg: #24262a; --star: #f0b429; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #18191b; --fg: #e4e2de; --muted: #9a9894; --accent: #e8836f; --rule: #33353a;
  --code-bg: #24262a; --star: #f0b429; color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 18px/1.6 Georgia, "Iowan Old Style", serif;
}
.site-header, main, .site-footer { max-width: 42rem; margin: 0 auto; padding: 0 16px; }
.site-header { padding-top: 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--rule); }
.site-title { font-size: 1.6rem; font-weight: bold; color: var(--fg); text-decoration: none; display: block; }
.site-desc { color: var(--muted); font-style: italic; }
.site-header nav { margin-top: .5rem; font-family: system-ui, sans-serif; font-size: .9rem; }
.site-header nav a { margin-right: 1rem; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; }
.meta, .tags, .count, .archive time, .prevnext, .site-footer { color: var(--muted); font-family: system-ui, sans-serif; font-size: .85rem; }
.summary { border-bottom: 1px solid var(--rule); padding-bottom: 1rem; }
.summary h2 a { color: var(--fg); text-decoration: none; }
.content img { max-width: 100%; height: auto; }
.content iframe { max-width: 100%; aspect-ratio: 16 / 9; height: auto; width: 100%; border: 0; }
.content table { border-collapse: collapse; max-width: 100%; display: block; overflow-x: auto; }
.content td, .content th { border: 1px solid var(--rule); padding: .3rem .5rem; vertical-align: top; }
.content pre, .content code { background: var(--code-bg); }
.content pre { padding: .75rem; overflow-x: auto; }
.rating { color: var(--star); font-size: 1.3rem; letter-spacing: .1em; }
.spoiler { border: 1px dashed var(--rule); padding: .5rem 1rem; margin: 1rem 0; }
.spoiler summary { cursor: pointer; font-family: system-ui, sans-serif; color: var(--muted); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.gallery img { width: 100%; height: auto; display: block; }
ul.archive, ul.terms { list-style: none; padding: 0; }
ul.archive time { display: inline-block; min-width: 4rem; }
.prevnext { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; }
.pagination { list-style: none; display: flex; gap: .5rem; padding: 0; font-family: system-ui, sans-serif; }
.pagination .active a { color: var(--fg); font-weight: bold; }
.pagination .disabled a { color: var(--muted); pointer-events: none; }
.site-footer { margin-top: 3rem; padding-top: 1rem; padding-bottom: 2rem; border-top: 1px solid var(--rule); }
