/* 现代化视频播放器样式 - 修复全屏按钮和进度条 */
.video-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.video-item {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 16/9;
    transition: all 0.3s ease;
    background: #000;
    /* 边框装饰 */
    border: 3px solid transparent;
    background:
            linear-gradient(45deg, #ff6b6b, #ffa500, #ffeb3b, #4caf50, #2196f3, #9c27b0, #ff6b6b);
    background-size: 400% 400%;
    padding: 3px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.video-item::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    background: #000;
    border-radius: 17px;
    z-index: 1;
}

.video-item:hover {
    animation: gradientBorder 3s ease infinite;
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

@keyframes gradientBorder {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 16px;
    position: relative;
    z-index: 2;
    /* 隐藏原生控制条 */
    &::-webkit-media-controls {
        display: none !important;
    }
    &::-webkit-media-controls-panel {
        display: none !important;
    }
    &::-webkit-media-controls-play-button {
        display: none !important;
    }
    &::-webkit-media-controls-timeline {
        display: none !important;
    }
    &::-webkit-media-controls-current-time-display {
        display: none !important;
    }
    &::-webkit-media-controls-time-remaining-display {
        display: none !important;
    }
    &::-webkit-media-controls-timeline-container {
        display: none !important;
    }
    &::-webkit-media-controls-volume-slider-container {
        display: none !important;
    }
    &::-webkit-media-controls-volume-slider {
        display: none !important;
    }
    &::-webkit-media-controls-seek-back-button {
        display: none !important;
    }
    &::-webkit-media-controls-seek-forward-button {
        display: none !important;
    }
    &::-webkit-media-controls-fullscreen-button {
        display: none !important;
    }
    &::-webkit-media-controls-rewind-button {
        display: none !important;
    }
    &::-webkit-media-controls-return-to-realtime-button {
        display: none !important;
    }
    &::-webkit-media-controls-toggle-closed-captions-button {
        display: none !important;
    }
}

/* 自定义控制条 */
.custom-controls {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    padding: 12px 16px;
    z-index: 3;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.video-item:hover .custom-controls,
.video-item.playing .custom-controls {
    opacity: 1;
    transform: translateY(0);
}

.controls-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.controls-bottom {
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    opacity: 0.8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    opacity: 1;
    transform: scale(1.1);
}

.time-display {
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0.8;
}

/* 修复进度条样式 - 减小阴影 */
.progress-container {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1); /* 减小阴影 */
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    overflow: visible;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #ffa500);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s ease;
    position: relative;
}

/* 进度条滑块 */
.progress-handle {
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); /* 减小阴影 */
}

.progress-container:hover .progress-handle {
    opacity: 1;
}

/* 中央播放按钮 */
.center-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 3;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.center-play-btn:hover {
    background: white;
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.video-item.playing .center-play-btn {
    opacity: 0;
    pointer-events: none;
}

/* 加载指示器 */
.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 3;
    display: none;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 全屏样式 */
.video-item:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    padding: 0;
    border: none;
    background: #000;
}

.video-item:-webkit-full-screen::before {
    display: none;
}

.video-item:-webkit-full-screen .video-player {
    border-radius: 0;
    object-fit: contain;
}

.video-item:-webkit-full-screen .custom-controls {
    bottom: 20px;
    left: 20px;
    right: 20px;
    opacity: 1;
}

.video-item:-moz-full-screen {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    padding: 0;
    border: none;
    background: #000;
}

.video-item:-moz-full-screen::before {
    display: none;
}

.video-item:-moz-full-screen .video-player {
    border-radius: 0;
    object-fit: contain;
}

.video-item:fullscreen {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    padding: 0;
    border: none;
    background: #000;
}

.video-item:fullscreen::before {
    display: none;
}

.video-item:fullscreen .video-player {
    border-radius: 0;
    object-fit: contain;
}

.video-item:fullscreen .custom-controls {
    bottom: 20px;
    left: 20px;
    right: 20px;
    opacity: 1;
}

/* 移动端适配 - 每行显示两个视频 */
@media (max-width: 768px) {
    .video-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 12px;
    }

    .video-item {
        border-radius: 16px;
        aspect-ratio: 4/3;
        border-width: 2px;
    }

    .video-item::before {
        top: 2px;
        left: 2px;
        right: 2px;
        bottom: 2px;
        border-radius: 14px;
    }

    .video-player {
        border-radius: 13px;
    }

    .center-play-btn {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }

    .custom-controls {
        padding: 8px 12px;
        bottom: 6px;
        left: 6px;
        right: 6px;
    }

    .control-btn {
        font-size: 0.9rem;
        padding: 4px;
    }

    .time-display {
        font-size: 0.7rem;
    }

    .progress-container {
        height: 3px;
    }

    .progress-handle {
        width: 10px;
        height: 10px;
        right: -5px;
    }
}

/* 超小屏幕适配 */
@media (max-width: 480px) {
    .video-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 8px;
    }

    .video-item {
        border-radius: 12px;
    }

    .video-item::before {
        border-radius: 10px;
    }

    .video-player {
        border-radius: 9px;
    }
}

/* 确保层级正确 */
.video-item * {
    box-sizing: border-box;
}