/* ══════════════════════════════════════
   kmmer base.css（由 main.css 按页面归属拆分生成，勿手工混写）
   重建：_ref/build_css_split.js  归因：_ref/css_split_plan.json
   ══════════════════════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
@font-face {
  font-family: 'ZQL';
  src: url('../fonts/zql-v3-subset.woff2') format('woff2');
  font-display: swap;
}
:root {
  /* 主色 #275CEA（HSL 224,82%,54%）；hover 降亮度约 9%、soft/glow 由它派生 */
  --accent: #275CEA;
  --accent-hover: #1044d3;
  --accent-soft: rgba(39,92,234,0.1);
  --accent-glow: rgba(39,92,234,0.25);
  --bg: #DCE0EA;
  /* 纯色渐变背景：只有渐变，不含任何图案纹理，避免干扰文章阅读。
     色相统一到主色族 H224（原 H214 偏青，会与新主色发灰） */
  --bg-grad:
    radial-gradient(120% 88% at 50% -12%, #F6F7FB 0%, rgba(246,247,251,0) 56%),
    radial-gradient(78% 58% at 100% 4%, rgba(209,215,229,0.72) 0%, rgba(209,215,229,0) 60%),
    radial-gradient(88% 66% at 0% 100%, rgba(202,207,221,0.62) 0%, rgba(202,207,221,0) 62%),
    linear-gradient(180deg, #EFF1F6 0%, #E5E8F0 52%, #DCE0EA 100%);
  --glass-bg: rgba(255,255,255,0.45);
  --glass-bg-strong: rgba(255,255,255,0.62);
  --glass-border: rgba(255,255,255,0.5);
  --glass-blur: 20px;
  --glass-highlight: linear-gradient(135deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0.08) 40%, rgba(255,255,255,0) 60%);
  --content-bg: transparent;
  --text: #1A1A1A;
  --text-secondary: #6B7280;
  --text-light: #9CA3AF;
  --border: rgba(0,0,0,0.06);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --radius-pill: 50px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,0.05), 0 2px 8px rgba(16,24,40,0.04);
  --shadow-md: 0 2px 6px rgba(16,24,40,0.05), 0 12px 28px rgba(16,24,40,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  --edge-light: inset 0 1px 0 rgba(255,255,255,0.5);
}
html.dark {
  --bg: #0F1117;
  /* 深色背景光晕与主色同族 H224 */
  --bg-grad:
    radial-gradient(120% 88% at 50% -12%, rgba(55,69,109,0.55) 0%, rgba(55,69,109,0) 58%),
    radial-gradient(80% 56% at 100% 8%, rgba(30,41,72,0.50) 0%, rgba(30,41,72,0) 60%),
    linear-gradient(180deg, #151A28 0%, #101219 55%, #0C0E14 100%);
  --glass-bg: rgba(22,25,33,0.6);
  --glass-bg-strong: rgba(22,25,33,0.78);
  --glass-border: rgba(255,255,255,0.06);
  --glass-highlight: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.02) 40%, rgba(255,255,255,0) 60%);
  --content-bg: transparent;
  --text: #E8EAED;
  --text-secondary: #9AA0AC;
  --text-light: #5F6570;
  --border: rgba(255,255,255,0.05);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.22), 0 2px 10px rgba(0,0,0,0.16);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.28), 0 14px 34px rgba(0,0,0,0.28);
  --edge-light: inset 0 1px 0 rgba(255,255,255,0.06);
}
a { text-decoration: none; color: inherit; }
a:hover { text-decoration: none; }
html {
  transition: background-color 0.35s ease, color 0.35s ease;
}
html, body {
  height: 100%; overflow: hidden;
  font-family: 'ZQL', -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text); font-size: 15px; line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  background-color: var(--bg);
  background-image: var(--bg-grad);
}
html.dark body {
  background-image: var(--bg-grad);
}
html.dark img {
  filter: brightness(0.88) saturate(0.92);
}
/* ── 环境光层：位于纯色渐变之上、所有内容之下 ──
   只做两件事：顶部柔光与底部暗角，给纯色渐变一点纵深，不引入任何图案 */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(150% 62% at 50% 124%, rgba(23,34,56,0.10), rgba(23,34,56,0) 72%),
    radial-gradient(90% 70% at 50% -20%, rgba(255,255,255,0.55), rgba(255,255,255,0) 60%);
}
html.dark body::before {
  background:
    radial-gradient(150% 62% at 50% 124%, rgba(0,0,0,0.34), rgba(0,0,0,0) 72%),
    radial-gradient(90% 70% at 50% -20%, rgba(93,116,177,0.16), rgba(93,116,177,0) 60%);
}
/* 布局唯一：左侧固定导航 + 顶部通栏 + 正文 640px 居中（原 leftnav）
   .page 铺满整个视口；≤920px 由下方响应式规则回落为抽屉式侧栏 */
.page {
  width: 100%; max-width: 100%; margin: 0;
  height: 100vh; display: flex; flex-direction: column;
  padding: 0;
}
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.6);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.6);
  border: 1px solid var(--glass-border);
  position: relative;
  /* 玻璃上缘的一道高光，让面板边缘“立”起来，层次更清晰 */
  box-shadow: var(--edge-light);
}
@supports not (backdrop-filter: blur(1px)) {
  .glass { background: var(--glass-bg-strong); }
  .sidebar { background: var(--glass-bg-strong) !important; }
  .mobile-search { background: var(--glass-bg-strong); }
  .hitokoto-banner { background: var(--glass-bg-strong); }
  .post-card-simple { background: var(--glass-bg-strong); }
  .post-card { background: var(--glass-bg-strong); }
  .bottom-bar { background: var(--glass-bg-strong); }
  .pg-card { background: var(--glass-bg-strong); }
}
.glass::before {
  display: none;
}
.shell {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius);
}
.topbar {
  height: var(--topbar-h, 90px); min-height: var(--topbar-h, 90px);
  display: flex; align-items: center;
  padding: 0 24px; gap: 0;
  position: relative; z-index: 5;
  transition: max-height .3s ease, opacity .22s ease, transform .3s ease;
}
.topbar-brand {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  flex-shrink: 0; color: inherit; text-decoration: none;
  transition: opacity .25s ease;
}
.topbar-brand:hover { opacity: .78; }
.topbar-center {
  position: absolute; left: 50%; transform: translateX(-50%);
  width: 340px; max-width: calc(100% - 400px);
}
.topbar-search-form {
  position: relative; display: block;
}
.topbar-center i {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-light); font-size: 13px; pointer-events: none; -webkit-tap-highlight-color: transparent; z-index: 2;
}
.topbar-search {
  width: 100%; height: 38px; border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border); padding: 0 16px 0 38px;
  font-size: 13px; color: var(--text);
  background: rgba(255,255,255,0.45);
  backdrop-filter: blur(10px);
  outline: none; transition: all .25s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.topbar-search::placeholder { color: var(--text-secondary); }
.topbar-search:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,0.75);
  box-shadow: 0 2px 12px var(--accent-glow);
}
html.dark .topbar-search {
  border-color: rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.07);
}
html.dark .topbar-search:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,0.12);
  box-shadow: 0 2px 12px var(--accent-glow);
}
.topbar-brand .brand-icon {
  width: 66px; height: 66px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 28px; font-weight: 700;
  box-shadow: 0 3px 12px var(--accent-glow);
}
.topbar-brand .brand-name { font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: .5px; }
.topbar-brand .brand-logo-img { height: 54px; width: auto; border-radius: var(--radius-sm); object-fit: contain; }
/* ── 图片加载动画 ── */
.img-shimmer-wrap {
  display: block; position: relative; overflow: hidden;
  border-radius: inherit;
}
.img-shimmer-wrap img {
  display: block; margin: 0;
}
.img-loading {
  position: relative; overflow: hidden;
  background: rgba(0,0,0,0.04);
}
.img-loading::before {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(110deg, rgba(0,0,0,0.04) 30%, rgba(0,0,0,0.10) 50%, rgba(0,0,0,0.04) 70%);
  background-size: 300% 100%;
  animation: imgSweep 1.4s ease-in-out infinite;
  border-radius: inherit;
  pointer-events: none;
}
@keyframes imgSweep {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
html.dark .img-loading {
  background: rgba(255,255,255,0.04);
}
html.dark .img-loading::before {
  background: linear-gradient(110deg, rgba(255,255,255,0.04) 30%, rgba(255,255,255,0.10) 50%, rgba(255,255,255,0.04) 70%);
  background-size: 300% 100%;
}
.img-loading img {
  opacity: 0;
}
img.loaded {
  opacity: 1;
  transition: opacity .3s ease;
}
.topbar-center .m-brand-icon, .topbar-center .m-brand-name, .topbar-center .m-brand-logo-img { display: none; }
.topbar-center .m-brand { display: none; }
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.topbar-btn {
  width: 34px; height: 34px; border-radius: 50%; border: none;
  background: transparent; cursor: pointer; display: flex;
  align-items: center; justify-content: center; color: var(--text-secondary);
  transition: all .2s; font-size: 14px; position: relative;
}
.topbar-btn:hover { background: rgba(0,0,0,0.06); color: var(--text); }
html.dark .topbar-btn:hover { background: rgba(255,255,255,0.08); }
#editPostBtn {
  color: var(--text-secondary); text-decoration: none;
  width: 31px; height: 31px;
  border: 2.5px solid var(--border);
}
#editPostBtn:hover {
  background: rgba(0,0,0,0.06); color: var(--text);
}
html.dark #editPostBtn:hover {
  background: rgba(255,255,255,0.08);
}
/* ── 深色模式切换按钮 ── */
#themeToggle {
  width: 31px; height: 31px;
  border: 2.5px solid var(--border);
}
.scroll-progress-btn {
  position: relative; display: flex; align-items: center; justify-content: center;
}
.scroll-progress-ring {
  width: 34px; height: 34px; transform: rotate(-90deg);
  position: absolute; top: 0; left: 0;
}
.scroll-progress-bg {
  fill: none; stroke: var(--border); stroke-width: 2.5;
}
.scroll-progress-bar {
  fill: none; stroke: var(--accent); stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 87.96;
  stroke-dashoffset: 87.96;
  transition: stroke-dashoffset 0.15s ease;
}
.scroll-progress-text {
  font-size: 9px; font-weight: 700; color: var(--text-secondary);
  position: relative; z-index: 1; line-height: 1;
}
.main-body { flex: 1; display: flex; overflow: hidden; }
.sidebar {
  width: var(--sidebar-w, 230px); min-width: var(--sidebar-w, 230px);
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
  padding-top: 4px;
  position: relative; z-index: 2;
  scrollbar-width: thin; scrollbar-color: var(--glass-bg-strong) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--glass-bg-strong); border-radius: 2px; }
