:root { color-scheme: dark; --paper: #121213; --ink: #deddd8; --link: #ffffff; --muted: #9d9b96; --rule: #303030; --quote-rule: #45433e; --quote-ink: #b6b3aa; --code-paper: #1d1d1c; --chip: #242424; }
html[data-theme="light"] { color-scheme: light; --paper: #fdfdfc; --ink: #292824; --link: #080808; --muted: #77746d; --rule: #e5e2db; --quote-rule: #d5d2ca; --quote-ink: #59564d; --code-paper: #f2f0e9; --chip: #f1f1f1; }
@media (prefers-color-scheme: light) {
  html:not([data-theme]) { color-scheme: light; --paper: #fdfdfc; --ink: #292824; --link: #080808; --muted: #77746d; --rule: #e5e2db; --quote-rule: #d5d2ca; --quote-ink: #59564d; --code-paper: #f2f0e9; --chip: #f1f1f1; }
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  max-width: 520px; margin: 0 auto; padding: 72px 24px 60px;
  background: var(--paper); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', system-ui, sans-serif;
  font-size: 15px; line-height: 1.8;
  -webkit-font-smoothing: antialiased; overflow-wrap: break-word;
}
a { color: var(--link); font-weight: 500; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--muted); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

/* Header */
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 0 0 46px; }
.site-header h1 { margin: 0; font-size: inherit; }
.site-header .name { color: var(--ink); font-size: 15px; font-weight: 500; letter-spacing: -.2px; }
.site-header nav { display: flex; align-items: center; gap: 18px; font-size: 12px; }
.site-header .chip { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 8px; border-radius: 3px; background: var(--chip); font-weight: 600; }
.theme-toggle { appearance: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
.theme-toggle:hover { color: var(--ink); }

/* Typography */
h1 { font-size: 19px; line-height: 1.4; font-weight: 600; letter-spacing: -.2px; margin: 0 0 28px; }
h2 { font-size: 15px; font-weight: 600; margin: 34px 0 10px; line-height: 1.5; }
h3 { font-size: 15px; font-weight: 600; margin: 28px 0 8px; line-height: 1.5; }
p { margin: 0 0 20px; }
ul, ol { padding-left: 24px; margin: 12px 0 24px; }
li { margin: 6px 0; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 32px 0; }
blockquote { margin: 28px 0; padding: 0 0 0 20px; border-left: 2px solid var(--quote-rule); color: var(--quote-ink); }
pre { overflow-x: auto; padding: 16px; background: var(--code-paper); font-size: 13px; line-height: 1.6; border-radius: 4px; }
code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .85em; }
:not(pre) > code { padding: 1px 5px; background: var(--code-paper); border-radius: 3px; }
img, video { max-width: 100%; height: auto; display: block; margin: 24px auto; }
figcaption { font-size: 12px; color: var(--muted); text-align: center; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; border-bottom: 1px solid var(--rule); padding: 8px; }

/* Home */
.home .intro > ul { list-style: none; padding-left: 20px; }
.home .intro > ul > li { position: relative; }
.home .intro > ul > li::before { content: '⡢'; position: absolute; left: -20px; top: -.2em; color: var(--muted); }
.home-writing { margin-top: 48px; }
.writing-heading { display: flex; align-items: baseline; gap: 8px; margin-bottom: 24px; }
.writing-heading h2 { margin: 0; }
.writing-heading > span { color: var(--muted); }
.writing-heading > a { font-weight: 400; }

.tag-nav { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: -8px 0 28px; font-size: 13px; }
.tag-nav a { color: var(--muted); font-weight: 400; }
.tag-nav a:hover { color: var(--ink); }
.tag-nav a[aria-current="page"] { color: var(--link); font-weight: 500; }
.tag-nav sup { margin-left: 2px; font-size: 10px; font-variant-numeric: tabular-nums; }
.date .tag { color: var(--muted); font-weight: 400; }
.date .tag:hover { color: var(--ink); }

.archive-year { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 22px; margin: 0 0 25px; }
.archive-year h3 { color: var(--muted); font-size: 12px; font-weight: 400; margin: 3px 0 0; font-variant-numeric: tabular-nums; }
.archive-year ul { list-style: none; margin: 0; padding: 0; }
.archive-year li { margin: 0 0 14px; line-height: 1.5; }
.archive-year time { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }

/* Article */
.date { margin: -18px 0 32px; color: var(--muted); font-size: 12px; }
.part-no { margin: 0 0 10px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.part > :last-child { margin-bottom: 0; }
.part-rule { margin: 36px 0; }
.source { margin-top: 32px; font-size: 13px; }
.source a { color: var(--muted); font-weight: 400; }
.post-navigation { display: flex; justify-content: space-between; gap: 24px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--rule); font-size: 14px; }
.post-navigation .next { margin-left: auto; text-align: right; }

.site-footer { margin-top: 64px; color: var(--muted); font-size: 12px; }

@media (max-width: 560px) {
  body { padding: 36px 20px 40px; }
  .site-header { margin-bottom: 34px; }
  .archive-year { grid-template-columns: 44px minmax(0, 1fr); gap: 12px; }
}
