/* =================================================== */
/* 首页背景：虚化的化学卡片墙                                */
/*   图片是卡片墙页面的一帧，已经离线糊好（不再用 CSS filter，  */
/*   省掉整屏 blur 的合成开销）：                            */
/*     wall-frame-blur.webp      浅色（45 KB）              */
/*     wall-frame-blur-dark.webp 深色（压暗+降饱和，27 KB）   */
/*   两层伪元素：::before 放图，::after 放遮罩                */
/*   只在首页（body.home-wall）生效，内页不动                 */
/* =================================================== */

/* ---- 背景图 ---- */
body:is(.home-wall, :has(.home))::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("../assets/chem-cards/wall-frame-blur.webp?v=20261204b");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

/* 深色：暗房里的卡片墙 */
body:is(.home-wall, :has(.home))[data-md-color-scheme="slate"]::before {
  background-image: url("../assets/chem-cards/wall-frame-blur-dark.webp?v=20261204b");
}

/* ---- 遮罩层 ---- */
body:is(.home-wall, :has(.home))::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

/* 浅色：白纱，卡片只留一点点影子 */
body:is(.home-wall, :has(.home))[data-md-color-scheme="default"] {
  background-color: #f7f6f3;
}

body:is(.home-wall, :has(.home))[data-md-color-scheme="default"]::after {
  background-image: linear-gradient(180deg,
    rgba(250, 249, 246, .86) 0%,
    rgba(250, 249, 246, .78) 38%,
    rgba(250, 249, 246, .74) 68%,
    rgba(250, 249, 246, .92) 100%);
}

/* 深色：左重右轻，保证左侧文字可读、右侧还能看见卡片 */
body:is(.home-wall, :has(.home))[data-md-color-scheme="slate"] {
  background-color: #0d0d0c;
}

body:is(.home-wall, :has(.home))[data-md-color-scheme="slate"]::after {
  background-image:
    linear-gradient(90deg,
      rgba(13, 13, 12, .88) 0%,
      rgba(13, 13, 12, .76) 34%,
      rgba(13, 13, 12, .30) 56%,
      rgba(13, 13, 12, .04) 80%,
      rgba(13, 13, 12, .40) 100%),
    linear-gradient(180deg,
      rgba(13, 13, 12, .66) 0%,
      rgba(13, 13, 12, .06) 22%,
      rgba(13, 13, 12, .10) 66%,
      rgba(13, 13, 12, .78) 100%);
}

/* 让卡片纹理透到内容下面；只改首页，不影响内页。 */
body:is(.home-wall, :has(.home)) .md-container,
body:is(.home-wall, :has(.home)) .md-main,
body:is(.home-wall, :has(.home)) .md-content,
body:is(.home-wall, :has(.home)) .md-typeset {
  background-color: transparent;
}

body:is(.home-wall, :has(.home))[data-md-color-scheme="slate"] .home__text {
  text-shadow: 0 1px 14px rgba(13, 13, 12, .55);
}

body:is(.home-wall, :has(.home))[data-md-color-scheme="slate"] .home-pages,
body:is(.home-wall, :has(.home))[data-md-color-scheme="slate"] .home-credit {
  text-shadow: 0 1px 10px rgba(13, 13, 12, .85);
}

.home-credit {
  margin: 1.4rem 0 0;
  text-align: center;
  font-size: .66rem;
  line-height: 1.75;
  letter-spacing: .02em;
  color: var(--md-default-fg-color--light);
  opacity: .62;
}

@media screen and (max-width: 59.984em) {
  /* 竖屏裁得厉害，遮罩改成上下渐变 */
  body:is(.home-wall, :has(.home))[data-md-color-scheme="slate"]::after {
    background-image:
      linear-gradient(180deg,
        rgba(13, 13, 12, .86) 0%,
        rgba(13, 13, 12, .56) 34%,
        rgba(13, 13, 12, .46) 66%,
        rgba(13, 13, 12, .90) 100%),
      linear-gradient(90deg,
        rgba(13, 13, 12, .52) 0%,
        rgba(13, 13, 12, .22) 100%);
  }

  body:is(.home-wall, :has(.home))[data-md-color-scheme="default"]::after {
    background-image: linear-gradient(180deg,
      rgba(250, 249, 246, .86) 0%,
      rgba(250, 249, 246, .88) 42%,
      rgba(250, 249, 246, .82) 100%);
  }
}

/* 卡片墙是整屏应用，不需要页面标题下方那行创建/更新时间 */
body:has(.chem-wall-app) .document-dates-plugin-wrapper {
  display: none;
}
