/* ============================================================
   妹妹紫（Meimeizi）· 基础样式
   -----------------------------------------------------------------
   视觉已接入参考设计（theme-meimeizi/设计/主机服务器类web页面分享）：
     主色 Primary #6C41FF · 深靛 DarkBlue #1A0F42 · 亮紫 #8261FC
     中性 文本 #1D1D1B / 次要 #707070 / 描边 #E1E5E5
     辅助 绿 #62BB65 · 粉 #D882B6（徽章语义色）
   所有令牌集中在 :root / [data-theme=dark]；组件按需引用变量。
   固定视觉点（不随主题变量）：pre 代码块、页脚深靛块、Hero 光斑装饰。
   重做视觉时：改令牌即可全局生效。
   配置入口：theme.config（见后台「基础设置」「全局设置」等设置组）。
   ============================================================ */

/* ---------- 1. 设计令牌 ---------- */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* 参考设计：设计/主机服务器类web页面分享（Dewa Hosting 风格）
     Primary #6C41FF · DarkBlue #1A0F42 · 亮紫 #8261FC · 文本 #1D1D1B
     中性 #707070 / #D8D8D8 / #E1E5E5 · 绿 #62BB65 / 粉 #D882B6 */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;

  --primary: #6c41ff;
  --primary-600: #5930e6;
  --primary-400: #8261fc;
  --primary-weak: rgba(108, 65, 255, .12);
  --primary-soft: rgba(108, 65, 255, .08);
  --primary-deep: #1a0f42;
  --grad-brand: linear-gradient(115deg, #1a0f42 0%, #6c41ff 55%, #8261fc 100%);
  --on-primary: #fff;

  /* 行内代码（正文 `code`）：独立于会被多处复用的 --primary-weak，
     用实色底 + 深紫字 + 细描边，保证「重点提醒」级的对比度 */
  --code-inline-bg: #ece6ff;
  --code-inline-fg: #4f22d4;
  --code-inline-border: rgba(108, 65, 255, .32);

  --bg: #f5f6fa;
  --surface: #ffffff;
  --text: #1d1d1b;
  --text-2: #707070;
  --text-3: #9aa3b2;
  --border: #e1e5e5;
  --shadow-sm: 0 1px 2px rgba(26, 15, 66, .07);
  --shadow-md: 0 8px 24px -8px rgba(26, 15, 66, .16);
  --shadow-lg: 0 18px 50px -18px rgba(26, 15, 66, .26);

  --header-h: 64px;
  /* 顶部导航与页面首个内容区块之间的呼吸间距：
     首页 Hero 首屏（.page-home > .hero）与装备页横幅
     （.page-hero--equipment）共用，改这一处即可全局统一 */
  --gap-top: 24px;
  --container-max: 1320px;
  --content-max: 780px;
  --sidebar-w: 320px;
}

[data-theme="dark"] {
  --bg: #120c2c;
  --surface: #1b1440;
  --text: #f2effb;
  --text-2: #b6b0d6;
  --text-3: #8880ab;
  --border: #2c2552;
  --primary: #8c6bff;
  --primary-weak: rgba(140, 107, 255, .18);
  --primary-soft: rgba(140, 107, 255, .1);
  --code-inline-bg: #2f2560;
  --code-inline-fg: #f5f2ff;
  --code-inline-border: #7a63d8;
  --grad-brand: linear-gradient(115deg, #0e0a28 0%, #5b34de 50%, #8c6bff 100%);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, .55);
  --shadow-lg: 0 18px 50px -18px rgba(0, 0, 0, .65);
}

/* 容器宽度由 data-width 控制 */
html[data-width="lg"] { --container-max: 1280px; }
html[data-width="xl"] { --container-max: 1400px; }
html[data-width="xxl"] { --container-max: 1520px; }
/* 圆角档位 */
html[data-radius="sm"] { --radius-sm: 4px; --radius-md: 8px; --radius-lg: 12px; }
html[data-radius="lg"] { --radius-sm: 8px; --radius-md: 16px; --radius-lg: 22px; }
/* 阴影开关 */
html[data-shadow="false"] .card,
html[data-shadow="false"] .post-card,
html[data-shadow="false"] .site-header.is-scrolled { box-shadow: none !important; border-color: var(--border); }

/* ---------- 2. 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* 兜底：凡带 hidden 属性的元素必须隐藏。
   否则 .search-overlay/.lightbox 等 JS 全屏层虽有 hidden，
   其自身 display:flex 会覆盖 UA 样式导致常显（黑色遮罩）。 */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
/* 滚动条：主题主色渐变，常驻可见（不随系统 overlay 隐藏） */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary-400), var(--primary));
  background-clip: content-box;
  border: 3px solid transparent;
  border-radius: 999px;
  min-height: 36px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--primary), var(--primary-600));
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:active {
  background: var(--primary-600);
  background-clip: content-box;
}

/* 自绘滚动条（theme.js 注入；启用后才隐藏原生滚动条，无 JS 时自动回退） */
.zs-scrollbar {
  position: fixed; right: 6px; top: calc(var(--header-h) + 10px); bottom: 14px;
  width: 10px; z-index: 120; opacity: 0; visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.zs-scrollbar.is-visible { opacity: 1; visibility: visible; }
/* 轨道：上下渐隐，hover 时加宽并透出主色微光 */
.zs-scrollbar::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, transparent, var(--border) 6%, var(--border) 94%, transparent);
  transition: width .2s ease, left .2s ease, background .2s ease;
}
.zs-scrollbar:hover::before {
  left: 0; width: 10px;
  background: linear-gradient(180deg, transparent, var(--primary-soft) 6%, var(--primary-soft) 94%, transparent);
}
/* 滑块：主色渐变胶囊 + 内高光 + 光晕 + 抓握纹 */
.zs-scrollbar-thumb {
  position: absolute; left: 3px; width: 4px; border-radius: 999px;
  background: linear-gradient(180deg, var(--primary-400), var(--primary));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35), 0 6px 16px -6px var(--primary);
  cursor: grab;
  will-change: transform;
  transition: width .2s ease, left .2s ease, box-shadow .2s ease;
}
.zs-scrollbar-thumb::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 3px; height: 16px; margin: -8px 0 0 -1.5px; border-radius: 2px;
  background: rgba(255, 255, 255, .8);
  opacity: 0; transition: opacity .2s ease;
}
.zs-scrollbar:hover .zs-scrollbar-thumb,
.zs-scrollbar.is-dragging .zs-scrollbar-thumb {
  left: 0; width: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5), 0 8px 24px -6px var(--primary);
}
.zs-scrollbar:hover .zs-scrollbar-thumb::after,
.zs-scrollbar.is-dragging .zs-scrollbar-thumb::after { opacity: 1; }
.zs-scrollbar.is-dragging .zs-scrollbar-thumb { cursor: grabbing; }
/* 拖拽时禁止选中文本 */
body.is-scrollbar-dragging { user-select: none; -webkit-user-select: none; }
/* 自绘滚动条生效后隐藏原生滚动条（触摸设备 / 无 JS 时保持原生样式） */
html.has-zs-scrollbar { scrollbar-width: none; }
html.has-zs-scrollbar::-webkit-scrollbar { width: 0; height: 0; }
html.has-zs-scrollbar::-webkit-scrollbar-thumb { background: transparent; }

img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.35; }
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 10px; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 1000;
  background: var(--primary); color: var(--on-primary); padding: 8px 14px; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* ---------- 3. 卡片 / 按钮 / 徽章 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 9px 18px; font-size: 14px; line-height: 1.4; transition: .18s;
}
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-light { background: rgba(255, 255, 255, .94); color: #14161c; }
/* Hero 上的次要按钮（后台「按钮链接（兜底）」）：深底卡片上用描边白，与 .btn-light 主次分明 */
.btn-outline-light { background: transparent; border-color: rgba(255, 255, 255, .55); color: #fff; }
.btn-outline-light:hover { background: rgba(255, 255, 255, .14); border-color: #fff; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.badge {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px;
  font-size: 12px; line-height: 1.6; font-weight: 600;
}
.badge--quality { background: rgba(98, 187, 101, .16); color: #2e9e45; } /* 参考绿 #62BB65 */
.badge--pinned { background: var(--primary-weak); color: var(--primary); }
.badge--tutorial { background: rgba(216, 130, 182, .16); color: #b4558f; } /* 参考粉 #D882B6 */
.verified-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--primary); color: var(--on-primary);
  font-size: 11px; line-height: 1; margin-left: 4px;
}
.tag-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--primary-weak); color: var(--primary);
  border-radius: 999px; padding: 3px 11px; font-size: 13px; margin: 0 8px 8px 0;
}
.tag-chip:hover { background: var(--primary); color: var(--on-primary); }
.tag-chip-count { font-size: 12px; opacity: .75; }
.tag-chip--lg { padding: 6px 16px; font-size: 14px; }

