/*
 * 固定背景 + 滚动后模糊
 * 结构参考 Berial's Blog：背景图独立固定，正文位于背景之上。
 */

:root {
  --global-bg: transparent;
}

html,
body {
  background: transparent !important;
  background-color: transparent !important;
}

/* Butterfly 原本的背景节点不再使用，避免与固定背景重复 */
#web_bg {
  display: none !important;
}

/* 首页固定背景图：顶部清晰，滚动后变模糊 */
html.home-bg-page body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url("/image/home-cover.png") center / cover no-repeat;
  filter: blur(0px);
  transform: scale(1.04);
  transform-origin: center center;
  transition: filter 0.3s ease;
  will-change: filter;
  pointer-events: none;
}

/* 滚动超过半个视口后，固定背景保持模糊 */
html.home-bg-page.is-background-blurred body::before {
  filter: blur(6px);
}

/* 正文容器透明，避免出现整页白色背景 */
#body-wrap,
#content-inner,
main.layout,
.layout,
#footer {
  position: relative;
  z-index: 1;
  background: transparent !important;
  background-color: transparent !important;
}

/* 首页顶部直接透出固定背景图 */
#page-header.full_page,
#page-header.full_page::before {
  background-color: transparent !important;
  background-image: none !important;
}

/* 内容卡片半透明，背景图片可以透出来 */
.layout > div:first-child:not(.nc),
#recent-posts .recent-post-item,
#article-container .shuoshuo-item,
#aside-content .card-widget,
.layout .pagination > *:not(.space),
.cardHover {
  background: rgba(255, 255, 255, 0.8) !important;
  background-color: rgba(255, 255, 255, 0.8) !important;
}

@media screen and (max-width: 768px) {
  html.home-bg-page body::before {
    transform: scale(1.03);
  }
}
