/*
 * Theme: theme-Serenity
 * Author: Serenity
 * Build: 2026-06-03 10:28:07
 * Fingerprint: 18f8d0015be24d2b
 * Copyright (c) 2026 Serenity. All rights reserved.
 */

.post-bg-wallpaper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  background: var(--color-bg);
}

.post-bg-wallpaper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(var(--blur, 3px));
  transform: scale(1.05);
  /* GPU 加速 */
  transform: translateZ(0) scale(1.05);
  backface-visibility: hidden;
  will-change: transform, opacity;
  /* 暗色模式处理 */
  filter: blur(var(--blur, 3px)) brightness(0.7);
  /* 加载优化 */
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
}

html[data-theme="light"] .post-bg-wallpaper img {
  filter: blur(var(--blur, 3px)) brightness(0.85);
}

/* 图片加载完成后的淡入效果 */
.post-bg-wallpaper img.loaded {
  opacity: 1;
}

/* 有背景壁纸时，文章内容区域添加模糊背景容器 */
.post.has-wallpaper-bg {
  position: relative;
  overflow: hidden;
}

.post.has-wallpaper-bg .wallpaper-bg-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100%;
  border-radius: 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 0;
  /* 基础样式 - 默认暗色模式 + 蒙版透明 */
  background: rgba(18, 18, 18, 0.85);
}

.post.has-wallpaper-bg > *:not(.wallpaper-bg-container) {
  position: relative;
  z-index: 1;
}

/* 亮色模式下模糊背景 + 蒙版透明 */
html[data-theme="light"] .post.has-wallpaper-bg .wallpaper-bg-container {
  background: rgba(245, 245, 245, 0.85);
}

/* 有背景壁纸时，侧边栏组件需要半透明模糊背景（跟随色相） */
.post-sidebar .sidebar-widget {
  background: color-mix(in srgb, var(--color-bg-soft) 90%, transparent) !important;
  border: 1px solid var(--color-border) !important;
  border-radius: 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.2s ease;
}

/* 侧边栏组件 hover 状态 - 跟随主题色 */
.post-sidebar .sidebar-widget:hover {
  background: color-mix(in srgb, var(--color-bg-mute) 92%, transparent) !important;
  border-color: var(--color-accent) !important;
}

/* 侧边栏文字颜色跟随主题色 */
.post-sidebar .widget-title,
.post-sidebar .widget-list a,
.post-sidebar .author-name,
.post-sidebar .author-bio,
.post-sidebar .stat-label,
.post-sidebar .toc-nav a,
.post-sidebar .reading-progress {
  color: var(--color-text);
}

.post-sidebar .widget-tag {
  color: var(--color-accent);
}

.post-sidebar .toc-nav a.is-active-link {
  color: var(--color-accent);
}

/* 分割线跟随主题色 */
.post-sidebar .widget-divider {
  background: var(--color-border);
}

/* 链接 hover 效果 */
.post-sidebar .widget-list a:hover,
.post-sidebar .widget-tag:hover {
  color: var(--color-accent);
}

/* ========================================
   自定义滚动条（跟随主题色，仅页面级）
   ======================================== */

/* Webkit 浏览器 (Chrome, Safari, Edge) */
html.show-scrollbar::-webkit-scrollbar {
  display: block;
  width: 6px;
}

html.show-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

html.show-scrollbar::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--color-accent), var(--color-accent-secondary, var(--color-accent)));
  border-radius: 3px;
}

html.show-scrollbar::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent-secondary, var(--color-accent));
}

/* Firefox - 仅 html 元素 */
html.show-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: var(--color-accent) transparent;
}

/* 防止页面滚动条样式污染内部可滚动组件（目录、文章列表等） */
html.show-scrollbar .toc-nav,
html.show-scrollbar .article-feed,
html.show-scrollbar .stream-feed,
html.show-scrollbar .mp-list-area {
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

html.show-scrollbar .toc-nav::-webkit-scrollbar,
html.show-scrollbar .article-feed::-webkit-scrollbar,
html.show-scrollbar .stream-feed::-webkit-scrollbar,
html.show-scrollbar .mp-list-area::-webkit-scrollbar {
  width: 4px;
}

html.show-scrollbar .toc-nav::-webkit-scrollbar-track,
html.show-scrollbar .article-feed::-webkit-scrollbar-track,
html.show-scrollbar .stream-feed::-webkit-scrollbar-track,
html.show-scrollbar .mp-list-area::-webkit-scrollbar-track {
  background: transparent;
}

html.show-scrollbar .toc-nav::-webkit-scrollbar-thumb,
html.show-scrollbar .article-feed::-webkit-scrollbar-thumb,
html.show-scrollbar .stream-feed::-webkit-scrollbar-thumb,
html.show-scrollbar .mp-list-area::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 2px;
}

html.show-scrollbar .toc-nav::-webkit-scrollbar-thumb:hover,
html.show-scrollbar .article-feed::-webkit-scrollbar-thumb:hover,
html.show-scrollbar .stream-feed::-webkit-scrollbar-thumb:hover,
html.show-scrollbar .mp-list-area::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent);
}

/* ========================================
   阅读进度条
   ======================================== */

.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-secondary, var(--color-accent)));
  z-index: 9999;
  transition: width 0.1s linear;
  pointer-events: none;
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px color-mix(in srgb, var(--color-accent) 40%, transparent);
}

/* ========================================
   文章封面头部
   ======================================== */

