/* ==================== Animation Keyframes ==================== */

/* 水墨晕染效果 */
@keyframes inkBlur {
    0% {
        filter: blur(0px);
        opacity: 0;
    }
    50% {
        filter: blur(5px);
        opacity: 0.5;
    }
    100% {
        filter: blur(0px);
        opacity: 1;
    }
}

/* 淡入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 从下方滑入 */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 从左侧滑入 */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 从右侧滑入 */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 缩放淡入 */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 呼吸效果 */
@keyframes breathe {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

/* 浮动效果 */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* 旋转淡入 */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-10deg) scale(0.9);
    }
    to {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

/* 波纹效果 */
@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* 闪烁效果 */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* ==================== Animation Classes ==================== */

/* 淡入上升 - 主要用于内容块 */
.fade-in-up {
    opacity: 0;
    animation: slideUp 0.8s ease-out forwards;
}

/* 延迟动画 */
.fade-in-up.delay-1 {
    animation-delay: 0.2s;
}

.fade-in-up.delay-2 {
    animation-delay: 0.4s;
}

.fade-in-up.delay-3 {
    animation-delay: 0.6s;
}

/* 淡入效果 */
.fade-in {
    opacity: 0;
    animation: fadeIn 1s ease-out forwards;
}

/* 缩放淡入 */
.scale-in {
    opacity: 0;
    animation: scaleIn 0.6s ease-out forwards;
}

/* 左侧滑入 */
.slide-in-left {
    opacity: 0;
    animation: slideInLeft 0.8s ease-out forwards;
}

/* 右侧滑入 */
.slide-in-right {
    opacity: 0;
    animation: slideInRight 0.8s ease-out forwards;
}

/* 水墨效果 */
.ink-blur {
    animation: inkBlur 2s ease-in-out;
}

/* 浮动效果 - 用于装饰元素 */
.floating {
    animation: float 3s ease-in-out infinite;
}

/* 呼吸效果 - 用于强调元素 */
.breathing {
    animation: breathe 3s ease-in-out infinite;
}

/* ==================== Scroll Animations ==================== */

/* 当元素进入视口时的动画 */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

/* ==================== Hover Effects ==================== */

/* 卡片悬停效果 */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

/* 按钮悬停波纹 */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

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

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

/* 文字悬停效果 */
.text-hover {
    position: relative;
    transition: color 0.3s ease;
}

.text-hover::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.3s ease;
}

.text-hover:hover::after {
    width: 100%;
}

/* ==================== Loading Animations ==================== */

/* 加载点动画 */
@keyframes dotPulse {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    40% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.loading-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 0 2px;
    background: currentColor;
    border-radius: 50%;
    animation: dotPulse 1.4s infinite ease-in-out;
}

.loading-dots span:nth-child(1) {
    animation-delay: 0s;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

/* ==================== Transition Classes ==================== */

/* 平滑过渡 */
.transition-all {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-fast {
    transition: all 0.15s ease;
}

.transition-slow {
    transition: all 0.6s ease;
}

/* ==================== Special Effects ==================== */

/* 光晕效果 */
.glow {
    box-shadow: 0 0 20px rgba(76, 182, 172, 0.3);
    transition: box-shadow 0.3s ease;
}

.glow:hover {
    box-shadow: 0 0 30px rgba(76, 182, 172, 0.5);
}

/* 渐变背景动画 */
.gradient-animate {
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
}

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

/* 水墨背景效果 */
.ink-background {
    position: relative;
    overflow: hidden;
}

.ink-background::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(76, 182, 172, 0.1) 0%, transparent 70%);
    animation: inkSpread 10s ease-in-out infinite;
}

@keyframes inkSpread {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translate(10%, 10%) scale(1.2);
        opacity: 0.5;
    }
}

/* ==================== Particle Animation ==================== */

/* 粒子效果容器 */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(76, 182, 172, 0.3);
    border-radius: 50%;
    animation: particleFloat 20s infinite ease-in-out;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translate(100px, -100px) scale(0.5);
        opacity: 0;
    }
}

/* ==================== Mobile Optimized Animations ==================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
