/* ============================================================
   字里行间 · 小说 · 文学 · 随笔（www.xiaojianwei.com/novel）
   与主站同一套企业官网风设计系统，替换品牌 token 为墨绿；
   标题采用衬线（宋体系）混排 + 加大字距，突出文艺气质。
   服务于 index.html / posts.html / post.html 三页。
   ============================================================ */

/* ---------- 设计变量（品牌墨绿，其余与主站一致） ---------- */
:root {
  --navy: #0E2B22;            /* 墨绿深色：页脚、深色区块 */
  --navy-2: #123A2E;
  --brand: #0B8A6B;           /* 墨绿 */
  --brand-dark: #07654F;
  --brand-soft: #EAF6F1;      /* 浅墨绿背景 */
  --ink: #0F1F33;
  --text: #3D4A5C;
  --muted: #7A8699;
  --bg: #FFFFFF;
  --bg-soft: #F5F8FC;
  --line: #E3E9F2;
  --hover-line: #BFE3D6;
  --code-bg: #F6F8FA;
  --code-fg: #24292F;
  --radius: 12px;
  --shadow: 0 12px 32px rgba(15, 31, 51, .10);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", "Noto Sans SC", sans-serif;
  --font-serif: "Songti SC", "STSong", "SimSun", "宋体", serif;
  --font-mono: Consolas, "SF Mono", "JetBrains Mono", Menlo, Monaco, "Courier New", monospace;
  --header-h: 64px;
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}
html, body { max-width: 100%; overflow-x: hidden; }

body {
  margin: 0;
  padding-top: var(--header-h);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--brand); }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--brand-soft); color: var(--ink); }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

[id] { scroll-margin-top: calc(var(--header-h) + 12px); }

/* ---------- 工具类 ---------- */
.container { max-width: 1200px; margin: 0 auto; }
.mono { font-family: var(--font-mono); }
.serif { font-family: var(--font-serif); }

.icon { width: 24px; height: 24px; flex: none; }
.li-arrow { width: 16px; height: 16px; flex: none; margin-top: 5px; color: var(--brand); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: transform .2s ease, background-color .2s ease, border-color .2s ease,
    color .2s ease, box-shadow .2s ease;
}
.btn-primary {
  background: var(--brand);
  color: #fff;
}
.btn-primary:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(11, 138, 107, .28);
}
.btn-secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}
.btn-secondary:hover {
  border-color: var(--brand);
  color: var(--brand);
  transform: translateY(-1px);
}
.btn-invert {
  background: #fff;
  color: var(--brand);
}
.btn-invert:hover {
  color: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
.btn-sm { padding: 8px 16px; font-size: 13.5px; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}
.text-link:hover { color: var(--brand-dark); text-decoration: underline; }
.text-link .li-arrow { margin-top: 0; }
.text-link-ghost { color: var(--muted); }
.text-link-ghost:hover { color: var(--brand); }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--line);
  z-index: 100;
  transition: box-shadow .25s ease;
}
.site-header.scrolled { box-shadow: 0 4px 16px rgba(14, 43, 34, .08); }

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: var(--header-h);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .01em;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex: none;
}
.brand-name {
  font-family: var(--font-serif);
  font-size: 18px;
  letter-spacing: .14em;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: color .2s ease;
}
.nav-links a:hover,
.nav-links a.active { color: var(--ink); }

.nav-cta { padding: 9px 20px; font-size: 14px; white-space: nowrap; }

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  align-items: center;
  justify-content: center;
}
.nav-toggle .icon { width: 20px; height: 20px; }
.nav-toggle .icon-close { display: none; }
.nav-open .nav-toggle .icon-menu { display: none; }
.nav-open .nav-toggle .icon-close { display: block; }

/* 移动端下拉面板 */
.mobile-panel {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  z-index: 99;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 20px 40px rgba(14, 43, 34, .10);
  padding: 6px 24px 22px;
}
.nav-open .mobile-panel { display: block; }
.mobile-panel nav { display: flex; flex-direction: column; }
.mobile-panel a {
  padding: 13px 4px;
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  border-bottom: 1px solid var(--line);
}
.mobile-panel a.btn {
  margin-top: 16px;
  border-bottom: none;
  justify-content: center;
}