.nav-group { padding: 2px 14px; }
.nav-group-title {
  font-size: 13px; color: var(--text-secondary);
  /* 右侧 4px 与 .cat-tree 的 padding 保持一致，使标题栏折叠箭头与分类行箭头上下对齐 */
  padding: 12px 4px 5px 18px;
  font-weight: 600; letter-spacing: .3px;
  display: flex; align-items: center; justify-content: space-between;
}
/* ── 侧边栏区块折叠按钮 ── */
.section-toggle-btn {
  /* 尺寸与 .cat-toggle 统一，保证两者箭头落在同一竖线上 */
  width: 22px; height: 22px;
  border: none; background: transparent;
  color: var(--text-light); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 10px;
  transition: all .2s;
  padding: 0;
}
.section-toggle-btn:hover {
  background: rgba(0,0,0,0.06);
  color: var(--text);
}
html.dark .section-toggle-btn:hover {
  background: rgba(255,255,255,0.08);
}
.section-toggle-btn i {
  transition: transform .25s ease;
}
.section-toggle-btn.collapsed i {
  transform: rotate(180deg);
}
.section-list {
  max-height: 800px;
  overflow: hidden;
  transition: max-height .35s ease, opacity .25s ease;
  opacity: 1;
}
.section-list.collapsed {
  max-height: 0;
  opacity: 0;
}
/* ── 侧边栏标签云 ── */
.sidebar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 18px 10px;
}
.sidebar-tag {
  display: inline-block;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(0,0,0,0.03);
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: all .15s;
  border: 1px solid transparent;
}
html.dark .sidebar-tag {
  background: rgba(255,255,255,0.04);
}
.sidebar-tag:hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-glow);
}
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 18px;
  cursor: pointer; position: relative; color: var(--text-secondary); font-size: 13px;
  transition: color .2s, background .2s; border-radius: var(--radius-sm); margin: 1px 0;
  text-decoration: none;
  overflow: hidden;
}
.nav-item:hover {
  background: rgba(0,0,0,0.04); color: var(--text);
}
.nav-item:hover i { color: var(--accent); }
html.dark .nav-item:hover {
  background: rgba(255,255,255,0.05);
}
.nav-item.active {
  color: var(--accent); font-weight: 600;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
}
/* ── 分类导航：手风琴 ── */
.cat-tree { list-style: none; margin: 0; padding: 0 4px; }
.cat-group { margin: 1px 0; }
.cat-row {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.cat-group > .cat-row > .nav-item {
  flex: 1; min-width: 0;
}
.cat-toggle {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none;
  color: var(--text-light); cursor: pointer;
  border-radius: 50%; font-size: 10px;
  padding: 0;
  transition: background .2s, color .2s;
}
.cat-toggle:hover {
  background: rgba(0,0,0,0.06);
  color: var(--text);
}
html.dark .cat-toggle:hover { background: rgba(255,255,255,0.08); }
.cat-toggle i {
  transition: transform .25s ease;
}
.cat-group.open > .cat-row > .cat-toggle i {
  transform: rotate(180deg);
}
/* 无子分类的顶级分类：占位同宽，保证各行计数徽标与箭头列左右对齐 */
.cat-toggle-empty { visibility: hidden; pointer-events: none; }
.cat-children {
  list-style: none; margin: 0; padding: 0 0 2px 18px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height .3s ease, opacity .2s ease;
}
.cat-group.open > .cat-children {
  max-height: 500px;
  opacity: 1;
}
.cat-children[hidden] { display: block; }   /* 配合 JS 平滑过渡：用 max-height 控制可见性，避免 [hidden] 立即消失 */
.cat-child-wrap > .nav-item {
  padding-left: 30px;     /* 缩进 */
  font-size: 12.5px;
}
.cat-child-wrap > .nav-item i { font-size: 11px; opacity: .85; }
html.dark .cat-child-wrap > .nav-item i { opacity: .9; }
/* 子项 active 强调左侧色条 */
.cat-child-wrap.cat-active > .nav-item,
.nav-item.cat-parent.active { position: relative; }
.nav-item.active i { color: var(--accent); }
.nav-item i {
  width: 17px; text-align: center; font-size: 14px;
  transition: color .2s;
}
.nav-count {
  margin-left: auto; font-size: 11px; color: var(--text-light);
  background: rgba(0,0,0,0.04); padding: 1px 7px;
  border-radius: var(--radius-sm); font-weight: 500;
  /* 大数字：等宽数字 + 定宽省略，保证多行分类名右侧徽标始终对齐 */
  font-variant-numeric: tabular-nums;
  min-width: 26px; text-align: center;
  max-width: 52px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex-shrink: 0;
}
html.dark .nav-count { background: rgba(255,255,255,0.06); }
.nav-divider { height: 1px; background: rgba(0,0,0,0.06); margin: 8px 18px; }
html.dark .nav-divider { background: rgba(255,255,255,0.06); }
.sidebar-footer { display: none; }
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,0.88);
  backdrop-filter: blur(8px);
  align-items: center; justify-content: center;
  padding: 20px;
  overflow: hidden;
}
.lightbox.active { display: flex; }
.lightbox-img-wrap {
  position: relative; display: flex; align-items: center; justify-content: center;
  max-width: 90vw; max-height: 85vh;
  animation: lbIn .25s ease; cursor: zoom-in;
}
.lightbox-img-wrap img {
  max-width: 90vw; max-height: 85vh; object-fit: contain;
  border-radius: var(--radius-xs); box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  user-select: none; -webkit-user-drag: none;
  transition: transform .2s ease, opacity .18s ease; will-change: transform;
  /* 尺寸契约：由 JS 按原图长宽比写入 aspect-ratio，解码期间即占好位，
     避免 naturalWidth=0 时按内在尺寸重排造成「打开时图片跳一下」 */
  width: auto; height: auto;
}
/* 解码完成前先隐藏，避免闪现旧图/半张图；配合 JS 的 img.decode() */
.lightbox-img-wrap img.lb-img-loading { opacity: 0; }
.lightbox-close {
  position: absolute; top: 16px; right: 20px; z-index: 10;
  width: 38px; height: 38px; border: none;
  background: rgba(255,255,255,0.25); color: #fff;
  border-radius: 50%; cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, right .28s ease;
  backdrop-filter: blur(8px);
}
.lightbox-close:hover { background: rgba(255,255,255,0.4); }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; border: none;
  background: rgba(255,255,255,0.25); color: #fff;
  border-radius: 50%; cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, right .28s ease; z-index: 10;
  backdrop-filter: blur(8px);
}
.lightbox-nav:hover { background: rgba(255,255,255,0.4); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-counter {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.7); font-size: 13px; z-index: 10;
  background: rgba(0,0,0,0.4); padding: 4px 14px; border-radius: var(--radius-pill);
  font-variant-numeric: tabular-nums; transition: transform .28s ease;
}
.content-area {
  flex: 1; position: relative; display: flex; flex-direction: column;
  overflow: hidden; z-index: 2;
}
.content-inner {
  flex: 1; display: flex; flex-direction: column;
  background: transparent;
  border-left: 1px solid var(--glass-border);
  overflow: hidden;
}
.content-scroll {
  flex: 1; overflow-y: scroll; padding: 6px 24px 40px;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  position: relative; z-index: 1;
  --sb-show: 0;
}
/* 滚动时 + 悬停在滚动条区域时显示 */
.content-scroll.sb-active,
.content-scroll:hover {
  scrollbar-color: var(--glass-bg-strong) transparent;
}
.content-scroll::-webkit-scrollbar { width: 6px; }
.content-scroll::-webkit-scrollbar-track { background: transparent; }
.content-scroll::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 3px;
  transition: background .3s;
}
.content-scroll.sb-active::-webkit-scrollbar-thumb,
.content-scroll:hover::-webkit-scrollbar-thumb {
  background: var(--glass-bg-strong);
}
.content-scroll.sb-active::-webkit-scrollbar-thumb:hover,
.content-scroll:hover::-webkit-scrollbar-thumb:hover {
  background: var(--accent-soft);
}
.fade-top, .fade-bottom {
  position: absolute; left: 0; right: 0; height: 48px;
  pointer-events: none; -webkit-tap-highlight-color: transparent; z-index: 5; transition: opacity .3s;
}
.fade-top { top: 0; background: linear-gradient(to bottom, var(--bg), transparent); opacity: 0; }
.fade-bottom { bottom: 0; background: linear-gradient(to top, var(--bg), transparent); opacity: 1; }
.fade-top.visible, .fade-bottom.visible { opacity: 1; }
/* ── 置顶文章 ── */
.sticky-wrap {
  display: grid; gap: 10px;
  margin-bottom: 12px;
}
.sticky-wrap.sticky-count-1 { grid-template-columns: 1fr; }
.sticky-wrap.sticky-count-2 { grid-template-columns: repeat(2, 1fr); }
.sticky-wrap.sticky-count-3 { grid-template-columns: repeat(3, 1fr); }
.sticky-card {
  text-decoration: none; color: inherit;
  display: block;
  margin-bottom: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  transition: box-shadow .25s, border-color .25s;
  position: relative;
}
.sticky-card:hover {
  background: var(--glass-bg-strong);
  box-shadow: var(--shadow-md);
  border-color: rgba(255,255,255,0.7);
}
html.dark .sticky-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(255,255,255,0.1);
}
/* 图片区域 */
.sticky-img {
  position: relative;
  overflow: hidden;
  background: rgba(0,0,0,0.04);
}
.sticky-img img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
}
.sticky-img-fallback {
  width: 100%; height: 130px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: rgba(255,255,255,0.9);
  font-size: 36px; font-weight: 700;
}
/* 图片底部渐隐 */
.sticky-img::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: linear-gradient(to top, var(--bg) 10%, transparent);
  pointer-events: none;
}
/* 置顶徽章 */
.sticky-badge {
  position: absolute;
  top: 10px; right: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: .5px;
  box-shadow: none;
}
/* 文字区域 */
.sticky-body {
  padding: 12px 14px 14px;
}
.sticky-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .15s;
}
.sticky-card:hover .sticky-title {
  color: var(--accent);
}
/* 分隔线 */
.sticky-divider {
  width: 24px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  margin: 8px 0;
  opacity: 0.5;
}
/* 底部信息 */
.sticky-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--text-light);
}
.sticky-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.sticky-meta i {
  font-size: 11px;
  opacity: 0.7;
}
.post-card-simple {
  display: block;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.5);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  transition: all .25s;
  position: relative; overflow: hidden;
  text-decoration: none; color: inherit;
  opacity: 0; transform: translateY(16px);
}
.post-card-simple.card-visible {
  animation: cardFadeIn 0.4s ease both;
}
.post-card-simple::before {
  content: ''; position: absolute; inset: 0;
  border-radius: inherit; pointer-events: none;
  background: var(--glass-highlight); z-index: 1;
}
.post-card-simple:hover {
  background: var(--glass-bg-strong);
  box-shadow: var(--shadow-md);
  border-color: rgba(255,255,255,0.7);
}
html.dark .post-card-simple { box-shadow: var(--shadow-sm); }
html.dark .post-card-simple:hover { box-shadow: var(--shadow-md); border-color: rgba(255,255,255,0.1); }
.pcs-body {
  flex: 1; min-width: 0; position: relative; z-index: 2;
}
.pcs-title {
  font-size: 16px; font-weight: 600; color: var(--text);
  line-height: 1.5; margin-bottom: 6px;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  transition: color .15s;
}
.post-card-simple:hover .pcs-title { color: var(--accent); }
.pcs-excerpt {
  font-size: 13px; color: var(--text-secondary); line-height: 1.7;
  margin-bottom: 10px;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.pcs-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
  font-size: 12px; color: var(--text-light);
}
.pcs-meta-item { display: flex; align-items: center; gap: 4px; }
.pcs-meta-item i { font-size: 11px; }
@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.post-card, .friend-feed-card,
.cmt-card, .cmt-item, .photo-item {
  opacity: 0; transform: translateY(16px);
}
.post-card.card-visible, .friend-feed-card.card-visible,
.cmt-card.card-visible, .cmt-item.card-visible, .photo-item.card-visible {
  animation: cardFadeIn 0.4s ease both;
}
.img-grid.g1 { grid-template-columns: 1fr; max-width: 360px; }
.img-grid.g3 { grid-template-columns: 1fr 1fr 1fr; max-width: 440px; }
.img-grid.g4 { grid-template-columns: 1fr 1fr; max-width: 400px; }
.img-grid.g5, .img-grid.g6 { grid-template-columns: 1fr 1fr 1fr; max-width: 440px; }
.img-grid .img-cell .img-more {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 22px; font-weight: 600;
}
.bottom-bar {
  height: 40px; min-height: 40px;
  display: flex; align-items: center; justify-content: center;
  gap: 12px; padding: 0 16px;
  color: var(--text-light); font-size: 11px; z-index: 2;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.6);
  border-top: 1px solid var(--glass-border);
  position: relative;
}
.bottom-bar::before {
  content: ''; position: absolute; inset: 0;
  border-radius: inherit; pointer-events: none;
  background: var(--glass-highlight);
}
.bottom-bar a { color: var(--text-secondary); text-decoration: none; transition: color .15s; }
.bottom-bar a:hover { color: var(--accent); }
.bottom-bar .dot { width: 2px; height: 2px; border-radius: 50%; background: var(--text-light); opacity: .5; }
.orb {
  position: fixed; border-radius: 50%; pointer-events: none; -webkit-tap-highlight-color: transparent;
  filter: blur(90px); opacity: 0.07; z-index: 0; transition: opacity .5s;
  will-change: transform;
}
html.dark .orb { opacity: 0.05; }
/* 背景光晕：主色蓝 + 同族浅蓝 + 青蓝点缀（视觉克制，深色下 opacity 仅 0.05） */
.orb-1 { width: 420px; height: 420px; background: #275CEA; top: -100px; left: -100px; animation: f1 16s ease-in-out infinite; }
.orb-2 { width: 380px; height: 380px; background: #7B9BF0; bottom: -80px; right: -80px; animation: f2 19s ease-in-out infinite; }
.orb-3 { width: 320px; height: 320px; background: #5CC8E8; top: 40%; left: 55%; animation: f3 13s ease-in-out infinite; }
@keyframes f1 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(50px,35px); } }
@keyframes f2 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-45px,-30px); } }
@keyframes f3 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-35px,45px); } }
.hamburger {
  display: none; width: 36px; height: 36px; border: none;
  background: transparent; cursor: pointer; align-items: center;
  justify-content: center; color: var(--text-secondary); font-size: 18px;
  border-radius: var(--radius-xs); transition: all .15s; flex-shrink: 0;
  position: relative; z-index: 10;
}
.hamburger:hover { background: rgba(0,0,0,0.06); color: var(--text); }
html.dark .hamburger:hover { background: rgba(255,255,255,0.08); }
.sidebar-overlay {
  display: none; position: fixed; inset: 0; z-index: 199;
  background: rgba(0,0,0,0.3);
  opacity: 0; pointer-events: none;
  transition: opacity .3s cubic-bezier(.4,0,.2,1);
  -webkit-tap-highlight-color: transparent;
}
.sidebar-mobile-header { display: none; }
/* ══════════════════════════════════════
   友情链接 - 分类标签栏
   ══════════════════════════════════════ */
