/* ==========================================================================
   Paper · 简洁博客主题（QiLog 默认主题）
   设计语言：纯白留白 / 细线分隔 / 单一强调色 / 系统字体栈
   --------------------------------------------------------------------------
   可覆盖变量（由 _head.php 按后台「主题设置」注入到内联 <style>，此处标注的是兜底默认值）：
     --shell-w   整页宽度（960 / 1040 / 1100，后台「整页宽度」，默认 std = 1040）
     --read-w    正文阅读宽度（760 / 820 / 1000，后台「正文阅读宽度」，默认 820）
     --accent    强调色（后台「主题强调色」，深浅两档由 PHP 派生）
     --font-body 正文字体（后台「正文字体」，系统字体栈，无外部请求）
   ========================================================================== */

:root {
  --shell-w: 1040px;
  --bg: #ffffff;
  --ink: #1a2027;
  --ink-2: #3e4650;
  --muted: #6f7885;
  --faint: #9aa3ae;
  --line: #ececf1;
  --line-2: #e0e1e8;
  /* 正文图片描边：页面底为纯白，白底截图若无描边会与背景融成一片、看不出边界 */
  --img-line: #d7dae1;
  --accent: #2e6da3;
  --accent-dark: #225680;
  --accent-soft: #edf4fa;
  --code-bg: #21252d;
  --code-ink: #d8dee8;
  --radius: 10px;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-size: 16px;
  line-height: 1.8;
  font-family: var(--font-body, "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- 链接 ---------- */
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
p a, li a, td a, dd a, .prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(46, 109, 163, .35); }
p a:hover, li a:hover, .prose a:hover { text-decoration-color: currentColor; }

::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid rgba(46,109,163,.55); outline-offset: 2px; border-radius: 4px; }

/* ---------- 布局骨架 ---------- */
.shell { max-width: var(--shell-w); margin: 0 auto; padding: 0 24px; }

/* ---------- 顶部 ---------- */
/* 高度由 --head-h 控制：默认 60px，下拉滚动时 body.head-shrink 收缩到 48px（更紧凑），
   上拉回弹恢复。用 padding-block 过渡而非 height，保证品牌/导航内容在收缩中居中不跳。 */
.site-head {
  --head-h: 60px;
  position: sticky; top: 0; z-index: 20;
  /* 玻璃模糊效果：半透明背景 + 强模糊 + 提高饱和，滚动内容透出形成毛玻璃质感 */
  background: rgba(255,255,255,.62);
  -webkit-backdrop-filter: saturate(1.9) blur(16px);
  backdrop-filter: saturate(1.9) blur(16px);
  /* 底部细线：仅在「下拉（head-shrink）」时出现，与正文明确区隔；页面顶部保持无感 */
  border-bottom: 1px solid transparent;
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 8px 28px -16px rgba(15,23,42,.28);
  transition: box-shadow .22s ease, border-color .22s ease, background .22s ease, backdrop-filter .22s ease;
}
.site-head .inner {
  display: flex; align-items: center; gap: 16px;
  height: var(--head-h);
  transition: height .24s cubic-bezier(.4,0,.2,1);
}
/* 收缩时玻璃更实一点（背景更不透明），并与下方内容拉开层次 */
body.head-shrink .site-head {
  --head-h: 48px;
  background: rgba(255,255,255,.8);
  /* 下拉时出现浅灰细线（border-color 参与过渡，淡入不跳） */
  border-bottom-color: rgba(15,23,42,.10);
  -webkit-backdrop-filter: saturate(2) blur(18px);
  backdrop-filter: saturate(2) blur(18px);
  box-shadow: 0 2px 16px rgba(15,23,42,.10);
}
/* 收缩时品牌与导航同步微缩，避免只缩容器造成「大字压窄条」的割裂感 */
.site-head .brand { transition: font-size .24s cubic-bezier(.4,0,.2,1); }
body.head-shrink .brand { font-size: 17.5px; }
.site-head .nav-item > a { transition: padding .24s cubic-bezier(.4,0,.2,1), background .15s ease, color .15s ease; }
body.head-shrink .nav-item > a { padding: 5px 11px; }
body.head-shrink .search input,
body.head-shrink .search button { height: 30px; }

