:root {
  --text: #222;
  --muted: #727272;
  --line: #e5e5e5;
  --background: #fff;
  --accent: #087f5b;
  --content: 820px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--text); background: var(--background); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.75; }
a { color: inherit; }
button, input { font: inherit; }

.site-header { height: 62px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; line-height: 1.1; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 4px; background: var(--accent); color: #fff; font-weight: 700; }
.brand strong { display: block; font-size: 15px; }
.brand small { display: none; }
.top-nav { display: flex; gap: 24px; font-size: 14px; }
.top-nav a { color: var(--muted); text-decoration: none; }
.top-nav a:hover { color: var(--accent); }
.icon-button { display: none; width: 38px; height: 38px; padding: 8px; border: 0; background: transparent; }
.icon-button span { display: block; height: 2px; margin: 5px 0; background: var(--text); }
.reading-progress { position: fixed; top: 61px; left: 0; z-index: 30; width: 0; height: 2px; background: var(--accent); }

#app { min-height: calc(100vh - 124px); }
.home, .about { max-width: var(--content); margin: 0 auto; padding: 64px 24px 80px; }
.intro { padding-bottom: 42px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 12px; font-weight: 700; }
.intro h1, .about h1 { margin: 0; font-size: 34px; line-height: 1.25; letter-spacing: 0; }
.intro h1 br { display: none; }
.intro-copy { max-width: 590px; margin-top: 14px; color: var(--muted); font-size: 15px; }
.intro-copy strong { display: inline; margin-right: 4px; color: var(--text); font-size: inherit; }
.collection-head { padding-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.collection-head h2 { margin: 0; font-size: 20px; }
.search { width: 240px; position: relative; }
.search input { width: 100%; height: 38px; padding: 0 34px 0 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--background); outline: none; }
.search input:focus { border-color: var(--accent); }
.search span { position: absolute; top: 5px; right: 11px; color: var(--muted); }
.articles { display: block; }
.article-card { padding: 24px 0; display: grid; grid-template-columns: 38px 1fr; gap: 12px; border-bottom: 1px solid var(--line); text-decoration: none; }
.article-index { padding-top: 4px; color: var(--muted); font: 12px/1.5 ui-monospace, monospace; }
.article-card h3 { margin: 0 0 6px; font-size: 20px; line-height: 1.35; }
.article-card p { margin: 0; color: var(--muted); font-size: 14px; }
.article-meta { margin-top: 9px; display: flex; gap: 12px; color: var(--muted); font-size: 12px; }
.article-card:hover h3 { color: var(--accent); }
.empty { padding: 30px 0; color: var(--muted); }

.reader { max-width: 1080px; margin: 0 auto; padding: 52px 24px 84px; display: grid; grid-template-columns: minmax(0, 760px) 180px; gap: 56px; }
.article-head { margin-bottom: 40px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.back-link { color: var(--accent); font-size: 13px; text-decoration: none; }
.article-head h1 { margin: 15px 0 10px; font-size: 36px; line-height: 1.25; letter-spacing: 0; }
.prose { font-size: 16px; }
.prose h2, .prose h3, .prose h4 { scroll-margin-top: 82px; line-height: 1.4; letter-spacing: 0; }
.prose h2 { margin: 2.3em 0 .7em; padding-bottom: .3em; border-bottom: 1px solid var(--line); font-size: 25px; }
.prose h3 { margin: 1.8em 0 .5em; font-size: 20px; }
.prose h4 { font-size: 17px; }
.prose p { margin: 1em 0; }
.prose ul { padding-left: 1.3em; }
.prose a { color: var(--accent); text-underline-offset: 3px; }
.prose img { max-width: 100%; height: auto; margin: 14px 0; border: 1px solid var(--line); }
.inline-code { padding: .12em .3em; border-radius: 3px; background: #edf5f1; color: #086c50; font: .9em ui-monospace, monospace; }
.code-wrap { position: relative; margin: 20px 0; }
.code-wrap pre { margin: 0; padding: 20px; overflow-x: auto; border-radius: 4px; background: #202522; color: #e7ece9; font: 13px/1.7 "SFMono-Regular", Consolas, monospace; tab-size: 4; }
.code-lang { position: absolute; top: 8px; right: 43px; color: #95a099; font: 10px/1 monospace; text-transform: uppercase; }
.copy { position: absolute; top: 4px; right: 6px; width: 32px; height: 32px; border: 0; background: transparent; color: #aab4ae; cursor: pointer; }
.copy:hover { color: #fff; }
.toc { position: sticky; top: 90px; align-self: start; padding-left: 16px; border-left: 1px solid var(--line); }
.toc strong { display: block; margin-bottom: 10px; font-size: 12px; }
.toc a { display: block; margin: 7px 0; color: var(--muted); font-size: 12px; line-height: 1.45; text-decoration: none; }
.toc a.level-3 { padding-left: 10px; }
.toc a:hover, .toc a.active { color: var(--accent); }
.about p { color: var(--muted); }
.loading { min-height: 60vh; display: grid; place-content: center; color: var(--muted); }
.loading span { width: 22px; height: 22px; margin: 0 auto 12px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.site-footer { max-width: var(--content); margin: 0 auto; padding: 20px 24px; display: flex; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

@media (max-width: 760px) {
  .site-header { height: 58px; padding: 0 16px; }
  .reading-progress { top: 57px; }
  .icon-button { display: block; }
  .top-nav { display: none; position: absolute; top: 57px; left: 0; right: 0; padding: 16px; flex-direction: column; gap: 12px; border-bottom: 1px solid var(--line); background: #fff; }
  .top-nav.open { display: flex; }
  .home, .about { padding: 42px 18px 60px; }
  .intro { padding-bottom: 34px; }
  .intro h1, .about h1 { font-size: 29px; }
  .collection-head { align-items: stretch; flex-direction: column; gap: 14px; }
  .search { width: 100%; }
  .article-card { grid-template-columns: 30px 1fr; }
  .article-card h3 { font-size: 18px; }
  .reader { padding: 36px 18px 64px; grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
  .article-head h1 { font-size: 30px; }
  .prose { font-size: 15px; }
  .prose h2 { font-size: 22px; }
  .site-footer { margin: 0 18px; padding: 18px 0; flex-direction: column; gap: 4px; }
}
