/* 全局重置和基础样式 - 采用手机优先设计 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 密码验证覆盖层样式 */
.password-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.password-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.password-container h2 {
        color: white;
        margin-bottom: 20px;
        font-size: 1.8rem;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }

    #passwordInput {
        width: 100%;
        padding: 12px 20px;
        margin-bottom: 20px;
        border: none;
        border-radius: 50px;
        font-size: 1.2rem;
        background-color: rgba(255, 255, 255, 0.95);
        color: #2c3e50;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#passwordInput:focus {
    outline: none;
    background-color: white;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.submit-button {
    background-color: #ffd700;
    color: #2c3e50;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.submit-button:hover {
    background-color: #ffed4e;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.submit-button:active {
    transform: translateY(0);
}

.error-message {
    color: #ff6b6b;
    margin-top: 15px;
    font-size: 0.9rem;
    min-height: 20px;
}

/* 响应式设计 - 手机屏幕适配 */
@media (max-width: 480px) {
    .password-container {
        padding: 25px 20px;
        width: 95%;
    }
    
    .password-container h2 {
        font-size: 1.5rem;
    }
    
    #passwordInput {
        font-size: 1rem;
        padding: 10px 15px;
    }
    
    .submit-button {
        padding: 10px 20px;
        font-size: 1rem;
    }
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
    color: #2c3e50;
    line-height: 1.6;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

/* 容器 - 基础样式为手机设计 */
.container {
    width: 100%;
    margin: 0;
    padding: 0;
}

/* 头部样式 */
.header {
    text-align: center;
    margin: 0;
    padding: 15px 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: none;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.2);
}

.title {
    font-size: 1.6rem;
    color: white;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    line-height: 1.3;
}

/* 主内容区 */
.main-content {
    background-color: white;
    padding: 0;
    margin: 0;
    box-shadow: none;
}

/* 视频和选集布局容器 - 默认垂直布局（手机优先）*/
.video-and-episodes {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* 视频部分 */
.video-section {
    width: 100%;
    order: 1;
}

/* 视频容器 - 标准16:9比例 */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 标准视频比例 */
    margin-bottom: 20px;
    background-color: #000;
    border-radius: 6px;
    overflow: hidden;
}

/* 视频播放器样式 - 确保正确显示和原生控制功能 */
#videoPlayer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 6px;
}

/* 视频信息 */
.video-info {
    padding: 15px;
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
}

#videoTitle {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

#videoDescription {
    font-size: 1rem;
    color: #666;
    line-height: 1.6;
}

/* 选集区域 */
.episode-container {
    width: 100%;
    padding: 15px;
    background-color: #fff;
    order: 2;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #2c3e50;
    display: flex;
    align-items: center;
}

.section-title::before {
    content: '📚';
    margin-right: 8px;
}

