* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

.filter-bar {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

#level-filter {
    width: 200px;
    padding: 10px;
    font-size: 1rem;
    border: 2px solid #667eea;
    border-radius: 5px;
    cursor: pointer;
}

.lesson-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.lesson-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.lesson-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0,0,0,0.2);
}

.lesson-level {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.lesson-title {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 10px;
}

.lesson-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

.loading {
    text-align: center;
    color: white;
    font-size: 1.2rem;
    padding: 40px;
}

.error {
    background: #ff6b6b;
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

footer {
    text-align: center;
    color: white;
    margin-top: 40px;
    padding: 20px;
    opacity: 0.8;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .lesson-list {
        grid-template-columns: 1fr;
    }
}

/* filter-bar 样式 */
.filter-bar {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.filter-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

/* 级别选择器 */
#level-filter {
    padding: 10px 16px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background-color: white;
    font-size: 16px;
    color: #333;
    min-width: 150px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#level-filter:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* 按钮容器 */
.filter-buttons {
    display: flex;
    gap: 10px;
    justify-content: right;
}

/* 图标按钮样式 */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: white;
    border: 1px solid #dee2e6;
    color: #666;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.icon-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* 一键播放按钮 */
.icon-btn.play-btn {
    /* display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    border: 2px solid #e0e0e0;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin: 0 5px; */
    color: #000;
    border-color: #000;
    background-color: rgba(231, 76, 60, 0.05);
}

.icon-btn.play-btn:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

/* 播放状态（默认） */
.icon-btn.play-btn .fa-play {
    display: inline-block;
}

.icon-btn.play-btn .fa-pause {
    display: none;
}

/* 暂停状态（当添加playing类时） */
.icon-btn.play-btn.playing {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: #667eea;
    color: white;
}

.icon-btn.play-btn.playing .fa-play {
    display: none;
}

.icon-btn.play-btn.playing .fa-pause {
    display: inline-block;
}

/* 活跃状态（正在播放的动画） */
.icon-btn.play-btn.playing::before {
    content: '';
    position: absolute;
    top: -3px;
    right: -3px;
    width: 8px;
    height: 8px;
    background: #48bb78;
    border-radius: 50%;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* 收藏按钮 */
.favorite-btn{
    color: #e74c3c;
    border-color: #e74c3c;
    background-color: rgba(231, 76, 60, 0.05);
}

/* 下载按钮 */
.download-btn {
    color: #34db50;
    border-color: #34db50;
    background-color: rgba(52, 152, 219, 0.05);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-buttons {
        align-self: flex-end;
        margin-top: 10px;
    }
    
    #level-filter {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .filter-buttons {
        align-self: center;
        margin-top: 15px;
    }
    
    .icon-btn {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}

/* 播放控制样式 */
#play-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: none;
}

#play-pause-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #3498db;
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#play-pause-btn:hover {
    background: #2980b9;
    transform: scale(1.05);
}

#play-pause-btn:active {
    transform: scale(0.95);
}

#now-playing {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    min-width: 120px;
    max-width: 200px;
    display: none;
    backdrop-filter: blur(5px);
}

#current-track {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 响应式调整 */
@media (max-width: 768px) {
    #play-controls {
        bottom: 80px;
        right: 15px;
    }
    
    #play-pause-btn {
        width: 56px;
        height: 56px;
        font-size: 22px;
    }
    
    #now-playing {
        bottom: 65px;
        max-width: 180px;
    }
}

/* 按钮悬停效果 */
#prev-btn:hover, #next-btn:hover {
    background: #e3f2fd !important;
    color: #1976d2 !important;
    transform: scale(1.05);
}

#prev-btn:active, #next-btn:active {
    transform: scale(0.95);
}

/* 禁用状态 */
#prev-btn:disabled, #next-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5 !important;
    color: #999 !important;
}

/* 播放模式指示器 */
.play-mode-indicator {
    position: fixed;
    bottom: 120px;
    right: 20px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 6px 10px;
    border-radius: 15px;
    font-size: 11px;
    z-index: 999;
}

.container {
    transition: margin-left 0.4s ease;
    padding-left: 20px;
    padding-right: 20px;
}

@media (min-width: 768px) {
    .sidebar-nav.open ~ .container {
        margin-left: 280px;
    }
}

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

.player-container {
    position: fixed;
    right: 20px;
    bottom: 50%;
    transform: translateY(50%);
    z-index: 999;
    transition: all 0.3s ease;
}

/* 圆形播放按钮 */
.player-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    border: none;
    color: white;
    font-size: 24px;
}

.player-circle:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.6);
}

.player-circle.playing .play-icon {
    display: none;
}

.player-circle.playing .pause-icon {
    display: block;
}

.player-circle .pause-icon {
    display: none;
}

/* 播放器展开面板 */
.player-expanded {
    width: 300px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    display: none;
    flex-direction: column;
}

