/* ============================================================
   读后小栈 — 书卷气主题（暖纸感 · 衬线阅读体 · 深浅色自适应）
   ============================================================ */
:root {
  --bg: #fbf8f1;
  --bg-2: #f3ece0;
  --text: #2b2620;
  --muted: #837767;
  --accent: #9b2d20;
  --accent-soft: #c9542f;
  --card: #fffdf8;
  --border: rgba(43, 38, 32, 0.1);
  --shadow: 0 8px 30px rgba(43, 38, 32, 0.08);
  --star-bg: #e3dccd;
  --serif: "Songti SC", "Noto Serif SC", Georgia, "Times New Roman", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}
[data-theme="dark"] {
  --bg: #1b1814;
  --bg-2: #231e18;
  --text: #ece5d8;
  --muted: #a99e8c;
  --accent: #e08a72;
  --accent-soft: #d9745f;
  --card: #261f18;
  --border: rgba(255, 255, 255, 0.1);
  --shadow: 0 10px 34px rgba(0, 0, 0, 0.4);
  --star-bg: #443c30;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: #fff; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(16px, 5vw, 48px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 1px;
}
.site-nav { display: flex; align-items: center; gap: 18px; }
.site-nav a { color: var(--muted); font-size: .95rem; transition: color .2s; }
.site-nav a:hover { color: var(--accent); }
.theme-toggle {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  transition: transform .2s, border-color .2s;
}
.theme-toggle:hover { transform: rotate(18deg); border-color: var(--accent); }

/* ---------- 容器 ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: 0 clamp(16px, 5vw, 48px); }

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: clamp(48px, 9vw, 96px) 0 clamp(28px, 5vw, 48px);
}
.eyebrow {
  display: inline-block;
  font-size: .8rem;
  letter-spacing: 3px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  margin: 0 0 14px;
  letter-spacing: 2px;
}
.hero p { color: var(--muted); font-size: 1.1rem; max-width: 540px; margin: 0 auto; }
.hero-stat {
  display: inline-block;
  margin-top: 22px;
  padding: 7px 18px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .9rem;
  color: var(--muted);
}
.hero-stat b { color: var(--accent); font-family: var(--serif); }

/* ---------- 卡片网格 ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: clamp(16px, 2.5vw, 26px);
  padding-bottom: 64px;
}
.post-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .22s ease, box-shadow .22s ease;
  display: flex;
  flex-direction: column;
}
.post-card:hover { transform: translateY(-6px); box-shadow: 0 16px 40px rgba(43,38,32,.14); }
.cover {
  height: 188px;
  position: relative;
  overflow: hidden;
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-ph { display: flex; align-items: center; justify-content: center; }
.cover-ch {
  font-family: var(--serif);
  font-size: 4.4rem;
  color: rgba(255, 255, 255, .92);
  text-shadow: 0 2px 14px rgba(0, 0, 0, .25);
}
.pc-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pc-meta { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; color: var(--muted); }
.pc-book { font-family: var(--serif); color: var(--accent); }
.post-card h3 { font-family: var(--serif); font-size: 1.18rem; margin: 0; line-height: 1.4; }
.pc-excerpt { color: var(--muted); font-size: .92rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; }
.pc-tags { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 评分 ---------- */
.rating { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.stars { position: relative; display: inline-block; font-size: .95rem; line-height: 1; letter-spacing: 2px; }
.stars-bg { color: var(--star-bg); }
.stars-fg { position: absolute; top: 0; left: 0; overflow: hidden; white-space: nowrap; color: var(--accent); }
.rating-num { font-size: .8rem; color: var(--muted); }

/* ---------- 文章详情 ---------- */
.article-wrap { max-width: 740px; padding-top: 28px; padding-bottom: 64px; }
.crumb { font-size: .85rem; color: var(--muted); margin-bottom: 18px; }
.crumb a:hover { color: var(--accent); }
.post-head { text-align: center; margin-bottom: 32px; }
.post-cover {
  height: clamp(200px, 34vw, 300px);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.post-cover img { width: 100%; height: 100%; object-fit: cover; }
.post-cover.cover-ph .cover-ch { font-size: 6rem; }
.post-book { font-family: var(--serif); color: var(--accent); font-size: 1rem; letter-spacing: 1px; }
.post-head h1 {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  margin: 12px 0 16px;
  line-height: 1.35;
}
.post-meta { display: flex; gap: 16px; justify-content: center; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: .9rem; }
.post-tags { margin-top: 14px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.tag { background: var(--bg-2); border: 1px solid var(--border); color: var(--muted); padding: 3px 10px; border-radius: 999px; font-size: .78rem; }

.post-body { font-family: var(--serif); font-size: 1.08rem; line-height: 1.95; color: var(--text); }
.post-body p { margin: 0 0 1.25em; }
.post-body h2 { font-size: 1.5rem; margin: 1.8em 0 .7em; border-left: 4px solid var(--accent); padding-left: 12px; }
.post-body h3 { font-size: 1.25rem; margin: 1.5em 0 .6em; }
.post-body blockquote {
  margin: 1.4em 0;
  padding: 12px 20px;
  background: var(--bg-2);
  border-left: 4px solid var(--accent-soft);
  border-radius: 0 10px 10px 0;
  color: var(--muted);
  font-style: italic;
}
.post-body ul, .post-body ol { padding-left: 1.4em; margin: 0 0 1.25em; }
.post-body li { margin: .4em 0; }
.post-body code { background: var(--bg-2); padding: 2px 6px; border-radius: 5px; font-size: .9em; }
.post-body pre { background: var(--bg-2); padding: 16px; border-radius: 10px; overflow: auto; }
.post-body pre code { background: none; padding: 0; }
.post-body img { border-radius: 10px; margin: .5em 0; }
.post-body hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }
.post-body a { color: var(--accent); border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }

/* ---------- 上下篇 / 返回 ---------- */
.post-nav { display: flex; gap: 14px; justify-content: space-between; margin: 40px 0 28px; flex-wrap: wrap; }
.pn {
  flex: 1 1 200px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 12px;
  padding: 14px 16px;
  transition: border-color .2s, transform .2s;
}
.pn:hover { border-color: var(--accent); transform: translateY(-3px); }
.pn-next { text-align: right; }
.pn span { display: block; font-size: .78rem; color: var(--muted); margin-bottom: 4px; }
.pn b { font-family: var(--serif); font-size: .98rem; }
.back-home { display: inline-block; color: var(--accent); font-size: .95rem; }
.back-home:hover { text-decoration: underline; }

/* ---------- 空状态 ---------- */
.empty {
  text-align: center;
  color: var(--muted);
  padding: 80px 20px;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: 16px;
}
.empty code { background: var(--bg-2); padding: 2px 6px; border-radius: 5px; }

/* ---------- 页脚 ---------- */
.site-footer { text-align: center; padding: 36px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: .85rem; }
.site-footer a { color: var(--muted); border-bottom: 1px dotted var(--muted); }
.site-footer a:hover { color: var(--accent); }
.site-footer p { margin: 6px 0; }

@media (max-width: 560px) {
  .post-meta { gap: 10px; }
  .pn { flex-basis: 100%; text-align: left !important; }
}
