:root {
  --paper: #f5f1e8;
  --paper-deep: #ebe4d6;
  --ink: #25231f;
  --muted: #756e64;
  --line: rgba(37, 35, 31, 0.15);
  --accent: #2f6860;
  --accent-dark: #1f4d47;
  --gold: #a87935;
  --card: #fbf9f3;
  --shadow: 0 22px 60px rgba(60, 49, 34, 0.1);
  --serif: Georgia, "Noto Serif CJK SC", "Songti SC", SimSun, serif;
  --sans: "Avenir Next", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --kai: KaiTi, "Kaiti SC", STKaiti, "Songti SC", serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  --zhu: #b03a2a;
  --zhu-dark: #8f3428;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); line-height: 1.7; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .24; background-image: radial-gradient(rgba(55, 45, 32, .14) .5px, transparent .5px); background-size: 5px 5px; mix-blend-mode: multiply; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid rgba(47, 104, 96, .4); outline-offset: 3px; }

.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 2px solid var(--ink); background: rgba(245, 241, 232, .9); backdrop-filter: blur(14px); transition: box-shadow .2s ease; }
.site-header::after { content: ""; display: block; height: 3px; border-bottom: 1px solid var(--ink); }
.site-header.scrolled { box-shadow: 0 8px 22px rgba(48, 41, 31, .06); }
.header-inner, main, .site-footer { width: min(var(--max), calc(100% - 48px)); margin: 0 auto; }
.header-inner { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--ink); border-radius: 50%; font-family: var(--serif); font-size: 21px; }
.brand-copy strong, .brand-copy small { display: block; }
.brand-copy strong { font-family: var(--serif); font-size: 20px; letter-spacing: .04em; }
.brand-copy small { color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.site-nav { display: flex; align-items: center; gap: 26px; color: var(--muted); font-size: 14px; }
.site-nav a { position: relative; padding: 8px 0; }
.site-nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 2px; height: 1px; background: var(--accent); transition: right .2s ease; }
.site-nav a:hover, .site-nav a.active { color: var(--accent-dark); }
.site-nav a:hover::after, .site-nav a.active::after { right: 0; }
.nav-toggle { display: none; border: 0; color: var(--ink); background: transparent; }

