/* ==========================================================================
   Paper · 简洁博客主题（QiLog 默认主题）
   设计语言：纯白留白 / 细线分隔 / 单一强调色 / 系统字体栈
   --------------------------------------------------------------------------
   可覆盖变量（由 _head.php 注入主题配置）：
     --shell-w   内容宽度（660 / 740 / 860，对应后台「正文阅读宽度」）
     --accent    强调色（后台「主题强调色」，深浅两档由 PHP 派生）
     --font-body 正文字体（后台「正文字体」，系统字体栈，无外部请求）
   ========================================================================== */

:root {
  --shell-w: 740px;
  --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; }

/* ---------- 顶部 ---------- */
.site-head {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,.92);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-head .inner { display: flex; align-items: center; gap: 16px; height: 60px; }

.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); }

.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; 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;
}
.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;
}
.search button:hover { border-color: var(--accent); color: var(--accent); }
.search-link { display: none; margin-left: 6px; }

/* ---------- 页脚 ---------- */
.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); }

/* ---------- 文章条目（首页 / 归档 / 搜索共用） ---------- */
.post { display: flex; gap: 24px; align-items: flex-start; padding: 28px 0; border-bottom: 1px solid var(--line); }
.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; }

/* ---------- 搜索框（搜索页） ---------- */
.search-box { display: flex; gap: 10px; padding: 30px 0 6px; }
.search-box input {
  flex: 1; height: 44px; padding: 0 16px;
  border: 1px solid var(--line-2); border-radius: 999px;
  font: inherit; font-size: 15px; color: var(--ink); background: #fff;
}
.search-box input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(46,109,163,.10); }
.search-box button {
  height: 44px; padding: 0 24px; border: none; border-radius: 999px; cursor: pointer;
  background: var(--accent); color: #fff; font: inherit; font-size: 15px; font-weight: 600;
}
.search-box button:hover { background: var(--accent-dark); }

/* ---------- 分页 ---------- */
.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; }
.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: 19px; line-height: 1.55; color: var(--ink); font-weight: 700; }
.prose h4 { margin: 1.8em 0 .5em; font-size: 16.5px; color: var(--ink); font-weight: 700; }

.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; }

.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; margin-top: 26px; }
.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 { margin-top: 72px; }
.comments h2 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 26px; font-size: 20px; font-weight: 700; color: var(--ink); }
.comments h2 .count { font-size: 13px; font-weight: 400; color: var(--faint); }

