:root {
  --bg: #faf9f6;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #59636e;
  --border: #e5e2dc;
  --accent: #2c5e4f;
  --accent-soft: #eaf2ef;
  --code-bg: #f3f1ec;
  --maxw: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141618;
    --surface: #1b1e21;
    --text: #e6e8ea;
    --muted: #9aa2ac;
    --border: #2a2f35;
    --accent: #73b69f;
    --accent-soft: #1d2d28;
    --code-bg: #202429;
  }
}

* { box-sizing: border-box; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Segoe UI", Roboto, sans-serif;
  line-height: 1.78;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
}

header.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 0;
}

.brand {
  font-size: 1.15rem;
  font-weight: 650;
  color: var(--text);
  letter-spacing: 0.02em;
}

.brand:hover {
  text-decoration: none;
  color: var(--accent);
}

nav.site-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.94rem;
}

nav.site-nav a {
  color: var(--muted);
}

nav.site-nav a:hover,
nav.site-nav a.active {
  color: var(--text);
  text-decoration: none;
}

main {
  padding: 2.5rem 0 4rem;
}

.intro {
  margin-bottom: 2.75rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.intro h1 {
  margin: 0 0 0.65rem;
  font-size: 1.65rem;
  line-height: 1.35;
  font-weight: 650;
}

.intro p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.section-label {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1.6rem;
}

.post-card {
  padding: 1.35rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.15s ease;
}

.post-card:hover {
  border-color: var(--accent);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.84rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.tag {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
}

.post-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  line-height: 1.4;
}

.post-card h2 a {
  color: var(--text);
}

.post-card h2 a:hover {
  color: var(--accent);
  text-decoration: none;
}

.post-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

article.prose h1 {
  font-size: 1.75rem;
  line-height: 1.35;
  margin: 0 0 0.75rem;
}

article.prose h2 {
  font-size: 1.25rem;
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

article.prose p {
  margin: 1rem 0;
}

article.prose ul {
  padding-left: 1.35rem;
}

article.prose li {
  margin: 0.4rem 0;
}

article.prose blockquote {
  margin: 1.4rem 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  color: var(--muted);
  border-radius: 0 6px 6px 0;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.6;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88em;
}

p code, li code {
  background: var(--code-bg);
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
}

.archive-group {
  margin-bottom: 2rem;
}

.archive-group h2 {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.archive-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--border);
}

.archive-date {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86rem;
  color: var(--muted);
  flex-shrink: 0;
}

.back-link {
  display: inline-block;
  margin-top: 2rem;
  font-size: 0.92rem;
}

footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 0 2.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
}

@media (max-width: 600px) {
  .header-inner { flex-direction: column; align-items: flex-start; }
  .archive-row { flex-direction: column; gap: 0.2rem; }
}
