/* 
 * 白趣云科技官网 - 动画样式表
 * 包含各种滑动和渐入动画效果
 */

/* 基础动画关键帧 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInLeft {
  from {
    transform: translateX(-50px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(50px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideInDown {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes zoomIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-15px);
  }
  100% {
    transform: translateY(0px);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* 新增滚动渐入动画关键帧 */
@keyframes fadeInOnScroll {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUpOnScroll {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideLeftOnScroll {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideRightOnScroll {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes zoomInOnScroll {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 应用动画的类 */
.fade-in {
  opacity: 0;
  animation: fadeIn 1s ease forwards;
}

.fade-in-left {
  opacity: 0;
  animation: slideInLeft 1s ease forwards;
}

.fade-in-right {
  opacity: 0;
  animation: slideInRight 1s ease forwards;
}

.fade-in-up {
  opacity: 0;
  animation: slideInUp 1s ease forwards;
}

.fade-in-down {
  opacity: 0;
  animation: slideInDown 1s ease forwards;
}

.zoom-in {
  opacity: 0;
  animation: zoomIn 1s ease forwards;
}

.floating {
  animation: float 6s ease-in-out infinite;
}

.pulse {
  animation: pulse 3s ease-in-out infinite;
}

.rotate {
  animation: rotate 10s linear infinite;
}

/* 滚动触发动画 */
.animate-on-scroll {
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.fade-in-visible {
  opacity: 1;
}

.animate-on-scroll.slide-left {
  transform: translateX(-50px);
}

.animate-on-scroll.slide-left.visible {
  transform: translateX(0);
  opacity: 1;
}

.animate-on-scroll.slide-right {
  transform: translateX(50px);
}

.animate-on-scroll.slide-right.visible {
  transform: translateX(0);
  opacity: 1;
}

.animate-on-scroll.slide-up {
  transform: translateY(50px);
}

.animate-on-scroll.slide-up.visible {
  transform: translateY(0);
  opacity: 1;
}

/* 增强的滚动渐入动画类 */
.scroll-fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.215, 0.61, 0.355, 1), 
              transform 0.8s cubic-bezier(0.215, 0.61, 0.355, 1);
  will-change: opacity, transform;
}

.scroll-fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 新增滚动动画类 */
.scroll-slide-up {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.8s cubic-bezier(0.215, 0.61, 0.355, 1), 
              transform 0.8s cubic-bezier(0.215, 0.61, 0.355, 1);
  will-change: opacity, transform;
}

.scroll-slide-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-slide-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.8s cubic-bezier(0.215, 0.61, 0.355, 1), 
              transform 0.8s cubic-bezier(0.215, 0.61, 0.355, 1);
  will-change: opacity, transform;
}

.scroll-slide-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.scroll-slide-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.8s cubic-bezier(0.215, 0.61, 0.355, 1), 
              transform 0.8s cubic-bezier(0.215, 0.61, 0.355, 1);
  will-change: opacity, transform;
}

.scroll-slide-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.scroll-zoom-in {
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.8s cubic-bezier(0.215, 0.61, 0.355, 1), 
              transform 0.8s cubic-bezier(0.215, 0.61, 0.355, 1);
  will-change: opacity, transform;
}

.scroll-zoom-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* 级联动画效果 */
.cascade-item {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.cascade-container.visible .cascade-item {
  opacity: 1;
  transform: translateY(0);
}

/* 为级联项设置不同的延迟 */
.cascade-container.visible .cascade-item:nth-child(1) {
  transition-delay: 0s;
}

.cascade-container.visible .cascade-item:nth-child(2) {
  transition-delay: 0.1s;
}

.cascade-container.visible .cascade-item:nth-child(3) {
  transition-delay: 0.2s;
}

.cascade-container.visible .cascade-item:nth-child(4) {
  transition-delay: 0.3s;
}

.cascade-container.visible .cascade-item:nth-child(5) {
  transition-delay: 0.4s;
}

.cascade-container.visible .cascade-item:nth-child(6) {
  transition-delay: 0.5s;
}

/* 延迟动画 */
[data-delay="200"] {
  animation-delay: 0.2s;
}

[data-delay="400"] {
  animation-delay: 0.4s;
}

[data-delay="600"] {
  animation-delay: 0.6s;
}

[data-delay="800"] {
  animation-delay: 0.8s;
}

[data-delay="1000"] {
  animation-delay: 1s;
}

/* 滚动延迟类 */
[data-scroll-delay="100"] {
  transition-delay: 0.1s;
}

[data-scroll-delay="200"] {
  transition-delay: 0.2s;
}

[data-scroll-delay="300"] {
  transition-delay: 0.3s;
}

[data-scroll-delay="400"] {
  transition-delay: 0.4s;
}

[data-scroll-delay="500"] {
  transition-delay: 0.5s;
}

/* 页面加载动画 */
/*.page-loader {*/
/*  position: fixed;*/
/*  top: 0;*/
/*  left: 0;*/
/*  width: 100%;*/
/*  height: 100%;*/
/*  background-color: #ffffff;*/
/*  display: flex;*/
/*  justify-content: center;*/
/*  align-items: center;*/
/*  z-index: 9999;*/
/*  transition: opacity 0.5s ease, visibility 0.5s ease;*/
/*}*/

/*.page-loader.loaded {*/
/*  opacity: 0;*/
/*  visibility: hidden;*/
/*}*/

/*.loader {*/
/*  width: 50px;*/
/*  height: 50px;*/
/*  border: 5px solid rgba(67, 97, 238, 0.2);*/
/*  border-top: 5px solid #4361ee;*/
/*  border-radius: 50%;*/
/*  animation: rotate 1s linear infinite;*/
/*}*/

/* 文字渐变动画 */
.text-gradient {
  background: linear-gradient(90deg, #4361ee, #4cc9f0);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textGradient 5s linear infinite;
}

@keyframes textGradient {
  0% {
    background-position: 0% center;
  }
  50% {
    background-position: 100% center;
  }
  100% {
    background-position: 0% center;
  }
}

/* 按钮悬停动画 */
.btn-hover-effect {
  position: relative;
  overflow: hidden;
}

.btn-hover-effect::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0) 100%);
  transition: all 0.6s ease;
}

.btn-hover-effect:hover::before {
  left: 100%;
}

/* 图片悬停效果 */
.img-hover-zoom {
  overflow: hidden;
}

.img-hover-zoom img {
  transition: transform 0.5s ease;
}

.img-hover-zoom:hover img {
  transform: scale(1.1);
}

/* 数字增长动画 */
.count-animation {
  display: inline-block;
  position: relative;
}

/* 鼠标跟随效果 */
.cursor-follow {
  position: fixed;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(67, 97, 238, 0.2);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 9999;
  transition: transform 0.1s ease, width 0.3s ease, height 0.3s ease, background-color 0.3s ease;
}

.cursor-follow.active {
  width: 60px;
  height: 60px;
  background-color: rgba(67, 97, 238, 0.1);
}

/* 滚动进度条 */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, #4361ee, #4cc9f0);
  z-index: 9999;
  transition: width 0.1s ease;
}

