/* 首屏底部飘动云朵波浪（DOM 由 banner-waves.js 注入，本文件负责样式与动画）
 * 同一 SVG 波形叠 4 层，以不同速度/透明度横向平移，形成视差飘动感。
 * 白色半透明填充叠在 banner 图上呈云雾效果，暗色模式换成主题暗底色。
 */

.main-hero-waves-area {
  width: 100%;
  position: absolute;
  left: 0;
  bottom: -11px;
  z-index: 5;
  pointer-events: none; /* 不拦截 banner 区域的点击 */
}

.waves-area .waves-svg {
  width: 100%;
  height: 5rem;
  display: block;
}

/* 文章页：banner 底部有文章元数据，波浪降低高度并压到元数据之下，避免遮挡 */
.waves-area.is-post {
  bottom: -3px;
  z-index: 1;
}

.waves-area.is-post .waves-svg {
  height: 2rem;
  min-height: 2rem;
}

/* 动画：4 层波浪近层快而实、远层慢而虚 */
.parallax > use {
  animation: move-forever 25s cubic-bezier(0.55, 0.5, 0.45, 0.5) infinite;
}

.parallax > use:nth-child(1) {
  animation-delay: -2s;
  animation-duration: 7s;
  fill: #ffffffbd;
}

.parallax > use:nth-child(2) {
  animation-delay: -3s;
  animation-duration: 10s;
  fill: #ffffff82;
}

.parallax > use:nth-child(3) {
  animation-delay: -4s;
  animation-duration: 13s;
  fill: #ffffff36;
}

.parallax > use:nth-child(4) {
  animation-delay: -5s;
  animation-duration: 20s;
  fill: #ffffff;
}

/* 暗色模式：换成 Butterfly 暗色底色，与夜间背景融合 */
[data-theme='dark'] .parallax > use:nth-child(1) {
  fill: #18171dc8;
}

[data-theme='dark'] .parallax > use:nth-child(2) {
  fill: #18171d80;
}

[data-theme='dark'] .parallax > use:nth-child(3) {
  fill: #18171d3e;
}

[data-theme='dark'] .parallax > use:nth-child(4) {
  fill: #18171d;
}

@keyframes move-forever {
  0% {
    transform: translate3d(-90px, 0, 0);
  }
  100% {
    transform: translate3d(85px, 0, 0);
  }
}

/* 用户系统开启"减少动态效果"时停用动画 */
@media (prefers-reduced-motion: reduce) {
  .parallax > use {
    animation: none;
  }
}

/* 移动端降低高度 */
@media (max-width: 768px) {
  .waves-area .waves-svg {
    height: 40px;
    min-height: 40px;
  }
}