.links-category-tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 16px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.links-cat-tab {
  font-size: 13px; color: var(--text-secondary); cursor: pointer;
  padding: 6px 14px; border-radius: var(--radius-pill); position: relative;
  transition: color .2s, background .2s;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  font-family: inherit; line-height: 1.5;
}
.links-cat-tab:hover {
  color: var(--text); background: rgba(0,0,0,0.08);
}
.links-cat-tab:focus {
  outline: none;
}
.links-cat-tab.active {
  color: #fff; font-weight: 600;
  background: var(--accent);
  box-shadow: 0 2px 8px var(--accent-glow);
}
.links-cat-tab.active:hover {
  background: var(--accent-hover);
  box-shadow: 0 3px 12px var(--accent-glow);
}
.links-cat-tab.active .links-cat-count {
  background: rgba(255,255,255,0.25);
  color: #fff;
}
.links-cat-count {
  font-size: 11px; font-weight: 600;
  background: rgba(0,0,0,0.04);
  color: var(--text-light);
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  transition: all .2s;
}
html.dark .links-cat-count {
  background: rgba(255,255,255,0.06);
}
/* ══════════════════════════════════════
   友情链接 - 分类分组标题
   ══════════════════════════════════════ */
.links-category-group {
  margin-bottom: 24px;
}
.links-category-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--text);
  margin-bottom: 12px; padding: 8px 0;
}
.links-category-title i {
  color: var(--accent); font-size: 13px;
}
.links-category-count {
  font-size: 11px; font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}
/* ══════════════════════════════════════
   友情链接 - 卡片网格
   ══════════════════════════════════════ */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.link-card {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 14px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.5);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  text-decoration: none; color: inherit;
  transition: all .25s;
  overflow: hidden; position: relative;
  opacity: 0; transform: translateY(16px);
}
.link-card.card-visible {
  animation: cardFadeIn 0.4s ease both;
}
.link-card::before {
  content: ''; position: absolute; inset: 0;
  border-radius: inherit; pointer-events: none;
  background: var(--glass-highlight); z-index: 1;
}
.link-card:hover {
  background: var(--glass-bg-strong);
  box-shadow: var(--shadow-md);
  border-color: rgba(255,255,255,0.7);
}
html.dark .link-card { box-shadow: var(--shadow-sm); }
html.dark .link-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(255,255,255,0.1);
}
.link-avatar {
  flex-shrink: 0; width: 48px; height: 48px;
  border-radius: 50%; overflow: hidden;
  background: var(--glass-bg-strong);
  position: relative; z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.link-avatar img {
  width: 48px; height: 48px;
  border-radius: 50%; object-fit: cover; display: block;
}
.link-avatar-text {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; font-weight: 700;
}
.link-info {
  flex: 1; min-width: 0;
  position: relative; z-index: 2;
}
.link-name {
  font-size: 14px; font-weight: 700; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: color .15s;
  line-height: 1.4;
}
.link-card:hover .link-name {
  color: var(--accent);
}
.link-desc {
  font-size: 12px; color: var(--text-light);
  margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  line-height: 1.4;
}
.link-meta {
  display: flex; align-items: center; gap: 8px;
  margin-top: 5px;
}
.link-category-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-weight: 500;
}
.link-category-tag i {
  font-size: 9px; opacity: 0.7;
}
.link-status {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  vertical-align: middle; margin-left: 2px;
  transition: all .3s;
  background: rgba(0,0,0,0.03);
  color: var(--text-light);
}
html.dark .link-status {
  background: rgba(255,255,255,0.04);
}
.link-status::before {
  content: ''; width: 6px; height: 6px;
  border-radius: 50%; background: #9ca3af;
  flex-shrink: 0; transition: background .3s;
}
.link-status.checking {
  color: var(--text-light);
}
.link-status.checking::before {
  width: 10px; height: 10px;
  border: 2px solid #e5e7eb;
  border-top-color: var(--accent);
  border-radius: 50%;
  background: transparent;
  animation: linkCheckSpin 0.8s linear infinite;
}
@keyframes linkCheckSpin {
  to { transform: rotate(360deg); }
}
.link-status.online {
  color: #059669;
  background: rgba(16,185,129,0.08);
}
.link-status.online::before {
  background: #10b981;
  box-shadow: 0 0 4px rgba(16,185,129,0.35);
}
.link-status.offline {
  color: #b91c1c;
  background: rgba(239,68,68,0.08);
}
.link-status.offline::before {
  background: #ef4444;
  box-shadow: 0 0 4px rgba(239,68,68,0.3);
}
.link-external-icon {
  flex-shrink: 0;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-light);
  font-size: 12px;
  border-radius: 6px;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  transition: all .2s;
  position: relative; z-index: 2;
  opacity: 0.5;
}
.link-card:hover .link-external-icon {
  opacity: 1;
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(39,92,234,0.2);
}
.links-empty {
  text-align: center; color: var(--text-secondary);
  padding: 40px 20px; font-size: 14px;
}
@media (max-width: 768px) {
  .links-grid { grid-template-columns: 1fr; }
  .links-category-tabs { gap: 6px; }
}
.album-grid {
  column-count: 2;
  column-gap: 14px;
}
.album-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.5);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: inherit;
  transition: all .25s; position: relative;
  break-inside: avoid;
  margin-bottom: 12px;
  display: inline-block;
  width: 100%;
  opacity: 0;
  transform: translateY(30px);
}
.album-card.card-visible {
  animation: albumFadeIn .5s ease forwards;
}
@keyframes albumFadeIn {
  to { opacity: 1; transform: translateY(0); }
}
.album-card::before {
  content: ''; position: absolute; inset: 0;
  border-radius: inherit;
  background: var(--glass-highlight); z-index: 0;
  pointer-events: none !important;
}
.album-card:hover {
  background: var(--glass-bg-strong);
  box-shadow: var(--shadow-md);
  border-color: rgba(255,255,255,0.7);
}
html.dark .album-card:hover { box-shadow: var(--shadow-md); border-color: rgba(255,255,255,0.1); }
.album-cover {
  overflow: hidden; position: relative;
  background: rgba(0,0,0,0.04); z-index: 1;
}
/* 瀑布流：交替不同高度 */
.album-card:nth-child(4n+1) .album-cover { aspect-ratio: 4/3; }
.album-card:nth-child(4n+2) .album-cover { aspect-ratio: 3/4; }
.album-card:nth-child(4n+3) .album-cover { aspect-ratio: 1/1; }
.album-card:nth-child(4n+4) .album-cover { aspect-ratio: 16/10; }
.album-cover img {
  width: 100%; height: 100%; object-fit: cover;
}
.album-cover-empty {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-light); font-size: 28px;
}
.album-count {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.5); color: #fff;
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600;
  backdrop-filter: blur(8px);
  z-index: 2;
}
.album-count i { margin-right: 4px; font-size: 10px; }
.album-info {
  padding: 12px 14px; position: relative; z-index: 2;
}
.album-title {
  display: block; font-size: 14px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-bottom: 4px;
}
.album-card:hover .album-title { color: var(--accent); }
.album-meta {
  display: block; font-size: 11px; color: var(--text-light);
}
@media (max-width: 768px) {
  .album-grid { column-count: 1; }
}
.friends-feed { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.friends-empty { text-align: center; padding: 40px 20px; grid-column: 1 / -1; }
.friends-empty i { font-size: 32px; display: block; margin-bottom: 12px; color: var(--text-light); }
.friend-feed-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 16px 18px; transition: all .2s;
}
.friend-feed-card:hover {
  background: var(--glass-bg-strong);
  box-shadow: var(--shadow-md);
  border-color: rgba(255,255,255,0.7);
}
html.dark .friend-feed-card:hover { box-shadow: var(--shadow-md); border-color: rgba(255,255,255,0.1); }
.friend-feed-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.friend-feed-avatar {
  flex-shrink: 0; width: 36px; height: 36px;
  border-radius: 50%; overflow: hidden;
  background: var(--glass-bg-strong);
}
.friend-feed-avatar-img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; display: block; }
.friend-feed-avatar-text {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 700;
}
.friend-feed-info { flex: 1; min-width: 0; }
.friend-feed-name {
  font-size: 14px; font-weight: 600; color: var(--text);
}
.friend-feed-desc {
  font-size: 11px; color: var(--text-light); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.friend-feed-visit {
  flex-shrink: 0; padding: 4px 12px; border-radius: var(--radius-pill);
  font-size: 12px; color: var(--accent); text-decoration: none;
  border: 1px solid var(--accent); transition: all .15s;
}
.friend-feed-visit:hover { background: var(--accent); color: #fff; }
.friend-feed-posts { display: flex; flex-direction: column; }
.friend-feed-divider { height: 1px; background: var(--border); margin: 6px 0; }
.friend-feed-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 6px 0; text-decoration: none; transition: all .15s;
}
.friend-feed-dot {
  flex-shrink: 0; width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent);
  opacity: 0.4; margin-top: 8px;
}
.friend-feed-item:hover .friend-feed-dot { opacity: 1; }
.friend-feed-item-content { flex: 1; min-width: 0; }
.friend-feed-item-title {
  font-size: 14px; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.6; transition: color .15s;
}
.friend-feed-item:hover .friend-feed-item-title { color: var(--accent); }
.friend-feed-item-desc {
  font-size: 12px; color: var(--text-light); margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.5;
}
.friend-feed-item-date { font-size: 11px; color: var(--text-light); margin-top: 2px; }
.friend-feed-no-posts { font-size: 13px; color: var(--text-light); text-align: center; padding: 12px; }
.article { margin-bottom: 16px; }
@keyframes headIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
/* 阅读进度条（E）：顶部细线，复用 #feed 滚动，由 updateScrollUI 驱动。
   元素由 JS 注入到 <body>（而非 .shell 内），故 fixed 相对真视口、top:0 就是窗口顶端；
   若日后改挂到 .shell 内，会因 .shell 的 backdrop-filter 改为相对 .shell 定位。 */
#readingBar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 9999; pointer-events: none; }
#readingBarFill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-hover)); transition: width .12s linear; }
#readerDock.visible .reader-bar-inner { transform: translateY(0); opacity: 1; }
/* ── 文章页作者栏 ── */
.article-author-bar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px; padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.article-author-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.article-author-name {
  font-size: 14px; font-weight: 600; color: var(--text);
}
.article-content .photo-grid p { margin: 0; }
/* ═══ 标题层级 ═══ */
.article-content h2 {
  font-size: 22px; font-weight: 700; color: var(--text);
  margin: 28px 0 12px; padding: 0;
  position: relative; line-height: 1.45;
  letter-spacing: -0.01em;
  display: inline-block;
  background: linear-gradient(var(--accent), var(--accent)) no-repeat;
  background-size: 100% 2px;
  background-position: bottom;
  padding-bottom: 6px;
}
.article-content h2:first-child { margin-top: 0; }
.article-content h3 {
  font-size: 18px; font-weight: 600; color: var(--text);
  margin: 24px 0 10px; padding: 6px 0 6px 16px;
  position: relative; line-height: 1.5;
  background: linear-gradient(90deg, var(--accent-soft) 0%, transparent 100%);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}