.brand {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  font-size: 19px; font-weight: 800; letter-spacing: -.2px; color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
/* 导航栏 Logo：仅在主题设置填写「导航栏 Logo」时出现，替代站点名称文字；留空则保持文字品牌。
   高度随页头（60/48px）与收缩态同步微调，透明背景 PNG/SVG 均可。 */
.brand-logo { display: block; height: 30px; width: auto; max-width: 220px; object-fit: contain; }
body.head-shrink .brand-logo { height: 24px; }

.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav-item { position: relative; list-style: none; }
.nav-item > a {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; margin: 0 1px;
  border-radius: 999px; font-size: 14.5px; font-weight: 600; color: var(--ink-2);
}
.nav-item > a:hover { color: var(--accent); background: var(--accent-soft); }
.nav-item.is-current > a { color: var(--accent); font-weight: 600; }
.nav-item.has-sub > a::after { content: ""; width: 0; height: 0; border: 4px solid transparent; border-top-color: currentColor; margin-top: 3px; opacity: .65; }

.nav-sub {
  position: absolute; top: 100%; left: 0; z-index: 30;
  min-width: 170px; margin: 4px 0 0; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(18,24,34,.10);
  opacity: 0; visibility: hidden; transform: translateY(4px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.nav-item.has-sub:hover .nav-sub,
.nav-item.has-sub:focus-within .nav-sub { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-sub li { list-style: none; }
.nav-sub a { display: block; padding: 7px 12px; border-radius: 7px; color: var(--ink-2); font-size: 14px; white-space: nowrap; }
.nav-sub a:hover { background: var(--accent-soft); color: var(--accent); }

/* 顶部搜索 */
.search { display: flex; gap: 6px; margin-left: 6px; }
.search input {
  width: 140px; height: 34px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 999px;
  font: inherit; font-size: 14px; color: var(--ink); background: #fff;
  transition: width .18s ease, border-color .15s ease, height .24s cubic-bezier(.4,0,.2,1);
}
.search input:focus { outline: none; width: 190px; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(46,109,163,.10); }
.search button {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-2); border-radius: 999px; background: #fff; color: var(--ink-2); cursor: pointer;
  transition: height .24s cubic-bezier(.4,0,.2,1), border-color .15s ease, color .15s ease;
}
.search button:hover { border-color: var(--accent); color: var(--accent); }
.search-link { display: none; margin-left: 6px; }
/* 窄屏汉堡按钮（仅 ≤620px 显示）：与搜索圆钮同款式，控制 #siteNav 变下拉面板 */
.nav-toggle {
  display: none; flex: 0 0 34px; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--line-2); border-radius: 999px;
  background: #fff; color: var(--ink-2); cursor: pointer;
}
.nav-toggle:hover { border-color: var(--accent); color: var(--accent); }
.nav-toggle .ico-close { display: none; }
body.nav-open .nav-toggle .ico-open { display: none; }
body.nav-open .nav-toggle .ico-close { display: block; }

/* ---------- 页脚 ---------- */
.site-foot { border-top: 1px solid var(--line); margin-top: 96px; padding: 30px 0 44px; }
.site-foot .inner { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.site-foot .meta { margin-left: auto; display: inline-flex; gap: 16px; flex-wrap: wrap; }
.site-foot a { color: var(--muted); }
.site-foot a:hover { color: var(--accent); }
.site-foot .sep { margin: 0 7px; opacity: .55; }

/* ---------- 首页 Hero ---------- */
.hero { padding: 88px 0 34px; text-align: center; }
.hero .kicker { display: inline-block; margin-bottom: 18px; font-size: 12.5px; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
.hero h1 { margin: 0 auto 16px; max-width: 620px; font-size: 40px; line-height: 1.35; font-weight: 700; letter-spacing: .5px; }
.hero .sub { margin: 0 auto; max-width: 500px; color: var(--muted); font-size: 16px; line-height: 1.9; }

/* 首页列表小标题 */
.stream { padding-top: 44px; }
.hero + .stream { padding-top: 0; }
.stream .stream-head { display: flex; align-items: baseline; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--ink); }
.stream .stream-head h2 { margin: 0; font-size: 13px; letter-spacing: .18em; color: var(--ink); font-weight: 700; }
.stream .stream-head .more { margin-left: auto; font-size: 13px; color: var(--muted); }
.stream .stream-head .more:hover { color: var(--accent); }

/* ---------- 文章条目（首页 / 归档 / 搜索共用） ---------- */
/* 文章列表项：hover 时整块浅底（圆角卡片感，类似参考图）。
   --post-bleed 控制底色左右外扩量：负边距 + 等量内边距 → 底色略宽于文字但内容不位移；
   分隔线改用 ::after 并内缩回容器宽度，避免随底色一起变宽。 */
.post { --post-bleed: 16px; display: flex; gap: 24px; align-items: flex-start; position: relative; margin: 0 calc(-1 * var(--post-bleed)); padding: 28px var(--post-bleed); border-radius: 12px; transition: background-color .18s ease; }
.post::after { content: ""; position: absolute; left: var(--post-bleed); right: var(--post-bleed); bottom: 0; height: 1px; background: var(--line); transition: opacity .18s ease; }
.post:hover { background: #f4f6fa; }
.post:hover::after { opacity: 0; }
.post.has-cover .post-thumb { flex: 0 0 200px; width: 200px; height: 132px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); display: block; background: #f3f4f6; }
.post.has-cover .post-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.post.has-cover .post-thumb:hover img { transform: scale(1.05); }
.post.has-cover .post-body { flex: 1 1 auto; min-width: 0; }
.post .post-title { margin: 0 0 10px; font-size: 23px; line-height: 1.55; font-weight: 700; letter-spacing: .2px; }
.post .post-title a { color: var(--ink); text-decoration: none; }
.post .post-title a:hover { color: var(--accent); }
.post .post-excerpt { margin: 0 0 14px; color: var(--ink-2); font-size: 15.5px; line-height: 1.9; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post .post-excerpt:empty { display: none; }

.post-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: 13px; color: var(--muted); }
.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-2); }
.post-meta time { color: var(--faint); }
.post-meta .views { color: var(--faint); }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 1px 10px 2px; border-radius: 999px;
  font-size: 12.5px; line-height: 1.7;
  background: var(--accent-soft); color: var(--accent-dark);
}
a.pill:hover { background: var(--accent); color: #fff; }
.pill.pin { background: var(--accent); color: #fff; }
a.pill.pin:hover { background: var(--accent-dark); color: #fff; }

/* ---------- 归档 / 搜索页头 ---------- */
.page-head { padding: 56px 0 30px; border-bottom: 1px solid var(--line); }
.page-head .crumb { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.page-head .crumb a { color: var(--muted); }
.page-head .crumb a:hover { color: var(--accent); }
.page-head h1 { margin: 0 0 10px; font-size: 32px; line-height: 1.35; font-weight: 700; }
.page-head .desc { margin: 0; max-width: 560px; color: var(--muted); font-size: 15.5px; }
.page-head .stat { margin: 14px 0 0; font-size: 12.5px; color: var(--faint); letter-spacing: .06em; }

/* ---------- 搜索页专用 ---------- */
.page-head--search { padding: 44px 0 10px; border-bottom: none; }
.page-head--search .search-title { margin: 0 0 8px; font-size: 26px; line-height: 1.35; font-weight: 700; letter-spacing: -.2px; color: var(--ink); }
.page-head--search .search-query { display: flex; flex-direction: column; gap: 6px; }
.page-head--search .search-query .kicker { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.page-head--search .query-term {
  display: inline-block; width: fit-content; max-width: 100%; padding: 8px 16px; margin-top: 2px;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  font-size: 18px; font-weight: 600; letter-spacing: -.1px;
  word-break: break-all;
}
.page-head--search .stat { margin: 14px 0 0; font-size: 14px; color: var(--muted); letter-spacing: 0; }

/* 搜索框：一体化圆角容器 + 内嵌图标，去「蓝药丸」按钮 */
.search-box {
  display: flex; align-items: center; gap: 10px;
  margin: 16px 0 8px; padding: 6px 6px 6px 16px;
  border: 1px solid var(--line-2); border-radius: 14px;
  background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.04);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(46,109,163,.10), 0 4px 14px rgba(15,23,42,.06); }
.search-box .search-ico { flex: none; color: var(--faint); }
.search-box input {
  flex: 1; min-width: 0; height: 46px; padding: 0;
  border: none; background: transparent;
  font: inherit; font-size: 16px; color: var(--ink);
}
.search-box input::placeholder { color: var(--faint); }
.search-box input:focus { outline: none; box-shadow: none; }
.search-box button {
  flex: none; width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 10px; cursor: pointer;
  background: var(--accent); color: #fff;
  transition: background .15s ease;
}
.search-box button:hover { background: var(--accent-dark); }
.search-box button svg { pointer-events: none; }

/* 搜索页空状态：去 emoji，改用精致线框图标 */
.search-empty { padding: 66px 0; text-align: center; color: var(--muted); }

/* ---------- 标签页 / 归档页（单页模板 page-tags / page-archive） ---------- */
.tags-index {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  margin: 8px 0 64px;
}
.tag-card {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  transition: border-color .16s ease, background-color .16s ease, transform .16s ease;
}
.tag-card:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); text-decoration: none; }
.tag-card .tag-name { font-size: 15.5px; font-weight: 600; color: var(--ink); }
.tag-card:hover .tag-name { color: var(--accent); }
.tag-card .tag-count {
  flex: none; padding: 1px 11px 2px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.tag-card:hover .tag-count { background: #fff; color: var(--accent); }

.archive-index { margin: 8px 0 64px; }
.arc-year { margin-bottom: 40px; }
.arc-year-head {
  display: flex; align-items: baseline; gap: 12px;
  padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 8px;
}
.arc-year-head .year { font-size: 24px; font-weight: 700; color: var(--ink); letter-spacing: .3px; }
.arc-year-head .year-count { font-size: 13px; color: var(--muted); }

.arc-month { margin: 4px 0 22px; }
.arc-month-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 2px; }
.arc-month-head .month { font-size: 16px; font-weight: 600; color: var(--ink-2); }
.arc-month-head .month-count { font-size: 12.5px; color: var(--faint); }

.arc-list { list-style: none; margin: 0; padding: 0; }
.arc-item {
  display: flex; align-items: baseline; gap: 18px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.arc-item time {
  flex: none; width: 48px; font-size: 13px; color: var(--faint);
  font-variant-numeric: tabular-nums; letter-spacing: .02em;
}
.arc-item a {
  color: var(--ink); text-decoration: none; font-size: 16px; line-height: 1.6;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.arc-item a:hover { color: var(--accent); }
.arc-item .arc-cat {
  margin-left: auto; flex: none; padding: 1px 10px 2px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--ink-2); font-size: 12.5px;
}
.arc-item .arc-cat:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* 头图开启时：保留描述/统计，用独立块替代 page-head */
.index-lead { padding-top: 44px; }
.index-lead .desc { margin: 0 0 10px; max-width: 560px; color: var(--muted); font-size: 15.5px; }
.index-lead .stat { margin: 0; font-size: 12.5px; color: var(--faint); letter-spacing: .06em; }

@media (max-width: 620px) {
  .index-lead { padding-top: 32px; }
  .tags-index { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tag-card { padding: 14px; }
  .tag-card .tag-name { font-size: 14.5px; }
  .arc-item { gap: 12px; }
  .arc-item time { width: 42px; }
  .arc-item a { font-size: 15px; }
  .arc-item .arc-cat { display: none; }
}
.search-empty .ico { width: 56px; height: 56px; margin: 0 auto 18px; color: var(--line-2); }
.search-empty p { margin: 0 0 8px; font-size: 16px; color: var(--ink-2); }
.search-empty .hint { display: block; font-size: 13.5px; color: var(--faint); }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 40px 0 10px; flex-wrap: wrap; }
.pager a, .pager span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 8px;
  font-size: 14px; color: var(--ink-2); background: #fff;
}
.pager a:hover { border-color: var(--accent); color: var(--accent); }
.pager .cur { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.pager .gap { border: none; min-width: 20px; padding: 0; color: var(--faint); }

/* ---------- 内容页：文章头 ---------- */
.article-head { padding: 48px 0 30px; border-bottom: 1px solid var(--line); margin-bottom: 42px; }
.article-head .article-cat { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
.article-head h1 { margin: 0 0 18px; font-size: 34px; line-height: 1.42; font-weight: 700; letter-spacing: .3px; }
/* 摘要（导读）：浅色底块 + 左侧强调线 + 右侧圆角，与正文白底段落明确区分 */
.article-head .lead { margin: 0 0 24px; padding: 13px 18px; border-left: 3px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; background: var(--accent-soft); color: var(--ink-2); font-size: 14px; line-height: 1.85; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13.5px; color: var(--muted); }
.article-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-2); }
.article-meta .views { color: var(--faint); }

/* ---------- 正文排版 ---------- */
.prose { font-size: 16.5px; line-height: 2; color: var(--ink-2); }
.prose > *:first-child { margin-top: 0; }
.prose > *:last-child { margin-bottom: 0; }
.prose p { margin: 0 0 1.35em; }
/* 正文标题层级（h1 定义见下方「正文内 h1」）。以正文 16.5px 为基准逐级拉开：
   28 / 24 / 21 / 18.5 / 17 / 16.5，每一级都必须明显重于正文（字号 + 字重 + 颜色三管齐下）。
   修正前的三个问题：① h4 与正文同为 16.5px，等于没区别；
   ② h5/h6 没有任何规则 → 走浏览器默认（≈13.7px / ≈11px），比正文还小，层级是反的；
   ③ h2 有强调色短横线而 h1 没有，视觉上 h2 反倒比 h1 重。 */
.prose h2 { margin: 2.2em 0 .8em; font-size: 24px; line-height: 1.5; color: var(--ink); font-weight: 700; letter-spacing: .2px; }
.prose h2::before { content: ""; display: block; width: 26px; height: 3px; border-radius: 2px; background: var(--accent); margin-bottom: 18px; }
.prose h3 { margin: 2em 0 .7em; font-size: 21px; line-height: 1.55; color: var(--ink); font-weight: 700; }
.prose h4 { margin: 1.8em 0 .55em; font-size: 18.5px; line-height: 1.6; color: var(--ink); font-weight: 700; }
/* h5/h6 已贴近正文字号，单靠字号拉不开 —— 主要靠「字重 700 + 更深的字色」与正文(400 / ink-2)区分 */
.prose h5 { margin: 1.6em 0 .5em; font-size: 17px; line-height: 1.65; color: var(--ink); font-weight: 700; }
.prose h6 { margin: 1.5em 0 .45em; font-size: 16.5px; line-height: 1.7; color: var(--ink); font-weight: 700; letter-spacing: .04em; }

.prose ul, .prose ol { margin: 0 0 1.4em; padding-left: 1.5em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--accent); }
.prose ul li::marker { content: "▪"; font-size: .85em; }

/* 任务列表：Markdown 的 - [ ] / - [x] 生成 .task-list > .task-item > label > input */
.prose ul.task-list { list-style: none; padding-left: .25em; margin: 0 0 1.4em; }
.prose ul.task-list > li.task-item { margin: .45em 0; padding: 0; }
.prose ul.task-list > li.task-item::marker { content: none; }
.prose ul.task-list > li.task-item > label {
  display: flex; align-items: flex-start; gap: 10px; cursor: default;
}
.prose ul.task-list input[type="checkbox"] {
  flex: none; width: 16px; height: 16px; margin: .42em 0 0;
  accent-color: var(--accent); cursor: default;
}
.prose ul.task-list input[type="checkbox"]:checked + .task-text {
  color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(0, 0, 0, .28);
}
.prose ul.task-list .task-text { min-width: 0; }

.prose blockquote { margin: 1.8em 0; padding: 2px 0 2px 22px; border-left: 3px solid var(--accent); color: var(--ink-2); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose blockquote .by { display: block; margin-top: .6em; font-size: 13px; color: var(--muted); }

.prose img { max-width: 100%; height: auto; border-radius: 12px; margin: 1.6em 0; display: block; border: 1px solid var(--img-line); }
.prose figure { margin: 2em 0; }
.prose figure img { margin: 0; width: 100%; }
.prose figcaption { margin-top: 10px; text-align: center; font-size: 13px; color: var(--muted); }

.prose hr { border: none; border-top: 1px solid var(--line); margin: 2.4em 0; }

.prose code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: .88em; background: var(--accent-soft); color: #1d5a8a;
  padding: .15em .42em; border-radius: 5px;
}
.prose pre {
  margin: 1.8em 0; padding: 18px 20px;
  background: var(--code-bg); color: var(--code-ink);
  border-radius: 12px; overflow-x: auto;
  font-size: 13.5px; line-height: 1.75;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}
.prose pre code { background: none; color: inherit; padding: 0; font-size: 1em; }

.prose table { width: 100%; margin: 1.8em 0; border-collapse: collapse; font-size: 14.5px; }
.prose th, .prose td { padding: 9px 14px; border: 1px solid var(--line); text-align: left; }
.prose th { background: #fafafc; color: var(--ink); font-weight: 600; }
.prose td { color: var(--ink-2); }

/* ---------- 标签 & 上下篇 ---------- */
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 44px 0 0; padding-top: 26px; border-top: 1px solid var(--line); }
.post-tags a { display: inline-flex; padding: 4px 13px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-2); font-size: 13px; }
.post-tags a:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: var(--read-w, 880px); margin: 26px auto 0; }
.post-nav a {
  display: block; padding: 18px 20px;
  border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none;
  transition: border-color .15s ease, transform .15s ease;
}
.post-nav a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.post-nav a .dir { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.post-nav a .t { font-size: 15px; font-weight: 600; line-height: 1.6; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.post-nav .next { text-align: right; }
.post-nav .placeholder { display: block; padding: 18px 20px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--faint); font-size: 14px; }

/* ---------- 评论：头像左 + 内容右的两栏紧凑式 ---------- */
.comments { max-width: var(--read-w, 880px); margin: 64px auto 0; }
.comments h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font-size: 18px; font-weight: 700; color: var(--ink); }
.comments h2 .count { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; }

/* 头像（评论项 / 发表框共用） */
.comment-form .avatar,
.comment-item .avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); font-size: 15px; font-weight: 600;
}
.comment-item .avatar { border: 1px solid var(--line); }
.comment-item .avatar.is-admin { background: var(--accent); color: #fff; border-color: transparent; }
.avatar img.ava-img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }

/* 发表框 */
.comment-form { margin-bottom: 26px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.comment-form .cf-top { display: grid; grid-template-columns: 40px 1fr; gap: 12px; }
.comment-form input,
.comment-form textarea {
  width: 100%; height: 36px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 8px;
  font: inherit; font-size: 14px; color: var(--ink); background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.comment-form textarea { height: auto; min-height: 76px; padding: 9px 12px; font-size: 14.5px; line-height: 1.7; resize: vertical; }
.comment-form input::placeholder,
.comment-form textarea::placeholder { color: var(--faint); }
.comment-form input:focus,
.comment-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(46,109,163,.14); }
.comment-form .cf-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.comment-form .cf-fields { display: flex; gap: 8px; flex-wrap: wrap; flex: 1 1 auto; min-width: 0; }
.comment-form .cf-fields input { flex: 1 1 132px; min-width: 0; }
.comment-form button {
  margin-left: auto; height: 36px; padding: 0 20px; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--accent); color: #fff; font: inherit; font-size: 14px; font-weight: 500;
  transition: background .15s ease;
}
.comment-form button:hover { background: var(--accent-dark); }
.comment-form button:disabled { opacity: .6; cursor: default; }
.comment-form .cf-note { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.comment-form .identity { font-size: 13px; color: var(--muted); }
.comment-form .identity b { color: var(--ink); font-weight: 600; }
/* 蜜罐字段：视觉隐藏但保留可提交 */
.comment-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* 回复提示条（点击「回复」后出现，置于输入框上方） */
.reply-hint {
  display: none; align-items: center; gap: 10px;
  margin-bottom: 8px; padding: 6px 12px;
  border-radius: 8px; background: var(--accent-soft); color: var(--accent-dark); font-size: 13px;
}
.reply-hint.is-on { display: flex; }
.reply-hint b { font-weight: 600; }
.reply-hint a { margin-left: auto; color: var(--accent); }

/* 评论列表 */
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-item { padding: 15px 0; border-bottom: 1px solid var(--line); }
.comment-list > .comment-item:first-child { padding-top: 0; }
.comment-list > .comment-item:last-child { border-bottom: 0; padding-bottom: 0; }
.cmt-row { display: grid; grid-template-columns: 40px 1fr; gap: 12px; }
.cmt-main { min-width: 0; }
.cmt-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 24px; }
.cmt-name { font-size: 14px; font-weight: 500; color: var(--ink); text-decoration: none; }
a.cmt-name:hover { color: var(--accent); }
.admin-tag { height: 18px; line-height: 18px; padding: 0 7px; border-radius: 5px; font-size: 11px; background: var(--accent-soft); color: var(--accent); }
.cmt-time { font-size: 12px; color: var(--faint); }
.comment-item .reply { margin-left: auto; font-size: 12.5px; color: var(--muted); text-decoration: none; opacity: 0; transition: opacity .15s ease, color .15s ease; }
.cmt-row:hover .reply { opacity: 1; }
.comment-item .reply:hover { color: var(--accent); }
/* 触屏设备没有 hover：不能靠悬停显形，否则「回复」在手机上完全看不见（永远 opacity:0）。 */
@media (hover: none) {
  .comment-item .reply { opacity: 1; }
}
.cmt-text { margin: 2px 0 0; font-size: 15px; line-height: 1.75; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }

/* 嵌套回复：缩进 + 左侧细引导线 */
.children { list-style: none; margin: 10px 0 0 52px; padding: 0; position: relative; }
.children::before { content: ""; position: absolute; left: -18px; top: 2px; bottom: 2px; width: 2px; border-radius: 2px; background: var(--line); }
.children > .comment-item { padding: 12px 0 0; border-bottom: 0; }
.children .cmt-row { grid-template-columns: 32px 1fr; gap: 10px; }
.children .avatar { width: 32px; height: 32px; font-size: 13px; }
.children .cmt-name { font-size: 13.5px; }
.children .cmt-text { font-size: 14.5px; }
/* 深层回复折叠提示 / 空状态 */
.comment-item.is-more { border: 0; padding: 10px 0 0; }
.comments .empty { padding: 22px 0; color: var(--muted); font-size: 14px; }

/* ---------- 友链 ---------- */
.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 34px; }
.link-card { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); transition: border-color .15s ease, transform .15s ease; }
.link-card:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.link-card .logo { width: 40px; height: 40px; flex: none; border-radius: 10px; object-fit: contain; background: #fafafc; border: 1px solid var(--line); padding: 4px; }
.link-card .initial { width: 40px; height: 40px; flex: none; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; font-size: 16px; }
.link-card .name { display: block; font-size: 15px; font-weight: 600; }
.link-card .url { display: block; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--muted); }

