/* ==========================================================================
 * Lumoes Blog - custom.css (AnZhiYu 主题适配版)
 * 从 Solitude 主题迁移，CSS 变量从 --efu-xxx 改为 --anzhiyu-xxx
 * ========================================================================== */

/* 选中文字颜色 */
::selection {
  background: #333;
  color: #fff;
}

/* 侧边栏作者卡描述：strong 继承父级白色（默认被主题 main 色覆盖，暗色下变黄） */
.author-info__description strong {
  color: var(--anzhiyu-white);
}

/* ==========================================================================
   文章结尾 THE END 分割线（仅 post 页）
   ========================================================================== */
.end-separator {
  display: block;
  position: relative;
  text-align: center;
  margin: 13px 0 40px;
  height: 1px;
  border-top: 1px dashed var(--anzhiyu-card-border);
  border-bottom: none;
  border-left: none;
  border-right: none;
}

.end-separator span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--anzhiyu-card-bg);
  padding: 0 15px;
  color: var(--anzhiyu-secondtext);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
  white-space: nowrap;
}

/* ==========================================================================
   自定义链接卡片（文章内的站内/外链接卡片）
   迁移自 Solitude 主题，CSS 变量适配为 --anzhiyu-*
   ========================================================================== */
.custom-link-card {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  margin: 15px 0;
  border: 1px solid var(--anzhiyu-card-border);
  background: var(--anzhiyu-secondbg);
  border-radius: 12px;
  text-decoration: none !important;
  border-bottom: none !important;
  transition: all 0.3s ease;
}

.custom-link-card:hover {
  background: var(--anzhiyu-main-op);
  border-color: var(--anzhiyu-main);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--anzhiyu-shadow-main);
}

.custom-link-card img {
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  margin: 0 15px 0 0 !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  flex-shrink: 0;
}

.custom-link-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  min-width: 0;
}

.custom-link-title {
  font-weight: 600;
  font-size: 1.05em;
  color: var(--anzhiyu-fontcolor);
  line-height: 1.3;
  margin-bottom: 4px;
}

.custom-link-desc {
  font-size: 0.85em;
  color: var(--anzhiyu-secondtext);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

/* ==========================================================================
   多链接组合卡片（{% links %}...{% endlinks %}）
   大卡片包裹多个小卡片，小卡片不显示顶部提示
   ========================================================================== */
#article-container .anzhiyu-tag-links {
  background: var(--anzhiyu-secondbg);
  border: var(--style-border);
  border-radius: 12px;
  padding: 0.5rem 1rem 1rem;
  margin: 1rem 0;
  transition: all 0.3s;
}

#article-container .anzhiyu-tag-links:hover {
  border: var(--style-border-hover);
}

#article-container .anzhiyu-tag-links .tag-links-tips {
  border-bottom: var(--style-border);
  padding-bottom: 4px;
  font-size: 12px;
  color: var(--anzhiyu-gray);
  font-weight: normal;
}

#article-container .anzhiyu-tag-links .tag-links-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

/* 组合卡片内的小卡片：去掉外层间距和圆角，贴合大卡片 */
#article-container .anzhiyu-tag-links .anzhiyu-tag-link {
  margin: 0;
}

#article-container .anzhiyu-tag-links .anzhiyu-tag-link .tag-Link {
  margin: 0;
  border-radius: 8px !important;
}

/* 链接卡片图标：统一图片/字体图标尺寸与居中，避免外链图标大小不一、不居中 */
/* 容器：60x60 flex 居中，统一背景 */
#article-container .tag-Link .tag-link-bottom .tag-link-left {
  background-color: var(--anzhiyu-card-bg);
}
/* 图片图标：固定方框 + cover 填满统一，视觉与字体图标一致 */
#article-container .tag-Link .tag-link-favicon {
  width: 40px !important;
  height: 40px !important;
  object-fit: cover !important;
  border-radius: 6px !important;
  padding: 0 !important;
  box-sizing: border-box;
  display: block;
}
/* 字体图标（FontAwesome）：放大到与图片视觉一致（覆盖 inline 1.4em） */
#article-container .tag-Link .tag-link-bottom .tag-link-left i {
  font-size: 36px !important;
}
/* 阿里 iconfont svg：统一尺寸（覆盖 inline 1.4em） */
#article-container .tag-Link .tag-link-bottom .tag-link-left svg.icon {
  width: 36px !important;
  height: 36px !important;
}

/* ==========================================================================
   封面图完整显示（cover_fit: contain）
   仅当文章 frontmatter 带 cover_fit: contain 时，对应封面才完整显示（不裁剪、居中）。
   实现方式：将带 cover-fit-contain 的 <img> 绝对定位填满“已定位且有确定高度”的封面容器，
   再用 object-fit: contain + object-position: center 完整居中。
   该方式不依赖父级 flex / 百分比高度解析（荐 区的 a 是 flex，百分比高度在此不可靠），
   所有位置表现一致。其余封面保持主题默认的 object-fit: cover 裁剪。
   ========================================================================== */

