/* 动态响应式渐变背景效果 - 优化版 */

/* 背景容器 */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

/* 动态背景层 - 白天主题 */
.background-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        #667eea 0%, 
        #764ba2 15%, 
        #8a2be2 25%, 
        #f093fb 40%, 
        #ff6b6b 50%, 
        #feca57 65%, 
        #48c9b0 80%, 
        #00b4d8 100%);
    background-size: 400% 400%;
    animation: gradientShift 20s ease infinite, floatingElements 15s ease-in-out infinite;
    opacity: 0.85;
    transition: all 0.5s ease;
    filter: saturate(1.2);
}

/* 白天主题背景动画 - 增强版 */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
        filter: saturate(1.2) brightness(1.0);
    }
    25% {
        filter: saturate(1.3) brightness(1.05);
    }
    50% {
        background-position: 100% 50%;
        filter: saturate(1.4) brightness(1.1);
    }
    75% {
        filter: saturate(1.3) brightness(1.05);
    }
    100% {
        background-position: 0% 50%;
        filter: saturate(1.2) brightness(1.0);
    }
}

/* 背景装饰元素 - 增强版 */
.background-layer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.4) 0%, transparent 30%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.3) 0%, transparent 25%),
        radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.2) 0%, transparent 35%);
    animation: floatingElements 15s ease-in-out infinite;
}

@keyframes floatingElements {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0.8;
    }
    25% {
        transform: translate(30px, -15px) rotate(2deg);
        opacity: 0.9;
    }
    50% {
        transform: translate(-20px, 25px) rotate(-1deg);
        opacity: 1.0;
    }
    75% {
        transform: translate(15px, 30px) rotate(1deg);
        opacity: 0.9;
    }
}

/* 新增背景装饰元素 - 光斑效果 */
.background-layer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 90% 40%, rgba(255, 255, 255, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 60% 90%, rgba(255, 255, 255, 0.06) 0%, transparent 50%);
    animation: lightSpot 25s ease-in-out infinite;
}

@keyframes lightSpot {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }
    33% {
        transform: translate(50px, -30px) scale(1.2);
        opacity: 0.5;
    }
    66% {
        transform: translate(-40px, 60px) scale(0.8);
        opacity: 0.4;
    }
}

/* 暗色主题背景 - 黑白动态响应式渐变 */
body.dark-theme .background-layer {
    background: linear-gradient(135deg, 
        #000000 0%, 
        #1a1a1a 15%, 
        #2d2d2d 30%, 
        #404040 50%, 
        #2d2d2d 70%, 
        #1a1a1a 85%, 
        #000000 100%);
    opacity: 0.8;
    animation: darkGradientShift 25s ease infinite;
}

/* 夜间主题背景动画 */
@keyframes darkGradientShift {
    0% {
        background-position: 0% 50%;
        filter: brightness(0.9);
    }
    25% {
        filter: brightness(1.0);
    }
    50% {
        background-position: 100% 50%;
        filter: brightness(1.1);
    }
    75% {
        filter: brightness(1.0);
    }
    100% {
        background-position: 0% 50%;
        filter: brightness(0.9);
    }
}

/* 夜间主题粒子动画 */
@keyframes floatParticle {
    0% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0.1;
    }
    25% {
        opacity: 0.3;
    }
    50% {
        transform: translate(100px, -50px) rotate(180deg);
        opacity: 0.1;
    }
    75% {
        opacity: 0.3;
    }
    100% {
        transform: translate(0, 0) rotate(360deg);
        opacity: 0.1;
    }
}

/* 响应式背景调整 - 增强版 */
@media (max-width: 768px) {
    .background-layer {
        background-size: 300% 300%;
        animation-duration: 15s;
        animation: gradientShift 15s ease infinite, floatingElements 12s ease-in-out infinite;
    }
    
    .background-layer::before {
        animation-duration: 12s;
    }
    
    .background-layer::after {
        animation-duration: 20s;
    }
}

@media (max-width: 480px) {
    .background-layer {
        background-size: 250% 250%;
        animation-duration: 12s;
        animation: gradientShift 12s ease infinite, floatingElements 10s ease-in-out infinite;
    }
    
    .background-layer::before {
        animation-duration: 10s;
        background-image: 
            radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.3) 0%, transparent 25%),
            radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.2) 0%, transparent 20%);
    }
    
    .background-layer::after {
        animation-duration: 15s;
        background-image: 
            radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 35%),
            radial-gradient(circle at 90% 40%, rgba(255, 255, 255, 0.06) 0%, transparent 40%);
    }
}

/* 平板设备优化 */
@media (min-width: 769px) and (max-width: 1024px) {
    .background-layer {
        background-size: 350% 350%;
        animation-duration: 18s;
    }
    
    .background-layer::before {
        animation-duration: 14s;
    }
    
    .background-layer::after {
        animation-duration: 22s;
    }
}

/* 大屏幕设备优化 */
@media (min-width: 1440px) {
    .background-layer {
        background-size: 450% 450%;
        animation-duration: 25s;
    }
    
    .background-layer::before {
        animation-duration: 18s;
    }
    
    .background-layer::after {
        animation-duration: 30s;
    }
}

/* 背景层交互效果 */
.background-layer:hover {
    opacity: 0.9;
}

/* 背景层加载动画 */
.background-layer {
    animation: fadeInBackground 1s ease-out;
}

@keyframes fadeInBackground {
    from {
        opacity: 0;
        transform: scale(1.1);
    }
    to {
        opacity: 0.8;
        transform: scale(1);
    }
}

/* 背景层主题切换动画 */
.background-layer.theme-transition {
    transition: background 0.8s ease, opacity 0.8s ease;
}

/* 背景层深度效果 */
.background-layer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0) 70%
    );
    pointer-events: none;
}