/**
 * 码上出海网站动画样式文件
 * 包含各种动画效果、过渡和交互反馈
 */

/* 基础动画关键帧 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-200deg);
    }
    to {
        opacity: 1;
        transform: rotate(0);
    }
}

@keyframes flipInX {
    from {
        opacity: 0;
        transform: perspective(400px) rotateX(90deg);
    }
    40% {
        transform: perspective(400px) rotateX(-20deg);
    }
    60% {
        transform: perspective(400px) rotateX(10deg);
    }
    80% {
        transform: perspective(400px) rotateX(-5deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateX(0);
    }
}

@keyframes flipInY {
    from {
        opacity: 0;
        transform: perspective(400px) rotateY(90deg);
    }
    40% {
        transform: perspective(400px) rotateY(-20deg);
    }
    60% {
        transform: perspective(400px) rotateY(10deg);
    }
    80% {
        transform: perspective(400px) rotateY(-5deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateY(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(10px);
    }
}

@keyframes swing {
    20% {
        transform: rotate(15deg);
    }
    40% {
        transform: rotate(-10deg);
    }
    60% {
        transform: rotate(5deg);
    }
    80% {
        transform: rotate(-5deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

@keyframes wobble {
    0% {
        transform: translateX(0%);
    }
    15% {
        transform: translateX(-25%) rotate(-5deg);
    }
    30% {
        transform: translateX(20%) rotate(3deg);
    }
    45% {
        transform: translateX(-15%) rotate(-3deg);
    }
    60% {
        transform: translateX(10%) rotate(2deg);
    }
    75% {
        transform: translateX(-5%) rotate(-1deg);
    }
    100% {
        transform: translateX(0%);
    }
}

@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);
    }
}

@keyframes lightSpeedIn {
    from {
        opacity: 0;
        transform: translateX(100%) skewX(-30deg);
    }
    60% {
        opacity: 1;
        transform: translateX(-20%) skewX(30deg);
    }
    80% {
        transform: translateX(0%) skewX(-15deg);
    }
    100% {
        opacity: 1;
        transform: translateX(0%) skewX(0deg);
    }
}

@keyframes rollIn {
    from {
        opacity: 0;
        transform: translateX(-100%) rotate(-120deg);
    }
    to {
        opacity: 1;
        transform: translateX(0%) rotate(0deg);
    }
}

@keyframes rollOut {
    from {
        opacity: 1;
        transform: translateX(0%) rotate(0deg);
    }
    to {
        opacity: 0;
        transform: translateX(100%) rotate(120deg);
    }
}

/* 悬停动画 */
@keyframes hoverLift {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-5px);
    }
}

@keyframes hoverGlow {
    0% {
        box-shadow: 0 0 5px rgba(44, 90, 160, 0.2);
    }
    100% {
        box-shadow: 0 0 20px rgba(44, 90, 160, 0.4);
    }
}

@keyframes hoverPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes hoverRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 加载动画 */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateY(0);
    }
    40%, 43% {
        transform: translateY(-30px);
    }
    70% {
        transform: translateY(-15px);
    }
    90% {
        transform: translateY(-4px);
    }
}

@keyframes flash {
    0%, 50%, 100% {
        opacity: 1;
    }
    25%, 75% {
        opacity: 0;
    }
}

@keyframes rubberBand {
    0% {
        transform: scale(1);
    }
    30% {
        transform: scaleX(1.25) scaleY(0.75);
    }
    40% {
        transform: scaleX(0.75) scaleY(1.25);
    }
    50% {
        transform: scaleX(1.15) scaleY(0.85);
    }
    65% {
        transform: scaleX(0.95) scaleY(1.05);
    }
    75% {
        transform: scaleX(1.05) scaleY(0.95);
    }
    100% {
        transform: scale(1);
    }
}

/* 进度条动画 */
@keyframes progressBar {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}

@keyframes progressBarStripes {
    0% {
        background-position: 40px 0;
    }
    100% {
        background-position: 0 0;
    }
}

/* 打字机效果 */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

/* 波浪效果 */
@keyframes wave {
    0% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(-25%);
    }
    100% {
        transform: translateX(0);
    }
}

/* 浮动效果 */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes floatX {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(10px);
    }
}

