/* 页面加载动画 */
@keyframes fadeInUp {
    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 scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes glow {
    0% {
        box-shadow: 0 0 5px rgba(255, 111, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 111, 0, 0.6);
    }
    100% {
        box-shadow: 0 0 5px rgba(255, 111, 0, 0.3);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@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 rubberBand {
    0% {
        transform: scale(1);
    }
    30% {
        transform: scaleX(1.25) scaleY(0.75);
    }
    40% {
        transform: scaleX(0.75) scaleY(1.25);
    }
    60% {
        transform: scaleX(1.15) scaleY(0.85);
    }
    100% {
        transform: scale(1);
    }
}

/* 英雄区域动画 */
.hero-content {
    animation: fadeInUp 1s ease-out;
}

.hero-logo {
    animation: bounceIn 1.5s ease-out;
}

.game-title {
    animation: glow 2s ease-in-out infinite alternate;
}

.hero-slogan {
    animation: slideInUp 1s ease-out 0.5s both;
}

.scroll-indicator {
    animation: float 2s ease-in-out infinite;
}

/* 导航栏动画 */
.navbar {
    animation: slideInDown 0.8s ease-out;
}

.nav-logo .logo-text {
    animation: shimmer 3s linear infinite;
    background: linear-gradient(90deg, transparent, rgba(192, 192, 192, 0.4), transparent);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
}

/* 区域标题动画 */
.section-title {
    animation: fadeInUp 0.8s ease-out;
}

.section-title::after {
    animation: scaleIn 0.8s ease-out 0.3s both;
}

/* 游戏介绍区域动画 */
.intro-content {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.intro-text h3 {
    animation: fadeInLeft 0.8s ease-out 0.4s both;
}

.intro-text p {
    animation: fadeInLeft 0.8s ease-out 0.6s both;
}

.feature-item {
    animation: scaleIn 0.6s ease-out;
}

.feature-item:nth-child(1) {
    animation-delay: 0.8s;
}

.feature-item:nth-child(2) {
    animation-delay: 1s;
}

.feature-item:nth-child(3) {
    animation-delay: 1.2s;
}

.feature-item:nth-child(4) {
    animation-delay: 1.4s;
}

.intro-image {
    animation: fadeInRight 0.8s ease-out 0.4s both;
}

/* 职业卡片动画 */
.career-card {
    animation: scaleIn 0.8s ease-out;
}

.career-card:nth-child(1) {
    animation-delay: 0.2s;
}

.career-card:nth-child(2) {
    animation-delay: 0.4s;
}

.career-card:nth-child(3) {
    animation-delay: 0.6s;
}

.career-card:hover {
    animation: pulse 0.6s ease-in-out;
}

.career-icon {
    animation: float 3s ease-in-out infinite;
}

.career-card:nth-child(1) .career-icon {
    animation-delay: 0s;
}

.career-card:nth-child(2) .career-icon {
    animation-delay: 1s;
}

.career-card:nth-child(3) .career-icon {
    animation-delay: 2s;
}

.skill-tag {
    animation: fadeInUp 0.6s ease-out;
}

/* 时间轴动画 */
.timeline::before {
    animation: scaleIn 1s ease-out;
}

.timeline-item {
    animation: slideInUp 0.8s ease-out;
}

.timeline-item:nth-child(1) {
    animation-delay: 0.2s;
}

.timeline-item:nth-child(2) {
    animation-delay: 0.4s;
}

.timeline-item:nth-child(3) {
    animation-delay: 0.6s;
}

.timeline-item:nth-child(4) {
    animation-delay: 0.8s;
}

.timeline-item.active .timeline-date {
    animation: pulse 0.6s ease-in-out;
}

.timeline-content {
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

/* 相册动画 */
.gallery-container {
    animation: fadeInUp 0.8s ease-out;
}

.gallery-image {
    animation: scaleIn 0.8s ease-out;
}

.gallery-btn {
    animation: bounceIn 0.8s ease-out;
}

.gallery-btn:hover {
    animation: rubberBand 0.6s ease-in-out;
}

.indicator {
    animation: scaleIn 0.6s ease-out;
}

.indicator.active {
    animation: pulse 1s ease-in-out infinite;
}

/* 玩家寄语动画 */
.memory-card {
    animation: fadeInUp 0.8s ease-out;
}

.memory-card:nth-child(1) {
    animation-delay: 0.2s;
}

.memory-card:nth-child(2) {
    animation-delay: 0.4s;
}

.memory-card:nth-child(3) {
    animation-delay: 0.6s;
}

.memory-card:hover {
    animation: float 0.6s ease-in-out;
}

.player-name {
    animation: fadeInLeft 0.6s ease-out;
}

.memory-content p {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

/* 友情链接动画 */
.link-card {
    animation: slideInUp 0.8s ease-out;
}

.link-card:nth-child(1) {
    animation-delay: 0.2s;
}

.link-card:nth-child(2) {
    animation-delay: 0.4s;
}

.link-card:nth-child(3) {
    animation-delay: 0.6s;
}

.link-card:hover .link-icon {
    animation: rotate 0.6s ease-in-out;
}

.link-card:hover .link-arrow {
    animation: fadeInLeft 0.6s ease-in-out;
}

/* 页脚动画 */
.footer {
    animation: fadeInUp 0.8s ease-out;
}

.footer-text {
    animation: slideInUp 0.6s ease-out;
}

.footer-subtext {
    animation: slideInUp 0.6s ease-out 0.2s both;
}

/* 滚动触发动画类 */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

.animate-on-scroll.fade-in-left {
    transform: translateX(-30px);
}

.animate-on-scroll.fade-in-left.animated {
    transform: translateX(0);
}

.animate-on-scroll.fade-in-right {
    transform: translateX(30px);
}

.animate-on-scroll.fade-in-right.animated {
    transform: translateX(0);
}

.animate-on-scroll.scale-in {
    transform: scale(0.9);
}

.animate-on-scroll.scale-in.animated {
    transform: scale(1);
}

/* 图片加载动画 */
.image-placeholder {
    position: relative;
    overflow: hidden;
}

.image-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 2s infinite;
}

.image-placeholder.loaded::before {
    display: none;
}

/* 按钮点击动画 */
.btn-click-effect {
    animation: scaleIn 0.3s ease-out;
}

/* 卡片悬停动画增强 */
.career-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 111, 0, 0.1), transparent);
    transition: left 0.5s ease;
}

.career-card:hover::before {
    left: 100%;
}

/* 文字打字机效果 */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: #ff6f00;
    }
}

