:root {
  color-scheme: light;
  --bg: #f6fbfa;
  --surface: #ffffff;
  --surface-soft: #edf8f5;
  --text: #173b3c;
  --muted: #668285;
  --line: #d5e9e5;
  --jade: #168c7e;
  --jade-dark: #0c685f;
  --sky: #389ccc;
  --shadow: 0 12px 36px rgba(23, 76, 76, 0.09);
  --header-bg: rgba(246, 251, 250, 0.88);
  --max: 1120px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f2224;
  --surface: #152d2f;
  --surface-soft: #1b3838;
  --text: #e7f4f1;
  --muted: #9eb9b7;
  --line: #2b4b4a;
  --jade: #54c7b2;
  --jade-dark: #86dfcf;
  --sky: #72c5e9;
  --shadow: 0 14px 38px rgba(0, 0, 0, 0.23);
  --header-bg: rgba(15, 34, 36, 0.9);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  line-height: 1.7;
  transition: background-color .25s ease, color .25s ease;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 74px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 0 max(24px, calc((100vw - var(--max)) / 2));
  background: var(--header-bg);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(16px);
  transition: border-color .2s, box-shadow .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: 0 4px 20px rgba(26, 75, 73, .05); }
.brand { display: inline-flex; align-items: center; gap: 11px; min-width: 0; justify-self: start; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--jade); background: var(--surface); border-radius: 50%; flex: 0 0 auto; }
.brand-mark svg { width: 18px; height: 18px; }
.brand strong, .brand small { display: block; line-height: 1.2; }
.brand strong { font: 600 14px/1.2 Georgia, "Times New Roman", serif; white-space: nowrap; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.desktop-nav { display: flex; gap: 34px; align-items: center; }
.desktop-nav a { position: relative; color: var(--muted); font-size: 14px; padding: 25px 2px 23px; }
.desktop-nav a::after { content: ""; position: absolute; left: 50%; right: 50%; bottom: 17px; height: 2px; background: var(--jade); transition: left .2s, right .2s; }
.desktop-nav a:hover, .desktop-nav a.active { color: var(--text); }
.desktop-nav a.active::after { left: 2px; right: 2px; }
.header-actions { display: flex; justify-content: flex-end; gap: 7px; }
.icon-button { width: 38px; height: 38px; border: 0; background: transparent; display: grid; place-items: center; border-radius: 50%; cursor: pointer; }
.icon-button:hover { background: var(--surface-soft); color: var(--jade); }
.mobile-only { display: none; }
.mobile-nav { display: none; }
.reading-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--jade); z-index: 60; }