.post-hero {
  position: relative;
  width: 100%;
  min-height: 320px;
  display: flex;
  align-items: flex-end;
  margin-top: calc(var(--header-height) + var(--space-6));
  margin-bottom: var(--space-6);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.post-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.post-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-hero-bg-default {
  background: linear-gradient(135deg, 
    color-mix(in srgb, var(--color-accent) 30%, transparent) 0%, 
    color-mix(in srgb, var(--color-accent) 10%, transparent) 50%,
    var(--color-bg-soft) 100%);
}

html[data-theme="light"] .post-hero-bg-default {
  background: linear-gradient(135deg, 
    color-mix(in srgb, var(--color-accent) 20%, transparent) 0%, 
    color-mix(in srgb, var(--color-accent) 8%, transparent) 50%,
    var(--color-bg-soft) 100%);
}

.post-hero-overlay {
  position: absolute;
  inset: 0;
  background: transparent;
}

.post-hero-content {
  position: relative;
  z-index: 1;
  padding: var(--space-5);
  width: 100%;
}

.post-hero-title {
  font-size: 2rem;
  font-weight: 700;
  font-style: italic;
  color: var(--color-accent);
  line-height: 1.4;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  margin: 0 0 var(--space-3) 0;
}

.post-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
}

.post-hero-meta > * {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-accent);
  font-weight: 700;
}

.post-hero-meta svg {
  color: var(--color-accent);
  opacity: 1;
}

.post-hero-author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.post-hero-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--color-accent);
}

/* 右下角分类和标签 */
.post-hero-tags {
  position: absolute;
  right: var(--space-5);
  bottom: var(--space-5);
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.post-hero-category-link,
.post-hero-tag-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--color-accent);
  transition: all 0.2s ease;
}

.post-hero-category-link:hover,
.post-hero-tag-link:hover {
  color: var(--color-accent-secondary);
}

.post-hero-category-link svg,
.post-hero-tag-link svg {
  color: var(--color-accent);
}

/* 响应式 */
@media (max-width: 768px) {
  .post-hero {
    min-height: 240px;
    flex-direction: column;
    align-items: stretch;
  }
  
  .post-hero-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-top: var(--space-5);
  }
  
  .post-hero-title {
    font-size: 1.5rem;
    margin-bottom: auto;
  }
  
  .post-hero-meta {
    gap: var(--space-3);
  }
  
  .post-hero-meta > * {
    font-size: 12px;
  }
  
  /* 标签紧跟在 meta 下方 */
  .post-hero-tags {
    position: static;
    padding: var(--space-2) var(--space-5) var(--space-4);
    justify-content: flex-start;
    gap: var(--space-2);
  }

  .post-hero-category-link,
  .post-hero-tag-link {
    font-size: 12px;
  }

  .post-hero-overlay {
    background: transparent;
  }

  /* 移动端封面图模糊遮罩 */
  .post-hero-bg img {
    filter: none;
    transform: none;
  }
}

/* ========================================
   文章布局
   ======================================== */

/* 文章布局 - 左右分栏 */
.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 48px;
  align-items: stretch;
  padding-bottom: var(--space-8);
  position: relative;
}

/* 阅读进度 */
.reading-progress {
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  font-style: italic;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: all 0.3s ease;
}

/* 左侧主内容区域 */
.post-main {
  min-width: 0;
}

/* 文章页面顶部间距 - 有封面时不需要额外间距 */
.post {
  padding-top: var(--space-6) !important;
  min-width: 0;
  min-height: auto;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

/* 右侧边栏 */
.post-sidebar {
  position: sticky;
  top: calc(var(--header-height, 64px) + var(--space-4));
  max-height: calc(100vh - var(--header-height, 64px) - var(--space-8));
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  z-index: 10;
  overflow: hidden;
}

/* 目录 widget 填充剩余空间（其他 widget 自然高度） */
.post-sidebar .sidebar-widget:has(.toc-nav) {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* 统一宽度 - 移除内容区域的最大宽度限制 */
.post-content {
  max-width: 100% !important;
  overflow-x: auto;
  word-wrap: break-word;
}

.post-content > * {
  max-width: 100%;
}

.post-tags,
.post-nav {
  max-width: 100% !important;
}

/* 目录导航 */
.toc-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  scroll-behavior: smooth;
}

/* 自定义目录滚动条样式 */
.toc-nav::-webkit-scrollbar {
  width: 6px;
}

.toc-nav::-webkit-scrollbar-track {
  background: var(--color-bg-mute);
  border-radius: 3px;
}

.toc-nav::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

.toc-nav::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent);
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.toc-list .toc-list {
  margin-top: var(--space-3);
  padding-left: var(--space-5);
  position: relative;
}

/* 二级列表的竖线 */
.toc-list .toc-list::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--color-border);
}

.toc-list-item {
  position: relative;
  padding-left: var(--space-5);
}

/* TOC 图标统一使用主题色 */
.toc-list-item.toc-h2::before,
.toc-list-item.toc-h3::before,
.toc-list-item.toc-h4::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  width: 14px;
  height: 14px;
  background-color: var(--color-accent);
  mask-size: contain;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  opacity: 0.85;
}

/* H2 单层云朵 */
.toc-list-item.toc-h2::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96z'/%3E%3C/svg%3E");
}