.player-expanded.active {
    display: flex;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 播放器头部 */
.player-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.player-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-header .player-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.player-mode-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.player-mode-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.player-toggle-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.player-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.player-toggle-btn.open i {
    transform: rotate(180deg);
}

/* 播放器主体 */
.player-body {
    padding: 15px;
}

.player-title {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.current-song {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
}

.current-song .song-number {
    background: #667eea;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.current-song .song-title {
    flex: 1;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 播放器控制 */
.player-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: #f8f9fa;
}

.control-btn {
    background: #667eea;
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: #5a67d8;
    transform: scale(1.05);
}

.control-btn:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
}

.control-btn.prev,
.control-btn.next {
    background: #a0aec0;
}

.control-btn.prev:hover,
.control-btn.next:hover {
    background: #718096;
}

/* 播放列表 */
.playlist {
    max-height: 300px;
    overflow-y: auto;
    border-top: 1px solid #e2e8f0;
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f7fafc;
}

.playlist-item:hover {
    background: #f8f9fa;
}

.playlist-item.active {
    background: #e6fffa;
    border-left: 3px solid #38b2ac;
}

.playlist-item .item-number {
    color: #718096;
    font-size: 12px;
    min-width: 20px;
}

.playlist-item .item-title {
    flex: 1;
    font-size: 14px;
    color: #4a5568;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item .item-duration {
    color: #a0aec0;
    font-size: 12px;
}

/* 播放器底部 */
.player-footer {
    padding: 10px 15px;
    background: #f8f9fa;
    border-top: 1px solid #e2e8f0;
    font-size: 12px;
    color: #718096;
    text-align: center;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .player-container {
        right: 10px;
        bottom: 80px;
        transform: none;
    }
    
    .player-expanded {
        width: 280px;
        max-height: 80vh;
    }
    
    .player-circle {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    .player-expanded {
        background: rgba(26, 32, 44, 0.95);
        color: #e2e8f0;
    }
    
    .player-body,
    .playlist,
    .player-footer {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .player-title,
    .current-song .song-title,
    .playlist-item .item-title {
        color: #e2e8f0;
    }
    
    .current-song,
    .player-controls {
        background: #4a5568;
    }
    
    .playlist-item:hover {
        background: #4a5568;
    }
    
    .playlist-item.active {
        background: #2c7a7b;
        border-left-color: #38b2ac;
    }
    
    .playlist-item .item-number,
    .playlist-item .item-duration {
        color: #cbd5e0;
    }
    
    .player-footer {
        background: #4a5568;
        color: #cbd5e0;
    }
}

/* ==================== 类别选择弹窗样式 ==================== */

.category-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.category-modal .modal-content {
    background-color: white;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 25px 30px 15px 30px;
    border-bottom: 1px solid #e2e8f0;
    text-align: center;
}

.modal-header h3 {
    margin: 0 0 8px 0;
    color: #2d3748;
    font-size: 24px;
    font-weight: 600;
}

.modal-header h3 i {
    color: #667eea;
    margin-right: 10px;
}

.modal-subtitle {
    margin: 0;
    color: #718096;
    font-size: 14px;
}

.category-options {
    padding: 20px 30px;
    max-height: 400px;
    overflow-y: auto;
}

.category-option {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background-color: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.category-option:hover {
    background-color: #edf2f7;
    border-color: #cbd5e0;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.category-option.selected {
    background-color: #ebf8ff;
    border-color: #4299e1;
    border-width: 2px;
}

.category-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 18px;
    color: white;
}

.category-option[data-value="my-favorites"] .option-icon {
    background: linear-gradient(135deg, #f56565 0%, #ed8936 100%);
}

.category-option[data-value="local-downloads"] .option-icon {
    background: linear-gradient(135deg, #48bb78 0%, #38b2ac 100%);
}

.category-option[data-value="N5"] .option-icon {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
}

.category-option[data-value="N4"] .option-icon {
    background: linear-gradient(135deg, #667eea 0%, #5a67d8 100%);
}

.category-option[data-value="N3"] .option-icon {
    background: linear-gradient(135deg, #9f7aea 0%, #805ad5 100%);
}

.category-option[data-value="N2"] .option-icon {
    background: linear-gradient(135deg, #ed64a6 0%, #d53f8c 100%);
}

.category-option[data-value="N1"] .option-icon {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
}

.category-option[data-value="DM001"] .option-icon {
    background: linear-gradient(135deg, #38a169 0%, #276749 100%);
}

.option-content {
    flex: 1;
}

.option-title {
    display: block;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 4px;
    font-size: 16px;
}

.option-description {
    display: block;
    font-size: 13px;
    color: #718096;
}

.option-checkmark {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #cbd5e0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    transition: all 0.3s ease;
}

.category-option.selected .option-checkmark {
    background-color: #4299e1;
    border-color: #4299e1;
}

.category-option.selected .option-checkmark::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: white;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.modal-footer button {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-footer .btn-secondary {
    background-color: #e2e8f0;
    border: 1px solid #cbd5e0;
    color: #4a5568;
}

.modal-footer .btn-secondary:hover {
    background-color: #cbd5e0;
}

.modal-footer .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.modal-footer .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.modal-footer .btn-primary:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 响应式调整 */
@media (max-width: 600px) {
    .category-modal .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-header,
    .category-options,
    .modal-footer {
        padding: 20px;
    }
    
    .category-option {
        padding: 12px;
    }
    
    .option-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .option-title {
        font-size: 15px;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    .category-modal .modal-content {
        background-color: #2d3748;
        color: #e2e8f0;
    }
    
    .modal-header {
        border-bottom-color: #4a5568;
    }
    
    .modal-header h3 {
        color: #e2e8f0;
    }
    
    .modal-subtitle {
        color: #cbd5e0;
    }
    
    .category-option {
        background-color: #4a5568;
        border-color: #718096;
    }
    
    .category-option:hover {
        background-color: #5a67d8;
        border-color: #667eea;
    }
    
    .category-option.selected {
        background-color: #2c5282;
        border-color: #4299e1;
    }
    
    .option-title {
        color: #e2e8f0;
    }
    
    .option-description {
        color: #cbd5e0;
    }
    
    .option-checkmark {
        border-color: #718096;
    }
    
    .modal-footer {
        border-top-color: #4a5568;
    }
    
    .modal-footer .btn-secondary {
        background-color: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .modal-footer .btn-secondary:hover {
        background-color: #5a67d8;
    }
}