/* 页面默认可见；只有已成功接入的模块才让视口下方内容准备渐显。 */
body[data-scroll-reveal="ready"] .scroll-reveal-pending {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
}

body[data-scroll-reveal="ready"] .scroll-reveal-running {
  animation: scroll-reveal-enter 620ms cubic-bezier(.2, .7, .25, 1) both;
  animation-delay: calc(var(--scroll-reveal-order, 0) * 36ms);
}

/* 图标稍早、文字稍后抵达原位，保留原有玻璃边缘和字体的清晰度。 */
body[data-scroll-reveal="ready"] .scroll-reveal-running > .scroll-reveal-copy {
  animation: scroll-reveal-copy 580ms cubic-bezier(.2, .7, .25, 1) both;
  animation-delay: calc(var(--scroll-reveal-order, 0) * 36ms + 40ms);
}

body[data-scroll-reveal="ready"] .scroll-reveal-running > .scroll-reveal-mark {
  animation: scroll-reveal-mark 500ms cubic-bezier(.2, .7, .25, 1) both;
  animation-delay: calc(var(--scroll-reveal-order, 0) * 36ms);
}

/* 独立 translate 与现有 hover transform 共存；不改变文档尺寸和点击区域。 */
body[data-scroll-reveal="ready"] .scroll-depth-layer {
  translate: 0 var(--scroll-depth-y, 0px);
}

@keyframes scroll-reveal-enter {
  from { opacity: 0; transform: translate3d(0, 16px, 0); }
  to { opacity: 1; transform: none; }
}

@keyframes scroll-reveal-copy {
  from { transform: translate3d(0, 4px, 0); }
  to { transform: none; }
}

@keyframes scroll-reveal-mark {
  from { transform: translate3d(0, -3px, 0); }
  to { transform: none; }
}

/* 手机减少距离和等待，保持原生单指滚动的直接感。 */
@media (max-width: 700px), (pointer: coarse) {
  body[data-scroll-reveal="ready"] .scroll-reveal-pending { transform: translate3d(0, 8px, 0); }
  body[data-scroll-reveal="ready"] .scroll-reveal-running {
    animation-name: scroll-reveal-enter-mobile;
    animation-duration: 420ms;
    animation-delay: calc(var(--scroll-reveal-order, 0) * 22ms);
  }
  body[data-scroll-reveal="ready"] .scroll-reveal-running > .scroll-reveal-copy,
  body[data-scroll-reveal="ready"] .scroll-reveal-running > .scroll-reveal-mark {
    animation-duration: 380ms;
    animation-delay: calc(var(--scroll-reveal-order, 0) * 22ms);
  }
}

@keyframes scroll-reveal-enter-mobile {
  from { opacity: 0; transform: translate3d(0, 8px, 0); }
  to { opacity: 1; transform: none; }
}

/* 后台、湖面游玩、弹窗、打印及减少动态时，内容即时完整显示。 */
body[data-scroll-reveal="paused"] .scroll-reveal-item,
body[data-scroll-reveal="paused"] .scroll-reveal-layer {
  animation: none !important;
}

@media (prefers-reduced-motion: reduce), print {
  .scroll-reveal-pending, .scroll-reveal-running {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
  .scroll-reveal-running > .scroll-reveal-layer { animation: none !important; }
  .scroll-depth-layer { translate: none !important; }
}
