/* ===== Blog Default 主题样式 ===== */

:root {
  --bg: #fafaf9;
  --fg: #1c1917;
  --card: #ffffff;
  --card-foreground: #1c1917;
  --popover: #ffffff;
  --popover-foreground: #1c1917;
  --primary: #d97706;
  --primary-hover: #b45309;
  --primary-foreground: #ffffff;
  --muted: #f5f5f4;
  --muted-foreground: #78716c;
  --border: #e7e5e4;
  --input: #f5f5f4;
  --ring: #d97706;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --footer-bg: #292524;
  --footer-text: #a8a29e;
  --footer-heading: #f5f5f4;
  --tag-bg: rgba(217, 119, 6, 0.1);

  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

/* ===== 专题 ===== */
.topic-index-section { padding-top: 48px; padding-bottom: 80px; }
.topic-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.topic-card { display: block; overflow: hidden; color: inherit; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); transition: transform 200ms ease, box-shadow 200ms ease; }
.topic-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(0,0,0,.08); }
.topic-card-cover { height: 190px; overflow: hidden; background: var(--muted); }
.topic-card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 300ms ease; }
.topic-card:hover img { transform: scale(1.04); }
.topic-card-placeholder { height: 100%; display: grid; place-items: center; color: var(--primary); font-size: 28px; font-weight: 700; background: linear-gradient(135deg, var(--tag-bg), var(--muted)); }
.topic-card-body { padding: 20px; }
.topic-card-kicker { margin-bottom: 8px; color: var(--primary); font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.topic-card h2 { margin: 0 0 10px; font-size: 21px; }
.topic-card p { min-height: 48px; margin: 0 0 18px; color: var(--muted-foreground); line-height: 1.6; }
.topic-card-meta, .topic-detail-meta { display: flex; gap: 18px; color: var(--muted-foreground); font-size: 13px; }
.topic-detail-hero { position: relative; min-height: 430px; display: flex; align-items: flex-end; color: #fff; background: linear-gradient(135deg,#1c1917,#57534e); background-size: cover; background-position: center; }
.topic-detail-overlay { position: absolute; inset: 0; background: linear-gradient(90deg,rgba(15,23,42,.9),rgba(15,23,42,.55),rgba(15,23,42,.22)); }
.topic-detail-hero-inner { position: relative; z-index: 1; width: 100%; padding-top: 90px; padding-bottom: 68px; }
.topic-back { display: inline-block; margin-bottom: 42px; color: rgba(255,255,255,.82); }
.topic-detail-eyebrow { display: flex; width: max-content; margin-bottom: 12px; }
.topic-detail-hero h1 { max-width: 820px; margin: 10px 0 16px; font-size: clamp(38px,6vw,68px); line-height: 1.08; }
.topic-detail-hero p { max-width: 680px; margin: 0 0 24px; color: rgba(255,255,255,.84); font-size: 17px; line-height: 1.7; }
.topic-detail-meta { color: rgba(255,255,255,.72); }
.topic-detail-main { padding-top: 48px; padding-bottom: 88px; }
.topic-intro { max-width: 840px; margin-bottom: 54px; padding: 28px 32px; background: var(--card); border-left: 4px solid var(--primary); border-radius: var(--radius-md); color: var(--muted-foreground); line-height: 1.9; }
.topic-section { margin-top: 56px; }
.topic-section-heading { margin-bottom: 22px; }
.topic-section-heading > span { color: var(--primary); font-size: 11px; font-weight: 700; letter-spacing: .14em; }
.topic-section-heading h2 { margin: 6px 0; font-size: 28px; }
.topic-section-heading p { margin: 0; color: var(--muted-foreground); }
.topic-article-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; }
@media (max-width: 900px) { .topic-grid,.topic-article-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 600px) { .topic-grid,.topic-article-grid { grid-template-columns: 1fr; } .topic-detail-hero { min-height: 360px; } .topic-detail-hero-inner { padding-bottom: 42px; } .topic-back { margin-bottom: 28px; } }

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 42% 34% at -4% 14%, color-mix(in srgb, var(--primary) 17%, transparent) 0%, transparent 72%),
    radial-gradient(ellipse 35% 30% at 102% 26%, color-mix(in srgb, var(--primary) 10%, #60a5fa 8%) 0%, transparent 74%),
    radial-gradient(ellipse 40% 36% at 4% 60%, color-mix(in srgb, #8b5cf6 11%, transparent) 0%, transparent 75%),
    radial-gradient(ellipse 34% 32% at 98% 72%, color-mix(in srgb, #22d3ee 10%, transparent) 0%, transparent 74%),
    radial-gradient(ellipse 30% 26% at 14% 96%, color-mix(in srgb, #fb7185 8%, transparent) 0%, transparent 76%),
    radial-gradient(ellipse 26% 22% at 86% 100%, color-mix(in srgb, #fbbf24 8%, transparent) 0%, transparent 76%),
    linear-gradient(120deg, color-mix(in srgb, var(--primary) 2.5%, var(--bg)) 0%, var(--bg) 44%, color-mix(in srgb, #60a5fa 3%, var(--bg)) 100%);
  background-attachment: fixed;
  color: var(--fg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* 主内容使用轻透底色，让两侧流体线条可见，同时保持正文和卡片的阅读对比度。 */
main { position: relative; }
body .featured-section,
body .content-section,
body .topic-index-section,
body .topic-detail-main,
body .reading-post-hero,
body .reading-content-section,
body .reading-related-section,
body .taxonomy-content,
body .standalone-page-main {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(2px);
}

/* 宽屏两侧线条更完整，小屏减少纹理密度，避免视觉拥挤。 */
@media (max-width: 760px) {
  body {
    background-image:
      radial-gradient(circle at -8% 18%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 48%),
      radial-gradient(circle at 108% 58%, color-mix(in srgb, #60a5fa 9%, transparent), transparent 46%),
      radial-gradient(circle at 12% 94%, color-mix(in srgb, #8b5cf6 7%, transparent), transparent 42%),
      linear-gradient(135deg, color-mix(in srgb, var(--primary) 2.5%, var(--bg)), var(--bg) 58%);
  }
  body .featured-section,
  body .content-section,
  body .topic-index-section,
  body .topic-detail-main,
  body .reading-post-hero,
  body .reading-content-section,
  body .reading-related-section,
  body .taxonomy-content,
  body .standalone-page-main { backdrop-filter: none; }
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* ===== 工具类 ===== */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.no-underline { text-decoration: none; }
.text-center { text-align: center; }
.group { cursor: pointer; }

/* ===== 页面容器 ===== */
.page-container {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* ===== 顶部导航栏 ===== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  height: 64px;
  transition: box-shadow 200ms ease;
}

/* 首页顶部和页脚广告使用主题容器宽度，避免素材撑满超宽屏幕。 */
main > .elara-ad[data-elara-ad-slot="site_header_bottom"],
body > .elara-ad[data-elara-ad-slot="site_footer_top"] {
  width: min(1280px, calc(100% - 48px));
  margin: 24px auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: 0 8px 24px rgba(28, 25, 23, 0.04);
}
/* 横幅图片设置可控高度，不合比例的素材使用居中裁切。 */
main > .elara-ad[data-elara-ad-slot="site_header_bottom"] img,
body > .elara-ad[data-elara-ad-slot="site_footer_top"] img {
  width: 100%;
  max-height: 140px;
  object-fit: cover;
}
.top-nav.scrolled { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav-logo { display: flex; align-items: center; gap: 8px; color: var(--fg); }
.nav-logo-icon { width: 20px; height: 20px; color: var(--primary); }
.nav-logo-text { font-size: 18px; font-weight: 700; color: var(--fg); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  font-size: 14px; font-weight: 500;
  color: var(--muted-foreground);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  transition: background 120ms ease, color 120ms ease;
}
.nav-link:hover { color: var(--fg); background: var(--muted); }
.nav-link.active { color: var(--fg); background: var(--muted); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-search-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: transparent; border: none;
  cursor: pointer; color: var(--muted-foreground);
  display: flex; align-items: center; justify-content: center;
  transition: background 120ms ease, color 120ms ease;
}
.nav-search-btn:hover { background: var(--muted); color: var(--fg); }
/* 下拉式主题切换器相对定位，菜单锚定在按钮右下方。 */
.color-switcher { position: relative; }
.color-switcher-toggle {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--fg);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.color-switcher-toggle:hover,
.color-switcher-toggle[aria-expanded="true"] { border-color: var(--primary); box-shadow: 0 0 0 3px var(--tag-bg); }
/* 当前主题色点与主题名称共同说明按钮的选择状态。 */
.color-switcher-current-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.color-switcher-current-name { min-width: 72px; font-size: 13px; font-weight: 500; text-align: left; }
.color-switcher-arrow { color: var(--muted-foreground); transition: transform 120ms ease; }
.color-switcher-toggle[aria-expanded="true"] .color-switcher-arrow { transform: rotate(180deg); }
/* 下拉菜单纵向展示五套具名主题，并为后续扩展保留滚动能力。 */
.color-switcher-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 80;
  width: 190px;
  max-height: 450px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
}
.color-switcher-panel[hidden] { display: none; }
/* 下拉选项用色点、名称和勾选标记组成，避免只看色块难以区分。 */
.color-option {
  width: 100%;
  min-height: 38px;
  padding: 7px 9px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  display: grid;
  grid-template-columns: 16px 1fr 16px;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  text-align: left;
  transition: background 120ms ease;
}
.color-option:hover { background: var(--muted); }
.color-option.active { color: var(--primary); background: var(--tag-bg); font-weight: 600; }
.color-option-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--swatch); box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08); }
.color-option-check { visibility: hidden; font-size: 14px; text-align: center; }
.color-option.active .color-option-check { visibility: visible; }
.nav-subscribe-btn {
  font-size: 14px; font-weight: 500;
  color: var(--primary-foreground); background: var(--primary);
  border: none; border-radius: var(--radius-sm);
  padding: 8px 16px; cursor: pointer;
  transition: background 200ms ease;
}
.nav-subscribe-btn:hover { background: var(--primary-hover); }

/* ===== Hero 轮播 ===== */
.hero-carousel {
  position: relative; width: 100%;
  height: 460px; overflow: hidden;
  background-color: var(--muted);
}
.hero-slide {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity 500ms ease;
  z-index: 0;
}
.hero-slide.active { opacity: 1; z-index: 1; }
.hero-slide-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(28, 25, 23, 0.78) 0%, rgba(28, 25, 23, 0.45) 50%, rgba(28, 25, 23, 0) 100%);
}
.hero-content {
  position: relative; z-index: 2; height: 100%;
  display: flex; align-items: center;
}
.hero-text { max-width: 560px; color: #fff; }
.hero-badge {
  display: inline-block; font-size: 12px; font-weight: 600;
  letter-spacing: 0.08em; color: var(--primary);
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-sm); padding: 4px 10px; margin-bottom: 16px;
}
.hero-title { font-size: 36px; font-weight: 700; line-height: 1.2; margin: 0 0 12px 0; }
.hero-desc { font-size: 16px; line-height: 1.6; color: rgba(255, 255, 255, 0.85); margin: 0 0 24px 0; }
.hero-read-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 500;
  color: var(--primary-foreground); background: var(--primary);
  border-radius: var(--radius-sm); padding: 10px 20px;
  transition: background 200ms ease;
}
.hero-read-btn:hover { background: var(--primary-hover); }
.hero-progress-wrap {
  position: absolute; top: 20px; right: 24px; z-index: 10;
  display: flex; align-items: center; gap: 4px;
}
.hero-progress-bar {
  width: 32px; height: 3px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 2px; overflow: hidden;
}
.hero-progress-fill {
  height: 100%; background: rgba(255, 255, 255, 0.9);
  transition: width 300ms ease;
}
.hero-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 10; width: 44px; height: 44px;
  border-radius: 50%; background: rgba(255, 255, 255, 0.9);
  border: none; cursor: pointer; color: var(--fg);
  display: flex; align-items: center; justify-content: center;
  transition: background 200ms ease;
}
.hero-arrow:hover { background: rgba(255, 255, 255, 1); }
.hero-prev { left: 24px; }
.hero-next { right: 24px; }
.hero-dots {
  position: absolute; bottom: 24px; left: 50%;
  transform: translateX(-50%); z-index: 10;
  display: flex; align-items: center; gap: 8px;
}
.hero-dot {
  width: 10px; height: 10px; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(255, 255, 255, 0.5);
  transition: background 200ms ease;
}
.hero-dot.active { background: var(--primary); }

/* ===== 精选文章 ===== */
.featured-section { padding-top: 64px; padding-bottom: 64px; }
.section-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.section-title { font-size: 24px; font-weight: 700; color: var(--fg); }
.section-more-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 14px; font-weight: 500; color: var(--primary);
  transition: color 120ms ease;
}
.section-more-link:hover { color: var(--primary-hover); }
.featured-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}

/* ===== 文章卡片 ===== */
.article-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.article-card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06); }
.article-card-cover { height: 180px; overflow: hidden; }
.article-card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 300ms ease; }
.article-card:hover .article-card-cover img { transform: scale(1.05); }
.article-card-body { padding: 16px; }
.article-tag {
  display: inline-block; font-size: 12px; font-weight: 600;
  color: var(--primary); background: var(--tag-bg);
  border-radius: var(--radius-sm); padding: 4px 8px; margin-bottom: 10px;
}
.article-title { font-size: 18px; font-weight: 600; color: var(--fg); margin: 0 0 8px 0; line-height: 1.4; }
.article-excerpt { font-size: 14px; line-height: 1.6; color: var(--muted-foreground); margin: 0 0 16px 0; }
.article-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted-foreground); }
.article-publish-time { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.article-publish-relative { color: var(--primary); font-weight: 600; }
.article-card-stats { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; white-space: nowrap; }
.article-card-stat { display: inline-flex; align-items: center; gap: 4px; }
.article-card-stat svg { width: 15px; height: 15px; }
.article-author-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--muted); color: var(--fg);
  font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.article-author-name { color: var(--fg); font-weight: 500; }
.article-meta-dot { color: var(--muted-foreground); }

/* ===== 主内容两栏布局 ===== */
.content-section { padding-bottom: 80px; }
.content-grid { display: grid; grid-template-columns: 70% 30%; gap: 32px; }
/* 文章详情页为侧栏预留稳定宽度，正文占满剩余空间且不会撑破网格。 */
.post-content-grid { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.post-article { min-width: 0; }
/* ===== 文章阅读页：结构和阅读节奏参考 default 主题 ===== */
.reading-post-hero { padding: 24px 0; background: var(--bg); border-bottom: 1px solid var(--border); }
/* 标题区改成紧凑信息卡，减少首屏占用并与下方正文形成清晰层级。 */
.reading-post-hero-inner { position: relative; max-width: 1232px; padding-top: 24px; padding-bottom: 24px; padding-left: 34px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 8px 24px rgba(28, 25, 23, 0.04); }
.reading-post-hero-inner::before { content: ''; position: absolute; top: 24px; bottom: 24px; left: 0; width: 4px; background: var(--primary); border-radius: 0 var(--radius-full) var(--radius-full) 0; }
.reading-breadcrumb { display: flex; align-items: center; gap: 7px; margin-bottom: 12px; color: var(--muted-foreground); font-size: 12px; }
.reading-breadcrumb a { color: inherit; transition: color 120ms ease; }
.reading-breadcrumb a:hover { color: var(--primary); }
.reading-category-badge { display: inline-flex; margin-bottom: 10px; padding: 3px 9px; color: var(--primary); background: var(--tag-bg); border-radius: var(--radius-full); font-size: 11px; font-weight: 700; }
.reading-post-title { max-width: 980px; margin: 0; color: var(--fg); font-size: clamp(24px, 2.4vw, 32px); font-weight: 720; line-height: 1.32; letter-spacing: -0.018em; }
/* 作者、日期和阅读量集中在标题左下方，避免宽屏时信息被拉到两端。 */
.reading-post-meta { display: flex; align-items: center; justify-content: flex-start; gap: 16px; margin-top: 16px; }
.reading-author { display: flex; align-items: center; gap: 12px; }
.reading-author-avatar { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; color: var(--primary-foreground); background: var(--primary); border-radius: 50%; font-size: 12px; font-weight: 700; }
.reading-author-info { display: flex; flex-direction: column; gap: 3px; }
.reading-author-info strong { color: var(--fg); font-size: 14px; }
.reading-author-info time, .reading-view-count { color: var(--muted-foreground); font-size: 12px; }
.reading-view-count { display: inline-flex; align-items: center; gap: 18px; }
.reading-view-count::before { content: ''; width: 1px; height: 18px; background: var(--border); }
.reading-content-section { padding: 38px 0 72px; background: var(--bg); }
.reading-post-article { overflow: hidden; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 8px 28px rgba(28, 25, 23, 0.05); }
.reading-post-cover { width: 100%; aspect-ratio: 16 / 8.5; margin: 0; overflow: hidden; background: var(--muted); }
.reading-post-cover img { width: 100%; height: 100%; object-fit: cover; }
/* 正文广告保持与文章内容相同的左右留白，移动端再缩小边距。 */
.reading-post-article > .elara-ad { margin: 32px 52px 0; border-radius: 12px; background: var(--muted); }
/* 正文排版沿用 default 主题的克制间距和标题层级，并映射到当前主题变量。 */
.reading-post-body { padding: 44px 52px 24px; color: var(--muted-foreground); font-size: 17px; line-height: 1.85; }
.reading-post-body > :first-child { margin-top: 0; }
.reading-post-body > :last-child { margin-bottom: 0; }
.reading-post-body h1, .reading-post-body h2, .reading-post-body h3, .reading-post-body h4 { margin: 34px 0 16px; color: var(--fg); line-height: 1.35; }
.reading-post-body h1 { font-size: 30px; letter-spacing: -0.02em; }
.reading-post-body h2 { padding-left: 14px; border-left: 3px solid var(--primary); font-size: 25px; letter-spacing: -0.015em; }
.reading-post-body h3 { font-size: 21px; }
.reading-post-body h4 { font-size: 17px; }
.reading-post-body p { margin: 0 0 18px; }
.reading-post-body a { color: var(--primary); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.reading-post-body a:hover { color: var(--primary-hover); }
.reading-post-body code { padding: 3px 7px; color: var(--fg); background: var(--muted); border: 1px solid var(--border); border-radius: 5px; font-size: 0.88em; }
.reading-post-body pre { margin: 24px 0; padding: 22px; overflow-x: auto; background: #1c1917; border-radius: 12px; }
.reading-post-body pre code { padding: 0; color: #e7e5e4; background: transparent; border: 0; line-height: 1.7; }
.reading-post-body blockquote { margin: 24px 0; padding: 18px 22px; color: var(--fg); background: var(--tag-bg); border-left: 3px solid var(--primary); border-radius: 0 10px 10px 0; }
.reading-post-body blockquote p:last-child { margin-bottom: 0; }
.reading-post-body ul, .reading-post-body ol { margin: 0 0 24px; padding-left: 28px; }
.reading-post-body li { margin-bottom: 8px; line-height: 1.75; }
.reading-post-body li::marker { color: var(--primary); }
.reading-post-body img { height: auto; margin: 30px auto; border-radius: 12px; }
.reading-post-body hr { margin: 34px 0; border: 0; border-top: 1px solid var(--border); }
.reading-post-footer { display: flex; align-items: center; gap: 12px; margin: 10px 52px 0; padding: 22px 0; border-top: 1px solid var(--border); color: var(--muted-foreground); font-size: 13px; }
.reading-post-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.reading-post-tags a { padding: 5px 12px; color: var(--muted-foreground); background: var(--muted); border: 1px solid var(--border); border-radius: var(--radius-full); transition: color 120ms ease, border-color 120ms ease; }
.reading-post-tags a:hover { color: var(--primary); border-color: var(--primary); }
.reading-author-card { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 16px; margin: 20px 52px 46px; padding: 22px; background: var(--muted); border-radius: 12px; }
.reading-author-card-avatar { width: 58px; height: 58px; display: flex; align-items: center; justify-content: center; color: var(--primary-foreground); background: var(--primary); border-radius: 50%; font-size: 20px; font-weight: 700; }
.reading-author-card span { color: var(--muted-foreground); font-size: 11px; letter-spacing: 0.08em; }
.reading-author-card h3 { margin: 3px 0 5px; color: var(--fg); font-size: 17px; }
.reading-author-card p { margin: 0; color: var(--muted-foreground); font-size: 13px; line-height: 1.6; }
.reading-content-section .sidebar { position: sticky; top: 88px; }
.reading-related-section { padding: 56px 0 72px; background: var(--card); border-top: 1px solid var(--border); }
.reading-not-found { padding-top: 100px; padding-bottom: 120px; text-align: center; }
.reading-not-found h1 { margin-bottom: 10px; color: var(--fg); }
.reading-not-found p { margin-bottom: 24px; color: var(--muted-foreground); }
.reading-back-link { display: inline-flex; padding: 9px 18px; color: var(--primary-foreground); background: var(--primary); border-radius: var(--radius-sm); }
/* 独立页面使用主题化横幅和阅读卡片，突出页面身份并保持内容易读。 */
.standalone-page { padding-top: 48px; padding-bottom: 80px; }
.standalone-page-hero {
  position: relative;
  min-height: 280px;
  padding: 48px 54px;
  overflow: hidden;
  color: var(--primary-foreground);
  background-position: center;
  background-size: cover;
  border-radius: 28px;
  box-shadow: 0 24px 60px color-mix(in srgb, var(--primary) 22%, transparent);
}
.standalone-page-hero::before { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(15, 23, 42, 0.82), rgba(15, 23, 42, 0.42) 68%, rgba(15, 23, 42, 0.18)); }
.standalone-page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to right, transparent 35%, #000 100%);
}
.standalone-page-hero-content { position: relative; z-index: 2; max-width: 720px; }
.standalone-page-orb {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}
.standalone-page-orb-one { width: 240px; height: 240px; top: -90px; right: 90px; }
.standalone-page-orb-two { width: 150px; height: 150px; right: -35px; bottom: -55px; }
.standalone-page-grid { margin-top: 32px; }
.standalone-page-article {
  position: relative;
  padding: 48px 54px 56px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--primary) 12%, var(--border));
  border-radius: 22px;
  box-shadow: 0 18px 48px rgba(28, 25, 23, 0.06);
}
/* 顶部细色条将正文卡片与当前主题色建立视觉联系。 */
.standalone-page-article::before {
  content: '';
  position: absolute;
  top: 0;
  left: 54px;
  width: 72px;
  height: 4px;
  background: var(--primary);
  border-radius: 0 0 4px 4px;
}
.standalone-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 36px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
}
.standalone-breadcrumb a { color: inherit; transition: color 120ms ease; }
.standalone-breadcrumb a:hover { color: #fff; }
.standalone-page-kicker {
  display: block;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  opacity: 0.76;
}
.standalone-page-hero h1 { margin: 0; font-size: clamp(40px, 5vw, 64px); line-height: 1.12; letter-spacing: -0.04em; }
.standalone-page-meta { display: flex; align-items: center; gap: 12px; margin-top: 24px; font-size: 13px; opacity: 0.78; }
.standalone-page-meta-line { width: 34px; height: 1px; background: currentColor; }
.standalone-page-content { color: color-mix(in srgb, var(--fg) 88%, var(--muted-foreground)); font-size: 16px; line-height: 1.95; }
.standalone-page-content > :first-child { margin-top: 0; }
.standalone-page-content > :last-child { margin-bottom: 0; }
/* Markdown 标题通过主题色标记形成清晰的章节导航感。 */
.standalone-page-content h2 {
  position: relative;
  margin: 44px 0 18px;
  padding-left: 18px;
  color: var(--fg);
  font-size: 28px;
  line-height: 1.35;
  letter-spacing: -0.02em;
}
.standalone-page-content h2::before {
  content: '';
  position: absolute;
  top: 0.18em;
  bottom: 0.18em;
  left: 0;
  width: 4px;
  background: var(--primary);
  border-radius: var(--radius-full);
}
.standalone-page-content h3 { margin: 34px 0 12px; color: var(--fg); font-size: 20px; line-height: 1.45; }
.standalone-page-content h4 { margin: 28px 0 10px; color: var(--fg); font-size: 17px; }
.standalone-page-content p { margin: 0 0 18px; }
/* 列表增加柔和底色和稳定缩进，避免后台 Markdown 内容显得拥挤。 */
.standalone-page-content ul,
.standalone-page-content ol {
  margin: 16px 0 24px;
  padding: 18px 22px 18px 44px;
  background: color-mix(in srgb, var(--primary) 4%, var(--muted));
  border: 1px solid color-mix(in srgb, var(--primary) 8%, var(--border));
  border-radius: 14px;
}
.standalone-page-content li { margin: 7px 0; padding-left: 4px; }
.standalone-page-content li::marker { color: var(--primary); font-weight: 700; }
.standalone-page-content strong { color: var(--fg); font-weight: 700; }
.standalone-page-content a { color: var(--primary); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--primary) 35%, transparent); text-underline-offset: 4px; }
.standalone-page-content a:hover { text-decoration-color: var(--primary); }
/* 引用块、代码和媒体采用统一圆角，适配后续扩展的独立页面内容。 */
.standalone-page-content blockquote {
  margin: 26px 0;
  padding: 18px 22px;
  color: var(--muted-foreground);
  background: var(--muted);
  border-left: 4px solid var(--primary);
  border-radius: 0 12px 12px 0;
}
.standalone-page-content blockquote p:last-child { margin-bottom: 0; }
.standalone-page-content code { padding: 2px 6px; color: var(--primary); background: var(--tag-bg); border-radius: 5px; font-size: 0.9em; }
.standalone-page-content pre { margin: 24px 0; padding: 20px; overflow-x: auto; background: #1c1917; border-radius: 14px; }
.standalone-page-content pre code { padding: 0; color: #f5f5f4; background: transparent; }
.standalone-page-content img { margin: 28px auto; border-radius: 16px; box-shadow: 0 12px 30px rgba(28, 25, 23, 0.12); }
.standalone-page-content hr { margin: 38px 0; border: 0; border-top: 1px solid var(--border); }

/* ===== 分类标签 ===== */
.category-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.category-tab {
  font-size: 14px; font-weight: 500;
  color: var(--muted-foreground); background: var(--muted);
  border: none; border-radius: var(--radius-full);
  padding: 6px 16px; cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.category-tab:hover { color: var(--fg); }
.category-tab.active {
  color: var(--primary-foreground); background: var(--primary);
}

/* ===== 文章列表项 ===== */
.article-list { display: flex; flex-direction: column; gap: 20px; }
.article-list-item {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px; cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.article-list-item:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06); }
.article-list-inner { display: flex; gap: 16px; }
.article-thumb { width: 160px; height: 120px; flex-shrink: 0; border-radius: var(--radius-md); overflow: hidden; }
.article-thumb img { width: 100%; height: 100%; object-fit: cover; }
.article-list-content { flex: 1; min-width: 0; }
.article-list-tag {
  display: inline-block; font-size: 12px; font-weight: 600;
  color: var(--primary); background: var(--tag-bg);
  border-radius: var(--radius-sm); padding: 3px 8px; margin-bottom: 8px;
}
.article-list-title { font-size: 17px; font-weight: 600; color: var(--fg); margin: 0 0 8px 0; line-height: 1.4; }
.article-list-excerpt { font-size: 14px; line-height: 1.6; color: var(--muted-foreground); margin: 0 0 12px 0; }

/* ===== 加载更多 ===== */
.load-more-wrap { margin-top: 32px; text-align: center; }
.load-more-btn {
  font-size: 14px; font-weight: 500; color: var(--fg);
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 10px 28px;
  cursor: pointer; transition: transform 200ms ease, box-shadow 200ms ease;
}
.load-more-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 16px rgba(0, 0, 0, 0.06); }

/* ===== 文本截断 ===== */
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ===== 侧边栏 ===== */
.sidebar { display: flex; flex-direction: column; gap: 24px; }
/* 侧栏广告作为一张独立卡片参与侧栏间距排版。 */
.sidebar > .elara-ad { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); box-shadow: 0 8px 24px rgba(28, 25, 23, 0.04); }
.sidebar-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
}
.sidebar-card-author { padding: 24px; text-align: center; }
.author-avatar-large {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--primary); color: var(--primary-foreground);
  font-size: 28px; font-weight: 700;
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
}
.author-name { font-size: 18px; font-weight: 700; color: var(--fg); margin: 0 0 8px 0; }
.author-bio { font-size: 14px; line-height: 1.6; color: var(--muted-foreground); margin: 0 0 16px 0; }
.author-social { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 16px; }
.author-social-link {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  color: var(--muted-foreground); background: var(--muted);
  display: flex; align-items: center; justify-content: center;
  transition: background 120ms ease, color 120ms ease;
}
.author-social-link:hover { background: var(--primary); color: var(--primary-foreground); }
.author-follow-btn {
  font-size: 14px; font-weight: 500;
  color: var(--primary-foreground); background: var(--primary);
  border: none; border-radius: var(--radius-sm);
  padding: 8px 20px; cursor: pointer; width: 100%;
  transition: background 200ms ease;
}
.author-follow-btn:hover { background: var(--primary-hover); }
.sidebar-title { font-size: 16px; font-weight: 700; color: var(--fg); margin: 0 0 16px 0; }