.hero { position: relative; min-height: min(680px, calc(100vh - 74px)); display: flex; align-items: flex-end; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(7, 42, 42, .78) 0%, rgba(10, 57, 58, .48) 47%, rgba(15, 63, 65, .12) 100%); z-index: 1; }
.hero-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-content { position: relative; z-index: 2; width: min(var(--max), calc(100% - 48px)); margin: 0 auto; padding: 110px 0 76px; color: #fff; }
.hero-kicker { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; color: #d3f4ed; font-size: 13px; letter-spacing: 0; }
.hero-kicker::before { content: ""; width: 34px; height: 1px; background: #9ee0d4; }
.hero h1 { max-width: 790px; margin: 0; font: 500 clamp(46px, 6vw, 76px)/1.03 Georgia, "Times New Roman", serif; letter-spacing: 0; text-wrap: balance; }
.hero-copy { max-width: 520px; margin: 24px 0 32px; font-size: 17px; color: rgba(255,255,255,.86); }
.hero-link { display: inline-flex; align-items: center; gap: 10px; padding: 11px 18px; border: 1px solid rgba(255,255,255,.65); font-size: 14px; transition: background .2s, color .2s; }
.hero-link:hover { background: #fff; color: #164445; }
.hero-link svg { width: 17px; height: 17px; }

.home-section, .page-shell { width: min(var(--max), calc(100% - 48px)); margin: 0 auto; }
.home-section { padding: 72px 0; }
.section-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin-bottom: 30px; }
.section-head h2 { margin: 0 0 4px; font: 500 30px/1.2 Georgia, "Times New Roman", serif; }
.section-head p { margin: 0; color: var(--muted); font-size: 14px; }
.section-link { color: var(--jade-dark); font-size: 14px; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.section-link svg { width: 16px; height: 16px; }
.post-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.post-card { position: relative; min-height: 255px; padding: 30px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; transition: transform .2s, box-shadow .2s, border-color .2s; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--jade) 40%, var(--line)); }
.post-card::after { content: ""; position: absolute; top: 0; right: 0; width: 82px; height: 5px; background: var(--card-accent, var(--jade)); }
.post-card[data-accent="sky"] { --card-accent: #55acd4; }
.post-card[data-accent="mint"] { --card-accent: #6dc3a3; }
.post-card[data-accent="deep"] { --card-accent: #28776f; }
.post-card[data-accent="sun"] { --card-accent: #d6ac55; }
.post-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; color: var(--muted); font-size: 12px; }
.post-meta .category { color: var(--jade-dark); }
.post-meta .dot::before { content: "·"; }
.post-card h3 { max-width: 500px; margin: 20px 0 13px; font: 500 25px/1.35 Georgia, "Noto Serif CJK SC", serif; }
.post-card p { margin: 0; color: var(--muted); font-size: 14px; }
.post-card .read-more { position: absolute; left: 30px; bottom: 24px; display: inline-flex; align-items: center; gap: 5px; color: var(--jade-dark); font-size: 13px; }
.post-card .read-more svg { width: 15px; height: 15px; transition: transform .2s; }
.post-card:hover .read-more svg { transform: translateX(3px); }
.quiet-strip { background: var(--surface-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.quiet-inner { width: min(var(--max), calc(100% - 48px)); margin: 0 auto; padding: 54px 0; display: grid; grid-template-columns: 1.2fr .8fr; gap: 70px; align-items: center; }
.quiet-inner blockquote { margin: 0; font: 400 27px/1.5 Georgia, "Noto Serif CJK SC", serif; }
.quiet-inner blockquote span { display: block; margin-top: 12px; color: var(--muted); font: 13px/1.5 "Microsoft YaHei UI", sans-serif; }
.mini-about { border-left: 1px solid var(--line); padding-left: 38px; }
.mini-about strong { display: block; margin-bottom: 8px; font: 500 18px Georgia, serif; }
.mini-about p { color: var(--muted); font-size: 14px; margin: 0 0 14px; }

.page-shell { min-height: calc(100vh - 240px); padding: 72px 0 90px; }
.page-title { max-width: 700px; margin-bottom: 44px; }
.page-title .eyebrow { color: var(--jade); font-size: 12px; text-transform: uppercase; }
.page-title h1 { margin: 9px 0 12px; font: 500 46px/1.15 Georgia, "Noto Serif CJK SC", serif; }
.page-title p { color: var(--muted); margin: 0; }
.archive-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 35px; }
.filter-button { border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: 999px; cursor: pointer; font-size: 13px; color: var(--muted); }
.filter-button:hover, .filter-button.active { color: #fff; border-color: var(--jade); background: var(--jade); }
.archive-list { border-top: 1px solid var(--line); }
.archive-item { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 28px; padding: 25px 0; border-bottom: 1px solid var(--line); }
.archive-date { font: 14px Georgia, serif; color: var(--muted); }
.archive-item h2 { margin: 0 0 5px; font: 500 22px/1.3 Georgia, "Noto Serif CJK SC", serif; }
.archive-item p { margin: 0; color: var(--muted); font-size: 13px; }
.archive-item svg { color: var(--jade); }
.empty-state { padding: 60px 0; color: var(--muted); text-align: center; }

.article-shell { width: min(760px, calc(100% - 48px)); margin: 0 auto; padding: 48px 0 100px; }
.back-link { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; margin-bottom: 50px; }
.back-link svg { width: 16px; }
.article-header { margin-bottom: 46px; }
.article-header .post-meta { margin-bottom: 18px; }
.article-header h1 { margin: 0 0 22px; font: 500 48px/1.18 Georgia, "Noto Serif CJK SC", serif; text-wrap: balance; }
.article-header .dek { color: var(--muted); font-size: 17px; margin: 0; }
.article-body { font-family: Georgia, "Noto Serif CJK SC", "Songti SC", serif; font-size: 17px; line-height: 2; }
.article-body p { margin: 0 0 24px; }
.article-body .lead { font-size: 20px; color: color-mix(in srgb, var(--text) 88%, var(--muted)); }
.article-body h2 { margin: 50px 0 18px; font-size: 27px; font-weight: 500; }
.article-body blockquote { margin: 36px 0; padding: 4px 0 4px 24px; border-left: 3px solid var(--jade); color: var(--jade-dark); font-size: 21px; }
.article-end { margin-top: 56px; padding-top: 26px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.tag-list { display: flex; gap: 7px; flex-wrap: wrap; }
.tag { padding: 5px 10px; background: var(--surface-soft); color: var(--muted); font-size: 12px; border-radius: 999px; }
.share-button { display: inline-flex; align-items: center; gap: 7px; background: transparent; border: 1px solid var(--line); padding: 8px 12px; cursor: pointer; }
.share-button:hover { border-color: var(--jade); color: var(--jade-dark); }
.share-button svg { width: 16px; }

.about-layout { display: grid; grid-template-columns: 280px 1fr; gap: 70px; align-items: start; }
.about-portrait { aspect-ratio: 4/5; background: var(--surface-soft); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.about-portrait img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.75); }
.about-copy h1 { margin: 0 0 22px; font: 500 46px/1.15 Georgia, "Noto Serif CJK SC", serif; }
.about-copy .lead { font-size: 20px; color: var(--jade-dark); }
.about-copy p { color: var(--muted); }
.about-note { margin-top: 32px; padding: 24px; border-left: 3px solid var(--sky); background: var(--surface-soft); }

.site-footer { width: min(var(--max), calc(100% - 48px)); margin: 0 auto; padding: 45px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 12px 30px; align-items: center; color: var(--muted); }
.footer-brand { color: var(--text); font: 500 18px Georgia, serif; }
.site-footer p { font-size: 12px; margin: 4px 0 0; }
.site-footer small { grid-column: 1/-1; font-size: 11px; }
.footer-links { display: flex; gap: 18px; font-size: 12px; }
.footer-links a { display: flex; align-items: center; gap: 6px; }
.footer-links svg { width: 15px; height: 15px; }

.search-dialog { width: min(640px, calc(100% - 32px)); max-height: min(620px, calc(100vh - 60px)); padding: 0; border: 1px solid var(--line); background: var(--surface); color: var(--text); box-shadow: 0 24px 80px rgba(0,0,0,.22); }
.search-dialog::backdrop { background: rgba(7, 31, 32, .48); backdrop-filter: blur(3px); }
.search-head { height: 66px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 0 12px 0 20px; border-bottom: 1px solid var(--line); }
.search-head > svg { color: var(--jade); }
.search-head input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; }
.search-results { padding: 8px; overflow-y: auto; max-height: 470px; }
.search-result { display: block; padding: 15px; border-bottom: 1px solid var(--line); }
.search-result:last-child { border-bottom: 0; }
.search-result:hover { background: var(--surface-soft); }
.search-result strong { display: block; font: 500 17px Georgia, "Noto Serif CJK SC", serif; }
.search-result span { color: var(--muted); font-size: 12px; }
.search-empty { padding: 55px 20px; text-align: center; color: var(--muted); font-size: 14px; }
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 70; transform: translate(-50%, 20px); padding: 9px 15px; background: var(--text); color: var(--bg); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; font-size: 13px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 760px) {
  .site-header { height: 66px; grid-template-columns: 1fr auto; padding: 0 18px; }
  .brand strong { max-width: 210px; overflow: hidden; text-overflow: ellipsis; }
  .brand small, .desktop-nav { display: none; }
  .mobile-only { display: grid; }
  .mobile-nav { position: fixed; top: 66px; left: 0; right: 0; z-index: 29; padding: 10px 18px 18px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .mobile-nav.open { display: grid; }
  .mobile-nav a { padding: 11px 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
  .mobile-nav a:last-child { border-bottom: 0; }
  .hero { min-height: 620px; }
  .hero::before { background: linear-gradient(0deg, rgba(7, 42, 42, .82), rgba(10, 57, 58, .15)); }
  .hero-content { width: calc(100% - 36px); padding-bottom: 58px; }
  .hero h1 { font-size: clamp(42px, 13vw, 58px); }
  .hero-copy { font-size: 15px; }
  .home-section, .page-shell, .quiet-inner, .site-footer { width: calc(100% - 36px); }
  .home-section { padding: 55px 0; }
  .post-grid { grid-template-columns: 1fr; }
  .post-card { min-height: 270px; padding: 25px; }
  .post-card .read-more { left: 25px; }
  .quiet-inner { grid-template-columns: 1fr; gap: 30px; }
  .quiet-inner blockquote { font-size: 23px; }
  .mini-about { border-left: 0; border-top: 1px solid var(--line); padding: 28px 0 0; }
  .page-shell { padding-top: 52px; }
  .page-title h1, .about-copy h1 { font-size: 37px; }
  .archive-item { grid-template-columns: 82px 1fr; gap: 16px; }
  .archive-item > svg { display: none; }
  .about-layout { grid-template-columns: 1fr; gap: 34px; }
  .about-portrait { aspect-ratio: 16/8; }
  .article-shell { width: calc(100% - 36px); padding-top: 36px; }
  .back-link { margin-bottom: 35px; }
  .article-header h1 { font-size: 38px; }
  .article-body { font-size: 16px; }
  .article-body .lead { font-size: 18px; }
  .article-end { align-items: flex-start; flex-direction: column; }
  .site-footer { grid-template-columns: 1fr; }
  .site-footer small { grid-column: 1; }
  .footer-links { margin-top: 8px; }
}

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