/* 才不是你的小麦 - 动画库 */

/* ==================== 入场动画 ==================== */

/* 弹跳入场 */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.bounce-in {
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

.slide-up {
    animation: slideUp 0.5s ease;
}

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

.slide-in-left {
    animation: slideInLeft 0.5s ease;
}

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

.slide-in-right {
    animation: slideInRight 0.5s ease;
}

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

.rotate-in {
    animation: rotateIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 翻转入场 */
@keyframes flipIn {
    from {
        opacity: 0;
        transform: perspective(400px) rotateY(90deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateY(0);
    }
}

.flip-in {
    animation: flipIn 0.6s ease;
}

/* ==================== 悬浮动画 ==================== */

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

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

/* 摇摆效果 */
@keyframes wobble {
    0%, 100% {
        transform: rotate(0deg);
    }
    15% {
        transform: rotate(-5deg);
    }
    30% {
        transform: rotate(3deg);
    }
    45% {
        transform: rotate(-3deg);
    }
    60% {
        transform: rotate(2deg);
    }
    75% {
        transform: rotate(-1deg);
    }
}

.wobble {
    animation: wobble 1s ease;
}

/* 脉冲效果 */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

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

/* 心跳效果 */
@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.3);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.3);
    }
    70% {
        transform: scale(1);
    }
}

.heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

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

.shake {
    animation: shake 0.5s ease;
}

/* ==================== 麦穗主题动画 ==================== */

/* 麦穗摇曳 */
@keyframes wheatSway {
    0%, 100% {
        transform: rotate(-8deg);
    }
    50% {
        transform: rotate(8deg);
    }
}

.wheat-sway {
    animation: wheatSway 2s ease-in-out infinite;
    transform-origin: bottom center;
}

/* 麦穗生长 */
@keyframes wheatGrow {
    from {
        opacity: 0;
        transform: scaleY(0);
    }
    to {
        opacity: 1;
        transform: scaleY(1);
    }
}

.wheat-grow {
    animation: wheatGrow 0.8s ease;
    transform-origin: bottom center;
}

/* 麦浪效果 */
@keyframes wheatWave {
    0%, 100% {
        transform: skewX(0deg);
    }
    25% {
        transform: skewX(3deg);
    }
    75% {
        transform: skewX(-3deg);
    }
}

.wheat-wave {
    animation: wheatWave 3s ease-in-out infinite;
}

/* ==================== 爱心动画 ==================== */

/* 爱心飘散 */
@keyframes heartFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(0.5) rotate(20deg);
    }
}

.heart-float {
    animation: heartFloat 1.5s ease-out forwards;
}

/* 爱心爆炸 */
@keyframes heartBurst {
    0% {
        opacity: 1;
        transform: scale(0);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
    100% {
        opacity: 0;
        transform: scale(1.5);
    }
}

.heart-burst {
    animation: heartBurst 0.6s ease-out forwards;
}

/* ==================== 粒子动画 ==================== */

/* 粒子上升 */
@keyframes particleRise {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-200px) scale(0);
    }
}

.particle-rise {
    animation: particleRise 2s ease-out forwards;
}

/* 粒子旋转上升 */
@keyframes particleSpin {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(-150px) rotate(360deg);
    }
}

.particle-spin {
    animation: particleSpin 2.5s ease-out forwards;
}

/* ==================== 光效动画 ==================== */

/* 发光脉冲 */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(244, 208, 63, 0.5),
                    0 0 10px rgba(244, 208, 63, 0.3),
                    0 0 15px rgba(244, 208, 63, 0.1);
    }
    50% {
        box-shadow: 0 0 10px rgba(244, 208, 63, 0.8),
                    0 0 20px rgba(244, 208, 63, 0.5),
                    0 0 30px rgba(244, 208, 63, 0.3);
    }
}

.glow-pulse {
    animation: glowPulse 2s ease-in-out infinite;
}

