/* 视频背景样式 */
.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1; /* 默认在内容背景上方 */
    pointer-events: none;
}

/* 首页特殊处理：视频在背景图片下方 */
body.home-page .video-background {
    z-index: -1;
}

/* 确保视频在所有内容之后 */
body {
    position: relative;
}

/* 首页：隐藏内容区域的背景图片，让视频显示出来 */
body.home-page.has-video-background .main-content {
    background-image: none !important;
    background: transparent !important;
}

/* 其他页面：确保内容在视频上方 */
body.has-video-background:not(.home-page) .main-content > *,
body.has-video-background:not(.home-page) header,
body.has-video-background:not(.home-page) footer {
    position: relative;
    z-index: 10;
}

/* 视频加载时的过渡效果 */
.video-background {
    opacity: 0;
    animation: fadeInVideo 1s ease-in forwards;
}

@keyframes fadeInVideo {
    to {
        opacity: 1;
    }
}

/* 移动设备优化 */
@media (max-width: 768px) {
    .video-background {
        /* 移动设备可能不支持自动播放，或者为了节省流量 */
        display: none;
    }
}

/* 视频控制按钮（可选） */
.video-control-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    transition: all 0.3s ease;
    z-index: 1000;
}

.video-control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.video-control-btn.hidden {
    display: none;
}