/* H3 双层云朵 */
.toc-list-item.toc-h3::before {
  opacity: 0.7;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 24'%3E%3Cpath d='M25.35 10.04C24.67 6.59 21.64 4 18 4c-2.89 0-5.4 1.64-6.65 4.04C8.34 8.36 6 10.91 6 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96z' opacity='0.5'/%3E%3Cpath d='M19.35 12.04C18.67 8.59 15.64 6 12 6 9.11 6 6.6 7.64 5.35 10.04 2.34 10.36 0 12.91 0 16c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 24'%3E%3Cpath d='M25.35 10.04C24.67 6.59 21.64 4 18 4c-2.89 0-5.4 1.64-6.65 4.04C8.34 8.36 6 10.91 6 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96z' opacity='0.5'/%3E%3Cpath d='M19.35 12.04C18.67 8.59 15.64 6 12 6 9.11 6 6.6 7.64 5.35 10.04 2.34 10.36 0 12.91 0 16c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96z'/%3E%3C/svg%3E");
}

/* H4 三层云朵 */
.toc-list-item.toc-h4::before {
  width: 14px;
  height: 12px;
  opacity: 0.55;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 26'%3E%3Cpath d='M29.35 8.04C28.67 4.59 25.64 2 22 2c-2.89 0-5.4 1.64-6.65 4.04C12.34 6.36 10 8.91 10 12c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96z' opacity='0.3'/%3E%3Cpath d='M25.35 11.04C24.67 7.59 21.64 5 18 5c-2.89 0-5.4 1.64-6.65 4.04C8.34 9.36 6 11.91 6 15c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96z' opacity='0.6'/%3E%3Cpath d='M19.35 14.04C18.67 10.59 15.64 8 12 8 9.11 8 6.6 9.64 5.35 12.04 2.34 12.36 0 14.91 0 18c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 26'%3E%3Cpath d='M29.35 8.04C28.67 4.59 25.64 2 22 2c-2.89 0-5.4 1.64-6.65 4.04C12.34 6.36 10 8.91 10 12c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96z' opacity='0.3'/%3E%3Cpath d='M25.35 11.04C24.67 7.59 21.64 5 18 5c-2.89 0-5.4 1.64-6.65 4.04C8.34 9.36 6 11.91 6 15c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96z' opacity='0.6'/%3E%3Cpath d='M19.35 14.04C18.67 10.59 15.64 8 12 8 9.11 8 6.6 9.64 5.35 12.04 2.34 12.36 0 14.91 0 18c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96z'/%3E%3C/svg%3E");
}

.toc-link {
  font-size: 13px;
  color: var(--color-text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: all var(--duration-fast);
  line-height: 1.5;
  text-decoration: none;
}

.toc-link:hover {
  color: var(--color-accent);
  padding-left: var(--space-1);
}

.toc-link.is-active-link {
  color: var(--color-accent);
  font-weight: 500;
  padding-left: var(--space-1);
}

/* 二级标题样式 */
.toc-list .toc-list .toc-link {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* 二级标题激活状态 */
.toc-list .toc-list .toc-link.is-active-link {
  color: var(--color-accent);
  font-weight: 500;
  padding-left: var(--space-1);
}

/* 作者信息 */
.widget-author {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-2);
}

.author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
}

.author-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

/* 作者名称链接 */
.author-name-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.author-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  transition: color var(--duration-fast);
  margin: 0;
}

.author-bio {
  font-size: 11px;
  color: var(--color-text-muted);
  line-height: 1.4;
  margin: 0;
}

.author-stats {
  display: flex;
  gap: var(--space-5);
  padding-top: var(--space-1);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-accent);
}

.stat-label {
  font-size: 10px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.author-name-link:hover .author-name {
  color: var(--color-accent);
}

/* Hover 明信片图标 */
.author-hover-icon {
  position: absolute;
  right: -28px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  width: 22px;
  height: 22px;
  color: var(--color-accent);
  opacity: 0;
  transition: all var(--duration-fast);
}

.author-name-link:hover .author-hover-icon {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

/* 整个作者组件 hover 遮盖层 */
.author-hover-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent);
  border-radius: var(--radius-md);
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-fast);
  z-index: 10;
  text-decoration: none;
}

.author-hover-overlay svg {
  color: #fff;
  transition: transform var(--duration-fast);
}

.widget-author:hover .author-hover-overlay {
  opacity: 1;
  visibility: visible;
}

.widget-author:hover .author-hover-overlay svg {
  transform: scale(1.1);
}

/* 移动端调整 */
@media (max-width: 1024px) {
  .post-layout {
    grid-template-columns: 1fr;
  }
  
  .post-toc {
    display: none;
  }
}

@media (max-width: 640px) {
  .post {
    padding-top: var(--space-4) !important;
  }
  
}

/* 修复移动端响应式 */
@media (max-width: 1024px) {
  .post-sidebar {
    display: none;
  }
}

/* 版权声明 */
.post-copyright {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-5);
  margin-top: var(--space-6);
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.copyright-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.copyright-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.copyright-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  background: var(--color-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
}

.copyright-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