.article-content h3::before {
  content: '';
  position: absolute; left: 0; top: 10px; bottom: 10px;
  width: 3px; border-radius: 2px;
  background: var(--accent);
}
.article-content h4 {
  font-size: 16px; font-weight: 600; color: var(--text-secondary);
  margin: 20px 0 8px;
}
/* 代码块 */
.article-content pre {
  background: var(--accent-soft);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0; margin: 16px 0;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  position: relative;
}
.article-content pre::before {
  content: ''; display: block;
  height: 38px;
  background: rgba(0,0,0,0.03);
  border-bottom: 1px solid var(--glass-border);
  background-image: radial-gradient(circle, #ef4444 5px, transparent 5px),
                    radial-gradient(circle, #eab308 5px, transparent 5px),
                    radial-gradient(circle, #22c55e 5px, transparent 5px);
  background-size: 12px 12px;
  background-position: 16px center, 32px center, 48px center;
  background-repeat: no-repeat;
}
html.dark .article-content pre::before {
  background-color: rgba(255,255,255,0.04);
  border-bottom-color: rgba(255,255,255,0.06);
}
.article-content pre code {
  display: block; padding: 18px 22px;
  overflow-x: auto; font-size: 13.5px; line-height: 1.75;
  color: var(--text-secondary);
}
.article-content pre code .hljs-keyword,
.article-content pre code .hljs-attr,
.article-content pre code .hljs-tag { color: var(--accent); }
.article-content pre code .hljs-string,
.article-content pre code .hljs-value { color: #059669; }
html.dark .article-content pre {
  background: var(--accent-soft);
  border-color: var(--glass-border);
}
.article-content code { font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace; font-size: 13.5px; }
.article-content :not(pre) > code {
  background: var(--accent-soft); color: var(--accent);
  padding: 2px 7px; border-radius: var(--radius-xs); font-size: 0.88em;
  font-weight: 500;
  border: 1px solid rgba(39,92,234,0.12);
}
/* 引用块 */
.article-content blockquote {
  border-left: none; padding: 18px 20px 18px 40px;
  margin: 16px 0;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  position: relative; overflow: hidden;
  border: 1px solid var(--glass-border);
  font-size: 15px; line-height: 1.8;
}
.article-content blockquote::before {
  content: '\201C';
  position: absolute; top: 4px; left: 10px;
  font-size: 42px; font-family: Georgia, serif;
  color: var(--accent); opacity: 0.3;
  line-height: 1;
}
.article-content blockquote p { margin-bottom: 8px; }
.article-content blockquote p:last-child { margin-bottom: 0; }
/* 列表 */
.article-content ul, .article-content ol { padding-left: 28px; margin-bottom: 16px; }
.article-content ul { list-style: none; }
.article-content ul > li { position: relative; padding-left: 4px; margin-bottom: 8px; line-height: 1.8; }
.article-content ul > li::before {
  content: ''; position: absolute; left: -20px; top: 10px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); opacity: 0.6;
}
.article-content ol { list-style: none; counter-reset: list-counter; }
.article-content ol > li { position: relative; padding-left: 4px; margin-bottom: 8px; counter-increment: list-counter; }
.article-content ol > li::before {
  content: counter(list-counter);
  position: absolute; left: -26px;
  top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-size: 11px; font-weight: 600;
  text-align: center; line-height: 18px;
}
.article-content li { margin-bottom: 8px; line-height: 1.8; }
.article-content li ul, .article-content li ol { margin-top: 8px; margin-bottom: 4px; }
.article-content a {
  color: var(--accent); text-decoration: none;
  background: linear-gradient(to right, var(--accent), var(--accent)) no-repeat;
  background-size: 0% 1.5px;
  background-position: left bottom;
  transition: background-size .3s ease, color .2s;
  padding-bottom: 2px;
  font-weight: 500;
}
.article-content a:hover {
  background-size: 100% 1.5px;
  color: var(--accent-hover);
}
/* 表格 */
.article-content .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 20px 0; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.article-content .table-wrap::-webkit-scrollbar { height: 4px; }
.article-content .table-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.article-content table { width: 100%; border-collapse: collapse; font-size: 14px; }
.article-content .table-wrap table { margin: 0; border: none; min-width: auto; }
.article-content th, .article-content td { padding: 11px 16px; border: 1px solid var(--border); text-align: left; }
.article-content th {
  background: linear-gradient(135deg, var(--accent-soft), var(--glass-bg));
  font-weight: 600; color: var(--accent);
  font-size: 13px; letter-spacing: 0.3px;
}
.article-content tr:nth-child(even) { background: rgba(0,0,0,0.015); }
html.dark .article-content tr:nth-child(even) { background: rgba(255,255,255,0.02); }
.article-content tr:hover { background: var(--accent-soft); }
/* 分割线 */
.article-content hr {
  border: none; margin: 24px auto;
  width: 60%; height: 1px;
  background: linear-gradient(to right, transparent, var(--border), var(--accent-soft), var(--border), transparent);
}
.photo-grid.g1 { grid-template-columns: 1fr; max-width: 500px; }
.photo-grid.g2 { grid-template-columns: 1fr 1fr; }
.photo-grid.g3 { grid-template-columns: 1fr 1fr 1fr; }
.photo-grid.g4 { grid-template-columns: 1fr 1fr; }
.photo-grid.g5, .photo-grid.g6 { grid-template-columns: 1fr 1fr 1fr; }
.photo-single { margin: 20px 0; cursor: pointer; }
.photo-single img { width: 100%; border-radius: var(--radius-sm); margin: 0; }
/* ── 代码块复制按钮 ── */
.code-copy-btn {
  position: absolute; top: 7px; right: 10px;
  width: 24px; height: 24px;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs); color: var(--text-light);
  cursor: pointer; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s; z-index: 2; opacity: 0;
}
.article-content pre:hover .code-copy-btn { opacity: 1; }
.code-copy-btn:hover { background: var(--glass-bg-strong); color: var(--text); }
.code-copy-btn.copied { background: rgba(34,197,94,0.12); color: #22c55e; border-color: rgba(34,197,94,0.25); }
/* ── 图片悬停背景 ── */
.img-cell:hover, .photo-item:hover, .album-cover:hover {
  background: linear-gradient(135deg, rgba(0,0,0,0.03), rgba(0,0,0,0.06));
}
html.dark .img-cell, html.dark .photo-item, html.dark .album-cover {
  background: linear-gradient(135deg, rgba(255,255,255,0.03), rgba(255,255,255,0.06));
}
/* ── 404 页面 ── */
.error-page {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 60vh; text-align: center; padding: 40px 20px;
  animation: cardFadeIn 0.5s ease both;
}
.error-code {
  font-size: 120px; font-weight: 800; color: var(--accent); opacity: 0.15;
  line-height: 1; margin-bottom: -20px; letter-spacing: -4px;
  animation: errorFloat 3s ease-in-out infinite;
}
.error-title {
  font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 10px;
}
.error-desc {
  font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; max-width: 360px; line-height: 1.7;
}
.error-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 24px; border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff; font-size: 14px; font-weight: 500;
  text-decoration: none; transition: all .2s;
  box-shadow: 0 2px 12px var(--accent-glow);
}
.error-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 20px var(--accent-glow); }
/* ── 图片说明文字 ── */
.article-content figcaption {
  text-align: center; font-size: 13px; color: var(--text-light);
  margin-top: -12px; margin-bottom: 20px; padding: 0 8px;
}
.article-content figure { margin: 20px 0; }
.article-content figure img { margin: 0; }
/* ── 留言板分隔线 ── */
.pg-leaderboard + #comments {
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
/* ── 搜索关键词高亮 ── */
.search-highlight { background: rgba(39,92,234,0.15); color: var(--accent); padding: 1px 3px; border-radius: 3px; font-weight: 500; }
.pagination .dots { color: var(--text-light); font-size: 12px; width: 20px; text-align: center; }
.toc-head {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
  color: var(--text-light); text-transform: uppercase;
  margin: 2px 0 8px;
}
.toc-head i { color: var(--accent); font-size: 13px; }
.toc-list {
  position: relative;
  padding: 2px 0;
}
.toc-item {
  display: block;
  position: relative;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 5px 10px 5px 14px;
  margin: 1px 0;
  border-left: 2px solid var(--border);
  border-radius: 0 6px 6px 0;
  text-decoration: none;
  line-height: 1.5;
  transition: color .15s, border-color .15s, background .15s;
}
.toc-item.toc-h3 {
  padding-left: 30px;
  font-size: 12.5px;
}
/* 折叠式大纲：非当前章节的 h3 子级收起（由 initTOC 的 updateActive 维护） */
.toc-item.toc-folded { display: none; }
.toc-item:hover {
  color: var(--text);
  background: rgba(0,0,0,0.04);
}
html.dark .toc-item:hover {
  background: rgba(255,255,255,0.04);
}
.toc-item.active {
  color: var(--accent);
  font-weight: 600;
  border-left-color: var(--accent);
  background: linear-gradient(90deg, var(--accent-soft), transparent);
}
/* ── 文章目录：「独立悬浮面板」（复刻 sspai）──
   目录脱离文章栅格，position:fixed 垂直居中悬浮在内容框右侧留白处
   （面板中线恒在屏幕中线）。
   ⚠️ fixed 是否相对真视口，取决于祖先是否带 backdrop-filter：`.shell` 带 `.glass`
   （毛玻璃），但 `@media (min-width:921px)` 内已把 `.shell`（及 `.topbar`/`.sidebar`）
   的 backdrop-filter 置为 none，故桌面端 fixed 相对真视口成立。若日后恢复 `.shell`
   毛玻璃，必须把 `.toc-wrap` append 到 body，否则 fixed 会改为相对 `.shell` 定位。
   带 TOC 的文章页内容栏放宽到 688（补偿 .content-scroll 左右 padding 24×2），
   使正文精确 640；悬浮断点 1240 保证目录(220+28)不与 640 正文重叠。
   弱化存在感：默认半透明无卡片感，hover/focus 时才完全显示。 */
@media (min-width: 921px) {
  .content-inner:has(.article.has-toc) { max-width: 688px; }
}
@media (min-width: 1240px) {
  .article.has-toc > .toc-wrap .toc-item {
    opacity: .5;
    transition: opacity .25s ease, color .15s, border-color .15s, background .15s;
  }
  .article.has-toc > .toc-wrap .toc-head {
    opacity: .55; transition: opacity .25s ease;
  }
  .article.has-toc > .toc-wrap:hover .toc-item,
  .article.has-toc > .toc-wrap:focus-within .toc-item,
  .article.has-toc > .toc-wrap .toc-item.active { opacity: 1; }
  .article.has-toc > .toc-wrap:hover .toc-head,
  .article.has-toc > .toc-wrap:focus-within .toc-head { opacity: 1; }
}
.cmt-list { list-style: none; padding: 0; margin: 0; }
.cmt-item { list-style: none; }
.cmt-is-child { margin-left: 0; }
/* ── 主评论卡片 ── */
.cmt-card {
  display: flex; gap: 10px;
  padding: 12px 14px;
  align-items: flex-start;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  margin-bottom: 8px;
  transition: background .2s;
}
.cmt-card:hover { background: var(--glass-bg-strong); }
/* 刚发布的评论高亮（发布后刷新定位到该条）
   注意：本规则会覆盖 .card-visible 的 cardFadeIn 动画，必须显式补 opacity:1/transform:none，
   否则会退回 .cmt-card 的 opacity:0，出现“跳到空白处、看不见新评论”的假象。 */
.cmt-card.cmt-new {
  border-color: var(--accent);
  opacity: 1;
  transform: none;
  animation: cmtFlash 2.2s ease;
}
@keyframes cmtFlash {
  0%   { background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-glow); }
  100% { background: var(--glass-bg); box-shadow: none; }
}
.cmt-list > .cmt-item:last-child > .cmt-children:last-child .cmt-card:last-child { margin-bottom: 0; }
.cmt-list > .cmt-item:last-child > .cmt-card:last-child { margin-bottom: 0; }
/* 子评论 - 紧凑内联 */
.cmt-is-child .cmt-card {
  padding: 8px 12px;
  border: none;
  background: transparent;
  margin-bottom: 4px;
  gap: 8px;
}
.cmt-is-child .cmt-card:hover { background: transparent; }
.cmt-avatar-col { flex-shrink: 0; }
.cmt-avatar {
  width: 32px; height: 32px;
  border-radius: 50%; object-fit: cover;
  display: block; background: var(--glass-bg);
}
.cmt-is-child .cmt-avatar { width: 22px; height: 22px; }
.cmt-body { flex: 1; min-width: 0; }
/* 头部：名字 + 标签 + 时间 一行 */
.cmt-header {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 2px;
  flex-wrap: wrap;
}
.cmt-user { display: inline-flex; align-items: center; gap: 5px; }
.cmt-name {
  font-size: 13px; font-weight: 600; color: var(--text);
  line-height: 1.2;
}
.cmt-is-child .cmt-name { font-size: 12px; }
.cmt-is-child .cmt-name::before {
  content: '\f3e5';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 9px;
  color: var(--text-light);
  margin-right: 3px;
  opacity: 0.5;
}
.cmt-name a { color: var(--text); text-decoration: none; transition: color .15s; }
.cmt-name a:hover { color: var(--accent); }
.cmt-tag {
  display: inline-block;
  padding: 0 5px; font-size: 10px; font-weight: 600;
  border-radius: 3px; line-height: 1.6;
}
.cmt-tag-admin { background: var(--accent-soft); color: var(--accent); }
.cmt-tag-friend { background: rgba(245,158,11,0.1); color: #D97706; }
html.dark .cmt-tag-friend { background: rgba(251,191,36,0.12); color: #FBBF24; }
.cmt-tag-lv { background: rgba(16,185,129,0.08); color: #059669; }
.cmt-time {
  font-size: 11px; color: var(--text-light);
  margin-left: auto;
  flex-shrink: 0;
}
.cmt-is-child .cmt-time { font-size: 10px; margin-left: 0; }
/* ── 评论正文 ── */
.cmt-text {
  font-size: 13px; line-height: 1.65;
  color: var(--text);
  margin-bottom: 4px;
  word-break: break-word; overflow-wrap: break-word;
}
.cmt-is-child .cmt-text {
  font-size: 13px; line-height: 1.65;
  margin-bottom: 4px;
  color: var(--text-secondary);
}
.cmt-text a { color: var(--accent); text-decoration: none; }
.cmt-text a:hover { text-decoration: underline; }
.cmt-text img { max-width: 100%; height: auto; border-radius: var(--radius-xs); margin: 4px 0; }
.cmt-text p { margin: 0 0 6px; }
.cmt-text p:last-child { margin-bottom: 0; }
.cmt-text code {
  background: rgba(39,92,234,0.06); padding: 1px 5px; border-radius: 3px;
  font-size: 12px; font-family: 'SF Mono', Monaco, Consolas, monospace;
}
html.dark .cmt-text code { background: rgba(39,92,234,0.16); }
.cmt-text pre {
  background: rgba(39,92,234,0.04); padding: 10px 12px; border-radius: var(--radius-xs);
  overflow-x: auto; margin: 6px 0; font-size: 12px;
  line-height: 1.6; font-family: 'SF Mono', Monaco, Consolas, monospace;
}
html.dark .cmt-text pre { background: rgba(39,92,234,0.08); }
.cmt-text pre code { background: none; padding: 0; }
.cmt-text blockquote {
  margin: 6px 0; padding: 6px 12px;
  border-left: 2px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  color: var(--text-secondary); font-size: 12px;
}
/* ── 操作栏 ── */
.cmt-actions {
  display: flex; align-items: center; gap: 8px;
}
.cmt-reply-btn {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; color: var(--text-light);
  padding: 1px 6px; border-radius: 3px;
  transition: all .2s; cursor: pointer;
  text-decoration: none;
}
.cmt-reply-btn:hover {
  color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}
.cmt-reply-btn i { font-size: 10px; }
.cmt-device {
  font-size: 10px; color: var(--text-light); opacity: 0.4;
  display: inline-flex; align-items: center; gap: 3px;
}
.cmt-device i { font-size: 9px; }
.cmt-children {
  padding: 0 0 0 28px;
  margin: 4px 0 0 0;
  border: none;
  overflow: hidden;
}
.cmt-children .cmt-children {
  padding-left: 0;
}
.cmt-reply-bar strong {
  color: var(--text);
  font-weight: 600;
}
/* 已登录状态 */
.cmt-logged {
  padding: 10px 16px;
  font-size: 12px; color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.cmt-logged strong { color: var(--text); }
.cmt-logged a { color: var(--accent); margin-left: 6px; font-size: 11px; text-decoration: none; }
.cmt-logged a:hover { text-decoration: underline; }
.cmt-closed { text-align: center; color: var(--text-light); padding: 24px; font-size: 14px; }
.cmt-closed i { margin-right: 6px; }
/* Toast */
.toast-notification {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  padding: 16px 28px;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(24px) saturate(1.8);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 500; color: var(--text);
  z-index: 10000; opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
}
.toast-notification::before {
  content: ''; position: absolute; inset: 0;
  border-radius: inherit; pointer-events: none;
  background: var(--glass-highlight); z-index: 0;
}
.toast-notification i, .toast-notification span { position: relative; z-index: 1; }
.toast-show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.toast-success i { color: #10b981; font-size: 18px; }
.toast-error i { color: #ef4444; font-size: 18px; }
@media (max-width: 920px) {
  .page { width: 100%; padding: 0; border-radius: 0; }
  .shell { border-radius: 0; }
  .content-inner { border-left: none; }
  .orb { filter: blur(40px); opacity: 0.15; }
  .bottom-bar { display: none; }
  /* 移动端顶栏隐藏「足迹」入口（桌面端保留） */
  .topbar-footprint { display: none !important; }
  .sidebar {
    display: flex; position: fixed; top: 0; left: 0; bottom: 0;
    width: 260px; z-index: 200;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(28px) saturate(1.8);
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    will-change: transform;
    padding-top: 16px;
    box-shadow: none;
    overflow-y: auto;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  }
  .hamburger { display: flex; }
  .sidebar-overlay {
    display: none; position: fixed; inset: 0; z-index: 199;
    background: rgba(0,0,0,0.3);
    opacity: 0; pointer-events: none;
    transition: opacity .3s;
    will-change: opacity;
    -webkit-tap-highlight-color: transparent;
  }
  .sidebar-overlay.active { opacity: 1; pointer-events: auto; }
  .sidebar-mobile-header {
    display: flex; align-items: center; justify-content: flex-end;
    padding: 14px 18px;
    min-height: 48px; position: relative;
  }
  .sidebar-close {
    display: flex; position: relative; top: auto; right: auto;
    width: 32px; height: 32px; border: none; background: rgba(0,0,0,0.06);
    border-radius: 50%; cursor: pointer; align-items: center; justify-content: center;
    color: var(--text-secondary); font-size: 14px; transition: all .15s;
  }
  .sidebar-close:hover { background: rgba(0,0,0,0.12); color: var(--text); }
  html.dark .sidebar-close { background: rgba(255,255,255,0.08); }
  html.dark .sidebar-close:hover { background: rgba(255,255,255,0.15); }
  .sidebar-footer {
    display: flex; align-items: center; gap: 8px;
    margin-top: auto; padding: 14px 20px;
    font-size: 11px; color: var(--text-light);
    border-top: 1px solid var(--glass-border);
    flex-wrap: wrap;
  }
  .sidebar-footer a { color: var(--text-secondary); text-decoration: none; }
  .sidebar-footer a:hover { color: var(--accent); }
  .sidebar-footer .dot {
    width: 3px; height: 3px; flex-shrink: 0;
    border-radius: 50%; background: var(--text-light);
  }
  .topbar { height: 56px; min-height: 56px; padding: 0 12px; }
  .topbar-center { display: flex; position: absolute; left: 50%; transform: translateX(-50%); align-items: center; gap: 8px; max-width: calc(100% - 200px); justify-content: center; }
  /* 移动端隐藏搜索相关（仅搜索框与其放大镜图标），不要写成 .topbar-center i —— 会连
     文章条的图标一起隐藏，从而要在别处再 !important 救回 */
  .topbar-center .topbar-search-form,
  .topbar-center .topbar-search-form i,
  .topbar-search { display: none !important; }
  .topbar-center .m-brand { display: inline-flex !important; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
  .topbar-center .m-brand:hover { opacity: .8; }
  .topbar-center .m-brand-logo-img { display: block !important; height: 28px; width: auto; border-radius: var(--radius-xs); }
  .topbar-center .m-brand-icon {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    border-radius: var(--radius-sm);
    align-items: center; justify-content: center;
    color: #fff; font-size: 14px; font-weight: 700;
  }
  .topbar-center .m-brand-name { font-size: 15px; font-weight: 700; color: var(--text); }
  .hamburger { flex-shrink: 0; }
  .topbar-spacer { display: none; }
  .topbar-actions { flex-shrink: 0; margin-left: auto; }
  .mobile-search:focus-within {
    border-color: var(--accent);
    background: rgba(255,255,255,0.7);
    box-shadow: 0 2px 12px var(--accent-glow);
  }
  html.dark .mobile-search:focus-within {
    border-color: var(--accent);
    background: rgba(255,255,255,0.1);
    box-shadow: 0 2px 12px var(--accent-glow);
  }
  .topbar-brand .brand-name { display: none; }
  .topbar-brand .brand-icon { display: none; }
  .topbar-brand { display: none; }
  .content-scroll { padding: 4px 14px 32px; scrollbar-width: none; }
  .content-scroll::-webkit-scrollbar { display: none; }
  .sidebar { scrollbar-width: none; }
  .sidebar::-webkit-scrollbar { display: none; }
  .post-card-simple { padding: 16px; gap: 12px; margin-bottom: 10px; }
  .sticky-wrap { grid-template-columns: 1fr !important; }
  .pcs-title { font-size: 15px; }
  .pcs-excerpt { font-size: 12px; margin-bottom: 8px; }
  .img-grid.g3 { max-width: 100%; grid-template-columns: 1fr 1fr 1fr; }
  .img-grid.g3 .img-cell:first-child { grid-column: auto; aspect-ratio: 1; }
  .bottom-bar { height: 36px; min-height: 36px; gap: 10px; font-size: 10px; }
  .friends-feed { grid-template-columns: 1fr; }
  .article-content h2 { font-size: 19px; margin: 32px 0 14px; }
  .article-content h3 { font-size: 17px; margin: 26px 0 12px; }
  .article-content h4 { font-size: 15px; margin: 22px 0 10px; }
  .photo-grid.g3 { grid-template-columns: 1fr 1fr; }
  .photo-grid.g3 .photo-item:first-child { grid-column: 1 / -1; aspect-ratio: 2/1; }
  .photo-grid.g5, .photo-grid.g6 { grid-template-columns: 1fr 1fr; }
  .cmt-children { padding-left: 20px; margin-top: 4px; }
  .cmt-children .cmt-children { padding-left: 0; }
  html.dark .sidebar {
    background: rgba(17,18,23,0.92);
  }
}
/* ── 文章内容瀑布流动画 ── */
@keyframes waterfallIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.article-content > *:nth-child(7)  { animation-delay: 0.24s; }
.article-content > *:nth-child(8)  { animation-delay: 0.28s; }
.article-content > *:nth-child(9)  { animation-delay: 0.32s; }
.article-content > *:nth-child(10) { animation-delay: 0.36s; }
.article-content > *:nth-child(11) { animation-delay: 0.40s; }
.article-content > *:nth-child(12) { animation-delay: 0.44s; }
.article-content > *:nth-child(n+13) { animation-delay: 0.48s; }
@media (max-width: 380px) {
  .topbar-center { margin: 0 4px; }
  .topbar-actions { gap: 2px; }
  .topbar-btn { width: 30px; height: 30px; font-size: 13px; }
  #themeToggle { width: 27px; height: 27px; }
  .scroll-progress-btn .scroll-progress-ring { width: 30px; height: 30px; }
  .scroll-progress-btn .scroll-progress-text { font-size: 8px; }
}
/* Heading scroll margin */
.article-content h2[id], .article-content h3[id] { scroll-margin-top: 20px; }
/* Standalone page responsive images */
.standalone-page .article-content img { max-width: 100%; height: auto; }
.like-btn.animating i { animation: likeHeart 0.5s ease; }
.like-btn.animating .like-float-heart {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  font-size: 20px; color: #ef4444; pointer-events: none;
  animation: likeFloat 0.8s ease forwards;
}
@keyframes likeHeart { 0% { transform: scale(1); } 25% { transform: scale(1.3); } 50% { transform: scale(0.9); } 100% { transform: scale(1); } }
@keyframes likeFloat { 0% { opacity: 1; transform: translateX(-50%) translateY(0); } 100% { opacity: 0; transform: translateX(-50%) translateY(-40px); } }
/* ══════════════════════════════════════
   相册移动端两列瀑布流
   ══════════════════════════════════════ */
@media (max-width: 768px) {
  .album-grid { column-count: 2; column-gap: 10px; }
  .album-card { margin-bottom: 10px; }
}
@media (max-width: 400px) {
  .album-grid { column-count: 1; }
}
/* ══════════════════════════════════════
   404 搜索框 + 返回按钮
   ══════════════════════════════════════ */
.error-search {
  display: flex; align-items: center;
  max-width: 320px; width: 100%; margin: 16px auto 20px;
  position: relative; background: var(--glass-bg);
  border: 1px solid var(--glass-border); border-radius: var(--radius-pill);
  padding: 0 16px; height: 40px; gap: 8px;
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: all .25s;
  animation: cardFadeIn 0.5s ease both; animation-delay: 0.15s;
}
.error-search:focus-within {
  border-color: rgba(39,92,234,0.4);
  background: var(--glass-bg-strong);
  box-shadow: 0 2px 12px rgba(39,92,234,0.1);
}
.error-search i {
  color: var(--text-light); font-size: 13px; flex-shrink: 0;
}
.error-search input {
  flex: 1; border: none; background: transparent;
  font-size: 13px; color: var(--text); outline: none;
  height: 100%;
}
.error-search input::placeholder { color: var(--text-secondary); }
.error-actions {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  animation: cardFadeIn 0.5s ease both; animation-delay: 0.25s;
}
.error-btn-outline {
  background: var(--glass-bg) !important;
  color: var(--text-secondary) !important;
  border: 1px solid var(--glass-border);
  box-shadow: none !important;
}
.error-btn-outline:hover {
  background: var(--glass-bg-strong) !important;
  color: var(--accent) !important;
  border-color: rgba(39,92,234,0.3);
}
/* ══════════════════════════════════════
   首页点赞按钮已赞状态
   ══════════════════════════════════════ */
.like-action.liked {
  color: var(--accent) !important;
}
.like-action.liked i {
  color: var(--accent);
}
/* 404 微动画：animation 声明已并入上方 .error-* 定义，此处仅保留关键帧 */
@keyframes errorFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
/* ══════════════════════════════════════
   深色模式过渡（不影响 transform 动画）
   ══════════════════════════════════════ */
body,
.glass, .shell, .topbar, .bottom-bar,
.post-card, .post-card-simple, .hitokoto-banner,

.album-card, .friend-feed-card, .link-card,
.nav-item, .pg-leaderboard, .error-page,
.lightbox,
.article-meta-item, .cmt-device,
.pagination a, .pagination span, .pagination .prev {
  transition: color .2s, background .2s, border-color .2s, box-shadow .2s;
}
/* ── 个人资料卡片 ── */
.pg-profile-card {
  padding: 24px;
}
.pg-profile-top {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 16px;
}
.pg-profile-avatar {
  width: 60px; height: 60px; flex-shrink: 0;
  border-radius: 50%; overflow: hidden;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px var(--accent-glow);
}
.pg-profile-avatar img {
  width: 60px; height: 60px; border-radius: 50%; object-fit: cover; display: block;
}
.pg-profile-avatar span {
  font-size: 26px; font-weight: 700; color: #fff;
}
.pg-profile-info { flex: 1; min-width: 0; }
.pg-profile-name {
  font-size: 20px; font-weight: 700; color: var(--text);
  margin-bottom: 4px;
}
.pg-profile-bio {
  font-size: 13px; color: var(--text-secondary); line-height: 1.6;
}
.pg-profile-bottom {
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.pg-profile-links {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.pg-profile-links a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px; color: var(--text-secondary);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all .2s;
}
.pg-profile-links a:hover {
  color: var(--accent); border-color: var(--accent);
  background: var(--accent-soft);
}
.pg-profile-links a i { font-size: 11px; }
/* ── 数据统计 ── */
.pg-stats-card {
  display: flex; align-items: center;
  padding: 18px 22px;
  gap: 0;
}
.pg-stat {
  flex: 1; text-align: center;
  padding: 4px 0;
}
.pg-stat-divider {
  width: 1px; height: 28px;
  background: var(--border);
  flex-shrink: 0;
}
.pg-stat b {
  display: block;
  font-size: 24px; font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}
.pg-stat span {
  font-size: 12px; color: var(--text-light);
}
/* ── 站点信息 ── */
.pg-info-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.pg-info-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  transition: all .2s;
}
.pg-info-item:hover {
  background: var(--glass-bg-strong);
  box-shadow: var(--shadow-md);
}
html.dark .pg-info-item:hover { box-shadow: var(--shadow-md); }
.pg-info-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.pg-info-text { display: flex; flex-direction: column; }
.pg-info-label { font-size: 11px; color: var(--text-light); margin-bottom: 2px; }
.pg-info-value { font-size: 13px; font-weight: 600; color: var(--text); }
@media (max-width: 600px) {
  .pg-info-grid { grid-template-columns: 1fr; }
}
/* ── 建站历程 ── */
.pg-tl {
  padding-left: 20px; position: relative;
}
.pg-tl::before {
  content: ''; position: absolute;
  left: 5px; top: 12px; bottom: 12px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--border));
  border-radius: 2px;
}
.pg-tl-item {
  position: relative;
  padding: 0 0 24px 20px;
}
.pg-tl-item:last-child { padding-bottom: 0; }
.pg-tl-item::before {
  content: ''; position: absolute;
  left: -18px; top: 8px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent-soft), 0 0 8px var(--accent-glow);
}
.pg-tl-head {
  font-size: 15px; font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
}
.pg-tl-item p, .pg-tl-item ul, .pg-tl-item ol {
  font-size: 13px; line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.pg-tl-item p:last-child { margin-bottom: 0; }
.pg-tl-item a { color: var(--accent); text-decoration: none; }
.pg-tl-item a:hover { text-decoration: underline; }
.pg-tl-item img {
  max-width: 100%; border-radius: var(--radius-xs);
  margin: 8px 0; cursor: pointer;
}
.pg-tl-item blockquote {
  margin: 8px 0; padding: 8px 14px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  color: var(--text-secondary); font-size: 13px;
}
.pg-tl-item pre {
  background: rgba(0,0,0,0.04);
  border-radius: var(--radius-xs); padding: 12px;
  overflow-x: auto; font-size: 13px;
}
html.dark .pg-tl-item pre { background: rgba(255,255,255,0.06); }
@media (max-width: 480px) {
  .pg-profile-avatar { width: 48px; height: 48px; }
  .pg-profile-avatar img { width: 48px; height: 48px; }
  .pg-profile-avatar span { font-size: 22px; }
  .pg-profile-name { font-size: 18px; }
  .pg-stat b { font-size: 20px; }
}
/* ══════════════════════════════════════
   归档页面
   ══════════════════════════════════════ */
.pg-arch-list {
  padding-top: 8px;
}
.pg-arch-panel {
  animation: archFadeIn .3s ease;
  position: relative; z-index: 2;
}
@keyframes archFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.pg-arch-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  text-decoration: none; color: inherit;
  transition: background .2s, box-shadow .2s;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  position: relative; z-index: 2;
  opacity: 0; transform: translateY(16px);
}
.pg-arch-row.card-visible {
  animation: cardFadeIn 0.4s ease both;
}
.pg-arch-row:hover {
  background: var(--glass-bg);
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
html.dark .pg-arch-row:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.15); }
.pg-arch-row-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: all .2s;
}
.pg-arch-row:hover .pg-arch-row-dot {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}
.pg-arch-row-date {
  font-size: 13px; color: var(--text-light);
  flex-shrink: 0; min-width: 60px;
  font-weight: 500;
}
.pg-arch-row-title {
  font-size: 14px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; flex: 1;
  transition: color .15s;
  font-weight: 500;
}
.pg-arch-row:hover .pg-arch-row-title { color: var(--accent); }
.pg-arch-row-meta {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
  font-size: 12px; color: var(--text-light);
}
.pg-arch-row-meta i { font-size: 11px; margin-right: 3px; }
.pg-arch-row-meta span {
  display: inline-flex; align-items: center; gap: 2px;
}
/* ── 留言排行榜 ── */
.pg-leaderboard {
  margin-bottom: 16px;
}
.pg-lb-title {
  font-size: 14px; font-weight: 600; color: var(--text);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.pg-lb-title i { color: #D4A84B; font-size: 13px; }
.pg-lb-list {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.pg-lb-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  transition: all .2s;
  opacity: 0; transform: translateY(16px);
}
.pg-lb-item.card-visible {
  animation: cardFadeIn 0.3s ease both;
}
.pg-lb-item:hover {
  background: var(--glass-bg-strong);
  box-shadow: var(--shadow-md);
  border-color: rgba(255,255,255,0.7);
}
html.dark .pg-lb-item { box-shadow: var(--shadow-sm); }
html.dark .pg-lb-item:hover { box-shadow: var(--shadow-md); border-color: rgba(255,255,255,0.1); }
.pg-lb-rank {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  flex-shrink: 0;
  background: var(--glass-bg);
  color: var(--text-light);
}
.pg-lb-rank-1 { background: rgba(234,179,8,0.15); color: #ca8a04; }
.pg-lb-rank-2 { background: rgba(156,163,175,0.15); color: #6b7280; }
.pg-lb-rank-3 { background: rgba(180,83,9,0.15); color: #b45309; }
.pg-lb-avatar {
  width: 28px; height: 28px;
  border-radius: 50%; object-fit: cover;
  flex-shrink: 0;
}
.pg-lb-name {
  font-size: 13px; font-weight: 500; color: var(--text);
  max-width: 100px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.pg-lb-count {
  font-size: 11px; color: var(--text-light);
  flex-shrink: 0;
}
@media (max-width: 480px) {
  .pg-lb-list { flex-direction: column; }
  .pg-lb-item { border-radius: var(--radius-sm); }
  .pg-stats-card { flex-wrap: wrap; }
  .pg-stat { min-width: 45%; }
  .pg-stat-divider { display: none; }
}
/* ══════════════════════════════════════
   更新时间标记
   ══════════════════════════════════════ */
.article-meta-updated {
  color: var(--accent);
}
.article-meta-updated i {
  color: var(--accent);
}
.aic-value > i { color: var(--text-light); font-size: 11px; margin-right: 2px; }
/* 打开动画：只做淡入，不做缩放。
   原先 from{transform:scale(.96)} 会让 getBoundingClientRect 从 96% 爬到 100%（1152px 上
   就是 1105.9→1152，跨 46px），肉眼即「图片跳一下」；且 scale 是非整像素缩放，
   中途文字/边缘会有一帧发虚。淡入本身已足够交代「渐进出现」。 */
@keyframes lbIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.lightbox-close:active, .lightbox-nav:active { transform: translateY(-50%) scale(.92); }
.lightbox-close:active { transform: scale(.92); }
@media (max-width: 640px) {
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
  .lightbox-nav { width: 38px; height: 38px; }
  .lightbox-close { top: 12px; right: 12px; }
}
/* ══════════════════════════════════════
   404 页推荐文章
   ══════════════════════════════════════ */
.error-recommend {
  margin-top: 40px;
  width: 100%;
  max-width: 600px;
}
.error-recommend-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #1f2937);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  justify-content: center;
}
.error-recommend-title i {
  color: var(--accent);
  font-size: 14px;
}
.error-recommend-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.error-recommend-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--glass-bg, rgba(255,255,255,.45));
  backdrop-filter: blur(var(--glass-blur, 20px));
  -webkit-backdrop-filter: blur(var(--glass-blur, 20px));
  border: 1px solid rgba(255,255,255,.2);
  text-decoration: none;
  transition: all .2s;
}
.error-recommend-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  border-color: var(--accent);
}
.error-recommend-cover {
  width: 100%;
  height: 100px;
  overflow: hidden;
}
.error-recommend-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.error-recommend-card:hover .error-recommend-cover img {
  transform: scale(1.05);
}
.error-recommend-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-soft, rgba(39,92,234,.1)), var(--accent-glow, rgba(39,92,234,.25)));
}
.error-recommend-fallback span {
  font-size: 24px;
  font-weight: 600;
  color: var(--accent);
}
.error-recommend-info {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.error-recommend-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary, #1f2937);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.error-recommend-date {
  font-size: 11px;
  color: var(--text-light, #9ca3af);
}
html.dark .error-recommend-card {
  background: rgba(26,29,39,.6);
  border-color: rgba(255,255,255,.06);
}
html.dark .error-recommend-card-title {
  color: #e5e7eb;
}
html.dark .error-recommend-title {
  color: #e5e7eb;
}
@media (max-width: 480px) {
  .error-recommend-grid { grid-template-columns: 1fr; }
}
/* ══════════════════════════════════════
   代码高亮 (highlight.js)
   ══════════════════════════════════════ */
.article-content pre code.hljs {
  padding: 18px 22px;
  background: transparent;
}
html.dark .article-content pre code.hljs {
  background: transparent;
}
/* ══════════════════════════════════════
   布局：左侧导航（本主题唯一布局）
   侧栏固定屏幕最左 · 头部置顶通栏 · 正文 640px 居中
   —— 桌面端（≥921px）生效，≤920px 自动回落为抽屉式侧栏
   ══════════════════════════════════════ */
@media screen and (min-width: 921px) {
  body {
    --ln-topbar-h: 68px;   /* 顶部头部高度 */
    --ln-content-w: 640px; /* 正文字栏宽度 */
    --ln-nav-w: var(--sidebar-w, 230px); /* 左侧导航宽度，沿用「左侧导航宽度」设置 */
  }
  .shell {
    border-radius: 0; border: none;
    background: transparent;
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .topbar {
    height: var(--ln-topbar-h); min-height: var(--ln-topbar-h);
    padding: 0 26px;
    background: var(--glass-bg-strong);
    backdrop-filter: blur(var(--glass-blur)) saturate(1.6);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.6);
    border-bottom: 1px solid var(--glass-border);
    z-index: 30;
  }
  .topbar-brand .brand-icon {
    width: 40px; height: 40px; font-size: 19px; border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px var(--accent-glow);
  }
  .topbar-brand .brand-name { font-size: 17px; }
  .topbar-brand .brand-logo-img { height: 34px; }
  .topbar-search { height: 36px; }
  .topbar-center { max-width: calc(100% - 420px); }
  .main-body { padding-left: var(--ln-nav-w); }
  .sidebar {
    position: fixed; left: 0; top: var(--ln-topbar-h); bottom: 0;
    width: var(--ln-nav-w); min-width: var(--ln-nav-w);
    height: auto;
    z-index: 25;
    background: var(--glass-bg-strong);
    backdrop-filter: blur(var(--glass-blur)) saturate(1.6);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.6);
    border-right: 1px solid var(--glass-border);
    border-radius: 0;
    padding-top: 12px;
    transition: top .3s ease;
  }
  body.tb-hidden .topbar {
    min-height: 0 !important; max-height: 0; height: 0;
    opacity: 0; transform: translateY(-100%); pointer-events: none; overflow: hidden;
  }
  body.tb-hidden .sidebar { top: 0; }
  .sidebar-footer {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin-top: auto; padding: 14px 20px;
    font-size: 11px; color: var(--text-light);
    border-top: 1px solid var(--glass-border);
  }
  .sidebar-footer a { color: var(--text-secondary); text-decoration: none; }
  .sidebar-footer a:hover { color: var(--accent); }
  .sidebar-footer .dot {
    width: 3px; height: 3px; flex-shrink: 0;
    border-radius: 50%; background: var(--text-light);
  }
  .nav-item { padding: 10px 18px; }
  .content-inner {
    width: 100%; max-width: var(--ln-content-w);
    margin: 0 auto; border-left: none;
  }
  .content-scroll {
    padding: 22px 24px 44px;
    /* 隐藏内层滚动条：避免它贴着 640px 正文右缘悬在屏幕中央；
       滚动位置反馈由顶栏圆形进度环（scrollTopBtn）承担 */
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .content-scroll::-webkit-scrollbar { display: none; width: 0; height: 0; }
  .content-scroll .article.standalone-page { margin-top: 200px; }
  .bottom-bar { display: none; }
  .topbar-btn { color: var(--text-secondary); }
}
/* 注：上方 @media(min-width:921px) 即 leftnav 桌面端整体布局（外壳铺满 / 顶栏通栏 /
   左侧导航固定全高 / 正文单栏 640 居中 / 顶栏自动隐藏让位 / 导航项加宽内边距），
   相关的分节说明已内联到各自规则旁，此处不再重复罗列。 */
/* 独立页面（关于/归档/友链/留言板/相册等）标题同样下移，与文章页标题保持同一水平位置 */
/* 底部版权条：该信息已由左侧导航底部承载，隐藏以免重复 */
/* 顶栏按钮在浅色玻璃上更清晰 */
/* ══════════════════════════════════════
   灯箱图片评论（每图独立评论区 · B 方案）
   ══════════════════════════════════════ */
.lightbox-cmt-toggle {
  position: absolute; top: 64px; right: 20px; z-index: 11;
  height: 38px; padding: 0 14px; border: none;
  background: rgba(255,255,255,0.25); color: #fff;
  border-radius: var(--radius-pill); cursor: pointer; font-size: 14px;
  display: flex; align-items: center; gap: 7px;
  transition: background .2s, right .28s ease, bottom .28s ease;
  backdrop-filter: blur(8px);
}
.lightbox-cmt-toggle:hover { background: rgba(255,255,255,0.4); }
.lightbox-cmt-toggle:active { transform: scale(.95); }
.lb-cmt-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  line-height: 18px; text-align: center;
  display: inline-flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
}
/* 侧滑面板（桌面右侧 / 移动端底部抽屉） */
.lightbox-cmt {
  position: absolute; top: 0; right: 0; bottom: 0;
  /* 宽度与 #lightbox 的 --lb-panel-w 同源，窄桌面自动收窄（见 #lightbox 处的 media） */
  width: var(--lb-panel-w, 360px); max-width: 92vw; z-index: 12;
  background: rgba(28,32,38,0.94);
  backdrop-filter: blur(18px);
  border-left: 1px solid rgba(255,255,255,0.12);
  transform: translateX(100%);
  transition: transform .28s ease;
  display: flex; flex-direction: column;
  /* 深色面板局部变量：让复用的 .cmt-* 样式自动适配暗色 */
  --text: #e9edf3;
  --text-light: rgba(233,237,243,0.6);
  --glass-bg: rgba(255,255,255,0.07);
  --glass-bg-strong: rgba(255,255,255,0.13);
  --glass-border: rgba(255,255,255,0.12);
}
.lightbox-cmt.open { transform: translateX(0); }
.lb-cmt-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}
.lb-cmt-title {
  font-size: 14px; font-weight: 700; color: #e9edf3;
  display: flex; align-items: center; gap: 7px;
}
.lb-cmt-title i { color: var(--accent); }
.lb-cmt-title em { font-style: normal; font-weight: 500; font-size: 12px; color: rgba(233,237,243,0.55); }
.lb-cmt-close {
  width: 30px; height: 30px; border: none; border-radius: 50%;
  background: rgba(255,255,255,0.1); color: #e9edf3;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.lb-cmt-close:hover { background: rgba(255,255,255,0.22); }
.lb-cmt-list { flex: 1; overflow-y: auto; padding: 14px; scrollbar-width: thin; }
.lb-cmt-list::-webkit-scrollbar { width: 5px; }
.lb-cmt-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 3px; }
.lb-cmt-list .cmt-text { font-size: 13px; }
.lb-cmt-list .cmt-text p { margin: 2px 0; }
.lb-cmt-list .cmt-time { font-size: 11px; }
.lb-cmt-loading, .lb-cmt-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 48px 0; color: rgba(233,237,243,0.45); font-size: 13px;
}
.lb-cmt-loading i, .lb-cmt-empty i { font-size: 26px; opacity: 0.6; }
.lb-cmt-reply-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 18px; flex-shrink: 0;
  background: rgba(255,255,255,0.06);
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12px; color: rgba(233,237,243,0.8);
}
.lb-cmt-reply-bar i:first-child { color: var(--accent); }
.lb-cmt-reply-bar span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-cmt-cancel {
  width: 22px; height: 22px; border: none; border-radius: 50%;
  background: rgba(255,255,255,0.12); color: #e9edf3; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 11px;
}
.lb-cmt-form {
  padding: 12px 18px 16px; flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex; flex-direction: column; gap: 8px;
  background: rgba(255,255,255,0.03);
}
.lb-cmt-logged { font-size: 12px; color: rgba(233,237,243,0.6); }
.lb-cmt-fields { display: flex; flex-direction: column; gap: 6px; }
.lb-cmt-fields input, .lb-cmt-form textarea {
  width: 100%; border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.07); color: #e9edf3;
  border-radius: var(--radius-xs); padding: 7px 10px; font-size: 12px;
  outline: none; transition: border-color .2s, background .2s;
  font-family: inherit;
}
.lb-cmt-fields input::placeholder, .lb-cmt-form textarea::placeholder { color: rgba(233,237,243,0.38); }
.lb-cmt-fields input:focus, .lb-cmt-form textarea:focus {
  border-color: var(--accent); background: rgba(255,255,255,0.1);
}
.lb-cmt-form textarea { resize: vertical; min-height: 60px; font-size: 13px; }
.lb-cmt-bar { display: flex; align-items: center; justify-content: space-between; }
.lb-cmt-hint { font-size: 11px; color: rgba(233,237,243,0.4); }
.lb-cmt-submit {
  border: none; background: var(--accent); color: #fff;
  padding: 7px 16px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: opacity .2s, transform .1s;
}
.lb-cmt-submit:hover { opacity: 0.88; }
.lb-cmt-submit:active { transform: scale(.96); }
.lb-cmt-submit:disabled { opacity: 0.5; cursor: default; }
.lb-cmt-msg {
  position: absolute; left: 50%; bottom: 24px; transform: translate(-50%, 12px);
  padding: 9px 18px; border-radius: var(--radius-pill);
  font-size: 13px; color: #fff; opacity: 0; pointer-events: none;
  transition: opacity .3s, transform .3s; z-index: 20; white-space: nowrap;
}
.lb-cmt-msg.show { opacity: 1; transform: translate(-50%, 0); }
.lb-cmt-msg-ok { background: rgba(46,160,67,0.92); }
.lb-cmt-msg-err { background: rgba(200,70,60,0.92); }
.related-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* ── 图片悬浮「评论」图标（首页/分类页/文章页） ── */
.img-cmt-host { position: relative; }
.img-cmt-badge {
  position: absolute; top: 7px; right: 7px; z-index: 3;
  width: 30px; height: 30px; padding: 0;
  border: none; border-radius: 50%;
  background: rgba(18,22,28,0.6); color: #fff; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  opacity: 0; transform: translateY(-4px) scale(.88);
  transition: opacity .2s ease, transform .2s ease, background .2s;
  pointer-events: none;
}
.img-cmt-host:hover > .img-cmt-badge,
.img-cmt-host:hover .img-cmt-badge { opacity: 1; transform: none; pointer-events: auto; }
.img-cmt-badge:hover { background: var(--accent); }
.img-cmt-badge:focus-visible { opacity: 1; transform: none; pointer-events: auto; outline: 2px solid var(--accent); outline-offset: 2px; }
/* 触屏设备没有 hover，直接常显（略微收敛透明度） */
@media (hover: none) {
  .img-cmt-badge { opacity: .82; transform: none; pointer-events: auto; }
}
/* 面板展开时右缘控件避让（默认展开后关闭×/下一张›/评论按钮不再被面板盖住） */
/* 舞台参数：侧滑面板宽度、切换按钮占位、图片与面板之间的安全留白
   （≤640px 为底部抽屉，不参与横向避让，见下方 media） */