main { min-height: 70vh; }
.home-hero { display: grid; grid-template-columns: 1fr 46px .92fr; gap: clamp(30px, 5vw, 66px); align-items: center; padding: clamp(64px, 9vw, 120px) 0 92px; }
.hero-vline { writing-mode: vertical-rl; font-family: var(--kai); color: var(--gold); font-size: 15px; letter-spacing: .42em; border-left: 1px solid var(--line); padding-left: 18px; height: min(330px, 52vh); align-self: center; opacity: .9; }
.hero-copy { max-width: 600px; }
.eyebrow { margin: 0 0 16px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; }
.hero-copy h1 { max-width: 580px; margin: 0; font-size: clamp(42px, 5.6vw, 76px); line-height: 1.08; letter-spacing: -.05em; }
.hero-lede { max-width: 460px; margin: 26px 0 30px; color: var(--muted); font-size: 17px; }
.text-link { display: inline-flex; align-items: center; gap: 12px; color: var(--accent-dark); border-bottom: 1px solid var(--accent); padding-bottom: 4px; font-size: 14px; }
.text-link span { transition: transform .2s ease; }
.text-link:hover span { transform: translateX(4px); }
.hero-stats { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 74px; color: var(--muted); font-size: 12px; }
.hero-stats strong { color: var(--ink); font-family: var(--serif); font-size: 22px; font-weight: 500; margin-right: 3px; }
.hero-feature { position: relative; }
.post-card { min-width: 0; border-bottom: 1px solid var(--line); transition: transform .2s ease; }
.post-card:hover { transform: translateY(-4px); }
.featured-card { border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); }
.post-media { display: block; overflow: hidden; background: var(--paper-deep); aspect-ratio: 16 / 9; }
.post-media img { width: 100%; height: 100%; object-fit: cover; object-position: center; transition: transform .5s ease; }
.post-card:hover .post-media img { transform: scale(1.035); }
.post-card-body { padding: 18px 0 22px; }
.featured-card .post-card-body { padding: 26px 28px 28px; }
.post-meta { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 12px; color: var(--accent); font-size: 11px; letter-spacing: .03em; }
.post-meta span:first-child::before { content: ""; display: inline-block; width: 7px; height: 7px; background: var(--gold); margin-right: 7px; }
.post-meta time { color: var(--muted); font-family: var(--mono); }
.post-card h3 { margin: 0; font-size: 23px; line-height: 1.28; letter-spacing: -.02em; }
.featured-card h3 { font-size: clamp(28px, 3vw, 38px); }
.post-card h3 a:hover { color: var(--accent-dark); }
.post-card p { margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.75; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; color: var(--muted); font-size: 11px; }
.section-band { border-top: 1px solid var(--line); padding: 72px 0 90px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.section-heading h2 { margin: 0; font-size: clamp(31px, 4vw, 48px); line-height: 1.05; }
.section-heading > a { color: var(--accent-dark); font-size: 13px; }
.latest-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.category-section { display: grid; grid-template-columns: .72fr 1.28fr; gap: 60px; padding-bottom: 120px; }
.category-ledger { border-top: 1px solid var(--line); }
.category-ledger a { display: grid; grid-template-columns: 54px 1fr auto; align-items: center; gap: 14px; min-height: 74px; border-bottom: 1px solid var(--line); }
.category-ledger a:hover strong { color: var(--accent); }
.category-ledger span { color: var(--gold); font-family: var(--kai); font-size: 19px; }
.category-ledger strong { font-family: var(--serif); font-size: 22px; font-weight: 500; }
.category-ledger small { color: var(--muted); font-size: 12px; }

.page-intro { max-width: 720px; padding: 96px 0 66px; }
.page-intro h1 { margin: 0; font-size: clamp(42px, 5vw, 68px); line-height: 1.08; letter-spacing: -.04em; }
.page-intro > p:last-child { max-width: 520px; margin: 22px 0 0; color: var(--muted); font-size: 17px; }
.archive-shell { border-top: 1px solid var(--line); padding: 28px 0 110px; }
.archive-shell-compact { margin-top: 72px; border-top: 0; padding-top: 0; }
.archive-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 22px; }
.archive-stats div { display: grid; place-items: center; min-height: 112px; border: 1px solid var(--line); border-radius: 7px; background: rgba(251, 249, 243, .62); text-align: center; }
.archive-stats strong { color: var(--accent-dark); font-family: var(--serif); font-size: 42px; font-weight: 500; line-height: 1; }
.archive-stats span { color: var(--muted); font-size: 14px; }
.archive-tools { display: grid; gap: 22px; margin-bottom: 34px; }
.search-field { display: grid; gap: 8px; color: var(--muted); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.search-field input { width: 100%; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; color: var(--ink); background: transparent; padding: 12px 0; outline: 0; font-size: 18px; }
.search-field input::placeholder { color: rgba(117, 110, 100, .7); }
.category-tabs { display: flex; flex-wrap: wrap; gap: 9px; }
.category-tabs button { border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: transparent; padding: 7px 14px; font-size: 12px; }
.category-tabs button:hover, .category-tabs button.active { border-color: var(--accent); color: var(--accent-dark); background: rgba(47, 104, 96, .07); }
.collection-tabs { gap: 0; width: fit-content; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: rgba(251, 249, 243, .7); }
.collection-tabs button { min-width: 96px; border-color: transparent; }
.collection-tabs button.active { border-color: var(--accent); box-shadow: 0 5px 16px rgba(47, 104, 96, .08); }
.essay-tabs { padding-left: 8px; }
.essay-tabs::before { content: "随笔分类"; align-self: center; margin-right: 4px; color: var(--muted); font-size: 12px; letter-spacing: .08em; }
.essay-tabs.hidden { display: none; }
.result-summary { display: flex; justify-content: space-between; margin-bottom: 18px; color: var(--muted); font-size: 12px; }
.result-summary button { border: 0; color: var(--accent); background: transparent; font-size: 12px; }
.archive-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 42px 28px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 44px; color: var(--muted); font-size: 13px; }
.pager button { border: 1px solid var(--line); color: var(--ink); background: transparent; padding: 8px 13px; }
.pager button:disabled { cursor: default; opacity: .35; }
.empty-state, .loading-state { min-height: 240px; display: grid; place-items: center; align-content: center; gap: 8px; border: 1px dashed var(--line); color: var(--muted); text-align: center; }
.empty-state strong { color: var(--ink); font-family: var(--serif); font-size: 25px; font-weight: 500; }
.empty-state a, .empty-state button { border: 0; color: var(--accent); background: transparent; }
.loading-state { border: 0; }
.loading-state span { width: 28px; height: 28px; border: 1px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.category-page-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; border: 1px solid var(--line); background: var(--line); margin-bottom: 120px; }
.category-page-grid a { min-height: 260px; display: flex; flex-direction: column; justify-content: space-between; background: var(--paper); padding: 30px; transition: background .2s ease; }
.category-page-grid a:hover { background: var(--card); }
.category-page-grid span { color: var(--gold); font-family: var(--kai); font-size: 19px; }
.category-page-grid h2 { margin: 38px 0 10px; font-size: 34px; }
.category-page-grid p { max-width: 400px; margin: 0; color: var(--muted); font-size: 14px; }
.category-page-grid small { margin-top: 24px; color: var(--accent); font-size: 12px; }