/* 选集列表 - 手机端默认不限制高度，让内容可以无限延伸 */
.episode-list {
    max-height: none;
    overflow-y: visible;
    padding: 5px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

/* 单元标题 */
.unit-title {
    font-size: 1.1rem;
    color: #2c3e50;
    margin: 15px 0 10px 0;
    padding: 8px 12px;
    background: linear-gradient(90deg, #667eea 0%, #667eea 5px, transparent 5px);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(102, 126, 234, 0.1);
}

/* 当前播放视频所在单元的标识样式 */
.unit-title.active-unit {
    background: linear-gradient(90deg, #2575fc 0%, #00d2ff 100%);
    box-shadow: 0 0 15px rgba(37, 117, 252, 0.5);
    border-left: 4px solid #ffd700;
}

.unit-title.active-unit .toggle-icon i {
    color: #ffd700;
}

.unit-title:hover {
    color: #667eea;
    background-position: 100% 0;
    background-size: 200% 100%;
}

/* 折叠图标样式 */
.toggle-icon {
    margin-right: 8px;
    transition: transform 0.3s ease;
    color: #667eea;
}

/* 折叠的单元列表样式 */
.unit-list.collapsed {
    display: none;
}

.unit-title:first-child {
    margin-top: 0;
}

.unit-list {
    margin-left: 10px;
    margin-bottom: 15px;
}

/* 选集列表项 */
.episode-item {
    display: flex;
    align-items: flex-start;
    padding: 12px;
    margin: 8px 5px;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.episode-item:hover {
    background-color: #f0f7ff;
    border-color: #3498db;
    transform: translateX(2px);
}

.episode-item.active {
    background-color: #e3f2fd;
    border-color: #3498db;
    box-shadow: 0 2px 5px rgba(52, 152, 219, 0.2);
}

/* 选中标记 */
.episode-checkmark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-right: 12px;
    border-radius: 50%;
    background-color: #ecf0f1;
    color: transparent;
    transition: all 0.3s ease;
}

.episode-item.active .episode-checkmark {
    background-color: #3498db;
    color: white;
}

/* 选集内容 */
.episode-content {
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

.episode-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
    white-space: normal;
}

.episode-description {
    font-size: 0.85rem;
    color: #7f8c8d;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 2px;
}

/* 滚动条样式 */
.episode-list::-webkit-scrollbar {
    width: 8px;
}

.episode-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.episode-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.episode-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 页脚样式 */
.footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    color: #666;
    font-size: 0.9rem;
}

/* 平板和桌面设备响应式设计 */
@media (min-width: 769px) {
    /* 容器样式调整 - 增加最大宽度并减少内边距 */
    .container {
        max-width: 1400px;
        margin: 0 auto;
        padding: 10px;
    }
    
    /* 标题样式调整 */
    .title {
        font-size: 2.5rem;
    }
    
    /* 主内容区样式 - 减少内边距 */
    .main-content {
        border-radius: 12px;
        padding: 15px;
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.1);
        background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    }
    
    /* 视频和选集水平布局 - 减少间距 */
    .video-and-episodes {
        flex-direction: row;
        gap: 20px;
        align-items: flex-start;
    }
    
    /* 视频部分占据主要空间 */
    .video-section {
        flex: 1;
        min-width: 0;
    }
    
    /* 选集区域固定宽度 - 略微减小宽度让视频区域更大 */
    .episode-container {
        width: 320px;
        flex-shrink: 0;
        padding: 0;
    }
    
    /* 视频容器样式调整 - 调整视频比例让视频更大 */
    .video-container {
        padding-bottom: 56.25%; /* 16:9 标准视频比例 */
        margin-bottom: 15px;
        background-color: #f8f9fa;
        border-radius: 8px;
        border: 1px solid #e0e0e0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }
    
    /* 桌面端视频播放器样式 */
    #videoPlayer {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border: none;
        border-radius: 6px;
    }
    
    /* 视频信息样式 */
    .video-info {
        margin-bottom: 20px;
        padding: 20px;
        background-color: #f8f9fa;
        border-radius: 8px;
        border-bottom: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }
    
    /* 标题和描述样式 */
    #videoTitle {
        font-size: 1.8rem;
        color: #667eea;
    }
    
    /* 选集列表高度调整 - 桌面端限制高度并显示滚动条 */
    .episode-list {
        max-height: calc(100vh - 250px);
        overflow-y: auto;
        padding: 10px;
    }
    
    /* 桌面端单元标题样式增强 */
    .unit-title {
        padding: 10px 15px;
        background: linear-gradient(90deg, #667eea 0%, #667eea 5px, transparent 5px);
    }
    
    /* 桌面端选集项样式增强 */
    .episode-item {
        padding: 12px 15px;
        transition: all 0.3s ease;
    }
    
    .episode-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 10px rgba(102, 126, 234, 0.15);
    }
    
    /* 桌面端选中状态增强 */
    .episode-item.active {
        background-color: #eef2ff;
        border-color: #667eea;
        box-shadow: 0 2px 10px rgba(102, 126, 234, 0.2);
    }
    
    /* 单元标题样式 */
    .unit-title {
        font-size: 1.2rem;
    }
    
    /* 选集列表项样式 */
    .episode-item {
        padding: 12px;
        margin-bottom: 8px;
        margin-left: 0;
        margin-right: 0;
    }
}

/* 平板设备进一步优化 */
@media (max-width: 1024px) and (min-width: 769px) {
    .episode-container {
        width: 300px;
    }
    
    .episode-list {
        max-height: 400px;
    }
}

/* 小屏幕手机优化 */
@media (max-width: 480px) {
    .title {
        font-size: 1.5rem;
    }
    
    #videoTitle {
        font-size: 1.2rem;
    }
    
    /* 确保小屏幕手机上选集列表也不限制高度 */
    .episode-list {
        max-height: none;
    }
}