:root {
  color-scheme: light dark;
  --paper: #faf9f6;
  --ink: #272725;
  --muted: #77746f;
  --soft: #96918a;
  --line: #e5e2dc;
  --code: #eeece7;
  --selection: #ded9cd;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; }
::selection { background: var(--selection); }
a { color: inherit; text-decoration: none; text-underline-offset: 4px; }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 5px; border-radius: 2px; }
button, input, textarea { font: inherit; }
.site-shell { width: min(740px, calc(100% - 64px)); min-height: 100svh; margin-inline: auto; display: flex; flex-direction: column; }
.site-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 24px; padding: 36px 0 28px; border-bottom: 1px solid var(--line); }
.site-name { font-size: 19px; font-weight: 650; letter-spacing: -.055em; overflow-wrap: anywhere; }
.site-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.site-nav a { white-space: nowrap; }
.site-nav a:hover, .back-link:hover { color: var(--ink); }
main { flex: 1; min-width: 0; }
.site-footer { display: flex; justify-content: space-between; gap: 16px; padding: 24px 0 30px; border-top: 1px solid var(--line); font-size: 11px; letter-spacing: .025em; color: var(--muted); }
.site-footer span { overflow-wrap: anywhere; }
.archive { padding: 68px 0 90px; }
.archive-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; padding-bottom: 33px; }
.archive-heading h1 { margin: 0; font-size: 31px; font-weight: 560; letter-spacing: -.055em; line-height: 1.4; }
.archive-heading h1 span { color: var(--soft); padding-left: 3px; }
.article-count { margin: 0; color: var(--muted); font-size: 12px; white-space: nowrap; }
.post-list { list-style: none; margin: 0; padding: 0; }
.post-row { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 24px; padding: 28px 0 30px; border-top: 1px solid var(--line); }
.post-date { padding-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.7; font-variant-numeric: tabular-nums; }
.post-summary { min-width: 0; }
.post-summary h2 { font-size: 20px; line-height: 1.6; letter-spacing: -.025em; font-weight: 550; margin: 0; overflow-wrap: anywhere; }
.post-summary h2 a { display: inline; }
.post-summary h2 a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.post-arrow { display: inline-block; color: var(--soft); font-size: 15px; padding-left: 11px; vertical-align: 2px; }
.post-description { margin: 9px 0 0; color: var(--muted); font-size: 14px; line-height: 1.9; overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; list-style: none; gap: 6px 14px; padding: 0; margin: 13px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.tags li { overflow-wrap: anywhere; }
.tags li::before { content: "#"; padding-right: 2px; color: var(--soft); }
.empty-state { border-top: 1px solid var(--line); padding-top: 30px; font-size: 16px; line-height: 1.9; }
.empty-state p { margin: 0 0 5px; }
.muted { color: var(--muted); font-size: 13px; }
.article { padding: 42px 0 64px; }
.back-link { color: var(--muted); font-size: 12px; line-height: 1.8; }
.back-link span { margin-right: 5px; }
.article-header { margin: 39px 0 39px; padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.article-header h1 { margin: 0; font-weight: 600; font-size: clamp(28px, 4.5vw, 39px); line-height: 1.4; letter-spacing: -.04em; overflow-wrap: anywhere; }
.article-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 11px; margin-top: 18px; color: var(--muted); font-size: 12px; line-height: 1.8; font-variant-numeric: tabular-nums; }
.meta-separator { color: var(--soft); }
.article-header .tags { margin-top: 12px; }
.prose { font-size: 17px; line-height: 1.95; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose table { margin: 0 0 1.55em; }
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { margin: 1.8em 0 .7em; font-weight: 600; letter-spacing: -.03em; line-height: 1.5; }
.prose h1 { font-size: 1.75em; }
.prose h2 { font-size: 1.4em; }
.prose h3 { font-size: 1.16em; }
.prose h4, .prose h5, .prose h6 { font-size: 1em; }
.prose strong { font-weight: 650; }
.prose a { text-decoration: underline; text-decoration-color: var(--soft); text-decoration-thickness: 1px; }
.prose a:hover { text-decoration-color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.5em; }
.prose li { margin-block: .3em; }
.prose li > ul, .prose li > ol { margin-bottom: 0; }
.prose li > p { margin-bottom: .6em; }
.prose blockquote { padding: 0 0 0 1.15em; border-left: 2px solid var(--line); color: var(--muted); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose img { display: block; width: auto; max-width: 100%; height: auto; margin: 1.6em auto; }
.prose code { padding: .15em .35em; border-radius: 3px; background: var(--code); font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: .84em; }
.prose pre { max-width: 100%; overflow-x: auto; padding: 20px 22px; background: var(--code); border: 1px solid var(--line); border-radius: 5px; line-height: 1.7; overflow-wrap: normal; tab-size: 4; }
.prose pre code { padding: 0; border: 0; border-radius: 0; background: transparent; font-size: 13px; white-space: pre; }
.prose table { display: block; width: max-content; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 14px; line-height: 1.7; }
.prose th, .prose td { min-width: 7em; padding: 11px 16px; border: 1px solid var(--line); text-align: left; }
.prose th { background: var(--code); font-weight: 600; white-space: nowrap; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.article-end { border-top: 1px solid var(--line); margin-top: 56px; padding-top: 25px; }
.error-state { padding: 100px 0 140px; }
.error-code { font-size: 12px; color: var(--muted); letter-spacing: .12em; margin: 0 0 18px; }
.error-state h1 { margin: 0 0 30px; font-weight: 550; font-size: 28px; line-height: 1.5; overflow-wrap: anywhere; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 1; padding: 10px 16px; background: var(--ink); color: var(--paper); font-size: 13px; }
.skip-link:focus { top: 16px; }

@media (max-width: 560px) {
  .site-shell { width: calc(100% - 40px); }
  .site-header { padding: 25px 0 22px; gap: 14px; }
  .site-nav { gap: 12px; }
  .site-name { font-size: 18px; }
  .archive { padding: 45px 0 70px; }
  .archive-heading { padding-bottom: 26px; }
  .archive-heading h1 { font-size: 26px; }
  .post-row { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 24px 0 27px; }
  .post-date { padding-top: 0; font-size: 11px; }
  .post-summary h2 { font-size: 19px; }
  .article { padding-top: 29px; padding-bottom: 48px; }
  .article-header { margin-top: 29px; margin-bottom: 29px; padding-bottom: 25px; }
  .article-meta { font-size: 11px; gap: 9px; }
  .prose { font-size: 16px; line-height: 1.95; }
  .prose pre { padding: 16px; }
  .prose th, .prose td { padding: 9px 12px; }
  .site-footer { font-size: 10px; padding: 21px 0 25px; }
  .error-state { padding-top: 65px; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1d1e1d;
    --ink: #deded8;
    --muted: #a6a39c;
    --soft: #8c8981;
    --line: #363732;
    --code: #272824;
    --selection: #514e41;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  :root { --paper: white; --ink: black; --muted: #555; --line: #ccc; --code: #f4f4f4; }
  .site-shell { width: 100%; min-height: 0; }
  .site-header, .back-link, .article-end, .site-footer { display: none; }
  .article { padding: 0; }
  .article-header { margin-top: 0; }
  .prose { font-size: 11pt; }
  .prose pre { white-space: pre-wrap; }
  .prose pre code { white-space: pre-wrap; }
}