/* ---------- 4. 顶部导航 ---------- */
.site-header {
  position: relative; z-index: 60;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.site-header[data-sticky="true"] { position: sticky; top: 0; }
.site-header.is-scrolled { box-shadow: var(--shadow-md); }
.header-inner {
  max-width: var(--container-max); margin: 0 auto; padding: 0 10px;
  height: var(--header-h);
  display: flex; align-items: center; gap: 24px;
}
.header-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; }
.header-logo { height: 34px; width: auto; border-radius: 8px; }
.header-nav { flex: 1; min-width: 0; }
.nav-list { display: flex; gap: 4px; }
/* 导航对齐：靠左 / 居中 / 靠右（桌面端；移动端抽屉见 20 节重置为靠上） */
.site-header[data-nav-align="left"] .nav-list { justify-content: flex-start; }
.site-header[data-nav-align="center"] .nav-list { justify-content: center; }
.site-header[data-nav-align="right"] .nav-list { justify-content: flex-end; }
.nav-item { position: relative; }
.nav-link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: 15px; color: var(--text-2); transition: .15s;
}
.nav-link:hover { color: var(--text); background: var(--primary-weak); }
.nav-dropdown {
  position: absolute; top: 100%; left: 0; min-width: 180px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  padding: 8px; opacity: 0; visibility: hidden; transform: translateY(6px); transition: .18s;
}
.nav-item:hover .nav-dropdown,
.nav-item:focus-within .nav-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-dropdown-link { display: block; padding: 8px 12px; border-radius: 6px; font-size: 14px; color: var(--text-2); }
.nav-dropdown-link:hover { background: var(--primary-weak); color: var(--text); }
.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: transparent; color: var(--text-2); transition: .15s;
}
.icon-btn:hover { background: var(--primary-weak); color: var(--text); }
/* 图标按钮悬停注释（tooltip，纯 CSS 冒泡） */
.tip { position: relative; }
.tip::after {
  content: attr(data-tip);
  position: absolute; top: calc(100% + 9px); left: 50%;
  transform: translateX(-50%) translateY(-2px);
  background: var(--text); color: var(--bg);
  font-size: 12px; line-height: 1.5; white-space: nowrap;
  padding: 5px 10px; border-radius: 6px; box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transition: .15s ease; pointer-events: none; z-index: 90;
}
.tip::before {
  content: ''; position: absolute; top: calc(100% + 4px); left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent; border-top: 0; border-bottom-color: var(--text);
  opacity: 0; visibility: hidden; transition: .15s ease; pointer-events: none; z-index: 90;
}
.tip:hover::after, .tip:focus-visible::after { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.tip:hover::before, .tip:focus-visible::before { opacity: 1; visibility: visible; }
/* 登录态（已登录用户中心入口） */
.icon-btn--online { color: var(--primary); }
.online-dot {
  position: absolute; right: 6px; bottom: 6px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #34c759; border: 2px solid var(--surface);
}
.icon-sun { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
.mobile-toggle { display: none; }
.nav-backdrop {
  position: fixed; inset: 0; z-index: 55; background: rgba(18, 11, 44, .55);
}

/* ---------- 5. Hero ---------- */
/* Hero 内容区左右留白令牌：文章轮播 / 纯色 Hero / 分类主视觉三处共用，
   改这一处即可统一三种 Hero 模式与卡片左右边框的间距 */
.hero { position: relative; --hero-pad-x: clamp(12px, 1.6vw, 22px); }
/* 顶部导航与 Hero 首屏之间的呼吸间距：
   仅当 Hero 位于首页内容首位时生效（模块被拖到其它位置时，间距由前一个
   .section 的 padding-top 提供，避免两层间距叠加）。取值克制，只做「不贴住」的分离感。
   取值走 --gap-top：装备页横幅引用同一令牌，两者间距完全一致 */
.page-home > .hero { padding-top: var(--gap-top, 24px); }
/* 独立页面（含注册/登录等系统页）此前没有上边距，正文顶到导航栏 */
.page-single { margin-top: var(--gap-top, 24px); }
.hero-slider {
  position: relative; overflow: hidden;
  /* 圆角统一交给「不参与动画」的视口来裁剪：
     轮播只平移 track，视口本身始终静止，圆角裁剪全程稳定。
     若把圆角放在每张 .hero-slide 上，切片滑入视口时超出部分会先被视口
     切成直角，落位后才显露自身圆角，于是出现「直角 → 圆角」的跳变。 */
  border-radius: var(--radius-lg);
  isolation: isolate;
}
.hero-slider-track { display: flex; transition: transform .5s ease; }
.hero-slide-wrap { min-width: 100%; }
.hero-slide {
  position: relative; min-height: 420px;
  display: flex; align-items: flex-end;
  overflow: hidden;
  color: inherit; text-decoration: none;
}
.hero-slide-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
}
.hero-slide-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.hero-slide-overlay {
  position: absolute; inset: 0;
  /* 蒙版强度由 Hero 设置里的「图片蒙版」控制：模板在 .hero 上注入 --hero-overlay-a。
     0 = 原图直出；数值越大白色标题越清晰（默认 .88，即「标准」）。
     渐变沿用左重右轻的比例，因为标题文字在左侧。 */
  background: linear-gradient(105deg,
    rgba(26, 15, 66, var(--hero-overlay-a, .88)) 0%,
    rgba(26, 15, 66, calc(var(--hero-overlay-a, .88) * .57)) 55%,
    rgba(26, 15, 66, calc(var(--hero-overlay-a, .88) * .3)) 100%);
}
.hero-slide-inner { position: relative; width: 100%; }
.hero-slide-inner--solid {
  min-height: 380px; display: flex; align-items: center; position: relative;
  background: var(--grad-brand);
  border-radius: var(--radius-lg);
}
/* 参考 Hitech Landing 帧：紫色光斑装饰 */
.hero-slide-inner--solid::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background:
    radial-gradient(46% 130% at 90% -20%, rgba(155, 123, 255, .5), transparent 62%),
    radial-gradient(38% 110% at -6% 118%, rgba(130, 97, 252, .4), transparent 60%);
}
.hero-slide-inner--solid .hero-slide-content { position: relative; padding: 56px var(--hero-pad-x); }
.hero-slide-content {
  max-width: var(--container-max); margin: 0 auto; width: 100%;
  /* 左右内边距：标题 / 描述 / 按钮与卡片左右边框之间留出呼吸位，
     纯色模式（--solid）用同一变量，两种形态边距一致 */
  padding: 0 var(--hero-pad-x) 72px;
}
.hero-slide-inner--solid .hero-slide-content { position: relative; }
.hero-eyebrow {
  display: inline-block; background: rgba(255, 255, 255, .18); color: #fff;
  font-size: 13px; padding: 3px 12px; border-radius: 999px; margin-bottom: 14px; backdrop-filter: blur(4px);
}
.hero-title { color: #fff; font-size: clamp(28px, 4.6vw, 46px); font-weight: 800; max-width: 720px; }
.hero-desc {
  color: rgba(255, 255, 255, .82); max-width: 560px; margin: 14px 0 22px;
  font-size: 16px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* 兜底文案 Hero 的标签串（后台「标签串（兜底·逗号分隔）」） */
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; }
.hero-chips li {
  background: rgba(255, 255, 255, .16); color: #fff; border: 1px solid rgba(255, 255, 255, .28);
  font-size: 13px; padding: 3px 12px; border-radius: 999px; backdrop-filter: blur(4px);
}
.hero-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hero-extra { color: rgba(255, 255, 255, .6); font-size: 13px; }
.hero-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .4); background: rgba(0, 0, 0, .22); color: #fff; font-size: 22px;
}
.hero-arrow--prev { left: 18px; }
.hero-arrow--next { right: 18px; }
.hero-arrow:hover { background: rgba(0, 0, 0, .5); }
.hero-dots {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; z-index: 5;
}
.hero-dots button {
  width: 9px; height: 9px; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, .45); transition: .2s; padding: 0;
}
.hero-dots button.is-active { background: #fff; width: 22px; border-radius: 6px; }

/* Hero：1 大 2 小布局（左侧主屏 + 右侧上下两个小屏）
   右侧两屏由「首页布局 → Hero 首屏」模块项的 sideTopSlides / sideBottomSlides 驱动：
   任一填写内容即启用 .hero-stage--trio（主屏 2/3 + 右侧 1/3），均未填写时 .hero-stage
   退化为单列，主屏保持整宽，与旧版观感一致。
   右侧两屏各自是独立的图片/视频轮播，复用 .hero-slider 结构与 theme.js 的轮播逻辑，
   仅通过 .hero-slider--side 调整高度与内容；圆角仍由 .hero-slider 视口统一裁剪。 */
.hero-stage { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.hero-stage--trio { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.hero-stage-main { min-width: 0; }
.hero-stage-side {
  min-width: 0;
  display: grid; grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 16px;
}
/* 小屏高度跟随主屏，由右侧栅格等分两行 */
.hero-stage-side > .hero-slider { height: 100%; }
.hero-slider--side .hero-slider-track { height: 100%; }
.hero-slider--side .hero-slide-wrap { height: 100%; }
.hero-side-slide {
  position: relative; display: block; height: 100%; min-height: 180px;
  overflow: hidden; color: inherit; text-decoration: none;
}
.hero-side-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  transition: transform .5s ease;
}
/* 有跳转地址时给一点悬停反馈；纯展示（无链接）不响应 */
.hero-side-slide:not(.hero-side-slide--static):hover .hero-side-bg { transform: scale(1.04); }
.hero-side-slide--static { cursor: default; }
.hero-side-overlay {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(26, 15, 66, 0) 45%, rgba(26, 15, 66, .3) 100%);
}
/* 有叠加文字时加深蒙版：文字压在画面底部，故用纵向渐变（主屏文字在左侧，用的是对角渐变）。
   与主屏不同，这里不跟随「图片蒙版」设置——小屏若原图直出，白字会完全读不出来 */
.hero-side-overlay--text {
  background: linear-gradient(180deg,
    rgba(26, 15, 66, 0) 24%,
    rgba(26, 15, 66, .38) 58%,
    rgba(26, 15, 66, .8) 100%);
}
/* 未配媒体时的兜底底色：沿用品牌渐变，避免纯文字卡透出页面底色 */
.hero-side-slide--solid { background: var(--grad-brand); }
/* 小屏叠加文字：标题 / 描述各自留空即整行不渲染（由模板控制），此处只负责排版与截断 */
.hero-side-content {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  /* 左右留白与主屏共用 --hero-pad-x，小屏叠加文字与主屏标题左对齐 */
  padding: 18px var(--hero-pad-x) 14px;
}
.hero-side-title {
  margin: 0; color: #fff; font-size: 17px; font-weight: 700; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-side-desc {
  margin: 6px 0 0; color: rgba(255, 255, 255, .82); font-size: 13px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Hero：分类模式（左主视觉 + 右卡推荐；多分类时复用 .hero-slider 轮播） */
.hero-category {
  position: relative; min-height: 440px;
  border-radius: var(--radius-lg); overflow: hidden;
  background: var(--grad-brand); color: #fff;
  display: grid; grid-template-columns: minmax(0, 1fr) 380px;
  align-items: stretch;
}
/* 背景层：由「背景方式（兜底）」决定是否渲染，与文章轮播共用同一套图层结构 */
.hero-category-bg {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center;
}
/* 蒙版沿用全局「图片蒙版」(--hero-overlay-a)，与文章轮播口径一致；
   文字在左、卡片在右，故左重右轻，保证两侧都读得清 */
.hero-category-overlay {
  position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(105deg,
    rgba(26, 15, 66, var(--hero-overlay-a, .88)) 0%,
    rgba(26, 15, 66, calc(var(--hero-overlay-a, .88) * .82)) 46%,
    rgba(26, 15, 66, calc(var(--hero-overlay-a, .88) * .5)) 100%);
}
/* 光斑装饰：与纯色 Hero 保持同一视觉语言；有背景图时退居其次 */
.hero-category::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(42% 120% at 96% -12%, rgba(130, 97, 252, .55), transparent 62%),
    radial-gradient(38% 110% at -6% 118%, rgba(130, 97, 252, .32), transparent 60%);
}
.hero-category--cover::before { opacity: .25; }

.hero-category-main {
  position: relative; z-index: 3; min-width: 0;
  display: flex; flex-direction: column; justify-content: center;
  /* 左内边距与文章轮播共用 --hero-pad-x，切模式时内容不会左右跳动 */
  padding: 56px 40px 56px var(--hero-pad-x);
}
.hero-category-main .hero-title { max-width: 14em; }
.hero-category-main .hero-desc { color: rgba(255, 255, 255, .84); max-width: 30em; }
.hero-category-count { display: block; margin: 14px 0 22px; font-size: 13px; color: rgba(255, 255, 255, .68); }

/* 右侧推荐面板 */
.hero-category-rec {
  position: relative; z-index: 3; min-width: 0;
  display: flex; flex-direction: column; justify-content: center; gap: 10px;
  /* 右边距同步 --hero-pad-x，与左侧主视觉的留白口径一致 */
  padding: 32px var(--hero-pad-x) 32px 0;
}
.hero-category-rec-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 2px;
  font-size: 12px; font-weight: 700; letter-spacing: .14em;
  color: rgba(255, 255, 255, .72);
}
.hero-category-rec-head::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, .18); }

.hero-cat-card {
  display: flex; gap: 12px; align-items: center; min-width: 0;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--radius-md); padding: 10px;
  backdrop-filter: blur(8px);
  transition: background .25s ease, border-color .25s ease, transform .25s ease;
}
.hero-cat-card:hover {
  background: rgba(255, 255, 255, .2);
  border-color: rgba(255, 255, 255, .4);
  transform: translateX(-4px);
}
.hero-cat-card-cover {
  /* 比例对齐「热门推荐」卡片封面：--card-ratio 由模板按 media.coverRatio 注入（默认 16/9） */
  width: 104px; flex: none; border-radius: 10px; overflow: hidden;
  aspect-ratio: var(--card-ratio, 16/9);
  background: rgba(255, 255, 255, .14);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; color: rgba(255, 255, 255, .6);
}
.hero-cat-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .45s ease; }
.hero-cat-card:hover .hero-cat-card-cover img { transform: scale(1.08); }
.hero-cat-card-body { min-width: 0; }
.hero-cat-card-title { font-size: 14px; font-weight: 600; line-height: 1.5; margin: 0 0 6px; }
.hero-cat-card-title a {
  color: #fff;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-cat-card-title a:hover { text-decoration: underline; }
.hero-cat-card-meta { font-size: 12px; color: rgba(255, 255, 255, .6); }

/* 分类模式接入轮播：圆角与裁剪统一交给外层视口，并隐藏箭头以免压住主视觉文字 */
.hero-slider--category .hero-slide-wrap { display: flex; }
.hero-slider--category .hero-category { flex: 1; border-radius: 0; }
.hero-slider--category .hero-arrow { display: none; }
.hero-slider--category .hero-dots { left: auto; right: 30px; bottom: 16px; transform: none; }

/* ---------- 6. 首页分区通用 ---------- */
.section { padding: 46px 0 8px; }
.section--home-main { padding-top: 34px; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  margin-bottom: 22px;
}
.section-title { font-size: 24px; font-weight: 800; }
.section-title::before { content: ""; }
.section-subtitle { color: var(--text-3); margin-top: 4px; font-size: 14px; }
.section-more { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-size: 14px; }
.section-more:hover { color: var(--primary); }
.section-empty { color: var(--text-3); text-align: center; padding: 30px 0; }

/* 主内容 + 侧边栏栅格 */
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px; align-items: start;
}
.content-grid--right { grid-template-columns: minmax(0, 1fr) var(--sidebar-w); }
.content-grid--left { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
.content-grid--left .site-sidebar { order: 0; }
.content-grid--left .content-main { order: 1; }
.content-main { min-width: 0; }

/* Sidebar 独立成区后，其后的模块被放进 .content-main 内与 Sidebar 并排渲染。
   这些模块自带 .container 与 .section 上边距，在此收敛，避免二次缩进与叠加大留白。 */
.content-grid > .content-main > .section { padding-top: 0; }
.content-grid > .content-main > .section + .section { padding-top: 46px; }
.content-grid > .content-main > .section > .container {
  max-width: none; padding-left: 0; padding-right: 0;
}

/* ---------- 7. 热门分类卡片 ---------- */
.hot-categories-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.category-card {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 18px; transition: .18s;
}
.category-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.category-card-cover {
  width: 52px; height: 52px; flex: none; border-radius: 12px; background-size: cover; background-position: center;
}
.category-card-icon {
  width: 52px; height: 52px; flex: none; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-weak); color: var(--primary); font-weight: 700; font-size: 22px;
}
.category-card-info { min-width: 0; display: flex; flex-direction: column; }
.category-card-name { font-weight: 700; font-size: 16px; }
.category-card-desc {
  color: var(--text-3); font-size: 13px;
  white-space: nowrap; text-overflow: ellipsis; overflow: hidden; max-width: 100%;
}
.category-card-count { color: var(--primary); font-size: 12px; margin-top: 2px; }