.copyright-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.copyright-label {
  font-size: 12px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.copyright-link {
  font-size: 13px;
  color: var(--color-accent);
  text-decoration: none;
  transition: all var(--duration-fast);
}

.copyright-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.copyright-icon {
  color: var(--color-text-muted);
}

.copyright-text {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.copyright-license {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity var(--duration-fast);
}

.copyright-license:hover {
  opacity: 0.8;
}

.copyright-text strong {
  color: var(--color-text);
  font-weight: 600;
}

.copyright-logo {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  opacity: 0.2;
}

.copyright-logo svg {
  width: 100%;
  height: 100%;
}

@media (max-width: 640px) {
  .post-copyright {
    flex-direction: column;
    text-align: center;
  }
  
  .copyright-header {
    justify-content: center;
  }
  
  .copyright-meta {
    justify-content: center;
  }
  
  .copyright-logo {
    width: 60px;
    height: 60px;
  }
}

/* ========================================
   分享按钮
   ======================================== */

.post-share {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  margin-top: var(--space-5);
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.share-label {
  font-size: 13px;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.share-buttons {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.share-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.share-btn svg {
  width: 24px;
  height: 24px;
  color: var(--color-text-muted);
}

.share-btn:hover {
  transform: translateY(-2px);
  border-color: var(--color-accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.share-btn:hover svg {
  color: var(--color-accent);
}

.share-btn:active {
  transform: translateY(0);
}

/* 微信按钮特殊处理 - 需要显示弹窗 */
.share-wechat {
  position: relative;
  overflow: visible;
}

/* 复制链接按钮 */
.share-copy {
  position: relative;
}

/* 复制成功气泡 */
.share-copy-bubble {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-secondary) 100%);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: white;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.share-copy-bubble::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: var(--color-accent-secondary);
}

.share-copy.copied .share-copy-bubble {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-4px);
}

@media (max-width: 640px) {
  .post-share {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }
  
  .share-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }
  
  .share-btn img {
    border-radius: 10px;
  }
  
  .share-btn svg {
    width: 20px;
    height: 20px;
  }
  
  /* 移动端弹窗隐藏 */
  .share-wechat-popup {
    display: none;
  }
}

/* 打赏组件 */
.post-reward {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  margin-top: var(--space-5);
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-secondary) 100%);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.reward-qrcode {
  flex-shrink: 0;
  width: 100px;
  height: 100px;
  background: white;
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.reward-qrcode img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.reward-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  color: white;
  position: relative;
}

.reward-title {
  font-size: 16px;
  font-weight: 600;
  color: white;
  margin: 0;
}

.reward-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
  margin: 0;
}

.reward-icon {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  opacity: 0.2;
}

.reward-icon svg {
  width: 100%;
  height: 100%;
}

@media (max-width: 640px) {
  .post-reward {
    flex-direction: column;
    text-align: center;
  }
  
  .reward-qrcode {
    width: 120px;
    height: 120px;
  }
  
  .reward-icon {
    position: static;
    transform: none;
    margin: 0 auto;
  }
}

/* 文章容器 */
.post {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--space-10) var(--space-5);
}

/* 文章头部 */
.post-header {
  margin-bottom: var(--space-8);
  text-align: center;
}


.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  font-size: 14px;
  color: var(--color-text-muted);
}

.post-meta > * {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.post-meta svg {
  width: 14px;
  height: 14px;
}

.post-meta a {
  color: var(--color-text-muted);
  transition: color var(--duration-fast);
}

.post-meta a:hover {
  color: var(--color-accent);
}

/* 文章封面 */
.post-cover {
  margin-bottom: var(--space-8);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.post-cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

/* 文章过期提示 */
.post-outdated-notice {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-5);
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.5;
}

.post-outdated-notice .notice-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.post-outdated-notice .notice-text {
  flex: 1;
}

/* 轻提示 5-20天 */
.post-outdated-notice.notice-light {
  background: color-mix(in srgb, var(--color-accent) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-accent) 15%, transparent);
  color: var(--color-accent);
}

/* 中提示 20-60天 */
.post-outdated-notice.notice-medium {
  background: rgba(234, 179, 8, 0.08);
  border: 1px solid rgba(234, 179, 8, 0.2);
  color: #ca8a04;
}

html[data-theme="dark"] .post-outdated-notice.notice-medium {
  color: #facc15;
}

/* 较强提示 60-180天 */
.post-outdated-notice.notice-strong {
  background: rgba(249, 115, 22, 0.08);
  border: 1px solid rgba(249, 115, 22, 0.2);
  color: #ea580c;
}

html[data-theme="dark"] .post-outdated-notice.notice-strong {
  color: #fb923c;
}

/* 强提示 180天以上 */
.post-outdated-notice.notice-critical {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #dc2626;
}

html[data-theme="dark"] .post-outdated-notice.notice-critical {
  color: #f87171;
}

/* 文章内容 */
.post-content {
  max-width: 100%;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.8;
  color: var(--color-text-secondary);
  min-width: 0;
  overflow-x: hidden;
}

.post-content > * + * {
  margin-top: 1.5em;
}

/* 文章标题图标样式 - 仿照参考网站 */
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  display: block;
  position: relative;
  z-index: 1;
  overflow: visible;
}

.post-content .post-heading-inline {
  width: fit-content;
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 标题底部渐变装饰条 - 中间深两边浅 */
.post-content .post-heading-inline::after {
  content: "";
  display: block;
  width: 100%;
  height: 8px;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  pointer-events: none;
  background: radial-gradient(ellipse at center, 
    hsl(var(--heading-gradient-color, 210 80% 60%) / 0.35) 0%,
    hsl(var(--heading-gradient-color, 210 80% 60%) / 0.15) 40%,
    transparent 70%
  );
  border-radius: 4px;
  z-index: -1;
}

.post-content .post-heading-inline .heading-icon {
  flex-shrink: 0;
  z-index: 20;
}

.post-content .post-heading-inline .heading-text {
  z-index: 20;
}

/* H2 标题样式 */
.post-content h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-top: 2.5em;
  margin-bottom: 1em;
  color: var(--color-text);
  letter-spacing: -0.01em;
  --heading-gradient-color: 340 80% 65%;
}

.post-content h2 .heading-icon {
  width: 1.6rem;
  height: 1.6rem;
  color: var(--color-accent);
}

