:root {
  --ink: #172321;
  --muted: #68736f;
  --paper: #f6f5f0;
  --surface: #ffffff;
  --line: #d8ddd8;
  --pine: #123f3b;
  --pine-light: #e0ece8;
  --accent: #d94f36;
  --code: #14211f;
}

* { box-sizing: border-box; letter-spacing: 0; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif; font-size: 16px; line-height: 1.7; }
a { color: inherit; }
img { max-width: 100%; }
.shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 100; padding: 8px 12px; background: var(--ink); color: white; }
.skip-link:focus { top: 12px; }

.site-header { position: sticky; top: 0; z-index: 30; height: 72px; border-bottom: 1px solid var(--line); background: var(--paper); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { min-width: 0; display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 750; font-size: 18px; }
.brand img { width: 38px; height: 38px; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main-nav { min-width: 0; display: flex; align-items: center; gap: 30px; }
.custom-nav-links { min-width: 0; display: flex; gap: 30px; overflow-x: auto; scrollbar-width: none; }
.custom-nav-links::-webkit-scrollbar { display: none; }
.main-nav a { flex: none; color: #42514d; text-decoration: none; font-size: 14px; font-weight: 650; white-space: nowrap; }
.admin-nav-link { flex: none; }
.main-nav a:hover { color: var(--accent); }

.listing-section { padding: 64px 0 90px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 16px; border-bottom: 2px solid var(--ink); }
.section-heading h2 { margin: 0; font: 650 20px/1.3 Georgia, "Songti SC", serif; }
.section-heading span { color: var(--muted); font-size: 13px; }
.post-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 48px; padding: 36px 0; border-bottom: 1px solid var(--line); }
.post-row-meta { display: flex; flex-direction: column; gap: 7px; font: 13px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--muted); }
.post-row-meta .post-id { color: var(--accent); font-weight: 750; }
.post-row-main h2 { margin: 0 0 10px; font: 600 29px/1.3 Georgia, "Songti SC", serif; }
.post-row-main h2 a { text-decoration: none; }
.post-row-main h2 a:hover { color: var(--accent); }
.post-row-main p { max-width: 720px; margin: 0 0 14px; color: #596662; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 44px; font-size: 14px; }
.pagination .page-link { width: 68px; flex: 0 0 68px; text-align: center; }
.pagination a { color: var(--pine); font-weight: 700; }
.pagination .page-indicator { color: var(--muted); }
.pagination .page-indicator { min-width: 36px; text-align: center; white-space: nowrap; }
.pagination a.page-link:hover { border-color: #8fa49d; background: var(--pine-light); }
.pagination .page-link.disabled { color: #9da5a2; border-color: #e1e5e2; background: #f7f8f6; cursor: default; }
.empty-state { padding: 64px 0; text-align: center; color: var(--muted); }
.empty-state strong { color: var(--ink); font: 600 22px Georgia, serif; }
.empty-state p { margin: 8px 0; }

.article-shell { width: min(860px, calc(100% - 40px)); margin: 0 auto; padding: 70px 0 80px; }
.article-header { padding-bottom: 42px; border-bottom: 1px solid var(--line); }
.article-header h1 { margin: 0; font: 600 52px/1.2 Georgia, "Songti SC", serif; overflow-wrap: anywhere; }
.article-summary { margin: 20px 0 18px; color: #52605c; font-size: 19px; }
.article-dates { display: flex; gap: 22px; color: var(--muted); font: 13px ui-monospace, SFMono-Regular, Consolas, monospace; }
.markdown-body { padding-top: 35px; color: #263330; font-size: 17px; line-height: 1.9; overflow-wrap: break-word; }
.markdown-body > :first-child:not(.toc) { margin-top: 0; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 { color: var(--ink); font-family: Georgia, "Songti SC", serif; line-height: 1.35; scroll-margin-top: 90px; }
.markdown-body h1 { margin: 2em 0 .8em; font-size: 34px; }
.markdown-body h2 { margin: 2em 0 .65em; padding-bottom: 9px; border-bottom: 1px solid var(--line); font-size: 28px; }
.markdown-body h3 { margin: 1.7em 0 .55em; font-size: 22px; }
.markdown-body p { margin: 1.15em 0; }
.markdown-body a { color: #08726a; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.markdown-body img { display: block; max-width: 100%; height: auto; margin: 28px auto; border-radius: 4px; }
.markdown-body blockquote { margin: 1.5em 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--accent); color: #53615d; }
.markdown-body blockquote p { margin: .5em 0; }
.markdown-body code { padding: 2px 5px; border: 1px solid #d4ded9; border-radius: 3px; color: #ab3d29; background: #edf1ee; font: .9em ui-monospace, SFMono-Regular, Consolas, monospace; }
.markdown-body pre { max-width: 100%; margin: 1.5em 0; padding: 20px 22px; overflow-x: auto; border-left: 4px solid #3f8f83; border-radius: 4px; background: var(--code); color: #dce8e3; line-height: 1.65; }
.markdown-body pre code { padding: 0; border: 0; color: inherit; background: transparent; font-size: 14px; }
.markdown-body table { width: 100%; min-width: 520px; border-collapse: collapse; display: block; overflow-x: auto; }
.markdown-body th, .markdown-body td { padding: 10px 12px; border: 1px solid var(--line); text-align: left; }
.markdown-body th { background: #e9ece8; }
.markdown-body ul, .markdown-body ol { padding-left: 1.4em; }
.markdown-body .toc { margin: 0 0 38px; padding: 22px 24px; border: 1px solid var(--line); border-top: 3px solid var(--pine); border-radius: 4px; background: #eeefea; }
.markdown-body .toc::before { content: "目录"; display: block; margin-bottom: 10px; color: var(--ink); font-weight: 750; }
.markdown-body .toc > .toc > ul, .markdown-body .toc > ul { margin: 0; padding-left: 20px; }
.markdown-body .toc a { color: #3d4e49; text-decoration: none; font-size: 14px; }
.article-nav { width: min(860px, calc(100% - 40px)); margin: 0 auto 74px; padding-top: 26px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.article-nav div:last-child { text-align: right; }
.article-nav span { display: block; color: var(--muted); font-size: 12px; }
.article-nav a { color: var(--pine); font-weight: 700; text-decoration: none; }

.comments-section { border-top: 1px solid var(--line); background: #edece5; padding: 64px 0 90px; }
.comments-inner { width: min(760px, calc(100% - 40px)); margin: auto; }
.comment-list { margin-bottom: 42px; }
.comment { padding: 25px 0; border-bottom: 1px solid #ced3cf; }
.comment header { display: flex; justify-content: space-between; gap: 20px; }
.comment time { color: var(--muted); font-size: 12px; }
.comment p { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-form { max-width: 620px; margin-top: 36px; display: grid; gap: 18px; }
.comment-form label { font-weight: 700; font-size: 14px; }
.comment-form input[type="text"], .comment-form textarea { width: 100%; margin-top: 6px; padding: 11px 12px; border: 1px solid #bdc6c1; border-radius: 4px; background: white; color: var(--ink); font: inherit; resize: vertical; }
.comment-form input:focus, .comment-form textarea:focus { outline: 2px solid #84aaa2; outline-offset: 1px; border-color: var(--pine); }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.comments-closed, .muted { color: var(--muted); }
.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 9px 16px; border: 1px solid transparent; border-radius: 4px; font: 700 14px/1.2 inherit; text-decoration: none; cursor: pointer; }
.button.primary { background: var(--pine); color: white; }
.button.secondary { color: var(--pine); border-color: #b9c8c3; background: white; }
.button.small { min-height: 34px; padding: 5px 11px; font-size: 13px; }
.button.primary:hover { background: #0b312e; }
.field-error { margin: -10px 0 0; color: #b52f25; font-size: 13px; }
.flash-stack { margin: 20px 0; display: grid; gap: 8px; }
.flash { padding: 11px 14px; border-left: 4px solid #5f827b; background: #e2ebe7; }
.flash-error { border-color: #b52f25; background: #f7e4df; }
.flash-warning { border-color: #aa741d; background: #f5ead5; }
.error-page { min-height: calc(100vh - 160px); display: grid; place-items: center; padding: 60px 20px; text-align: center; }
.error-page span { color: var(--accent); font: 750 14px ui-monospace, monospace; }
.error-page h1 { margin: 8px 0; font: 600 40px Georgia, serif; }
.error-page p { margin: 0 0 24px; color: var(--muted); }
.site-footer { border-top: 1px solid var(--line); }
.footer-inner { min-height: 84px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13px; }

@media (max-width: 760px) {
  .shell { width: min(100% - 28px, 1120px); }
  .site-header { height: 64px; }
  .header-inner { gap: 14px; }
  .brand { max-width: 48%; }
  .brand img { width: 34px; height: 34px; }
  .main-nav, .custom-nav-links { gap: 18px; }
  .listing-section { padding: 42px 0 64px; }
  .post-row { grid-template-columns: 1fr; gap: 12px; padding: 28px 0; }
  .post-row-meta { flex-direction: row; }
  .post-row-main h2 { font-size: 25px; }
  .article-shell { width: min(100% - 28px, 860px); padding: 46px 0 58px; }
  .article-header h1 { font-size: 36px; }
  .article-summary { font-size: 17px; }
  .article-dates { flex-direction: column; gap: 3px; }
  .markdown-body { padding-top: 25px; font-size: 16px; }
  .markdown-body h1 { font-size: 29px; }
  .markdown-body h2 { font-size: 24px; }
  .markdown-body pre { padding: 17px; }
  .article-nav { width: min(100% - 28px, 860px); grid-template-columns: 1fr; }
  .article-nav div:last-child { text-align: left; }
  .comments-inner { width: min(100% - 28px, 760px); }
  .comment header { flex-direction: column; gap: 2px; }
  .footer-inner { padding: 18px 0; flex-direction: column; align-items: flex-start; justify-content: center; }
}
