/* ─────────────────────────────────────────────
   woacg blog — 纯中文排版克制风
   ───────────────────────────────────────────── */

:root {
  --bg: #fbfaf8;
  --fg: #23201d;
  --muted: #7d766e;
  --faint: #a8a099;
  --line: #e6e1da;
  --accent: #b4553c;
  --accent-soft: #f3e7e2;
  --code-bg: #f3f0eb;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC",
    "Noto Sans CJK SC", sans-serif;
  --serif: "Songti SC", "Source Han Serif SC", "Noto Serif CJK SC",
    "Georgia", "Times New Roman", serif;

  --w: 42rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1817;
    --fg: #e6e1da;
    --muted: #9a938b;
    --faint: #6d6760;
    --line: #322d2a;
    --accent: #d98561;
    --accent-soft: #2e2320;
    --code-bg: #242120;
  }
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--accent);
}

/* ── 页头 ── */
.site-head {
  max-width: var(--w);
  margin: 0 auto;
  padding: 2.2rem 1.4rem 1.2rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--serif);
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 0.32em;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 0.42em;
}

.site-nav {
  display: flex;
  gap: 1.15rem;
  font-size: 0.9rem;
  color: var(--muted);
}

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

/* ── 主体 ── */
.wrap {
  max-width: var(--w);
  margin: 0 auto;
  padding: 1.4rem 1.4rem 4rem;
}

.hero {
  padding: 1.6rem 0 2.4rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2.6rem;
}

.hero h1 {
  font-family: var(--serif);
  font-size: 2.05rem;
  line-height: 1.35;
  margin: 0 0 0.6rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

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

.eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--faint);
  text-transform: uppercase;
  margin: 0 0 1.1rem;
}

.page-head {
  margin-bottom: 2.2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--line);
}

.page-head h1 {
  font-family: var(--serif);
  font-size: 1.7rem;
  margin: 0 0 0.3rem;
  font-weight: 600;
}

.count {
  margin: 0;
  color: var(--faint);
  font-size: 0.85rem;
}

/* ── 分区卡片 ── */
.section-list {
  margin-bottom: 3rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.75rem;
}

.card {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.card:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--fg);
}

.card-t {
  font-family: var(--serif);
  font-size: 1rem;
}

.card-n {
  font-size: 0.78rem;
  color: var(--faint);
}

/* ── 文章列表 ── */
.posts {
  list-style: none;
  margin: 0;
  padding: 0;
}

.item {
  padding: 1.35rem 0;
  border-bottom: 1px dashed var(--line);
}

.item:first-child {
  padding-top: 0.2rem;
}

.item .meta {
  font-size: 0.78rem;
  color: var(--faint);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.42rem;
  font-variant-numeric: tabular-nums;
}

.sep {
  color: var(--line);
}

.item .tag:hover {
  color: var(--accent);
}

.item .title {
  display: block;
  font-family: var(--serif);
  font-size: 1.16rem;
  font-weight: 600;
  line-height: 1.55;
  transition: color 0.15s ease;
}

.item .summary {
  margin: 0.42rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.75;
}

.empty {
  color: var(--faint);
  font-size: 0.9rem;
}

/* ── 文章页 ── */
.article-head {
  margin-bottom: 2.4rem;
}

.article-head .meta {
  font-size: 0.8rem;
  color: var(--faint);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
  flex-wrap: wrap;
}

.article-head h1 {
  font-family: var(--serif);
  font-size: 1.85rem;
  line-height: 1.5;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.01em;
}

.prose {
  font-size: 1.02rem;
  line-height: 1.95;
  color: var(--fg);
}

/* 中文首行缩进是可选的，这里用段间距而非缩进，读起来更松 */
.prose > p {
  margin: 0 0 1.35em;
  text-align: justify;
  text-justify: inter-ideograph;
}

.prose h2 {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 2.6em 0 0.9em;
  padding-bottom: 0.35em;
  border-bottom: 1px solid var(--line);
}

.prose h3 {
  font-size: 1.12rem;
  font-weight: 600;
  margin: 2em 0 0.7em;
}

.prose h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.7em 0 0.6em;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in srgb, var(--accent) 38%, transparent);
}

.prose a:hover {
  text-decoration-color: var(--accent);
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1.6em 0;
}

.prose ul,
.prose ol {
  margin: 0 0 1.35em;
  padding-left: 1.5em;
}

.prose li {
  margin: 0.4em 0;
}

.prose li > ul,
.prose li > ol {
  margin: 0.4em 0 0.2em;
}

.prose blockquote {
  margin: 1.6em 0;
  padding: 0.2em 0 0.2em 1.1em;
  border-left: 2px solid var(--accent);
  color: var(--muted);
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose code {
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: var(--code-bg);
  padding: 0.14em 0.38em;
  border-radius: 4px;
}

.prose pre {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1em 1.15em;
  overflow-x: auto;
  margin: 1.6em 0;
  line-height: 1.7;
}

.prose pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2.6em auto;
  width: 42%;
}

.prose strong {
  font-weight: 600;
}

/* ── 上一篇 / 下一篇 ── */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 3.4rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.pager a {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  color: var(--fg);
  line-height: 1.6;
}

.pager a span {
  font-size: 0.76rem;
  color: var(--faint);
}

.pager-next {
  text-align: right;
}

/* ── 页脚 ── */
.site-foot {
  max-width: var(--w);
  margin: 0 auto;
  padding: 1.6rem 1.4rem 3rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--faint);
  border-top: 1px solid var(--line);
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.7rem; }
  .article-head h1 { font-size: 1.5rem; }
  .prose { font-size: 1rem; line-height: 1.9; }
  .pager { grid-template-columns: 1fr; }
  .pager-next { text-align: left; }
}