/* H3 标题样式 */
.post-content h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 2em;
  margin-bottom: 0.75em;
  color: var(--color-text);
  --heading-gradient-color: 200 75% 55%;
}

.post-content h3 .heading-icon {
  width: 1.8rem;
  height: 1.4rem;
  color: var(--color-accent);
}

/* H4 标题样式 */
.post-content h4 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1.75em;
  margin-bottom: 0.5em;
  color: var(--color-text);
  --heading-gradient-color: 210 70% 55%;
}

.post-content h4 .heading-icon {
  width: 2rem;
  height: 1.4rem;
  color: var(--color-text-secondary);
}

/* H5 标题样式 */
.post-content h5 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  color: var(--color-text);
  --heading-gradient-color: 45 85% 55%;
}

.post-content h5 .heading-icon {
  width: 1.3rem;
  height: 1.3rem;
  color: var(--color-text-secondary);
}

/* H6 标题样式 */
.post-content h6 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.25em;
  margin-bottom: 0.5em;
  color: var(--color-text-secondary);
  --heading-gradient-color: 140 60% 45%;
}

.post-content h6 .heading-icon {
  width: 1.2rem;
  height: 1.2rem;
  color: var(--color-text-muted);
}

/* 标题图标切换按钮 */
.heading-icons-toggle {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 2px;
  width: fit-content;
  margin-left: auto;
  margin-bottom: 1em;
}

.heading-icons-toggle .toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.25s ease;
  line-height: 1;
}

.heading-icons-toggle .toggle-btn:hover {
  color: var(--color-text);
}

.heading-icons-toggle .toggle-btn.active {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.heading-icons-toggle .toggle-btn svg {
  width: 14px;
  height: 14px;
}

/* 隐藏标题图标状态 */
.hide-heading-icons .post-content .heading-icon {
  display: none;
}

.hide-heading-icons .post-content .post-heading-inline::after {
  display: none;
}

.post-content p {
  margin-bottom: 1.25em;
  line-height: 1.8;
  text-align: justify;
}

.post-content a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(245, 150, 170, 0.3);
  transition: all var(--duration-fast);
  font-weight: 500;
}

.post-content a:hover {
  border-bottom-color: var(--color-accent);
  opacity: 0.8;
}

html[data-theme="light"] .post-content a {
  border-bottom-color: rgba(51, 166, 184, 0.3);
}

.post-content strong {
  color: var(--color-text);
  font-weight: 600;
  background: linear-gradient(to bottom, transparent 50%, rgba(245, 150, 170, 0.15) 50%);
  padding: 0 2px;
}

html[data-theme="light"] .post-content strong {
  background: linear-gradient(to bottom, transparent 50%, rgba(51, 166, 184, 0.1) 50%);
}

.post-content em {
  font-style: italic;
  color: var(--color-text-secondary);
}

.post-content img {
  border-radius: var(--radius-md);
  margin: 2em 0;
  max-width: 100%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform var(--duration-normal), box-shadow var(--duration-normal);
  cursor: zoom-in;
}

.post-content img:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* ========================================
   LightGallery 灯箱插件适配
   适配 Halo 官方 plugin-lightgallery
   插件设置 DOM 选择器填写: .post-content
   ======================================== */

/* lightgallery 会给图片包裹 <a> 标签，确保样式不被破坏 */
.post-content .lg-object,
.post-content [data-lg-size] img {
  cursor: zoom-in;
}

/* 灯箱打开时隐藏页面滚动 */
.lg-on {
  overflow: hidden;
}

/* 灯箱背景遮罩 */
.lg-backdrop {
  background-color: rgba(0, 0, 0, 0.9);
}

/* 灯箱工具栏适配主题色 */
.lg-toolbar .lg-icon,
.lg-actions .lg-icon {
  color: rgba(255, 255, 255, 0.8);
}

.lg-toolbar .lg-icon:hover,
.lg-actions .lg-icon:hover {
  color: var(--color-accent);
}

/* 灯箱计数器 */
.lg-counter {
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--font-sans);
}

/* 灯箱缩略图适配 */
.lg-thumb-item.active,
.lg-thumb-item:hover {
  border-color: var(--color-accent);
}

.post-content blockquote {
  position: relative;
  padding: 1.5em 1.75em 1.5em 2em;
  margin: 2em 0;
  background: linear-gradient(135deg, var(--color-bg-soft) 0%, var(--color-bg-mute) 100%);
  border-radius: var(--radius-lg);
  font-style: italic;
  color: var(--color-text-secondary);
  border: none;
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

/* 左侧渐变装饰条 */
.post-content blockquote::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--color-accent) 0%, var(--color-accent-secondary, var(--color-accent)) 100%);
  border-radius: 4px 0 0 4px;
}

/* 引号装饰图标 */
.post-content blockquote::after {
  content: '';
  position: absolute;
  top: 12px;
  right: 16px;
  width: 32px;
  height: 32px;
  background-color: var(--color-accent);
  opacity: 0.12;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z'/%3E%3C/svg%3E");
  mask-size: contain;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
}

.post-content blockquote p {
  margin: 0;
  position: relative;
  z-index: 1;
  line-height: 1.8;
}

.post-content blockquote p + p {
  margin-top: 0.75em;
}

/* 引用块内的强调文字 */
.post-content blockquote strong {
  color: var(--color-accent);
  font-weight: 600;
}

