/* 页面特效样式 */

/* 页面加载时立即隐藏所有元素，避免闪烁 */
body:not(.initialized) .scale-container {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* 初始状态 - 隐藏所有元素 */
.initial-state .scale-container {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
}

/* 进入按钮样式 */
.enter-button {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50px;
    padding: 20px 40px;
    font-size: 24px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.enter-button:hover {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6);
}

.enter-button:active {
    transform: translate(-50%, -50%) scale(0.95);
}

/* 脉冲动画 */
@keyframes pulse {
    0% {
        box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 10px 30px rgba(102, 126, 234, 0.8), 0 0 0 20px rgba(102, 126, 234, 0.1);
    }
    100% {
        box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    }
}

/* 元素进入动画 */
.element-enter {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
    animation: elementSlideIn 0.8s ease-out forwards;
}

/* 元素滑入动画 */
@keyframes elementSlideIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    50% {
        opacity: 0.7;
        transform: translateY(-5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 光效渐变 */
.glow-effect {
    position: relative;
    overflow: hidden;
}

.glow-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: glowSweep 1.5s ease-out;
}

@keyframes glowSweep {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* 打字机效果 */
.typewriter {
    overflow: hidden;
    border-right: 2px solid #667eea;
    white-space: nowrap;
    animation: typing 3s 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: #667eea;
    }
}

/* 元素出现顺序 */
.element-1 { animation-delay: 0.1s; }
.element-2 { animation-delay: 0.3s; }
.element-3 { animation-delay: 0.5s; }
.element-4 { animation-delay: 0.7s; }
.element-5 { animation-delay: 0.9s; }
.element-6 { animation-delay: 1.1s; }
.element-7 { animation-delay: 1.3s; }
.element-8 { animation-delay: 1.5s; }

/* 背景渐变动画 - 紫色和蓝色 */
.background {
    background: linear-gradient(-45deg, #667eea, #764ba2, #8b5cf6, #3b82f6);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    z-index: -2;
}

/* 确保原背景图片显示 */
.background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/bg@3x.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.7;
    z-index: -1;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}



/* ===== 粒子效果容器 ===== */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* ===== 特效1: 快速星星移动 ===== */
.particle-fast {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: floatFast 3s ease-in-out infinite;
}

@keyframes floatFast {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-150px) rotate(720deg);
        opacity: 0;
    }
}

/* ===== 特效2: 流星效果 ===== */
.particle-meteor {
    position: absolute;
    width: 2px;
    height: 2px;
    background: linear-gradient(45deg, #fff, #667eea);
    border-radius: 50%;
    animation: meteor 4s linear infinite;
}

@keyframes meteor {
    0% {
        transform: translateX(-100px) translateY(-100px) rotate(45deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateX(calc(100vw + 100px)) translateY(calc(100vh + 100px)) rotate(45deg);
        opacity: 0;
    }
}

/* ===== 特效3: 闪烁星星 ===== */
.particle-twinkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    animation: twinkle 2s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.2;
        transform: scale(0.5);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* ===== 特效4: 波浪效果 ===== */
.particle-wave {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(102, 126, 234, 0.6);
    border-radius: 50%;
    animation: wave 5s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% {
        transform: translateY(0px) scale(1);
        opacity: 0.3;
    }
    25% {
        transform: translateY(-20px) scale(1.5);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-40px) scale(1);
        opacity: 0.5;
    }
    75% {
        transform: translateY(-20px) scale(1.5);
        opacity: 0.8;
    }
}

/* ===== 特效5: 旋转星星 ===== */
.particle-spin {
    position: absolute;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    animation: spin 4s linear infinite;
}

@keyframes spin {
    0% {
        transform: translateY(0px) rotate(0deg) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-120px) rotate(1440deg) scale(0.5);
        opacity: 0;
    }
}

/* ===== 特效6: 脉冲星星 ===== */
.particle-pulse {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: pulseStar 3s ease-in-out infinite;
}

@keyframes pulseStar {
    0%, 100% {
        transform: translateY(0px) scale(1);
        opacity: 0.3;
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    }
    50% {
        transform: translateY(-60px) scale(1.5);
        opacity: 1;
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
    }
}

/* ===== 特效7: 彩虹星星 ===== */
.particle-rainbow {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    animation: rainbow 6s ease-in-out infinite;
}

@keyframes rainbow {
    0% {
        background: #ff0000;
        transform: translateY(0px) scale(1);
        opacity: 0.7;
    }
    16.66% {
        background: #ff8000;
        transform: translateY(-20px) scale(1.2);
        opacity: 1;
    }
    33.33% {
        background: #ffff00;
        transform: translateY(-40px) scale(1);
        opacity: 0.7;
    }
    50% {
        background: #00ff00;
        transform: translateY(-60px) scale(1.2);
        opacity: 1;
    }
    66.66% {
        background: #0080ff;
        transform: translateY(-80px) scale(1);
        opacity: 0.7;
    }
    83.33% {
        background: #8000ff;
        transform: translateY(-100px) scale(1.2);
        opacity: 1;
    }
    100% {
        background: #ff0080;
        transform: translateY(-120px) scale(1);
        opacity: 0;
    }
}

/* ===== 特效8: 无特效 ===== */
.particle-none {
    display: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .enter-button {
        font-size: 20px;
        padding: 15px 30px;
    }
    
    .effects-selector {
        top: 10px;
        right: 10px;
        font-size: 12px;
        padding: 10px;
    }
}