.article-header { position: relative; max-width: 820px; margin: 0 auto; padding: 66px 0 40px; text-align: center; }
.back-link { display: block; text-align: left; margin-bottom: 44px; color: var(--accent-dark); font-size: 13px; }
.article-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; color: var(--muted); font-size: 12px; letter-spacing: .12em; }
.article-meta span:first-child { color: var(--zhu); }
.article-header h1 { margin: 22px auto 18px; max-width: 760px; font-size: clamp(30px, 4.4vw, 52px); font-weight: 600; line-height: 1.4; letter-spacing: .03em; }
.article-header > p { max-width: 620px; margin: 0 auto; color: var(--muted); font-family: var(--kai); font-size: 17px; line-height: 2; }
.article-stamp { position: absolute; right: 0; top: 70px; transform: rotate(4deg); }
.seal { width: 54px; height: 54px; border-radius: 5px; background: var(--zhu); color: var(--paper); display: grid; grid-template-columns: 1fr 1fr; box-shadow: inset 0 0 0 2px rgba(245, 241, 232, .28); font-family: var(--kai); }
.seal i { display: grid; place-items: center; font-style: normal; font-size: 17px; line-height: 1; }
.reader-layout { display: grid; grid-template-columns: 182px minmax(0, 760px); gap: 62px; align-items: start; padding: 30px 0 86px; }
.article-toc { position: sticky; top: 118px; color: var(--muted); font-size: 12px; }
.article-toc strong { display: block; margin-bottom: 14px; color: var(--ink); font-size: 13px; font-weight: 600; letter-spacing: .6em; }
.article-toc nav { display: grid; gap: 9px; border-left: 1px solid var(--line); padding-left: 14px; counter-reset: juan; }
.article-toc a { display: block; line-height: 1.55; }
.article-toc a.level-h2 { counter-increment: juan; }
.article-toc a.level-h2::before { content: counter(juan, cjk-ideographic) "\3000"; font-family: var(--kai); color: var(--zhu); }
.article-toc a.level-h3 { padding-left: 24px; font-size: 11px; }
.article-toc a:hover, .article-toc a.active { color: var(--zhu-dark); }
.article-body { min-width: 0; font-family: var(--serif); font-size: 18.5px; line-height: 2.12; }
.article-body > * { margin: 0 0 1.55em; }
.article-body h2 { position: relative; margin: 2.6em 0 .8em; padding-left: 18px; font-size: 27px; font-weight: 600; line-height: 1.4; letter-spacing: .04em; }
.article-body h2::before { content: ""; position: absolute; left: 0; top: .3em; width: 5px; height: .92em; background: var(--zhu); }
.article-body h3 { margin: 2em 0 .6em; font-size: 21.5px; font-weight: 600; }
.article-body p { text-wrap: pretty; }
.article-body a { color: var(--zhu-dark); text-decoration: underline; text-decoration-color: rgba(176, 58, 42, .35); text-underline-offset: 4px; }
.article-body strong { font-weight: 700; }
.article-body em { font-style: normal; text-emphasis: filled circle var(--zhu); text-emphasis-position: under right; -webkit-text-emphasis: filled circle var(--zhu); -webkit-text-emphasis-position: under; }
.article-body blockquote { position: relative; margin: 2.1em 0; padding: 20px 24px 20px 58px; border-left: 2px solid var(--zhu); background: rgba(176, 58, 42, .05); font-family: var(--kai); font-size: 18.5px; line-height: 2; color: var(--zhu-dark); }
.article-body blockquote::before { content: "批"; position: absolute; left: 16px; top: 20px; width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--zhu); border-radius: 4px; color: var(--zhu); font-size: 14px; font-family: var(--kai); }
.article-body blockquote p { margin: 0 0 .8em; }
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body ul, .article-body ol { padding-left: 1.6em; }
.article-body li { padding-left: .3em; margin-bottom: .45em; }
.article-body li::marker { color: var(--zhu); }
.article-body hr { border: 0; text-align: center; }
.article-body hr::after { content: "\25C7\3000\25C7\3000\25C7"; color: var(--zhu); font-size: 12px; letter-spacing: .6em; }
.article-body figure { margin: 32px 0; }
.article-body figure img { margin: 0 auto; border: 1px solid var(--ink); background: #fff; padding: 6px; }
.article-body figcaption { margin-top: 12px; text-align: center; font-family: var(--kai); font-size: 14px; color: var(--muted); }
.article-body figcaption::before { content: "\3014\56FE\3015"; color: var(--zhu); margin-right: 6px; }
.article-body img { width: auto; max-width: 100%; height: auto; }
.article-body p img { margin: 24px auto; }
.article-body pre { overflow: auto; border-radius: 4px; background: #292922; color: #f5f1e8; padding: 20px; font: 14px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; }
.article-body code { border-radius: 3px; background: rgba(47, 104, 96, .1); padding: 2px 5px; font: .82em ui-monospace, SFMono-Regular, Consolas, monospace; }
.article-body pre code { background: transparent; padding: 0; }
.table-wrap { overflow-x: auto; margin: 28px 0; }
.article-body table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.6; }
.article-body th, .article-body td { border-bottom: 1px solid var(--line); padding: 12px 10px; text-align: left; vertical-align: top; }
.article-body th { color: var(--accent-dark); font-family: var(--sans); font-weight: 700; }
.text-center { display: block; text-align: center; }
.mermaid { white-space: pre-wrap; background: var(--card) !important; color: var(--ink) !important; }
.mermaid-fallback { border: 1px dashed var(--line); background: transparent !important; color: var(--muted) !important; }
.article-footer { border-top: 1px solid var(--line); padding: 28px 0 100px; }
.article-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; }
.article-tags button { border: 0; background: transparent; color: var(--muted); padding: 6px 0; font-size: 14px; }
.article-tags button::before { content: "\3014"; color: var(--zhu); }
.article-tags button::after { content: "\3015"; color: var(--zhu); }
.article-tags button:hover { color: var(--zhu-dark); background: transparent; border: 0; }
.article-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 46px; }
.article-nav a { display: grid; gap: 8px; border: 1px solid var(--line); background: rgba(251, 249, 243, .7); padding: 16px 18px; }
.article-nav a:hover { border-color: var(--zhu); }
.article-nav a:last-child { text-align: right; }
.article-nav span { color: var(--muted); font-size: 11px; letter-spacing: .2em; }
.article-nav strong { font-family: var(--serif); font-size: 17px; font-weight: 500; line-height: 1.6; }

