/**
 * 探趣智能 - 动画样式表
 * TANQU AI - Animation Stylesheet
 */

/* ============================================
   1. 滚动渐入动画 (Scroll Animation)
   ============================================ */

/* 初始隐藏状态 */
.animate-on-scroll {
  opacity: 0;
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 各种动画方向的初始偏移 */
.animate-on-scroll[data-animation="fade-up"] {
  transform: translateY(60px);
}

.animate-on-scroll[data-animation="fade-left"] {
  transform: translateX(-60px);
}

.animate-on-scroll[data-animation="fade-right"] {
  transform: translateX(60px);
}

.animate-on-scroll[data-animation="scale-up"] {
  transform: scale(0.85);
}

/* 动画完成状态 */
.animate-on-scroll.animated {
  opacity: 1;
  transform: translate(0) scale(1);
}

/* 子元素逐一出现的延迟效果 */
.animate-on-scroll.animated:nth-child(1) {
  transition-delay: 0s;
}

.animate-on-scroll.animated:nth-child(2) {
  transition-delay: 0.15s;
}

.animate-on-scroll.animated:nth-child(3) {
  transition-delay: 0.3s;
}

.animate-on-scroll.animated:nth-child(4) {
  transition-delay: 0.45s;
}

.animate-on-scroll.animated:nth-child(5) {
  transition-delay: 0.6s;
}

.animate-on-scroll.animated:nth-child(6) {
  transition-delay: 0.75s;
}

.animate-on-scroll.animated:nth-child(7) {
  transition-delay: 0.9s;
}

.animate-on-scroll.animated:nth-child(8) {
  transition-delay: 1.05s;
}

.animate-on-scroll.animated:nth-child(9) {
  transition-delay: 1.2s;
}

/* ============================================
   2. Hero 区域入场动画 (Hero Entrance)
   ============================================ */

@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroSlideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroScaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Hero 内容元素入场动画 */
.hero-section .hero-tag {
  animation: heroFadeIn 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  opacity: 0;
}

.hero-section .hero-title {
  animation: heroSlideUp 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s forwards;
  opacity: 0;
}

.hero-section .hero-subtitle {
  animation: heroSlideUp 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.4s forwards;
  opacity: 0;
}

.hero-section .hero-desc {
  animation: heroFadeIn 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.6s forwards;
  opacity: 0;
}

.hero-section .hero-buttons {
  animation: heroScaleIn 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.8s forwards;
  opacity: 0;
}

/* ============================================
   3. 向下滚动箭头弹跳动画 (Scroll Indicator)
   ============================================ */

@keyframes bounceDown {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(12px);
  }
}

.scroll-arrow {
  animation: bounceDown 2s ease-in-out infinite;
}

.scroll-arrow:hover {
  animation-play-state: paused;
}

/* ============================================
   4. Hover 微交互效果 (Hover Effects)
   ============================================ */

/* 卡片 Hover 效果 */
.feature-card,
.solution-card,
.custom-card,
.case-card,
.coop-card,
.contact-info-card {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.feature-card:hover,
.solution-card:hover,
.custom-card:hover,
.case-card:hover,
.coop-card:hover,
.contact-info-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(26, 109, 212, 0.15),
              0 8px 16px rgba(10, 22, 40, 0.1);
}

/* 按钮 Hover 效果 */
.btn {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.btn:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 20px rgba(26, 109, 212, 0.3);
}

.btn:active {
  transform: scale(0.98);
}

/* 导航链接 Hover 下划线动画 */
.nav-link {
  position: relative;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #1a6dd4, #4a9eff);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-link:hover::after {
  transform: scaleX(1);
}

/* Footer 导航链接 Hover */
.footer-nav a {
  position: relative;
  transition: color 0.3s ease;
}

.footer-nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: #1a6dd4;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.footer-nav a:hover::after {
  transform: scaleX(1);
}

/* 合作伙伴标签 Hover */
.partner-tag {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.partner-tag:hover {
  background-color: #1a6dd4;
  color: #ffffff;
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(26, 109, 212, 0.25);
}

/* 高亮项 Hover */
.highlight-item {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.highlight-item:hover {
  transform: translateY(-4px) scale(1.02);
  background-color: rgba(26, 109, 212, 0.1);
}

/* 统计项 Hover */
.stat-item {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.stat-item:hover {
  transform: translateY(-6px);
}

.stat-item:hover .stat-number {
  color: #4a9eff;
}

/* 联系项 Hover */
.contact-item {
  transition: all 0.3s ease;
}

.contact-item:hover {
  transform: translateX(8px);
}

.contact-item:hover .contact-icon {
  transform: scale(1.1);
}

.contact-icon {
  transition: transform 0.3s ease;
}

/* ============================================
   5. 背景装饰动画 (Background Decorations)
   ============================================ */

/* 浮动光圈效果 */
@keyframes float {
  0%, 100% {
    transform: translate(0, 0);
  }
  33% {
    transform: translate(30px, -30px);
  }
  66% {
    transform: translate(-20px, 20px);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.2);
  }
}

/* Hero 背景动画元素 */
.hero-bg-animation::before,
.hero-bg-animation::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.hero-bg-animation::before {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(26, 109, 212, 0.4) 0%, transparent 70%);
  top: 10%;
  right: 10%;
  animation: float 8s ease-in-out infinite, pulse 4s ease-in-out infinite;
}

.hero-bg-animation::after {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(74, 158, 255, 0.3) 0%, transparent 70%);
  bottom: 20%;
  left: 5%;
  animation: float 10s ease-in-out infinite reverse, pulse 5s ease-in-out infinite 1s;
}

