/**
 * 文章页面基础样式
 * @package Westlife
 * @version 1.0.0
 */
 
/*--------------------------------------------------------------
>>> 文章页面布局与内容
--------------------------------------------------------------*/
/* 主要布局结构 */
.single-main {
  position: relative;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 0;
}

/* 主容器 */
.main-container {
  width: 100%;
  max-width: var(--container-width, 1600px);
  margin: 0 auto;
  padding: 0 var(--container-padding, 1rem);
  position: relative;
}

/* 内容区域 */
.main-content {
  width: 100%;
  max-width: var(--content-width, 1280px);
  margin: 0 auto;
  padding: 2rem;
  background: var(--color-background);
  border-radius: var(--border-radius, 8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05), 0 -4px 12px rgba(0, 0, 0, 0.05);
}

/* 文章内容 */
.article-content {
  width: 100%;
}

/* 文章头部 */
.entry-header {
  position: relative;
  padding-bottom: 0.5rem;
  border-bottom: 1.5px solid var(--color-border);
  padding-right: 200px; /* 为分类预留空间 */
}

/* 分类容器样式 */
.entry-categories {
  position: absolute;
  right: 1rem;
  top: -1rem; /* 稍微向下移动一点 */
  display: flex;
  flex-direction: row; /* 改为横向排列 */
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem; /* 增加间距 */
}

/* 分类名称样式 */
.category-name {
  font-family: "Tencent Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; /* 使用腾讯字体 */
  font-size: 3.5rem; /* 增大字号 */
  color: rgba(var(--color-primary-rgb), 0.25);
  font-weight: 700;
  writing-mode: horizontal-tb; /* 改为横向文字 */
  letter-spacing: 0.05em; /* 调整字间距 */
  user-select: none;
  white-space: nowrap;
  transition: all 0.3s ease;
  border-radius: 4px; /* 添加圆角 */
}

/* 分类悬浮效果 */
.category-name:hover {
  color: rgba(var(--color-primary-rgb), 0.75);
  transform: translateY(-1px); /* 改为向上浮动 */
}

/* 深色模式适配 */
[data-theme="dark"] .category-name {
  color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .category-name:hover {
  color: var(--color-primary);
}

/* 响应式适配 */
@media (max-width: 768px) {
  .entry-header {
    padding-right: 0;
  }

  .entry-categories {
    position: relative;
    top: 0;
    right: 0;
    margin-bottom: 1rem;
  }

  .category-name {
    font-size: 1.1rem; /* 移动端稍微缩小字号 */
    padding: 0.35rem 0.75rem;
  }
}

.entry-title {
    font-family: "Source Han Serif CN", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; /* 使用腾讯字体 */
    font-size: 2rem;
    font-weight: 700; /* 使用粗体 */
    line-height: 1.4;
    margin-bottom: 1rem;
    color: var(--color-text); /* 使用主题文本颜色 */
    transition: color 0.3s ease; /* 添加颜色过渡效果 */
}

/* 深色模式适配 */
[data-theme="dark"] .entry-title {
    color: #fff;
}

/* 文章头部元信息样式 */
.entry-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

/* 统一项目基础样式 */
.entry-meta > span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    background: var(--color-background-light);
    border-radius: 20px;
    transition: all 0.2s ease;
}

/* 统一图标样式 */
.entry-meta i {
    font-size: 0.9em;
    color: var(--color-primary);
    opacity: 1;
    transition: all 0.2s ease;
}

/* 统一文字样式 */
.entry-meta span:not(i) {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* 更新图标样式 */
.modified-icon {
    margin-left: 0.2rem;
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

/* 链接样式 */
.entry-meta a {
    color: inherit;
    text-decoration: none;
    transition: all 0.2s ease;
}

/* 悬停效果 */
.entry-meta > span:hover {
    color: var(--color-primary);
    background: var(--color-background);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.entry-meta > span:hover i {
    opacity: 1;
}

/* 更新图标悬停动画 */
.entry-meta > span:hover .modified-icon {
    transform: rotate(180deg);
}

.single-main .post-date[data-title] {
    position: relative;
    cursor: help;
}
.single-main .post-date[data-title]:hover::before {
    content: attr(data-title);
    position: absolute;
    bottom: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 0.875rem;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
}
/* 改这里：title -> data-title */
.single-main .post-date[data-title]:hover::after {
    content: "";
    position: absolute;
    bottom: calc(100% - 5px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 10;
}
/* 深色模式也改为 data-title */
[data-theme="dark"] .single-main .post-date[data-title]:hover::before {
    background: rgba(0, 0, 0, 0.95);
}
[data-theme="dark"] .single-main .post-date[data-title]:hover::after {
    border-top-color: rgba(0, 0, 0, 0.95);
}

/* 深色模式适配 */
[data-theme="dark"] .entry-meta > span {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .entry-meta > span:hover {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] [title]:hover::before {
    background: rgba(0, 0, 0, 0.95);
}

[data-theme="dark"] [title]:hover::after {
    border-top-color: rgba(0, 0, 0, 0.95);
}

/* 响应式适配 */
@media (max-width: 768px) {
    .entry-meta {
        gap: 0.5rem;
        margin: 0.75rem 0;
    }
    
    .entry-meta > span {
        padding: 0.3rem 0.6rem;
        font-size: 0.85rem;
    }
    
    .entry-meta i {
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    .entry-meta {
        justify-content: center;
    }
}

/* 文章过期提示样式 */
.article-outdated {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin: 1rem 0 2rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    background: rgba(255, 244, 222, 0.5);
    border: 1px solid #FFE4AF;
}

.article-outdated i {
    font-size: 1.5rem;
    color: #FFA500;
    flex-shrink: 0;
    margin-top: 0.2rem;
}

.article-outdated .outdated-content {
    flex: 1;
}

.article-outdated strong {
    display: block;
    color: #CC7700;
    margin-bottom: 0.3rem;
}

.article-outdated p {
    margin: 0;
    font-size: 0.95rem;
    color: #666;
    line-height: 1.6;
}

/* 深色模式适配 */
[data-theme="dark"] .article-outdated {
    background: rgba(255, 244, 222, 0.1);
    border-color: rgba(255, 228, 175, 0.2);
}

[data-theme="dark"] .article-outdated strong {
    color: #FFB84D;
}

[data-theme="dark"] .article-outdated p {
    color: #999;
}


/* 文章结束标识（静态版） */
.article-end {
  position: relative;
  margin: 2rem 0 1rem;
  text-align: center;
}
.article-end .end-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border), transparent);
}
.article-end .end-badge {
  position: absolute;
  left: 50%;
  top: -0.8rem;
  transform: translateX(-50%);
  background: var(--color-background);
  padding: 0 .75rem;
}
.article-end .end-text {
  font-family: var(--font-primary);
  font-weight: 600;
  letter-spacing: .35em;
  color: var(--color-text-light);
  font-size: .85rem;
}
/* 深色模式 */
[data-theme="dark"] .article-end .end-badge { background: var(--color-background); }

/* 评论计数链接样式 */
.scroll-to-comments {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-light);
    text-decoration: none;
    transition: color 0.2s ease;
}

.scroll-to-comments:hover {
    color: var(--color-text);
}

/* 文章正文样式 */
.entry-content {
  font-family: var(--font-content);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--color-text);
}

/* 文章标题体系 */
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
  font-family: var(--font-title);
  font-weight: 600;
  line-height: 1.4;
  margin: 1em 0 1em;
  color: var(--color-heading);
  position: relative;
}