#lightbox { --lb-panel-w: 360px; --lb-nav-inset: 20px; --lb-stage-pad: 24px; }
/* 窄桌面（641~900px）：360px 面板会吃掉大半视口、把图片挤得很小，收窄到 300px 并压缩留白 */
@media (min-width: 641px) and (max-width: 900px) {
  #lightbox { --lb-panel-w: 300px; --lb-nav-inset: 14px; --lb-stage-pad: 16px; }
}
#lightbox.lb-cmt-on .lightbox-close { right: calc(var(--lb-panel-w) + var(--lb-nav-inset)); }
#lightbox.lb-cmt-on .lightbox-next { right: calc(var(--lb-panel-w) + var(--lb-nav-inset)); }
#lightbox.lb-cmt-on .lightbox-cmt-toggle { right: calc(var(--lb-panel-w) + var(--lb-nav-inset)); }
#lightbox.lb-cmt-on .lightbox-counter { transform: translateX(calc(-50% - var(--lb-panel-w) / 2)); }
/* 桌面：面板展开后可用区域变窄，让图片连同两个切换按钮一起同步左移半个面板宽，
   使图片始终落在左右切换按钮的正中间；同时限制图片最大宽度，避免钻到面板底下 */
@media (min-width: 641px) {
  .lightbox-img-wrap { transition: transform .28s ease; }
  #lightbox.lb-cmt-on .lightbox-img-wrap,
  #lightbox.lb-cmt-on .lightbox-img-wrap img {
    max-width: calc(100vw - var(--lb-panel-w) - 2 * var(--lb-stage-pad));
  }
  #lightbox.lb-cmt-on .lightbox-img-wrap { transform: translateX(calc(-1 * var(--lb-panel-w) / 2)); }
}
/* 移动端：评论面板改为底部抽屉 */
@media (max-width: 640px) {
  .lightbox-cmt-toggle { top: auto; bottom: 64px; }
  .lightbox-cmt {
    top: auto; left: 0; right: 0; width: 100%; max-width: 100%;
    height: 68vh; max-height: 68vh;
    border-left: none; border-top: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius) var(--radius) 0 0;
    transform: translateY(100%);
  }
  .lightbox-cmt.open { transform: translateY(0); }
  .lightbox-img-wrap { max-height: 62vh; }
  .lightbox-img-wrap img { max-height: 62vh; }
  .lb-cmt-list .cmt-children { margin-left: 10px; }
  #lightbox.lb-cmt-on .lightbox-cmt-toggle { right: 10px; bottom: calc(68vh + 16px); }
  #lightbox.lb-cmt-on { padding-bottom: calc(68vh + 12px); }
  #lightbox.lb-cmt-on .lightbox-img-wrap,
  #lightbox.lb-cmt-on .lightbox-img-wrap img { max-height: 24vh; }
  #lightbox.lb-cmt-on .lightbox-close { right: 12px; }
  #lightbox.lb-cmt-on .lightbox-next { right: 10px; }
  #lightbox.lb-cmt-on .lightbox-prev,
  #lightbox.lb-cmt-on .lightbox-next { top: 12vh; }
  #lightbox.lb-cmt-on .lightbox-counter { transform: translateX(-50%); bottom: calc(68vh + 16px); }
}
@media (max-width: 640px) { .columns-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .column-card-media { height: 124px; } .column-card-fallback { font-size: 42px; } }
.column-empty { text-align: center; color: var(--text-secondary); padding: 40px; }
@media (max-width: 600px) { .column-hero { flex-direction: column; align-items: flex-start; padding: 16px; } .column-hero-cover { width: 72px; height: 72px; } .column-hero-name { font-size: 20px; } }
@media (max-width: 600px) { .col-post-thumb { display: none; } .col-post-index { width: 26px; font-size: 15px; } }
/* 顶栏「专栏」入口（覆盖 .topbar-btn 的圆形定宽） */
.topbar-nav-link { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: auto; min-width: 34px; height: 34px; border-radius: 17px; padding: 0 12px; white-space: nowrap; }
.topbar-nav-link .topbar-nav-text { font-size: 14px; font-weight: 600; line-height: 1; }
.topbar-nav-link.active { color: var(--accent); background: var(--accent-soft); }
@media (max-width: 640px) { .topbar-nav-link { padding: 0 8px; } .topbar-nav-link .topbar-nav-text { display: none; } }
.article-eyebrow-col .aec-sep { opacity: 0.5; }
@media (max-width: 600px) { .post-column-box { padding: 14px; } .pcb-list li a { font-size: 13.5px; } }
/* ── 专栏目录进度标记（已读 / 当前篇） ── */
.pcb-mark { flex: 0 0 auto; align-self: center; font-size: 11px; font-weight: 600; line-height: 1; padding: 3px 8px; border-radius: 10px; margin-left: 8px; white-space: nowrap; }
.pcb-list li.is-read { opacity: 0.85; }
.pcb-list li.is-read > a { color: var(--text-secondary); }
.sticky-body .post-taxo { margin-top: 8px; }
/* ── 置顶徽标（专栏目录 / 专栏页） ── */
.col-pin-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; line-height: 1; padding: 2px 6px; border-radius: 6px; margin-right: 7px; background: var(--accent); color: #fff; vertical-align: middle; }
.col-pin-badge i { font-size: 10px; }
/* ── 清除已读按钮 ── */
.clear-read-btn { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; line-height: 1; padding: 4px 10px; border: 1px solid var(--border); border-radius: 12px; background: transparent; color: var(--text-secondary); cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.clear-read-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.clear-read-btn i { font-size: 11px; }
/* ── 继续阅读 toast（底部居中，避开 readerDock） ── */
#resumeToast {
  position: fixed; left: var(--ln-nav-w, 0); right: 0; bottom: 88px; z-index: 60;
  display: flex; justify-content: center; pointer-events: none;
}
#resumeToast .resume-card {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 10px 9px 16px; font-size: 13px; color: var(--text);
  background: var(--glass-bg-strong);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.6);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.6);
  border: 1px solid var(--glass-border); border-radius: 999px;
  box-shadow: 0 10px 30px rgba(31, 45, 61, 0.18);
  opacity: 0; transform: translateY(14px);
  transition: opacity .3s ease, transform .3s ease;
}
#resumeToast.show .resume-card { opacity: 1; transform: none; pointer-events: auto; }
#resumeToast .resume-card > i { color: var(--accent); font-size: 13px; }
#resumeToast .resume-go {
  border: none; cursor: pointer; height: 30px; padding: 0 14px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 12.5px; font-weight: 600;
  display: inline-flex; align-items: center; transition: background .2s;
}
#resumeToast .resume-go:hover { background: var(--accent-hover); }
#resumeToast .resume-x {
  border: none; background: transparent; color: var(--text-secondary); cursor: pointer;
  width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
}
#resumeToast .resume-x:hover { background: rgba(0, 0, 0, 0.06); color: var(--text); }
html.dark #resumeToast .resume-x:hover { background: rgba(255, 255, 255, 0.08); }
/* ── 专注模式：一键隐藏顶栏/侧栏/悬浮目录/底栏，正文栏保持 640 居中沉浸 ──
   入口：阅读偏好胶囊 / 阅读底栏按钮 + 键盘 F；退出：Esc / 右上角浮标 / 再按 F */