/* 引用块悬停效果 */
.post-content blockquote:hover {
  box-shadow: 
    0 6px 24px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.post-content blockquote:hover::before {
  width: 5px;
}

/* 嵌套引用块 */
.post-content blockquote blockquote {
  margin: 1em 0;
  padding: 1em 1.25em 1em 1.5em;
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-md);
}

html[data-theme="light"] .post-content blockquote {
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

html[data-theme="light"] .post-content blockquote:hover {
  box-shadow: 
    0 6px 24px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.post-content ul,
.post-content ol {
  padding-left: 2em;
  margin: 1.25em 0;
}

.post-content ul {
  list-style-type: disc;
}

.post-content ol {
  list-style-type: decimal;
}

.post-content li {
  margin-top: 0.5em;
  line-height: 1.8;
  position: relative;
  padding-left: 0.25em;
}

.post-content ul > li::marker {
  color: var(--color-accent);
}

.post-content ol > li::marker {
  color: var(--color-accent);
  font-weight: 600;
}

/* 嵌套列表样式 */
.post-content ul ul {
  list-style-type: circle;
}

.post-content ul ul ul {
  list-style-type: square;
}

.post-content ol ol {
  list-style-type: lower-alpha;
}

.post-content ol ol ol {
  list-style-type: lower-roman;
}

.post-content code {
  font-family: var(--font-global, var(--font-mono, "JetBrains Mono", "Fira Code", Consolas, monospace));
  background: var(--color-bg-soft);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--color-accent);
  border: 1px solid var(--color-border);
}

/* 代码块内的 code 不需要额外样式 */
.post-content pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  color: inherit;
  border: none;
}

/* 键盘按键样式 */
.post-content kbd {
  display: inline-block;
  padding: 0.15em 0.5em;
  font-family: var(--font-global, var(--font-mono, "JetBrains Mono", "Fira Code", Consolas, monospace));
  font-size: 0.85em;
  line-height: 1.4;
  color: var(--color-text);
  background: linear-gradient(180deg, var(--color-bg-soft) 0%, var(--color-bg) 100%);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  box-shadow: 0 2px 0 var(--color-border), 0 2px 3px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
}

/* 代码块横向滚动 */
.post-content pre {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.post-content pre code {
  display: block;
  white-space: pre;
  word-wrap: normal;
  overflow-wrap: normal;
}

/* 表格容器 - 支持横向滚动 */
.post-content .table-wrapper,
.post-content figure:has(table),
.post-content div:has(> table) {
  display: block;
  overflow-x: auto;
  margin: 2em 0;
  max-width: fit-content;
}

.post-content table {
  width: auto !important;
  max-width: none;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  margin: 2em 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  table-layout: auto;
  display: table;
}

/* 表头样式 */
.post-content thead {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-secondary, var(--color-accent)) 100%);
  color: white;
}

.post-content thead tr {
  display: table-row;
}

.post-content th {
  padding: 1em 1.25em;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

/* 表头单元格分隔线 */
.post-content th:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 25%;
  height: 50%;
  width: 1px;
  background: rgba(255, 255, 255, 0.2);
}

/* 表格内容 */
.post-content td {
  padding: 1em 1.25em;
  border-bottom: 1px solid var(--color-border);
  transition: all var(--duration-fast);
}

/* 最后一行无底边框 */
.post-content tbody tr:last-child td {
  border-bottom: none;
}

.post-content tbody tr {
  transition: all var(--duration-fast);
}

/* 斑马纹 */
.post-content tbody tr:nth-child(odd) {
  background: var(--color-bg);
}

.post-content tbody tr:nth-child(even) {
  background: var(--color-bg-soft);
}

/* 悬停高亮 */
.post-content tbody tr:hover {
  background: var(--color-bg-mute);
  transform: scale(1.005);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.post-content tbody tr:hover td {
  color: var(--color-text);
}

/* 第一列加粗 */
.post-content tbody td:first-child {
  font-weight: 500;
  color: var(--color-text);
}

/* 表格内链接 */
.post-content table a {
  color: var(--color-accent);
  border-bottom: 1px dashed var(--color-accent);
}

.post-content table a:hover {
  border-bottom-style: solid;
}

/* 表格内代码 */
.post-content table code {
  padding: 0.15em 0.4em;
  font-size: 0.85em;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

html[data-theme="light"] .post-content table {
  border: 1px solid var(--color-border);
}

html[data-theme="light"] .post-content tbody tr:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.post-content hr {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    var(--color-border) 15%, 
    var(--color-accent) 50%, 
    var(--color-border) 85%, 
    transparent 100%
  );
  margin: 3em auto;
  max-width: 80%;
}

/* ========================================
   脚注样式
   ======================================== */

/* 文章内脚注引用 */
.post-content sup,
.post-content .footnote-ref {
  font-size: 0.75em;
  vertical-align: super;
  line-height: 0;
}

.post-content sup a,
.post-content .footnote-ref a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-size: 11px;
  font-weight: 600;
  color: white;
  background: var(--color-accent);
  border-radius: 4px;
  text-decoration: none;
  border-bottom: none;
  transition: all var(--duration-fast);
}

.post-content sup a:hover,
.post-content .footnote-ref a:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 脚注区域 */
.post-content .footnotes,
.post-content section[data-footnotes],
.post-content .footnote-definition {
  margin-top: 3em;
  padding-top: 2em;
  border-top: 2px solid var(--color-border);
  font-size: 0.9em;
  color: var(--color-text-secondary);
}

.post-content .footnotes::before,
.post-content section[data-footnotes]::before {
  content: '脚注';
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 1em;
}