/* ============================================
   6. 统计数字动画辅助 (Counter Animation)
   ============================================ */

.stat-number {
  transition: color 0.3s ease, transform 0.3s ease;
}

.counter {
  display: inline-block;
}

/* 数字变化时的闪烁效果 */
@keyframes numberGlow {
  0%, 100% {
    text-shadow: 0 0 0 transparent;
  }
  50% {
    text-shadow: 0 0 20px rgba(26, 109, 212, 0.5);
  }
}

.counter.counting {
  animation: numberGlow 0.5s ease;
  color: #4a9eff;
}

/* ============================================
   7. 网格线条背景动画 (Grid Background)
   ============================================ */

@keyframes gridMove {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 50px 50px;
  }
}

.grid-bg {
  background-image: 
    linear-gradient(rgba(26, 109, 212, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 109, 212, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: gridMove 20s linear infinite;
}

/* ============================================
   8. 标题装饰线动画 (Section Title Line)
   ============================================ */

@keyframes lineExpand {
  from {
    width: 0;
  }
  to {
    width: 60px;
  }
}

.section-title {
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, #1a6dd4, #4a9eff);
  border-radius: 2px;
}

.section-header.animate-on-scroll.animated .section-title::after {
  animation: lineExpand 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s forwards;
}

/* ============================================
   9. 图标动画效果 (Icon Animations)
   ============================================ */

@keyframes iconPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.feature-icon,
.solution-icon,
.custom-icon,
.coop-icon {
  transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon,
.solution-card:hover .solution-icon,
.custom-card:hover .custom-icon,
.coop-card:hover .coop-icon {
  animation: iconPulse 0.6s ease;
}

/* ============================================
   10. 页面加载动画 (Page Load)
   ============================================ */

@keyframes pageLoad {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

body {
  animation: pageLoad 0.5s ease-out;
}

/* ============================================
   11. Header 滚动效果 (Header Scroll)
   ============================================ */

.header {
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.header.scrolled {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

/* ============================================
   12. 案例卡片图片遮罩动画 (Case Card)
   ============================================ */

.case-image {
  overflow: hidden;
}

.case-placeholder {
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.case-card:hover .case-placeholder {
  transform: scale(1.05);
}

/* ============================================
   13. 链接下划线动画增强 (Link Underline)
   ============================================ */

.contact-value {
  position: relative;
  transition: color 0.3s ease;
}

.contact-value::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: #1a6dd4;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.contact-value:hover::after {
  transform: scaleX(1);
}

/* ============================================
   14. 按钮光效动画 (Button Shine)
   ============================================ */

@keyframes buttonShine {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

/* ============================================
   15. 减少动效偏好适配 (Reduced Motion)
   ============================================ */

@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;
  }
  
  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }
  
  .hero-section .hero-tag,
  .hero-section .hero-title,
  .hero-section .hero-subtitle,
  .hero-section .hero-desc,
  .hero-section .hero-buttons {
    opacity: 1;
    animation: none;
  }
  
  .scroll-arrow {
    animation: none;
  }
}

/* ============================================
   16. 移动端动画优化 (Mobile Optimization)
   ============================================ */

@media (max-width: 768px) {
  .animate-on-scroll[data-animation="fade-left"],
  .animate-on-scroll[data-animation="fade-right"] {
    transform: translateY(40px);
  }
  
  .animate-on-scroll.animated[data-animation="fade-left"],
  .animate-on-scroll.animated[data-animation="fade-right"] {
    transform: translateY(0);
  }
  
  .hero-bg-animation::before,
  .hero-bg-animation::after,
  .hero-scan-line,
  .hero-grid-overlay,
  .tech-particles {
    display: none;
  }
  
  .section-corner-decoration,
  .tech-decoration {
    display: none;
  }
}

/* ============================================
   17. 扫描线动画 (Scan Line Animation)
   ============================================ */

@keyframes scan-line {
  0% {
    top: 0;
    opacity: 0;
  }
  5% {
    opacity: 0.7;
  }
  95% {
    opacity: 0.7;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

/* ============================================
   18. 粒子浮动动画 (Particle Float)
   ============================================ */

@keyframes float-particle {
  0%, 100% {
    transform: translate(0, 0);
    opacity: 0.6;
  }
  25% {
    transform: translate(20px, -30px);
    opacity: 1;
  }
  50% {
    transform: translate(-10px, -50px);
    opacity: 0.8;
  }
  75% {
    transform: translate(-30px, -20px);
    opacity: 1;
  }
}

/* ============================================
   19. 脉冲发光动画 (Pulse Glow)
   ============================================ */

@keyframes pulse-glow {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
    box-shadow: 0 0 15px rgba(26, 109, 212, 0.4);
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
    box-shadow: 0 0 25px rgba(26, 109, 212, 0.7), 0 0 40px rgba(74, 144, 226, 0.4);
  }
}

/* ============================================
   20. 滑动线条动画 (Slide Line)
   ============================================ */

@keyframes slide-line {
  0%, 100% {
    transform: translateX(0);
    opacity: 0.3;
  }
  50% {
    transform: translateX(30px);
    opacity: 0.7;
  }
}

/* ============================================
   21. 跑马灯动画 (Marquee)
   ============================================ */

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* ============================================
   22. 星空背景动画 (Star Field)
   ============================================ */

@keyframes star-field {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 500px 200px;
  }
}

/* ============================================
   23. 卡片边框发光动画 (Card Border Glow)
   ============================================ */

@keyframes border-glow {
  0%, 100% {
    border-color: rgba(26, 109, 212, 0.2);
    box-shadow: 0 0 0 rgba(26, 109, 212, 0);
  }
  50% {
    border-color: rgba(26, 109, 212, 0.5);
    box-shadow: 0 0 20px rgba(26, 109, 212, 0.2);
  }
}

/* 卡片悬停增强发光效果 */
.solution-card,
.custom-card,
.coop-card {
  position: relative;
}

.solution-card::after,
.custom-card::after,
.coop-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  border: 1px solid transparent;
  pointer-events: none;
  transition: all 0.3s ease;
}

.solution-card:hover::after {
  border-color: rgba(26, 109, 212, 0.4);
  box-shadow: 
    0 0 20px rgba(26, 109, 212, 0.2),
    inset 0 0 20px rgba(26, 109, 212, 0.05);
}

.custom-card:hover::after,
.coop-card:hover::after {
  border-color: rgba(26, 109, 212, 0.4);
  box-shadow: 0 0 20px rgba(26, 109, 212, 0.15);
}

/* ============================================
   24. 图标脉冲光效 (Icon Pulse Glow)
   ============================================ */

@keyframes icon-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(26, 109, 212, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(26, 109, 212, 0);
  }
}

.solution-icon,
.feature-icon {
  position: relative;
}

.solution-icon::after,
.feature-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.solution-card:hover .solution-icon::after,
.feature-card:hover .feature-icon::after {
  animation: icon-glow 1s ease-out;
  opacity: 1;
}

/* ============================================
   25. 标题装饰动画增强 (Title Decoration)
   ============================================ */

.section-title {
  position: relative;
}

.section-title::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -60px;
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary));
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 0.5s ease 0.3s;
}