/* 呼吸效果 */
@keyframes breathe {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* 闪烁效果 */
@keyframes twinkle {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* 彩虹效果 */
@keyframes rainbow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* 动画类 */
.animate-fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-fade-in-down {
    animation: fadeInDown 0.6s ease forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.6s ease forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 0.6s ease forwards;
}

.animate-slide-in-up {
    animation: slideInUp 0.6s ease forwards;
}

.animate-slide-in-down {
    animation: slideInDown 0.6s ease forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s ease forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.6s ease forwards;
}

.animate-scale-in {
    animation: scaleIn 0.6s ease forwards;
}

.animate-bounce-in {
    animation: bounceIn 0.8s ease forwards;
}

.animate-rotate-in {
    animation: rotateIn 0.8s ease forwards;
}

.animate-flip-in-x {
    animation: flipInX 0.8s ease forwards;
}

.animate-flip-in-y {
    animation: flipInY 0.8s ease forwards;
}

.animate-zoom-in {
    animation: zoomIn 0.6s ease forwards;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-shake {
    animation: shake 0.8s ease forwards;
}

.animate-swing {
    animation: swing 1s ease forwards;
}

.animate-wobble {
    animation: wobble 1s ease forwards;
}

.animate-tada {
    animation: tada 1s ease forwards;
}

.animate-light-speed-in {
    animation: lightSpeedIn 0.8s ease forwards;
}

.animate-roll-in {
    animation: rollIn 0.8s ease forwards;
}

.animate-roll-out {
    animation: rollOut 0.8s ease forwards;
}

/* 悬停动画类 */
.hover-lift:hover {
    animation: hoverLift 0.3s ease forwards;
}

.hover-glow:hover {
    animation: hoverGlow 0.3s ease forwards;
}

.hover-pulse:hover {
    animation: hoverPulse 0.6s ease infinite;
}

.hover-rotate:hover {
    animation: hoverRotate 0.6s ease infinite;
}

/* 加载动画类 */
.loading-spin {
    animation: spin 1s linear infinite;
}

.loading-bounce {
    animation: bounce 1s infinite;
}

.loading-flash {
    animation: flash 1s infinite;
}

.loading-rubber-band {
    animation: rubberBand 1s ease forwards;
}

/* 进度条动画类 */
.progress-bar {
    animation: progressBar 2s ease forwards;
}

.progress-bar-striped {
    background-image: linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);
    background-size: 40px 40px;
    animation: progressBarStripes 2s linear infinite;
}

/* 打字机效果类 */
.typing-effect {
    overflow: hidden;
    border-right: 2px solid;
    white-space: nowrap;
    animation: typing 3s steps(40, end), blink 0.75s step-end infinite;
}

/* 波浪效果类 */
.wave {
    animation: wave 2s ease-in-out infinite;
}

/* 浮动效果类 */
.float {
    animation: float 3s ease-in-out infinite;
}

.float-x {
    animation: floatX 3s ease-in-out infinite;
}

/* 呼吸效果类 */
.breathe {
    animation: breathe 2s ease-in-out infinite;
}

/* 闪烁效果类 */
.twinkle {
    animation: twinkle 1.5s ease-in-out infinite;
}

/* 彩虹效果类 */
.rainbow {
    background: linear-gradient(90deg, #ff0000, #ff8000, #ffff00, #80ff00, #00ff00, #00ff80, #00ffff, #0080ff, #0000ff, #8000ff, #ff00ff, #ff0080);
    background-size: 200% 200%;
    animation: rainbow 3s ease infinite;
}

/* 延迟动画类 */
.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;
}

/* 动画缓动函数类 */
.ease-linear {
    animation-timing-function: linear;
}

.ease-in {
    animation-timing-function: ease-in;
}

.ease-out {
    animation-timing-function: ease-out;
}

.ease-in-out {
    animation-timing-function: ease-in-out;
}

.ease-bounce {
    animation-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.ease-elastic {
    animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 动画填充模式类 */
.fill-forwards {
    animation-fill-mode: forwards;
}

.fill-backwards {
    animation-fill-mode: backwards;
}

.fill-both {
    animation-fill-mode: both;
}

.fill-none {
    animation-fill-mode: none;
}

/* 动画迭代次数类 */
.iterate-1 {
    animation-iteration-count: 1;
}

.iterate-2 {
    animation-iteration-count: 2;
}

.iterate-3 {
    animation-iteration-count: 3;
}

.iterate-infinite {
    animation-iteration-count: infinite;
}

/* 动画方向类 */
.direction-normal {
    animation-direction: normal;
}

.direction-reverse {
    animation-direction: reverse;
}

.direction-alternate {
    animation-direction: alternate;
}

.direction-alternate-reverse {
    animation-direction: alternate-reverse;
}

/* 动画暂停类 */
.pause {
    animation-play-state: paused;
}

.running {
    animation-play-state: running;
}

/* 响应式动画 */
@media (max-width: 768px) {
    .animate-fade-in-up,
    .animate-fade-in-down,
    .animate-fade-in-left,
    .animate-fade-in-right {
        animation: fadeIn 0.6s ease forwards;
    }
    
    .animate-slide-in-up,
    .animate-slide-in-down,
    .animate-slide-in-left,
    .animate-slide-in-right {
        animation: fadeIn 0.6s ease forwards;
    }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .animate-fade-in,
    .animate-fade-in-up,
    .animate-fade-in-down,
    .animate-fade-in-left,
    .animate-fade-in-right,
    .animate-slide-in-up,
    .animate-slide-in-down,
    .animate-slide-in-left,
    .animate-slide-in-right,
    .animate-scale-in,
    .animate-bounce-in,
    .animate-rotate-in,
    .animate-flip-in-x,
    .animate-flip-in-y,
    .animate-zoom-in,
    .animate-pulse,
    .animate-shake,
    .animate-swing,
    .animate-wobble,
    .animate-tada,
    .animate-light-speed-in,
    .animate-roll-in,
    .animate-roll-out {
        animation: none !important;
    }
    
    .hover-lift:hover,
    .hover-glow:hover,
    .hover-pulse:hover,
    .hover-rotate:hover {
        animation: none !important;
    }
    
    .loading-spin,
    .loading-bounce,
    .loading-flash,
    .loading-rubber-band {
        animation: none !important;
    }
    
    .progress-bar,
    .progress-bar-striped {
        animation: none !important;
    }
    
    .typing-effect {
        animation: none !important;
        border-right: none;
    }
    
    .wave,
    .float,
    .float-x,
    .breathe,
    .twinkle,
    .rainbow {
        animation: none !important;
    }
}