.entry-content h2 {
  font-size: 1.75rem;
  padding-bottom: 0.5em;
  border-bottom: 2px solid var(--color-border);
}

.entry-content h2::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100px;
  height: 2px;
  background: var(--color-primary);
}

.entry-content h3 {
  font-size: 1.5rem;
  padding-left: 1rem;
  border-left: 4px solid var(--color-primary);
}

.entry-content h4 {
  font-size: 1.25rem;
}

.entry-content h5 {
  font-size: 1.1rem;
}

.entry-content h6 {
  font-size: 1rem;
}

/* 段落样式 */
.entry-content p {
  margin: 0.5em 0;
  text-align: justify;
}

.entry-content strong {
  color: var(--color-primary);
  font-weight: 600;
}

.entry-content em {
  color: #718096;
  font-style: italic;
}

/* 引用块 = Callout 风格（覆盖旧的引号装饰样式） */
.entry-content blockquote {
  padding: 12px 14px;
  border-left: 4px solid #0a7cff;
  background: rgba(10,124,255,.06);
  border-radius: 8px;
  margin: 12px 0;
}

/* 移除旧的 ::before / ::after 引号装饰 */
.entry-content blockquote::before,
.entry-content blockquote::after {
  content: none !important;
}

/* 警告变体：在编辑器给 blockquote 加 warn 类可用 */
.entry-content blockquote.warn {
  border-color: #f39c12;
  background: rgba(243,156,18,.08);
}

/* 深色模式微调 */
[data-theme="dark"] .entry-content blockquote {
  background: rgba(10,124,255,.10);
}

/* 兼容：保留 .callout 别名（可删除） */
.entry-content .callout {
  padding: 12px 14px;
  border-left: 4px solid #0a7cff;
  background: rgba(10,124,255,.06);
  border-radius: 8px;
  margin: 12px 0;
}
.entry-content .callout.warn {
  border-color: #f39c12;
  background: rgba(243,156,18,.08);
}
/* 文章内仿真键盘按键样式 
<span class="kbd">Ctrl</span> + <span class="kbd">C</span>
使用方式  */
.kbd {
  display: inline-block;
  border: 1px solid #ccc;
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 0 6px;
  background: #f9f9fb;
  font-family: ui-monospace, Consolas, monospace;
  color: #222;
}

/* 暗黑模式适配 */
@media (prefers-color-scheme: dark) {
  .kbd {
    border-color: #555;
    background: #1e1e1e;
    color: #eee;
  }
}

/* 列表样式 */
.entry-content ul,
.entry-content ol {
  margin: 1.5em 0;
  padding-left: 2em;
}

.entry-content ul {
  list-style: none;
}

.entry-content ul li {
  position: relative;
  margin-bottom: 0.5em;
}

.entry-content ul li::before {
  content: "";
  position: absolute;
  left: -1.5em;
  top: 0.7em;
  width: 6px;
  height: 6px;
  background: var(--color-primary);
  border-radius: 50%;
}

.entry-content ol {
  counter-reset: item;
  list-style: none;
}

.entry-content ol li {
  position: relative;
  margin-bottom: 0.5em;
  counter-increment: item;
}

.entry-content ol li::before {
  content: counter(item);
  position: absolute;
  left: -2em;
  top: 0.2em;
  width: 1.5em;
  height: 1.5em;
  line-height: 1.5em;
  text-align: center;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  font-size: 0.8em;
}

/* 链接容器本身也需要调整 */
.entry-content a:not(.download-btn):not(.github-btn):not([href$=".jpg"]):not([href$=".jpeg"]):not([href$=".png"]):not([href$=".gif"]):not([href$=".webp"]):not([href$=".mp4"]):not([href$=".webm"]):not([href*="youtube.com"]):not([href*="youku.com"]):not([href*="bilibili.com"]) {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: var(--color-primary);
  text-decoration: none;
  padding: 0;
  margin-left: 22px; /* 调整为与 favicon 位置对应 */
  margin-right: 2px; /* 右侧间距 */
  transition: all 0.3s ease;
}

/* 外部链接 Favicon */
.entry-content a[href^="http"]:not(.download-btn):not(.github-btn):not([href$=".jpg"]):not([href$=".jpeg"]):not([href$=".png"]):not([href$=".gif"]):not([href$=".webp"]):not([href$=".mp4"]):not([href$=".webm"]):not([href*="youtube.com"]):not([href*="youku.com"]):not([href*="bilibili.com"])::before {
    content: '';
    position: absolute;
    left: -18px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-image: var(--favicon-url);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    margin-right: 6px;
}

/* 外部链接箭头图标 */
.entry-content a[href^="http"]:not(.download-btn):not(.github-btn):not([href$=".jpg"]):not([href$=".jpeg"]):not([href$=".png"]):not([href$=".gif"]):not([href$=".webp"]):not([href$=".mp4"]):not([href$=".webm"]):not([href*="youtube.com"]):not([href*="youku.com"]):not([href*="bilibili.com"])::after {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-left: 6px; /* 增加左侧间距 */
    margin-right: 2px; /* 增加右侧间距 */
    background-image: url('../../static/images/link.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.6;
    position: relative;
    top: 1px;
}

/* 链接文字容器 */
.entry-content a:not(.download-btn):not(.github-btn):not([href$=".jpg"]):not([href$=".jpeg"]):not([href$=".png"]):not([href$=".gif"]):not([href$=".webp"]):not([href$=".mp4"]):not([href$=".webm"]):not([href*="youtube.com"]):not([href*="youku.com"]):not([href*="bilibili.com"]) span {
    position: relative;
    padding-bottom: 1px;
    border-bottom: 1px dotted rgba(var(--color-primary-rgb), 0.4);
    transition: all 0.3s ease;
}

/* 内部链接图标 */
.entry-content a:not([href^="http"]):not(.download-btn):not(.github-btn):not([href$=".jpg"]):not([href$=".jpeg"]):not([href$=".png"]):not([href$=".gif"]):not([href$=".webp"]):not([href$=".mp4"]):not([href$=".webm"]):not([href*="youtube.com"]):not([href*="youku.com"]):not([href*="bilibili.com"])::before {
    content: '#';
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-light);
    opacity: 0.6;
}

/* 悬浮效果 */
.entry-content a:not(.download-btn):not(.github-btn):not([href$=".jpg"]):not([href$=".jpeg"]):not([href$=".png"]):not([href$=".gif"]):not([href$=".webp"]):not([href$=".mp4"]):not([href$=".webm"]):not([href*="youtube.com"]):not([href*="youku.com"]):not([href*="bilibili.com"]):hover {
    color: var(--color-primary);
}

