:root {
    --paper: #ffffff;
    --canvas: #f5f6f4;
    --ink: #1d2420;
    --muted: #667069;
    --line: #d9ded9;
    --accent: #176b4d;
    --accent-dark: #0f5139;
    --warm: #a34b2c;
    --code: #eef2ee;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 16px;
    line-height: 1.75;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }
img { display: block; max-width: 100%; height: auto; }
button, input, textarea { font: inherit; }

.shell { width: min(100% - 40px, 980px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.site-header { background: var(--paper); border-top: 4px solid var(--accent); border-bottom: 1px solid var(--line); }
.header-row { min-height: 116px; display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.site-identity { min-width: 0; }
.site-title { display: block; color: var(--ink); font-family: Georgia, "Noto Serif SC", "Songti SC", serif; font-size: 30px; font-weight: 700; line-height: 1.2; text-decoration: none; }
.site-identity p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.site-search { display: grid; grid-template-columns: minmax(140px, 240px) auto; gap: 8px; }
.site-search input, .form-grid input, textarea { width: 100%; border: 1px solid #b9c1bb; border-radius: 4px; background: #fff; color: var(--ink); padding: 9px 11px; }
.site-search button, #comment-form button { border: 1px solid var(--accent); border-radius: 4px; background: var(--accent); color: #fff; padding: 9px 16px; cursor: pointer; }
.site-search button:hover, #comment-form button:hover { background: var(--accent-dark); }
.site-search input:focus, input:focus, textarea:focus { outline: 3px solid rgba(23, 107, 77, 0.18); border-color: var(--accent); }

.site-nav { display: flex; flex-wrap: wrap; gap: 4px 22px; min-height: 45px; align-items: center; }
.site-nav a { color: #3e4942; text-decoration: none; font-size: 15px; }
.site-nav a.current, .site-nav a:hover { color: var(--accent); }

.site-main { min-height: 65vh; padding-block: 46px 72px; }
.archive-header { margin-bottom: 32px; border-bottom: 1px solid var(--line); padding-bottom: 22px; }
.archive-header h1, .empty-state h1 { margin: 4px 0 0; font-family: Georgia, "Noto Serif SC", "Songti SC", serif; font-size: 30px; line-height: 1.35; }
.section-label { margin: 0; color: var(--warm); font-size: 13px; font-weight: 700; }

.post-list { display: grid; gap: 0; }
.post-summary { display: grid; grid-template-columns: minmax(220px, 34%) 1fr; gap: 30px; padding: 34px 0; border-bottom: 1px solid var(--line); }
.post-summary:first-child { padding-top: 0; }
.post-summary:not(:has(.post-cover)) { grid-template-columns: 1fr; }
.post-cover { overflow: hidden; border-radius: 6px; background: #e5e9e5; text-decoration: none; }
.post-cover img { width: 100%; height: 100%; object-fit: cover; }
.post-cover-list { aspect-ratio: 16 / 10; align-self: start; }
.post-summary h2 { margin: 10px 0 12px; font-family: Georgia, "Noto Serif SC", "Songti SC", serif; font-size: 26px; line-height: 1.4; }
.post-summary h2 a { color: var(--ink); text-decoration: none; }
.post-summary h2 a:hover { color: var(--accent); }
.post-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 13px; }
.post-meta a { color: inherit; }
.post-excerpt { color: #455048; }
.post-excerpt p { margin: 0; }
.read-more { display: inline-block; margin-top: 14px; color: var(--accent); font-weight: 650; }

.page-navigator { display: flex; justify-content: center; gap: 7px; margin: 42px 0 0; padding: 0; list-style: none; }
.page-navigator a, .page-navigator .current { display: grid; place-items: center; min-width: 38px; min-height: 38px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); text-decoration: none; }
.page-navigator .current { border-color: var(--accent); background: var(--accent); color: #fff; }

.post-single, .page-single { max-width: 760px; margin-inline: auto; }
.post-header { margin-bottom: 26px; }
.post-header h1 { margin: 12px 0 0; font-family: Georgia, "Noto Serif SC", "Songti SC", serif; font-size: 38px; line-height: 1.35; }
.post-cover-single { aspect-ratio: 16 / 9; margin-bottom: 36px; }
.post-content { font-family: Georgia, "Noto Serif SC", "Songti SC", serif; font-size: 18px; line-height: 1.95; overflow-wrap: anywhere; }
.post-content h2, .post-content h3 { margin: 2em 0 0.7em; line-height: 1.45; }
.post-content blockquote { margin: 1.5em 0; padding: 2px 20px; border-left: 3px solid var(--accent); color: #4f5a53; }
.post-content pre { overflow-x: auto; padding: 18px; border: 1px solid var(--line); border-radius: 6px; background: var(--code); font-size: 14px; line-height: 1.65; }
.post-content code { background: var(--code); padding: 2px 5px; border-radius: 3px; font-family: Consolas, "SFMono-Regular", monospace; font-size: 0.9em; }
.post-content pre code { padding: 0; background: transparent; }
.post-content table { display: block; width: max-content; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.post-content th, .post-content td { border: 1px solid var(--line); padding: 8px 12px; }
.post-footer { margin-top: 42px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); }
.post-near { max-width: 760px; margin: 34px auto; display: grid; gap: 8px; color: var(--muted); }

.comments-area { max-width: 760px; margin: 54px auto 0; padding-top: 34px; border-top: 1px solid var(--line); }
.comments-area h2 { font-size: 22px; }
.comment-list { margin: 0; padding: 0; list-style: none; }
.comment-item { margin: 0 0 18px; padding: 18px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.comment-child { margin-top: 14px; margin-left: 28px; background: #fafbfa; }
.comment-by-author { border-color: #9fbbae; }
.comment-header { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 13px; }
.comment-header strong { color: var(--ink); }
.comment-content { margin-top: 12px; }
.comment-content p { margin: 0.5em 0; }
.comment-reply { margin-top: 8px; font-size: 13px; }
.comment-pending { color: var(--warm); }
.respond { margin-top: 36px; }
.cancel-reply { float: right; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
#comment-form label { display: grid; gap: 6px; margin-bottom: 14px; color: #455048; font-size: 14px; }
#comment-form button { min-width: 112px; }

.empty-state { padding: 72px 0; text-align: center; }
.empty-state p { color: var(--muted); }
.error-page { min-height: 50vh; display: grid; place-content: center; }

.site-footer { border-top: 1px solid var(--line); background: var(--paper); color: var(--muted); font-size: 13px; }
.footer-row { min-height: 78px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }

@media (max-width: 760px) {
    .shell { width: min(100% - 28px, 980px); }
    .header-row { min-height: 0; padding-block: 26px 20px; align-items: stretch; flex-direction: column; gap: 20px; }
    .site-title { font-size: 27px; }
    .site-search { grid-template-columns: 1fr auto; }
    .site-nav { min-height: 44px; gap: 4px 18px; overflow-x: auto; flex-wrap: nowrap; }
    .site-nav a { flex: 0 0 auto; }
    .site-main { padding-block: 34px 56px; }
    .post-summary { grid-template-columns: 1fr; gap: 20px; padding: 28px 0; }
    .post-summary h2 { font-size: 23px; }
    .post-header h1 { font-size: 31px; }
    .post-content { font-size: 17px; }
    .form-grid { grid-template-columns: 1fr; gap: 0; }
    .comment-child { margin-left: 12px; }
    .comment-header { flex-direction: column; gap: 2px; }
    .footer-row { padding-block: 20px; align-items: flex-start; flex-direction: column; }
}