body.focus-mode .topbar { display: none; }
/* 移动端：侧栏直接隐藏（占位释放，内容占满）；桌面端见下方动画规则 */
body.focus-mode .sidebar { display: none; }
@media (min-width: 921px) {
  .sidebar {
    transition: transform .45s cubic-bezier(.2, .7, .2, 1), opacity .3s ease;
  }
  .main-body {
    transition: padding-left .45s cubic-bezier(.2, .7, .2, 1);
  }
  .focus-mode .sidebar {
    display: flex; /* 覆盖上面的 display:none，用动画滑出 */
    transform: translateX(-102%);
    opacity: 0;
    pointer-events: none;
  }
  .focus-mode .main-body { padding-left: 0; }
}
/* 桌面端：侧栏滑出动画 + 内容区补位 */
/* 右上角「退出专注」浮标（仅专注模式可见；append 到 body，真视口 fixed） */
#focusExit {
  position: fixed; top: 16px; right: 20px; z-index: 1300;
  opacity: 0; transform: translateY(-10px); pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
body.focus-mode #focusExit { opacity: 1; transform: none; pointer-events: auto; }
#focusExit button {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-strong);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.6);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.6);
  color: var(--text-secondary); font-size: 12.5px; font-weight: 600;
  height: 34px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  box-shadow: 0 8px 24px rgba(31, 45, 61, 0.16);
  transition: color .15s, border-color .15s;
}
#focusExit button i { color: var(--accent); font-size: 13px; }
#focusExit button:hover { color: var(--accent); border-color: var(--accent); }
#focusExit button kbd {
  font-family: inherit; font-size: 10.5px; font-weight: 700;
  padding: 1px 6px; border-radius: 6px;
  color: var(--text-light);
  background: var(--glass-bg); border: 1px solid var(--glass-border);
}
@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .main-body,
  #focusExit { transition: none; }
}
/* 专注模式移动端收益低：底栏去掉，入口保留在阅读偏好胶囊（键盘 F 亦可用） */
/* ═══ 标题锚点（h2/h3 悬停 # 复制本节链接） ═══ */
.article-content h2 .heading-anchor,
.article-content h3 .heading-anchor {
  position: absolute;
  left: -26px; top: 50%;
  transform: translateY(-50%);
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; line-height: 1;
  color: var(--accent);
  text-decoration: none;
  opacity: 0;
  user-select: none;
  transition: opacity .15s ease, transform .15s ease;
}
.article-content h2:hover .heading-anchor,
.article-content h3:hover .heading-anchor,
.article-content .heading-anchor:focus-visible { opacity: 1; }
.article-content .heading-anchor:hover {
  transform: translateY(-50%) scale(1.25);
}
@media (max-width: 920px) {
  .article-content h2 .heading-anchor,
  .article-content h3 .heading-anchor { display: none; }
}
/* 触摸设备无悬停，隐藏锚点避免视觉噪音（选择器特异性须与基础规则一致，否则被覆盖） */
/* ═══ 灯箱缩放 / 拖拽 ═══ */
#lightbox.lb-dragging .lightbox-img-wrap { cursor: grabbing; }
#lightbox.lb-dragging .lightbox-img-wrap img { transition: none; }
.lightbox-zoom {
  position: absolute; top: 16px; left: 20px; z-index: 10;
  display: flex; align-items: center; gap: 2px;
  background: rgba(255,255,255,0.25); color: #fff;
  border-radius: var(--radius-pill); padding: 3px 6px;
  backdrop-filter: blur(8px);
  font-size: 12px;
}
.lightbox-zoom button {
  width: 30px; height: 30px; border: none; background: transparent; color: #fff;
  border-radius: 50%; cursor: pointer; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.lightbox-zoom button:hover { background: rgba(255,255,255,0.35); }
.lightbox-zoom button:disabled { opacity: .35; cursor: default; background: transparent; }
.lb-zoom-level { min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; letter-spacing: .2px; }
.lb-zoom-sep { width: 1px; height: 16px; background: rgba(255,255,255,0.35); margin: 0 2px; }
@media (max-width: 640px) {
  .lightbox-zoom { display: none; }
}
.fp-clear.confirming { color: #fff; background: #ef4444; border-color: #ef4444; }
/* ═══ 顶栏「文章态」：下滑显示 标题/章节/收藏/阅读偏好胶囊，上滑恢复搜索框 ═══ */
.topbar-post { display: none; }
/* 插槽默认占位；显隐由下方规则决定：桌面端仅在文章阅读态（body.tp-post-mode）显示，
   非文章态与 ≤920px 一律隐藏（≤920 胶囊留在文章头部，不用此插槽）。 */
.tp-slot { display: block; }
/* 文章页（胶囊可在 ≥1100 搬入顶栏插槽 tpPrefsSlot）：桌面端顶栏中间区改为「与正文列同中轴」的
   绝对定位（见下方 @media）；中间区脱离文档流后，靠 .topbar-spacer 把右侧操作区顶到最右。
   ≤1099（含移动端）插槽不启用、胶囊留在文章头部。 */
/* 顶栏中间区：leftnav 桌面端始终与正文列同中轴（消除「搜索框 / 文章条偏左」错位）。 */
@media screen and (min-width: 1100px) {
  .topbar { --tp-reserve: 360px; }
  .topbar-center {
    position: absolute; top: 0; bottom: 0;
    left: calc(var(--ln-nav-w) + (100% - var(--ln-nav-w)) / 2);
    transform: translateX(-50%);
    width: min(var(--ln-content-w), calc(100% - var(--ln-nav-w) - var(--tp-reserve)));
    max-width: none; margin: 0;
    /* top:0/bottom:0 把中间区撑满整条顶栏，必须显式 flex 居中，
       否则内部的块级搜索框 / 文章条会从 top:0 往下排 —— 呈现为「贴着窗口顶端」，
       与右侧「专栏 / 足迹」的垂直居中基线错位（实测 Δ≈16px）。 */
    display: flex; align-items: center;
  }
  .topbar-center .topbar-search-form { flex: 1 1 auto; min-width: 140px; }
  .topbar-center .topbar-post { flex: 1 1 auto; min-width: 0; }
  /* 阅读偏好胶囊插槽：桌面端常驻顶栏（紧贴正文列中轴右侧）；仅文章阅读态（下滑后顶栏切换为阅读条）显示，
     搜索态保持仅搜索框；非文章页插槽为空、零尺寸不影响布局 */
  .topbar-center .tp-slot { display: inline-flex; align-items: center; flex: none; }
  body:not(.tp-post-mode) .topbar-center .tp-slot { display: none; }
  /* 胶囊移入顶栏后去掉文章头部那套 margin-top，保证在 68px 顶栏内垂直居中 */
  #tpPrefsSlot .reader-prefs { margin: 0; }
}
/* 单一可见子项撑满中间区宽度，保持与正文列同宽（改 flex 容器后原 flex-basis 会生效并收窄） */
/* 窄桌面（1100~1365）：「专栏 / 足迹」收成纯图标，避免与对齐后的中间区压叠 */
@media screen and (min-width: 1100px) and (max-width: 1365px) {
  .topbar { --tp-reserve: 300px; }
  .topbar-actions .topbar-nav-link { padding: 0 8px; }
  .topbar-actions .topbar-nav-link .topbar-nav-text { display: none; }
}
body.tp-post-mode .topbar-search-form { display: none; }
body.tp-post-mode .topbar-post {
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
/* 顶栏中间区的图标复位：主题的 .topbar-center i 会把所有 <i> 绝对定位到搜索图标位 */
.topbar-center .topbar-post i,
.topbar-center .tp-slot i {
  position: static; left: auto; top: auto; transform: none;
  color: inherit; pointer-events: none; font-size: inherit;
}
.tp-title {
  flex: 1 1 auto; min-width: 80px; max-width: 300px;
  display: flex; align-items: center; gap: 6px;
  border: none; background: transparent; cursor: pointer;
  padding: 4px 6px; border-radius: var(--radius-sm);
  color: var(--text); font-size: 14px; font-weight: 600;
  transition: color .15s, background .15s;
}
.tp-title i { font-size: 10px; color: var(--text-light); opacity: .8; }
.tp-title .tp-title-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-title:hover { color: var(--accent); background: var(--accent-soft); }
.tp-chapter {
  flex: 0 1 auto; min-width: 0; max-width: 160px;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12.5px; color: var(--text-light);
  padding: 3px 7px; border-radius: var(--radius-sm);
  cursor: pointer; -webkit-user-select: none; user-select: none;
  transition: color .15s, background .15s;
}
.tp-chapter:hover { color: var(--accent); background: var(--accent-soft); }
.tp-chapter i { font-size: 9px; opacity: .7; }
.tp-chapter .tp-chapter-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-btn {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--glass-bg-strong);
  color: var(--text-secondary); cursor: pointer; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .15s, border-color .15s, background .15s;
}
.tp-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.tp-btn.active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
/* 注：胶囊常驻顶栏插槽（桌面端），原先依赖 :has(.tp-slot > .reader-prefs) 的
   「压缩搜索框让位」规则已失效，此处清理，仅保留仍生效的章节名收缩。 */
@media (max-width: 1240px) {
  .tp-chapter { max-width: 120px; }
}
@media (max-width: 1080px) {
  .tp-chapter { display: none !important; }
}
@media (max-width: 920px) {
  .topbar-center .m-brand-icon { display: flex !important; }
  .topbar-center .m-brand-name { display: block !important; }
  .topbar-center .topbar-post i,
  .topbar-center .tp-slot i { display: inline-block !important; }
  .tp-slot { display: none; }
  body.tp-post-mode .topbar-center {
    justify-content: flex-start; gap: 8px; margin: 0 8px;
  }
  body.tp-post-mode .topbar-actions .topbar-nav-link { display: none !important; }
  body.tp-post-mode .topbar-center .m-brand { display: none !important; }
  body.tp-post-mode .topbar-post { flex: 1 1 auto; min-width: 0; gap: 6px; }
  body.tp-post-mode .tp-title { flex: 1 1 auto; max-width: none; font-size: 13px; padding: 4px 0; }
  body.tp-post-mode .tp-title i,
  body.tp-post-mode .tp-mark,
  body.tp-post-mode .tp-chapter { display: none !important; }
  body.tp-post-mode .tp-slot {
    display: block; flex: none; max-width: 34vw;
    overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
    /* 右缘渐隐，提示可横向滑动查看全部按钮 */
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 14px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 14px), transparent);
  }
  body.tp-post-mode .tp-slot::-webkit-scrollbar { display: none; }
  body.tp-post-mode .tp-slot .reader-prefs { width: max-content; }
}
/* 移动端：顶部/上滑显示站名，下滑才显示文章条 + 胶囊 */
/* 补：窄屏下站名各部件需显式恢复 display（桌面规则把它们设成了 none） */
/* 窄屏原规则隐藏了顶栏中间所有 <i>（只保留搜索图标位），文章条与胶囊的图标需恢复 */
/* 文章态：顶栏中间占满 汉堡 ~ 右侧按钮 之间的宽度，只保留 标题 + 胶囊（可横滑） */
/* 阅读态精简：让出专栏/足迹入口的位置（上滑恢复） */
