/* ============================================================
   animations.css · eatandbefit.com
   版本 V1.0 · 2026-10-16
   ============================================================ */

/* ============ 页面加载动效 ============ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

body {
  animation: fadeIn var(--duration-slow) var(--ease-out);
}

.article-card, .pick-card, .sidebar-widget {
  animation: fadeInUp var(--duration-slower) var(--ease-out) both;
}
.article-card:nth-child(2) { animation-delay: 80ms; }
.article-card:nth-child(3) { animation-delay: 160ms; }
.article-card:nth-child(4) { animation-delay: 240ms; }

/* ============ 滚动触发（配合 IntersectionObserver） ============ */
.scroll-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 400ms var(--ease-out), transform 400ms var(--ease-out);
}
.scroll-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============ 悬停动效 ============ */
.hover-lift {
  transition: transform var(--duration-normal) var(--ease-out), box-shadow var(--duration-normal) var(--ease-out);
}
.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ============ 聚焦动效 ============ */
.focus-glow {
  transition: box-shadow var(--duration-fast) var(--ease-out);
}
.focus-glow:focus-visible {
  box-shadow: var(--shadow-focus);
}

/* ============ 过渡 ============ */
.theme-transition,
[data-theme] body {
  transition: background-color var(--duration-slow) var(--ease-in-out),
              color var(--duration-slow) var(--ease-in-out),
              border-color var(--duration-slow) var(--ease-in-out);
}

/* ============ 光点闪烁（封面图使用） ============ */
@keyframes lightFlicker {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 1.0; }
}

/* ============ 骨架屏微光 ============ */
@keyframes skeletonShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============ 加载旋转 ============ */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ============ 脉冲 ============ */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

/* ============ 进度条填充 ============ */
@keyframes progressFill {
  from { width: 0%; }
  to   { width: var(--progress-target, 100%); }
}

/* ============ 减少动效偏好 ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .scroll-reveal { opacity: 1; transform: none; }
  .exploration-hook::before { animation: none; opacity: 0.5; }
}

/* ============ 移动端：只保留必要动效 ============ */
@media (max-width: 768px) {
  body { animation: none; }
  .article-card, .pick-card, .sidebar-widget { animation: none; }
  .hover-lift:hover { transform: none; }
}