/* ---------- Hero 横幅（左文右图） ---------- */
.hero {
  position: relative;
  padding: 72px 24px 88px;
  overflow: hidden;
  background:
    radial-gradient(640px 420px at 86% -4%, rgba(11, 138, 107, .10), transparent 70%),
    linear-gradient(rgba(14, 43, 34, .03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 43, 34, .03) 1px, transparent 1px),
    linear-gradient(180deg, #FFFFFF 0%, var(--bg-soft) 100%);
  background-size: auto, 40px 40px, 40px 40px, auto;
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  align-items: center;
  gap: 56px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .12em;
  color: var(--muted);
}
.hero-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  flex: none;
}

.hero-title { margin-top: 24px; }
.hero-name {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(38px, 4.8vw, 56px);
  font-weight: 800;
  color: var(--ink);
  line-height: 1.18;
  letter-spacing: .12em;
}
.hero-line2 {
  display: block;
  margin-top: 14px;
  font-family: var(--font-serif);
  font-size: clamp(20px, 2.6vw, 27px);
  font-weight: 700;
  color: var(--brand);
  line-height: 1.35;
  letter-spacing: .28em;
}
.hero-line2 em {
  font-style: normal;
  color: var(--brand);
}

.hero-intro {
  max-width: 560px;
  margin-top: 20px;
  font-size: 16px;
  color: var(--muted);
}

.hero-cta {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-visual { position: relative; }
.hero-illus {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 24px 48px rgba(14, 43, 34, .10));
}

/* Hero 左下悬浮书影卡 */
.hero-shot {
  position: absolute;
  left: -18px;
  bottom: -30px;
  margin: 0;
  width: min(300px, 62%);
  padding: 8px 8px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.hero-shot img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}
.hero-shot figcaption {
  margin-top: 8px;
  padding: 0 2px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

/* ---------- 区块与标题模式 ---------- */
.section { padding: 76px 24px; }
.section.alt { background: var(--bg-soft); }

.section-head {
  text-align: center;
  margin-bottom: 40px;
}
.section-head-left { text-align: left; }
.section-head-left .section-sub { margin-left: 0; }
.eyebrow {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: .2em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.section-head h2 {
  font-family: var(--font-serif);
  font-size: clamp(28px, 3.6vw, 38px);
  font-weight: 800;
  color: var(--ink);
  line-height: 1.25;
  letter-spacing: .06em;
}
.section-sub {
  max-width: 720px;
  margin: 14px auto 0;
  font-size: 16px;
  color: var(--muted);
}

/* ---------- 精选卡 ---------- */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.feat-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
  text-decoration: none;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.feat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--hover-line);
}
/* 封面图区（竖版书封 / 羽毛笔手稿） */
.feat-card .feat-cover {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 150px;
  overflow: hidden;
  background: var(--brand-soft);
}
.feat-card .feat-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.feat-card:hover .feat-cover img { transform: scale(1.04); }
.feat-card .feat-cover .mini-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 31, 51, .12);
}
.feat-card .feat-body {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
}
.feat-card .icon-box {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.mini-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid #CDE9DE;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.7;
  white-space: nowrap;
}
.feat-card h3 {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.5;
  letter-spacing: .03em;
  transition: color .2s ease;
}
.feat-card:hover h3 { color: var(--brand); }
.feat-kind {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
}
.feat-desc {
  margin-top: 10px;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 18px;
  font-size: 14px;
}
.card-cta .li-arrow {
  width: 14px;
  height: 14px;
  margin-top: 0;
  transition: transform .2s ease;
}
.feat-card:hover .li-arrow { transform: translateX(2px); }

