/* 动态背景系统样式 */

/* 全局背景容器 */
.dynamic-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

/* 背景图片层 */
.bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    /* 移除CSS transition，避免与animation冲突 */
}

/* 当前显示的背景层 */
.bg-layer.active {
    opacity: 1;
    /* 确保活动层在最上面 */
    z-index: 1;
}

/* 背景遮罩层 */
.bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
    z-index: 1;
}

/* 渐变遮罩效果 */
.bg-gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.15) 0%,
        rgba(0, 0, 0, 0.05) 50%,
        rgba(0, 0, 0, 0.15) 100%
    );
    z-index: 2;
}

/* 内容区域样式调整 */
body {
    position: relative;
    z-index: 1;
}

/* 确保内容在背景之上 */
.section {
    position: relative;
    z-index: 2;
}

/* 卡片和内容区域半透明效果 */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* 导航栏半透明效果 */
.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

/* 页脚半透明效果 */
.footer {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .bg-layer {
        background-attachment: scroll;
    }
    
    .card {
        background: rgba(255, 255, 255, 0.98);
    }
    
    .navbar {
        background: rgba(255, 255, 255, 0.95);
    }
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    .bg-overlay {
        background: rgba(0, 0, 0, 0.25);
    }
    
    .bg-gradient-overlay {
        background: linear-gradient(
            135deg,
            rgba(0, 0, 0, 0.3) 0%,
            rgba(0, 0, 0, 0.15) 50%,
            rgba(0, 0, 0, 0.3) 100%
        );
    }
    
    .card {
        background: rgba(30, 30, 30, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .navbar {
        background: rgba(30, 30, 30, 0.9);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .footer {
        background: rgba(30, 30, 30, 0.9);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* 背景切换动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* 淡入淡出过渡效果 - 优化时间和缓动 */
.fade-in {
    animation: fadeIn 1.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    z-index: 2;
}

.fade-out {
    animation: fadeOut 1.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    z-index: 0;
}

/* 滑动过渡效果 */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

.slide-in {
    animation: slideInLeft 1.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    z-index: 2;
}

.slide-out {
    animation: slideOutRight 1.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    z-index: 0;
}

/* 缩放过渡效果 */
@keyframes zoomIn {
    from {
        transform: scale(1.2);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

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

.zoom-in {
    animation: zoomIn 1.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    z-index: 2;
}

.zoom-out {
    animation: zoomOut 1.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    z-index: 0;
}

/* 旋转过渡效果 */
@keyframes rotateIn {
    from {
        transform: rotate(5deg) scale(1.1);
        opacity: 0;
    }
    to {
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }
}

@keyframes rotateOut {
    from {
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }
    to {
        transform: rotate(-5deg) scale(0.9);
        opacity: 0;
    }
}

.rotate-in {
    animation: rotateIn 1.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    z-index: 2;
}

.rotate-out {
    animation: rotateOut 1.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    z-index: 0;
}

/* 背景图片加载状态 */
.bg-layer.loading {
    opacity: 0;
}

.bg-layer.loaded {
    opacity: 1;
}

