/* Lume Blog — 前台样式(手写,零构建依赖;文档根静态托管)
 *
 * 设计基调:纸质阅读感。浅底深字,正文用衬线字体,元信息用无衬线。
 * 响应式:800px 断点,以下折叠双栏。
 */

:root {
  --bg: #fbfaf7;
  --panel: #ffffff;
  --ink: #1f2937;
  --ink-soft: #4b5563;
  --muted: #6b7280;
  --accent: #b8483d;
  --accent-soft: #f4dcd8;
  --accent-ink: #a03a30;   /* tag 徽章文字:对 --accent-soft 对比 5.12(≥4.5) */
  --line: #e5e1d8;
  --ok: #2f855a;
  --warn: #b7791f;
  --danger: #c53030;
  --code-bg: #f4f1ea;      /* 代码块背景(主题可覆盖) */
  --accent-contrast: #ffffff; /* accent 底上的文字色(mono 主题用深字) */
  --glow-hue: 4; /* 每日色相轮换:背景装饰(光晕/侧带/几何)色相,blog.js 按日期设;默认红棕 */
  color-scheme: light;         /* 原生滚动条/表单控件浅色;手动深色由 html.dark 覆盖 */
  accent-color: var(--accent); /* checkbox/radio/range 等原生控件用品牌色 */
  --serif: "Manrope", "Noto Serif SC", Georgia, "Songti SC", serif;
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --mono: "Fira Code", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* 自托管可变字体(Manrope 正文/标题、Fira Code 代码),与线上 theme.json 一致;
 * 自托管避免 CSP font-src 拦截,woff2 变体覆盖全字重段 */
@font-face {
  font-family: "Manrope";
  src: url("/vendors/fonts/Manrope-VariableFont_wght.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fira Code";
  src: url("/vendors/fonts/FiraCode-VariableFont_wght.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.75 var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* 列表页玻璃拟态光晕背景(首页/标签/关键词/资源/链接/搜索等含 .page-head;
 * 文章页无 .page-head,正文保持纯净阅读)。固定视差渐变光斑,浅/深两套。 */
body:has(.page-head) {
  background:
    radial-gradient(1100px 560px at 85% -8%, color-mix(in srgb, hsl(var(--glow-hue) 55% 48%) 12%, transparent), transparent 62%),
    radial-gradient(820px 480px at 8% 6%, color-mix(in srgb, hsl(var(--glow-hue) 55% 48%) 8%, transparent), transparent 58%),
    radial-gradient(700px 420px at 50% 105%, color-mix(in srgb, hsl(var(--glow-hue) 55% 48%) 6%, transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
html.dark body:has(.page-head) {
  background:
    radial-gradient(1100px 560px at 85% -8%, color-mix(in srgb, hsl(var(--glow-hue) 55% 48%) 22%, transparent), transparent 62%),
    radial-gradient(820px 480px at 8% 6%, color-mix(in srgb, hsl(var(--glow-hue) 55% 48%) 15%, transparent), transparent 58%),
    radial-gradient(700px 420px at 50% 105%, color-mix(in srgb, hsl(var(--glow-hue) 55% 48%) 11%, transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

/* ---------- 两侧铺垫:点阵网格 + 对角光斑 + 漂浮几何 ----------
 * 仅宽屏(≥1240px,两侧才有真实留白)列表页显示;文章页正文保持纯净。
 * body::before/::after 各占一侧,宽度 = 内容列两侧空白(50vw - 520px),
 * z-index:-1 置于内容下;点阵网格 + 对角光斑,靠内容侧羽化渐隐。
 * main.wrap::before/::after 为漂浮渐变几何(圆环/菱形),增加层次与动感。 */
/* 两侧侧带:width 自适应(max(0, 50vw-520px)),窄屏负值自动隐藏,无断点 */
body:has(.page-head)::before,
body:has(.page-head)::after {
  content: '';
  position: fixed;
  top: 0;
  bottom: 0;
  width: max(0px, calc(50vw - 520px));
  max-width: 380px;
  pointer-events: none;
  z-index: -1;
}
body:has(.page-head)::before {
  left: 0;
  background-image:
    radial-gradient(600px 520px at 14% 12%, color-mix(in srgb, hsl(var(--glow-hue) 55% 48%) 20%, transparent), transparent 74%),
    radial-gradient(color-mix(in srgb, hsl(var(--glow-hue) 55% 48%) 16%, transparent) 1.7px, transparent 2px);
  background-size: auto, 24px 24px;
  background-repeat: no-repeat, repeat;
  mask-image: linear-gradient(90deg, #000 62%, transparent 98%);
  -webkit-mask-image: linear-gradient(90deg, #000 62%, transparent 98%);
}
body:has(.page-head)::after {
  right: 0;
  background-image:
    radial-gradient(600px 520px at 86% 88%, color-mix(in srgb, hsl(var(--glow-hue) 55% 48%) 20%, transparent), transparent 74%),
    radial-gradient(color-mix(in srgb, hsl(var(--glow-hue) 55% 48%) 16%, transparent) 1.7px, transparent 2px);
  background-size: auto, 24px 24px;
  background-repeat: no-repeat, repeat;
  mask-image: linear-gradient(270deg, #000 62%, transparent 98%);
  -webkit-mask-image: linear-gradient(270deg, #000 62%, transparent 98%);
}
html.dark body:has(.page-head)::before {
  background-image:
    radial-gradient(600px 520px at 14% 12%, color-mix(in srgb, hsl(var(--glow-hue) 55% 48%) 32%, transparent), transparent 74%),
    radial-gradient(color-mix(in srgb, hsl(var(--glow-hue) 55% 48%) 20%, transparent) 1.7px, transparent 2px);
  background-size: auto, 24px 24px;
  background-repeat: no-repeat, repeat;
}
html.dark body:has(.page-head)::after {
  background-image:
    radial-gradient(600px 520px at 86% 88%, color-mix(in srgb, hsl(var(--glow-hue) 55% 48%) 32%, transparent), transparent 74%),
    radial-gradient(color-mix(in srgb, hsl(var(--glow-hue) 55% 48%) 20%, transparent) 1.7px, transparent 2px);
  background-size: auto, 24px 24px;
  background-repeat: no-repeat, repeat;
}
/* 漂浮几何(≥1150px 显示,防移动端碍眼) */
@media (min-width: 1150px) {
  body:has(.page-head) main.wrap::before,
  body:has(.page-head) main.wrap::after {
    content: '';
    position: fixed;
    pointer-events: none;
    z-index: -1;
  }
  body:has(.page-head) main.wrap::before {
    left: 4vw;
    top: 18vh;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, hsl(var(--glow-hue) 55% 48%), hsl(calc(var(--glow-hue) + 80) 60% 60%), hsl(var(--glow-hue) 55% 48%));
    mask-image: radial-gradient(circle, transparent 55%, #000 56%, #000 74%, transparent 75%);
    -webkit-mask-image: radial-gradient(circle, transparent 55%, #000 56%, #000 74%, transparent 75%);
    opacity: .5;
    animation: kw-ring-spin 16s linear infinite;
  }
  html.dark body:has(.page-head) main.wrap::before { opacity: .6; }
  body:has(.page-head) main.wrap::after {
    right: 4vw;
    top: 58vh;
    width: 54px;
    height: 54px;
    border-radius: 9px;
    background: linear-gradient(120deg, hsl(var(--glow-hue) 55% 48%), hsl(calc(var(--glow-hue) + 80) 60% 60%));
    transform: rotate(45deg);
    opacity: .4;
    animation: kw-diamond-float 11s ease-in-out infinite;
  }
  html.dark body:has(.page-head) main.wrap::after { opacity: .5; }
}
@keyframes kw-ring-spin { to { transform: rotate(360deg); } }
@keyframes kw-diamond-float {
  0%, 100% { transform: rotate(45deg) translateY(0); }
  50% { transform: rotate(45deg) translateY(-16px); }
}
@media (prefers-reduced-motion: reduce) {
  body:has(.page-head) main.wrap::before,
  body:has(.page-head) main.wrap::after { animation: none; }
}

/* ---------- 文章详情页基础氛围:全视口渐变光晕 ----------
 * 任何视口可见(与列表页 body:has(.page-head) 同款,稍淡),解决
 * 窄屏看不到两侧铺垫的问题。 */
body:has(.post-body) {
  background:
    radial-gradient(1100px 560px at 85% -8%, color-mix(in srgb, hsl(var(--glow-hue) 55% 48%) 10%, transparent), transparent 62%),
    radial-gradient(820px 480px at 8% 6%, color-mix(in srgb, hsl(var(--glow-hue) 55% 48%) 7%, transparent), transparent 58%),
    radial-gradient(700px 420px at 50% 105%, color-mix(in srgb, hsl(var(--glow-hue) 55% 48%) 5%, transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
html.dark body:has(.post-body) {
  background:
    radial-gradient(1100px 560px at 85% -8%, color-mix(in srgb, hsl(var(--glow-hue) 55% 48%) 18%, transparent), transparent 62%),
    radial-gradient(820px 480px at 8% 6%, color-mix(in srgb, hsl(var(--glow-hue) 55% 48%) 13%, transparent), transparent 58%),
    radial-gradient(700px 420px at 50% 105%, color-mix(in srgb, hsl(var(--glow-hue) 55% 48%) 9%, transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

/* ---------- 文章详情页两侧铺垫(侧带,width 自适应) ----------
 * 网格 + 对角光斑 + 红/紫晕;width = max(0, 50vw-520px),窄屏负值自动隐藏,
 * 无需 min-width 断点(修复窄屏看不到的问题)。 */
body:has(.post-body)::before,
body:has(.post-body)::after {
  content: '';
  position: fixed;
  top: 0;
  bottom: 0;
  width: max(0px, calc(50vw - 520px));
  max-width: 380px;
  pointer-events: none;
  z-index: -1;
}
body:has(.post-body)::before {
  left: 0;
  background-image:
    radial-gradient(780px 700px at 10% 6%, color-mix(in srgb, #f43f5e 24%, transparent), transparent 74%),
    radial-gradient(660px 560px at 14% 12%, color-mix(in srgb, hsl(var(--glow-hue) 55% 48%) 30%, transparent), transparent 74%),
    radial-gradient(color-mix(in srgb, hsl(var(--glow-hue) 55% 48%) 22%, transparent) 2px, transparent 2.4px);
  background-size: auto, auto, 20px 20px;
  background-repeat: no-repeat, no-repeat, repeat;
  mask-image: linear-gradient(90deg, #000 80%, transparent 99%);
  -webkit-mask-image: linear-gradient(90deg, #000 80%, transparent 99%);
}
body:has(.post-body)::after {
  right: 0;
  background-image:
    radial-gradient(780px 700px at 90% 94%, color-mix(in srgb, #8b5cf6 24%, transparent), transparent 74%),
    radial-gradient(660px 560px at 86% 88%, color-mix(in srgb, hsl(var(--glow-hue) 55% 48%) 30%, transparent), transparent 74%),
    radial-gradient(color-mix(in srgb, hsl(var(--glow-hue) 55% 48%) 22%, transparent) 2px, transparent 2.4px);
  background-size: auto, auto, 20px 20px;
  background-repeat: no-repeat, no-repeat, repeat;
  mask-image: linear-gradient(270deg, #000 80%, transparent 99%);
  -webkit-mask-image: linear-gradient(270deg, #000 80%, transparent 99%);
}
html.dark body:has(.post-body)::before {
  background-image:
    radial-gradient(780px 700px at 10% 6%, color-mix(in srgb, #f43f5e 36%, transparent), transparent 74%),
    radial-gradient(660px 560px at 14% 12%, color-mix(in srgb, hsl(var(--glow-hue) 55% 48%) 46%, transparent), transparent 74%),
    radial-gradient(color-mix(in srgb, hsl(var(--glow-hue) 55% 48%) 34%, transparent) 2px, transparent 2.4px);
  background-size: auto, auto, 20px 20px;
  background-repeat: no-repeat, no-repeat, repeat;
}
html.dark body:has(.post-body)::after {
  background-image:
    radial-gradient(780px 700px at 90% 94%, color-mix(in srgb, #8b5cf6 36%, transparent), transparent 74%),
    radial-gradient(660px 560px at 86% 88%, color-mix(in srgb, hsl(var(--glow-hue) 55% 48%) 46%, transparent), transparent 74%),
    radial-gradient(color-mix(in srgb, hsl(var(--glow-hue) 55% 48%) 34%, transparent) 2px, transparent 2.4px);
  background-size: auto, auto, 20px 20px;
  background-repeat: no-repeat, no-repeat, repeat;
}
/* 漂浮几何(≥1150px,两侧留白足够时显示,防移动端碍眼) */
@media (min-width: 1150px) {
  body:has(.post-body) main.wrap::before,
  body:has(.post-body) main.wrap::after {
    content: '';
    position: fixed;
    pointer-events: none;
    z-index: -1;
  }
  body:has(.post-body) main.wrap::before {
    left: 4vw;
    top: 16vh;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, hsl(var(--glow-hue) 55% 48%), hsl(calc(var(--glow-hue) + 80) 60% 60%), hsl(var(--glow-hue) 55% 48%));
    mask-image: radial-gradient(circle, transparent 55%, #000 56%, #000 74%, transparent 75%);
    -webkit-mask-image: radial-gradient(circle, transparent 55%, #000 56%, #000 74%, transparent 75%);
    opacity: .65;
    animation: kw-ring-spin 16s linear infinite;
  }
  html.dark body:has(.post-body) main.wrap::before { opacity: .8; }
  body:has(.post-body) main.wrap::after {
    right: 4vw;
    top: 56vh;
    width: 72px;
    height: 72px;
    border-radius: 11px;
    background: linear-gradient(120deg, hsl(var(--glow-hue) 55% 48%), hsl(calc(var(--glow-hue) + 80) 60% 60%));
    transform: rotate(45deg);
    opacity: .55;
    animation: kw-diamond-float 11s ease-in-out infinite;
  }
  html.dark body:has(.post-body) main.wrap::after { opacity: .7; }
}
@media (prefers-reduced-motion: reduce) {
  body:has(.post-body) main.wrap::before,
  body:has(.post-body) main.wrap::after { animation: none; }
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 可访问性:键盘焦点环(品牌色,2px + 2px 偏移);仅键盘触发 :focus-visible,
 * 鼠标点击不显示。表单输入已有各自 :focus 边框+光晕,不在此重复。 */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 选中文字:品牌色淡染(保留文字原色,深浅主题都柔和),替代系统默认蓝 */
::selection {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
  color: var(--ink);
}

/* 内容列宽度对齐线上 theme.json:contentSize 1000px / wideSize 1340px */
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 20px; }

/* ---------- 头部 ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .wrap {
  display: flex;
  flex-direction: column;   /* 两行:品牌+搜索在上,导航在下,避免 15 项挤乱品牌 */
  gap: 10px;
  padding-top: 14px;
  padding-bottom: 14px;
  max-width: 1000px;
}
/* 第一行:品牌 + 搜索,两端对齐。 */
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}
.brand {
  font: 600 1.25rem/1 var(--serif);
  color: var(--ink);
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  min-height: 24px;   /* 触控目标 ≥24px(target-size) */
}
.brand:hover { text-decoration: none; color: var(--accent); }
.site-nav {
  display: flex;
  align-items: center;   /* 文字链接 / lang-switch pill / 后台按钮 垂直居中对齐 */
  gap: 18px;
  font-size: 0.9rem;
  flex-wrap: wrap;       /* 内容发现补全后项变多,允许换行防溢出 */
  row-gap: 6px;
  width: 100%;           /* 第二行占满,导航换行不挤品牌 */
}
.site-nav a { color: var(--ink-soft); display: inline-flex; align-items: center; min-height: 24px; }
.site-nav a:hover { color: var(--accent); }
/* 顶部导航内联搜索表单:紧凑,视觉与导航链接齐平。 */
.nav-search {
  display: inline-flex;
  align-items: center;
}
.nav-search input[type="search"] {
  width: 130px;
  padding: 4px 10px;
  font-size: 0.82rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.nav-search input[type="search"]::placeholder { color: var(--muted); }
.nav-search input[type="search"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.nav-admin {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted) !important;
}

/* ---------- 主体 ---------- */
main.wrap { padding-top: 40px; padding-bottom: 60px; }

.page-head {
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.page-head h1 {
  margin: 0 0 8px;
  font: 600 1.9rem/1.25 var(--serif);
  background: linear-gradient(120deg, var(--ink) 30%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.page-head .muted { margin: 0; }
.page-head a { margin-top: 10px; display: inline-block; font-size: 0.9rem; }

/* ---------- Firefly 数字人 CTA(仅首页) ---------- */
.firefly-cta {
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 24px; padding: 10px 18px;
  background: linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #8b5cf6));
  border: none; border-radius: 9999px;
  font-size: 0.95rem; font-weight: 600; color: #fff;
  text-decoration: none;
  box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 32%, transparent);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.firefly-cta:hover {
  box-shadow: 0 6px 22px color-mix(in srgb, var(--accent) 45%, transparent);
  transform: translateY(-2px);
}
.firefly-cta .ff-ico { font-size: 1.15em; }

/* ---------- 英文首页 hero(与线上 /home-en/ 逐字一致) ---------- */
.home-en-hero {
  max-width: 760px; margin: 0 auto; padding: 56px 20px 8px; text-align: center;
}
.home-en-hero h1 {
  font-size: 2rem; margin: 0 0 .4em; line-height: 1.3;
}
.home-en-hero p {
  font-size: 1.05rem; line-height: 1.8; color: #374151;
  max-width: 620px; margin: 0 auto 1.6em;
}
.home-en-cta {
  display: inline-block; padding: 12px 26px; border-radius: 999px;
  background: #2563eb; color: #fff; font-weight: 600; text-decoration: none; font-size: 1rem;
}
.home-en-cta:hover { background: #1d4ed8; }
.tt25-articles-en a:hover { text-decoration: underline; }

/* ---------- 列表卡片语言徽标(与线上 / 逐字一致) ---------- */
.card-lang-badge { margin: 6px 0 10px; }
.card-lang-badge a {
  display: inline-block; padding: 2px 10px;
  border: 1px solid #d1d5db; border-radius: 4px; font-size: 12px;
  color: #6b7280; text-decoration: none;
}
.card-lang-badge a:hover { border-color: #9ca3af; color: #374151; }

/* ---------- 文章页顶部语言徽标(与线上内容徽标逐字一致) ---------- */
.post-lang-badge {
  margin-bottom: 24px; padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
}
.post-lang-badge a {
  display: inline-block; padding: 4px 12px; margin-right: 8px;
  border: 1px solid #e5e7eb; border-radius: 6px; font-size: 13px;
  color: #374151; text-decoration: none; background: #f9fafb;
}
.post-lang-badge a:hover { border-color: #cbd5e1; color: #111; }

/* ---------- 文章卡片 ---------- */
.posts { display: flex; flex-direction: column; gap: 26px; }

.post-card {
  background: color-mix(in srgb, var(--panel) 76%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 24px;   /* 卡片间距(原无 margin,列表卡片紧贴) */
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
  position: relative;
}
@media (min-width: 641px) {
  .post-card {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}
.post-card:last-child { margin-bottom: 0; }
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 14%, transparent);
  border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
}
/* ---------- 精选卡片(首页精选区):品牌色左边框 + 「★ 精选」角标 ---------- */
.post-card.featured {
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 26%, var(--panel));
}
/* 标题右侧留出角标空间,避免长标题被右上角「★ 精选」遮挡。 */
.post-card.featured .post-title {
  padding-right: 96px;
}
.featured-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 3px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent-ink, var(--accent));
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 999px;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .post-card.featured .post-title {
    padding-right: 76px;
  }
  .featured-badge {
    top: 10px;
    right: 10px;
    font-size: 0.7rem;
    padding: 2px 8px;
  }
}
.post-title { margin: 0 0 10px; font-size: 1.35rem; }
.post-title a {
  color: var(--ink);
  font: 600 1.35rem/1.35 var(--serif);
  background: linear-gradient(120deg, var(--ink) 55%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.post-title a:hover { color: var(--accent); -webkit-background-clip: unset; background-clip: unset; background: none; }
.post-excerpt {
  color: var(--ink-soft);
  margin: 0 0 12px;
  line-height: 1.65;
}
.post-meta {
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.post-tags { display: flex; gap: 10px; flex-wrap: wrap; }
.tag {
  display: inline-block;
  padding: 2px 9px;
  background: var(--accent-soft);
  color: var(--accent-ink);   /* 提高对 accent-soft 的对比(原 var(--accent) 仅 3.99) */
  border-radius: 10px;
  font-size: 0.78rem;
}
.tag:hover { text-decoration: none; background: var(--accent); color: var(--accent-contrast, #fff); }

/* ---------- 文章详情 ---------- */
/* 文章详情:加宽并居中(原 720px 左对齐,右侧留 280px 空白显窄)。
   800px 对中文正文行宽(约 50 字/行)仍舒适,且更填满 1000px 容器。 */
.post { max-width: 800px; margin: 0 auto; }
/* 锚点跳转留出顶部 sticky header 高度(64px)+ 余量,避免 TOC 点击/URL hash
   直达时章节标题被顶栏遮挡。 */
.post-body h2[id^="sec-"],
.post-body h3[id^="sec-"] { scroll-margin-top: 84px; }
.toc {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 0 0 18px;
  background: var(--panel);
  font-size: 0.9rem;
}
.toc-title { font-weight: 600; margin-bottom: 8px; color: var(--muted); }
.toc-list { display: flex; flex-direction: column; gap: 3px; }
.toc-link { color: var(--ink-soft); text-decoration: none; line-height: 1.5; padding: 3px 6px; border-radius: 4px; }
.toc-link:hover { color: var(--accent); background: var(--accent-soft); }
.toc-link.toc-h3 { padding-left: 1.3em; font-size: 0.87em; }
.toc-link.active { color: var(--accent); font-weight: 600; }
.breadcrumb {
  font-size: 0.88rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  line-height: 1.5;
}
.breadcrumb a { color: var(--accent); text-decoration: none; display: inline-flex; align-items: center; min-height: 24px; }
.breadcrumb a:hover { text-decoration: underline; }
.bc-sep { color: var(--muted); opacity: 0.6; }
/* 当前文章标题:不强制拉伸(短标题保持自然宽),但允许占满面包屑剩余宽度,
   长标题显示到行尾才省略号(替代原 16em 硬限——那会把 100+ 字符的长标题
   压到 ~210px 截断)。 */
.bc-current {
  color: var(--ink);
  min-width: 0;
  flex: 0 1 auto;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.post-h1 {
  font: 600 2.2rem/1.3 var(--serif);
  margin: 0 0 12px;
}
.post-meta-line {
  color: var(--muted);
  font-size: 0.88rem;
  padding: 10px 0 18px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  line-height: 1.4;
}
.post-tags { margin: 16px 0; }

/* 正文排版(与 Markdown 渲染结果配合) */
.post-body {
  font: 1.02rem/1.85 var(--serif);
  color: var(--ink);
}
/* ---------- 评论区(只读迁移) ---------- */
.comments {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.comments-title {
  font: 600 1.2rem/1.4 var(--serif);
  margin: 0 0 14px;
}
.comments-list { list-style: none; margin: 0; padding: 0; }
.comments-list .comment {
  padding: 14px 0;
  border-bottom: 1px dashed var(--line);
}
.comments-list .comment:last-child { border-bottom: none; }
.comment-head {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 6px; font-size: 0.92rem;
}
.comment-author { font-weight: 600; color: var(--ink); }
.comment-date { color: var(--muted); font-size: 0.85rem; }
.comment-body {
  font: 0.95rem/1.7 var(--serif);
  color: var(--ink);
  /* 评论富文本:Markdown 渲染的 HTML 自带段落/换行,不需 pre-wrap */
}
.comment-body a { color: var(--accent); }
/* 评论表单(审核制):提交进 pending,后台审核后显示 */
.comment-form { margin-top: 18px; }
.cf-row { display: flex; gap: 10px; margin-bottom: 10px; }
.cf-row input { flex: 1; }
.comment-form input, .comment-form textarea {
  width: 100%; box-sizing: border-box;
  padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--bg); color: var(--ink);
  font: 0.95rem/1.5 var(--serif);
}
.comment-form textarea { resize: vertical; margin-bottom: 10px; }
.comment-form input:focus, .comment-form textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.cf-actions { display: flex; align-items: center; gap: 12px; }
.cf-submit {
  background: var(--accent); color: var(--accent-contrast, #fff);
  border: none; padding: 9px 18px; border-radius: 8px;
  font: 600 0.95rem/1 var(--serif); cursor: pointer;
}
.cf-submit:hover { opacity: 0.9; }
.cf-submit:disabled { opacity: 0.6; cursor: not-allowed; }
/* Markdown 预览切换按钮(次级) */
.cf-preview-toggle {
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); padding: 9px 16px; border-radius: 8px;
  font: 500 0.9rem/1 var(--sans); cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.cf-preview-toggle:hover { border-color: var(--accent); color: var(--accent); }
/* Markdown 预览容器:与评论正文同外观,所见即所得 */
.cf-preview {
  margin: 10px 0;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  max-height: 260px;
  overflow: auto;
  font-size: 0.9rem;
  line-height: 1.65;
}
.cf-preview p { margin: 0 0 0.6em; }
.cf-preview p:last-child { margin-bottom: 0; }
.cf-preview.empty { color: var(--muted); font-style: italic; }
.cf-preview a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.cf-preview code {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  padding: 1px 5px; border-radius: 3px; font-size: 0.88em;
}
.cf-preview pre {
  background: var(--code-bg); padding: 10px 12px; border-radius: 6px;
  overflow-x: auto; margin: 0.6em 0;
}
.cf-preview pre code { background: none; padding: 0; }
.cf-preview blockquote {
  margin: 0.6em 0; padding: 6px 12px;
  border-left: 3px solid var(--accent);
  color: var(--ink-soft);
}
.cf-preview ul, .cf-preview ol { margin: 0.4em 0; padding-left: 1.4em; }
.cf-preview li { margin: 0.2em 0; }
.cf-preview h1, .cf-preview h2, .cf-preview h3, .cf-preview h4 {
  margin: 0.7em 0 0.35em; font: 600 1.1em/1.4 var(--serif); color: var(--ink);
}
.cf-preview h1 { font-size: 1.25em; }
.cf-preview h2 { font-size: 1.15em; }
.cf-preview h3, .cf-preview h4 { font-size: 1.05em; }
.cf-msg { font-size: 0.85rem; }
.cf-msg.ok { color: var(--accent); }
.cf-msg.err { color: #b8483d; }
html.dark .cf-msg.err { color: #ff8a7a; }
.cf-hint { font-size: 0.8rem; color: var(--muted); margin: 8px 0 0; }
.post-body h1, .post-body h2, .post-body h3, .post-body h4 {
  font: 600 1.5rem/1.4 var(--serif);
  margin: 1.6em 0 0.7em;
}
.post-body h1 { font-size: 1.7rem; }
.post-body h2 { font-size: 1.45rem; }
.post-body p { margin: 0 0 1em; }
.post-body blockquote {
  margin: 1em 0;
  padding: 0.6em 1em;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  color: var(--ink-soft);
}
.post-body pre {
  background: var(--code-bg, #f4f1ea);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.6;
}
/* 文章表格:display:block + overflow-x 让宽表格小屏横向滚动(不溢出) */
.post-body table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.92em;
  max-width: 100%;
}
.post-body th, .post-body td {
  border: 1px solid var(--line);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}
.post-body th {
  background: var(--panel, var(--bg));
  font-weight: 600;
  white-space: nowrap;
}
.post-body code {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.9em;
  font-family: var(--mono);
}
.post-body pre code { background: none; padding: 0; }
.post-body ul, .post-body ol { padding-left: 1.6em; }
.post-body li { margin: 0.3em 0; }
.post-body img {
  max-width: 100%;
  border-radius: 4px;
  margin: 0.6em 0;
}
.post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.post-body hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 1.6em 0;
}
.post-body del { color: var(--muted); }
.post-body mark { background: #fff3bf; padding: 0 2px; }

/* FAQ 问答块 */
.post-body .faq {
  margin: 1.2em 0;
  padding: 14px 18px;
  background: color-mix(in srgb, var(--accent) 4%, transparent);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
}
.post-body .faq p { margin: 0 0 0.6em; }
.post-body .faq p:last-child { margin-bottom: 0; }
/* 问答条目间距:每条 Q/A 独立成块(与线上 faq-item 一致,避免挤成一团) */
.post-body .faq-item { margin: 1.05em 0 0; }
.post-body .faq-item:first-child { margin-top: 0; }
.post-body .faq-q {
  margin: 0 0 0.35em;
  font-size: 1.02em;
  font-weight: 600;
  color: var(--ink);
}
.post-body .faq-a p { margin: 0; }

/* ============ 商品卡片 / 相关文章卡片 ============ */
/* 编辑器内容区(.editor-area)复用同一套卡片样式,后台 WYSIWYG 所见即所得 */
/* 占位符(插件未启用时):显示原始 key:value 文本,不丢内容 */
.post-body .card-pending,
.editor-area .card-pending {
  margin: 1.6em 0;
  padding: 12px 16px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  white-space: pre-wrap;
  font-family: var(--mono);
}

/* 商品卡片:左图右文 */
.post-body .product-card,
.editor-area .product-card {
  display: flex;
  flex-direction: row;
  box-sizing: border-box;
  width: 100%;
  margin: 1.6em 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.post-body a.product-card:hover,
.editor-area a.product-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  text-decoration: none;
  color: var(--ink);
}
.pc-img {
  width: 240px;
  min-width: 240px;
  background: var(--line);
}
.pc-img img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 180px;
  object-fit: cover;
}
.pc-right {
  flex: 1;
  min-width: 0;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}
.pc-top { min-width: 0; }
.pc-tags { margin-bottom: 8px; }
.pc-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.6;
  border-radius: 3px;
  background: var(--accent-soft);
  color: var(--accent-ink);   /* 提高对 accent-soft 对比(原 var(--accent) 仅 3.99) */
}
.pc-title {
  font-weight: 700;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pc-desc {
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pc-desc span { font-size: 14px; color: var(--muted); line-height: 1.6; }
.pc-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.pc-prices { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.pc-price { font-size: 18px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.pc-original { font-size: 13px; color: var(--muted); text-decoration: line-through; white-space: nowrap; }
.pc-btn {
  display: inline-block;
  padding: 6px 14px;
  font-size: 13px;
  line-height: 1.5;
  border-radius: 4px;
  background: var(--accent);
  color: var(--accent-contrast, #fff);
  white-space: nowrap;
}

/* 相关文章卡片列表 */
.related-posts { margin: 2em 0 0; }
.related-posts h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--ink);
}
.related-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.related-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  transition: border-color 0.2s;
}
.related-item:hover { border-color: var(--accent); }
.related-link {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  text-decoration: none;
}
.related-link:hover { color: var(--accent); }
.related-date {
  font-size: 0.8rem;
  color: var(--muted);
}
.related-articles { margin: 1.6em 0; }
.ra-head {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 10px;
}
.ra-item {
  display: flex;
  flex-direction: row;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
  margin-bottom: 10px;
  transition: border-color 0.2s;
}
.ra-item:last-child { margin-bottom: 0; }
.ra-item:hover {
  border-color: var(--accent);
  text-decoration: none;
  color: var(--ink);
}
.ra-img {
  width: 96px;
  min-width: 96px;
  height: 96px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ra-mark {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
  padding: 4px;
  line-height: 1.3;
  word-break: break-all;
}
.ra-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.ra-title {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ra-desc {
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ra-desc span { font-size: 13px; color: var(--muted); line-height: 1.5; }
.ra-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}
.ra-date { white-space: nowrap; }
.ra-meta { white-space: nowrap; }

@media (max-width: 640px) {
  .pc-img { width: 110px; min-width: 110px; }
  .pc-img img { min-height: 120px; }
  .pc-right { padding: 10px 12px; gap: 8px; }
  .pc-title { font-size: 15px; }
  .pc-price { font-size: 16px; }
  .pc-btn { padding: 5px 10px; font-size: 12px; }
  .ra-img { width: 76px; min-width: 76px; height: 76px; }
  .ra-item { gap: 10px; padding: 10px; }
}

.adj-nav {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}
.adj { max-width: 48%; }

.back { display: inline-block; margin-top: 22px; font-size: 0.9rem; }

/* ---------- 分享栏 ---------- */
.share-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
  padding: 16px;
  background: var(--panel);   /* 亮/暗自适应(原硬编码 #f9f7f3,暗色下 share-title 对比仅 2.69) */
  border: 1px solid var(--line);
  border-radius: 8px;
}
.share-title {
  font-size: 0.85rem;
  color: var(--muted);
  margin-right: 8px;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-family: inherit;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s;
  min-width: 32px;
}
.share-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.share-btn.wechat:hover { background: #e8f8f0; border-color: #07c160; color: #07c160; }
.share-btn.weibo:hover { background: #fce4e4; border-color: #ff8200; color: #ff8200; }
.share-btn.twitter:hover { background: #e8f4fd; border-color: #1da1f2; color: #1da1f2; }
.share-btn.facebook:hover { background: #e8f0fe; border-color: #1877f2; color: #1877f2; }
.share-btn.copy { padding: 6px 10px; }
.share-btn.copied { background: var(--ok, #22c55e); color: #fff; border-color: var(--ok, #22c55e); }

/* 关键词高亮 */
/* ---------- 作者框(文章尾部,E-E-A-T) ---------- */
.author-box {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-top: 24px;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.ab-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--line);
  background: var(--accent-soft);
}
.ab-info { min-width: 0; }
.ab-label {
  margin: 0 0 2px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.ab-name {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}
.ab-bio {
  margin: 0 0 10px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
.ab-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}
.ab-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.ab-link:hover { text-decoration: underline; }

/* ---------- GitHub Star CTA(文章尾部) ---------- */
.gh-star-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding: 16px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.gh-star-emoji { font-size: 1.6rem; line-height: 1; }
.gh-star-info { flex: 1; min-width: 0; }
.gh-star-title {
  margin: 0 0 2px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}
.gh-star-sub {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  color: var(--muted);
  word-break: break-all;
}
.gh-star-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border-radius: 6px;
  text-decoration: none;
  transition: transform 0.12s, filter 0.12s;
}
.gh-star-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  color: #fff;
}

/* ---------- 文章内产品 CTA(正文后,Stage E) ---------- */
.prod-cta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 28px 0 0;
  padding: 16px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.prod-cta-info { flex: 1; min-width: 0; }
.prod-cta-label {
  margin: 0 0 2px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.prod-cta-name {
  margin: 0 0 4px;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--ink);
}
.prod-cta-desc {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--ink-soft);
}
.prod-cta-btn {
  flex-shrink: 0;
  padding: 9px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-contrast, #fff);
  background: var(--accent);
  border-radius: 6px;
  text-decoration: none;
  transition: transform 0.12s, filter 0.12s;
}
.prod-cta-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  color: var(--accent-contrast, #fff);
}
@media (max-width: 640px) {
  .prod-cta { flex-wrap: wrap; }
  .prod-cta-btn { width: 100%; text-align: center; }
}

/* ---------- 文章系列徽标(文章页顶部) ---------- */
.series-badge {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 14px 0 4px;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.85rem;
}
.series-link {
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}
.series-link:hover { text-decoration: underline; }
.series-progress {
  color: var(--muted);
  font-size: 0.82rem;
}
.series-nav {
  display: inline-flex;
  gap: 12px;
  margin-left: auto;
}
.series-prev, .series-next {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.82rem;
}
.series-prev:hover, .series-next:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ---------- 系列索引页 ---------- */
.series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.series-chip {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.series-chip:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.series-chip-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}
.series-chip-desc {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--ink-soft);
}
.series-chip-count {
  font-style: normal;
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---------- 系列落地页 ---------- */
.series-desc {
  max-width: 60ch;
  line-height: 1.6;
}
.series-count { margin-top: 0; }
.series-list {
  list-style: none;
  padding: 0;
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.series-post {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.series-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
}
.series-post-body { min-width: 0; }
.series-post-title {
  display: block;
  font-size: 0.98rem;
  font-weight: 650;
  color: var(--ink);
  text-decoration: none;
}
.series-post-title:hover { color: var(--accent); }
.series-post-date {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--muted);
}

.post-body a.kw-link {
  color: inherit;
  text-decoration: none;
}
.post-body a.kw-link:hover {
  text-decoration: underline;
}
.post-body mark.keyword-highlight {
  background: var(--hl, color-mix(in srgb, var(--accent) 15%, transparent));
  color: var(--ink);
  padding: 1px 3px;
  border-radius: 2px;
  font-weight: 500;
  transition: background 0.2s;
  cursor: pointer;
}
.post-body a.kw-link:hover mark.keyword-highlight {
  background: var(--hl, color-mix(in srgb, var(--accent) 30%, transparent));
}

/* ---------- 链接页 ---------- */
.links-list {
  list-style: none;
  padding: 0;
  margin-top: 16px;
}
.links-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.link-date {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.kw-filter-banner {
  margin: 16px 0;
  padding: 10px 14px;
  background: var(--accent-soft);
  border-radius: 6px;
  font-size: 0.9em;
}
.kw-filter-banner .kw-back {
  margin-right: 12px;
}
.kw-filter-banner .kw-n {
  font-weight: 600;
}

/* ---------- 关键词聚合页 ---------- */
.keyword-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.keyword-card {
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: all 0.2s;
}
.keyword-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 10%, transparent);
}
.kw-name {
  margin: 0 0 12px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
}
.kw-count {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--accent-ink);   /* 对 accent-soft 对比 5.12(原 muted #6b7280 仅 3.7) */
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
}
.kw-posts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kw-posts a {
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
  transition: all 0.15s;
}
.kw-posts a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------- 语言切换 ---------- */
.site-nav .lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 8px;
  min-height: 24px;   /* 触控目标 ≥24px(target-size) */
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  background: var(--accent-soft, #e8f0fe);
  border: none;
  border-radius: 999px;
  color: var(--accent-ink, #1a73e8);   /* 对 accent-soft 对比 ≥4.5(原 --accent 3.99) */
  text-decoration: none;
  transition: all 0.2s;
}
.site-nav .lang-switch:hover {
  background: var(--accent-ink, #1a73e8);   /* 深色底配白字,对比≥4.5(原 --accent 底暗色仅3.83) */
  color: var(--accent-contrast, #fff);
}

/* ---------- 标签页 ---------- */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.tag-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink-soft);
}
.tag-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.tag-chip em {
  color: var(--muted);
  font-size: 0.8rem;
  font-style: normal;
}

/* ---------- 关于页 ---------- */
.about h2 {
  font: 600 1.3rem/1.4 var(--serif);
  margin: 1.6em 0 0.5em;
}
.about p { line-height: 1.85; }
.about code {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.9em;
}
.about a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* 简历卡片(主视觉) */
.about .bio-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 22px;
  margin: 16px 0;
  line-height: 1.8;
}
.about .bio-card p { margin: 0.5em 0; }
.about .bio-card p:first-child { margin-top: 0; }
.about .bio-card p:last-child { margin-bottom: 0; }

/* 链接行(GitHub / 邮箱 / 社交) */
.about .links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 12px 0;
  font-size: 0.9rem;
}
.about .links a { color: var(--accent); }
.about .links a:hover { text-decoration: underline; }

/* ---------- 免费资源页:资源卡片(玻璃拟态,与首页一致) ----------
 * 仅作用于 .about.resources(关于页 .links 仍为文本行)。文本与 href 不变,
 * 视觉改造纯 CSS:网格卡片 + 渐变圆点 + 内/外链箭头。 */
.about.resources .links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin: 12px 0 26px;
  font-size: 0.9rem;
}
.about.resources .links a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  background: color-mix(in srgb, var(--panel) 76%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 12px;
  padding: 12px 14px;
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
@media (min-width: 641px) {
  .about.resources .links a {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}
.about.resources .links a::before {
  content: '';
  width: 9px; height: 9px;
  border-radius: 50%;
  flex: none;
  background: linear-gradient(120deg, var(--accent), #8b5cf6);
  box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 45%, transparent);
}
.about.resources .links a::after {
  content: '→';
  margin-left: auto;
  color: var(--muted);
  font-size: 0.95em;
  transition: transform .18s ease, color .18s ease;
}
.about.resources .links a[href^="http"]::after { content: '↗'; }
.about.resources .links a:hover {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 16%, transparent);
}
.about.resources .links a:hover::after {
  color: var(--accent);
  transform: translate(2px, -1px);
}
/* 深色:玻璃底更透,字色保持可读 */
html.dark .about.resources .links a {
  background: color-mix(in srgb, var(--panel) 60%, transparent);
}
/* 小节标题:渐变菱形标记 */
.about.resources h2 {
  display: flex;
  align-items: center;
  gap: 9px;
}
.about.resources h2::before {
  content: '';
  width: 12px; height: 12px;
  border-radius: 3px;
  flex: none;
  background: linear-gradient(120deg, var(--accent), #8b5cf6);
  transform: rotate(45deg);
}
@media (prefers-reduced-motion: reduce) {
  .about.resources .links a:hover,
  .about.resources .links a:hover::after { transform: none; }
}

/* FAQ(关于页与文章正文共用外观) */
.about .faq {
  margin: 14px 0;
  padding: 14px 18px;
  background: color-mix(in srgb, var(--accent) 4%, transparent);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
}
.about .faq p { margin: 0 0 0.6em; }
.about .faq p:last-child { margin-bottom: 0; }

/* ---------- 搜索页 ---------- */
.search-box {
  display: flex;
  gap: 10px;
  margin: 0 0 28px;
}
.search-box input[type="search"] {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font-size: 0.95rem;
}
.search-box input[type="search"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
.search-box button {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-contrast, #fff);
  font-size: 0.95rem;
  cursor: pointer;
  transition: opacity 0.15s;
}
.search-box button:hover { opacity: 0.9; }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 60px 0; }
.notfound h1 {
  font: 600 3rem/1 var(--serif);
  color: var(--accent);
}
.notfound p { color: var(--muted); margin: 12px 0 24px; }

/* ---------- 分页 ---------- */
.pager {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-top: 34px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}
.pager a, .pager span {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink-soft);
  background: var(--panel);
}
.pager a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pager .cur {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast, #fff);
}
.pager .dots {
  border: none;
  background: none;
  padding: 6px 4px;
  color: var(--muted);
}

/* ---------- 杂项 ---------- */
.muted { color: var(--muted); }
.empty { padding: 40px 0; text-align: center; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px 0 30px;
  margin-top: 40px;
  color: var(--muted);
  font-size: 0.85rem;
}
.site-footer .wrap { max-width: 860px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

/* 页脚上半:品牌描述(整体居中) */
.footer-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  margin-bottom: 16px;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.footer-desc { color: var(--muted); font-size: 0.8rem; }

/* 页脚下半:年份 + 构建信息 + 备案 + 站点子域外链(整体居中,同一块不分层) */
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
  gap: 8px 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
}
.footer-icp {
  display: inline-flex;
  gap: 14px;
  flex-wrap: wrap;
}
.footer-icp a { color: var(--muted); }
.footer-icp a:hover { color: var(--accent); text-decoration: underline; }

/* 站点子域外链行(商店/Web/Chat/Nsbp + 隐私政策):紧贴品牌描述下方,
 * 居中一行,不占 footer-bottom(备案/年份仍在其下)。 */
.footer-sitelinks {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 22px;
}
.footer-sitelinks a { color: var(--muted); }
.footer-sitelinks a:hover { color: var(--accent); text-decoration: none; }

/* Newsletter 订阅表单(页脚):居中,输入 + 按钮一行,下方反馈文案。 */
.subscribe-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 4px auto 20px;
  max-width: 420px;
  width: 100%;
}
.subscribe-label {
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--ink-soft);
}
.subscribe-row {
  display: flex;
  gap: 8px;
  width: 100%;
}
.subscribe-row input[type="email"] {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
}
.subscribe-row input[type="email"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.subscribe-btn {
  flex-shrink: 0;
  padding: 9px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--accent-contrast, #fff);
  background: var(--accent);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s;
}
.subscribe-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.subscribe-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.subscribe-msg {
  margin: 0;
  min-height: 1.2em;
  font-size: 0.8rem;
}
.subscribe-msg.ok { color: var(--ok, #22c55e); }
.subscribe-msg.err { color: var(--err, #e5484d); }

/* 关注入口行:居中,label + 渠道链接。 */
.footer-follow {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 18px;
  margin: 0 auto 20px;
  font-size: 0.82rem;
}
.follow-label {
  font-weight: 650;
  color: var(--ink-soft);
}
.footer-follow a {
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}
.footer-follow a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- 响应式 ---------- */
/* 平板(iPad 竖屏 768 / 横屏 1024 及大手机横屏):导航更宽松,可换行防溢出 */
@media (max-width: 900px) {
  .site-header .wrap { gap: 10px; }
  .site-nav { gap: 12px; flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .site-header .wrap { flex-direction: column; gap: 10px; align-items: flex-start; }
  .site-nav { gap: 12px; flex-wrap: wrap; }
  main.wrap { padding-top: 24px; }
  .post-h1 { font-size: 1.7rem; }
  .page-head h1 { font-size: 1.5rem; }
  .adj-nav { flex-direction: column; }
  .adj { max-width: 100%; }
  .post-card { padding: 16px; }
  .search-box { flex-direction: column; }
  .search-box button { width: 100%; }
  /* 评论表单小屏:昵称/邮箱堆叠,操作行可换行 */
  .cf-row { flex-direction: column; gap: 8px; }
  .cf-actions { flex-wrap: wrap; gap: 8px; }
  /* 作者框/Star 卡片小屏:头像与按钮换行,避免挤压 */
  .author-box { flex-direction: column; }
  .ab-avatar { width: 56px; height: 56px; }
  .gh-star-card { flex-wrap: wrap; }
  .gh-star-info { flex: 1 1 100%; }
}

/* ---------- 跳过导航直达正文(键盘可达性) ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  padding: 10px 16px;
  background: var(--panel);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 0 0 8px 0;
  border: 1px solid var(--line);
  border-top: 0;
  border-left: 0;
}
.skip-link:focus {
  left: 0;
}
main#main:focus {
  outline: none;
}

/* ---------- 阅读进度条 ---------- */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--accent);
  z-index: 1000;
  transition: width 0.1s;
}

/* ---------- 返回顶部按钮 ---------- */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-contrast, #fff);
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: all 0.2s;
  z-index: 100;
}
.back-to-top.show {
  display: flex;
}
.back-to-top:hover {
  background: var(--accent-soft);
  transform: translateY(-2px);
}

/* ---------- 暗色模式 ---------- */
.dark-mode-toggle {
  position: fixed;
  bottom: 30px;
  right: 80px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.2s;
  z-index: 100;
}
.dark-mode-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

html.dark {
  --bg: #1a1a2e;
  --panel: #16213e;
  --ink: #e0e0e0;
  --ink-soft: #b0b0b0;
  --muted: #9498a4;   /* 暗色 muted:对 #1a1a2e 5.92 / #16213e 5.52(原 #808080 4.32/4.02 不足) */
  --accent: #f0566f;   /* 暗色链接:对 #1a1a2e 5.09 / #16213e 4.74(原 #e94560 4.46 不足) */
  --accent-soft: #2d2d44;
  --accent-ink: #ff8a7a;   /* 暗色 tag 文字:对 #2d2d44 对比 5.84 */
  --line: #33334d;
  color-scheme: dark;          /* 深色模式下原生滚动条/控件跟随深色 */
  accent-color: var(--accent);
}

/* 暗黑模式代码块样式 */
html.dark .post-body pre {
  background: #0d1117;
  border-color: #30363d;
}
html.dark .post-body code {
  background: rgba(233, 69, 96, 0.15);
}
html.dark .post-body pre code {
  background: none;
  color: #e6edf3;
}
html.dark .post-body blockquote {
  background: rgba(233, 69, 96, 0.1);
  border-left-color: var(--accent);
}
html.dark .post-body mark {
  background: #4a3f00;
  color: #ffd700;
}
/* 暗色关键词高亮:彩底(半透明合成)上白字对比 ≥5.8,覆盖通用 mark 的黄字
   (黄字 #ffd700 在暗色彩底上仅 4.2-4.5,不足 4.5)。 */
html.dark .post-body mark.keyword-highlight {
  color: #ffffff;
}
html.dark .post-body .faq {
  background: rgba(233, 69, 96, 0.08);
  border-color: #30363d;
  border-left-color: var(--accent);
}
html.dark .post-body .product-card,
html.dark .post-body .ra-item,
html.dark .editor-area .product-card,
html.dark .editor-area .ra-item {
  background: #0d1117;
  border-color: #30363d;
}
html.dark .post-body a.product-card:hover,
html.dark .post-body .ra-item:hover,
html.dark .editor-area a.product-card:hover,
html.dark .editor-area .ra-item:hover {
  border-color: var(--accent);
}
html.dark .pc-img { background: #1f2933; }
html.dark .ra-img {
  background: linear-gradient(135deg, #2d2d44, #e94560);
}
html.dark .ra-mark { color: #ffd9de; }
html.dark .about .bio-card {
  border-color: #30363d;
}
html.dark .about .faq {
  background: rgba(233, 69, 96, 0.08);
  border-color: #30363d;
  border-left-color: var(--accent);
}
html.dark .search-box input[type="search"] {
  border-color: #30363d;
}
html.dark .tag {
  background: rgba(233, 69, 96, 0.2);
  color: #ff6b81;
}
html.dark .tag:hover {
  background: var(--accent);
  color: var(--accent-contrast, #fff);
}

/* ---------- 阅读进度条 ---------- */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--accent);
  z-index: 1000;
  transition: width 0.1s;
}

/* ---------- 返回顶部按钮 ---------- */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-contrast, #fff);
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: all 0.2s;
  z-index: 100;
}
.back-to-top.show {
  display: flex;
}
.back-to-top:hover {
  background: var(--accent-soft);
  transform: translateY(-2px);
}

/* 插件:作者头像 */
.post-author { display: inline-flex; align-items: center; }
.author-avatar { border: 1px solid var(--line); background: #fff; }

/* 插件:列表广告位 */
.ad-slot {
  margin: 24px 0;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
  overflow: hidden;
}

/* ---------- 代码高亮亮色对比度修正 ----------
   vendors/github.min.css 在 style.css 后加载,需更高优先级覆盖。
   亮色 code 块背景 #f4f1ea 下,github 主题的 keyword #d73a49(4.06)
   与 built_in #e36209(3.09) 对比不足(<4.5),加深到合格值。
   暗色用 github-dark.min.css,已在 #0d1117 上全部 ≥4.5,不改。 */
html:not(.dark) .post-body .hljs-keyword,
html:not(.dark) .post-body .hljs-doctag,
html:not(.dark) .post-body .hljs-type,
html:not(.dark) .post-body .hljs-variable.language_ {
  color: #c62828;   /* 对 #f4f1ea 对比 4.98 */
}
html:not(.dark) .post-body .hljs-built_in,
html:not(.dark) .post-body .hljs-symbol {
  color: #c2410c;   /* 对 #f4f1ea 对比 4.59 */
}
html:not(.dark) .post-body .hljs-name,
html:not(.dark) .post-body .hljs-quote,
html:not(.dark) .post-body .hljs-selector-pseudo,
html:not(.dark) .post-body .hljs-selector-tag {
  color: #166534;   /* 对 #f4f1ea 对比 6.32(原 #22863a 仅 4.10) */
}
html:not(.dark) .post-body .hljs-comment,
html:not(.dark) .post-body .hljs-code,
html:not(.dark) .post-body .hljs-formula {
  color: #5c646e;   /* 对 #f4f1ea 对比 5.31(原 #6a737d 仅 4.27) */
}

/* ---------- 代码高亮暗色对比度修正 ----------
   暗色 code 块背景被覆盖为 #0d1117(html.dark .post-body pre),但页面只引入
   亮色 github.min.css,暗色下 token 用亮色系(如 #005cc5/#032f62)在 #0d1117
   上对比仅 1.4-3.0,严重不足。此处按 github-dark.min.css 的暗色 token 色
   覆盖,保证暗色 code 全 token ≥4.5。 */
html.dark .post-body .hljs-doctag,
html.dark .post-body .hljs-keyword,
html.dark .post-body .hljs-meta .hljs-keyword,
html.dark .post-body .hljs-template-tag,
html.dark .post-body .hljs-template-variable,
html.dark .post-body .hljs-type,
html.dark .post-body .hljs-variable.language_ {
  color: #ff7b72;
}
html.dark .post-body .hljs-title,
html.dark .post-body .hljs-title.class_,
html.dark .post-body .hljs-title.class_.inherited__,
html.dark .post-body .hljs-title.function_ {
  color: #d2a8ff;
}
html.dark .post-body .hljs-attr,
html.dark .post-body .hljs-attribute,
html.dark .post-body .hljs-literal,
html.dark .post-body .hljs-meta,
html.dark .post-body .hljs-number,
html.dark .post-body .hljs-operator,
html.dark .post-body .hljs-selector-attr,
html.dark .post-body .hljs-selector-class,
html.dark .post-body .hljs-selector-id,
html.dark .post-body .hljs-variable {
  color: #79c0ff;
}
html.dark .post-body .hljs-meta .hljs-string,
html.dark .post-body .hljs-regexp,
html.dark .post-body .hljs-string {
  color: #a5d6ff;
}
html.dark .post-body .hljs-built_in,
html.dark .post-body .hljs-symbol {
  color: #ffa657;
}
html.dark .post-body .hljs-code,
html.dark .post-body .hljs-comment,
html.dark .post-body .hljs-formula {
  color: #8b949e;
}
html.dark .post-body .hljs-name,
html.dark .post-body .hljs-quote,
html.dark .post-body .hljs-selector-pseudo,
html.dark .post-body .hljs-selector-tag {
  color: #7ee787;
}
html.dark .post-body .hljs-subst {
  color: #c9d1d9;
}
html.dark .post-body .hljs-section {
  color: #1f6feb;
  font-weight: 700;
}
html.dark .post-body .hljs-bullet {
  color: #f2cc60;
}
html.dark .post-body .hljs-emphasis {
  color: #c9d1d9;
  font-style: italic;
}
html.dark .post-body .hljs-strong {
  color: #c9d1d9;
  font-weight: 700;
}
html.dark .post-body .hljs-addition {
  color: #aff5b4;
  background-color: #033a16;
}
html.dark .post-body .hljs-deletion {
  color: #ffdcd7;
  background-color: #67060c;
}

/* ---------- 社会证明:访客统计条(首页) ---------- */
.visitor-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 24px;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--panel) 72%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 12px;
  font-size: 0.85rem;
  color: var(--muted);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.visitor-stats .vs-item strong {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.visitor-stats .vs-sep {
  color: var(--line);
}

/* ---------- 首页「精选项目」板块 ---------- */
.featured-projects {
  margin: 40px 0 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.featured-projects .fp-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--ink);
}
.featured-projects .fp-sub {
  margin: 0 0 18px;
  font-size: 0.9rem;
}
.featured-projects .fp-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (max-width: 640px) {
  .featured-projects .fp-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- 首页精选 + 热门(Stage D) ---------- */
.featured-posts {
  margin: 36px 0 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.featured-posts .fp-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--ink);
}
.featured-posts .fp-sub {
  margin: 0 0 18px;
  font-size: 0.9rem;
}
.featured-posts .fp-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
/* 单数卡片时最后一张横跨全宽:两列网格最后一个落单会右侧留白、
 * 只有半宽,与全宽普通卡不协调。奇数个时让末位卡占满两列。 */
.featured-posts .fp-grid .post-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}
@media (max-width: 640px) {
  .featured-posts .fp-grid {
    grid-template-columns: 1fr;
  }
}

/* 热门 Top5:编号列表 + 浏览量。 */
.top-posts {
  margin: 36px 0 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.tp-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--ink);
}
.top-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.top-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.top-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 50%;
}
.top-link {
  flex: 1;
  min-width: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.top-link:hover { color: var(--accent); }
.top-views {
  flex-shrink: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---------- 归档页(按年) ---------- */
.arch-year {
  margin: 26px 0 6px;
}
.arch-year-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.arch-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.arch-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.arch-item a {
  flex: 1;
  min-width: 0;
  font-size: 0.92rem;
  font-weight: 550;
  color: var(--ink);
  text-decoration: none;
}
.arch-item a:hover { color: var(--accent); }
.arch-date {
  flex-shrink: 0;
  font-size: 0.76rem;
  color: var(--muted);
}

/* ---------- 开始阅读页 ---------- */
.sh-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sh-post {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.sh-post a {
  flex: 1;
  min-width: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.sh-post a:hover { color: var(--accent); }
.sh-topics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 0 0 8px;
}
.sh-topic {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
}
.sh-topic:hover { border-color: var(--accent); }
.sh-topic span { font-weight: 700; color: var(--ink); font-size: 0.95rem; }
.sh-topic em { font-style: normal; font-size: 0.78rem; color: var(--muted); }
.sh-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0 0 8px;
}
.sh-pages a { font-size: 0.9rem; font-weight: 600; color: var(--accent); text-decoration: none; }
.sh-pages a:hover { text-decoration: underline; }
.sh-sub {
  margin-top: 18px;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
@media (max-width: 640px) {
  .sh-topics { grid-template-columns: 1fr; }
}

/* ---------- 社区页 ---------- */
.comm-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 8px;
}
.comm-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
a.comm-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.comm-name { font-size: 1rem; font-weight: 700; color: var(--ink); }
.comm-desc { font-size: 0.84rem; line-height: 1.55; color: var(--ink-soft); }
.comm-soon {
  background: color-mix(in srgb, var(--panel) 55%, transparent);
  border-style: dashed;
  opacity: 0.75;
}
.comm-soon .comm-name { color: var(--muted); }
.comm-sub .comm-name { color: var(--accent); }
@media (max-width: 640px) {
  .comm-grid { grid-template-columns: 1fr; }
}
.project-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.project-card:hover {
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
  border-color: var(--accent-soft);
}
.project-card .pc-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}
.project-card .pc-desc {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--ink-soft);
  flex: 1;
}
.project-card .pc-cta {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
}
html.dark .project-card {
  background: #1f2430;
  border-color: var(--line);
}
html.dark .project-card .pc-name {
  color: var(--ink);
}
html.dark .project-card .pc-desc {
  color: var(--ink-soft);
}

/* ---------- 动效偏好:减少动态(玻璃 hover 位移/光晕视差) ---------- */
@media (prefers-reduced-motion: reduce) {
  .post-card:hover, .firefly-cta:hover { transform: none; }
  body:has(.page-head), body:has(.post-body) { background-attachment: scroll; }
}