/* ---------- 8. 文章卡片 ---------- */
.post-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; transition: .18s; display: flex; flex-direction: column; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: rgba(108, 65, 255, .45); }
/* 拖动滚动条（快速滚动）期间：卡片 hover 动效会成片触发，临时关掉以避免掉帧 */
body.is-scrollbar-dragging .post-card,
body.is-scrollbar-dragging .post-card * { transition: none !important; }
body.is-scrollbar-dragging .post-card:hover { transform: none !important; box-shadow: none !important; }
.post-card-cover { position: relative; display: block; aspect-ratio: var(--card-ratio, 16/9); background: var(--border); overflow: hidden; }
.post-card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.post-card:hover .post-card-cover img { transform: scale(1.05); }
.post-card-cover-empty {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary-weak), transparent); color: var(--primary);
}
.post-card-badges { position: absolute; top: 10px; left: 10px; z-index: 3; display: flex; gap: 6px; }
.post-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-card-title { font-size: 16px; font-weight: 700; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card-title a:hover { color: var(--primary); }
.post-card-excerpt {
  color: var(--text-2); font-size: 13px; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card-meta { margin-top: auto; display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 12px; }
.post-card-tags { display: flex; flex-wrap: wrap; margin-top: 10px; }
.post-card-tags .tag-chip { font-size: 12px; padding: 2px 9px; margin: 0 6px 6px 0; }
.meta-cat { color: var(--primary); font-weight: 600; }
.post-card--list { flex-direction: row; align-items: stretch; }
.post-card--list .post-card-cover { width: 260px; aspect-ratio: auto; flex: none; }
.post-card--list .post-card-body { flex: 1; }
.post-card--list .post-card-title { font-size: 18px; }

/* ---------- 9. 精选专题 ---------- */
.featured-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.featured-card { min-width: 0; }
.featured-card--lead { grid-column: 1 / -1; }
.featured-lead { position: relative; display: flex; min-height: 300px; border-radius: var(--radius-md); overflow: hidden; background: var(--primary-deep); }
.featured-lead-cover { position: absolute; inset: 0; background-size: cover; background-position: center; }
.featured-lead-shade { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(20, 12, 46, .88), transparent 70%); }
.featured-lead-body { position: relative; margin-top: auto; padding: 26px; color: #fff; display: flex; flex-direction: column; gap: 8px; }
.featured-lead-tag { align-self: flex-start; background: var(--primary); color: #fff; font-size: 12px; padding: 3px 10px; border-radius: 999px; }
.featured-lead-title { font-size: 24px; font-weight: 800; }
.featured-lead-desc { color: rgba(255, 255, 255, .78); font-size: 14px; }
.featured-groups { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.featured-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px; }
.featured-group-head { margin-bottom: 10px; }
.featured-group-title { font-size: 18px; }
.featured-group-desc { color: var(--text-3); font-size: 13px; }
.featured-mini {
  display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: baseline;
  padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 14px;
}
.featured-mini:last-child { border-bottom: 0; }
.featured-mini-no { color: var(--text-3); font-size: 13px; font-weight: 700; }
.featured-mini-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.featured-mini-time { color: var(--text-3); font-size: 12px; }

/* ---------- 10. 热门推荐 ---------- */
.hotpicks-grid { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hotpick-card { position: relative; }
.hotpick-no {
  position: absolute; top: 10px; right: 12px; z-index: 4;
  font-size: 32px; font-weight: 900; color: rgba(255, 255, 255, .9);
  text-shadow: 0 2px 10px rgba(0, 0, 0, .3);
}

/* ---------- 11. 最新文章 / 归档列表 ---------- */
.latest-grid { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.latest-grid--list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* 紧凑单列列表：封面比例对齐「热门推荐」网格卡片（--card-ratio，默认 16/9）。
   宽度 52% 是临界值：此时「比例换算出的高度」不低于任何一篇的正文高度，
   于是全部卡片封面统一 16/9，既不会被正文撑高变形，也不留白、不裁切正文。 */
.latest-grid--list .post-card--list .post-card-cover {
  width: 52%; aspect-ratio: var(--card-ratio, 16/9);
}

/* Sidebar 同排避让：主栏被 Sidebar 收窄后，栅格模块减少每行数量，避免卡片被挤成窄条。
   热门推荐与最新文章网格保持同一列数（3 列）—— 两者卡片等宽，封面比例同为
   --card-ratio，封面尺寸因此完全一致。仅在 Sidebar 可见的宽度区间生效（≤1080px 时隐藏）。 */
@media (min-width: 1081px) {
  .content-grid > .content-main .hotpicks-grid,
  .content-grid > .content-main .latest-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* 紧凑单列列表：每行一篇，卡片被拉得很宽，封面按「一列热门推荐的宽度」取值，
     否则 52% 换算出的封面会明显大过热门推荐。（须排在 .latest-grid 规则之后） */
  .content-grid > .content-main .latest-grid--list { grid-template-columns: minmax(0, 1fr); }
  .content-grid > .content-main .latest-grid--list .post-card--list .post-card-cover {
    width: calc((100% - 32px) / 3);
  }
}
/* 分类 / 标签 / 作者页的卡片网格：列数与「热门推荐」镜像，卡片等宽 →
   封面尺寸与首页热门推荐完全一致（比例本就同源：两者由 post-card 按 --card-ratio 注入）。
   图文列表变体（.archive-grid--list）恒为单列，故写法上多带一个类提高特异性，
   避免被其后的 .archive-grid 列数规则（含媒体查询）覆盖。 */
.archive-grid { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.archive-grid.archive-grid--list { grid-template-columns: 1fr; }
/* 图文列表（分类页「图文列表」模式）：封面比例与「热门推荐」一致（同 --card-ratio，默认 16/9）。
   列表卡片是横向 flex，而 .post-card--list 为 align-items: stretch，封面会被拉高到与正文等高，
   比例随正文长短浮动（原先就是这个问题），故用 align-self: flex-start 退出拉伸，
   高度完全由比例决定（比正文矮时垂直居中，不再被拉高变形）；宽度取 260px，与基础值一致。
   移动端另有规则（封面转 100% 宽 + 16/9）在文件后部覆盖宽度。 */
.archive-grid--list .post-card--list .post-card-cover {
  width: 260px; aspect-ratio: var(--card-ratio, 16/9); align-self: center;
}

/* ---------- 12. 侧边栏挂件 ---------- */
/* 平板及以下才出现的侧边栏折叠入口（后台「响应式 → 平板端侧边栏折叠为展开块」）。
   桌面端不参与布局，先整体摘除；≤1080px 且 body[data-sidebar-fold="on"] 时由第 20 节接管，
   那里同时把 .sidebar-inner 改成「默认收起 / .is-open 展开」。 */
.sidebar-fold-toggle { display: none; }
.site-sidebar .sidebar-inner { display: flex; flex-direction: column; gap: 18px; }
/* 侧边栏跟随页面滚动（theme.config.sidebar.sticky=true）：整栏吸附在导航栏下方跟随滑动。
   ★ 适合 Sidebar 内容较少（整栏高度小于视口）时开启 —— 此时整栏完整跟随，无内部滚动。
   带「文章目录」的页面内容通常较长，不走整栏吸附，由目录自身吸附（见第 12 节末）。 */
.site-sidebar .sidebar-inner[data-sticky="true"]:not(:has(.widget-toc)) {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  height: auto;                                    /* 取消末尾的 height:100% 拉伸：
                                                      否则整栏与父级等高，吸附没有行程 */
}
/* 模式 A（默认）「栏内滚动」：整栏继续吸附，超出一屏的部分在栏内滚动查看 */
.site-sidebar .sidebar-inner[data-sticky="true"]:not([data-sticky-full="true"]):not(:has(.widget-toc)) {
  max-height: calc(100vh - var(--header-h) - 32px);
  overflow-y: auto;
}
/* 模式 B「整栏完整跟随」（sidebar.stickyFull=true）：全程不出现栏内滚动条。
   加高度限制会截断内容，故此处显式解除；内容超过一屏时由 theme.js（initSidebarSticky）
   写入负向 top，让整栏底部贴住视口下沿 —— 页面滚动即可从首个挂件看到最后一个挂件。 */
.site-sidebar .sidebar-inner[data-sticky="true"][data-sticky-full="true"]:not(:has(.widget-toc)) {
  max-height: none;
  overflow: visible;
}
.widget-title { font-size: 16px; font-weight: 700; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); position: relative; }
.widget-title::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 34px; height: 3px; border-radius: 3px; background: var(--primary); }
.widget-empty { color: var(--text-3); font-size: 13px; margin: 0; }
/* 侧边栏组件标题右侧的「查看全部」入口（如热门标签 → /tags） */
.widget-more { position: absolute; right: 0; bottom: 12px; font-size: 12px; font-weight: 400; color: var(--text-3); }
.widget-more:hover { color: var(--primary); }
.sidebar-widget > .card { padding: 18px; }

/* 个人品牌 */
.widget-profile-bg {
  height: 72px; margin: -18px -18px 0; border-radius: var(--radius-md) var(--radius-md) 0 0;
  background-size: cover; background-position: center;
}
.widget-profile-head { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
.widget-profile-avatar {
  width: 60px; height: 60px; flex: none; border-radius: 50%;
  object-fit: cover; background: var(--primary-weak); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 24px;
}

/* 头像地址失效（404 / 外链被拦）时的文字兜底：由 theme.js initProfileMedia 替换 <img> 生成。
   尺寸沿用原头像类（.widget-profile-avatar / .post-author-avatar），这里只补文字排布。 */
.avatar-fallback-text {
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-weak); color: var(--primary); font-weight: 800;
}

/* ---------- 个人品牌头像特效 ----------
   两个效果各自独立开关（后台「个人品牌 → 头像特效」），模板按配置注入修饰类：
     .avatar-fx--zoom  悬停时头像轻微放大（1.06）
     .avatar-fx--halo  悬停时出现佛光：贴头像外沿的锥形渐变光带旋转 + 外层柔光呼吸
   实现说明：头像可能是 <img>（伪元素对它无效），所以由外层 .avatar-fx 承载光效。
   isolation 让负 z-index 的光晕只压在头像之下，不影响卡片背景。 */
.avatar-fx {
  position: relative; flex: none; display: inline-flex;
  border-radius: 50%; isolation: isolate;
}
/* 环绕光带：conic-gradient 做渐亮弧，mask 挖空中心只留细环（默认不可见，仅 --halo 悬停时点亮） */
.avatar-fx::before {
  content: ""; position: absolute; inset: -5px; border-radius: 50%; pointer-events: none; z-index: -1;
  background: conic-gradient(from 0deg,
      rgba(108, 65, 255, 0) 0deg, var(--primary) 72deg,
      rgba(108, 65, 255, 0) 156deg, rgba(108, 65, 255, 0) 360deg);
  -webkit-mask: radial-gradient(farthest-side, rgba(0, 0, 0, 0) calc(100% - 2.5px), #000 calc(100% - 2.5px));
          mask: radial-gradient(farthest-side, rgba(0, 0, 0, 0) calc(100% - 2.5px), #000 calc(100% - 2.5px));
  opacity: 0; animation: avatarHaloSpin 2.8s linear infinite; animation-play-state: paused;
  transition: opacity .35s ease;
}
/* 外层柔光：佛光的氛围光晕（默认不可见） */
.avatar-fx::after {
  content: ""; position: absolute; inset: -14px; border-radius: 50%; pointer-events: none; z-index: -1;
  background: radial-gradient(circle, var(--primary) 0%, rgba(108, 65, 255, 0) 70%);
  filter: blur(7px); opacity: 0; transition: opacity .4s ease;
}

/* 开关 1：悬停放大 */
.avatar-fx--zoom .widget-profile-avatar,
.avatar-fx--zoom .post-author-avatar { transition: transform .4s cubic-bezier(.22, .68, .34, 1.1); }
.avatar-fx--zoom:hover .widget-profile-avatar,
.avatar-fx--zoom:focus-within .widget-profile-avatar,
.avatar-fx--zoom:hover .post-author-avatar,
.avatar-fx--zoom:focus-within .post-author-avatar { transform: scale(1.06); }

/* 开关 2：佛光环绕 */
.avatar-fx--halo:hover::before,
.avatar-fx--halo:focus-within::before { opacity: .9; animation-play-state: running; }
.avatar-fx--halo:hover::after,
.avatar-fx--halo:focus-within::after { opacity: .32; animation: avatarHaloPulse 2.8s ease-in-out infinite; }

@keyframes avatarHaloSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes avatarHaloPulse {
  0%, 100% { opacity: .22; }
  50% { opacity: .42; }
}
@media (prefers-reduced-motion: reduce) {
  .avatar-fx::before, .avatar-fx::after { animation: none; }
  .avatar-fx--zoom .widget-profile-avatar, .avatar-fx--zoom .post-author-avatar { transition: none; }
  .avatar-fx--zoom:hover .widget-profile-avatar, .avatar-fx--zoom:focus-within .widget-profile-avatar,
  .avatar-fx--zoom:hover .post-author-avatar, .avatar-fx--zoom:focus-within .post-author-avatar { transform: none; }
}
.widget-profile-name { font-weight: 700; font-size: 16px; display: flex; align-items: center; }
.widget-profile-tagline { color: var(--text-2); font-size: 13px; margin: 2px 0 0; }
.widget-profile-bio { color: var(--text-2); font-size: 13px; margin: 12px 0; }
/* 列数由模板按可见统计项数量注入（--stat-cols），默认 3 列 */
.widget-profile-stats { display: grid; grid-template-columns: repeat(var(--stat-cols, 3), 1fr); gap: 8px; margin: 14px 0; }
.stat-cell { text-align: center; }
.stat-num { display: block; font-size: 18px; font-weight: 800; }
.stat-label { color: var(--text-3); font-size: 12px; }

/* 自媒体 */
.social-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.social-chip {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 10px; font-size: 13px;
  background: var(--surface);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
/* 悬停反馈：可点卡片与静态卡片统一，避免一排卡片里只有填了「链接」的那个有反应。
   可点性不靠悬停表达，而是靠「是否跳转 + 光标形状」（静态卡片为 default 光标，
   并带 aria-disabled），所以两边用同一套高亮是安全的 */
.social-chip:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
/* 未填「链接」的平台：仅展示、不跳转，光标保持默认 */
.social-chip.is-static { cursor: default; }
.social-icon {
  width: 28px; height: 28px; border-radius: 50%; flex: none; overflow: hidden;
  background: var(--primary-weak); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px;
}
.social-icon img { width: 100%; height: 100%; object-fit: cover; }
/* 头像悬停放大（后台「自媒体 → 头像悬停放大」，由模板在 .widget-social 上挂
   .widget-social--icon-zoom 控制，关闭时这两条规则整体不生效）。
   悬停整张卡片即触发，头像在卡片内，所以指针落在头像上也成立。
   缩放对象是整个 .social-icon：自定义图标与「名称首字」兜底两种形态都有效；
   28px 的头像用 1.15 倍（约 +4px），看得见又不跳。 */
.widget-social--icon-zoom .social-icon { transition: transform .22s ease; }
.widget-social--icon-zoom .social-chip:hover .social-icon { transform: scale(1.15); }
.social-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.social-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.social-id { color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 400px) { .social-grid { grid-template-columns: 1fr; } }

/* 公众号 */
.widget-wechat { text-align: center; }
.widget-wechat-name { font-weight: 700; }
.widget-wechat-intro { color: var(--text-2); font-size: 13px; }
/* 图片区：宣传封面横幅在上，二维码在下（各自独立，均支持明暗双图） */
.widget-wechat-media { margin: 12px auto 0; display: flex; flex-direction: column; gap: 10px; }
.widget-wechat-media > a { display: flex; flex-direction: column; gap: 10px; }
.wechat-media-cover { width: 100%; }
.wechat-media-qr { width: 150px; margin: 0 auto; cursor: zoom-in; }
.widget-wechat-img { display: block; width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border); }
/* 明暗双图：仅当上传了深色版（.has-dark）时才在深色模式下替换 */
.wechat-img--dark { display: none; }
[data-theme="dark"] .widget-wechat .has-dark .wechat-img--light { display: none; }
[data-theme="dark"] .widget-wechat .has-dark .wechat-img--dark { display: block; }
.widget-wechat-hint { color: var(--text-3); font-size: 12px; }

/* 热门排行 */
.rank-item { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: baseline; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.rank-item:last-child { border-bottom: 0; }
.rank-no { font-weight: 800; color: var(--text-3); font-size: 14px; }
.rank-item:nth-child(-n+3) .rank-no { color: var(--primary); font-weight: 900; }
.rank-link { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-link:hover { color: var(--primary); }
.rank-visits { color: var(--text-3); font-size: 12px; }

/* ---------- 13. 文章详情 ---------- */
.post-article { padding: 34px 40px 40px; }
.post-header { margin-bottom: 24px; }
.post-title { font-size: clamp(24px, 3.4vw, 34px); font-weight: 800; margin: 6px 0 14px; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; color: var(--text-3); font-size: 13px; }
.meta-item--cats a { color: var(--primary); margin-right: 6px; }
/* 标题下文章作者：小圆头像 + 名称，与其余 meta 项同色同字号 */
.meta-author { display: inline-flex; align-items: center; gap: 6px; }
.meta-author-avatar { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; display: block; }
.meta-author-name { color: var(--text-2); }

/* 侧边栏「文章目录」 */
/* 侧边栏拉满整行高度（默认 align-items:start 会压缩成自身内容高度，导致跟随空间不足） */
.site-sidebar { align-self: stretch; }
.site-sidebar .sidebar-inner { height: 100%; }
/* 常驻跟随：滚到目录位置开始固定，回滚到其上方自动复位
   （含目录时整栏不吸附，只让目录跟随 —— 见第 12 节） */
.sidebar-widget--toc { position: sticky; top: calc(var(--header-h) + 16px); z-index: 2; }
.widget-toc-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 700; margin-bottom: 12px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.widget-toc-title::before {
  content: ""; flex: none; width: 3px; height: 14px; border-radius: 2px; background: var(--primary);
}
.widget-toc-list {
  position: relative; display: flex; flex-direction: column; gap: 2px;
  max-height: 58vh; overflow-y: auto; padding-right: 4px;
}
.widget-toc-list::-webkit-scrollbar { width: 4px; }
.widget-toc-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.widget-toc-list li a {
  position: relative; display: block;
  font-size: 13px; line-height: 1.55; color: var(--text-2);
  padding: 6px 10px; border-radius: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background .18s, color .18s;
}
.widget-toc-list li a:hover { color: var(--primary); background: var(--primary-weak); }
.widget-toc-list li a.is-active { color: var(--primary); background: var(--primary-weak); font-weight: 600; }
.widget-toc-list li a.is-active::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--primary);
}
.widget-toc-list li.toc-h3 a { padding-left: 22px; font-size: 12.5px; }
.widget-toc-list li.toc-h3 a::after {
  content: ""; position: absolute; left: 10px; top: 50%;
  width: 4px; height: 4px; margin-top: -2px; border-radius: 50%; background: var(--border);
}
.widget-toc-list li.toc-h4 a { padding-left: 32px; font-size: 12.5px; }
.widget-toc-progress { height: 2px; border-radius: 2px; background: var(--border); margin-top: 12px; overflow: hidden; }
.widget-toc-progress span { display: block; height: 100%; width: 0; background: var(--primary); transition: width .18s; }

/* 正文排版 */
.post-content { font-size: 16px; line-height: 1.9; color: var(--text); overflow-wrap: break-word; }
.post-content > *:first-child { margin-top: 0; }
.post-content p, .post-content ul, .post-content ol, .post-content blockquote, .post-content pre, .post-content table { margin: 0 0 1.2em; }
.post-content h2, .post-content h3, .post-content h4 { margin: 1.8em 0 .7em; scroll-margin-top: calc(var(--header-h) + 16px); }
.post-content h2 { font-size: 25px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.post-content h3 { font-size: 20px; }
.post-content a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.post-content img { border-radius: var(--radius-sm); cursor: zoom-in; }
/* 正文图片（含首图）居中：编辑器输出的 figure 带内联 style="align-items:start"，
   需用 !important 覆盖；img 只有 width 属性，补 max-width/height 保证窄屏不溢出 */
.post-content figure[data-content-type="image"] {
  display: flex;
  flex-direction: column;
  align-items: center !important;
  text-align: center;
  margin: 0 0 1.2em;
}
.post-content figure img { max-width: 100%; height: auto; }
.post-content ul { list-style: disc; padding-left: 1.5em; }
.post-content ol { list-style: decimal; padding-left: 1.5em; }
.post-content blockquote {
  border-left: 4px solid var(--primary); background: var(--primary-weak);
  padding: 10px 18px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text-2);
}
.post-content :not(pre) > code {
  font-family: var(--font-mono); font-size: 0.9em; font-weight: 600;
  background: var(--code-inline-bg); color: var(--code-inline-fg);
  border: 1px solid var(--code-inline-border);
  padding: 1px 6px; border-radius: 5px;
}
.post-content pre {
  background: #171031; color: #dbe4f5; border-radius: var(--radius-sm);
  padding: 16px 18px; overflow-x: auto; line-height: 1.7;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.post-content pre code { background: transparent; color: inherit; padding: 0; }
.post-content table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.post-content th, .post-content td { border: 1px solid var(--border); padding: 8px 14px; font-size: 14px; }
.post-content th { background: var(--primary-weak); }

.post-footer-meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 20px; margin-top: 26px; border-top: 1px solid var(--border); }
.post-tags { display: flex; flex-wrap: wrap; }

/* ---- 文章分享（复刻 theme-hao：扫码 / 微博 / 复制链接） ---- */
.post-share { display: flex; align-items: center; gap: 8px; }
.post-share__btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--border); border-radius: 50%;
  background: transparent; color: var(--text-2);
  cursor: pointer; transition: color .2s, border-color .2s, transform .2s;
}
.post-share__btn:hover { color: var(--primary); border-color: var(--primary); transform: translateY(-2px); }

/* 手机扫码：按钮上方弹出二维码浮层（与打赏气泡同一定位风格） */
.post-share__qr { position: relative; display: inline-flex; }
.post-share__qr-pop {
  position: absolute; bottom: calc(100% + 10px); left: 50%;
  transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 12px 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  text-align: center; z-index: 30;
}
.post-share__qr-pop::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--border);
}
.post-share__qr-canvas img { display: block; width: 120px; height: 120px; }
.post-share__qr-desc { margin: 8px 0 2px; font-size: 12px; color: var(--text-2); white-space: nowrap; }

/* 复制成功提示按钮态 */
.post-share__btn.is-copied { color: var(--primary); border-color: var(--primary); }

.post-copyright {
  display: flex; align-items: flex-start; gap: 10px;
  margin-top: 20px; padding: 14px 16px;
  background: var(--primary-soft); border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm); font-size: 13px; line-height: 1.8; color: var(--text-2);
}
.post-copyright-label { flex: none; font-weight: 700; color: var(--primary); }
.post-copyright-body { margin: 0; }

/* 过期提示（正文上方）：发布超过「文章页面 → 过期天数」后出现，文案可含 HTML */
.post-outdated {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 0 0 22px; padding: 13px 16px;
  background: var(--primary-soft); border: 1px solid var(--primary-weak);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm); font-size: 13px; line-height: 1.8; color: var(--text-2);
}
.post-outdated-icon {
  flex: none; width: 18px; height: 18px; margin-top: 3px; border-radius: 50%;
  background: var(--primary); color: var(--on-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; line-height: 1;
}
.post-outdated-body { min-width: 0; }
.post-outdated-body > :first-child { margin-top: 0; }
.post-outdated-body > :last-child { margin-bottom: 0; }
.post-outdated-body a { color: var(--primary); }

/* 受限内容提示（正文上方）：仅匿名访客打开受限文章时出现，提示登录后可见 */
.post-restricted-tip {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 0 0 22px; padding: 13px 16px;
  background: var(--primary-soft); border: 1px solid var(--primary-weak);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm); font-size: 13px; line-height: 1.8; color: var(--text-2);
}
.post-restricted-icon { flex: none; margin-top: 3px; color: var(--primary); }
.post-restricted-body { min-width: 0; }
.post-restricted-link {
  margin-left: 6px; color: var(--primary); font-weight: 600; white-space: nowrap;
}
.post-restricted-link:hover { text-decoration: underline; }