.section-title::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -60px;
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), transparent);
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 0.5s ease 0.3s;
}

.section-header.animated .section-title::before,
.section-header.animated .section-title::after {
  opacity: 0.5;
}

/* 英文副标题科技感样式 */
.section-subtitle {
  font-family: 'Courier New', monospace;
  letter-spacing: 4px;
  text-shadow: 0 0 10px rgba(26, 109, 212, 0.3);
}

/* ============================================
   26. 图片悬停效果增强 (Image Hover)
   ============================================ */

.about-image-container,
.solution-image-wrapper,
.custom-image-wrapper,
.cooperation-image-wrapper,
.case-image {
  position: relative;
  overflow: hidden;
}

.about-image-container::before,
.solution-image-wrapper::before,
.custom-image-wrapper::before,
.cooperation-image-wrapper::before,
.case-image::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transform: skewX(-25deg);
  transition: left 0.7s ease;
  z-index: 3;
  pointer-events: none;
}

.about-image-container:hover::before,
.solution-image-wrapper:hover::before,
.custom-image-wrapper:hover::before,
.cooperation-image-wrapper:hover::before,
.case-card:hover .case-image::before {
  left: 150%;
}

/* ============================================
   27. 电路板线条装饰动画 (Circuit Lines)
   ============================================ */

@keyframes circuit-flow {
  0% {
    stroke-dashoffset: 100;
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 0.3;
  }
}