/* 1) 让所有封面容器成为定位上下文（绝对定位的 contain 图才能正确填满并居中） */
.post_cover,
.topGroup .recent-post-item .post_cover a,
#topPostGroup .top-group-list-item .post_cover a,
.aside-list-item .thumbnail,
.article-sort-item-img,
.relatedPosts .relatedPosts-list > div,
.pagination-post .prev-post > a,
.pagination-post .next-post > a {
  position: relative;
}

/* 2) 通用：任何带 cover-fit-contain 的封面图 → 绝对填满容器、完整居中、不裁剪 */
img.cover-fit-contain {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  background: var(--anzhiyu-secondbg); /* 完整显示时信箱式留白底色，避免透明穿出 */
}

/* 3) 兜底：确保以上容器内、非 contain 的封面仍按 cover 裁剪
      （防止某些位置被其它规则覆盖为 fill 拉伸而“看起来没裁剪”） */
.post_cover img:not(.cover-fit-contain),
.aside-list-item .thumbnail > img:not(.cover-fit-contain),
.article-sort-item-img img:not(.cover-fit-contain),
.relatedPosts .relatedPosts-list > div img:not(.cover-fit-contain),
.pagination-post .prev-post > a > img:not(.cover-fit-contain),
.pagination-post .next-post > a > img:not(.cover-fit-contain),
.topGroup .recent-post-item .post_cover img:not(.cover-fit-contain),
#topPostGroup .top-group-list-item .post_cover img:not(.cover-fit-contain) {
  object-fit: cover;
}

/* 3b) 客户端 shimmer 会把 img 包进 <span.lum-img-shimmer>，导致主题
      侧栏 ".thumbnail > img" 这类"直接子代"选择器失效：非 contain
      缩略图丢失 object-fit:cover，回退为 height:auto → 完整显示且上移。
      仅对侧栏缩略图兜底恢复 cover 裁剪（其余位置的主题选择器用后代选择器，
      shimmer 包裹不会打断；contain 图由 img.cover-fit-contain 的 !important
      规则接管，不受影响）。不能写成全局 .lum-img-shimmer > img，否则会破坏
      首页轮播图、文章正文图片等其它被 shimmer 包裹的非封面图片。 */
.aside-list-item .thumbnail .lum-img-shimmer > img:not(.cover-fit-contain) {
  object-fit: cover !important;
  width: 100% !important;
  height: 100% !important;
}

/* 4) 相关文章卡片：主题默认把封面压暗(opacity:.4)，contain 模式提高可见度 */
.relatedPosts .cover.cover-fit-contain {
  opacity: 1 !important;
}

/* ==========================================================================
   封面白天/黑夜双封面（frontmatter: cover_day / cover_night）
   - cover_day：亮色模式封面（未设置时回退 cover）
   - cover_night：暗色模式封面（未设置时回退 cover）
   模板输出两张 img，默认显示白天版，dark 模式切换为黑夜版；
   cover-night 图带 nolazyload 不参与懒加载/shimmer，保证切换即时。
   ========================================================================== */
.post_cover img.cover-night,
.recent-post-item img.cover-night,
#topPostGroup img.cover-night,
.topGroup .recent-post-item img.cover-night,
.article-sort-item-img img.cover-night,
.aside-list-item .thumbnail img.cover-night,
.relatedPosts img.cover-night,
.pagination-post img.cover-night,
.cat-tree-post-item img.cover-night {
  display: none;
}
[data-theme="dark"] .post_cover img.cover-day,
[data-theme="dark"] .recent-post-item img.cover-day,
[data-theme="dark"] #topPostGroup img.cover-day,
[data-theme="dark"] .topGroup .recent-post-item img.cover-day,
[data-theme="dark"] .article-sort-item-img img.cover-day,
[data-theme="dark"] .aside-list-item .thumbnail img.cover-day,
[data-theme="dark"] .relatedPosts img.cover-day,
[data-theme="dark"] .pagination-post img.cover-day,
[data-theme="dark"] .cat-tree-post-item img.cover-day {
  display: none !important;
}
[data-theme="dark"] .post_cover img.cover-night,
[data-theme="dark"] .recent-post-item img.cover-night,
[data-theme="dark"] #topPostGroup img.cover-night,
[data-theme="dark"] .topGroup .recent-post-item img.cover-night,
[data-theme="dark"] .article-sort-item-img img.cover-night,
[data-theme="dark"] .aside-list-item .thumbnail img.cover-night,
[data-theme="dark"] .relatedPosts img.cover-night,
[data-theme="dark"] .pagination-post img.cover-night,
[data-theme="dark"] .cat-tree-post-item img.cover-night {
  display: block;
}