/* 打字机效果 */
.typewriter {
  overflow: hidden;
  border-right: 2px solid #4361ee;
  white-space: nowrap;
  margin: 0 auto;
  animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}

@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: #4361ee }
}

/* 3D卡片效果 */
.card-3d {
  transition: transform 0.5s ease;
  transform-style: preserve-3d;
}

.card-3d:hover {
  transform: rotateY(10deg) rotateX(10deg);
}

/* 视差滚动效果 */
.parallax {
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* 滑动菜单动画 */
.slide-menu {
  position: fixed;
  top: 0;
  right: -300px;
  width: 300px;
  height: 100%;
  background-color: #ffffff;
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
  transition: right 0.3s ease;
  z-index: 1000;
}

.slide-menu.active {
  right: 0;
}

/* 波浪动画 */
.wave-animation {
  position: relative;
  overflow: hidden;
}

.wave-animation::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 10px;
  background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 1200 120" xmlns="http://www.w3.org/2000/svg"><path d="M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z" opacity=".25" fill="%234361ee"/><path d="M0,0V15.81C13,36.92,27.64,56.86,47.69,72.05,99.41,111.27,165,111,224.58,91.58c31.15-10.15,60.09-26.07,89.67-39.8,40.92-19,84.73-46,130.83-49.67,36.26-2.85,70.9,9.42,98.6,31.56,31.77,25.39,62.32,62,103.63,73,40.44,10.79,81.35-6.69,119.13-24.28s75.16-39,116.92-43.05c59.73-5.85,113.28,22.88,168.9,38.84,30.2,8.66,59,6.17,87.09-7.5,22.43-10.89,48-26.93,60.65-49.24V0Z" opacity=".5" fill="%234361ee"/><path d="M0,0V5.63C149.93,59,314.09,71.32,475.83,42.57c43-7.64,84.23-20.12,127.61-26.46,59-8.63,112.48,12.24,165.56,35.4C827.93,77.22,886,95.24,951.2,90c86.53-7,172.46-45.71,248.8-84.81V0Z" fill="%234361ee"/></svg>');
  background-size: 1200px 100%;
  animation: wave 10s linear infinite;
}

@keyframes wave {
  0% {
    background-position-x: 0;
  }
  100% {
    background-position-x: 1200px;
  }
}

/* 闪光效果 */
.shine-effect {
  position: relative;
  overflow: hidden;
}

.shine-effect::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 20%;
  height: 200%;
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(30deg);
  transition: all 0.6s ease;
}

.shine-effect:hover::after {
  left: 120%;
}

/* 滚动触发的渐入动画 */
.scroll-fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 新增：部分激活状态动画 */
section.active .section-header {
  animation: fadeInOnScroll 0.8s ease forwards;
}

section.active .service-card,
section.active .case-card,
section.active .team-card {
  animation: slideUpOnScroll 0.8s ease forwards;
}

/* 为活跃部分的卡片设置级联延迟 */
section.active .service-card:nth-child(1),
section.active .case-card:nth-child(1),
section.active .team-card:nth-child(1) {
  animation-delay: 0s;
}

section.active .service-card:nth-child(2),
section.active .case-card:nth-child(2),
section.active .team-card:nth-child(2) {
  animation-delay: 0.1s;
}

section.active .service-card:nth-child(3),
section.active .case-card:nth-child(3),
section.active .team-card:nth-child(3) {
  animation-delay: 0.2s;
}

section.active .service-card:nth-child(4),
section.active .case-card:nth-child(4),
section.active .team-card:nth-child(4) {
  animation-delay: 0.3s;
}

/* 新增：滚动渐入效果变体 */
.scroll-fade-in-fast {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.scroll-fade-in-fast.visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-fade-in-slow {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.2s ease, transform 1.2s ease;
}

.scroll-fade-in-slow.visible {
  opacity: 1;
  transform: translateY(0);
} 