/* 标签云 */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-item {
  font-size: 13px; font-weight: 500;
  color: var(--muted-foreground); background: var(--muted);
  border-radius: var(--radius-full); padding: 5px 12px;
  cursor: pointer; transition: background 120ms ease, color 120ms ease;
}
.tag-item:hover, .tag-item.active {
  color: var(--primary-foreground); background: var(--primary);
}
/* 3D 标签云标题栏保留统一的侧栏标题间距。 */
.sidebar-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.sidebar-title-row .sidebar-title { margin-bottom: 0; }
/* 标签云采用参考示例的纯文字球体，固定高度避免旋转时改变侧边栏布局。 */
.tag-cloud-3d { position: relative; width: 100%; height: 250px; overflow: hidden; perspective: 420px; user-select: none; }
/* 标签保持轻量文字形态，脚本负责球面位置、尺寸和前后透明度。 */
.tag-cloud-3d-item { position: absolute; top: 50%; left: 50%; max-width: 138px; overflow: hidden; padding: 3px 6px; color: var(--fg); font-size: 13px; font-weight: 700; line-height: 1.3; white-space: nowrap; text-overflow: ellipsis; transform: translate(-50%, -50%); will-change: transform, opacity; transition: color 120ms ease, background 120ms ease; }
/* 使用主题色与辅助色交错展示，模拟参考示例的多色文字层次。 */
.tag-cloud-3d-item:nth-child(3n + 1) { color: var(--primary); }
.tag-cloud-3d-item:nth-child(3n + 2) { color: var(--muted-foreground); }
.tag-cloud-3d-item:hover { color: var(--primary-foreground); background: var(--primary); }