/* ==========================================================================
   分类页：树形层级结构
   - 顶级分类：加粗主色 + 大字号
   - 子分类：缩进 + 左侧连接线 + 灰色文字
   - hover：父级主色高亮，子级传递
   ========================================================================== */
.cat-tree {
  padding: 8px 0;
}

.cat-tree-root,
.cat-tree-child {
  position: relative;
}

/* 子分类左侧连接线 */
.cat-tree-child {
  padding-left: 24px;
}

.cat-tree-child::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  border-left: 1px dashed var(--anzhiyu-card-border);
}

/* 横向连接线（每个子节点到竖线） */
.cat-tree-child::after {
  content: '';
  position: absolute;
  left: 8px;
  top: 18px;
  width: 12px;
  border-top: 1px dashed var(--anzhiyu-card-border);
}

/* 最后一个子节点：横向线之下不再延伸竖线 */
.cat-tree-branch-last::before {
  bottom: auto;
  height: 18px;
}

/* 节点链接 */
.cat-tree-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.25s ease;
  text-decoration: none;
  margin: 2px 0;
}

.cat-tree-link:hover {
  background: var(--anzhiyu-main-op);
  text-decoration: none;
}

/* 顶级分类：加粗 + 主色 + 大字号 */
.cat-tree-root > .cat-tree-link {
  font-weight: 700;
  font-size: 1.15em;
  color: var(--anzhiyu-main);
  margin-top: 12px;
}

.cat-tree-root > .cat-tree-link:hover {
  color: var(--anzhiyu-theme);
}

/* 子分类：常规字重 + 灰色 */
.cat-tree-child > .cat-tree-link {
  font-weight: 400;
  font-size: 0.95em;
  color: var(--anzhiyu-fontcolor);
}

.cat-tree-child > .cat-tree-link:hover {
  color: var(--anzhiyu-main);
}

/* 计数 */
.cat-tree-count {
  margin-left: 6px;
  font-size: 0.8em;
  color: var(--anzhiyu-thirdtext);
  font-weight: normal;
}

/* 子分类容器 */
.cat-tree-children {
  position: relative;
}

/* ==========================================================================
   单个分类页：面包屑路径 + 子分类卡片
   ========================================================================== */
.cat-breadcrumb {
  margin: 1rem 0;
  padding: 1rem 1.2rem;
  background: var(--anzhiyu-secondbg);
  border: var(--style-border);
  border-radius: 12px;
}

.cat-breadcrumb-path {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  font-size: 1rem;
}

.cat-crumb-link {
  color: var(--anzhiyu-secondtext);
  transition: color 0.25s;
  text-decoration: none;
}

.cat-crumb-link:hover {
  color: var(--anzhiyu-main);
  text-decoration: none;
}

.cat-crumb-sep {
  margin: 0 6px;
  font-size: 0.8em;
  color: var(--anzhiyu-thirdtext);
}

.cat-crumb-current {
  font-weight: 700;
  color: var(--anzhiyu-main);
}

.cat-crumb-count {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--anzhiyu-thirdtext);
}

/* 子分类卡片区域 */
.cat-children-wrap {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--anzhiyu-card-border);
}

.cat-children-label {
  font-size: 0.8rem;
  color: var(--anzhiyu-thirdtext);
  margin-bottom: 8px;
}

.cat-children-label i {
  margin-right: 4px;
}

.cat-children-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cat-child-card {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: var(--anzhiyu-card-bg);
  border: var(--style-border);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.25s ease;
}

.cat-child-card:hover {
  background: var(--anzhiyu-main-op);
  border-color: var(--anzhiyu-main);
  transform: translateY(-2px);
  text-decoration: none;
}

.cat-child-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--anzhiyu-fontcolor);
}

.cat-child-card:hover .cat-child-name {
  color: var(--anzhiyu-main);
}

.cat-child-count {
  margin-left: 8px;
  font-size: 0.75rem;
  color: var(--anzhiyu-thirdtext);
}

/* ==========================================================================
   首页 category-bar：逐级向右展开子分类
   - 用 .is-active（JS 控制）替代 :hover，避免鼠标在横条内移动时鬼畜收缩
   - 鼠标离开整个 #catalog-list 才收回
   - 溢出时非激活的顶级项加 .is-collapsed 让位
   ========================================================================== */

/* 所有分类项基础过渡 */
#catalog-list .catalog-list-item {
  transition: opacity 0.3s ease, max-width 0.35s ease, margin 0.35s ease, padding 0.35s ease;
  max-width: 200px;
  overflow: hidden;
  white-space: nowrap;
}

