/* 动画效果样式 */

/* 基础动画类 */
.animate-on-scroll {
    opacity: 0;
    transition: all 0.8s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
}

/* 淡入动画 */
.fade-in {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
}

/* 从下向上滑入 */
.slide-up {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.slide-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 从左向右滑入 */
.slide-right {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s ease;
}

.slide-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* 从右向左滑入 */
.slide-left {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s ease;
}

.slide-left.visible {
    opacity: 1;
    transform: translateX(0);
}

/* 缩放动画 */
.scale-up {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s ease;
}

.scale-up.visible {
    opacity: 1;
    transform: scale(1);
}

/* 旋转动画 */
.rotate-in {
    opacity: 0;
    transform: rotate(-15deg) scale(0.8);
    transition: all 0.8s ease;
}

.rotate-in.visible {
    opacity: 1;
    transform: rotate(0) scale(1);
}

/* 延迟类 */
.delay-100 {
    transition-delay: 100ms;
}

.delay-200 {
    transition-delay: 200ms;
}

.delay-300 {
    transition-delay: 300ms;
}

.delay-400 {
    transition-delay: 400ms;
}

.delay-500 {
    transition-delay: 500ms;
}

/* 页面过渡动画 */
.page-transition {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 悬停动画 */
.hover-lift {
    transition: transform 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
}

.hover-grow {
    transition: transform 0.3s ease;
}

.hover-grow:hover {
    transform: scale(1.05);
}

/* 脉冲动画 */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* 波纹效果 */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple:after {
    content: "";
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, #fff 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform 0.5s, opacity 1s;
}

.ripple:active:after {
    transform: scale(0, 0);
    opacity: 0.3;
    transition: 0s;
}

/* 闪光效果 */
.shine {
    position: relative;
    overflow: hidden;
}

.shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 100%);
    transform: skewX(-25deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        left: -100%;
    }
    20% {
        left: 100%;
    }
    100% {
        left: 100%;
    }
}

/* 浮动动画 */
.float {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

/* 打字机效果 */
.typewriter h1 {
    overflow: hidden;
    border-right: .15em solid #333;
    white-space: nowrap;
    margin: 0 auto;
    letter-spacing: .15em;
    animation: typing 3.5s steps(40, end), blink-caret .75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: #333; }
}

/* 渐变背景动画 */
.gradient-bg {
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* 3D翻转效果 */
.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* 导航菜单动画 */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: currentColor;
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* 图片悬停效果 */
.img-hover-zoom {
    overflow: hidden;
}

.img-hover-zoom img {
    transition: transform 0.5s ease;
}

.img-hover-zoom:hover img {
    transform: scale(1.1);
}

/* 按钮点击波纹效果 */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple:after {
    content: "";
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.3) 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform 0.5s, opacity 1s;
}

.btn-ripple:active:after {
    transform: scale(0, 0);
    opacity: 0.3;
    transition: 0s;
}