/* ---------- 最新文章网格 ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px 24px;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
/* 类别色条（主页最新文章，按标签着色） */
.post-card .card-strip {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--hover-line);
}
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin-bottom: 14px;
}
.card-date {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .02em;
  color: var(--muted);
  white-space: nowrap;
}
.type-badge {
  flex: none;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .12em;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid #CDE9DE;
  padding: 5px 8px;
  border-radius: 5px;
}
.card-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: .02em;
  color: var(--ink);
  overflow-wrap: break-word;
}
.card-title a { color: inherit; text-decoration: none; transition: color .2s ease; }
.card-title a:hover { color: var(--brand); }
.card-summary {
  margin-top: 10px;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-tags { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  line-height: 1;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.read-more {
  margin-top: auto;
  padding-top: 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  transition: color .2s ease;
}
.read-more:hover { color: var(--brand-dark); }
.read-more .arrow { display: inline-block; transition: transform .2s ease; }
.read-more:hover .arrow { transform: translateX(3px); }

.posts-more-wrap { margin-top: 36px; text-align: center; }

/* ---------- 筛选 chips（列表页） ---------- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 24px;
  margin-bottom: 36px;
}
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  appearance: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}
.chip:hover { color: var(--ink); border-color: var(--hover-line); }
.chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}
.post-count {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .02em;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- 状态提示卡 ---------- */
.state-card {
  margin: 8px 0 0;
  padding: 48px 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  text-align: center;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.9;
}
.state-card .title { color: var(--ink); font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.state-card code {
  display: inline-block;
  margin: 10px 0 2px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--code-bg);
  color: var(--code-fg);
  font-family: var(--font-mono);
  font-size: 13px;
}
.state-card.narrow { max-width: 560px; margin: 56px auto 0; }
.spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  margin-bottom: 12px;
  border: 2px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 作品与下载（两张大卡） ---------- */
.books-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
.book-card {
  display: flex;
  gap: 26px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.book-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--hover-line);
}
.book-cover {
  flex: none;
  width: 176px;
  min-height: 248px;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(14, 43, 34, .18), inset 0 0 0 1px rgba(15, 31, 51, .06);
  transition: box-shadow .3s ease, transform .3s ease;
}
.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.book-card:hover .book-cover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(14, 43, 34, .26), inset 0 0 0 1px rgba(15, 31, 51, .06);
}
.book-card:hover .book-cover img { transform: scale(1.045); }
.book-cover-gradient {
  width: 100%;
  height: 100%;
  min-height: 210px;
  background: linear-gradient(160deg, #0B8A6B, #0E2B22);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 12px;
}
.book-cover-title {
  font-family: var(--font-serif);
  color: #fff;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: .3em;
  text-align: center;
  line-height: 1.6;
  writing-mode: vertical-rl;
}
.book-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.book-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}
.book-size {
  flex: none;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}
.book-card h3 {
  margin-top: 12px;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--ink);
  line-height: 1.5;
}
.book-meta {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
}
.book-desc {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.book-actions {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
}
.books-note {
  margin-top: 32px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- 页脚（墨绿深色 · 四站友情链接） ---------- */
.footer {
  background: var(--navy);
  color: rgba(255, 255, 255, .65);
}
.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 24px 44px;
  display: grid;
  grid-template-columns: 1.6fr 1.2fr 1.2fr;
  gap: 36px;
}
.footer h4 {
  margin-bottom: 18px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .06em;
}
.footer-brand .brand { color: #fff; }
.footer-brand .footer-tagline {
  margin-top: 16px;
  font-size: 13.5px;
  line-height: 1.8;
  max-width: 320px;
}
.footer-brand .footer-domain {
  display: inline-block;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: rgba(255, 255, 255, .45);
}
.footer-links { display: grid; gap: 10px; }
.footer-links a,
.footer-links span {
  color: rgba(255, 255, 255, .65);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.6;
  transition: color .2s ease;
  overflow-wrap: break-word;
}
.footer-links a:hover { color: #fff; }
.footer-links .flabel {
  color: rgba(255, 255, 255, .45);
  margin-right: 8px;
  font-size: 13px;
}
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .12);
  padding: 20px 24px;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, .45);
}

/* ---------- 文章详情页（post.html） ---------- */
.wrap {
  flex: 1;
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 56px 24px 96px;
}
.back-link {
  display: inline-block;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 24px;
  transition: color .2s ease;
}
.back-link:hover { color: var(--brand); }
.post-head { padding-bottom: 28px; border-bottom: 1px solid var(--line); margin-bottom: 40px; }
.post-title {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4.5vw, 36px);
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: .02em;
  color: var(--ink);
  overflow-wrap: break-word;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 18px;
}
.post-date {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .03em;
  color: var(--muted);
}
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.post-tags .tag {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  line-height: 1;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.post-foot { margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--line); }
.more-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 0;
  transition: color .2s ease;
}
.more-link:hover { color: var(--brand-dark); }