.post-author { display: flex; align-items: center; gap: 14px; padding: 18px; margin-top: 26px; position: relative; }
.post-author-avatar {
  width: 52px; height: 52px; flex: none; border-radius: 50%; object-fit: cover;
  background: var(--primary-weak); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 20px;
}
.post-author-name { font-weight: 700; }
.post-author-bio { color: var(--text-2); font-size: 13px; margin: 2px 0 0; }
.post-author-label { margin-left: auto; color: var(--text-3); font-size: 12px; }

.post-prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 26px; }
.pn-item {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 16px 18px; transition: .15s;
}
.pn-item:hover { border-color: var(--primary); }
.pn-item--next { text-align: right; }
.pn-label { color: var(--text-3); font-size: 12px; }
.pn-title { font-weight: 600; font-size: 15px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

.section--related { padding-top: 30px; }
.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
/* 评论区：视口外跳过渲染，快速拖动经过时不触发评论组件初始化/重排 */
.post-comments {
  content-visibility: auto;
  contain-intrinsic-size: auto 600px;
}
.comment-title { font-size: 18px; margin: 30px 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }

/* ---------- 14. 列表页头部 ---------- */
.page-hero { margin: 34px 0 26px; }
.page-hero-title { font-size: 30px; font-weight: 800; }
.page-hero-subtitle { color: var(--text-2); margin-top: 6px; }
.page-hero-meta { color: var(--primary); font-size: 13px; display: inline-block; margin-top: 8px; }
.page-hero--taxonomy {
  padding: 28px 30px; background-size: cover; background-position: center;
}
.page-hero--taxonomy.card { min-height: 150px; display: flex; flex-direction: column; justify-content: flex-end; }
.page-hero--has-cover {
  border-color: transparent;
  background-image: linear-gradient(rgba(26, 15, 66, .72), rgba(26, 15, 66, .72)), var(--ph-cover-img, none);
}
.page-hero--has-cover .page-hero-title { color: #fff; }
.page-hero--has-cover .page-hero-subtitle { color: rgba(255, 255, 255, .82); }
.page-hero--has-cover .page-hero-meta { color: rgba(255, 255, 255, .72); }
.page-hero--author { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 40px 30px; }
.page-hero-avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; margin-bottom: 12px; background: var(--primary-weak); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 40px; font-weight: 800; }
.subcategories { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 20px; }
.subcat-chip { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 5px 16px; font-size: 13px; }
.subcat-chip:hover { border-color: var(--primary); color: var(--primary); }

/* 面包屑层级导航（分类页）：首页 › 全部分类 › 父分类 › 当前分类 */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 22px 0 0; font-size: 13px; color: var(--text-3); }
.breadcrumb-link { color: var(--text-2); }
.breadcrumb-link:hover { color: var(--primary); }
.breadcrumb-sep { color: var(--text-3); opacity: .7; }
.breadcrumb-current { color: var(--text); font-weight: 600; }

/* ---------- 15. 分类 / 标签 / 归档 / 独立页面 ---------- */
.categories-all-grid, .tags-all-cloud { padding-bottom: 40px; }
.category-card--flat { }

/* ---------- 全部分类页：分类树（子分类缩进 + 父子连接线） ----------
   结构：.cat-node > .category-card + .cat-children > .cat-node …
   连接线全部由 .cat-node 的伪元素绘制（卡片本身 overflow:hidden，画不出界），
   竖线画在父卡片左侧内 12px 处，横线从竖线连到子卡片左边缘、正对分类名。 */
