/* ===== 页面过渡动画样式 ===== */

/* 页面加载动画 */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    color: white;
}

.loader-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
    background: linear-gradient(135deg, #DC143C, #B91C3C);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    animation: pulse 2s ease-in-out infinite;
}

.loader-text {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 2rem;
    animation: fadeInOut 1.5s ease-in-out infinite;
}

.loader-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.loader-progress-bar {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #DC143C, #B91C3C);
    border-radius: 2px;
    animation: progressBar 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@keyframes progressBar {
    0% { width: 0; }
    100% { width: 100%; }
}

/* 页面切换动画 */
.page-transition {
    animation-duration: 0.5s;
    animation-fill-mode: both;
}

.page-enter {
    animation-name: pageEnter;
}

.page-exit {
    animation-name: pageExit;
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pageExit {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* 滑动切换动画 */
.slide-enter-left {
    animation: slideInLeft 0.5s ease-out;
}

.slide-enter-right {
    animation: slideInRight 0.5s ease-out;
}

.slide-exit-left {
    animation: slideOutLeft 0.5s ease-out;
}

.slide-exit-right {
    animation: slideOutRight 0.5s ease-out;
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes slideOutLeft {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

@keyframes slideOutRight {
    from { transform: translateX(0); }
    to { transform: translateX(100%); }
}

/* 淡入淡出动画 */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.fade-out {
    animation: fadeOut 0.5s ease-out;
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.fade-in-down {
    animation: fadeInDown 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@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);
    }
}

/* 缩放动画 */
.scale-in {
    animation: scaleIn 0.4s ease-out;
}

.scale-out {
    animation: scaleOut 0.4s ease-out;
}

.zoom-in {
    animation: zoomIn 0.3s ease-out;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.3);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 旋转动画 */
.rotate-in {
    animation: rotateIn 0.6s ease-out;
}

.spin {
    animation: spin 1s linear infinite;
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg) scale(0.5);
    }
    to {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 弹跳动画 */
.bounce-in {
    animation: bounceIn 0.8s ease-out;
}

.bounce {
    animation: bounce 1s ease-in-out infinite;
}

@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 bounce {
    0%, 20%, 53%, 80%, 100% {
        animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
        transform: translateY(0);
    }
    40%, 43% {
        animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
        transform: translateY(-10px);
    }
    70% {
        animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
        transform: translateY(-5px);
    }
    90% {
        transform: translateY(-2px);
    }
}

/* 摇摆动画 */
.shake {
    animation: shake 0.6s ease-in-out;
}

.wobble {
    animation: wobble 1s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes wobble {
    0% { transform: translateX(0%); }
    15% { transform: translateX(-25px) rotate(-5deg); }
    30% { transform: translateX(20px) rotate(3deg); }
    45% { transform: translateX(-15px) rotate(-3deg); }
    60% { transform: translateX(10px) rotate(2deg); }
    75% { transform: translateX(-5px) rotate(-1deg); }
    100% { transform: translateX(0%); }
}

/* 翻转动画 */
.flip-in-x {
    animation: flipInX 0.6s ease-out;
}

.flip-in-y {
    animation: flipInY 0.6s ease-out;
}

@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(0deg);
    }
}

@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(0deg);
    }
}

/* 滚动进入动画 */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s ease-out;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.scroll-reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.6s ease-out;
}

.scroll-reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.scroll-reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.6s ease-out;
}

.scroll-reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* 悬浮动画 */
.float {
    animation: float 3s ease-in-out infinite;
}

.pulse-slow {
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(220, 20, 60, 0.5);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 20px rgba(220, 20, 60, 0.8);
        transform: scale(1.02);
    }
}

/* 打字机效果 */
.typewriter {
    overflow: hidden;
    border-right: 2px solid #DC143C;
    white-space: nowrap;
    margin: 0 auto;
    letter-spacing: 0.1em;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: #DC143C; }
}

/* 渐进式载入 */
.progressive-load {
    opacity: 0;
    animation: progressiveLoad 0.8s ease-out forwards;
}

.progressive-load:nth-child(1) { animation-delay: 0.1s; }
.progressive-load:nth-child(2) { animation-delay: 0.2s; }
.progressive-load:nth-child(3) { animation-delay: 0.3s; }
.progressive-load:nth-child(4) { animation-delay: 0.4s; }
.progressive-load:nth-child(5) { animation-delay: 0.5s; }

@keyframes progressiveLoad {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 滑动条加载 */
.loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #DC143C, #B91C3C);
    transform: translateX(-100%);
    animation: loadingBar 2s ease-in-out infinite;
    z-index: 9999;
}

@keyframes loadingBar {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(0%); }
    100% { transform: translateX(100%); }
}

/* 波纹效果 */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(220, 20, 60, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::before {
    width: 300px;
    height: 300px;
}

/* 呼吸灯效果 */
.breathing {
    animation: breathing 2s ease-in-out infinite;
}

@keyframes breathing {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* 滚动进度条 */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #DC143C, #B91C3C);
    z-index: 1000;
    transition: width 0.1s ease-out;
}

/* 动画延迟类 */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* 动画速度类 */
.animate-slow { animation-duration: 2s; }
.animate-fast { animation-duration: 0.3s; }

/* 无限循环 */
.infinite { animation-iteration-count: infinite; }

/* 暂停动画 */
.paused { animation-play-state: paused; }

/* 响应式动画控制 */
@media (prefers-reduced-motion: reduce) {
    .page-transition,
    .slide-enter-left,
    .slide-enter-right,
    .slide-exit-left,
    .slide-exit-right,
    .fade-in,
    .fade-out,
    .scale-in,
    .scale-out,
    .rotate-in,
    .bounce-in,
    .shake,
    .wobble,
    .flip-in-x,
    .flip-in-y {
        animation-duration: 0.01ms;
        animation-iteration-count: 1;
        transition-duration: 0.01ms;
    }
    
    .scroll-reveal,
    .scroll-reveal-left,
    .scroll-reveal-right {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* 移动设备优化 */
@media (max-width: 768px) {
    .page-transition,
    .slide-enter-left,
    .slide-enter-right,
    .slide-exit-left,
    .slide-exit-right {
        animation-duration: 0.3s;
    }
    
    .loader-logo {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .loader-text {
        font-size: 1rem;
    }
    
    .loader-progress {
        width: 150px;
    }
}

/* 高性能动画 */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform, opacity;
}

/* 动画性能优化 */
.animate-transform {
    will-change: transform;
}

.animate-opacity {
    will-change: opacity;
}

.animate-auto {
    will-change: auto;
} 