/* 增强动画特效库 */

/* 页面加载动画 */
@keyframes pageLoad {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 卡片弹入动画 */
@keyframes cardBounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(-10deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.05) rotate(5deg);
    }
    70% {
        transform: scale(0.95) rotate(-2deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* 爱心跳动动画 */
@keyframes heartBeat {
    0%, 100% {
        transform: scale(1);
        filter: hue-rotate(0deg);
    }
    25% {
        transform: scale(1.1);
        filter: hue-rotate(15deg);
    }
    50% {
        transform: scale(1.2);
        filter: hue-rotate(30deg);
    }
    75% {
        transform: scale(1.1);
        filter: hue-rotate(15deg);
    }
}

/* 文字打字机效果 */
@keyframes typewriter {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blinkCaret {
    from, to { border-color: transparent }
    50% { border-color: #e91e63; }
}

.typewriter {
    overflow: hidden;
    border-right: 0.15em solid #e91e63;
    white-space: nowrap;
    margin: 0 auto;
    letter-spacing: 0.05em;
    animation: 
        typewriter 3s steps(40, end),
        blinkCaret 0.75s step-end infinite;
}

/* 粒子漂浮效果 */
@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.7;
    }
    25% {
        transform: translateY(-20px) rotate(90deg);
        opacity: 1;
    }
    50% {
        transform: translateY(-40px) rotate(180deg);
        opacity: 0.8;
    }
    75% {
        transform: translateY(-20px) rotate(270deg);
        opacity: 1;
    }
}

/* 渐变波浪动画 */
@keyframes waveGradient {
    0% {
        background-position: 0% 50%;
        transform: rotate(0deg) scale(1);
    }
    25% {
        background-position: 100% 50%;
        transform: rotate(2deg) scale(1.02);
    }
    50% {
        background-position: 100% 100%;
        transform: rotate(0deg) scale(1.05);
    }
    75% {
        background-position: 0% 100%;
        transform: rotate(-2deg) scale(1.02);
    }
    100% {
        background-position: 0% 50%;
        transform: rotate(0deg) scale(1);
    }
}

/* 悬停发光效果 */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 154, 158, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 154, 158, 0.6), 
                    0 0 40px rgba(255, 105, 180, 0.4);
    }
}

.glow-on-hover {
    transition: all 0.3s ease;
}

.glow-on-hover:hover {
    animation: glow 2s ease-in-out infinite;
    transform: translateY(-5px) scale(1.02);
}

/* 数字计数动画 */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.count-animation {
    animation: countUp 0.6s ease-out;
}

/* 按钮点击波纹效果 */
.ripple {
    position: relative;
    overflow: hidden;
    transform: translate3d(0, 0, 0);
}

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

.ripple:active:before {
    width: 300px;
    height: 300px;
}

/* 卡片翻转效果 */
.flip-card {
    background-color: transparent;
    perspective: 1000px;
    width: 100%;
    height: 200px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    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%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.flip-card-front {
    background: linear-gradient(135deg, #ff9a9e, #fecfef);
}

.flip-card-back {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    transform: rotateY(180deg);
}

/* 进度条动画 */
@keyframes progressFill {
    0% {
        width: 0%;
        background-position: 0% 50%;
    }
    100% {
        width: 100%;
        background-position: 100% 50%;
    }
}

.progress-animated {
    background: linear-gradient(90deg, #ff9a9e, #fecfef, #ff9a9e);
    background-size: 200% 100%;
    animation: progressFill 2s ease-out forwards;
}

/* 照片悬停缩放效果 */
.photo-zoom {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.photo-zoom:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.photo-zoom img {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.photo-zoom:hover img {
    transform: scale(1.1);
    filter: brightness(1.1) saturate(1.2);
}

/* 文字渐现动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

/* 延迟动画类 */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* 无限旋转 */
@keyframes infiniteRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

/* 弹跳加载动画 */
@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.bounce-loading {
    display: inline-block;
}

.bounce-loading span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #e91e63;
    animation: bounce 1.4s ease-in-out infinite both;
    margin: 0 2px;
}

.bounce-loading span:nth-child(1) { animation-delay: -0.32s; }
.bounce-loading span:nth-child(2) { animation-delay: -0.16s; }
.bounce-loading span:nth-child(3) { animation-delay: 0s; }

/* 气泡上升效果 */
@keyframes bubbleUp {
    0% {
        opacity: 0;
        transform: translateY(100px) scale(0.5);
    }
    50% {
        opacity: 0.8;
        transform: translateY(50px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(0) scale(0.5);
    }
}

.bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: bubbleUp 4s ease-in-out infinite;
    pointer-events: none;
}

/* 时间数字滚动动画 */
@keyframes numberRoll {
    0% { transform: translateY(20px); opacity: 0; }
    50% { transform: translateY(-10px); opacity: 1; }
    100% { transform: translateY(0); opacity: 1; }
}

.number-roll {
    animation: numberRoll 0.5s ease-out;
}

/* 验证成功动画 */
@keyframes successPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

.success-animation {
    animation: successPulse 2s ease-out;
}

/* 错误摇摆动画 */
@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

.error-animation {
    animation: errorShake 0.6s ease-in-out;
}

/* 加载旋转动画 */
@keyframes loadingSpinner {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #e91e63;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: loadingSpinner 1s linear infinite;
    display: inline-block;
}

/* 移除了彩虹文字动画，改用更优雅的渐变效果 */

/* 响应式动画优化 */
@media (max-width: 768px) {
    /* 减少移动端动画以提高性能 */
    .glow-on-hover:hover {
        animation: none;
        transform: translateY(-2px) scale(1.01);
    }
    
    .photo-zoom:hover {
        transform: scale(1.02);
    }
    
    .photo-zoom:hover img {
        transform: scale(1.05);
    }
}

@media (prefers-reduced-motion: reduce) {
    /* 尊重用户的动画偏好设置 */
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}