.categories-all-grid {
  --cat-indent: 48px;        /* 每级缩进 */
  --cat-line-offset: 24px;   /* 竖线相对父卡片左边缘的位置（≈ 图标左侧，看起来像从图标下方引出） */
  --cat-line-y: 26px;        /* 横线高度（自卡片顶部起，正对分类名） */
  --cat-gap: 10px;           /* 卡片间距，竖线跨越这段间距把父子连起来 */
  --cat-line: rgba(108, 65, 255, .42);
}
[data-theme="dark"] .categories-all-grid { --cat-line: rgba(140, 107, 255, .55); }
.categories-all-grid .cat-node { position: relative; display: flow-root; }
.categories-all-grid .category-card { margin-bottom: var(--cat-gap); }
.categories-all-grid .cat-children { padding-left: var(--cat-indent); }
/* 竖线：从上一个卡片底部（父卡片下沿）起，向下贯穿本节点（含它自己的子级） */
.categories-all-grid .cat-children > .cat-node::before {
  content: ""; position: absolute; z-index: 0;
  left: calc(var(--cat-line-offset) - var(--cat-indent));
  top: calc(-1 * var(--cat-gap)); bottom: 0;
  border-left: 1px solid var(--cat-line);
}
/* 最后一个子分类：竖线到自己的横线处为止，不再往下延伸 */
.categories-all-grid .cat-children > .cat-node:last-child::before {
  bottom: auto; height: calc(var(--cat-gap) + var(--cat-line-y));
}
/* 横线：指向卡片左边缘，横向接到分类名左侧 */
.categories-all-grid .cat-children > .cat-node::after {
  content: ""; position: absolute; z-index: 0;
  left: calc(var(--cat-line-offset) - var(--cat-indent));
  top: var(--cat-line-y);
  width: calc(var(--cat-indent) - var(--cat-line-offset));
  border-top: 1px solid var(--cat-line);
}
/* 子分类卡片略紧凑，左侧一条浅色竖线提示层级归属（仅作用于「全部分类」页，避免影响首页热门分类卡） */
.categories-all-grid .category-card:not(.category-card--depth-1) { padding: 14px 16px; gap: 12px; border-left: 3px solid var(--primary-weak); }
.categories-all-grid .category-card:not(.category-card--depth-1) .category-card-cover,
.categories-all-grid .category-card:not(.category-card--depth-1) .category-card-icon { width: 42px; height: 42px; font-size: 18px; }
.categories-all-grid .category-card:not(.category-card--depth-1) .category-card-name { font-size: 15px; }
@media (max-width: 640px) {
  .categories-all-grid { --cat-indent: 30px; --cat-line-offset: 16px; --cat-line-y: 24px; }
}
.page-tags .tags-all-cloud, .page-categories .categories-all-grid { margin-bottom: 40px; }

.archives-list { margin-bottom: 44px; }
.archive-year { margin-bottom: 26px; }
.archive-year-head { display: flex; align-items: baseline; gap: 12px; border-bottom: 2px solid var(--text); padding-bottom: 8px; margin-bottom: 14px; }
.archive-year-title { font-size: 26px; font-weight: 800; }
.archive-year-count { color: var(--text-3); font-size: 13px; }
.archive-month { margin-bottom: 18px; }
.archive-month-title { font-size: 17px; display: flex; align-items: baseline; gap: 6px; margin-bottom: 6px; color: var(--text-2); }
.archive-month-count { color: var(--text-3); font-size: 12px; margin-left: 4px; }
.archive-post { display: grid; grid-template-columns: 62px 1fr auto; gap: 12px; align-items: baseline; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.archive-post-date { color: var(--text-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.archive-post-title:hover { color: var(--primary); }
.archive-post-cat { color: var(--primary); font-size: 12px; }
/* 归档列表封面（「分类与标签 → 归档页显示封面」开关，默认开）：
   比例与「热门推荐」等卡片同源 —— 模板把 media.coverRatio 换算成 --card-ratio 注入
   .archive-month-posts，改「图片与媒体 → 卡片封面比例」时这里同步生效。
   封面列固定 168px 宽（移动端 128px）：未设封面的文章同样渲染占位底，保证整列标题起点对齐。
   标题与描述（「归档页显示文章描述」开关控制）包在 .archive-post-main 内，
   有无封面时结构一致，故两种形态共用同一份样式。
   分类名是随行末的 auto 列，若 main 列占满剩余宽度，描述末行会顶到分类名/页面边缘；
   故 main 列右侧留出约两个分类名宽度的内边距（180px），让出明显空间给分类名。 */
.archive-post--cover { grid-template-columns: 62px 168px minmax(0, 1fr) auto; align-items: center; padding: 10px 0; }
.archive-post-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; padding-right: 180px; }
.archive-post-desc {
  color: var(--text-3); font-size: 13px; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.archive-post-cover {
  display: block; width: 100%; border-radius: 8px; overflow: hidden;
  aspect-ratio: var(--card-ratio, 16/9); background: var(--primary-weak);
}
.archive-post-cover img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.archive-post:hover .archive-post-cover img { transform: scale(1.06); }
.archive-post-cover-empty {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary-weak), transparent); color: var(--primary); opacity: .6;
}

.about-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; margin-bottom: 40px; }
.about-side { position: sticky; top: calc(var(--header-h) + 20px); }

/* ---------- 16. 搜索 / 浮层 / 灯箱 ---------- */
.search-panel { padding: 28px; margin-bottom: 44px; }
.search-form { display: flex; gap: 12px; }
.search-input {
  flex: 1; min-width: 0;
  padding: 11px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); font-size: 15px; outline: none;
}
.search-input:focus { border-color: var(--primary); }
.search-tip { color: var(--text-3); font-size: 13px; margin: 12px 0 0; }
.search-results { margin-top: 16px; }