.about-layout { display: grid; grid-template-columns: .62fr 1fr; gap: clamp(42px, 8vw, 120px); align-items: center; padding: 100px 0 140px; }
.about-portrait { background: var(--paper-deep); padding: 14px; transform: rotate(-2deg); box-shadow: var(--shadow); }
.about-portrait img { width: 100%; aspect-ratio: 1 / 1.15; object-fit: cover; filter: saturate(.75); }
.about-copy { max-width: 650px; }
.about-copy h1 { margin: 0; font-size: clamp(40px, 5vw, 68px); line-height: 1.08; letter-spacing: -.05em; }
.about-copy > p:not(.eyebrow) { margin: 28px 0; color: var(--muted); font-size: 17px; }
.about-copy blockquote { margin: 32px 0; border-left: 2px solid var(--gold); padding-left: 20px; color: var(--accent-dark); font-family: var(--serif); font-size: 22px; line-height: 1.55; }
.about-numbers { display: flex; flex-wrap: wrap; gap: 28px; margin: 40px 0; color: var(--muted); font-size: 12px; }
.about-numbers strong { display: block; color: var(--ink); font-family: var(--serif); font-size: 27px; font-weight: 500; }

.site-footer { display: flex; justify-content: space-between; gap: 28px; border-top: 1px solid var(--line); padding: 28px 0 38px; color: var(--muted); font-size: 12px; }
.site-footer strong { display: block; color: var(--ink); font-family: var(--serif); font-size: 18px; font-weight: 500; }
.site-footer span { display: block; margin-top: 3px; }
.footer-links { display: flex; gap: 18px; align-items: center; }
.footer-links a:hover { color: var(--accent-dark); }
.to-top { position: fixed; right: 22px; bottom: 22px; z-index: 10; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; color: var(--accent-dark); background: rgba(245, 241, 232, .9); opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { transform: translateY(-3px); }

@media (max-width: 860px) {
  .header-inner, main, .site-footer { width: min(var(--max), calc(100% - 32px)); }
  .nav-toggle { display: block; font-size: 13px; }
  .site-nav { position: absolute; top: 82px; left: 16px; right: 16px; display: none; flex-direction: column; align-items: stretch; gap: 0; border: 1px solid var(--line); background: var(--paper); padding: 10px 18px; box-shadow: var(--shadow); }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 11px 0; border-bottom: 1px solid var(--line); }
  .site-nav a:last-child { border-bottom: 0; }
  .home-hero { grid-template-columns: 1fr; padding: 70px 0 82px; }
  .hero-vline { display: none; }
  .article-stamp { display: none; }
  .hero-feature { max-width: 560px; }
  .hero-stats { margin-top: 46px; }
  .latest-grid { grid-template-columns: repeat(2, 1fr); }
  .archive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-section { grid-template-columns: 1fr; gap: 30px; }
  .reader-layout { grid-template-columns: 1fr; gap: 24px; }
  .article-toc { position: static; border: 1px solid var(--line); padding: 16px; }
  .article-toc nav { max-height: 180px; overflow: auto; }
  .about-layout { grid-template-columns: .7fr 1fr; gap: 34px; }
}

