/* 碎笔 —— 与学术主页（Lato / 白底）完全独立的一套皮：暖纸色 + 衬线 */

:root {
  --paper: #faf6ee;
  --ink: #3d372e;
  --muted: #9a907f;
  --accent: #b25d3f;
  --rule: #e6dfd2;
  --code-bg: #f1ebdf;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #211e19;
    --ink: #d9d2c4;
    --muted: #857c6c;
    --accent: #d08a6a;
    --rule: #3a342b;
    --code-bg: #2b2721;
  }
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0 auto;
  padding: 4rem 1.5rem 2.5rem;
  max-width: 40rem; /* 中文正文 ~35 字/行的甜区；刻意窄于主站，见 DECISIONS.md */
  color: var(--ink);
  font-family: Georgia, "Times New Roman", "Songti SC", "Noto Serif SC", "Noto Serif CJK SC", "SimSun", serif;
  font-size: 17px;
  line-height: 1.95;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* —— 目录页 —— */

.site-header { margin-bottom: 2.8rem; }
.site-header h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: 0.35em;
  text-indent: 0.35em; /* 抵消最后一个字后面的字距，保持视觉居左 */
}
.site-header .tagline {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.year-group { margin-bottom: 2rem; }
.year {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.15em;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.35rem;
}

.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { margin: 0; }
.post-list li + li { margin-top: 0.4rem; }
.post-list a {
  display: flex;
  gap: 1.1rem;
  align-items: baseline;
  padding: 0.55rem 0.5rem;
  color: var(--ink);
  border-radius: 8px;
}
.post-list a:hover { text-decoration: none; background: var(--code-bg); }
.post-list .d {
  flex: none;
  width: 3.6rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.post-list .entry {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.post-list a:hover .t { color: var(--accent); }
.post-list .ex {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.75;
}

/* —— 文章页 —— */

.post-date {
  margin: 0 0 0.3rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.post-title {
  margin: 0 0 2rem;
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1.5;
}

.post-body p { margin: 0 0 1.1em; }
.post-body h2 { font-size: 1.2rem; margin: 2em 0 0.7em; }
.post-body h3 { font-size: 1.05rem; margin: 1.6em 0 0.6em; }

.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  margin: 1.4em auto;
}

.post-body blockquote {
  margin: 1.4em 0;
  padding: 0.1em 1.1em;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

.post-body hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2.2em auto;
  width: 38%;
}

.post-body code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}
.post-body pre {
  background: var(--code-bg);
  padding: 0.9em 1.1em;
  border-radius: 8px;
  overflow-x: auto;
  line-height: 1.6;
}
.post-body pre code { background: none; padding: 0; }

.post-body ul, .post-body ol { padding-left: 1.6em; }

.post-views {
  margin: 3rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.post-views:not([hidden]) + .back { margin-top: 0.5rem; }

.back { margin-top: 3rem; font-size: 0.95rem; }

/* —— 页脚 —— */

footer {
  max-width: 40rem; /* 中文正文 ~35 字/行的甜区；刻意窄于主站，见 DECISIONS.md */
  margin: 3.5rem auto 0;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  text-align: center;
  font-size: 0.85rem;
}
footer a { color: var(--muted); }
