/* 分类页面样式 */

/* 页面内容区域 */
.main-content {
    margin-top: 0;
    margin-bottom: 60px;
    padding: 16px;
}

/* 搜索框 */
.search-box {
    display: flex;
    margin: 16px;
    gap: 12px;
    align-items: center;
    background: white;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.search-box input {
    flex: 1;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    background: #F7FAFC;
    transition: all 0.3s ease;
}

.search-box input:focus {
    background: white;
    border-color: #667EEA;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-box .search-btn {
    padding: 10px 16px;
    font-size: 14px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.search-box .search-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 分类筛选区域 */
.filter-section {
    margin: 0 16px 16px;
}

.filter-title {
    font-size: 16px;
    font-weight: 600;
    color: #2D3748;
    margin-bottom: 12px;
    padding-left: 4px;
}

.categories-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.categories-scroll::-webkit-scrollbar {
    display: none;
}

.category-item {
    flex-shrink: 0;
    background: white;
    padding: 10px 16px;
    border-radius: 20px;
    border: 1px solid #E2E8F0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.category-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.category-item.active {
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    color: white;
    border-color: #667EEA;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.category-name {
    font-size: 14px;
    font-weight: 500;
}

/* 排序选项区域 */
.sort-section {
    margin: 0 16px 16px;
}

.sort-title {
    font-size: 16px;
    font-weight: 600;
    color: #2D3748;
    margin-bottom: 12px;
    padding-left: 4px;
}

.sort-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.sort-item {
    background: white;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.sort-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.sort-item.active {
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    color: white;
    border-color: #667EEA;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.sort-name {
    font-size: 14px;
    font-weight: 500;
}

/* 课程列表容器 */
.courses-container {
    margin: 0 16px 70px;
}

/* 课程列表 */
.course-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

/* 课程卡片 */
.course-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 0;
}

.course-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.course-card .course-cover {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.course-card .course-info {
    padding: 12px;
}

/* 课程头部样式 - 标题和价格一行显示 */
.course-card .course-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.course-card .course-title {
    font-size: 14px;
    font-weight: 600;
    color: #2D3748;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 8px;
}

.course-card .price {
    font-size: 16px;
    font-weight: 600;
    color: #667EEA;
    white-space: nowrap;
}

/* 加载更多按钮 */
.load-more {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

.load-more-btn {
    padding: 12px 32px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 24px;
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.load-more-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #A0AEC0;
    text-align: center;
}

.empty-state .empty-icon {
    margin-bottom: 16px;
    opacity: 0.6;
    display: flex;
    justify-content: center;
    align-items: center;
}

.empty-state .empty-feather-icon {
    width: 48px;
    height: 48px;
    fill: currentColor;
    opacity: 0.6;
    margin-bottom: 16px;
}

.empty-state .empty-text {
    font-size: 14px;
    font-weight: 500;
}

/* 底部导航栏分类图标 - 已在style.css中统一更新，此处移除冗余定义 */

/* 返回按钮 */
.back-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    box-shadow: none;
    margin-right: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: none;
    box-shadow: none;
}

/* 骨架屏 */
.skeleton-course {
    margin-bottom: 0;
}

.skeleton-course .skeleton-cover {
    height: 120px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .course-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .course-card .course-cover {
        height: 110px;
    }
    
    .course-card .course-info {
        padding: 10px;
    }
    
    .course-card .course-title {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .sort-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .course-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .course-card .course-cover {
        height: 100px;
    }
    
    .course-card .course-title {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }
    
    .course-card .course-meta {
        font-size: 11px;
        margin-bottom: 6px;
    }
    
    .course-card .course-stats {
        font-size: 10px;
        gap: 8px;
        margin-bottom: 8px;
    }
    
    .course-card .price {
        font-size: 14px;
    }
    

}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.course-card {
    animation: fadeInUp 0.3s ease-out;
}

/* 分类项动画 */
.category-item {
    animation: fadeInUp 0.2s ease-out;
}

/* 排序项动画 */
.sort-item {
    animation: fadeInUp 0.2s ease-out;
}
