:root {
    color-scheme: light dark;
    --background: #ffffff;
    --text: #202523;
    --muted: #6b716f;
    --line: #e7e9e8;
    --soft: #f5f7f6;
    --accent: #315b4b;
    --code: #eef2f0;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--background);
    color: var(--text);
    font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-underline-offset: 3px;
}

img {
    max-width: 100%;
    height: auto;
}

.wrap {
    width: min(720px, calc(100% - 48px));
    margin: 0 auto;
}

.site-header {
    border-bottom: 1px solid var(--line);
}

.header-inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.identity,
.site-nav,
.footer-links {
    display: flex;
    align-items: center;
    gap: 18px;
}

.identity a,
.site-nav a,
.site-footer a {
    text-decoration: none;
}

.domain {
    color: var(--accent);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.section-name {
    padding-left: 18px;
    border-left: 1px solid var(--line);
    color: var(--text);
    font-weight: 600;
}

.site-nav a {
    color: var(--muted);
    font-size: 0.88rem;
}

.site-nav a:hover,
.site-nav a.current {
    color: var(--accent);
}

.site-main {
    min-height: calc(100vh - 160px);
    padding: 11vh 0 80px;
}

.eyebrow {
    margin: 0 0 16px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.blog-intro,
.archive-header {
    margin-bottom: 56px;
}

.blog-intro h1,
.archive-header h1,
.error-page h1 {
    margin: 0 0 14px;
    font-size: clamp(2rem, 5vw, 2.8rem);
    line-height: 1.25;
    letter-spacing: -0.03em;
}

.blog-intro > p:last-child,
.error-page > p {
    margin: 0;
    color: var(--muted);
}

.post-list {
    border-top: 1px solid var(--line);
}

.post-row {
    display: grid;
    grid-template-columns: 104px 1fr auto;
    gap: 22px;
    align-items: start;
    padding: 24px 2px;
    border-bottom: 1px solid var(--line);
}

.post-date {
    color: var(--muted);
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}

.post-summary h2 {
    margin: -4px 0 8px;
    font-size: 1.18rem;
    line-height: 1.45;
}

.post-summary h2 a {
    color: var(--text);
    text-decoration: none;
}

.post-summary h2 a:hover { color: var(--accent); }

.post-summary p {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.94rem;
}

.post-taxonomy,
.post-taxonomy a {
    color: var(--muted);
    font-size: 0.8rem;
    text-decoration: none;
}

.row-arrow {
    color: var(--muted);
    text-decoration: none;
    transition: transform 150ms ease, color 150ms ease;
}

.post-row:hover .row-arrow {
    color: var(--accent);
    transform: translateX(3px);
}

.empty-state {
    margin: 0;
    padding: 28px 2px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
}

.pagination { margin-top: 34px; }

.page-navigator {
    margin: 0;
    padding: 0;
    display: flex;
    gap: 8px;
    list-style: none;
}

.page-navigator a,
.page-navigator .current {
    display: block;
    min-width: 36px;
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: 4px;
    text-align: center;
    text-decoration: none;
}

.page-navigator .current {
    border-color: var(--accent);
    color: var(--accent);
}

.article-header {
    margin-bottom: 54px;
}

.back-link {
    display: inline-block;
    margin-bottom: 30px;
    color: var(--muted);
    font-size: 0.88rem;
    text-decoration: none;
}

.back-link:hover { color: var(--accent); }

.article-header h1 {
    margin: 0 0 20px;
    font-size: clamp(2rem, 6vw, 3.2rem);
    line-height: 1.2;
    letter-spacing: -0.04em;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    color: var(--muted);
    font-size: 0.86rem;
}

.article-meta a { color: inherit; }

.article-content {
    line-height: 1.9;
    overflow-wrap: anywhere;
}

.article-content h2,
.article-content h3,
.article-content h4 {
    margin: 2.2em 0 0.8em;
    line-height: 1.4;
}

.article-content h2 {
    padding-bottom: 0.35em;
    border-bottom: 1px solid var(--line);
    font-size: 1.55rem;
}

.article-content h3 { font-size: 1.25rem; }

.article-content p,
.article-content ul,
.article-content ol,
.article-content blockquote,
.article-content pre,
.article-content table {
    margin: 1.2em 0;
}

.article-content blockquote {
    padding: 0.2em 0 0.2em 1.2em;
    border-left: 3px solid var(--accent);
    color: var(--muted);
}

.article-content code {
    padding: 0.16em 0.35em;
    border-radius: 4px;
    background: var(--code);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9em;
}

.article-content pre {
    padding: 18px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--soft);
}

.article-content pre code {
    padding: 0;
    background: transparent;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
}

.article-content th,
.article-content td {
    padding: 9px 12px;
    border: 1px solid var(--line);
    text-align: left;
}

.article-footer {
    margin-top: 64px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.tags,
.tags a {
    color: var(--muted);
    font-size: 0.86rem;
}

.post-near {
    margin-top: 28px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.post-near span:last-child { text-align: right; }

.comments {
    margin-top: 70px;
    padding-top: 36px;
    border-top: 1px solid var(--line);
}

.comments h2 {
    margin: 0 0 24px;
    font-size: 1.2rem;
}

.comment-list,
.comment-list ol {
    list-style: none;
    padding: 0;
}

.comment-list ol { margin-left: 28px; }

.comment-body {
    margin: 18px 0;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}

.comment-author .avatar {
    width: 32px;
    height: 32px;
    margin-right: 10px;
    border-radius: 50%;
    vertical-align: middle;
}

.comment-meta,
.comment-reply { font-size: 0.82rem; }

.respond { margin-top: 48px; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

label {
    display: block;
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 0.86rem;
}

input,
textarea {
    width: 100%;
    margin-top: 7px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--background);
    color: var(--text);
    font: inherit;
}

textarea { resize: vertical; }

button {
    padding: 9px 18px;
    border: 1px solid var(--accent);
    border-radius: 4px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.site-footer {
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.8rem;
}

.footer-inner {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.error-page { padding: 5vh 0; }

@media (max-width: 680px) {
    .header-inner {
        padding: 18px 0;
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .site-nav {
        width: 100%;
        gap: 16px;
        overflow-x: auto;
        white-space: nowrap;
    }

    .site-main { padding-top: 8vh; }

    .post-row {
        grid-template-columns: 1fr auto;
        gap: 8px 16px;
    }

    .post-date {
        grid-column: 1;
    }

    .post-summary {
        grid-column: 1;
    }

    .row-arrow {
        grid-column: 2;
        grid-row: 1 / span 2;
        align-self: center;
    }

    .form-grid { grid-template-columns: 1fr; }

    .footer-inner {
        padding: 22px 0;
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --background: #151817;
        --text: #eeefed;
        --muted: #a3aaa6;
        --line: #303532;
        --soft: #1c211f;
        --accent: #8fbea8;
        --code: #242a27;
    }
}