/* 悬浮时下划线样式 */
.entry-content a:not(.download-btn):not(.github-btn):not([href$=".jpg"]):not([href$=".jpeg"]):not([href$=".png"]):not([href$=".gif"]):not([href$=".webp"]):not([href$=".mp4"]):not([href$=".webm"]):not([href*="youtube.com"]):not([href*="youku.com"]):not([href*="bilibili.com"]):hover span {
    border-bottom-style: solid;
    border-bottom-width: 2px;
    border-bottom-color: var(--color-primary);
    font-weight: 600;
}

/* 深色模式适配 */
[data-theme="dark"] .entry-content a:not(.download-btn):not(.github-btn) span {
    border-bottom-color: rgba(var(--color-primary-rgb), 0.3);
}

[data-theme="dark"] .entry-content a:not(.download-btn):not(.github-btn):hover span {
    border-bottom-color: var(--color-primary);
}

[data-theme="dark"] .entry-content a:not([href^="http"]):not(.download-btn):not(.github-btn)::before {
    opacity: 0.4;
}

/* 行内代码块样式 */
.entry-content code:not([class*="language-"]) {
    padding: 0.2em 0.4em;
    margin: 0 0.2em;
    font-size: 0.875em;
    font-family: var(--font-mono, Consolas, Monaco, monospace);
    background: rgba(0, 47, 167, 0.08); /* 使用主题蓝色 */
    color: var(--color-primary, #002FA7); /* 使用主题变量 */
    border-radius: 4px;
    border: 1px solid rgba(0, 47, 167, 0.1);
    vertical-align: middle;
    transition: all 0.2s ease;
}

/* 悬停效果 */
.entry-content code:not([class*="language-"]):hover {
    background: rgba(0, 47, 167, 0.12);
    border-color: rgba(0, 47, 167, 0.2);
}

/* 深色模式适配 */
[data-theme="dark"] .entry-content code:not([class*="language-"]) {
    background: rgba(0, 47, 167, 0.15);
    color: #4d71d7; /* 更亮的蓝色以适应深色模式 */
    border-color: rgba(0, 47, 167, 0.2);
}

[data-theme="dark"] .entry-content code:not([class*="language-"]):hover {
    background: rgba(0, 47, 167, 0.2);
    border-color: rgba(0, 47, 167, 0.25);
}

/*--------------------------------------------------------------
>>> 文章内图片样式（统一兼容：带说明/不带说明，1-4张）
--------------------------------------------------------------*/

/* 网格容器 */
.entry-content .image-row {
  display: flex;
  flex-wrap: wrap; 
  justify-content: flex-start;
  align-items: stretch;
  --gap: .5rem;
  gap: var(--gap);
  margin: 2rem 0;
  width: 100%;
}

.entry-content .image-row > * {
  position: relative; 
  box-sizing: border-box;
  overflow: hidden; 
  min-width: 0; 
}

/* 图片基础样式（不改） */
.entry-content .image-row img,
.entry-content .single-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  object-fit: cover;
  background: var(--color-background-light);
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  transition: transform .3s ease;
}

/* 单张图片容器（不改） */
.entry-content .single-image {
  position: relative;
  width: 100%;

  margin: 2rem auto;
  box-sizing: border-box;
}

/* 列宽规则 */
.entry-content .image-row.one   > * { flex: 0 0 100%;                    max-width: 100%; }
.entry-content .image-row.two   > * { flex: 0 0 calc(50% - .25rem);      max-width: calc(50% - .25rem); }
/* 修复三列 2+1：用 (100% - 2*gap)/3，并减去 .1px 防止进位 */
.entry-content .image-row.three > * {
  flex: 0 0 calc((100% - (var(--gap) * 2)) / 3 - .1px);
  max-width: calc((100% - (var(--gap) * 2)) / 3 - .1px);
}
.entry-content .image-row.four  > * { flex: 0 0 calc(25% - .375rem);     max-width: calc(25% - .375rem); }


/* 桌面端：两列/三列/四列强制单行显示 */
@media (min-width: 769px) {
  .entry-content .image-row.two,
  .entry-content .image-row.three,
  .entry-content .image-row.four {
    flex-wrap: nowrap;
  }
  /* 三列均分，避免 calc 进位导致 2+1 */
  .entry-content .image-row.three > * {
    flex: 1 1 0;       /* 均分剩余空间 */
    max-width: none;   /* 覆盖之前的 max-width 计算 */
  }
}

/* 说明文字：仅当父容器（非 img）或 .single-image 带 data-title 时显示 */
/* 注意：不要把 data-title 放到 <img> 上，img 上的 ::after 不会渲染 */
.entry-content .image-row > [data-title]:not(img)::after,
.entry-content .single-image[data-title]::after {
  content: attr(data-title);
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  padding: .5rem 1.2rem;
  max-width: calc(100% - 1rem);
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 6px;
  color: #fff;
  font-size: .95rem;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  pointer-events: none;  /* 不阻挡点击图片 */
  z-index: 1;
}

/* 悬停效果（不改） */
.entry-content .image-row img:hover,
.entry-content .single-image img:hover {
  transform: translateY(-2px);
}

/* 响应式（不改尺寸逻辑） */
@media (max-width: 992px) {
  .entry-content .image-row.four > * {
    flex: 0 0 calc(33.333% - .333rem);
    max-width: calc(33.333% - .333rem);
  }
}
@media (max-width: 768px) {
  .entry-content .image-row { gap: 1rem; }
  .entry-content .image-row.three > *,
  .entry-content .image-row.four  > * {
    flex: 0 0 calc(50% - .5rem);
    max-width: calc(50% - .5rem);
  }
  .entry-content .single-image { max-width: 100%; }
}
@media (max-width: 480px) {
  .entry-content .image-row { gap: .5rem; }
  .entry-content .image-row > * {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
}

/* 整组图片容器与说明（不影响 .image-row 布局） */
.entry-content figure.image-group {
  margin: 2rem 0;
}

.entry-content figure.image-group .image-row,
.entry-content figure.image-group .single-image {
  margin-bottom: .5rem; /* 组内图片与说明的间距 */
}

.entry-content .image-caption {
  display: block;
  width: 100%;
  text-align: center;
  font-size: .95rem;
  line-height: 1.7;
  color: var(--color-text-light);
  margin: 0;               /* 由父容器控制外边距 */
  padding: 0 .5rem;        /* 轻微内边距，避免贴边 */
  word-break: break-word;  /* 防止超长文本溢出 */
}

.entry-content .image-caption em {
  color: var(--color-text-light);
  font-style: italic;
  opacity: .95;
}

/* 深色模式（可选加强可读性） */
[data-theme="dark"] .entry-content .image-caption {
  color: var(--color-text-light);
}

/*--------------------------------------------------------------
>>> 文章内图片样式结束
--------------------------------------------------------------*/

/* 表格样式 */
.entry-content table {
  width: 100%;
  margin: 1em 0;
  border-collapse: collapse;
  border-spacing: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.entry-content th,
.entry-content td {
  padding: 0.75em 1em;
  border: 1px solid var(--color-border);
  text-align: left;
}

.entry-content th {
  background: var(--color-background-light);
  font-weight: 600;
  color: var(--color-heading);
}

.entry-content tr:nth-child(even) {
  background: var(--color-background-light);
}

/* 分割线样式 */
.entry-content hr {
  margin: 3em 0;
  border: none;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-border) 50%,
    transparent
  );
}