.search-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(18, 11, 44, .62); backdrop-filter: blur(4px);
  display: flex; justify-content: center; align-items: flex-start; padding: 14vh 20px 0;
}
.search-overlay-panel {
  width: min(680px, 100%); background: var(--surface); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); padding: 18px; max-height: 60vh; display: flex; flex-direction: column;
}
.search-close {
  width: 34px; height: 34px; flex: none; border: 0; background: var(--primary-weak); color: var(--text-2);
  border-radius: var(--radius-sm); font-size: 20px; line-height: 1;
}
.search-overlay-results { overflow: auto; margin-top: 12px; }
.search-result-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 6px; border-bottom: 1px dashed var(--border);
}
.search-result-item:hover .sr-title { color: var(--primary); }
.sr-title { font-weight: 600; }
.sr-excerpt { color: var(--text-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-empty { color: var(--text-3); padding: 20px 0; text-align: center; }
.search-count { padding: 2px 2px 10px; font-size: 13px; color: var(--text-3); }
.search-total { padding: 10px 2px 0; font-size: 12px; color: var(--text-3); }
.search-result-list mark { background: var(--primary-weak); color: var(--primary); padding: 0 2px; border-radius: 3px; }

.lightbox {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0, 0, 0, .9);
  display: flex; align-items: center; justify-content: center; padding: 30px;
}
.lightbox-img { max-width: 92vw; max-height: 88vh; border-radius: var(--radius-sm); object-fit: contain; }
.lightbox-close {
  position: absolute; top: 18px; right: 24px; width: 42px; height: 42px;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 26px;
}

/* ---------- 17. 分页 ---------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 30px 0 40px; }
.pagination-link { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 18px; font-size: 14px; }
.pagination-link:hover { border-color: var(--primary); color: var(--primary); }
.pagination-now { color: var(--text-3); font-size: 14px; }

/* ---------- 18. 页脚 ---------- */
/* 参考 11_Footer：深靛块（#1A0F42 + 亮紫 hover），浅/深主题下统一 */
.site-footer { margin-top: 60px; background: var(--primary-deep); color: rgba(255, 255, 255, .8); }
.footer-inner {
  display: grid; grid-template-columns: 1fr;
  gap: 30px; padding: 44px 20px 30px;
}
/* 品牌列：仍居左侧，与栏目层叠加在同一网格区域内 */
.footer-brand { grid-area: 1 / 1; }
/* Footer 栏目区：叠加于品牌列之上，以页脚整幅中心为基准居中 */
.footer-cols {
  grid-area: 1 / 1; justify-self: center; max-width: 100%;
  display: flex; flex-wrap: wrap; align-items: flex-start;
  justify-content: center; gap: 30px 48px; min-width: 0;
}
.footer-col { min-width: 160px; text-align: center; }
.footer-brand-title { font-size: 20px; font-weight: 800; color: #fff; }
.footer-tagline { color: rgba(255, 255, 255, .66); font-size: 14px; margin: 8px 0 0; }
/* 页脚二维码：图片在上、注释在下（各自支持明暗双图） */
.footer-wechat { display: inline-flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 16px; }
.footer-wechat-qr {
  width: 96px; height: 96px; border-radius: 8px; object-fit: contain;
  border: 1px solid rgba(255, 255, 255, .2); background: #fff; padding: 4px;
}
.footer-wechat-name { color: rgba(255, 255, 255, .6); font-size: 13px; text-align: center; }
/* 明暗双图：仅当上传了深色版（.has-dark）时才在深色模式下替换 */
.footer-wechat-img--dark { display: none; }
[data-theme="dark"] .footer-wechat.has-dark .footer-wechat-img--light { display: none; }
[data-theme="dark"] .footer-wechat.has-dark .footer-wechat-img--dark { display: block; }
.footer-col-title { font-size: 15px; margin-bottom: 14px; color: #fff; }
.footer-col-links li { margin-bottom: 9px; }
.footer-col-links a { color: rgba(255, 255, 255, .72); font-size: 14px; }
.footer-col-links a:hover { color: #a78bff; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .14); padding: 16px 0; }
.footer-bottom-inner { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: rgba(255, 255, 255, .55); font-size: 13px; }
.footer-halo, .footer-author { color: rgba(255, 255, 255, .8); font-weight: 600; }
.footer-dot { opacity: .6; }

/* ---- 页脚主题名「妹妹紫」：渐变填充字 ----
   设计思路：
   1. 实心填充 + 玫瑰金→粉紫的横向渐变（贴合主题配色），不再描边镂空；
   2. 光晕动画由背景渐变的定位缓慢流动（background-position）实现，
      悬停时流速加快且光晕增强（--glow 变量平滑过渡）；
   3. 老浏览器不支持 background-clip: text 时回退为实色玫瑰金 */
.footer-theme-name {
  --glow: .3;
  color: #e8b4a0;
  font-weight: 800;
  letter-spacing: .1em;
  background: linear-gradient(100deg,
    #e8b4a0 0%, #f3c6d8 30%, #c9a0f0 60%, #e8b4a0 100%) no-repeat;
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: footer-theme-flow 6s ease-in-out infinite;
}
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .footer-theme-name {
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 8px rgba(212, 140, 160, var(--glow)));
  }
}
.footer-theme-name:hover {
  --glow: .7;
  animation-duration: 2.5s;
}
@keyframes footer-theme-flow {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .footer-theme-name { animation: none; }
}

/* 主题署名链接：悬停亮起并发光 */
.footer-author { transition: color .2s, text-shadow .2s; }
.footer-author:hover {
  color: #fff;
  text-shadow: 0 0 12px rgba(192, 132, 252, .8);
}
/* RSS 订阅入口：图标 + 胶囊描边。
   层级说明：除「返回顶部」按钮(90)外，站点常在页脚注入 fixed 挂件
   （如 #support-widget：bottom/right 20px + z-index 9999，且淡出后仅 opacity:0、
   仍会拦截点击），会整片盖住视口右下角。故此处取 10000，保证入口始终可点、悬停可见 */
.footer-rss {
  margin-left: auto; position: relative; z-index: 10000;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px 4px 10px; border-radius: 999px;
  border: 1px solid rgba(167, 139, 255, .42);
  background: rgba(167, 139, 255, .1);
  color: #b7a3ff; font-weight: 600; font-size: 12.5px; letter-spacing: .4px;
  transition: color .2s ease, background .2s ease, border-color .2s ease,
              box-shadow .2s ease, transform .2s ease;
}
/* 图标不接收点击，事件统一落到外层 <a>，确保点图标也能跳转订阅页 */
.footer-rss-icon { width: 14px; height: 14px; flex: none; fill: currentColor; pointer-events: none; }
/* RSS 文字：渐变填充（background-clip: text，深浅主题下页脚均为深底，故共用一套亮色渐变） */
.footer-rss-text {
  background-image: linear-gradient(92deg, #c6abff 0%, #8ed1ff 50%, #ffa8e2 100%);
  background-size: 200% 100%; background-position: 0% 50%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  transition: background-position .45s ease;
}
.footer-rss:hover, .footer-rss:focus-visible {
  color: #fff; background: #7c5cff; border-color: #7c5cff;
  box-shadow: 0 6px 18px -6px rgba(124, 92, 255, .85);
  transform: translateY(-1px);
}
/* 悬停：文字换成更亮的一套渐变并横向滑动，实紫底上依然清晰 */
.footer-rss:hover .footer-rss-text,
.footer-rss:focus-visible .footer-rss-text {
  background-image: linear-gradient(92deg, #ffffff 0%, #d8c9ff 48%, #ffffff 100%);
  background-position: 100% 50%;
}
/* 悬停时图标信号点轻微闪动，强化「订阅」语义 */
.footer-rss:hover .footer-rss-icon path:first-child,
.footer-rss:focus-visible .footer-rss-icon path:first-child {
  animation: rssSignal .9s ease-in-out infinite;
}
@keyframes rssSignal { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) {
  .footer-rss, .footer-rss-text, .footer-rss-icon path { transition: none; animation: none; }
}
.footer-copy { display: inline-flex; align-items: baseline; gap: 6px; }
.footer-beian { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-beian-link { display: inline-flex; align-items: center; gap: 4px; color: rgba(255, 255, 255, .55); font-size: 13px; }
.footer-beian-link:hover { color: #a78bff; }
.footer-beian-icon { width: 16px; height: 16px; object-fit: contain; display: block; }

/* ---------- 19. 其他 ---------- */
/* 与页脚 RSS 同层级：高于第三方右下角挂件(9999)，否则会被其透明层吃掉点击 */
.back-to-top {
  position: fixed; right: 22px; bottom: 24px; z-index: 10000;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  box-shadow: var(--shadow-md); opacity: 0; visibility: hidden; transform: translateY(8px); transition: .2s;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
/* 全屏浮层（搜索 / 灯箱）打开时让位，避免压在半透明遮罩之上 */
body.is-search-open .back-to-top,
body.is-lightbox-open .back-to-top,
body.is-search-open .footer-rss,
body.is-lightbox-open .footer-rss { z-index: 50; }
.page-error { padding: 80px 0; }
.error-card { text-align: center; padding: 60px 30px; }
.error-code { font-size: 90px; font-weight: 900; line-height: 1; color: var(--primary); }
.error-title { margin: 14px 0 6px; font-size: 26px; }
.error-desc { color: var(--text-2); margin-bottom: 24px; }

/* 空首页 */
.section--empty-home { min-height: 40vh; display: flex; align-items: center; justify-content: center; }

/* ---------- 20. 移动端 ---------- */
@media (max-width: 1080px) {
  .hotpicks-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .latest-grid, .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* 分类 / 标签 / 作者页卡片网格同步降为 2 列，与热门推荐保持同一卡片宽度 */
  .archive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid--right, .content-grid--left { grid-template-columns: minmax(0, 1fr); }
  .content-grid--left .site-sidebar { order: 2; }
  .site-sidebar { display: none; }
  /* 「响应式 → 平板端侧边栏折叠为展开块」开启（默认）：上面那条隐藏规则被本条覆盖，
     侧边栏改为主内容下方的折叠面板，挂件不丢失 —— 折叠状态由 theme.js initSidebarFold 切换。
     开关关闭（off）时走回上一条：平板端整栏隐藏。
     .content-grid 在此断点已是单列，order 保证折叠块排在正文之后。 */
  [data-sidebar-fold="on"] .site-sidebar { display: block; order: 2; }
  [data-sidebar-fold="on"] .site-sidebar .sidebar-inner {
    display: none; position: static; height: auto; max-height: none; overflow: visible;
    margin-top: 10px; padding: 14px;
    border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface);
  }
  [data-sidebar-fold="on"] .site-sidebar.is-open .sidebar-inner { display: flex; }
  [data-sidebar-fold="on"] .sidebar-fold-toggle {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    width: 100%; padding: 12px 14px; cursor: pointer; text-align: left;
    font-size: 15px; font-weight: 600; color: var(--text-1);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  }
  [data-sidebar-fold="on"] .sidebar-fold-arrow { transition: transform .2s ease; }
  [data-sidebar-fold="on"] .site-sidebar.is-open .sidebar-fold-arrow { transform: rotate(180deg); }
  .about-layout { grid-template-columns: 1fr; }
  .about-side { position: static; }
  .hero-category { grid-template-columns: minmax(0, 1fr); min-height: 360px; }
  .hero-category-main { padding: 44px 32px 44px var(--hero-pad-x); }
  .hero-category-rec { display: none; }
  .hero-slider--category .hero-dots { right: 20px; bottom: 14px; }
  .hero-slide { min-height: 360px; }
  /* 1 大 2 小：平板端改为上下两排，右侧两屏横向并排 */
  .hero-stage--trio { grid-template-columns: minmax(0, 1fr); }
  .hero-stage-side { grid-template-rows: none; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-stage-side > .hero-slider { height: auto; }
  .hero-slider--side .hero-slider-track,
  .hero-slider--side .hero-slide-wrap { height: auto; }
  .hero-side-slide { height: 200px; min-height: 0; }
}
@media (max-width: 768px) {
  .header-inner { gap: 12px; }
  /* 移动端导航抽屉 —— 「响应式 → 移动端导航 = 右侧抽屉」（默认）。
     这里不加 [data-nav-style] 前缀：即使 body 属性缺失也回落到抽屉，形态不失控；
     dropdown 形态在其后用 data-nav-style 覆盖。开关与 @media 的关系：
     body[data-nav-style] 由 layout.html 从主题配置输出，切换后无需改 JS。 */
  .header-nav {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 70;
    width: min(320px, 82vw); background: var(--surface);
    transform: translateX(105%); transition: transform .25s ease;
    padding: 80px 20px 30px; overflow-y: auto;
    border-left: 1px solid var(--border);
    /* 收起态必须显式禁止命中：单靠「移出视口 / opacity:0」挡不住点击
       （opacity 不参与命中测试），透明面板会盖在正文上 ——
       点分类卡片会跳到导航里的另一个分类。打开时再恢复。 */
    pointer-events: none;
  }
  body.is-nav-open .header-nav { transform: none; pointer-events: auto; }
  /* 「移动端导航 = 下拉面板」：面板挂在导航栏下沿展开，不再是全高抽屉。
     absolute 相对 .site-header（relative / sticky 皆可）定位，随页面滚走，不铺满屏。 */
  body[data-nav-style="dropdown"] .header-nav {
    position: absolute; top: 100%; left: 0; right: 0; bottom: auto;
    width: auto; max-height: min(70vh, 460px); padding: 8px 10px 12px;
    background: var(--surface); border-left: 0; border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    transform: translateY(-6px); opacity: 0; visibility: hidden;
    transition: opacity .18s ease, transform .18s ease;
  }
  body[data-nav-style="dropdown"].is-nav-open .header-nav { transform: none; opacity: 1; visibility: visible; pointer-events: auto; }
  body[data-nav-style="dropdown"] .nav-link { padding: 10px 12px; }
  .nav-list { flex-direction: column; gap: 6px; justify-content: flex-start; }
  .nav-link { display: block; padding: 11px 14px; font-size: 16px; }
  .nav-dropdown {
    /* visibility 用 inherit 而非写死 visible：写死会盖过收起态面板的
       visibility: hidden，让子菜单变成「看不见却能点」的幽灵热区（点卡片跳错分类） */
    position: static; opacity: 1; visibility: inherit; transform: none;
    box-shadow: none; border: 0; padding: 0 0 0 14px;
  }
  .mobile-toggle { display: inline-flex; }
  .latest-grid, .latest-grid--list { grid-template-columns: 1fr; }
  /* 手机端一律单列：两列时每张卡只剩约 170px，封面比例和标题摘要都放不下 */
  .archive-grid { grid-template-columns: minmax(0, 1fr); }
  .archive-grid .post-card--list { flex-direction: column; }
  /* 列表卡片在移动端转纵向，封面铺满卡片宽度；比例统一走 --card-ratio，
     与 PC 端及网格卡片同源 —— 后台改「卡片封面比例」时移动端一并跟随。 */
  .archive-grid .post-card--list .post-card-cover { width: 100%; aspect-ratio: var(--card-ratio, 16/9); }
  .latest-grid .post-card--list .post-card-cover { width: 100%; aspect-ratio: var(--card-ratio, 16/9); }
  /* 归档列表：封面列收窄，给标题留出足够宽度；
     移动端空间紧张，把为分类名预留的右侧间距收敛为 80px。 */
  .archive-post--cover { grid-template-columns: 46px 128px minmax(0, 1fr) auto; gap: 10px; }
  .archive-post-main { padding-right: 80px; }
  .post-card--list { flex-direction: column; }
  .post-card--list .post-card-cover { width: 100%; aspect-ratio: var(--card-ratio, 16/9); }
  .hero-slide { min-height: 320px; }
  .hero { --hero-pad-x: 12px; }
  .hero-slide-content { padding-bottom: 56px; }
  /* 1 大 2 小：移动端右侧两屏改为纵向堆叠 */
  .hero-stage-side { grid-template-columns: minmax(0, 1fr); }
  .hero-side-slide { height: 170px; }
  /* 小屏叠加文字同步收敛，避免在矮卡片里压住画面 */
  .hero-side-content { padding: 12px 12px 10px; }
  .hero-side-title { font-size: 15px; }
  .hero-side-desc { margin-top: 4px; font-size: 12px; -webkit-line-clamp: 1; }
  .hero-category { min-height: 300px; }
  .hero-category-main { padding: 34px 22px 34px var(--hero-pad-x); }
  .hero-category-count { margin: 10px 0 18px; }
  /* 「响应式 → 移动端 Hero 布局 = 精简单卡」：手机端只保留第一屏画面 ——
     压低高度，去掉描述、切换箭头与圆点、右侧两个小屏、分类推荐卡，让首屏快速过渡到正文。
     stacked 为默认形态，不加任何覆盖，沿用上面几条纵向堆叠的规则。 */
  body[data-hero-mobile="compact"] .hero-slide { min-height: 240px; }
  body[data-hero-mobile="compact"] .hero-slide-content { padding-bottom: 32px; }
  body[data-hero-mobile="compact"] .hero-slider-track .hero-slide-wrap:not(:first-child) { display: none; }
  body[data-hero-mobile="compact"] .hero-desc,
  body[data-hero-mobile="compact"] .hero-arrow,
  body[data-hero-mobile="compact"] .hero-dots,
  body[data-hero-mobile="compact"] .hero-stage-side,
  body[data-hero-mobile="compact"] .hero-category-rec { display: none; }
  body[data-hero-mobile="compact"] .hero-category { min-height: 220px; }
  body[data-hero-mobile="compact"] .hero-category-main { padding: 26px 20px 26px var(--hero-pad-x); }
  /* 热门推荐：手机端一行一篇，避免两列挤压导致封面/标题被截断 */
  .hotpicks-grid { grid-template-columns: minmax(0, 1fr); }
  .featured-grid { grid-template-columns: 1fr; }
  .post-article { padding: 24px 18px 28px; }
  .related-grid { grid-template-columns: 1fr; }
  .post-prev-next { grid-template-columns: 1fr; }
  .pn-item--next { text-align: left; }
  .footer-inner { grid-template-columns: 1fr; gap: 20px; }
  .footer-brand, .footer-cols { grid-area: auto; }
  .footer-cols { justify-self: center; }
  /* 底栏：窄屏上版权 / 备案 / Powered by 会挤成一团，
     把最长的两块（版权、来自「基础设置」的 ICP / 公安备案）各占一行，其余照常折行 */
  .footer-bottom-inner { row-gap: 8px; column-gap: 12px; }
  .footer-copy, .footer-beian { flex: 1 0 100%; }
  .footer-beian { gap: 6px 12px; }
  .footer-rss { margin-left: 0; }
  .section { padding-top: 30px; }
}

/* ---------- 14. 小铺 / 装备页（equipment 插件前台页面） ----------
   插件自带样式（jar 内 static/equipment.css）里有 body{line-height:2}、
   *{box-sizing}、.layout{...} 等全局规则，会污染主题，故本页不复用插件 CSS，
   改用主题令牌重绘卡片；封面比例走 --card-ratio（模板注入，与 post-card 同源）：
   后台「图片与媒体 → 卡片封面比例」为 16:9 时，本页封面即 16:9，宽度变化时比例恒定
   （插件原样式是固定 height: 200px，比例随卡片宽度浮动）。 */
.page-equipment { padding-bottom: 48px; }
.equip-group { margin-top: 30px; }
.equip-group-title { font-size: 22px; font-weight: 800; line-height: 1.4; }
.equip-group-desc { color: var(--text-2); margin: 6px 0 0; font-size: 14px; }
.equip-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 16px;
}
.equip-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden; transition: .18s;
}
.equip-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: rgba(108, 65, 255, .45); }
.equip-card-cover {
  position: relative; display: flex; align-items: center; justify-content: center;
  aspect-ratio: var(--card-ratio, 16/9);
  background: var(--border); overflow: hidden;
}
.equip-card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.equip-card:hover .equip-card-cover img { transform: scale(1.05); }
.equip-card-cover-empty {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary-weak), transparent);
  color: var(--primary); font-size: 26px; font-weight: 800;
}
.equip-card-body { padding: 14px 16px 0; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.equip-card-name { font-size: 16px; font-weight: 700; line-height: 1.5; }
.equip-card-spec { color: var(--primary); font-size: 12px; margin: 0; }
.equip-card-desc {
  color: var(--text-2); font-size: 13px; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.equip-card-actions { margin-top: auto; padding: 10px 16px 14px; display: flex; justify-content: flex-end; }
.equip-card-link {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary); transition: .18s;
}
.equip-card-link:hover { background: var(--primary); color: var(--on-primary); }
html[data-shadow="false"] .equip-card { box-shadow: none !important; }

/* 顶部横幅（背景图 + 小标题 + 大标题 + 描述）：
   背景图 / 蒙版强度 / 高度由后台「我的装备页」设置以 CSS 变量注入
   （--ph-cover-img / --equip-overlay / --equip-hero-h），无背景图时用品牌渐变兜底。 */
.page-hero--equipment {
  position: relative; isolation: isolate; overflow: hidden;
  /* 与首页 Hero 首屏对齐：覆盖 .page-hero 的 34px 上边距，改用统一令牌 --gap-top */
  margin-top: var(--gap-top, 24px);
  display: flex; flex-direction: column; justify-content: flex-end;
  /* 高度由后台「我的装备页 → 顶部横幅高度」注入（紧凑 320 / 标准 440 / 高耸 600 px） */
  min-height: var(--equip-hero-h, 440px);
  padding: 30px 34px;
  background-size: cover; background-position: center;
}
.page-hero--equipment.page-hero--has-cover {
  background-image:
    linear-gradient(180deg,
      rgba(18, 11, 44, calc(var(--equip-overlay, 62) / 100 * .78)),
      rgba(18, 11, 44, calc(var(--equip-overlay, 62) / 100))),
    var(--ph-cover-img, none);
}
/* 无背景图兜底：品牌渐层 + 两层光斑，避免横幅"秃"掉 */
.page-hero--equipment:not(.page-hero--has-cover) {
  background-image:
    radial-gradient(120% 150% at 8% 0%, var(--primary-weak), transparent 60%),
    radial-gradient(90% 130% at 96% 6%, rgba(130, 97, 252, .22), transparent 58%),
    var(--grad-brand);
}
/* 右上高光：叠加在背景图上，做出层次与"炫酷"感 */
.page-hero--equipment::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(58% 76% at 84% 12%, rgba(255, 255, 255, .18), transparent 62%);
}
.page-hero--equipment .page-hero-title { font-size: clamp(26px, 3.6vw, 40px); line-height: 1.2; }
.page-hero--equipment .page-hero-subtitle { max-width: 760px; margin-top: 10px; font-size: 15px; white-space: pre-line; }
.page-hero--equipment:not(.page-hero--has-cover) .page-hero-title { color: #fff; }
.page-hero--equipment:not(.page-hero--has-cover) .page-hero-subtitle { color: rgba(255, 255, 255, .82); }
.page-hero--equipment:not(.page-hero--has-cover) .page-hero-meta { color: rgba(255, 255, 255, .72); }

/* 小标题：主色短标签 + 前置短线；有背景图时转白 */
.page-hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 10px; font-size: 12px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: var(--primary);
}
.page-hero-eyebrow::before {
  content: ""; width: 20px; height: 2px; border-radius: 2px;
  background: currentColor; opacity: .85;
}
.page-hero--has-cover .page-hero-eyebrow { color: #fff; opacity: .92; }

/* 分类快速导航：吸附在导航栏下方，锚点跳转到对应分组 */
.equip-nav {
  position: sticky; top: var(--header-h); z-index: 12;
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 0 0 20px; padding: 10px 0; background: var(--bg);
}
.equip-nav-item {
  padding: 5px 16px; font-size: 13px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); transition: .18s;
}
.equip-nav-item:hover { border-color: var(--primary); color: var(--primary); }
.equip-group { scroll-margin-top: calc(var(--header-h) + 60px); }
.equip-group-count {
  margin-left: 8px; padding: 2px 10px; vertical-align: middle;
  font-size: 12px; font-weight: 600; border-radius: 999px;
  color: var(--primary); background: var(--primary-soft);
}

@media (max-width: 1200px) { .equip-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .equip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .equip-grid { grid-template-columns: 1fr; }
  /* 手机端按比例收窄横幅，避免页头占满整屏 */
  .page-hero--equipment { padding: 22px 20px; min-height: calc(var(--equip-hero-h, 440px) * .66); }
  .page-hero-eyebrow { letter-spacing: .12em; }
}

/* ============================================================
   广告位（后台「广告与推广」，组件 components/promo.html）
   位置：post-top / post-bottom / index-top / index-bottom
   ============================================================ */
.promo-slot {
  position: relative;
  margin: 22px auto;
  border-radius: var(--radius-md);
}
/* 该位置没有广告时整体隐藏空壳（:has 不被支持时仅表现为一段空间距） */
.section--promo:not(:has(.promo-slot)) { display: none; }
/* 首页顶/底部由 .section 负责间距，卡片自身不再叠外边距 */
.section--promo .promo-slot { margin: 0; }
/* 同一位置放了多条广告时，彼此之间保留间距（否则会上下紧贴成一整块） */
.section--promo .promo-slot + .promo-slot { margin-top: 18px; }
/* 首页顶部的广告贴在导航下方，去掉额外的顶部间距 */
.promo-slot--index-top { margin-top: 0; }
.promo-label {
  position: absolute; z-index: 2; top: 8px; left: 8px;
  padding: 1px 8px; font-size: 11px; line-height: 1.7; border-radius: 999px;
  color: #fff; background: rgba(0, 0, 0, .42);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.promo-link { display: block; }
.promo-image {
  display: block; width: 100%; height: auto;
  border-radius: var(--radius-md); border: 1px solid var(--border);
}
.promo-script { text-align: center; }
.promo-script img, .promo-script ins, .promo-script iframe { max-width: 100%; }

/* 正文随机位置：隐藏广告池（theme.js 取出后即移除该节点，此处兜底防止闪烁） */
.promo-random-pool { display: none !important; }
/* 插入正文的广告：与段落同宽，去掉侧向额外边距 */
.promo-slot--incontent { margin: 26px 0; }

/* 侧边栏广告位：无广告时整块收起，不占间距；同一位置多条广告之间保留间距 */
.sidebar-widget--promo:not(:has(.promo-slot)) { display: none; }
.sidebar-widget--promo .promo-slot { margin: 0; }
.sidebar-widget--promo .promo-slot + .promo-slot { margin-top: 18px; }

/* ============================================================
   消息通知型广告位（后台「广告与推广」类型 = 文本/HTML 消息通知）
   用于向访客主动推送站点消息：正文按 HTML 原样输出，不显示「广告」角标
   ============================================================ */
/* 级别配色：默认蓝「通知」，其余级别覆盖为对应语义色；深色模式整体提亮 */
.promo-slot--notice { --notice-accent: #2f6fed; }
.promo-notice--success { --notice-accent: #3f9e4d; }
.promo-notice--warning { --notice-accent: #d9871a; }
.promo-notice--danger { --notice-accent: #dc3b40; }
[data-theme="dark"] .promo-slot--notice { --notice-accent: #7aa8ff; }
[data-theme="dark"] .promo-notice--success { --notice-accent: #6ec97c; }
[data-theme="dark"] .promo-notice--warning { --notice-accent: #f0b45c; }
[data-theme="dark"] .promo-notice--danger { --notice-accent: #ff7b80; }

.promo-notice {
  position: relative;
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--notice-accent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.promo-notice-icon {
  flex: 0 0 auto;
  width: 22px; height: 22px; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; line-height: 1; font-style: normal;
  color: #fff; background: var(--notice-accent); border-radius: 50%;
}
.promo-notice-icon::before { content: "i"; }
.promo-notice--success .promo-notice-icon::before { content: "✓"; }
.promo-notice--warning .promo-notice-icon::before { content: "!"; }
.promo-notice--danger .promo-notice-icon::before { content: "!"; }

.promo-notice-body { flex: 1 1 auto; min-width: 0; }
.promo-notice-title {
  margin: 0 0 4px;
  font-size: 15px; font-weight: 700; line-height: 1.5;
  color: var(--text);
}
/* 正文为后台 HTML 原样输出，这里给出块级元素的最小兜底排版 */
.promo-notice-text {
  font-size: 14px; line-height: 1.7; color: var(--text-2);
  overflow-wrap: break-word;
}
.promo-notice-text > :first-child { margin-top: 0; }
.promo-notice-text > :last-child { margin-bottom: 0; }
.promo-notice-text p { margin: 0 0 8px; }
.promo-notice-text strong, .promo-notice-text b { color: var(--text); }
.promo-notice-text a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.promo-notice-text ul, .promo-notice-text ol { margin: 0 0 8px; padding-left: 20px; }
.promo-notice-text li { margin: 2px 0; }
.promo-notice-text img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.promo-notice-text code {
  padding: 1px 5px; font-family: var(--font-mono); font-size: .92em;
  color: var(--code-inline-fg); background: var(--code-inline-bg);
  border: 1px solid var(--code-inline-border); border-radius: var(--radius-sm);
}
.promo-notice-text blockquote {
  margin: 0 0 8px; padding: 2px 0 2px 12px;
  border-left: 3px solid var(--notice-accent);
}
/* 详情链接：后台「跳转链接」填了才出现 */
.promo-notice-more {
  display: inline-block; margin-top: 8px;
  font-size: 13px; font-weight: 600; color: var(--primary);
}
.promo-notice-more::after { content: " →"; }
.promo-notice-more:hover { text-decoration: underline; }
/* 关闭按钮 */
.promo-notice-x {
  flex: 0 0 auto; width: 26px; height: 26px; padding: 0; margin-top: -2px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; line-height: 1; cursor: pointer;
  color: var(--text-3); background: transparent;
  border: none; border-radius: 50%;
  transition: color .18s, background .18s;
}
.promo-notice-x:hover { color: var(--text); background: var(--primary-soft); }
/* 关闭动效：theme.js 加上 .is-hiding 后再移除节点 */
.promo-slot--notice.is-hiding {
  opacity: 0; transform: translateY(-6px);
  transition: opacity .2s ease, transform .2s ease;
}
/* 弹窗位置的通知已有弹窗自身的关闭按钮，隐藏卡片内的 × 避免重叠 */
.promo-popup-box .promo-notice-x { display: none; }

/* ============================================================
   首次访问弹窗广告（后台「广告与推广」position=popup）
   theme.js 控制延迟 / 次数 / 自动关闭；data-promo-close 为可关闭热点
   ============================================================ */
.promo-popup {
  /* 层级取 10001：需高于站点注入的第三方右下角挂件(9999)与「返回顶部」(10000)，
     否则遮罩会被挂件压在下面，关闭按钮也可能被其透明层拦截点击 */
  position: fixed; inset: 0; z-index: 10001;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.promo-popup[hidden] { display: none; }
.promo-popup-mask {
  position: absolute; inset: 0;
  background: rgba(10, 6, 30, .58);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.promo-popup-box {
  position: relative; z-index: 1;
  width: min(420px, 100%); max-height: 86vh; overflow-y: auto;
  padding: 16px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: promo-popup-in .26s ease-out;
}
@keyframes promo-popup-in {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to { opacity: 1; transform: none; }
}
.promo-popup-box .promo-slot { margin: 0; }
.promo-popup-x {
  position: absolute; z-index: 3; top: 8px; right: 8px;
  width: 30px; height: 30px; padding: 0; line-height: 1; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%; cursor: pointer;
  color: #fff; background: rgba(0, 0, 0, .42);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  transition: background .18s;
}
.promo-popup-x:hover { background: rgba(0, 0, 0, .62); }
.promo-popup-btn {
  display: block; width: 100%; margin-top: 12px; padding: 9px 14px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  color: var(--text); background: var(--primary-weak);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  transition: .18s;
}
.promo-popup-btn:hover { border-color: var(--primary); color: var(--primary); }
/* 弹窗打开时锁定页面滚动 */
body.is-promo-popup-open { overflow: hidden; }

/* ---------- 21. 加载动画（后台「加载动画」设置组） ----------
   遮罩与进度条由 layout.html 直接输出、theme.js 收尾（见 initLoading）。
   关键点：@keyframes 里带 6s 自动淡出兜底 —— 脚本被拦截或报错时，
   遮罩也会自己消失，不会把页面永久盖住（动画优先级高于普通声明，
   且 forwards 只在动画结束后生效，因此不影响 .is-done 的正常淡出）。 */
.page-loader {
  /* 190 / 195：盖住吸顶导航（60）、移动端抽屉（70），
     又让位于搜索浮层（200）与灯箱（300），层级关系与主题其余浮层一致 */
  position: fixed; inset: 0; z-index: 190;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  animation: page-loader-auto-out 0s linear 6s forwards;
}
.page-loader.is-done { opacity: 0; visibility: hidden; transition: opacity .38s ease, visibility .38s; }
@keyframes page-loader-auto-out { to { opacity: 0; visibility: hidden; } }
.page-loader-inner {
  position: relative; z-index: 1;   /* 压在加载背景媒体与色彩遮罩之上 */
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 28px 32px; text-align: center;
}
/* 加载背景（后台「加载动画 → 加载背景」）：图片 / 动图 / 视频铺满整个首屏。
   叠放顺序自下而上：.page-loader 自身底色 → .page-loader-bg 背景媒体 →
   .page-loader-veil 色彩遮罩 → 内容（.page-loader-inner）。
   关键点：色彩遮罩只盖住背景媒体、位于内容之下，所以「遮罩透明度」只会压暗
   背景，不会把加载动画、遮罩图片与提示文字一起压暗 —— 背景再暗，动画仍是原色。
   关键点：背景媒体由 theme.js 的 initLoaderBackground() 在加载失败或
   「外链超时」时整层撤下，撤下后剩下的仍是原来的纯色遮罩，
   既不会露出页面内容，也不会留下破图或黑框。
   另外绝对定位（inset: 0）让这两层脱离 flex 流，内容保持居中，无需额外包裹。 */
.page-loader-bg {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
}
.page-loader-bg-media {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: center; border: 0;
}
.page-loader-veil {
  position: absolute; inset: 0; pointer-events: none;
  background: var(--bg);
  /* --page-loader-veil = 后台「遮罩透明度」取反后的不透明比例（0 全透 / 1 全遮），
     由 layout.html 直接写在 .page-loader 的 style 上，不经过脚本。
     注意层级：本层在 .page-loader-bg 之上、.page-loader-inner 之下，
     因此调它只会压暗背景，不会影响加载动画与提示文字 */
  opacity: var(--page-loader-veil, .55);
}
/* 自定义加载动画（后台「加载动画 → 加载动画」）：GIF / 动态 WebP 等
   交给浏览器自行播放，主题不再附加动效，也不加背景色（透明通道原样保留）。
   尺寸取 --page-loader-anim-size（layout.html 直接写在标签上，不经过脚本），
   与「遮罩图片」同一套规则：图小不放大、窄屏自动收窄、按自身比例完整显示。
   与内置转圈在模板里二选一（th:if），不会同时出现两个动画。
   注意：它属于内容层（z-index: 1），在「遮罩透明度」色彩层之上，不会被压暗。 */
.page-loader-anim {
  width: auto; height: auto;
  max-width: min(var(--page-loader-anim-size, 140px), 52vw);
  max-height: min(var(--page-loader-anim-size, 140px), 52vw);
  border-radius: var(--radius-md);
  background: none;
}
/* 遮罩图片：尺寸取后台「遮罩图片大小」（--page-loader-logo-size，由 layout.html
   直接写在标签上，不经过脚本，避免先按默认尺寸渲染再跳变）。
   关键点：图片用 auto 尺寸 + max 约束，让「元素盒子」贴合图片自身比例，
   圆角才会正好落在图片边缘上 —— 方形、圆形、横版 logo 都成立，与 png / jpg
   等格式无关。若改成固定 1:1 盒子 + object-fit: contain，横版 logo 会被装进
   正方形里、四周留白，border-radius 只裁到留白，图片看上去仍是直角。 */
.page-loader-img {
  width: auto; height: auto;
  max-width: min(var(--page-loader-logo-size, 68px), 46vw);
  max-height: min(var(--page-loader-logo-size, 68px), 46vw);
  border-radius: var(--radius-md);
  background: none;   /* 透明 PNG/GIF/WebP 保持透明；主题不会给图片加底色 */
  animation: page-loader-breathe 1.8s ease-in-out infinite;
}
.page-loader-icon { color: var(--primary); animation: page-loader-breathe 1.8s ease-in-out infinite; }
/* 内置兜底图标跟随同一尺寸档位，留空与自定义图片的视觉大小保持一致 */
.page-loader-icon svg { width: calc(var(--page-loader-logo-size, 68px) * .62); height: auto; }
.page-loader-spin {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--primary-weak); border-top-color: var(--primary);
  animation: page-loader-rotate .8s linear infinite;
}
.page-loader-text { margin: 0; color: var(--text-2); font-size: 14px; }
@keyframes page-loader-rotate { to { transform: rotate(360deg); } }
@keyframes page-loader-breathe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(.92); opacity: .78; }
}
/* 顶部进度条：宽度由 JS 平滑推进，走品牌渐变 */
.page-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 195;
  pointer-events: none; transition: opacity .3s ease .12s;
}
.page-progress.is-done { opacity: 0; }
.page-progress-bar {
  display: block; width: 0; height: 100%;
  background: var(--grad-brand);
  box-shadow: 0 0 10px rgba(108, 65, 255, .55);
  transition: width .28s ease;
}

/* ---------- 22. 图片懒加载（后台「图片与媒体」设置组） ----------
   三个类都由 theme.js 的 initLazyImages() 挂载，主题未开对应开关则不会出现：
     .is-loading 占位（骨架渐变 或 后台配置的占位图）
     .is-loaded  加载完成（配 .lazy-fade 时淡入）
     .is-failed  加载失败且无兜底图 → 隐藏，不留破图
   注意：淡入用 animation 而非常驻 opacity:0 —— 后者会连占位骨架一起隐藏。 */
img.is-loading {
  background-image: linear-gradient(100deg,
    var(--primary-soft) 25%, transparent 37%, var(--primary-soft) 63%);
  background-size: 400% 100%;
  background-repeat: no-repeat;
  animation: lazy-shimmer 1.4s ease-in-out infinite;
}
html.has-lazy-img img.is-loading {
  background-image: var(--lazy-loading-img);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  animation: none;
}
@keyframes lazy-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}
img.lazy-fade.is-loaded { animation: lazy-fade-in .34s ease both; }
@keyframes lazy-fade-in { from { opacity: 0; } to { opacity: 1; } }
img.is-failed { opacity: 0; }

/* ---------- 23. 标签云随机配色（后台「分类与标签 → 标签云随机配色」） ----------
   色调号由模板按标签名散列成 tone-0 ~ tone-7（tags.html / hot-tags.html），
   同一标签每次刷新颜色稳定。只声明一个 --tag-h 色相，浅色 / 深色模式
   各组合一次明度饱和度，避免为 8 种颜色重复写 16 条规则。 */
.tag-chip--tone-0 { --tag-h: 258; }
.tag-chip--tone-1 { --tag-h: 210; }
.tag-chip--tone-2 { --tag-h: 172; }
.tag-chip--tone-3 { --tag-h: 145; }
.tag-chip--tone-4 { --tag-h: 32; }
.tag-chip--tone-5 { --tag-h: 0; }
.tag-chip--tone-6 { --tag-h: 330; }
.tag-chip--tone-7 { --tag-h: 285; }
.tag-chip[class*="tag-chip--tone-"] {
  background: hsl(var(--tag-h), 88%, 95%);
  color: hsl(var(--tag-h), 58%, 40%);
}
.tag-chip[class*="tag-chip--tone-"]:hover {
  background: hsl(var(--tag-h), 68%, 50%);
  color: #fff;
}
[data-theme="dark"] .tag-chip[class*="tag-chip--tone-"] {
  background: hsl(var(--tag-h), 42%, 24%);
  color: hsl(var(--tag-h), 82%, 78%);
}
[data-theme="dark"] .tag-chip[class*="tag-chip--tone-"]:hover {
  background: hsl(var(--tag-h), 62%, 52%);
  color: #fff;
}

/* ---------- 24. 错误页增强（后台「错误页」设置组） ----------
   基础排版沿用「19. 其他」里的 .page-error / .error-card，
   这里只补「插图 + 操作区」两块——后台未配置时不影响原样。 */
.error-card--with-image { padding-top: 40px; }
.error-image {
  display: block; width: auto; max-width: 100%; max-height: 220px;
  margin: 0 auto 18px; border-radius: var(--radius-md);
}
.error-actions {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
}
.error-actions .btn { min-width: 132px; justify-content: center; }


/* ==========================================================
   打赏：作者卡片内的按钮 + 收款码浮层
   ========================================================== */
/* 作者信息区占满卡片高度并整体垂直居中，使右侧打赏按钮在模块内上下居中 */
.post-author-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
/* 按钮绝对定位到「昵称行 / 简介行」的分界线上：top:0 即 bio 行顶边，translateY(-50%) 让按钮居中于这条线 */
.post-author-bio-row { position: relative; display: flex; align-items: center; justify-content: flex-start; gap: 10px; flex-wrap: wrap; min-height: 34px; }
.post-author-bio-row .post-author-bio { margin: 2px 0 0; }
.reward-btn { position: relative; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; font-size: 14px; font-weight: 600; line-height: 1.2; color: var(--on-primary); background: linear-gradient(135deg, var(--primary-400), var(--primary)); border: 0; border-radius: 999px; box-shadow: 0 8px 20px -8px rgba(108, 65, 255, .55), inset 0 1px 0 rgba(255, 255, 255, .18); cursor: pointer; white-space: nowrap; transition: transform .22s cubic-bezier(.22, .68, .34, 1.1), box-shadow .22s, filter .22s; }
.reward-btn:hover { transform: translateY(calc(-50% - 2px)); filter: brightness(1.06); box-shadow: 0 12px 26px -8px rgba(108, 65, 255, .62); }
.reward-btn:active { transform: translateY(-50%) scale(.98); }
.reward-btn-icon { flex: none; animation: rewardBeat 2.6s ease-in-out infinite; }
@keyframes rewardBeat { 0%, 88%, 100% { transform: none; } 92% { transform: translateY(-2px) scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .reward-btn-icon { animation: none; } }
@media (max-width: 480px) {
  .post-author-bio-row { gap: 10px; min-height: 0; }
  /* 窄屏取消上移，按钮正常落在简介下方 */
  .reward-btn { position: static; transform: none; margin-top: 6px; padding: 8px 16px; font-size: 13px; }
  .reward-btn:hover { transform: translateY(-2px); }
  .reward-btn:active { transform: scale(.98); }
}
/* 收款码气泡：锚在按钮上方（空间不足时由 JS 加 --below 翻到下方），水平溢出由 JS 夹紧 */
.reward-modal { position: absolute; bottom: calc(100% + 42px); left: 0; z-index: 60; width: min(88vw, 360px); padding: 18px 16px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); text-align: center; animation: rewardPop .16s ease; }
.reward-modal[hidden] { display: none; }
.reward-modal--below { bottom: auto; top: calc(100% + 42px); }
.reward-modal::after { content: ""; position: absolute; left: var(--arrow-x, 24px); bottom: -6px; width: 11px; height: 11px; background: var(--surface); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); transform: rotate(45deg); }
.reward-modal--below::after { bottom: auto; top: -6px; border: 0; border-left: 1px solid var(--border); border-top: 1px solid var(--border); }
@keyframes rewardPop { from { opacity: 0; } }
.reward-modal-close { position: absolute; top: 4px; right: 10px; border: 0; background: none; font-size: 22px; line-height: 1; color: var(--text-3); cursor: pointer; }
.reward-modal-close:hover { color: var(--text); }
.reward-modal-title { margin: 0; font-size: 17px; font-weight: 700; }
.reward-modal-desc { margin: 6px 0 0; font-size: 13px; color: var(--text-2); }
.reward-qr-list { display: flex; justify-content: center; align-items: flex-start; gap: 18px; flex-wrap: nowrap; margin-top: 16px; }
.reward-qr { flex: 0 0 auto; }
.reward-qr img { width: 138px; height: 138px; object-fit: contain; background: #fff; border: 1px solid var(--border); border-radius: 10px; }
.reward-qr span { display: block; margin-top: 6px; font-size: 12px; color: var(--text-2); }

/* ============================================================
   自定义内容（首页模块 type=custom / 侧边栏组件 widget=custom）
   -----------------------------------------------------------------
   图片 / 视频 / HTML 三段各自独立：留空时模板不输出对应 DOM，
   本身就不存在空白占位；这里只负责有内容时的呈现。
   ============================================================ */
.custom-block { display: flex; flex-direction: column; gap: 18px; }
.custom-media { margin: 0; }
.custom-media img,
.custom-media video { display: block; width: 100%; height: auto; border-radius: var(--radius-md); }
.custom-media--image img { max-height: 480px; object-fit: cover; background: var(--bg); }
.custom-media--video video { max-height: 520px; background: #000; }
.custom-embed,
.widget-custom-embed {
  position: relative; width: 100%; padding-top: 56.25%;
  overflow: hidden; border-radius: var(--radius-md); background: #000;
}
.custom-embed iframe,
.widget-custom-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.custom-html { font-size: 15px; line-height: 1.8; color: var(--text-2); }
.custom-html a { color: var(--primary); text-decoration: underline; }
.custom-html img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.custom-html > :first-child { margin-top: 0; }
.custom-html > :last-child { margin-bottom: 0; }

/* 侧边栏卡片内的自定义内容：窄栏，字号与间距收紧 */
.widget-custom { display: flex; flex-direction: column; gap: 12px; }
.widget-custom-desc { margin: 0; font-size: 13px; line-height: 1.7; color: var(--text-2); }
.widget-custom-media img,
.widget-custom-media video { display: block; width: 100%; height: auto; border-radius: var(--radius-sm); }
.widget-custom-media--video video { background: #000; }
.widget-custom-html { font-size: 13px; line-height: 1.75; color: var(--text-2); }
.widget-custom-html a { color: var(--primary); }
.widget-custom-html img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.widget-custom-html > :first-child { margin-top: 0; }
.widget-custom-html > :last-child { margin-bottom: 0; }
@media (max-width: 640px) { .custom-media--image img { max-height: none; } }

/* 组件块内没有任何卡片时不占位（如：非文章页的目录、内容全空的自定义组件）；广告位块不受影响 */
.sidebar-widget:not(.sidebar-widget--promo):not(:has(.card)) { display: none; }
/* 自定义内容：描述 / HTML / 图片 / 视频「点击跳转」态（开关开启且有地址时） */
.custom-media-link { display: block; color: inherit; text-decoration: none; border-radius: var(--radius-md); }
.custom-media-link img,
.custom-media-link video { transition: opacity .2s ease; }
.custom-media-link:hover img,
.custom-media-link:hover video { opacity: .9; }
.custom-html--link,
.section-subtitle--link,
.widget-custom-desc--link { display: block; color: inherit; text-decoration: none; transition: color .18s ease; }
.custom-html--link:hover,
.section-subtitle--link:hover,
.widget-custom-desc--link:hover { color: var(--primary); text-decoration: underline; }
@media (max-width: 480px) { .reward-qr img { width: 118px; height: 118px; } .reward-qr-list { gap: 12px; } }
