/* ============================================================
   拾光札记 · 个人博客主题
   个性简约：暖纸底色 + 墨字 + 朱砂点缀 + 衬线标题
   ============================================================ */
:root {
  --bg: #f7f3ec;
  --bg-soft: #efe9dd;
  --card: #fffdf8;
  --ink: #26221c;
  --ink-soft: #6b655a;
  --line: #ded5c3;
  --accent: #b3452a;
  --accent-soft: #f2dfd4;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --sans: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --shadow: 0 1px 2px rgba(38, 34, 28, .04), 0 8px 24px rgba(38, 34, 28, .06);
  --radius: 14px;
}

[data-theme="dark"] {
  --bg: #171410;
  --bg-soft: #201c16;
  --card: #1e1a15;
  --ink: #e9e2d3;
  --ink-soft: #9c927f;
  --line: #332c22;
  --accent: #e07a4f;
  --accent-soft: #3a2a1e;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.85;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}

::selection { background: var(--accent); color: #fff; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

.container { max-width: 860px; margin: 0 auto; padding: 0 24px; }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.site-brand {
  font-family: var(--serif);
  font-size: 20px; font-weight: 700; letter-spacing: .06em;
}
.site-brand::before { content: "◆ "; color: var(--accent); font-size: 14px; }
.site-nav { display: flex; gap: 26px; font-size: 14px; }
.nav-link { color: var(--ink-soft); position: relative; padding: 4px 0; }
.nav-link:hover { color: var(--accent); }
.nav-link.active { color: var(--ink); font-weight: 600; }
.nav-link.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--accent); border-radius: 2px;
}
.theme-toggle {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; width: 34px; height: 34px; cursor: pointer;
  font-size: 15px; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
}
.theme-toggle:hover { border-color: var(--accent); }

/* ---------- 首页 Hero ---------- */
.hero { padding: 96px 0 56px; }
.hero-title {
  font-family: var(--serif);
  font-size: clamp(30px, 5.5vw, 46px);
  font-weight: 700; line-height: 1.45; letter-spacing: .02em;
  margin-bottom: 20px;
}
.hero-title::first-line { color: var(--accent); }
.hero-sub { color: var(--ink-soft); font-size: 17px; }

/* ---------- 文章列表 ---------- */
.section-title, .page-title {
  font-family: var(--serif); font-size: 22px; font-weight: 700;
  margin-bottom: 28px; padding-left: 14px; position: relative;
}
.section-title::before, .page-title::before {
  content: ""; position: absolute; left: 0; top: .2em; bottom: .2em;
  width: 4px; border-radius: 2px; background: var(--accent);
}
.post-list { padding-bottom: 80px; }