/* 标记文本 */
.entry-content mark {
  background: rgba(var(--color-primary-rgb), 0.1);
  color: var(--color-primary);
  padding: 0.2em 0.4em;
  border-radius: 3px;
}

/* 键盘输入 */
.entry-content kbd {
  padding: 0.2em 0.4em;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  box-shadow: 0 2px 0 var(--color-border);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

[data-theme="dark"] .entry-content table {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 文章目录样式（重写） */
.article-toc {
  position: fixed;
  top: 0;      /* 由 JS 实时设置 */
  left: 0;     /* 由 JS 实时设置 */
  width: 280px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(20px);
  /* 加上 top 的过渡，配合 JS 惯性更顺滑 */
  transition: top .25s ease-out, opacity .3s ease, transform .3s ease, visibility .3s ease;
  will-change: top, left, transform;
  z-index: 100;
}
/* 小屏兜底隐藏可保留；移除响应式 left 的兜底，避免视觉错觉 */
@media (max-width: 1400px) { .article-toc { display: none !important; } }

.article-toc.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* 评论区淡出状态（不抢事件） */
.article-toc.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* 强制隐藏（空间不足/无目录项时） */
.article-toc.is-hidden {
  display: none !important;
}

/* 目录卡片 */
.toc-container {
  background: var(--color-background);
  border-radius: 8px;
  padding: 0.8rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--color-border);
}

.toc-title {
  font-size: 1rem;
  font-weight: 540;
  color: var(--color-text);
  margin: 0 0 0.55rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toc-title i {
  color: var(--color-primary);
  font-size: 1.1rem;
}

.toc-list {
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  padding-right: 0.5rem;
}

.toc-item { margin: 0.25rem 0; line-height: 1.4; }
.toc-item.level-2 { padding-left: 0; }
.toc-item.level-3 { padding-left: 1.2em; }
.toc-item.level-4 { padding-left: 2.4em; }
.toc-item.level-5 { padding-left: 3.6em; }
.toc-item.level-6 { padding-left: 4.8em; }

.toc-link {
  display: block;
  padding: 0.2rem 0.3rem;
  color: var(--color-text);
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toc-link:hover {
  color: var(--color-primary);
  background: rgba(var(--color-primary-rgb), 0.08);
  opacity: 1;
}
.toc-link.active {
  color: var(--color-primary);
  background: rgba(var(--color-primary-rgb), 0.1);
  font-weight: 500;
  opacity: 1;
}

/* 目录不同层级字号区分，避免占满宽度 */
.toc-item.level-2 > .toc-link { font-size: 0.95rem; font-weight: 400; }
.toc-item.level-3 > .toc-link { font-size: 0.85rem; }
.toc-item.level-4 > .toc-link { font-size: 0.75rem; }
.toc-item.level-5 > .toc-link { font-size: 0.65rem; }
.toc-item.level-6 > .toc-link { font-size: 0.60rem; }

/* 滚动条美化 */
.toc-list::-webkit-scrollbar { width: 4px; }
.toc-list::-webkit-scrollbar-track { background: transparent; }
.toc-list::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 2px; }
.toc-list:hover::-webkit-scrollbar-thumb { background: var(--color-text-light); }

/* 修复锚点被固定头部遮挡（JS 会设置 --fixed-header-offset） */
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
  scroll-margin-top: var(--fixed-header-offset, 100px);
}

/* 深色模式 */
[data-theme="dark"] .toc-container {
  background: var(--color-background);
  border-color: var(--color-border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

/* 响应式兜底（JS 会优先计算定位） */
@media (max-width: 1400px) {
  .article-toc { display: none !important; }
}

/*--------------------------------------------------------------
>>>  底部功能区：三栏布局（左分享｜中表情｜右关键词）
--------------------------------------------------------------*/

/* 底部功能区：三栏布局（左分享｜中表情｜右关键词） */
.entry-taxonomy {
  position: relative;                 /* 供中栏绝对居中定位 */
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--color-background-light);
  border-radius: 12px;
  overflow: visible;                  /* 允许子项可见溢出（右侧标签） */
}
.taxonomy-left  { flex: 0 0 auto; display: flex; align-items: center; }
.taxonomy-center{ flex: 1 1 auto; display: flex; align-items: center; justify-content: center; }
.taxonomy-right { flex: 1 1 auto; min-width: 0; display: flex; justify-content: flex-end; }

/* 左侧分享（完全重写）：默认浅色，悬浮仅图标放大+品牌色+轻微阴影 */
.entry-taxonomy .taxonomy-left .post-share { display: flex; align-items: center; }
.entry-taxonomy .taxonomy-left .post-share .share-icons {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  white-space: nowrap;
}
.entry-taxonomy .taxonomy-left .post-share .share-icons li { list-style: none; flex: 0 0 auto; }

/* 按钮本体：默认跟随主题浅色，禁止任何背景变化 */
.entry-taxonomy .taxonomy-left .post-share .share-icon {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  line-height: 1;
  color: var(--color-text-light);
  background: transparent !important;
  box-shadow: none !important;
  text-shadow: none !important;
  transform-origin: center;
  transition: transform .18s ease, color .2s ease, filter .2s ease;
  will-change: transform, filter;
}
.entry-taxonomy .taxonomy-left .post-share .share-icon i,
.entry-taxonomy .taxonomy-left .post-share .share-icon svg { font-size: 22px; line-height: 1; }
.entry-taxonomy .taxonomy-left .post-share .share-icon i,
.entry-taxonomy .taxonomy-left .post-share .share-icon svg,
.entry-taxonomy .taxonomy-left .post-share .share-icon svg path {
  color: currentColor !important;
  fill: currentColor !important;
}

/* 悬浮/键盘聚焦：仅放大一点并微上浮 */
@media (hover: hover) {
  .entry-taxonomy .taxonomy-left .post-share .share-icon:hover {
    transform: scale(1.5) translateY(-1px) !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  .entry-taxonomy .taxonomy-left .post-share .share-icon { transition: none; }
  .entry-taxonomy .taxonomy-left .post-share .share-icon:hover { transform: none !important; }
}

/* 品牌色（悬浮时仅改变图标本身颜色） */
.entry-taxonomy .taxonomy-left .post-share .share-icon.share-icon--x:hover        { color: #000000 !important;  filter: drop-shadow(0 4px 10px rgba(0,0,0,.35)); }
.entry-taxonomy .taxonomy-left .post-share .share-icon.share-icon--mastodon:hover { color: #6364FF !important;  filter: drop-shadow(0 4px 10px rgba(99,100,255,.35)); }
.entry-taxonomy .taxonomy-left .post-share .share-icon.share-icon--weibo:hover    { color: #E6162D !important;  filter: drop-shadow(0 4px 10px rgba(230,22,45,.35)); }
.entry-taxonomy .taxonomy-left .post-share .share-icon.share-icon--telegram:hover { color: #26A4E3 !important;  filter: drop-shadow(0 4px 10px rgba(38,164,227,.35)); }
.entry-taxonomy .taxonomy-left .post-share .share-icon.share-icon--bluesky:hover  { color: #0285FF !important;  filter: drop-shadow(0 4px 10px rgba(2,133,255,.35)); }
/* 暗色：X 悬浮用白色以保证可见度 */
[data-theme="dark"] .entry-taxonomy .taxonomy-left .post-share .share-icon.share-icon--x:hover {
  color: #ffffff !important; filter: drop-shadow(0 4px 10px rgba(255,255,255,.25));
}

/* 键盘可访问性 */
.entry-taxonomy .taxonomy-left .post-share .share-icon:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* 慢速平滑放大：声明初始 transform + 更柔和缓动 */
.entry-taxonomy .taxonomy-left .post-share .share-icon {
  transform: translateY(0) scale(1);
  transition: transform .42s cubic-bezier(.22,.61,.36,1), color .28s ease, filter .28s ease;
}

/* 悬浮/聚焦/触摸：保持原目标尺寸，仅改变动画节奏 */
.entry-taxonomy .taxonomy-left .post-share .share-icon:hover,
.entry-taxonomy .taxonomy-left .post-share .share-icon:focus-visible {
  transform: scale(1.5) translateY(-1px) !important;
}
.entry-taxonomy .taxonomy-left .post-share .share-icon:active {
  transform: scale(1.35) translateY(-1px) !important;
}

/* 中栏：点赞绝对居中，不挡左右点击；小屏回退为正常流居中 */
.entry-taxonomy .taxonomy-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: none;        /* 不挡左右区域事件 */
}
.entry-taxonomy .taxonomy-center .reactions { pointer-events: auto; } /* 仅按钮可点 */
@media (max-width: 768px) {
  .entry-taxonomy .taxonomy-center {
    position: static;
    transform: none;
    flex: 1 1 auto;
    pointer-events: auto;
  }
}

/* 中栏：表情/点赞（轻量样式） */
.reactions {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.react-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  background: var(--color-background);
  color: var(--color-text);
  border-radius: 999px;
  cursor: pointer;
  line-height: 1;
  transition: background .2s ease, border-color .2s ease, transform .1s ease;
}
.react-btn:hover  { border-color: var(--color-primary); }
.react-btn:active { transform: scale(0.98); }
.react-emoji { font-size: 16px; line-height: 1; }
.react-count { font-size: 12px; color: var(--color-text-light); }
.react-btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }


/* Reactions 交互增强 */
.react-btn.active {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(var(--color-primary-rgb), 0.06);
}
.react-btn:active { transform: scale(0.98); }

/* +1/-1 漂浮气泡 */
.plus-one {
  position: fixed;
  left: 0; top: 0;
  transform: translate(-50%, 0);
  z-index: 9999;
  pointer-events: none;
  font: 700 14px/1 var(--font-primary, system-ui);
  color: var(--color-primary);
  text-shadow: 0 1px 0 rgba(0,0,0,.05);
  animation: plusOneFloat .7s ease-out forwards;
}
@keyframes plusOneFloat {
  0%   { opacity: 0; transform: translate(-50%, 8px) scale(.9); }
  10%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -28px) scale(1); }
}
/* 暗色微调 */
[data-theme="dark"] .plus-one { color: #86a8ff; }


/* 右侧关键词（单文页专用 single-tags） */

/* 调小右侧关键词字号与计数徽标（稍微小一点） */
.entry-taxonomy .taxonomy-right .single-tags { font-size: 0.85rem; }
.entry-taxonomy .taxonomy-right .single-tags a { line-height: 1.1; }
.entry-taxonomy .taxonomy-right .single-tags .tag-hash { font-size: 0.85em; }
.entry-taxonomy .taxonomy-right .single-tags a .count {
  font-size: 9px;
  top: -0.5em;
  right: -0.4em;
}

/* 小屏再小一档 */
@media (max-width: 480px) {
  .entry-taxonomy .taxonomy-right .single-tags { font-size: 0.9rem; }
}


.react-btn.active {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(var(--color-primary-rgb), 0.06);
}
/* 深色模式 */
[data-theme="dark"] .react-btn.active {
  background: rgba(255,255,255,0.06);
  color: var(--color-text);
  border-color: var(--color-border);
}

/* 右侧关键词（单文页专用 single-tags） */

.entry-taxonomy .taxonomy-right {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  overflow: visible;
}
.entry-taxonomy .taxonomy-right .single-tags {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: nowrap;
  white-space: nowrap;
  max-width: none;           /* 不限制宽度 */
  overflow: visible;         /* 不出现滚动条 */
}
.entry-taxonomy .taxonomy-right .single-tags a {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: baseline;
  gap: .25rem;
  padding: 0;
  background: none;
  border-radius: 0;
  color: var(--color-text);
  line-height: 1.2;
  text-decoration: none;
  transition: color .2s ease;
}
.entry-taxonomy .taxonomy-right .single-tags a:hover { color: var(--color-hover); }
.entry-taxonomy .taxonomy-right .single-tags .tag-hash {
  color: var(--color-primary);   /* # 高亮为主题色 */
  margin-right: 2px;
  font-weight: 600;
}
.entry-taxonomy .taxonomy-right .single-tags a .count {
  position: absolute;
  top: -0.45em;
  right: -0.35em;
  font-size: 10px;
  line-height: 1;
  color: var(--color-text-light);
  font-weight: 600;
  padding: 0;
  background: none;
  border: 0;
  display: inline-block !important;
}

/* 深色模式微调 */
[data-theme="dark"] .entry-taxonomy { background: var(--color-background); }
[data-theme="dark"] .entry-taxonomy .taxonomy-right .single-tags a .count { color: #bfbfbf; }

/*--------------------------------------------------------------
>>> 版权和作者（底部）
--------------------------------------------------------------*/

/* 1) 区块容器 */
.entry-meta-box {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1rem 0;
  padding: 1.2rem;
  background: var(--color-background-light);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* 2) 背景装饰 + 动画 */
.entry-meta-box::before {
  content: "";
  position: absolute;
  right: 140px;
  top: 50%;
  width: 180px;
  height: 180px;
  background-image: url("../images/WTFPL.svg");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.06;
  z-index: 0;
  transform: translateY(-50%) scale(1);
  transform-origin: center center;
  will-change: transform;
}

/* 3) 左侧：头像与社交区 */
.author-avatar {
  position: relative;
  z-index: 1;
  margin-left: 16px;
  margin-right: 1rem;
}

.author-avatar img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid var(--color-background);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform .3s ease, box-shadow .3s ease;
}

/* 悬浮：先上移头像（丝滑），再出现社交图标（入场延迟） */
.author-avatar:hover img,
.author-avatar:focus-within img {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

/* 社交按钮容器：默认隐藏 */
.author-social {
  position: absolute;
  left: 50%;
  top: calc(100% - 10px);
  transform: translateX(-50%) translateY(10px);
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transition: transform .28s ease, opacity .28s ease;
  will-change: transform, opacity;
  z-index: 2;
}

.author-social li {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* 兜底去除列表符号 */
.author-social li::marker { content: none; }

/* 社交容器底片 */
.author-social::before {
  content: "";
  position: absolute;
  inset: -6px -10px;
  background: rgba(0,0,0,0.04);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  z-index: -1;
  opacity: 0;
  transition: opacity .3s ease;
}

/* 显示条件：仅入场延迟，离场无延迟 */
.author-avatar:hover .author-social,
.author-avatar:focus-within .author-social,
.author-social:hover {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
  transition-delay: .12s; /* 仅入场延迟 */
}

.author-avatar:hover .author-social::before,
.author-avatar:focus-within .author-social::before,
.author-social:hover::before {
  opacity: 1;
}

/* 扩展热区，避免移入图标时消失 */
.author-avatar::after {
  content: "";
  position: absolute;
  left: -16px;
  right: -16px;
  top: 100%;
  height: 90px;
}

/* 4) 社交按钮样式 */
.as-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  outline: none;
  color: #fff; /* 基色固定白色 */
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
  transition: transform .18s ease, box-shadow .18s ease;
}

/* 阻断全局 a:hover 颜色，图标始终白色 */
.author-social .as-btn,
.author-social .as-btn:hover,
.author-social .as-btn:focus { color: #fff !important; }
.author-social .as-btn .as-icon { color: #fff !important; }

.as-btn .as-icon { font-size: 14px; }
.as-btn .text { display: none !important; }

/* 悬浮：仅轻微放大 */
.as-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 14px rgba(0,0,0,.16);
}

/* 品牌色 */
.as-btn.twitter { background-color: #1da1f2; }
.as-btn.github  { background-color: #24292e; }
.as-btn.youtube { background-color: #ff0000; }

/* 深色模式阴影微调 */
[data-theme="dark"] .as-btn { box-shadow: 0 3px 8px rgba(0,0,0,.3); }
[data-theme="dark"] .as-btn:hover { box-shadow: 0 10px 20px rgba(0,0,0,.45); }

/* 小屏优化（社交按钮更小） */
@media (max-width: 768px) {
  .author-social { gap: 4px; }
  .as-btn { width: 26px; height: 26px; }
  .as-btn .as-icon { font-size: 13px; }
}

/* 5) 中间：作者与版权信息 */
.copyright-content {
  display: flex;
  gap: 1.2rem;
  flex: 1;
  z-index: 1;
  position: static;      /* 使引号图标相对 entry-meta-box 定位 */
  padding-left: 2.4rem;  /* 为引号图标留位 */
}

/* 左上角引号图标 */
.entry-meta-box .copyright-icon {
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  color: var(--color-primary);
  font-size: 1.6rem;
  opacity: 0.2;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.entry-meta-box:hover .copyright-icon {
  opacity: 0.3;
}

/* 文本容器 */
.copyright-info { flex: 1; }

.copyright-info p {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.4rem 0;
  font-size: 0.95rem;
  color: var(--color-text);
}

.copyright-info span {
  color: var(--color-text);
  white-space: nowrap;
}

.copyright-info a {
  color: var(--color-primary);
  text-decoration: none;
  transition: all 0.2s ease;
}

.copyright-info a:hover {
  color: var(--color-secondary);
  text-decoration: underline;
}

/* 时间信息弱化 */
.entry-meta-box .article-author {
  font-size: 0.92rem;
}

.entry-meta-box .article-author .published,
.entry-meta-box .article-author .updated {
  font-size: 0.88em;
  color: var(--color-text-light);
  font-weight: 400;
  white-space: nowrap;
}

.entry-meta-box .article-author .sep {
  color: var(--color-text-light);
  opacity: .6;
}

/* 小屏再弱化 */
@media (max-width: 480px) {
  .entry-meta-box .article-author { font-size: 0.9rem; }
  .entry-meta-box .article-author .published,
  .entry-meta-box .article-author .updated { font-size: 0.86em; }
}

/* 版权区链接强调 */
.entry-meta-box .article-author .in-cat a { color: var(--color-primary); }
.entry-meta-box .article-license .site-name,
.entry-meta-box .article-license .license-link { color: var(--color-primary); }
.entry-meta-box .article-license .site-name:hover,
.entry-meta-box .article-license .license-link:hover { color: var(--color-secondary); }

/* 仅文章底部版权中的“CC BY-NC-SA 4.0”链接文本使用 Roboto Condensed */
.entry-meta-box .article-license .license-link {
  font-family: "Roboto Condensed", "Roboto", "Segoe UI", Arial, sans-serif;
  font-weight: 600;         /* 可按需调整粗细 */
  letter-spacing: 0.02em;   /* 略微加字距，更利于辨识 */
}

/* 复制链接按钮 */
.article-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.copy-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  border: none;
  background: transparent;
  color: var(--color-text-light);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.copy-link-btn:hover {
  color: var(--color-primary);
  background: var(--color-background-light);
}

.copy-link-btn.success {
  color: #10B981;
  background: rgba(16, 185, 129, 0.1);
}

/* 深色模式（复制按钮） */
[data-theme="dark"] .copy-link-btn { color: var(--color-text-light); }
[data-theme="dark"] .copy-link-btn:hover { background: rgba(255,255,255,0.1); }
[data-theme="dark"] .copy-link-btn.success {
  color: #34D399;
  background: rgba(52,211,153,0.1);
}

/* 6) 右侧：二维码 */
.qrcode-box {
  position: relative;
  width: 80px;
  margin-left: auto;
  opacity: 0.8;
  transition: transform .25s ease, opacity .25s ease;
  transform: none !important;
}

.qrcode-content {
  width: 100%;
  height: 80px;
  background: #fff;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.qrcode-content img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}

.qrcode-tip {
  margin-top: 0.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-text-light);
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  opacity: 0.8;
}

.qrcode-tip i {
  font-size: 0.9rem;
  color: #07C160;
}

/* 悬浮仅缩放 */
.qrcode-box:hover {
  opacity: 1;
  transform: scale(1.06) !important;
}
.qrcode-box:hover .qrcode-tip { opacity: 1; }

/* 深色模式（二维码） */
[data-theme="dark"] .qrcode-content {
  background: var(--color-background);
  border-color: var(--color-border);
}
[data-theme="dark"] .qrcode-tip { color: var(--color-text-light); }
[data-theme="dark"] .qrcode-box { opacity: 0.6; }
[data-theme="dark"] .qrcode-box:hover { opacity: 0.9; }

/* 7) 移动端布局 */
@media (max-width: 768px) {
  .entry-meta-box {
    flex-direction: column;
    align-items: flex-start;
    gap: .8rem;
  }
  .author-avatar { margin-right: 0; }
  .qrcode-box { margin-left: 0; align-self: flex-end; }
}

/*--------------------------------------------------------------
>>> 相关文章区域
--------------------------------------------------------------*/
/* 容器 */
.related-posts {
  margin: 2rem 0;
  position: relative;
}

/* 头部（标题 + 换一批） */
.related-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem 1rem;
  padding: .4rem .2rem .8rem;
  margin-bottom: .6rem;
  border-bottom: 1px solid var(--color-border);
}

/* 标题：左侧色条 + 图标 */
.related-title {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-heading);
  line-height: 1.2;
  padding-left: .75rem;
}
.related-title::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 1.1em;
  border-radius: 3px;
  background: var(--color-primary);
}
.related-title i {
  color: var(--color-primary);
  font-size: 1.05rem;
}

/* 相关文章：右侧“换一批”动作区（优化版）
   - 默认/悬浮：仅显示刷新 SVG（跟随 currentColor）
   - 加载中(.loading / [aria-busy="true"])：仅显示旋转圆圈，颜色 #002FA7，禁用点击
   - 使用变量控制尺寸与速度；移除一切 hover 切换逻辑
*/
.related-actions {
  --related-icon-size: 18px;
  --related-spinner-duration: 1s;
  --related-spinner-color: #002FA7;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  user-select: none;
}

/* 按钮基础 */
.related-random-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--color-background);
  color: var(--color-text-light);            /* 控制图标颜色（SVG/FA 跟随） */
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: none;                           /* 取消过渡，避免悬浮动画 */
}
.related-random-btn i,
.related-random-btn svg { pointer-events: none; }

/* 悬浮/聚焦：保持外观不变（不触发图标切换） */
.related-random-btn:hover,
.related-random-btn:focus {
  background: var(--color-background);
  color: var(--color-text-light);
  border-color: var(--color-border);
  transform: none;
  box-shadow: none;
}

/* 提示文字（容器悬浮时淡入） */
.related-random-text {
  font-size: .85rem;
  color: var(--color-text-light);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity .18s ease, transform .18s ease, color .18s ease;
  white-space: nowrap;
  pointer-events: none;
}
.related-actions:hover .related-random-text,
.related-actions:focus-within .related-random-text {
  opacity: 1;
  transform: translateY(0);
}

/* 刷新 SVG（默认/悬浮均显示） */
.related-random-btn .icon-refresh {
  width: var(--related-icon-size);
  height: var(--related-icon-size);
  display: inline-block;
  vertical-align: -2px;
  fill: currentColor;
}
.related-random-btn .icon-refresh path { fill: currentColor; }

/* 加载圈：默认隐藏，仅 loading 显示；对齐与旋转中心 */
.related-random-btn .fa-circle-notch {
  display: none !important;
  font-size: var(--related-icon-size);
  line-height: 1;
  transform-origin: center center;
  will-change: transform;
}

/* 加载状态：仅在 loading 时切换为旋转圈并着色为主题蓝 */
.related-random-btn.loading,
.related-random-btn[aria-busy="true"] {
  color: var(--related-spinner-color);        /* 主题蓝，同时作用于旋转圈颜色 */
  cursor: not-allowed;
  pointer-events: none;
}
.related-random-btn.loading .icon-refresh,
.related-random-btn[aria-busy="true"] .icon-refresh {
  display: none !important;
}
.related-random-btn.loading .fa-circle-notch,
.related-random-btn[aria-busy="true"] .fa-circle-notch {
  display: inline-block !important;
  animation: fa-spin var(--related-spinner-duration) linear infinite !important; /* 强制旋转 */
}

/* 列表容器加载态（淡化） */
.related-grid.loading {
  opacity: 0.5;
  pointer-events: none;
}

/* 兜底：若 Font Awesome 未定义 .fa-spin，提供动画（全局） */
@keyframes fa-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.fa-spin { animation: fa-spin 1s linear infinite; }

/* 网格与卡片（保持原有） */
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  transition: opacity 0.3s ease;
}
.related-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}
.related-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.related-thumb {
  position: relative;
  aspect-ratio: 16/9;
  height: auto;
  overflow: hidden;
  background: var(--color-background-light);
}
@supports not (aspect-ratio: 1) {
  .related-thumb { padding-bottom: 56.25%; }
}
.related-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.related-item:hover .related-thumb img { transform: scale(1.1); }
.related-content {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 2rem 1rem 1rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  backdrop-filter: blur(4px);
  transition: all 0.3s ease;
}
.related-item-title {
  font-size: 1.1rem;
  line-height: 1.5;
  margin: 0;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  text-align: center;
  transition: transform 0.3s ease;
}

/* 相关文章：标题变小、背景条变矮，仅包住标题 */
.related-item-title {
  font-size: 0.95rem;         /* 比原来更小 */
  line-height: 1.35;
  font-weight: 600;
}

/* 若已有模糊背景，这里仅收紧高度与内边距 */
.related-content {
  padding: 6px 10px;          /* 变矮：上下内边距减小 */
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
}

/* 缩略图左上角的发布时间徽标 */
.related-thumb { position: relative; }
.related-date {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.4;
  color: #fff;
  background: rgba(0,0,0,0.55);
  border-radius: 4px;
  backdrop-filter: saturate(140%) blur(4px);
  -webkit-backdrop-filter: saturate(140%) blur(4px);
  pointer-events: none;
}

/* 深色模式微调 */
[data-theme="dark"] .related-content {
  background: rgba(0,0,0,0.45);
}
[data-theme="dark"] .related-date {
  background: rgba(0,0,0,0.6);
  color: #eee;
}

/* 小屏再小一点标题字号 */
@media (max-width: 480px) {
  .related-item-title { font-size: 0.9rem; }
  .related-content { padding: 6px 8px; }
}

/* 响应式 */
@media (max-width: 768px) {
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .related-grid { grid-template-columns: 1fr; }
}

/* 全局动画（所有模块可复用） */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}

/* 可选：通用工具类 */
.ani-spin { animation: spin 1s linear infinite; }
.ani-pulse { animation: pulse 1.5s ease-in-out infinite; }


/* 相关文章卡片阴影 */
[data-theme="dark"] .related-item {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
[data-theme="dark"] .related-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 单文页主体与通用块（取自单页原深色块） */
[data-theme="dark"] .main-content {
  background: var(--color-background);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
[data-theme="dark"] .entry-content { color: var(--color-text); }
[data-theme="dark"] .entry-content blockquote,
[data-theme="dark"] .entry-content pre[class*="language-"] {
  background: var(--color-background-light);
}
[data-theme="dark"] .entry-content mark {
  background: rgba(var(--color-primary-rgb), 0.15);
}
[data-theme="dark"] .entry-content kbd {
  background: var(--color-background-light);
  border-color: var(--color-border);
  box-shadow: 0 2px 0 var(--color-border);
}

/* 单文页卡片 */
[data-theme="dark"] .entry-meta-box,
[data-theme="dark"] .entry-taxonomy,
[data-theme="dark"] .related-posts {
  background: var(--color-background-light);
}

/* 代码工具条 */
[data-theme="dark"] .code-toolbar .language-name {
  background: rgba(0, 0, 0, 0.2);
}
[data-theme="dark"] .code-toolbar .copy-button {
  background: var(--color-background);
}

/* 目录卡片 */
[data-theme="dark"] .toc-container {
  background: var(--color-background);
  border-color: var(--color-border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
[data-theme="dark"] .toc-list::-webkit-scrollbar-thumb {
  background: var(--color-border);
}

/* 加载遮罩 */
[data-theme="dark"] .loading-overlay {
  background: rgba(0, 0, 0, 0.2);
}

/* 复制/二维码弹层 */
[data-theme="dark"] .copy-tooltip { background: rgba(0, 0, 0, 0.9); }
[data-theme="dark"] .copy-tooltip::after { border-top-color: rgba(0, 0, 0, 0.9); }
[data-theme="dark"] .qrcode-popup { background: var(--color-background); }
[data-theme="dark"] .qrcode-popup::after { border-top-color: var(--color-background); }
[data-theme="dark"] .qrcode-popup p { color: var(--color-text-light); }

/* 作者头像边框与阴影 */
[data-theme="dark"] .author-avatar img {
  border-color: var(--color-background);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* 响应式（仅深色差异） */
@media (max-width: 768px) {
  [data-theme="dark"] .entry-meta-box::before { opacity: 0.04; }
}
@media (max-width: 576px) {
  [data-theme="dark"] .entry-content blockquote { background: var(--color-background-light); }
  [data-theme="dark"] .code-toolbar .copy-button { background: var(--color-background-light); }
}

/* GitHub 按钮样式
------------------------------------------ */
.github-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: #24292e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* 按钮内容布局 */
.github-btn-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* GitHub Logo */
.github-icon {
    display: flex;
    align-items: center;
}

.github-icon svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

/* GitHub Logo SVG Path */
.github-icon path {
    d: path("M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z");
}

/* 按钮文字 */
.github-text {
    font-weight: 500;
}

/* 星星计数区域 */
.github-stars {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    transition: all 0.3s ease;
}

/* 星星图标 */
.github-stars .octicon {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

/* 星星数字 */
.star-count {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

/* 悬浮效果 */
.github-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    background: #2f363d;
}

/* 星星动画效果 */
.github-btn:hover .github-stars {
    background: rgba(255, 255, 255, 0.15);
}

.github-btn:hover .octicon {
    transform: scale(1.2);
    filter: drop-shadow(0 0 2px rgba(255, 215, 0, 0.6));
}

/* 点击星星效果 */
.github-stars:active .octicon {
    transform: scale(0.9);
}

/* 深色模式适配 */
[data-theme="dark"] .github-btn {
    background: #2f363d;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .github-btn:hover {
    background: #373e47;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

/* 响应式适配 */
@media (max-width: 768px) {
    .github-btn {
        width: 100%;
        justify-content: center;
    }
}

/* 下载区域基础样式 
------------------------------------------ */
.download-area {
    margin: 1.5rem 0;
    border-radius: 12px;
    background: var(--card-background, #fff);
    border: 1px solid var(--color-border, #eee);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

/* 头部样式 
------------------------------------------ */
.download-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: var(--color-primary, #002fa7);
    color: #fff;
    gap: 15px;
}

/* 头部左侧 */
.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.download-title {
    font-size: 1.1em;
    font-weight: 500;
}

.download-icon {
    font-size: 1.2em;
    animation: iconBounce 2s ease-in-out infinite;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* 头部右侧信息 */
.header-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.9em;
    color: #fff;
}

.info-item i {
    font-size: 0.9em;
}

/* 下载按钮区域
------------------------------------------ */
.download-content {
    padding: 20px;
}

.download-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

/* 下载按钮基础样式 */
.download-btn {
    position: relative;
    height: 45px;
    width: 200px;
    cursor: pointer;
    background: var(--color-primary);
    border: none;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.button-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 100%;
    color: #fff;
}

.svg-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.download-icon {
    width: 24px;
    height: 24px;
    color: currentColor;
    transition: transform 0.3s ease;
}

.text-container {
    font-size: 14px;
    font-weight: 500;
}

/* 按钮颜色 */
.site-download { background: #002FA7; }
.baidu-download { background: #409EFF; }
.lanzou-download { background: #FF9900; }

/* 提取码样式 */
.download-code {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 10px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

/* 悬浮效果 */
.download-btn:hover {
    transform: translateY(-2px);
    filter: brightness(110%);
}

.download-btn:hover .download-icon {
    transform: scale(1.1);
}

.download-btn:hover .download-code {
    opacity: 1;
    visibility: visible;
    bottom: -25px;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .download-btn {
        width: 100%;
        max-width: 100%;
    }

    .download-code {
        position: static;
        margin-top: 8px;
        transform: none;
        opacity: 1;
        visibility: visible;
        text-align: center;
    }
}

/* 下载说明和底部
------------------------------------------ */
.download-note {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    background: var(--color-background-light, #f8f9fa);
    color: var(--color-text-light, #666);
    font-size: 0.9em;
    line-height: 1.6;
}

.download-footer {
    padding: 12px 20px;
    background: var(--color-background-light, #f8f9fa);
    border-top: 1px solid var(--color-border, #eee);
}

.tips {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-light, #666);
    font-size: 0.85em;
}

.tips i {
    color: var(--color-primary, #002fa7);
}

/* 深色模式适配
------------------------------------------ */
[data-theme="dark"] {
    .download-area {
        background: var(--card-background, #1a1a1a);
        border-color: var(--color-border, #333);
    }

    .download-note,
    .download-footer {
        background: rgba(255, 255, 255, 0.05);
    }

    .download-footer {
        border-color: var(--color-border, #333);
    }

    .download-code {
        background: rgba(0, 0, 0, 0.9);
    }
}

/* 响应式适配
------------------------------------------ */
@media (max-width: 768px) {
    .download-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 12px 15px;
    }

    .header-info {
        width: 100%;
        justify-content: flex-start;
    }

    .download-content {
        padding: 15px;
    }

    .download-action {
        flex-direction: column;
    }

    .download-btn {
        width: 100%;
    }

    .download-code {
        position: static;
        margin-top: 8px;
        transform: none;
        opacity: 1;
        visibility: visible;
        text-align: center;
    }
}

/* 程序化滚动时临时锁住导航栏，防止出现/消失导致定位跳变 */
html.toc-lock-header .site-header {
  /* 常见自动隐藏实现是 transform/top，这里双保险 */
  transform: translateY(-100%) !important;
  top: -200px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: none !important; /* 避免过渡引发中间态错位 */
}
/* 保留 WP 管理条（如存在） */
html.toc-lock-header #wpadminbar {
  transform: none !important;
  top: 0 !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* 文章内容 Callout 模块 */
.entry-content .callout {
  padding: 12px 14px;
  border-left: 4px solid #0a7cff;
  background: rgba(10, 124, 255, .06);
  border-radius: 8px;
  margin: 12px 0;
}
.entry-content .callout.warn {
  border-color: #f39c12;
  background: rgba(243, 156, 18, .08);
}