/* 微交互动画样式 */

/* 按钮动画 */
.btn-animated {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-animated::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
  border-radius: 50%;
}

.btn-animated:hover::before {
  width: 300px;
  height: 300px;
}

.btn-animated:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.btn-animated:active {
  transform: translateY(0);
  transition: transform 0.1s;
}

/* 输入框动画 */
.input-animated {
  position: relative;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.input-animated:focus {
  transform: translateY(-1px);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.input-animated::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.input-animated:focus::after {
  transform: scaleX(1);
}

/* 涟漪效果 */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: scale(0);
  animation: ripple 0.6s ease-out;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* 弹性动画 */
.bounce-in {
  animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* 脉冲动画 */
.pulse-soft {
  animation: pulseSoft 2s infinite;
}

@keyframes pulseSoft {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

/* 光晕效果 */
.glow {
  position: relative;
}

.glow::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #3b82f6, #8b5cf6, #ec4899, #3b82f6);
  background-size: 400% 400%;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s;
  filter: blur(8px);
  z-index: -1;
  animation: glowAnimation 3s ease infinite;
}

.glow:hover::before,
.glow:focus-within::before {
  opacity: 0.6;
}

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

/* 滑动下划线 */
.underline-slide {
  position: relative;
  text-decoration: none;
}

.underline-slide::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.underline-slide:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* 3D 翻转效果 */
.flip-3d {
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.flip-3d:hover {
  transform: rotateY(5deg) rotateX(-5deg);
}

/* 磁性吸附效果 */
.magnetic {
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

/* 需要JavaScript配合实现磁性效果 */

/* 液体按钮效果 */
.liquid-button {
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.liquid-button::before,
.liquid-button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.5s ease-out;
}

.liquid-button:hover::before {
  transform: translate(-50%, -50%) scale(1.5);
}

.liquid-button:hover::after {
  transform: translate(-50%, -50%) scale(1.2);
  transition-delay: 0.1s;
}

/* 呼吸灯效果 */
.breathing {
  animation: breathing 3s ease-in-out infinite;
}

@keyframes breathing {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}