/* ---------- 文章排版（Markdown 渲染目标 #article） ---------- */
.article {
  font-size: 16px;
  line-height: 1.9;
  color: var(--text);
  overflow-wrap: break-word;
}
.article > :first-child { margin-top: 0; }
.article > :last-child { margin-bottom: 0; }
.article h1, .article h2, .article h3,
.article h4, .article h5, .article h6 {
  font-family: var(--font-serif);
  color: var(--ink);
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: .03em;
}
.article h1 { font-size: 25px; margin: 2em 0 .8em; }
.article h2 {
  font-size: 24px;
  margin: 2.2em 0 .9em;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.article h3 { font-size: 19px; margin: 1.8em 0 .7em; }
.article h4, .article h5, .article h6 { font-size: 16.5px; margin: 1.5em 0 .5em; }
.article p { margin: 0 0 1.15em; }
.article strong { color: var(--ink); font-weight: 700; }
.article a { color: var(--brand); text-decoration: none; }
.article a:hover { color: var(--brand-dark); text-decoration: underline; text-underline-offset: 3px; }
.article code {
  font-family: var(--font-mono);
  font-size: .875em;
  padding: .15em .4em;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--code-bg);
  color: var(--code-fg);
  word-break: break-all;
}
.article pre {
  margin: 1.6em 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--code-fg);
  overflow-x: auto;
  line-height: 1.75;
  -webkit-overflow-scrolling: touch;
}
.article pre code {
  display: block;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  color: inherit;
  font-size: 13.5px;
  word-break: normal;
  white-space: pre;
}
.article blockquote {
  margin: 1.6em 0;
  padding: 14px 20px;
  border-left: 3px solid var(--brand);
  background: var(--brand-soft);
  border-radius: 0 8px 8px 0;
  color: var(--text);
}
.article blockquote p { margin: 0 0 .5em; }
.article blockquote p:last-child { margin-bottom: 0; }
.article ul, .article ol { margin: 0 0 1.15em; padding-left: 1.5em; }
.article li { margin: .4em 0; }
.article li::marker { color: var(--muted); }
.table-wrap { margin: 1.6em 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.7;
  min-width: 480px;
}
.article th, .article td {
  border: 1px solid var(--line);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}
.article th {
  background: var(--bg-soft);
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}
.article img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  margin: .4em 0;
}
.article hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }

/* ---------- 列表页页头 ---------- */
.page-head {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}
.page-head .container { padding-top: 88px; padding-bottom: 72px; }
.page-title {
  font-family: var(--font-serif);
  margin-top: 14px;
  font-size: 36px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: .08em;
  color: var(--ink);
}
.page-sub {
  margin-top: 12px;
  max-width: 640px;
  font-size: 16px;
  line-height: 1.8;
  color: var(--muted);
}
.page-body { background: #fff; }
.page-body .container { padding-top: 64px; padding-bottom: 96px; }

/* ---------- 入场动画（JS 失败时内容始终可见） ---------- */
html.js .reveal { opacity: 0; }
html.js .reveal.revealed,
.revealed { opacity: 1; }
.reveal.visible { animation: fadeUp .55s cubic-bezier(.22, .61, .36, 1) both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .featured-grid { grid-template-columns: repeat(2, 1fr); }
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-inner { gap: 40px; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: inline-flex; }

  .hero { padding: 48px 24px 96px; }
  .hero-inner { grid-template-columns: 1fr; gap: 48px; }
  .hero-visual { max-width: 620px; margin: 0 auto; }

  .books-grid { grid-template-columns: 1fr; }

  .page-head .container { padding-top: 64px; padding-bottom: 52px; }
}

@media (max-width: 680px) {
  .section { padding: 60px 20px; }
  .hero { padding: 40px 20px 72px; }
  .hero-shot { display: none; }
  .featured-grid { grid-template-columns: 1fr; }
  .post-grid { grid-template-columns: 1fr; gap: 16px; }
  .post-card { padding: 22px 20px 20px; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .footer-bottom { padding: 20px 16px; text-align: center; }
  .page-title { font-size: 30px; }
  .page-body .container { padding-top: 40px; padding-bottom: 64px; }
  .toolbar { margin-bottom: 28px; }
}

@media (max-width: 480px) {
  .book-card { flex-direction: column; }
  .book-cover { width: 150px; min-height: 212px; }
  .hero-cta .btn { width: 100%; max-width: 320px; }
  .hero-line2 { letter-spacing: .18em; }
  .brand-name { letter-spacing: .08em; }
}

@media (max-width: 390px) {
  html, body { overflow-x: hidden; }
  .wrap { padding: 36px 16px 64px; }
  .article pre { padding: 16px; }
  .article pre code { font-size: 12.5px; }
  .state-card { padding: 44px 20px; }
}

/* ---------- 降低动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html.js .reveal { opacity: 1; }
  .reveal.visible { animation: none; }
}
