/* PC端Bilibili风格播放器样式 */

/* 播放器容器样式 */
#bilibili-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    cursor: default;
    user-select: none;
}

#bilibili-player video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* 加载动画 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 15;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #00a1d6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 控制栏样式 */
.bilibili-player-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10;
    padding: 20px 0 0;
}

.bilibili-player-controls.show {
    opacity: 1;
    visibility: visible;
}

/* 进度条区域 */
.progress-area {
    padding: 0 20px 15px;
}

.progress-bar-wrap {
    position: relative;
    height: 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.progress-bar-wrap::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.progress-buffer {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 3px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-played {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 3px;
    background: #00a1d6;
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s ease;
}

.progress-thumb {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: #00a1d6;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
}

.progress-bar-wrap:hover .progress-thumb {
    opacity: 1;
}

.progress-tooltip {
    position: absolute;
    bottom: 25px;
    left: 0;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

.progress-bar-wrap:hover .progress-tooltip {
    opacity: 1;
}

/* 控制栏 */
.control-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 15px;
    height: 40px;
}

.left-controls,
.right-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 控制按钮 */
.control-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.control-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.control-btn.play-pause svg {
    width: 20px;
    height: 20px;
}

/* 时间显示 */
.time-display {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    font-family: monospace;
    margin: 0 8px;
}

.time-separator {
    margin: 0 4px;
    opacity: 0.7;
}

/* 音量控制 */
.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-slider {
    position: relative;
    width: 60px;
    height: 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.volume-track {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.volume-fill {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 3px;
    background: #00a1d6;
    border-radius: 2px;
    width: 70%;
    transition: width 0.1s ease;
}

.volume-thumb {
    position: absolute;
    left: 70%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: #00a1d6;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.volume-slider:hover .volume-thumb {
    opacity: 1;
}

/* 下拉菜单 */
.dropdown {
    position: relative;
}

.dropdown-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
}

.dropdown-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.dropdown.active .dropdown-btn svg {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
    background: rgba(32, 32, 32, 0.95);
    border-radius: 6px;
    padding: 8px 0;
    min-width: 120px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 20;
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    padding: 8px 16px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dropdown-item.active {
    color: #00a1d6;
    background: rgba(0, 161, 214, 0.1);
}


/* 响应式控制 */
.more-controls {
    display: none;
}

/* 网页全屏 */
#bilibili-player.web-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: #000;
    border-radius: 0;
}

/* 画中画支持 */
#bilibili-player.pip-supported .pip-btn {
    display: flex !important;
}

/* 激活状态 */
.control-btn.active {
    color: #00a1d6;
}

.danmaku-btn.active {
    color: #00a1d6;
}

/* 小屏幕适配 */
@media (max-width: 768px) {
    .control-bar {
        padding: 0 15px 15px;
        gap: 8px;
    }
    
    .left-controls,
    .right-controls {
        gap: 8px;
    }
    
    .volume-control {
        display: none;
    }
    
    
    .more-controls {
        display: block;
    }
    
    .time-display {
        font-size: 12px;
        margin: 0 4px;
    }
}

/* 超小屏幕 */
@media (max-width: 480px) {
    .progress-area {
        padding: 0 15px 12px;
    }
    
    .control-bar {
        padding: 0 15px 12px;
        height: 36px;
    }
    
    .control-btn {
        min-width: 28px;
        height: 28px;
        padding: 6px;
    }
    
    .control-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .episodes-controls {
        display: none;
    }
    
    .speed-select {
        display: none;
    }
}