/* 让位项：非激活且需腾出空间时由 JS 添加 */
#catalog-list .catalog-list-item.is-collapsed {
  opacity: 0;
  max-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none;
}

/* 有子分类的项 */
.catalog-list-item-has-child {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* 激活项提升层级，确保 flyout 不被右侧兄弟项遮挡 */
#catalog-list .catalog-list-item.is-active {
  z-index: 10;
  overflow: visible !important;
  max-width: none !important;
}

/* 激活状态时隐藏"更多"按钮和翻页按钮，避免遮挡 flyout */
#catalog-bar.catalog-bar-active .catalog-more,
#catalog-bar.catalog-bar-active .category-bar-next {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* 箭头：激活时旋转 */
.catalog-list-item .cat-arrow {
  font-size: 0.8em;
  margin-left: 2px;
  opacity: 0.6;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.catalog-list-item.is-active > a .cat-arrow {
  transform: rotate(90deg);
  opacity: 1;
}

/* 子分类容器：默认收起（每层都默认收起，靠父级 .is-active 展开） */
.catalog-list-item-has-child .cat-flyout {
  display: inline-flex;
  align-items: center;
  /* 无 gap：子项通过负 margin 堆叠重叠在一起 */
  margin-left: 0;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-width 0.4s ease, opacity 0.3s ease 0.1s, margin-left 0.4s ease;
}

/* 激活时展开直接子级（用 > 限定，避免孙级连带展开） */
.catalog-list-item.is-active > .cat-flyout {
  max-width: 800px;
  opacity: 1;
  margin-left: 6px;
  overflow: visible;
}

/* 子级项基础：position:relative 让 z-index 生效，overflow:visible 覆盖基础 hidden */
.cat-flyout > .catalog-list-item {
  position: relative;
  z-index: 1;
  overflow: visible !important;
}

/* 堆叠核心：第二项起向左负 margin，与前一项重叠挤在一起 */
.cat-flyout > .catalog-list-item + .catalog-list-item {
  margin-left: -22px;
}

/* 子级项链接样式：胶囊背景，区分层级 */
.cat-flyout > .catalog-list-item > a {
  font-size: 0.9em;
  background: var(--anzhiyu-card-bg);
  border: 1px solid var(--anzhiyu-card-border);
  height: 26px;
  line-height: 26px;
  padding: 0 14px;
  border-radius: 13px;
  transition: all 0.25s ease;
  position: relative;
  z-index: 1;
}

/* 悬停高亮 */
.cat-flyout > .catalog-list-item > a:hover {
  background: var(--anzhiyu-main);
  color: var(--anzhiyu-white);
  border-color: var(--anzhiyu-main);
}

/* 当前激活的子项：从堆叠中前置（z-index 置顶 + 上浮 + 主色背景 + 阴影） */
.cat-flyout > .catalog-list-item.is-active {
  z-index: 20;
}
.cat-flyout > .catalog-list-item.is-active > a {
  background: var(--anzhiyu-main);
  color: var(--anzhiyu-white);
  border-color: var(--anzhiyu-main);
  border-width: 2px;
  height: 28px;
  line-height: 24px;
  box-shadow: 0 4px 12px rgba(242, 185, 75, 0.45);
  transform: translateY(-2px);
}

/* 非激活的兄弟项适度淡化，反衬激活项 */
.cat-flyout > .catalog-list-item:not(.is-active) > a {
  opacity: 0.6;
}

/* 更深层级逐级缩小，增强视觉层次 */
.cat-flyout .cat-flyout > .catalog-list-item > a {
  font-size: 0.82em;
  height: 24px;
  line-height: 22px;
}

/* ==========================================================================
   分类页：树形文章列表（父分类文章 + 缩进的子分类文章）
   ========================================================================== */
.cat-tree-posts {
  margin-top: 1rem;
}

/* 子分类标题 */
.cat-tree-post-header {
  margin: 16px 0 8px;
  padding: 8px 12px;
  border-left: 3px solid var(--anzhiyu-main);
  background: var(--anzhiyu-secondbg);
  border-radius: 0 8px 8px 0;
}

.cat-tree-cat-link {
  display: inline-flex;
  align-items: center;
  font-size: 1rem;
  font-weight: 600;
  color: var(--anzhiyu-main);
  text-decoration: none;
  transition: color 0.2s;
}

.cat-tree-cat-link:hover {
  color: var(--anzhiyu-theme);
  text-decoration: none;
}

/* ==========================================================================
   首页文章卡片显示文章描述（description）
   主题全局规则将 .content 设为 opacity:0 / height:0，此处强制显示
   配合 _config.anzhiyu.yml 中 index_post_content.method=1
   ========================================================================== */
#content-inner #recent-posts > .recent-post-item > .recent-post-info > .content {
  opacity: 1 !important;
  height: auto !important;
  display: -webkit-box !important;
}