.typing-effect {
    overflow: hidden;
    border-right: 2px solid #ff6f00;
    white-space: nowrap;
    animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

/* 粒子效果动画 */
@keyframes particle-float {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) translateX(50px);
        opacity: 0;
    }
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #ff6f00;
    border-radius: 50%;
    animation: particle-float 3s linear infinite;
}

/* 响应式动画调整 */
@media (max-width: 768px) {
    .game-title {
        animation: bounceIn 1s ease-out;
    }
    
    .hero-content {
        animation: fadeInUp 0.8s ease-out;
    }
    
    .timeline-item {
        animation: slideInUp 0.8s ease-out;
    }
    
    .career-card {
        animation: scaleIn 0.8s ease-out;
    }
    
    .memory-card {
        animation: fadeInUp 0.8s ease-out;
    }
    
    .link-card {
        animation: slideInUp 0.8s ease-out;
    }
}

/* 性能优化 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .career-card,
    .memory-card,
    .link-card {
        border-width: 2px;
    }
    
    .skill-tag {
        border: 1px solid white;
    }
}

/* 暗色模式优化 */
@media (prefers-color-scheme: dark) {
    .image-placeholder {
        background: linear-gradient(135deg, rgba(26, 35, 126, 0.8), rgba(13, 27, 74, 0.8));
    }
}