.comment-form { margin-bottom: 34px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: #fbfbfd; }
.comment-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.comment-form input, .comment-form textarea {
  width: 100%; padding: 10px 13px;
  border: 1px solid var(--line-2); border-radius: 8px;
  font: inherit; font-size: 14.5px; color: var(--ink); background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.comment-form textarea { resize: vertical; min-height: 96px; margin-bottom: 12px; }
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(46,109,163,.12); }
.comment-form .submit-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.comment-form .note { font-size: 12.5px; color: var(--muted); }
.comment-form button {
  padding: 9px 22px; border: none; border-radius: 8px; cursor: pointer;
  background: var(--accent); color: #fff; font: inherit; font-size: 14.5px; font-weight: 600;
}
.comment-form button:hover { background: var(--accent-dark); }
.comment-form .url-input { margin-bottom: 12px; }

.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-item { padding: 20px 0; border-bottom: 1px solid var(--line); }
.comment-item .c-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.comment-item .avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-dark); font-size: 14px; font-weight: 700;
  overflow: hidden;
}
.comment-item .avatar img.ava-img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.comment-item .who { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.comment-item .name { font-size: 14.5px; font-weight: 400; color: var(--ink); }
.comment-item .name .admin { font-size: 11px; font-weight: 600; color: #fff; background: var(--accent); border-radius: 4px; padding: 1px 6px; vertical-align: 1px; }
/* 管理员评论：以站点身份展示，不公开个人昵称 */
.comment-item .admin-tag {
  display: inline-block; font-size: 12px; font-weight: 600; color: var(--accent-dark);
  background: var(--accent-soft); border: 1px solid transparent; border-radius: 999px;
  padding: 2px 10px; vertical-align: 1px;
}
.comment-item .avatar.is-admin { background: var(--accent); color: #fff; }
.comment-item .time { font-size: 12.5px; color: var(--faint); }
.comment-item .c-body { margin: 8px 0 0; font-size: 15px; line-height: 1.9; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.comment-item .reply { display: inline-block; margin-top: 6px; font-size: 13px; color: var(--muted); }
.comment-item .reply:hover { color: var(--accent); }

/* 回复提示条 / 登录身份行 */
.reply-hint {
  display: none; align-items: center; gap: 10px;
  margin-bottom: 12px; padding: 8px 14px;
  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); text-decoration: underline; text-underline-offset: 2px; }
.comment-form .identity {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 12px; font-size: 13.5px; color: var(--muted);
}
.comment-form .identity b { color: var(--ink); font-weight: 600; }

.children { list-style: none; margin: 14px 0 0; padding: 0 0 0 26px; border-left: 2px solid var(--accent-soft); }
.children .comment-item { border-bottom: none; padding: 14px 0 0 6px; }

/* ---------- 友链 ---------- */
.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 .inner { height: 54px; gap: 8px; }
  .brand { font-size: 17px; }
  .nav { overflow-x: auto; }
  .nav-item > a { padding: 5px 9px; font-size: 13.5px; white-space: nowrap; }
  .search { display: none; }
  .search-link { display: inline-flex; align-items: center; justify-content: center; 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 { padding: 26px 0; gap: 16px; }
  .post.has-cover .post-thumb { flex-basis: 116px; width: 116px; height: 84px; border-radius: 8px; }
  .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; }
  .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 .row { grid-template-columns: 1fr; }
  .site-foot { margin-top: 60px; }
  .site-foot .meta { margin-left: 0; width: 100%; }
}

/* ============================================================
   文章 / 单页：统一整页宽，无侧栏
   所有页面 .shell 统一为 --shell-w（后台「整页宽度」配置）；
   文章/单页无侧栏组件，正文占满整页宽度。
   ============================================================ */
.post-main { min-width: 0; }
.post-body .prose h2, .post-body .prose h3, .post-body .prose h4, .post-body .prose h5 { scroll-margin-top: 84px; }

/* 单页变体（page-links 等）：宽版沉浸，仅调字号/间距，不改整页宽度（统一 --shell-w） */
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; }


/* ---- 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:center;padding:0 24px;max-width:920px}
.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:14px 0 0;color:rgba(255,255,255,.94);font-size:16.5px;line-height:1.85;text-shadow:0 1px 12px rgba(0,0,0,.24)}

/* ---------- 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}

/* ---------- 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}

/* ---------- 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){
  .site-cover{height:calc(var(--cover-h,320px) * .72)}
  .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：正文含多级标题时自动显示，悬浮右侧留白 + 下拉吸顶 ---------- */
/* 关键：正文 .shell 宽度不变（仍 = var(--shell-w) 居中），正文左缘天然与顶部导航左缘对齐；
   目录不占正文宽度，相对 .post-body 定位、浮在右侧留白（gutter）里，sticky 吸顶。 */
.post-body.has-toc{position:relative}
/* 宽屏(≥1440px)：目录浮在正文右侧留白，sticky 吸顶 */
.toc-side{position:absolute;left:calc(100% + 40px);top:0;width:224px;height:100%}
.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}
.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}
.toc-list a:hover{color:var(--accent)}
.toc-list li.lv3 a{padding-left:14px}
.toc-list li.lv4 a{padding-left:28px}

/* 窄屏(不足容纳悬浮目录时)手动展开：右下浮动按钮 + 右侧抽屉式目录 */
/* 阈值固定为安全值：视口 ≥ 1680px 才用悬浮态（覆盖所有页宽配置所需阈值，杜绝横向滚动）；
   原按页宽动态注入，改为静态外链后固定（详见 _head.php 注释）。 */
.toc-toggle{display:none}
.toc-overlay{display:none}
@media (max-width:1679px){
  /* 目录改为右侧抽屉，默认收起（translateX 移出屏幕） */
  .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
  }
  body.toc-open .toc-side{transform:translateX(0)}
  .toc-card{position:static;top:auto;margin-top:0;max-height:none}
  .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
  }
  .toc-toggle:hover{background:var(--accent);border-color:var(--accent);color:#fff;transform:translateY(-2px)}
  .toc-toggle svg{width:20px;height:20px}
  /* 与右下角返回顶部按钮垂直堆叠，避免重叠（≤620px 时返回顶部按钮更贴边） */
  @media (max-width:620px){
    .toc-toggle{right:16px;bottom:66px;width:38px;height:38px}
  }
  .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-open .toc-overlay{opacity:1;visibility:visible}
}
/* 宽屏自动展开：隐藏手动入口，并确保抽屉态不残留 */
@media (min-width:1680px){
  .toc-toggle,.toc-overlay{display:none!important}
  .toc-side{transform:none!important}
}