/* 文章分类改用杂志目录式列表，跟标签云形成清晰的视觉区分。 */
.sidebar-category-card { overflow: hidden; }
.category-title-row { margin-bottom: 14px; }
.category-view-all { color: var(--muted-foreground); font-size: 11px; font-weight: 500; transition: color 120ms ease; }
.category-view-all:hover { color: var(--primary); }
.category-index-list { display: flex; flex-direction: column; gap: 7px; }
.category-index-item { min-width: 0; min-height: 46px; padding: 7px 9px; border: 1px solid transparent; border-radius: var(--radius-md); display: grid; grid-template-columns: 30px minmax(0, 1fr) 24px; align-items: center; gap: 9px; transition: border-color 150ms ease, background 150ms ease, transform 150ms ease; }
.category-index-item:hover { border-color: color-mix(in srgb, var(--primary) 28%, var(--border)); background: var(--tag-bg); transform: translateX(3px); }
/* 圆形序号使用浅主题色底，当前配色变化时自动同步。 */
.category-index-number { width: 30px; height: 30px; border-radius: 50%; color: var(--primary); background: var(--tag-bg); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.category-index-name { min-width: 0; overflow: hidden; color: var(--fg); font-size: 13px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.category-index-arrow { width: 24px; height: 24px; border-radius: 50%; color: var(--muted-foreground); display: flex; align-items: center; justify-content: center; transition: color 150ms ease, background 150ms ease; }
.category-index-item:hover .category-index-arrow { color: var(--primary-foreground); background: var(--primary); }

/* 热门文章列表 */
.popular-list { display: flex; flex-direction: column; gap: 14px; }
.popular-item { display: flex; align-items: center; gap: 12px; }
/* 热门文章缩略图固定在左侧，并在左上角叠加文章排名。 */
.popular-thumb { position: relative; width: 72px; height: 54px; border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0; }
.popular-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.popular-rank { position: absolute; top: 4px; left: 4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; }
.popular-rank.muted { background: rgba(28, 25, 23, 0.68); color: #fff; }
/* 文本区域允许收缩，避免长标题把左侧缩略图挤出布局。 */
.popular-content { min-width: 0; flex: 1; }
/* 热门文章标题最多显示两行，超出的内容使用省略号截断。 */
.popular-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  margin: 0 0 4px 0;
  line-height: 1.4;
  transition: color 120ms ease;
}
.popular-item:hover .popular-title { color: var(--primary); }
.popular-views { font-size: 12px; color: var(--muted-foreground); }

/* 最新文章列表 */
.latest-list { display: flex; flex-direction: column; gap: 14px; }
.latest-item { display: flex; align-items: flex-start; gap: 12px; }
.latest-thumb { width: 56px; height: 56px; border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0; }
.latest-thumb img { width: 100%; height: 100%; object-fit: cover; }
.latest-title { font-size: 14px; font-weight: 500; color: var(--fg); margin: 0 0 4px 0; line-height: 1.4; }
.latest-date { font-size: 12px; color: var(--muted-foreground); }

/* ===== 页脚 ===== */
.site-footer { background: var(--footer-bg); padding: 48px 0 24px 0; }
/* 页脚上半部分由品牌信息和后台 footer 导航组成，并保持在同一排。 */
.footer-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 48px; margin-bottom: 40px; }
/* 品牌区域保留稳定宽度，避免导航项目较多时挤压站点描述。 */
.footer-brand { width: min(320px, 35%); flex-shrink: 0; }
.footer-brand-logo { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.footer-brand-icon { width: 18px; height: 18px; color: var(--primary); }
.footer-brand-name { font-size: 16px; font-weight: 700; color: var(--footer-heading); }
.footer-desc { font-size: 14px; line-height: 1.7; color: var(--footer-text); }
/* 后台底部导航按菜单组横向排列，空间不足时自动换行。 */
.footer-nav { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 28px 40px; min-width: 0; }
.footer-nav-group { min-width: 96px; }
.footer-nav-title { display: inline-block; margin-bottom: 12px; font-size: 14px; font-weight: 700; color: var(--footer-heading); transition: color 120ms ease; }
.footer-nav-title--standalone { margin-bottom: 0; }
.footer-nav-children { display: flex; flex-direction: column; gap: 10px; }
.footer-nav-link { font-size: 14px; color: var(--footer-text); transition: color 120ms ease; }
.footer-nav-title:hover, .footer-nav-link:hover { color: var(--primary); }
.footer-nav-group--horizontal { min-width: min(760px, 100%); }
.footer-nav-children--horizontal { flex-direction: row; flex-wrap: wrap; gap: 12px 24px; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 24px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}
.footer-copyright { font-size: 13px; color: var(--footer-text); }
.footer-social { display: flex; align-items: center; gap: 8px; }
.footer-social-link {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  color: var(--footer-text);
  display: flex; align-items: center; justify-content: center;
  transition: background 120ms ease, color 120ms ease;
}
.footer-social-link:hover { background: rgba(255, 255, 255, 0.1); color: var(--primary); }

/* ===== 分类与标签总览页 ===== */
/* 总览页顶部使用轻量主题色渐变，跟随访客选择的具名配色变化。 */
/* 分类与标签总览横幅改用主题图库，并通过遮罩保证五套图片下文字均清晰可读。 */
.taxonomy-hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); background-position: center 48%; background-size: cover; }
.taxonomy-hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(15, 23, 42, 0.82) 0%, rgba(15, 23, 42, 0.56) 48%, rgba(15, 23, 42, 0.16) 100%); }
.taxonomy-hero-inner { position: relative; z-index: 1; padding-top: 64px; padding-bottom: 60px; }
.taxonomy-eyebrow { display: inline-flex; margin-bottom: 13px; padding: 4px 9px; color: #fff; background: color-mix(in srgb, var(--primary) 78%, transparent); border: 1px solid rgba(255, 255, 255, 0.24); border-radius: var(--radius-full); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; }
.taxonomy-page-title { margin: 0 0 12px; color: #fff; font-size: 40px; line-height: 1.2; text-shadow: 0 2px 16px rgba(0, 0, 0, 0.28); }
.taxonomy-page-desc { max-width: 560px; margin: 0; color: rgba(255, 255, 255, 0.82); font-size: 15px; line-height: 1.7; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.22); }
.taxonomy-section { padding-top: 40px; padding-bottom: 72px; }

/* 分类卡片使用两列布局，并通过箭头提示整张卡片可以进入分类详情。 */
.category-overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.category-overview-card {
  min-width: 0;
  min-height: 132px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 14px;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.category-overview-card:hover { transform: translateY(-2px); border-color: var(--primary); box-shadow: 0 10px 24px rgba(28, 25, 23, 0.08); }
.category-overview-icon { width: 44px; height: 44px; border-radius: var(--radius-md); color: var(--primary); background: var(--tag-bg); display: flex; align-items: center; justify-content: center; }
.category-overview-content { min-width: 0; }
.category-overview-title { margin: 0 0 7px; color: var(--fg); font-size: 17px; line-height: 1.35; }
/* 分类描述最多显示两行，避免单张卡片因内容过长而破坏网格高度。 */
.category-overview-desc { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; margin: 0; color: var(--muted-foreground); font-size: 13px; line-height: 1.55; }
.category-overview-arrow { color: var(--muted-foreground); transition: color 160ms ease, transform 160ms ease; }
.category-overview-card:hover .category-overview-arrow { color: var(--primary); transform: translateX(3px); }

/* 标签页使用三列紧凑卡片，名称过长时在单行内省略。 */
.tag-overview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tag-overview-card { min-width: 0; padding: 15px 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--card); display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 7px; row-gap: 3px; transition: border-color 140ms ease, background 140ms ease; }
.tag-overview-card:hover { border-color: var(--primary); background: var(--tag-bg); }
.tag-overview-hash { grid-row: 1 / span 2; color: var(--primary); font-size: 20px; font-weight: 700; }
.tag-overview-name { overflow: hidden; color: var(--fg); font-size: 14px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.tag-overview-count { color: var(--muted-foreground); font-size: 11px; }

/* ===== 分页 ===== */
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 32px; }
.page-link {
  min-width: 36px; height: 36px; padding: 0 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--fg); background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: background 120ms ease;
}
.page-link:hover { background: var(--muted); }
.page-link.active { color: var(--primary-foreground); background: var(--primary); border-color: var(--primary); }

