/* 全局样式 */
body {
    font-family: 'Microsoft YaHei', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
}

header {
    background-color: #00a1d6;
    color: white;
    padding: 10px;
    text-align: center;
}

footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 10px;
    position: fixed;
    bottom: 0;
    width: 100%;
}

/* 布局 */
.content-container {
    display: flex;
    width: 100%;
    min-height: calc(100vh - 100px);
}

.left-sidebar, .right-sidebar {
    width: 15%;
    padding: 10px;
    background-color: #fff;
    border: 1px solid #ddd;
}

.main-content {
    width: 70%;
    padding: 10px;
    background-color: #fff;
    border: 1px solid #ddd;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* 视频容器 */
.video-container {
    position: relative;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

#videoPlayer {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

/* 视频控件 */
.video-controls {
    position: static;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 10px 5px 10px 5px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    opacity: 1;
    z-index: 2;
}

.video-container:hover .video-controls,
.video-container.show-controls .video-controls {
    opacity: 1;
}

.control-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.3s;
}

.control-btn:hover {
    background-color: rgba(255,255,255,0.2);
}

.control-select {
    background-color: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 5px;
    border-radius: 4px;
}

.progress-bar, .volume-bar {
    flex: 1;
    height: 5px;
    background: rgba(255,255,255,0.3);
    outline: none;
    border-radius: 2px;
}

.progress-bar::-webkit-slider-thumb, .volume-bar::-webkit-slider-thumb {
    appearance: none;
    width: 15px;
    height: 15px;
    background: #00a1d6;
    border-radius: 50%;
    cursor: pointer;
}

/* 弹幕容器 */
.danmu-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.danmu {
    position: absolute;
    white-space: nowrap;
    pointer-events: none;
    animation: scrollDanmu linear forwards;
    font-weight: bold;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}

@keyframes scrollDanmu {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(-100%);
    }
}

/* 弹幕控件 */
.danmu-controls {
    background-color: rgba(0,0,0,0.8);
    padding: 10px 5px 10px 5px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    opacity: 1;
    z-index: 2;
    transition: opacity 0.3s;
}

.video-container:hover .danmu-controls {
    opacity: 1;
}

.danmu-controls input[type="text"] {
    flex: 1;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.danmu-controls button {
    padding: 5px 10px;
    background-color: #00a1d6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.danmu-controls select {
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.danmu-controls label {
    color: white;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.danmu-controls input[type="range"] {
    width: 60px;
}

/* 播放列表 */
#playlist {
    list-style: none;
    padding: 0;
}

#playlist li {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #ddd;
    transition: background 0.3s;
}

#playlist li:hover, #playlist li.active {
    background-color: #00a1d6;
    color: white;
}

/* 响应式设计 */
@media (max-width: 900px) {
    .content-container {
        flex-direction: column;
    }
    .left-sidebar, .right-sidebar {
        width: 100%;
        order: 2;
    }
    .main-content {
        width: 100%;
        order: 1;
    }
    .video-container {
        max-width: 100vw;
        aspect-ratio: 16 / 9;
        min-height: 200px;
    }
    .video-controls, .danmu-controls {
        flex-direction: column;
        gap: 5px;
        align-items: stretch;
        padding: 8px 2px 8px 2px;
    }
    .danmu-controls input[type="range"] {
        width: 100%;
    }
    .video-controls button, .video-controls select, .danmu-controls button, .danmu-controls select {
        font-size: 16px;
        min-width: 40px;
        min-height: 32px;
    }
}