/* 脚注列表 */
.post-content .footnotes ol,
.post-content section[data-footnotes] ol {
  padding-left: 1.5em;
  margin: 0;
}

.post-content .footnotes li,
.post-content section[data-footnotes] li,
.post-content .footnote-definition {
  padding: 0.75em 1em;
  margin: 0.5em 0;
  background: var(--color-bg-soft);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--color-accent);
  transition: all var(--duration-fast);
}

.post-content .footnotes li:hover,
.post-content section[data-footnotes] li:hover,
.post-content .footnote-definition:hover {
  background: var(--color-bg-mute);
  border-left-width: 5px;
}

.post-content .footnotes li::marker,
.post-content section[data-footnotes] li::marker {
  color: var(--color-accent);
  font-weight: 600;
}

/* 脚注返回链接 */
.post-content .footnotes a.footnote-backref,
.post-content section[data-footnotes] a[data-footnote-backref],
.post-content .footnote-definition a.footnote-backref {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: 8px;
  font-size: 12px;
  color: var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
  border-radius: 50%;
  text-decoration: none;
  border-bottom: none;
  transition: all var(--duration-fast);
}

.post-content .footnotes a.footnote-backref:hover,
.post-content section[data-footnotes] a[data-footnote-backref]:hover,
.post-content .footnote-definition a.footnote-backref:hover {
  background: var(--color-accent);
  color: white;
}

/* 文章标签 */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.post-tags svg {
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
}

.tag {
  display: inline-block;
  padding: 4px 12px;
  font-size: 13px;
  color: var(--color-text-secondary);
  background: var(--color-bg-soft);
  border-radius: var(--radius-full);
  transition: all var(--duration-fast);
}

.tag:hover {
  color: var(--color-accent);
  background: var(--color-bg-mute);
}

/* 文章导航 */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-top: var(--space-8);
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.post-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--color-bg-soft);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  transition: all var(--duration-normal);
  text-decoration: none;
  min-width: 0;
  overflow: hidden;
}

.post-nav-item:hover {
  background: var(--color-bg-mute);
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.post-nav-item:hover .post-nav-arrow {
  color: var(--color-accent);
}

.post-nav-item:hover .post-nav-arrow svg {
  transform: scale(1.1);
}

.post-nav-item.prev .post-nav-arrow svg {
  transition: transform var(--duration-fast);
}

.post-nav-item.prev:hover .post-nav-arrow svg {
  transform: translateX(-3px);
}

.post-nav-item.next:hover .post-nav-arrow svg {
  transform: translateX(3px);
}

.post-nav-item.next {
  flex-direction: row;
  justify-content: flex-end;
}

.post-nav-item.next .post-nav-content {
  text-align: right;
}

.post-nav-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--color-bg-mute);
  color: var(--color-text-muted);
  flex-shrink: 0;
  transition: all var(--duration-fast);
}

.post-nav-arrow svg {
  width: 18px;
  height: 18px;
  transition: transform var(--duration-fast);
}

.post-nav-content {
  flex: 1;
  min-width: 0;
}

.post-nav-label {
  display: block;
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.post-nav-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-nav-empty {
  cursor: default;
  opacity: 0.5;
}

.post-nav-empty:hover {
  background: var(--color-bg-soft);
  border-color: var(--color-border);
  transform: none;
  box-shadow: none;
}

.post-nav-empty:hover .post-nav-arrow {
  color: var(--color-text-muted);
}

.post-nav-empty:hover .post-nav-arrow svg {
  transform: none;
}

.post-nav-empty .post-nav-title {
  font-size: 13px;
  color: var(--color-text-muted);
  font-style: italic;
}

@media (max-width: 640px) {
  .post {
    padding: var(--space-8) var(--space-4);
  }
  
  .post-header {
    text-align: left;
  }
  
  .post-meta {
    justify-content: flex-start;
  }
  
  .post-content {
    font-size: 15px;
  }
  
  .post-nav {
    grid-template-columns: 1fr;
  }
  
  .post-nav-item.next {
    flex-direction: row;
    justify-content: flex-start;
  }
  
  .post-nav-item.next .post-nav-content {
    text-align: left;
  }
  
  .post-nav-item.next .post-nav-arrow {
    order: -1;
  }
}


/* 跳转到评论按钮 */
.go-to-comments {
  position: fixed;
  right: 30px;
  bottom: 40px;
  width: 48px;
  height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-lg);
  color: var(--color-accent);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 1000;
}

html[data-theme="light"] .go-to-comments {
  background: color-mix(in srgb, var(--color-accent) 8%, transparent);
}

.go-to-comments.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.go-to-comments:hover {
  background: color-mix(in srgb, var(--color-accent) 20%, transparent);
  border-color: var(--color-accent-secondary);
  color: var(--color-accent-secondary);
  transform: translateY(4px);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--color-accent) 25%, transparent);
}

html[data-theme="light"] .go-to-comments:hover {
  background: color-mix(in srgb, var(--color-accent) 15%, transparent);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--color-accent) 20%, transparent);
}

.go-to-comments-icon {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.go-to-comments:hover .go-to-comments-icon {
  transform: translateY(2px);
}

.go-to-comments-text {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
}

/* ========================================
   内置灯箱 — 未安装 lightgallery 时的 fallback
   ======================================== */

.post-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  cursor: zoom-out;
}

.post-lightbox.active {
  opacity: 1;
  visibility: visible;
}

.post-lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.post-lightbox.active .post-lightbox-img {
  transform: scale(1);
}

.post-lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  font-size: 36px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s ease;
  z-index: 1;
}

