/* Enword 官方网站 - 动画效果文件 */

/* ========== 页面加载动画 ========== */
.animate-on-load {
    opacity: 0;
    transform: translateY(30px);
    animation: animateIn 0.6s ease forwards;
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }
.animate-delay-5 { animation-delay: 0.5s; }

@keyframes animateIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== 滚动触发动画 ========== */
.scroll-animate {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.scroll-animate-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.scroll-animate-right {
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.scroll-animate-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ========== 悬停动画 ========== */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(74, 144, 226, 0.3);
}

/* ========== 按钮动画 ========== */
.btn-animate {
    position: relative;
    overflow: hidden;
}

.btn-animate::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

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

.btn-click {
    transition: transform 0.1s ease;
}

.btn-click:active {
    transform: scale(0.95);
}

/* ========== 卡片动画 ========== */
.card-hover {
    position: relative;
}

.card-hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.card-hover:hover::after {
    transform: scaleX(1);
}

/* ========== 下划线动画 ========== */
.underline-animate {
    position: relative;
}

.underline-animate::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

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

/* ========== 文字渐变动画 ========== */
.gradient-text {
    background: linear-gradient(
        90deg,
        var(--primary) 0%,
        var(--secondary) 50%,
        var(--primary) 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientMove 3s ease infinite;
}

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

/* ========== 浮动动画 ========== */
.float {
    animation: float 3s ease-in-out infinite;
}

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

.float-slow {
    animation: float 4s ease-in-out infinite;
}

.float-delay {
    animation: float 3s ease-in-out infinite;
    animation-delay: 1s;
}

/* ========== 脉冲动画 ========== */
.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.pulse-scale {
    animation: pulseScale 2s ease-in-out infinite;
}

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

/* ========== 旋转动画 ========== */
.rotate {
    animation: rotate 10s linear infinite;
}

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

.rotate-slow {
    animation: rotate 20s linear infinite;
}

/* ========== 弹跳动画 ========== */
.bounce {
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.bounce-left {
    animation: bounceLeft 1s ease infinite;
}

@keyframes bounceLeft {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(-10px);
    }
}

/* ========== 闪烁动画 ========== */
.blink {
    animation: blink 1s step-start infinite;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* ========== 渐入动画 ========== */
.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

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

.fade-in-down {
    animation: fadeInDown 0.6s ease forwards;
}

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

.fade-in-left {
    animation: fadeInLeft 0.6s ease forwards;
}

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

.fade-in-right {
    animation: fadeInRight 0.6s ease forwards;
}

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

/* ========== 滑入动画 ========== */
.slide-in-top {
    animation: slideInTop 0.6s ease forwards;
}

@keyframes slideInTop {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

.slide-in-bottom {
    animation: slideInBottom 0.6s ease forwards;
}

@keyframes slideInBottom {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* ========== 缩放动画 ========== */
.scale-in {
    animation: scaleIn 0.4s ease forwards;
}

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

/* ========== 震动动画 ========== */
.shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* ========== 成功动画 ========== */
.success-check {
    animation: successCheck 0.6s ease forwards;
}

@keyframes successCheck {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ========== 加载动画 ========== */
.loading-dots::after {
    content: '';
    animation: loadingDots 1.5s steps(4, end) infinite;
}

@keyframes loadingDots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--primary-alpha-20);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ========== 背景动画 ========== */
.gradient-bg {
    background: linear-gradient(
        -45deg,
        var(--primary-alpha-10),
        var(--secondary-alpha-10),
        var(--primary-alpha-10),
        var(--secondary-alpha-10)
    );
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

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

/* ========== 鼠标跟随效果 ========== */
.mouse-follow {
    position: relative;
}

.mouse-follow::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(74, 144, 226, 0.1) 0%,
        transparent 50%
    );
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mouse-follow:hover::before {
    opacity: 1;
}

/* ========== 打字机效果 ========== */
.typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--primary);
    animation: typing 3s steps(40, end), blink 0.75s step-end infinite;
}

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

/* ========== 使用示例 ========== */

/* 
HTML中使用方式：

1. 页面加载动画：
<div class="animate-on-load animate-delay-1">
    内容
</div>

2. 滚动触发动画：
<div class="scroll-animate">
    滚动到视口时会触发动画
</div>

3. 悬停效果：
<div class="hover-lift">
    悬停时上浮
</div>

4. 浮动效果：
<span class="float">飘动的内容</span>

5. 渐变文字：
<h1 class="gradient-text">渐变文字</h1>
*/