/* ==========================================================================
   首页文章卡片显示文章描述（description）
   主题在双栏模式下默认隐藏 .content（opacity:0 / height:0 / display:none）
   此处强制显示，并加 padding 与标题对齐（标题 .recent-post-info-top 有 padding:0 32px）
   ========================================================================== */
#content-inner #recent-posts > .recent-post-item > .recent-post-info > .content {
  opacity: 1 !important;
  height: auto !important;
  display: -webkit-box !important;
  padding: 0 32px;
  box-sizing: border-box;
  margin-top: 0.1rem;
  line-height: 1.3;
}

@media screen and (min-width: 1201px) {
  #recent-posts > .recent-post-item > .recent-post-info > .content {
    display: -webkit-box !important;
  }
}

/* ==========================================================================
   图片懒加载 Shimmer 流光占位动画
   图床加载慢时显示 shimmer 流光占位，提示用户图片正在加载。
   纯 CSS 渐变位移动画，GPU 加速，亮/暗色自适应。
   包裹层由 custom.js 动态生成：.lum-img-shimmer > (img 或 a) + .lum-shimmer-overlay
   ========================================================================== */

/* 包裹层：inline-block 默认，块级场景撑满父容器 */
.lum-img-shimmer {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
  vertical-align: bottom;
  overflow: hidden;
}

/* 封面 / 卡片等块级场景：撑满父容器，保持原布局 */
.post_cover .lum-img-shimmer,
.recent-post-item .lum-img-shimmer,
.top-group-list-item .lum-img-shimmer,
.topGroup .recent-post-item .lum-img-shimmer,
.thumbnail .lum-img-shimmer,
#article-container .lum-img-shimmer {
  display: block;
  width: 100%;
  height: 100%;
}

/* 特殊尺寸场景：img 依赖百分比高度（height:100%）或为无固有尺寸的 SVG，
   shimmer 默认 inline-block（宽高自适应内容）会打断尺寸解析链，
   导致图片塌缩成 1px（追番封面/分类页缩略图）或 0×0（关于页人格图）。
   必须让包裹层撑满封面容器，恢复确定尺寸 */
.comic-item-cover .lum-img-shimmer,
.cat-tree-post-item .article-sort-item-img .lum-img-shimmer {
  display: block;
  width: 100%;
  height: 100%;
}
.personalities .image .lum-img-shimmer {
  display: block;
  width: 100%;
}