.post-lightbox-close:hover {
  color: #fff;
}

/* ========================================
   文章详情页移动端整体缩小
   ======================================== */
@media (max-width: 768px) {
  /* 文章容器 */
  .post {
    padding: var(--space-4) var(--space-3) !important;
  }

  /* 文章内容字号 */
  .post-content {
    font-size: 14px;
    line-height: 1.7;
  }

  .post-content h2 {
    font-size: 1.3rem;
    margin-top: 1.8em;
    margin-bottom: 0.6em;
  }

  .post-content h3 {
    font-size: 1.15rem;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
  }

  .post-content h4 {
    font-size: 1.05rem;
    margin-top: 1.3em;
  }

  .post-content h2 .heading-icon {
    width: 1.2rem;
    height: 1.2rem;
  }

  .post-content h3 .heading-icon {
    width: 1.3rem;
    height: 1rem;
  }

  .post-content blockquote {
    padding: 1em 1.2em 1em 1.4em;
    margin: 1.2em 0;
    font-size: 13px;
  }

  .post-content img {
    margin: 1em 0;
  }

  .post-content table {
    font-size: 12px;
  }

  .post-content th,
  .post-content td {
    padding: 0.6em 0.8em;
  }

  .post-content code {
    font-size: 0.85em;
  }

  /* 封面区域 */
  .post-hero {
    min-height: 180px;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-top: var(--header-height);
    margin-bottom: var(--space-4);
    border-radius: 0;
  }

  .post-hero-title {
    font-size: 1.2rem;
    order: 1;
    margin-bottom: var(--space-2);
  }

  .post-hero-content {
    padding: var(--space-3);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
  }

  .post-hero-meta {
    order: 2;
    gap: var(--space-2);
  }

  .post-hero-meta > * {
    font-size: 11px;
  }

  .post-hero-category-link,
  .post-hero-tag-link {
    font-size: 11px;
  }

  /* 版权声明 - 保持横向布局 */
  .post-copyright {
    padding: var(--space-3);
    margin-top: var(--space-4);
    gap: var(--space-3);
    flex-direction: row;
    text-align: left;
  }

  .copyright-header {
    justify-content: flex-start;
  }

  .copyright-meta {
    justify-content: flex-start;
  }

  .copyright-badge {
    font-size: 10px;
    padding: 2px 8px;
  }

  .copyright-title {
    font-size: 12px;
  }

  .copyright-label {
    font-size: 10px;
  }

  .copyright-link {
    font-size: 11px;
  }

  .copyright-text {
    font-size: 11px;
  }

  .copyright-logo {
    width: 48px;
    height: 48px;
  }

  /* 分享按钮 - 保持横向布局 */
  .post-share {
    padding: var(--space-3);
    margin-top: var(--space-3);
    gap: var(--space-2);
    flex-direction: row;
    align-items: center;
  }

  .share-label {
    font-size: 11px;
  }

  .share-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }

  .share-btn img {
    border-radius: 8px;
  }

  .share-btn svg {
    width: 18px;
    height: 18px;
  }

  .share-buttons {
    gap: var(--space-2);
  }

  /* 打赏 - 保持横向布局 */
  .post-reward {
    padding: var(--space-3);
    margin-top: var(--space-3);
    flex-direction: row;
  }

  .reward-qrcode {
    width: 72px;
    height: 72px;
    padding: 4px;
  }

  .reward-title {
    font-size: 13px;
  }

  .reward-text {
    font-size: 11px;
  }

  .reward-icon {
    width: 28px;
    height: 28px;
  }

  /* 标签 */
  .post-tags {
    margin-top: var(--space-5);
    padding-top: var(--space-4);
    gap: var(--space-1);
  }

  .tag {
    font-size: 11px;
    padding: 3px 8px;
  }

  /* 文章导航 */
  .post-nav {
    grid-template-columns: 1fr;
    gap: var(--space-2);
    margin-top: var(--space-5);
  }

  .post-nav-item {
    padding: var(--space-3);
    gap: var(--space-2);
  }

  .post-nav-arrow {
    width: 28px;
    height: 28px;
  }

  .post-nav-arrow svg {
    width: 14px;
    height: 14px;
  }

  .post-nav-label {
    font-size: 10px;
  }

  .post-nav-title {
    font-size: 12px;
  }

  .post-nav-item.next {
    flex-direction: row;
    justify-content: flex-start;
  }

  .post-nav-item.next .post-nav-content {
    text-align: left;
  }

  .post-nav-item.next .post-nav-arrow {
    order: -1;
  }

  /* 跳转评论按钮 - 与回到顶部按钮保持一致 */
  .go-to-comments {
    width: 36px;
    height: 36px;
    right: 16px;
    bottom: 30px;
    border-radius: var(--radius-md);
  }

  .go-to-comments-icon {
    width: 14px;
    height: 14px;
  }

  .go-to-comments-text {
    font-size: 7px;
  }

  /* 作者信息 */
  .author-avatar {
    width: 36px;
    height: 36px;
  }

  .author-name {
    font-size: 12px;
  }

  .author-bio {
    font-size: 10px;
  }

  /* 评论区头部 */
  .comments-header {
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
  }

  .comments-header svg {
    width: 16px;
    height: 16px;
  }

  .comments-title {
    font-size: 0.95rem;
  }

  .comments-subtitle {
    font-size: 0.7rem;
    margin-left: var(--space-1);
    padding-left: var(--space-2);
  }

  .comments-count {
    font-size: 0.7rem;
    padding: 2px 8px;
  }
}
