/* 视频模态框样式 */
.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1;
}

.modal-content {
    position: relative;
    z-index: 2;
    background-color: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    max-width: 1200px;
    max-height: 90vh;
    width: 95%;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

/* 关闭按钮 */
.close-modal-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    width: 35px;
    height: 35px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-modal-btn:hover {
    background-color: rgba(255, 0, 0, 0.7);
    transform: scale(1.1);
}

/* 播放器容器 - 桌面端 */
.modal-player-wrapper {
    position: relative;
    height: 0;
    background-color: #000;
    flex-shrink: 0;
}

.modal-player-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* 视频信息区域 - 桌面端 */
.modal-video-info {
    padding: 20px;
    color: white;
    overflow-y: auto;
    max-height: 300px;
    background-color: #252525;
    flex: 1;
}

.modal-video-info h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.3;
}

.modal-video-info p {
    margin: 5px 0;
    font-size: 0.9rem;
    color: #aaa;
    line-height: 1.5;
}

/* 描述文本样式 */
.description-text {
    margin-top: 10px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #ccc;
}

/* 桌面端特定样式 */
@media (min-width: 769px) {
    .modal-content {
        max-width: 85vw;
        max-height: 80vh;
        width: auto;
        border-radius: 8px;
    }
    
    .modal-video-info {
        padding: 20px;
        max-height: 300px;
    }
    
    .modal-video-info h3 {
        font-size: 1.3rem;
    }
    
    .close-modal-btn {
        width: 35px;
        height: 35px;
        font-size: 24px;
    }
}

/* 移动端特定样式 - 最大化视频体验 */
@media (max-width: 768px) {
    .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 100vh !important;
        height: 100% !important;
        border-radius: 0 !important;
        flex-direction: column;
        display: flex;
    }
    
    .modal-player-wrapper {
        flex: 1;
        height: auto !important;
        min-height: calc(100vh - 150px);
    }
    
    .modal-video-info {
        padding: 10px !important;
        max-height: 120px !important;
        min-height: 100px;
        background-color: rgba(37, 37, 37, 0.95);
    }
    
    .modal-video-info h3 {
        font-size: 1rem;
        margin-bottom: 5px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .modal-video-info p {
        font-size: 0.8rem;
        margin: 3px 0;
    }
    
    .close-modal-btn {
        width: 40px;
        height: 40px;
        font-size: 24px;
        top: 15px;
        right: 15px;
        background-color: rgba(0, 0, 0, 0.8);
    }
    
    /* 移动端隐藏描述 */
    .modal-video-info .description-text {
        display: none !important;
    }
}

/* 横屏移动端优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-player-wrapper {
        min-height: calc(100vh - 80px);
    }
    
    .modal-video-info {
        max-height: 80px !important;
    }
}

/* 防止页面滚动 */
body.modal-open {
    overflow: hidden;
    touch-action: none;
}

/* 淡入动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 针对iOS设备的特殊处理 */
@supports (-webkit-touch-callout: none) {
    .video-modal {
        -webkit-backface-visibility: hidden;
    }
    
    .modal-content {
        -webkit-overflow-scrolling: touch;
    }
}

/* 确保iframe正确加载 */
.modal-player-container iframe {
    width: 100% !important;
    height: 100% !important;
    border: none;
    display: block;
}