:root {
  --paper: #fcfaf6;
  --ink: #1f2224;
  --muted: #596069;
  --line: #d8d1c6;
  --accent: #0f4b4b;
  --code-bg: #f0ede7;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 5.5rem; }
body {
  margin: 0;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, #ece5d7 0%, rgba(236, 229, 215, 0) 35%),
    linear-gradient(180deg, #f7f4ef 0%, #f2eee7 100%);
  line-height: 1.72;
}
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: 0.5rem 0.75rem; z-index: 1000; }
.skip-link:focus { left: 1rem; top: 1rem; }
.site-header { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(6px); background: color-mix(in srgb, var(--paper) 88%, transparent); border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 0.9rem 1rem; display: flex; gap: 1rem; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.project-title { color: var(--ink); text-decoration: none; font-size: 1.2rem; letter-spacing: 0.06em; font-weight: 700; }
.project-subtitle { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.85rem; }
.top-nav { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.top-nav a { text-decoration: none; color: var(--ink); font-size: 0.92rem; padding: 0.25rem 0.5rem; border-radius: 999px; }
.top-nav a:hover, .top-nav a[aria-current="page"] { background: #ece7dd; }
.content-wrap { max-width: 960px; margin: 1.7rem auto 2.5rem; padding: 0 1rem; }
.content-wrap.with-toc { max-width: 1200px; display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 960px) minmax(210px, 260px); align-items: start; }
.prose { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.25rem 1.4rem; }
.anchors { border: 1px solid var(--line); background: #f4efe6; border-radius: 10px; padding: 0.8rem 0.95rem; margin-bottom: 1rem; }
.anchors h2 { margin-top: 0; }
h1, h2, h3 { line-height: 1.22; margin: 1.2em 0 0.5em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.08rem; }
p, li { font-size: 1.03rem; }
a { color: var(--accent); word-break: break-word; }
img { max-width: 100%; height: auto; border-radius: 8px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; background: var(--code-bg); border: 1px solid #e4ddd1; border-radius: 5px; padding: 0.08rem 0.3rem; font-size: 0.92em; }
pre { background: var(--code-bg); border: 1px solid #e4ddd1; border-radius: 8px; padding: 0.8rem; overflow-x: auto; }
pre code { background: transparent; border: 0; padding: 0; }
blockquote { margin: 1rem 0; border-left: 3px solid #bbb0a0; padding: 0.2rem 1rem; color: #373d44; background: #f8f4ed; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; display: block; overflow-x: auto; }
th, td { border: 1px solid var(--line); padding: 0.45rem 0.55rem; vertical-align: top; }
th { background: #f1ebe0; text-align: left; }
.toc { position: sticky; top: 5.5rem; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); padding: 0.75rem 0.85rem; }
.toc h2 { margin: 0 0 0.45rem; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.05em; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0.2rem 0; font-size: 0.94rem; }
.toc li.toc-sub { padding-left: 0.75rem; font-size: 0.9rem; }
.toc a { text-decoration: none; color: var(--muted); }
.toc a:hover { color: var(--accent); text-decoration: underline; }
.snapshot-note { padding: 0.55rem 0.75rem; border-radius: 8px; background: #fbf4e3; border: 1px solid #e8d7b6; }
.site-footer { max-width: 960px; margin: 0 auto 2.3rem; padding: 0 1rem; color: #3f464e; font-size: 0.95rem; }
.site-footer p { margin: 0.25rem 0; }
@media (max-width: 980px) { .content-wrap.with-toc { grid-template-columns: 1fr; } .toc { position: static; order: -1; } }
