:root {
    color-scheme: light;
    --ink: #20252b;
    --muted: #78869b;
    --line: #e6e8eb;
    --accent: #315c88;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--ink);
    background: #fff;
    line-height: 1.7;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: 2px;
}
::selection { background: #e4edf5; }

.site-shell {
    width: min(calc(100% - 32px), 680px);
    min-height: 100vh;
    min-height: 100svh;
    margin-inline: auto;
    border-inline: 1px solid var(--line);
    display: flex;
    flex-direction: column;
}

.site-header {
    min-height: 48px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    font-size: 14px;
}
.site-name { overflow-wrap: anywhere; font-size: 15px; }

.archive { padding: 12px 16px 48px; }
.archive-year + .archive-year { margin-top: 28px; }
.archive-year h2 {
    margin: 0 0 2px;
    color: #a2adbb;
    font-size: 24px;
    font-weight: 400;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
}
.post-list { list-style: none; padding: 0; margin: 0; }
.post-link {
    display: flex;
    align-items: baseline;
    gap: 16px;
    min-height: 40px;
    padding-block: 7px;
}
.post-title { min-width: 0; overflow-wrap: anywhere; }
.post-link:hover .post-title { text-decoration: underline; text-underline-offset: 4px; }
.post-leader {
    flex: 1 0 16px;
    border-bottom: 1px dashed #dfe3e8;
    align-self: flex-start;
    margin-top: 0.85em;
}
time {
    color: var(--muted);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}
.post-link time { flex-shrink: 0; white-space: nowrap; }

.site-footer {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-top: auto;
    padding: 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 11px;
}

.post-page { padding: 32px 24px 24px; }
.post-header { margin-bottom: 32px; }
.post-header h1 {
    margin: 0 0 10px;
    font-size: clamp(24px, 4vw, 30px);
    font-weight: 500;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.prose { line-height: 1.9; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote,
.prose pre, .prose table { margin-block: 0 1.5em; }
.prose h1, .prose h2, .prose h3, .prose h4,
.prose h5, .prose h6 {
    margin: 1.8em 0 0.7em;
    font-weight: 500;
    line-height: 1.5;
}
.prose h1 { font-size: 26px; }
.prose h2 { font-size: 22px; }
.prose h3 { font-size: 19px; }
.prose h4, .prose h5, .prose h6 { font-size: 16px; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.6em; }
.prose li + li { margin-top: 0.3em; }
.prose li > p { margin-bottom: 0.5em; }
.prose blockquote {
    margin-inline: 0;
    padding: 2px 0 2px 18px;
    border-left: 2px solid #d6dde5;
    color: #657184;
}
.prose blockquote > :last-child { margin-bottom: 0; }
.prose code {
    padding: 0.15em 0.35em;
    border-radius: 3px;
    background: #f5f6f8;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.85em;
}
.prose pre {
    max-width: 100%;
    overflow-x: auto;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #f8f9fa;
    line-height: 1.7;
    overflow-wrap: normal;
    tab-size: 4;
}
.prose pre code { padding: 0; border-radius: 0; background: none; }
.prose img, .prose video { display: block; max-width: 100%; height: auto; margin-inline: auto; }
.prose figure { margin: 1.5em 0; }
.prose figcaption { margin-top: 8px; color: var(--muted); font-size: 13px; text-align: center; }
.prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 14px; }
.prose th, .prose td { padding: 8px 12px; border: 1px solid var(--line); text-align: left; }
.prose th { background: #f8f9fa; font-weight: 500; }
.prose hr { margin-block: 32px; border: 0; border-top: 1px solid var(--line); }
.post-navigation { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; }
.post-navigation a, .back-link { color: var(--muted); }
.post-navigation a:hover, .back-link:hover { color: var(--accent); }

.empty-state, .not-found { padding: 64px 24px 80px; }
.empty-state { padding-inline: 0; }
.empty-state h2 { margin: 0 0 12px; font-size: 22px; font-weight: 400; }
.empty-state p { color: var(--muted); font-size: 14px; }
.not-found > p { margin: 0; font-size: 18px; line-height: 1.8; }
.not-found .error-code { margin: 0 0 16px; color: #a2adbb; font-size: 48px; font-weight: 300; line-height: 1; }
.back-link { display: inline-block; margin-top: 24px; font-size: 14px; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 1; padding: 8px 16px; background: #fff; }
.skip-link:focus { top: 8px; }

@media (max-width: 480px) {
    .site-shell { width: 100%; border-inline: 0; }
    .site-header, .site-footer { padding-inline: 20px; }
    .archive { padding: 16px 20px 40px; }
    .post-link { gap: 10px; padding-block: 9px; }
    .post-leader { flex-basis: 8px; }
    .post-link time { font-size: 11px; letter-spacing: 0; }
    .post-page { padding: 28px 20px 24px; }
    .not-found { padding-inline: 20px; }
}

@media print {
    .site-shell { width: 100%; min-height: auto; border: 0; }
    .site-header, .site-footer, .post-navigation, .skip-link { display: none; }
    .post-page { padding: 0; }
    .prose pre { white-space: pre-wrap; }
}
