/* 北方的秋天 · 信件排版 · 灵感来源：Gary Halbert 的信件风格
   改风格 = 只改 :root 变量，不要重写组件部分 */
:root {
  --bg: #faf7f1;
  --text: #1a1714;
  --muted: #6b635a;
  --light: #9a9088;
  --fill: rgba(26, 23, 20, .04);
  --fill-strong: rgba(26, 23, 20, .07);
  --link: #1a1714;
  --link-underline: rgba(26, 23, 20, .3);
  --link-underline-hover: var(--text);
  --accent: #8b3a2f;
  --code-bg: #efe9e1;
  --invert-bg: #1a1714;
  --invert-text: #faf7f1;
  --max: 640px;
  --sans: Georgia, "Songti SC", "Source Serif 4", "Noto Serif SC", serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #181612;
  --text: #e8e0d6;
  --muted: #a59a8e;
  --light: #736961;
  --fill: rgba(232, 224, 214, .05);
  --fill-strong: rgba(232, 224, 214, .08);
  --link: #e8e0d6;
  --link-underline: rgba(232, 224, 214, .3);
  --link-underline-hover: var(--text);
  --accent: #c9785e;
  --code-bg: #221f1a;
  --invert-bg: #e8e0d6;
  --invert-text: #181612;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 200ms ease, color 200ms ease;
}

/* ---- 布局 ---- */
.site { max-width: var(--max); margin: 0 auto; padding: 72px 24px 96px; }

/* ---- 标题 ---- */
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 700; letter-spacing: -0.01em; }
h1 { margin-bottom: 32px; font-size: 28px; }
h2 { margin-top: 56px; margin-bottom: 20px; font-size: 22px; }
h3 { margin-top: 32px; margin-bottom: 8px; font-size: 19px; }

/* ---- 正文 ---- */
p { margin: 0 0 20px; }
.lead { font-size: 19.5px; line-height: 1.8; }
ul, ol { margin: 0 0 24px 1.4em; padding: 0; }
li { margin: 8px 0; padding-left: 2px; }

/* ---- 链接 ---- */
a {
  color: var(--link);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--link-underline);
  transition: text-decoration-color 150ms ease;
}
a:hover { text-decoration-color: var(--link-underline-hover); }

/* ---- 辅助文本 ---- */
.meta { color: var(--muted); }
.small { color: var(--light); font-size: 14.5px; }
strong, b { font-weight: 700; }
em { font-style: italic; }

/* ---- 信件头：From / Date ---- */
.letter-header {
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--fill-strong);
}
.letter-header .from { font-size: 15px; color: var(--muted); line-height: 1.7; }
.letter-header .from strong { color: var(--text); font-size: 16px; }
.letter-header .date { font-size: 15px; color: var(--light); font-style: italic; margin-top: 4px; }

/* ---- 信件正文 ---- */
.letter-body { font-size: 18px; line-height: 1.9; }
.letter-body p { margin-bottom: 22px; }

/* ---- 签名 ---- */
.signature {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--fill-strong);
}
.signature .name { font-size: 17px; font-weight: 700; }
.signature .title { font-size: 14.5px; color: var(--muted); font-style: italic; margin-top: 2px; }

/* ---- 附言（P.S.） ---- */
.postscript {
  margin-top: 32px;
  padding: 16px 20px;
  background: var(--fill);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  font-size: 16.5px;
  line-height: 1.75;
}
.postscript .ps-label { font-weight: 700; color: var(--accent); }

/* ---- 信件列表（归档页 / 首页） ---- */
.letter-list { margin: 0; padding: 0; list-style: none; }
.letter-list li {
  padding: 20px 0;
  border-bottom: 1px solid var(--fill-strong);
}
.letter-list li:last-child { border-bottom: none; }
.letter-list .ll-date { font-size: 13.5px; color: var(--light); font-style: italic; }
.letter-list .ll-title {
  display: block;
  margin: 6px 0 4px;
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  line-height: 1.35;
}
.letter-list .ll-title:hover { color: var(--accent); }
.letter-list .ll-excerpt { font-size: 15px; color: var(--muted); line-height: 1.65; margin: 0; }

/* ---- 联系按钮 ---- */
.contact-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 32px 0 8px; }
.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border: none;
  border-radius: 4px;
  font-size: 14.5px;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 150ms ease, background-color 150ms ease;
}
.contact-btn--dark { background: var(--invert-bg); color: var(--invert-text); }
.contact-btn--dark:hover { opacity: .85; color: var(--invert-text); }
.contact-btn--light { background: var(--fill); color: var(--text); }
.contact-btn--light:hover { background: var(--fill-strong); color: var(--text); }

/* ---- 引用 ---- */
blockquote {
  margin: 24px 0;
  padding: 12px 20px;
  border-left: 3px solid var(--accent);
  background: var(--fill);
  color: var(--muted);
  font-style: italic;
  font-size: 17px;
  border-radius: 0 4px 4px 0;
}
blockquote p { margin: 0; }

/* ---- 分隔线 ---- */
hr { border: none; border-top: 1px solid var(--fill-strong); margin: 40px 0; }

/* ---- 页脚 ---- */
.site-footer {
  margin-top: 80px;
  padding-top: 24px;
  border-top: 1px solid var(--fill-strong);
  color: var(--light);
  font-size: 14px;
  line-height: 1.65;
}
.site-footer a { color: var(--muted); }

/* ---- 标签 / 状态 ---- */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 3px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--fill);
  color: var(--muted);
}

/* ---- 响应式 ---- */
@media (max-width: 640px) {
  body { font-size: 17px; }
  .site { padding: 56px 20px 80px; }
  h1 { font-size: 24px; }
  h2 { font-size: 20px; margin-top: 44px; }
  .letter-body { font-size: 17px; line-height: 1.85; }
  .letter-list .ll-title { font-size: 17.5px; }
}

/* ---- 无障碍 ---- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
