/* ========================================
   Hero Banner iOS滚动抖动修复
   平衡版 - 保留安全的动画，禁用导致闪烁的部分
   ======================================== */

/* iOS滚动优化 - 仅在移动设备上应用 */
@media (max-width: 768px) {

  /* 1. 基础优化 - GPU加速 */
  .hero {
    -webkit-transform: translateZ(0) !important;
    transform: translateZ(0) !important;
    -webkit-backface-visibility: hidden !important;
    backface-visibility: hidden !important;
  }

  .hero-scroll-container {
    -webkit-transform: translateZ(0) !important;
    transform: translateZ(0) !important;
    -webkit-backface-visibility: hidden !important;
    backface-visibility: hidden !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .hero-panel {
    -webkit-backface-visibility: hidden !important;
    backface-visibility: hidden !important;
  }

  /* 2. 减慢背景动画速度，而不是完全禁用 */
  .hero-orb,
  .luminous-sphere,
  .mesh-blob,
  .soft-light {
    animation-duration: 60s !important;
    -webkit-animation-duration: 60s !important;
  }

  /* 3. 尝试恢复粒子动画，但减慢速度 */
  .hero-particles span {
    animation-duration: 30s !important;
    -webkit-animation-duration: 30s !important;
    opacity: 0.3 !important;
  }

  .star {
    animation-duration: 6s !important;
    -webkit-animation-duration: 6s !important;
    opacity: 0.4 !important;
  }

  .hero-grid-overlay,
  .hero-pulse-lines {
    animation: none !important;
    -webkit-animation: none !important;
  }

  /* 4. 简化背景层 */
  .hero-bg {
    opacity: 0.7 !important;
  }

  /* 5. 减少blur强度 */
  .hero-orb-1,
  .hero-orb-2,
  .hero-orb-3 {
    filter: blur(60px) !important;
  }

  /* 6. 禁用backdrop-filter（性能杀手） */
  .hero-panel-content .btn-secondary,
  .hero-panel .stat-card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* 7. 禁用渐变文字的滚动动画 */
  .hero-panel-content h2 em {
    animation: none !important;
    -webkit-animation: none !important;
  }

  /* 8. 禁用指示器脉冲动画 */
  .hero-scroll-indicator.active {
    animation: none !important;
    -webkit-animation: none !important;
  }

  /* 9. 禁用数字弹跳动画 */
  .hero-panel .stat-card .stat-num {
    animation: none !important;
    -webkit-animation: none !important;
  }

  /* 10. 禁用按钮和卡片的伪元素悬停效果 */
  .hero-panel-content .btn::before,
  .hero-panel .stat-card::before,
  .hero-panel .stat-card::after {
    display: none !important;
  }

  /* 11. 简化阴影 */
  .hero-panel-content .btn,
  .hero-panel .stat-card {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
  }

  /* 12. 在移动端完全禁用内容区域的过渡动画 */
  .hero-panel-content,
  .hero-panel-content h2,
  .hero-panel-content p,
  .hero-panel-content .btn-group,
  .hero-panel .stats-grid,
  .hero-panel .stat-card {
    transition: none !important;
  }
}

/* iOS特定修复 - 只在真正的iOS设备上应用更严格的规则 */
@supports (-webkit-touch-callout: none) {
  @media (max-width: 768px) {

    /* 禁用触摸高亮 */
    .hero,
    .hero * {
      -webkit-tap-highlight-color: transparent !important;
    }

    /* 完全禁用所有过渡和动画 */
    .hero-panel-content,
    .hero-panel-content *,
    .hero-panel-content h2,
    .hero-panel-content p,
    .hero-panel-content .btn,
    .hero-panel-content .btn-group,
    .hero-panel .stats-grid,
    .hero-panel .stat-card,
    .hero-panel .stat-card * {
      transition: none !important;
      -webkit-transition: none !important;
      animation: none !important;
      -webkit-animation: none !important;
    }

    /* 强制所有面板和内容始终完全可见 */
    .hero-panel,
    .hero-panel-content,
    .hero-panel-content *,
    .hero-panel-content h2,
    .hero-panel-content p,
    .hero-panel-content .btn,
    .hero-panel .stat-card,
    .hero-panel .stat-card * {
      opacity: 1 !important;
      visibility: visible !important;
    }

    /* 在iOS上滚动时暂停所有动画 */
    body.scrolling .hero-orb,
    body.scrolling .luminous-sphere,
    body.scrolling .mesh-blob,
    body.scrolling .soft-light {
      animation-play-state: paused !important;
    }
  }
}

/* 超小屏幕优化 */
@media (max-width: 375px) {
  .hero {
    height: 500px !important;
    min-height: 500px !important;
  }

  .hero-scroll-indicators {
    bottom: 16px !important;
  }
}

/* 横屏模式优化 */
@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    height: 450px !important;
    min-height: 450px !important;
    max-height: 450px !important;
  }

  .hero-scroll-indicators {
    bottom: 12px !important;
  }
}