/* shimmer 覆盖层：覆盖在图片上方，加载完成后移除 */
.lum-shimmer-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;

  /* shimmer 流光渐变背景 */
  background: linear-gradient(
    90deg,
    var(--anzhiyu-card-bg, #e8e8e8) 0%,
    var(--anzhiyu-secondtext-hover, #d0d0d0) 20%,
    var(--anzhiyu-card-bg, #e8e8e8) 40%,
    var(--anzhiyu-card-bg, #e8e8e8) 100%
  );
  background-size: 200% 100%;
  animation: lum-shimmer-sweep 1.5s ease-in-out infinite;
}

/* 暗色模式适配 */
[data-theme="dark"] .lum-shimmer-overlay {
  background: linear-gradient(
    90deg,
    #2a2a2c 0%,
    #3a3a3c 20%,
    #2a2a2c 40%,
    #2a2a2c 100%
  );
  background-size: 200% 100%;
}

/* shimmer 中央旋转 spinner（叠加在流光背景上） */
.lum-shimmer-overlay::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--anzhiyu-main, #425aef);
  border-radius: 50%;
  animation: lum-spinner-rotate 0.8s linear infinite;
}

[data-theme="dark"] .lum-shimmer-overlay::after {
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: #6b8aff;
}

/* 尊重 reduce-motion 用户偏好 */
@media (prefers-reduced-motion: reduce) {
  .lum-shimmer-overlay {
    animation: none;
    background: var(--anzhiyu-card-bg, #e8e8e8);
  }
  .lum-shimmer-overlay::after {
    animation: none;
  }
}

/* 流光位移动画 */
@keyframes lum-shimmer-sweep {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* spinner 旋转动画 */
@keyframes lum-spinner-rotate {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  100% {
    transform: translate(0, 0) rotate(360deg);
  }
}

/* shimmer 完成后淡出 */
.lum-shimmer-done .lum-shimmer-overlay {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* ==========================================================================
   关于页 "Hello there!" 眼睛动画：亮色模式圆环可见性修复 + 文字统一白色
   主题原样式 .content 为白色 + mix-blend-mode: screen，
   亮色下 screen(白, 背景) = 白，瞳孔周围的彩色圆环被整层白色遮住。
   修复：content 改为透明背景 + 正常混合，让圆环在亮/暗色下都透出。
   文字统一白色：multiply 混合下白字会变成背景色（白×背景=背景），
   所以必须用 normal 混合才能让白字在圆环上保持纯白清晰。
   ========================================================================== */
.hello-about .content {
  background: transparent !important;
  mix-blend-mode: normal;
}
.hello-about h1 {
  color: #fff !important;
}
[data-theme='dark'] .hello-about h1 {
  color: #fff !important;
}

/* ==========================================================================
   即刻短文页：长内容折叠 + "展开更多内容"按钮
   文字过长或图片过高时默认折叠（保留 400px 预览 + 底部渐隐），
   点击按钮展开完整内容。由 custom.js 按内容实测高度决定是否折叠。
   ========================================================================== */
.bber-item.essay-collapsed .bber-content {
  max-height: 400px;
  overflow: hidden;
  position: relative;
}
/* 折叠态底部渐隐遮罩，提示内容被截断 */
.bber-item.essay-collapsed .bber-content::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 80px;
  background: linear-gradient(to bottom, transparent, var(--anzhiyu-card-bg));
  pointer-events: none;
  z-index: 1;
}
/* 展开/收起按钮 */
.essay-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 4px auto 2px;
  padding: 3px 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--anzhiyu-secondtext);
  background: var(--anzhiyu-secondbg);
  border: var(--style-border-always);
  border-radius: 14px;
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s;
}
.essay-toggle-btn:hover {
  color: var(--anzhiyu-main);
  border-color: var(--anzhiyu-main);
}
.essay-toggle-btn i {
  font-size: 12px;
  transition: transform 0.3s;
}
.essay-toggle-btn.expanded i {
  transform: rotate(180deg);
}

/* ==========================================================================
   装备页面图片溢出修复
   主题 equipment.styl 中 img 固定 width:260px 无 max-width 约束，
   在窄屏卡片中溢出容器。同时 shimmer 包裹层在 flex 布局中需适配。
   ========================================================================== */
.equipment-item-content-item-cover img.equipment-item-content-item-image {
  max-width: 100% !important;
  width: auto !important;
  height: 80% !important;
  object-fit: contain !important;
}

/* equipment 页面的 shimmer 包裹层适配 flex 居中布局 */
.equipment-item-content-item-cover .lum-img-shimmer {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  line-height: normal;
}
.equipment-item-content-item-cover .lum-img-shimmer img.equipment-item-content-item-image {
  max-height: 80% !important;
  max-width: 90% !important;
  width: auto !important;
  height: auto !important;
}

.cat-tree-cat-link i {
  margin-right: 4px;
  font-size: 0.8em;
}

.cat-tree-cat-count {
  margin-left: 8px;
  font-size: 0.75rem;
  font-weight: normal;
  color: var(--anzhiyu-thirdtext);
  background: var(--anzhiyu-card-bg);
  padding: 2px 8px;
  border-radius: 10px;
}

/* 文章项 */
.cat-tree-post-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  margin: 4px 0;
  border-radius: 8px;
  transition: background 0.2s ease;
  border: var(--style-border);
}

.cat-tree-post-item:hover {
  background: var(--anzhiyu-secondbg);
}

.cat-tree-post-item .article-sort-item-img {
  width: 80px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  margin-right: 12px;
}

.cat-tree-post-item .article-sort-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cat-tree-post-item .article-sort-item-info {
  flex: 1;
  min-width: 0;
}

.cat-tree-post-item .article-sort-item-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--anzhiyu-fontcolor);
  text-decoration: none;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cat-tree-post-item .article-sort-item-title:hover {
  color: var(--anzhiyu-main);
  text-decoration: none;
}

/* 子分类文章的分类标签 */
.cat-tree-post-label {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  color: var(--anzhiyu-thirdtext);
  margin-top: 2px;
}

.cat-tree-post-label i {
  margin-right: 3px;
  font-size: 0.85em;
}

.cat-tree-post-item .article-meta-wrap {
  margin-top: 4px;
}

.cat-tree-post-item .article-sort-item-time {
  font-size: 0.75rem;
  color: var(--anzhiyu-thirdtext);
}

.cat-tree-post-item .article-sort-item-time i {
  margin-right: 3px;
}

.cat-tree-post-item.no-article-cover {
  padding-left: 16px;
}

/* ==========================================================================
   访客 IP 归属地展示卡片
   ========================================================================== */