/* ---------- 空态 / 404 ---------- */
.empty { padding: 60px 0; text-align: center; color: var(--muted); }
.empty .big { display: block; font-size: 34px; color: var(--faint); margin-bottom: 10px; }
.notfound { padding: 90px 0; text-align: center; }
.notfound .code { font-size: 72px; line-height: 1; font-weight: 800; color: var(--accent); letter-spacing: 2px; }
.notfound p { color: var(--muted); margin: 18px 0 26px; }
.notfound a { display: inline-flex; align-items: center; height: 40px; padding: 0 22px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 14.5px; font-weight: 600; }
.notfound a:hover { background: var(--accent-dark); color: #fff; }

/* ---------- 无障碍辅助 ---------- */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- 响应式 ---------- */
@media (max-width: 620px) {
  body { font-size: 15px; }
  .shell { padding: 0 18px; }
  .site-head { --head-h: 54px; }
  body.head-shrink .site-head { --head-h: 46px; }
  .site-head .inner { gap: 8px; }
  .brand { font-size: 17px; }
  .brand-logo { height: 26px; max-width: 150px; }
  /* 窄屏（≤620px）导航：不再横滑，改由汉堡按钮开合的下拉面板承载全部菜单项。
     关键：用的是同一个 .nav 元素（不复制 DOM），只是从「横排 flex」变成「贴在页头下方的面板」。
     父级 .site-head 是 position:sticky ⇒ 面板用 absolute 定位，left/right:0 即整条页头宽度；
     top 取 --head-h（收缩态自动变 46px），刚好贴住页头下沿。 */
  .nav {
    position: absolute; top: var(--head-h); left: 0; right: 0; z-index: 40;
    display: block; margin: 0; padding: 8px 12px 14px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    box-shadow: 0 20px 34px -20px rgba(15,23,42,.34);
    max-height: calc(100vh - var(--head-h)); overflow-y: auto;
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
  }
  body.nav-open .nav { transform: translateY(0); opacity: 1; visibility: visible; }
  .nav-item { display: block; }
  .nav-item > a { display: block; padding: 12px 14px; border-radius: 10px; font-size: 15px; white-space: normal; }
  .nav-item > a:hover { background: var(--accent-soft); }
  .nav-item.is-current > a { background: var(--accent-soft); }
  /* ⛔ 收缩态的两条桌面规则在这里必须拉回窄屏基准值，否则滚动后打开面板：
     `body.head-shrink .nav-item > a`(0,2,1) 会盖掉上面的 `.nav-item > a`(0,1,1) → 条目被压扁（51→37px）；
     `body.head-shrink .brand` 还会把品牌字号从 17px 反弹成 17.5px。同特异性 + 位置更靠后 ⇒ 生效。 */
  body.head-shrink .nav-item > a { padding: 12px 14px; font-size: 15px; }
  body.head-shrink .brand { font-size: 17px; }
  .nav-toggle { display: inline-flex; }
  .search { display: none; }
  /* flex:0 0 34px —— 不参与 flex 收缩。缺了它，窄屏下 34px 会被压成 18~24px 的椭圆。 */
  /* margin-left:auto —— 面板定位后 .nav 脱离文档流，原先由它承担的「把右侧内容推到底」失效，
     改由搜索钮承担（苹果/安卓常见：品牌在左、操作钮贴右）。 */
  .search-link { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 34px; margin-left: auto; width: 34px; height: 34px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--ink-2); }
  .search-link:hover { border-color: var(--accent); color: var(--accent); }

  .hero { padding: 54px 0 22px; }
  .hero h1 { font-size: 28px; }
  .hero .sub { font-size: 15px; }
  .post { --post-bleed: 14px; padding: 26px var(--post-bleed); gap: 16px; }
  /* 窄屏列表项：图文改「上图下文」。原来左图 116px 占掉宽度，右列文字只剩约 220px、
     标题被挤成两三行；改成缩略图满宽置顶后，标题/摘要拿到完整宽度。 */
  .post.has-cover { flex-direction: column; gap: 12px; }
  .post.has-cover .post-thumb { flex: none; width: 100%; height: auto; border-radius: 10px; }
  .post.has-cover .post-thumb img { width: 100%; height: auto; aspect-ratio: 16 / 9; max-height: 200px; object-fit: cover; }
  .post .post-title { font-size: 19.5px; }
  .post .post-excerpt { font-size: 15px; }
  .page-head { padding: 36px 0 24px; }
  .page-head h1 { font-size: 25px; }
  .page-head--search { padding: 32px 0 8px; }
  .page-head--search .search-title { font-size: 22px; }
  .page-head--search .query-term { font-size: 16px; padding: 6px 13px; }
  .search-box { margin-top: 14px; padding-left: 12px; }
  .search-box input { height: 42px; font-size: 15px; }
  .search-box button { width: 38px; height: 38px; }
  .article-head { padding: 34px 0 24px; }
  .article-head h1 { font-size: 25px; }
  .article-head .lead { padding: 11px 14px; font-size: 13.5px; line-height: 1.8; border-radius: 0 8px 8px 0; }
  .prose { font-size: 16px; line-height: 1.95; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { text-align: left; }
  .comment-form .cf-fields input { flex: 1 1 100%; }
  .comment-form .cf-bar button { width: 100%; margin-left: 0; }
  .children { margin-left: 36px; }
  .site-foot { margin-top: 60px; }
  .site-foot .meta { margin-left: 0; width: 100%; }
}

/* ============================================================
   文章 / 单页：正文定宽 880px（--read-w，由后台「正文阅读宽度」配置注入）
   ------------------------------------------------------------
   正文不再是「占满整页宽度」，而是固定 880px 居中，右侧留白留给浮动 TOC；
   .post-body 为定位上下文，TOC 以它为基准 absolute 定位到右侧 gutter。
   ============================================================ */
.post-main { min-width: 0; max-width: var(--read-w, 880px); margin: 0 auto; }
/* 无目录时正文同样居中，视觉重心保持一致 */
.post-body:not(.has-toc) .post-main { max-width: var(--read-w, 880px); margin: 0 auto; }
/* 目录吸顶与标题锚点偏移：跟随导航高度（60px / 收缩 48px）+ 24px 呼吸 */
.post-body .prose h1, .post-body .prose h2, .post-body .prose h3,
.post-body .prose h4, .post-body .prose h5 { scroll-margin-top: 84px; }
body.head-shrink .post-body .prose h1,
body.head-shrink .post-body .prose h2,
body.head-shrink .post-body .prose h3,
body.head-shrink .post-body .prose h4,
body.head-shrink .post-body .prose h5 { scroll-margin-top: 72px; }

/* 正文内 h1：主题标题已画在头图上，正文 h1 降到「正文层级最高的标题」呈现（仍明显大于 h2），
   避免与页头那个 40px 大标题争视觉权重。 */
.prose h1 { margin: 2.4em 0 .9em; font-size: 28px; line-height: 1.4; color: var(--ink); font-weight: 700; letter-spacing: .2px; }

/* 头图模式下正文顶部不再留 article-head 的下边距 */
.prose.prose-hero { margin-top: 0; }
.article-lead {
  margin: 0 0 34px; padding: 14px 18px;
  border-left: 3px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--accent-soft); color: var(--ink-2);
  font-size: 14.5px; line-height: 1.9;
}
/* 单页变体（page-links 等）：宽版沉浸，仅调字号/间距，不改正文宽度 */
body.tpl-wide .article-head { padding: 56px 0 34px; }
body.tpl-wide .article-head h1 { font-size: 40px; line-height: 1.35; letter-spacing: .2px; }
body.tpl-wide .article-head .lead { padding: 15px 20px; font-size: 15px; line-height: 1.9; }
body.tpl-wide .prose { font-size: 17.5px; line-height: 2.05; }
body.tpl-wide .post-tags { margin-top: 30px; }
body.tpl-wide .page-head { padding: 60px 0 34px; }
body.tpl-wide .page-head h1 { font-size: 40px; }
/* 宽版单页刻意放宽正文（链接聚合等场景信息密度优先） */
body.tpl-wide .post-main, body.tpl-wide .post-body:not(.has-toc) .post-main { max-width: var(--shell-w); }