/* 彩虹光效 */
@keyframes rainbowGlow {
    0% {
        box-shadow: 0 0 10px #ff0000;
    }
    16.66% {
        box-shadow: 0 0 10px #ff8800;
    }
    33.33% {
        box-shadow: 0 0 10px #ffff00;
    }
    50% {
        box-shadow: 0 0 10px #00ff00;
    }
    66.66% {
        box-shadow: 0 0 10px #0088ff;
    }
    83.33% {
        box-shadow: 0 0 10px #8800ff;
    }
    100% {
        box-shadow: 0 0 10px #ff0000;
    }
}

.rainbow-glow {
    animation: rainbowGlow 3s linear infinite;
}

/* ==================== 转场动画 ==================== */

/* 淡入淡出 */
@keyframes fadeInOut {
    0% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.fade-in-out {
    animation: fadeInOut 2s ease-in-out;
}

/* 缩放转场 */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.zoom-in {
    animation: zoomIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 模糊转场 */
@keyframes blurIn {
    from {
        opacity: 0;
        filter: blur(10px);
    }
    to {
        opacity: 1;
        filter: blur(0);
    }
}

.blur-in {
    animation: blurIn 0.5s ease;
}

/* ==================== 加载动画 ==================== */

/* 旋转加载 */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

/* 弹跳加载 */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.bounce {
    animation: bounce 0.6s ease-in-out infinite;
}

/* 闪烁加载 */
@keyframes flash {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

.flash {
    animation: flash 1.5s ease-in-out infinite;
}

/* ==================== 特殊效果 ==================== */

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

.typing {
    overflow: hidden;
    white-space: nowrap;
    animation: typing 2s steps(40, end);
}

/* 闪烁光标 */
@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

.blink {
    animation: blink 1s step-end infinite;
}

/* 抖动强调 */
@keyframes tada {
    0% {
        transform: scale(1);
    }
    10%, 20% {
        transform: scale(0.9) rotate(-3deg);
    }
    30%, 50%, 70%, 90% {
        transform: scale(1.1) rotate(3deg);
    }
    40%, 60%, 80% {
        transform: scale(1.1) rotate(-3deg);
    }
    100% {
        transform: scale(1) rotate(0);
    }
}

.tada {
    animation: tada 1s ease;
}

/* 果冻效果 */
@keyframes jelly {
    0%, 100% {
        transform: scale(1, 1);
    }
    25% {
        transform: scale(0.9, 1.1);
    }
    50% {
        transform: scale(1.1, 0.9);
    }
    75% {
        transform: scale(0.95, 1.05);
    }
}

.jelly {
    animation: jelly 0.5s ease;
}

/* 弹性效果 */
@keyframes rubberBand {
    0% {
        transform: scale(1);
    }
    30% {
        transform: scale(1.25, 0.75);
    }
    40% {
        transform: scale(0.75, 1.25);
    }
    50% {
        transform: scale(1.15, 0.85);
    }
    65% {
        transform: scale(0.95, 1.05);
    }
    75% {
        transform: scale(1.05, 0.95);
    }
    100% {
        transform: scale(1);
    }
}

.rubber-band {
    animation: rubberBand 1s ease;
}

/* ==================== 视差滚动 ==================== */

.parallax-slow {
    will-change: transform;
}

.parallax-medium {
    will-change: transform;
}

.parallax-fast {
    will-change: transform;
}

/* ==================== 悬停效果类 ==================== */

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

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* 悬停缩放 */
.hover-scale {
    transition: transform 0.3s ease;
}

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

/* 悬停旋转 */
.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* 悬停发光 */
.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(244, 208, 63, 0.6);
}

/* ==================== 动画延迟类 ==================== */

.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; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }
.delay-900 { animation-delay: 0.9s; }
.delay-1000 { animation-delay: 1s; }

/* ==================== 动画时长类 ==================== */

.duration-300 { animation-duration: 0.3s; }
.duration-500 { animation-duration: 0.5s; }
.duration-700 { animation-duration: 0.7s; }
.duration-1000 { animation-duration: 1s; }
.duration-1500 { animation-duration: 1.5s; }
.duration-2000 { animation-duration: 2s; }

/* ==================== 动画填充模式 ==================== */

.fill-forwards {
    animation-fill-mode: forwards;
}

.fill-backwards {
    animation-fill-mode: backwards;
}

.fill-both {
    animation-fill-mode: both;
}