.post-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 30px; margin-bottom: 20px; box-shadow: var(--shadow);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(38,34,28,.06), 0 16px 40px rgba(38,34,28,.10);
  border-color: var(--accent);
}
.post-card-meta { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.post-num {
  font-family: var(--serif); font-style: italic; font-size: 15px;
  color: var(--accent); opacity: .8;
}
.post-card-meta time { font-size: 13px; color: var(--ink-soft); }
.post-card-title { font-family: var(--serif); font-size: 21px; font-weight: 700; line-height: 1.5; margin-bottom: 8px; }
.post-card-excerpt { color: var(--ink-soft); font-size: 15px; margin-bottom: 14px; }
.post-card-foot { display: flex; justify-content: space-between; align-items: center; }

.tag {
  display: inline-block; font-size: 12px; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 12px; margin: 2px 6px 2px 0;
  transition: all .2s;
}
.tag:hover { color: var(--accent); border-color: var(--accent); }
.tag.big { font-size: 14px; padding: 5px 16px; margin: 4px; }
.tag.big em { font-style: normal; color: var(--accent); margin-left: 4px; }

.more-link { margin-top: 30px; text-align: center; }
.more-link a { color: var(--accent); border-bottom: 1px dashed var(--accent); }

.empty { color: var(--ink-soft); text-align: center; padding: 60px 0; }

/* ---------- 文章详情 ---------- */
.post-full { padding: 56px 0 80px; }
.post-head { margin-bottom: 42px; }
.post-meta { font-size: 13px; color: var(--ink-soft); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.post-meta .dot { color: var(--accent); }
.post-title { font-family: var(--serif); font-size: clamp(26px, 4.5vw, 36px); font-weight: 700; line-height: 1.4; margin-bottom: 16px; }
.post-summary { color: var(--ink-soft); font-size: 16px; padding-left: 14px; border-left: 3px solid var(--accent); }

.post-body { font-size: 16.5px; }
.post-body p { margin-bottom: 22px; }
.post-body h1, .post-body h2, .post-body h3, .post-body h4 {
  font-family: var(--serif); font-weight: 700; line-height: 1.5; margin: 42px 0 16px;
}
.post-body h2 { font-size: 24px; }
.post-body h3 { font-size: 20px; }
.post-body h1 { font-size: 28px; }
.post-body a { color: var(--accent); border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.post-body a:hover { border-bottom-color: var(--accent); }
.post-body strong { font-weight: 700; }
.post-body em { color: var(--accent); font-style: normal; font-weight: 600; }
.post-body img { max-width: 100%; border-radius: 10px; margin: 8px 0; display: block; }
.post-body blockquote {
  border-left: 3px solid var(--accent); background: var(--accent-soft);
  padding: 16px 22px; margin: 24px 0; border-radius: 0 10px 10px 0; color: var(--ink);
}
.post-body blockquote p { margin: 0; }
.post-body code {
  font-family: "SF Mono", Consolas, "Courier New", monospace; font-size: .88em;
  background: var(--bg-soft); padding: 2px 7px; border-radius: 6px;
}
.post-body pre.code-block {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px;
  padding: 20px; overflow-x: auto; margin: 24px 0; line-height: 1.6; font-size: 14px;
}
.post-body pre.code-block code { background: none; padding: 0; font-size: 14px; }
.post-body ul, .post-body ol { padding-left: 28px; margin-bottom: 22px; }
.post-body li { margin-bottom: 6px; }
.post-body table {
  width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 15px;
}
.post-body th, .post-body td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; }
.post-body th { background: var(--bg-soft); font-weight: 600; }
.post-body hr { border: none; border-top: 1px solid var(--line); margin: 40px 0; }

/* ---------- 归档 / 标签 ---------- */
.page-title { margin: 56px 0 8px; }
.page-desc { color: var(--ink-soft); font-size: 14px; margin-bottom: 36px; }
.archive { padding-bottom: 80px; }
.archive-year { font-family: var(--serif); font-size: 20px; margin: 32px 0 12px; color: var(--accent); }
.archive-list { list-style: none; }
.archive-list li { display: flex; align-items: baseline; gap: 20px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.archive-list time { font-size: 13px; color: var(--ink-soft); font-family: var(--serif); min-width: 92px; }
.archive-list a { font-size: 16px; }
.tags-page { padding-bottom: 80px; }
.tag-cloud { margin: 24px 0 40px; }
.tag-heading { font-family: var(--serif); font-size: 20px; margin: 40px 0 12px; }

/* ---------- 关于页 ---------- */
.page { padding: 56px 0 80px; }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 120px 0; }
.notfound h1 { font-family: var(--serif); font-size: 72px; color: var(--accent); }
.notfound p { color: var(--ink-soft); margin: 8px 0; }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0; margin-top: 40px; }
.footer-inner { text-align: center; }
.footer-note { font-family: var(--serif); font-size: 15px; color: var(--ink-soft); margin-bottom: 6px; }
.footer-meta { font-size: 12px; color: var(--ink-soft); opacity: .8; }

/* ---------- 滚动进入动画 ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .container { padding: 0 18px; }
  .hero { padding: 64px 0 40px; }
  .site-nav { gap: 18px; }
  .post-card { padding: 22px 20px; }
  .post-body { font-size: 16px; }
  .archive-list li { flex-direction: column; gap: 4px; }
}
