/* 页面转场动画 */
body {
    opacity: 0;
    transition: opacity 0.5s ease;
}

body.page-loaded {
    opacity: 1;
}

body.page-exit {
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* 滚动进度条 */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(to right, var(--main-color), var(--accent-color));
    z-index: 1002;
    transition: width 0.2s ease;
}

/* 淡入动画效果 */
.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    animation: fadeInSection 0.8s forwards;
}

@keyframes fadeInSection {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 打字效果 */
.typed-text {
    opacity: 0;
    border-right: 2px solid var(--main-color);
    overflow: hidden;
    white-space: nowrap;
    margin: 0 auto;
    letter-spacing: 0.15em;
}

.typed-text.typing-complete {
    border-right: 0;
    transition: border-right 0.5s ease;
}

/* 图片懒加载效果 */
.lazy {
    opacity: 0;
    transition: opacity 1s ease, transform 1s ease;
    transform: scale(0.95);
}

.loaded {
    opacity: 1;
    transform: scale(1);
}

/* 颜色渐变文本 */
.gradient-animate {
    background: linear-gradient(270deg, var(--main-color), var(--accent-color), var(--main-color));
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: shine 4s linear infinite;
    display: inline-block;
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

/* 按钮脉冲动画 */
.btn-pulse {
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% {
        box-shadow: 0 0 0 0 rgba(94, 114, 228, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(94, 114, 228, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(94, 114, 228, 0);
    }
}

/* 闪烁动画 */
.blink {
    animation: blink-animation 1s steps(5, start) infinite;
}

@keyframes blink-animation {
    to {
        visibility: hidden;
    }
}

/* 弹跳动画 */
.bounce-in {
    animation: bounceIn 0.6s;
    transform-origin: center bottom;
}

@keyframes bounceIn {
    from, 20%, 40%, 60%, 80%, to {
        animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
    }
    0% {
        opacity: 0;
        transform: scale3d(0.3, 0.3, 0.3);
    }
    20% {
        transform: scale3d(1.1, 1.1, 1.1);
    }
    40% {
        transform: scale3d(0.9, 0.9, 0.9);
    }
    60% {
        opacity: 1;
        transform: scale3d(1.03, 1.03, 1.03);
    }
    80% {
        transform: scale3d(0.97, 0.97, 0.97);
    }
    to {
        opacity: 1;
        transform: scale3d(1, 1, 1);
    }
}

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

.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: 10px;
    overflow: hidden;
}

.flip-card-front {
    background-color: #fff;
    color: var(--text-color);
}

.flip-card-back {
    background: var(--gradient);
    color: var(--light-text);
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

/* 震荡效果 */
.shake-animation {
    animation: shake 0.82s cubic-bezier(.36,.07,.19,.97) both;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}

@keyframes shake {
    10%, 90% {
        transform: translate3d(-1px, 0, 0);
    }
    
    20%, 80% {
        transform: translate3d(2px, 0, 0);
    }
    
    30%, 50%, 70% {
        transform: translate3d(-4px, 0, 0);
    }
    
    40%, 60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* 旋转加载 */
.rotating {
    animation: rotating 2s linear infinite;
}

@keyframes rotating {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 悬停图片放大效果 */
.zoom-container {
    overflow: hidden;
    border-radius: 10px;
}

.zoom-container img {
    transition: transform 0.5s ease;
}

.zoom-container:hover img {
    transform: scale(1.1);
}

/* 进度条动画 */
.animate-progress .progress-bar-fill {
    width: 0;
    transition: width 1.5s ease-in-out;
}

/* 渐变边框 */
.gradient-border {
    position: relative;
    border-radius: 10px;
    padding: 3px;
    background: linear-gradient(60deg, var(--main-color), var(--accent-color));
}

.gradient-border:before {
    content: '';
    position: absolute;
    top: 1px;
    right: 1px;
    bottom: 1px;
    left: 1px;
    background: #fff;
    border-radius: 9px;
}

.gradient-border-content {
    position: relative;
    z-index: 1;
    padding: 1.5rem;
}

/* 弹性动画 */
.elastic {
    animation: elastic 1s;
}

@keyframes elastic {
    0% {
        transform: scale(0);
    }
    55% {
        transform: scale(1.1);
    }
    70% {
        transform: scale(0.95);
    }
    85% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* 滑动效果 */
.slide-in-left {
    animation: slideInLeft 0.5s forwards;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 文本高亮动画 */
.highlight-text {
    position: relative;
    display: inline-block;
}

.highlight-text:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0.3em;
    background-color: rgba(94, 114, 228, 0.3);
    z-index: -1;
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.5s ease;
}

.highlight-text:hover:after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* 移动悬停效果 */
.hover-float {
    transition: transform 0.3s ease;
}

.hover-float:hover {
    transform: translateY(-8px);
}

/* 移动鼠标跟随效果 */
.cursor-follow {
    position: relative;
    z-index: 1;
}

.cursor-follow:before {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    background: var(--main-color);
    border-radius: 50%;
    z-index: -1;
    opacity: 0.3;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: width 0.3s, height 0.3s, opacity 0.3s;
}

.cursor-follow:hover:before {
    width: 100px;
    height: 100px;
    opacity: 0.2;
}

/* 响应式调整 */
@media screen and (max-width: 768px) {
    .scroll-progress {
        height: 2px;
    }
} 