.card-widget-visitor {
  background: var(--anzhiyu-card-bg);
  border-radius: 12px;
  padding: 16px 16px 20px;
  margin-top: 16px;
  border: var(--style-border-always);
  box-shadow: var(--anzhiyu-shadow-border);
}
.card-widget-visitor .item-headline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--anzhiyu-fontcolor);
  margin-bottom: 12px;
}
.card-widget-visitor .item-headline i {
  font-size: 16px;
  color: var(--anzhiyu-main);
}

#visitor-info {
  min-height: 80px;
}

.visitor-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 0;
  color: var(--anzhiyu-secondtext);
  font-size: 13px;
}
.visitor-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--anzhiyu-secondbg);
  border-top-color: var(--anzhiyu-main);
  border-radius: 50%;
  animation: visitor-spin 0.8s linear infinite;
}
@keyframes visitor-spin {
  100% { transform: rotate(360deg); }
}

.visitor-info-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.visitor-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 4px 0;
}
.visitor-label {
  color: var(--anzhiyu-secondtext);
  font-size: 12px;
  flex-shrink: 0;
}
.visitor-value {
  color: var(--anzhiyu-fontcolor);
  font-weight: 500;
  text-align: right;
  white-space: nowrap; /* 归属地过长时由 JS 缩小字号保持单行，不换行 */
  /* 兜底：nowrap 的 flex 子项默认无法收缩到内容宽度以下，min-width:0 放开限制；
     极端长文本即使缩到最小字号（8.5px）仍超宽时，退化为省略号而非撑破卡片 */
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.visitor-value.ip-address {
  filter: blur(4px);
  transition: filter 0.3s ease;
  cursor: pointer;
}
.visitor-value.ip-address:hover {
  filter: blur(0);
}
.visitor-greeting {
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--anzhiyu-secondbg);
  border-radius: 8px;
  font-size: 13px;
  color: var(--anzhiyu-fontcolor);
  text-align: center;
  line-height: 1.5;
}
.visitor-note {
  margin-top: 6px;
  padding: 6px 10px;
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.2);
  border-radius: 8px;
  font-size: 11px;
  color: #856404;
  line-height: 1.5;
}
[data-theme="dark"] .visitor-note {
  color: #ffd54f;
  background: rgba(255, 193, 7, 0.08);
  border-color: rgba(255, 193, 7, 0.15);
}

.visitor-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 0;
  text-align: center;
}
.visitor-error-icon {
  display: inline-flex;
}