/* ---- Widget band (HALO-light declarative widgets, rendered above site footer) ---- */
.widget-band{margin:34px 0 0;display:grid;gap:18px}
@media (min-width:900px){.widget-band{grid-template-columns:repeat(2,1fr)}}
.widget{background:#fff;border:1px solid var(--color-border,#eef0f3);border-radius:14px;padding:18px 20px}
.widget-title{font-size:15px;font-weight:600;margin:0 0 12px;color:#1a1a1a;display:flex;align-items:center;gap:8px}
.widget ul{list-style:none;margin:0;padding:0}
.widget li{padding:7px 0;border-bottom:1px solid var(--color-border,#f0f2f5)}
.widget li:last-child{border-bottom:none}
.widget a{color:var(--color-text,#1a1f29);text-decoration:none}
.widget a:hover{color:var(--accent,#2E6DA3)}
.wi-meta{font-size:12px;color:var(--color-muted,#8b93a1);margin-left:6px}
.wi-links .wi-logo{display:inline-block;width:18px;height:18px;border-radius:4px;object-fit:cover;vertical-align:-3px;margin-right:6px}
.wi-excerpt{font-size:13px;color:var(--color-muted,#8b93a1);margin-top:2px;line-height:1.5}
.wi-author{font-weight:400}
.tag-cloud{display:flex;flex-wrap:wrap;gap:8px}
.tag-cloud a{display:inline-flex;align-items:center;gap:5px;padding:3px 10px;border:1px solid var(--color-border,#eef0f3);border-radius:20px;font-size:13px;text-decoration:none;color:var(--color-text,#1a1f29)}
.tag-cloud a:hover{border-color:var(--accent,#2E6DA3);color:var(--accent,#2E6DA3)}
.wi-search-form{display:flex;gap:8px}
.wi-search-form .input{flex:1}

/* ==========================================================================
   HALO-style additions (v2.0.0)
   - Full-width site cover banner (gradient / image)
   - Two-column layout for list pages (content + sidebar widget area)
   - Per-area widget band variants (sidebar single col / footer auto-fit)
   - Post cover image (first content image as full-width cover)
   ========================================================================== */

/* ---------- Site cover (full-width banner below sticky nav) ---------- */
.site-cover{position:relative;height:var(--cover-h,320px);display:flex;align-items:center;justify-content:center;overflow:hidden}
.site-cover-shade{position:absolute;inset:0;background:rgba(10,16,24,.34)}
.site-cover-inner{position:relative;z-index:1;text-align:left;width:100%;max-width:var(--shell-w);margin:0 auto;padding:0 24px}
.site-cover-title{margin:0;color:#fff;font-size:36px;line-height:1.3;font-weight:800;letter-spacing:.5px;text-shadow:0 1px 14px rgba(0,0,0,.28)}
.site-cover-sub{margin:0;max-width:640px;color:rgba(255,255,255,.94);font-size:16.5px;line-height:1.85;text-shadow:0 1px 12px rgba(0,0,0,.24)}
.site-cover-title + .site-cover-sub{margin-top:14px}

/* ---------- 详情页头图（post hero）：图上直接显示面包屑 / 标题 / 阅读信息 ----------
   与 .site-cover 区别：内容左对齐（贴正文 880px 阅读宽度的左缘）、靠底部排布，
   蒙版为「上浅下深」的线性渐变，保证浅色背景下文字依然可读。 */
.post-hero{
  position:relative;height:var(--hero-h,360px);overflow:hidden;
  display:flex;align-items:flex-end;
  margin-bottom:36px;
}
.post-hero-shade{
  position:absolute;inset:0;
  background:linear-gradient(180deg,rgba(8,13,20,.16) 0%,rgba(8,13,20,.44) 52%,rgba(8,13,20,.72) 100%);
}
.post-hero-inner{
  position:relative;z-index:1;width:100%;
  max-width:var(--read-w,880px);margin:0 auto;padding:0 24px;
  padding-bottom:44px;
}
.post-hero-crumb{
  display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:0 0 18px;
  font-size:13.5px;color:rgba(255,255,255,.76);letter-spacing:.2px;
}
.post-hero-crumb a{color:rgba(255,255,255,.8);text-decoration:none;transition:color .15s ease}
.post-hero-crumb a:hover{color:#fff}
.post-hero-crumb .sep{opacity:.55}
.post-hero-crumb .cur{color:rgba(255,255,255,.94)}
.post-hero-title{
  margin:0;color:#fff;font-weight:700;letter-spacing:.3px;
  font-size:36px;line-height:1.38;
  max-width:22em;
  text-shadow:0 2px 18px rgba(0,0,0,.32);
}
.post-hero-meta{
  display:flex;align-items:center;flex-wrap:wrap;gap:8px 16px;margin:20px 0 0;
  font-size:14px;color:rgba(255,255,255,.9);
  text-shadow:0 1px 10px rgba(0,0,0,.26);
}
.post-hero-meta > * + *::before{
  content:"";display:inline-block;width:3px;height:3px;border-radius:50%;
  background:currentColor;opacity:.6;vertical-align:middle;margin-right:16px;
}
/* 单页头图 meta：用页面描述替代日期/阅读数 */
.post-hero-meta .desc { max-width: 640px; line-height: 1.7; }
/* 归档页头图描述（分类 / 标签 / 月份）：面包屑 + 标题下方的说明文字 */
.post-hero-desc{
  margin:16px 0 0;max-width:640px;
  font-size:15.5px;line-height:1.9;color:rgba(255,255,255,.88);
  text-shadow:0 1px 10px rgba(0,0,0,.26);
}
/* 归档页头图「随首页」：内容垂直居中（非靠底）、内宽贴整页容器、蒙版用首页同款平铺暗色 */
.post-hero--center{align-items:center}
.post-hero--center .post-hero-inner{max-width:var(--shell-w);padding-bottom:0}
.post-hero--center .post-hero-shade{background:rgba(10,16,24,.34)}
@media (max-width:620px){
  .post-hero{height:calc(var(--hero-h,360px) * .74)}
  .post-hero-inner{padding:0 18px;padding-bottom:28px}
  .post-hero-crumb{font-size:12.5px;margin-bottom:14px}
  .post-hero-title{font-size:24px;line-height:1.4}
  .post-hero-meta{font-size:13px;margin-top:14px;gap:6px 12px}
  .post-hero-meta > * + *::before{margin-right:12px}
  .post-hero-desc{font-size:14px;margin-top:12px}
}

/* ---------- Two-column layout (list pages) ---------- */
/* 由页面模板输出 .layout（仅当该页开启且侧边栏有组件）；所有页面 .shell 统一为 --shell-w（后台「整页宽度」） */
.layout{display:grid;grid-template-columns:minmax(0,1fr) var(--sidebar-w,300px);gap:48px;align-items:start}
.layout--left{grid-template-columns:var(--sidebar-w,300px) minmax(0,1fr)}
.layout--left .col-side{order:-1}
.col-main{min-width:0}
.col-side{position:sticky;top:84px;min-width:0;margin-top:44px}
/* 归档列表页没有 page-head：主列首个内容顶 = .col-main 顶 + .post 自带的 padding-top(28px)。
   侧栏默认 margin-top:44px 会比主列内容低 16px。这里只把「右侧栏」的顶部留白由 44px 收到 28px，
   让侧栏卡片顶边与首篇文章内容顶边齐平——左侧文章区块保持原样（不动 .post / .col-main）。 */
@media (min-width:1001px){
  body.is-archive.has-sidebar .col-side{margin-top:28px}
}

/* ---------- Widget band per area ---------- */
.widget-band{margin:0 0 8px}
.widget-band-footer{grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:18px;margin-top:40px}
.widget-band-sidebar{grid-template-columns:1fr;gap:20px}
.widget-band-sidebar .widget{margin-bottom:0}
/* 右侧侧栏小组件统一 14px 字号（覆盖片段里混用的 12/13/15px） */
.widget-band-sidebar .widget{font-size:14px}
.widget-band-sidebar .widget-title{font-size:14px}
.widget-band-sidebar .wi-meta,
.widget-band-sidebar .wi-excerpt,
.widget-band-sidebar .tag-cloud a{font-size:14px}

/* Paper 观感统一（覆盖 widget 片段里的通用回退变量） */
.widget{background:var(--bg);border:1px solid var(--line);border-radius:var(--radius);padding:18px 20px}
.widget-title{color:#1a1a1a;font-size:15px;font-weight:700;letter-spacing:.02em}
/* 小组件标题左侧强调色竖条：3px 宽 / 1.2em 高（随标题字号自适应）/ 2px 圆角。
   .widget-title 本身已是 flex + gap:8px，伪元素作为首个 flex item 自动与文字留出 8px 间距。 */
.widget-title::before{content:"";flex:none;width:3px;height:1.2em;border-radius:2px;background:var(--accent)}
.widget li{border-bottom:1px solid var(--line)}
.widget li:last-child{border-bottom:none}
.widget a{color:var(--ink-2)}
.widget a:hover{color:var(--accent)}
.widget ul{list-style:none;margin:0;padding:0}
/* 列表型组件（分类目录 / 文章归档 / 最新文章）：名称靠左，数量（日期）靠右对齐。
   markup 是 li 下 `<a>名称</a><span class="wi-meta">数量</span>` 两个兄弟节点，
   故在 li 上两端对齐（.wi-comments 内含摘要 div，不参与，保持原样）。 */
.widget.wi-cats li,
.widget.wi-archives li,
.widget.wi-posts li{display:flex;align-items:baseline;justify-content:space-between;gap:12px}
.widget.wi-cats li>a,
.widget.wi-archives li>a,
.widget.wi-posts li>a{min-width:0}
.widget.wi-cats .wi-meta,
.widget.wi-archives .wi-meta,
.widget.wi-posts .wi-meta{flex:none;margin-left:0}

/* ---------- Post cover (first content image, full column width) ---------- */
.post-cover{margin:34px 0 0;border-radius:var(--radius);overflow:hidden;background:var(--line-2)}
.post-cover img{display:block;width:100%;height:auto;margin:0;border-radius:0}

/* ---------- Responsive: collapse two-column to single column ---------- */
@media (max-width:1000px){
  .layout{grid-template-columns:1fr;gap:0}
  .layout--left .col-side{order:0}
  .col-side{position:static;margin-top:44px}
  .widget-band-footer{margin-top:32px}
}
@media (max-width:620px){
  /* 手机端隐藏侧栏：5 个组件会全堆在正文之后（实测多出约 1400px 滚动），手机端收益为负。
     平板（621~1000px）仍是单列堆叠，不受影响。 */
  body.has-sidebar .col-side{display:none}
}
@media (max-width:620px){
  .site-cover{height:calc(var(--cover-h,320px) * .72)}
  .site-cover-inner{padding:0 18px}
  .site-cover-title{font-size:26px}
  .site-cover-sub{font-size:14.5px}
  .widget-band-footer{grid-template-columns:1fr;margin-top:28px}
}

/* 返回顶部：右下角悬浮圆形按钮（滚动一段距离后出现） */
.back-top{
  position:fixed;right:26px;bottom:30px;z-index:900;
  width:42px;height:42px;display:grid;place-items:center;
  border:1px solid var(--line);border-radius:50%;
  background:var(--paper);color:var(--ink-2);cursor:pointer;
  box-shadow:0 4px 14px rgba(15,23,42,.10);
  transition:background .18s ease,color .18s ease,transform .18s ease,border-color .18s ease;
}
.back-top:hover{background:var(--accent);border-color:var(--accent);color:#fff;transform:translateY(-2px)}
.back-top[hidden]{display:none}
@media (max-width:620px){
  .back-top{right:16px;bottom:18px;width:38px;height:38px}
}

/* ---------- 文章目录 TOC：正文含多级标题（h1~h4）时自动显示，悬浮右侧留白 + 吸顶 ---------- */
/* 布局原则（2026-10-09 重做）：**正文布局完全不变**——仍按原规则在 .shell 内居中，
   宽度/位置与无目录时逐像素一致。目录是"旁注"，绝对定位浮在正文右侧的留白里，
   不参与任何文档流、不挤压正文、不改变 .post-body 的宽度。
   ── 几何：.post-body 是定位基准（relative，宽度＝shell 内宽，与原来相同）；
      正文 .post-main 居中，右缘 = 50% + readW/2；目录左缘 = 该右缘 + 间距 40。
      目录带宽 224 → 需要 .post-body 右半侧至少 (readW/2 + 40 + 224) 的空间，
      而 .post-body 右半侧实际宽恰为 50%（shell 内宽的一半）。
      右侧不足时目录会溢出 .post-body —— 这正是 JS 阈值要拦住的场景，见下。 */
.post-body.has-toc{position:relative}
/* 目录：左缘锚定到「正文右缘 + 40px」，绝对浮于留白，不占流 */
.toc-side{
  position:absolute;top:0;width:224px;height:100%;
  left:calc(50% + var(--read-w,820px) / 2 + 40px);
}
.toc-card{
  position:sticky;top:84px;margin-top:24px;
  background:var(--bg);border:1px solid var(--line);border-radius:var(--radius);
  padding:16px 18px;max-height:calc(100vh - 108px);overflow:auto;scrollbar-width:thin;
  transition:top .24s cubic-bezier(.4,0,.2,1);
}
body.head-shrink .toc-card{top:72px;max-height:calc(100vh - 96px)}
.toc-title{font-size:12.5px;font-weight:700;color:var(--faint);letter-spacing:.08em;margin:0 0 8px}
.toc-list{list-style:none;margin:0;padding:0;font-size:13.5px;line-height:1.55}
.toc-list li{margin:0}
.toc-list a{
  display:block;padding:4px 0;color:var(--ink-2);text-decoration:none;
  border-left:2px solid transparent;padding-left:10px;margin-left:-12px;
  transition:color .15s ease,border-color .15s ease;
}
.toc-list a:hover{color:var(--accent)}
.toc-list a.is-active{color:var(--accent);border-left-color:var(--accent);font-weight:600}
/* 层级缩进：h1~h5 逐级递进，每档 +10px；越深字号越小，给 224px 窄栏留出可读宽度。
   ⛔ 档数必须与 _post_main.php 的正则级别（h1~h5）一致，否则会出现无样式的裸条目。
   注：基础 .toc-list a 的 padding-left 已是 10px（配 margin-left:-12px 让左侧竖条贴卡片边），
   故 lv1 = 10px，往下依次 20 / 30 / 40 / 50。（修正前 lv1 与 lv2 同为 10px，看不出层级。） */
.toc-list li.lv1 a{font-weight:600}
.toc-list li.lv2 a{padding-left:20px}
.toc-list li.lv3 a{padding-left:30px;font-size:13px}
.toc-list li.lv4 a{padding-left:40px;font-size:12.5px}
.toc-list li.lv5 a{padding-left:50px;font-size:12px}

/* ---- 抽屉态：视口不足以容纳「正文 + 右侧悬浮目录」时（body.toc-drawer） ----
   ⛔ 本块所有规则必须带 body.toc-drawer 前缀。此前 .toc-side 的基础布局漏了前缀，
   导致悬浮态被无条件覆盖成 fixed 抽屉（left:auto/right:0 + translateX(100%)）→ 目录永远在屏外。 */
body.toc-drawer .toc-side{
  position:fixed;top:0;right:0;left:auto;height:100vh;width:280px;max-width:84vw;
  transform:translateX(100%);transition:transform .22s ease;z-index:60;
  padding:64px 18px 18px;background:var(--bg);border-left:1px solid var(--line);
  box-shadow:-8px 0 28px rgba(15,23,42,.10);overflow:auto;
}
/* 说明：正文布局与目录无关，抽屉态无需再"还原"正文——.post-body/.post-main 从未被改动。
   抽屉态只需把 .toc-side 从 absolute 换成 fixed 并把 left 复位（已在上一块 left:auto 处理）。 */
.toc-toggle,.toc-overlay{display:none}
body.toc-drawer .toc-side{transform:translateX(100%)}
body.toc-drawer.toc-open .toc-side{transform:translateX(0)}
body.toc-drawer .toc-card,
body.toc-drawer .toc-card,
body.toc-drawer.head-shrink .toc-card{
  position:static;top:auto;margin-top:0;max-height:none;transition:none;
}
body.toc-drawer .toc-list a,
body.toc-drawer .toc-list li.lv2 a,
body.toc-drawer .toc-list li.lv3 a,
body.toc-drawer .toc-list li.lv4 a,
body.toc-drawer .toc-list li.lv5 a{padding-left:10px;margin-left:0;font-size:13.5px}
body.toc-drawer .toc-list a.is-active{border-left-color:transparent;background:var(--accent-soft)}
body.toc-drawer .toc-toggle{
  display:inline-flex;align-items:center;justify-content:center;
  position:fixed;right:26px;bottom:82px;width:42px;height:42px;border-radius:50%;
  background:var(--paper);color:var(--ink-2);border:1px solid var(--line);cursor:pointer;z-index:58;
  box-shadow:0 4px 14px rgba(15,23,42,.10);
  transition:background .18s ease,color .18s ease,transform .18s ease,border-color .18s ease;
}
body.toc-drawer .toc-toggle:hover{background:var(--accent);border-color:var(--accent);color:#fff;transform:translateY(-2px)}
.toc-toggle svg{width:20px;height:20px}
body.toc-drawer .toc-overlay{
  display:block;position:fixed;inset:0;background:rgba(15,23,42,.32);
  opacity:0;visibility:hidden;transition:opacity .2s ease,visibility .2s ease;z-index:55;
}
body.toc-drawer.toc-open .toc-overlay{opacity:1;visibility:visible}
/* 与右下角返回顶部按钮垂直堆叠，避免重叠（≤620px 时返回顶部按钮更贴边） */
@media (max-width:620px){
  body.toc-drawer .toc-toggle{right:16px;bottom:66px;width:38px;height:38px}
}
