/* ========================================
   CJplayer 播放器样式
   ======================================== */

.play-page .main-content { padding: 0; }
.play-page .container { max-width: 1400px; }

.play-container {
    display: flex; gap: 20px; align-items: flex-start;
    padding: 20px 0;
}

/* ===== 播放器区域 ===== */
.player-section { flex: 1; min-width: 0; }

.video-player-wrapper {
    background: #000; border-radius: var(--radius-md); overflow: hidden;
    margin-bottom: 16px; box-shadow: var(--shadow-lg);
    position: relative;
}

.video-player {
    position: relative; width: 100%; aspect-ratio: 16/9;
    background: #000; overflow: hidden;
}

.video-player iframe,
.video-player video {
    width: 100%; height: 100%; border: 0; display: block;
}

/* 加载提示 */
.player-loading {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.85); color: #fff; z-index: 10;
    gap: 12px;
}
.loading-spinner {
    width: 40px; height: 40px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.player-loading p { font-size: 0.95rem; }
.loading-detail { font-size: 0.8rem; color: rgba(255,255,255,0.6); }

/* 错误提示 */
.player-error {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.9); color: #fff; z-index: 10;
    gap: 12px; padding: 20px; text-align: center;
}
.error-icon { font-size: 3rem; }
.error-hint { font-size: 0.82rem; color: rgba(255,255,255,0.6); }

/* ===== 影片信息 ===== */
.video-info { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; margin-bottom: 16px; transition: background-color .3s ease, border-color .3s ease; }
.video-title { font-size: 1.3rem; font-weight: 700; color: var(--text-main); margin-bottom: 10px; }
.video-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.meta-tag {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: var(--radius-sm);
    background: var(--bg-hover); color: var(--text-second); font-size: 0.82rem;
}
.tag-m3u8 { background: var(--warning-soft); color: var(--warning); }
.tag-direct { background: var(--success-soft); color: var(--success); }

.video-desc { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.video-desc h3 { font-size: 0.95rem; color: var(--text-second); margin-bottom: 8px; }
.video-desc p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.7; }

/* 观看进度条 */
.watch-progress-bar { margin-top: 14px; }
.progress-label { display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 4px; }
.progress-track { width: 100%; height: 6px; background: var(--bg-hover); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #8b5cf6); border-radius: 3px; transition: width .3s ease; }

/* ===== 集数列表 ===== */
.episode-section { width: 340px; flex-shrink: 0; max-height: 85vh; overflow-y: auto; padding-right: 4px; }
.episode-section::-webkit-scrollbar { width: 6px; }
.episode-section::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.play-line { margin-bottom: 18px; }
.line-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.line-header h3 { font-size: 0.95rem; color: var(--text-main); display: flex; align-items: center; gap: 6px; }
.line-type-badge { font-size: 0.7rem; padding: 1px 6px; border-radius: 3px; font-weight: 600; }
.line-type-m3u8 { background: var(--warning-soft); color: var(--warning); }
.line-type-direct { background: var(--success-soft); color: var(--success); }
.ep-count { font-size: 0.78rem; color: var(--text-muted); }

.episode-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.episode-btn {
    display: flex; align-items: center; justify-content: center;
    padding: 8px 4px; border-radius: var(--radius-sm);
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text-second); font-size: 0.82rem;
    transition: var(--t); text-decoration: none;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.episode-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.episode-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }

/* ===== 播放页响应式 ===== */
@media (max-width: 992px) {
    .play-container { flex-direction: column; }
    .episode-section { width: 100%; max-height: none; }
    .episode-grid { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 576px) {
    .video-player { aspect-ratio: 16/9; }
    .episode-grid { grid-template-columns: repeat(4, 1fr); }
    .video-title { font-size: 1.1rem; }
    .video-info { padding: 14px; }
}