@media (max-width: 580px) {
  .header-inner, main, .site-footer { width: calc(100% - 28px); }
  .brand-copy small { display: none; }
  .home-hero { padding-top: 52px; }
  .archive-stats { gap: 8px; }
  .archive-stats div { min-height: 92px; }
  .archive-stats strong { font-size: 34px; }
  .hero-copy h1, .page-intro h1 { font-size: clamp(40px, 13vw, 58px); }
  .article-header h1 { font-size: clamp(26px, 8vw, 38px); }
  .hero-lede, .page-intro > p:last-child, .article-header > p { font-size: 15px; }
  .latest-grid, .archive-grid, .category-page-grid { grid-template-columns: 1fr; }
  .latest-section, .category-section, .archive-shell { padding-bottom: 70px; }
  .archive-shell-compact { margin-top: 34px; }
  .category-page-grid a { min-height: 220px; }
  .section-heading { align-items: start; flex-direction: column; gap: 12px; }
  .page-intro { padding: 58px 0 44px; }
  .article-header { padding: 52px 0 45px; }
  .back-link { margin-bottom: 36px; }
  .article-body { font-size: 17px; line-height: 1.95; }
  .article-body h2 { font-size: 28px; }
  .article-nav { grid-template-columns: 1fr; gap: 22px; }
  .article-nav a:last-child { text-align: left; }
  .about-layout { grid-template-columns: 1fr; padding: 60px 0 90px; }
  .about-portrait { max-width: 280px; margin: 0 auto; }
  .site-footer { flex-direction: column; }
  .footer-links { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