/* ===== 空状态 ===== */
.empty-state { text-align: center; padding: 48px 16px; color: var(--muted-foreground); }

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .featured-grid { grid-template-columns: 1fr; }
  .content-grid { grid-template-columns: 1fr; }
  .article-list-inner { flex-direction: column; }
  .article-thumb { width: 100%; height: 200px; }
  /* 中等屏幕允许品牌和底部导航上下排列，避免导航过度拥挤。 */
  .footer-main { flex-direction: column; gap: 32px; }
  .footer-brand { width: 100%; }
  .footer-nav { justify-content: flex-start; }
  /* 总览页单栏时仍保留两列卡片，提高平板空间利用率。 */
  .tag-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* 单栏时取消侧栏吸顶，避免侧栏在正文后占据异常高度。 */
  .reading-content-section .sidebar { position: static; }
}

@media (max-width: 768px) {
  /* 手机端全局广告与页面安全边距对齐。 */
  main > .elara-ad[data-elara-ad-slot="site_header_bottom"],
  body > .elara-ad[data-elara-ad-slot="site_footer_top"] { width: calc(100% - 32px); margin: 16px auto; }
  .hero-carousel { height: 390px; }
  .hero-overlay { background: linear-gradient(90deg, rgba(28, 25, 23, 0.82) 0%, rgba(28, 25, 23, 0.55) 100%); }
  /* 移动端底部导航使用两列，保持链接清晰可点。 */
  .footer-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .nav-links { display: none; }
  .hero-title { font-size: 28px; }
  /* 手机端压缩文章标题区和正文卡片留白。 */
  .reading-post-hero { padding: 14px 0; }
  .reading-post-hero-inner { padding: 20px 18px 20px 24px; border-radius: 12px; }
  .reading-post-hero-inner::before { top: 20px; bottom: 20px; }
  .reading-breadcrumb { margin-bottom: 10px; }
  .reading-post-title { font-size: 24px; }
  .reading-post-meta { align-items: center; gap: 14px; }
  .reading-content-section { padding-top: 22px; }
  .reading-post-body { padding: 28px 20px 18px; font-size: 16px; }
  /* 手机端正文广告与文字共用紧凑边距。 */
  .reading-post-article > .elara-ad { margin: 20px 20px 0; }
  .reading-post-body h1 { font-size: 26px; }
  .reading-post-body h2 { font-size: 22px; }
  .reading-post-footer { margin-right: 20px; margin-left: 20px; }
  .reading-author-card { margin: 16px 20px 28px; }
  .reading-related-section { padding: 40px 0 48px; }
  /* 手机端总览页缩小标题并将所有卡片改为单列。 */
  .taxonomy-hero-inner { padding-top: 40px; padding-bottom: 36px; }
  .taxonomy-page-title { font-size: 30px; }
  .category-overview-grid, .tag-overview-grid { grid-template-columns: 1fr; }
  /* 手机端缩小独立页面卡片留白和标题，避免正文区域过窄。 */
  .standalone-page { padding-top: 24px; padding-bottom: 48px; }
  .standalone-page-hero { min-height: 230px; padding: 30px 24px; border-radius: 20px; }
  .standalone-breadcrumb { margin-bottom: 28px; }
  .standalone-page-hero h1 { font-size: 38px; }
  .standalone-page-grid { margin-top: 20px; }
  .standalone-page-article { padding: 34px 22px 38px; border-radius: 18px; }
  .standalone-page-article::before { left: 22px; width: 54px; }
  .standalone-page-content h2 { font-size: 24px; }
  .standalone-page-content h3 { font-size: 19px; }
  .standalone-page-content ul, .standalone-page-content ol { padding: 15px 16px 15px 36px; }
}