.visitor-error-icon svg {
  width: 30px;
  height: 30px;
  color: var(--anzhiyu-secondtext, #999);
}
.visitor-error p {
  margin: 0;
  font-size: 13px;
  color: var(--anzhiyu-secondtext);
}
.visitor-retry {
  font-size: 12px !important;
}
.visitor-retry-btn {
  color: var(--anzhiyu-main);
  cursor: pointer;
  font-weight: 600;
  text-decoration: underline;
  margin: 0 4px;
}

/* ==========================================================================
   YouTube 视频智能降级提示
   ========================================================================== */
.yt-fallback {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.yt-fallback-logo {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  opacity: 0.9;
}

.yt-fallback-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  text-align: center;
  color: #fff;
  font-size: 15px;
  line-height: 1.7;
  width: 90%;
  max-width: 500px;
}
.yt-fallback-text strong {
  font-size: 16px;
  font-weight: 600;
  display: block;
  margin-bottom: 8px;
}

.yt-fallback-link {
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: rgba(255, 0, 0, 0.8);
  color: #fff !important;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.3s;
}
.yt-fallback-link:hover {
  background: rgba(255, 0, 0, 1);
}

[data-theme="dark"] .yt-fallback {
  background: linear-gradient(135deg, #0d1117 0%, #161b22 50%, #1a1a2e 100%);
}

/* ==========================================================================
   侧边栏统计图表（Tag 饼图 / 博文热力图，echarts 渲染）
   - helper 输出纯数据容器（.lum-chart），custom.js 负责渲染
   - 饼图固定高度；热力图画布为整年固定宽度，容器内横向滚动查看
   ========================================================================== */
.card-stats-chart .item-headline {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

/* 卡片标题图标：内联 SVG（currentColor，明暗自适应） */
.card-stats-chart .item-headline svg {
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  color: var(--anzhiyu-main, #425aef);
}

.lum-chart-pie {
  width: 100%;
  height: 205px;
}

.lum-chart-heatmap {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(128, 128, 128, 0.35) transparent;
  cursor: grab;
}

.lum-chart-heatmap::-webkit-scrollbar {
  height: 5px;
}

.lum-chart-heatmap::-webkit-scrollbar-thumb {
  background: rgba(128, 128, 128, 0.35);
  border-radius: 3px;
}

.lum-chart-heatmap::-webkit-scrollbar-track {
  background: transparent;
}

/* 热力图年份切换头部 */
.lum-heat-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 4px;
}

.lum-heat-year {
  font-size: 12px;
  font-weight: 600;
  color: var(--anzhiyu-main, #425aef);
  min-width: 34px;
  text-align: center;
}

.lum-heat-btn {
  width: 18px;
  height: 18px;
  line-height: 1;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: var(--anzhiyu-secondbg, #f0f0f0);
  color: var(--anzhiyu-fontcolor, #363636);
  cursor: pointer;
  transition: background 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lum-heat-btn svg {
  width: 11px;
  height: 11px;
}

.lum-heat-btn:hover:not(:disabled) {
  background: var(--anzhiyu-main, #425aef);
  color: #fff;
}

.lum-heat-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

/* ==========================================================================
   侧边栏「文章 / 图表」模式切换
   - 默认显示原生「文章数/Tag标签」卡片（.aside-stats-original）
   - 切到图表模式时（#aside-content.aside-stats-charts）改为显示 echarts 卡片
   - 偏好存储在 localStorage（custom.js: applyAsideStatsMode）
   ========================================================================== */
#aside-content:not(.aside-stats-charts) .aside-stats-charts-wrap {
  display: none;
}

#aside-content.aside-stats-charts .aside-stats-original {
  display: none;
}

/* 页签式分段控件：骑在统计卡上边缘（一半压卡片、一半在缝隙），
   视觉上夹在公告卡与标签卡之间，明确归属下方统计区。
   主题的 .card-widget overflow:hidden（更高优先级规则）会裁掉骑缝按钮的
   上半截，此处用 ID 级选择器强制放开；本卡子元素均为自带圆角的文字块，
   放开裁剪无副作用 */
#aside-content .card-widget.aside-stats-original,
#aside-content .card-widget.aside-stats-charts-card {
  overflow: visible !important;
}

.aside-stats-original,
.aside-stats-charts-card {
  position: relative;
}

.aside-stats-switch {
  position: absolute;
  top: -12px;
  right: 14px;
  z-index: 2;
}

.aside-stats-switch .seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--anzhiyu-card-bg, #fff);
  border: 1px solid var(--anzhiyu-card-border, #e3e8f7);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.aside-stats-btn {
  font-size: 12px;
  line-height: 1;
  padding: 6px 14px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--anzhiyu-secondtext, #999);
  cursor: pointer;
  transition: all 0.2s;
}

.aside-stats-btn:hover {
  color: var(--anzhiyu-main, #425aef);
}

.aside-stats-btn.on-active {
  background: var(--anzhiyu-main, #425aef);
  color: #fff;
}

/* ==========================================================================
   归档页（/archives/）顶部原版全尺寸热力图
   ========================================================================== */
.lum-heatmap-full-wrap {
  background: var(--anzhiyu-card-bg, #fff);
  border: 1px solid var(--anzhiyu-card-border, #e3e8f7);
  border-radius: 12px;
  padding: 16px 18px 10px;
  margin-bottom: 1rem;
}

.lum-heatmap-full-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1.1em;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--anzhiyu-fontcolor, #363636);
}

.lum-heatmap-full-title svg {
  width: 1.1em;
  height: 1.1em;
  color: var(--anzhiyu-main, #425aef);
}

.lum-chart-heatmap-full {
  width: 100%;
  height: 200px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(128, 128, 128, 0.35) transparent;
}

.lum-chart-heatmap-full::-webkit-scrollbar {
  height: 5px;
}

.lum-chart-heatmap-full::-webkit-scrollbar-thumb {
  background: rgba(128, 128, 128, 0.35);
  border-radius: 3px;
}

/* ==========================================================================
   标签页全尺寸饼图（/tags/ 总览 + /tags/<name>/ 单标签页）
   - 单标签页时高亮当前标签扇区（select 状态）
   - 37 标签色环：按标签数均分色相，JS 生成
   ========================================================================== */
.lum-pie-full-page .lum-pie-full-wrap,
.lum-pie-full-wrap {
  background: var(--anzhiyu-card-bg, #fff);
  border: 1px solid var(--anzhiyu-card-border, #e3e8f7);
  border-radius: 12px;
  padding: 16px 18px 8px;
  margin-bottom: 1rem;
}

.lum-pie-full-caption {
  font-size: 13px;
  color: var(--anzhiyu-secondtext, #999);
  margin-bottom: 4px;
}

.lum-chart-pie-full {
  width: 100%;
  height: 500px;
}

/* note 标签内嵌套的 markdown 引用块：去掉 blockquote 自带的底色和边框，
   否则会在 note 的彩色背景上"掏空"一块 */
#article-container .note blockquote {
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  margin: 0;
  padding: 2px 0 2px 10px;
}
