/* ==================== 全局变量 ==================== */
:root {
    --primary-color: #FF9500;
    --primary-light: #FFB649;
    --primary-dark: #E68600;
    --secondary-color: #1E88E5;
    --secondary-dark: #1565C0;
    --success-color: #4CAF50;
    --danger-color: #F44336;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --bg-primary: #F5F6F8;
    --bg-white: #FFFFFF;
    --border-color: #EEEEEE;
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.12);
    --radius-small: 4px;
    --radius-medium: 8px;
    --radius-large: 12px;
    --radius-full: 50%;
}

/* ==================== 重置样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
                 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    padding-bottom: 60px; /* 为底部导航留空间 */
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

/* ==================== 容器 ==================== */
.container {
    max-width: 100%;
    padding: 0 15px;
}

/* ==================== 顶部搜索栏 ==================== */
.search-header {
    background: var(--bg-white);
    padding: 10px 15px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-primary);
    border-radius: 20px;
    padding: 8px 15px;
    gap: 8px;
}

.search-box .search-icon {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

/* ==================== Banner 轮播 ==================== */
.banner-section {
    padding: 15px;
}

.banner-slide {
    width: 100%;
    border-radius: var(--radius-large);
    overflow: hidden;
    background: linear-gradient(135deg, #1a237e 0%, #0d47a1 50%, #1565c0 100%);
    position: relative;
    padding: 30px 20px;
    min-height: 160px;
}

.banner-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
}

.banner-content {
    position: relative;
    z-index: 1;
    color: white;
    text-align: center;
}

.banner-content h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.banner-content p {
    font-size: 16px;
    opacity: 0.9;
}

/* ==================== 分类图标网格 ==================== */
.category-section {
    background: var(--bg-white);
    padding: 20px 15px;
    margin-bottom: 10px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.category-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.category-icon:hover {
    transform: scale(1.1);
}

.category-icon svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.category-icon.green { background: linear-gradient(135deg, #43A047, #66BB6A); }
.category-icon.blue { background: linear-gradient(135deg, #1E88E5, #42A5F5); }
.category-icon.cyan { background: linear-gradient(135deg, #00ACC1, #26C6DA); }
.category-icon.orange { background: linear-gradient(135deg, #FB8C00, #FFA726); }
.category-icon.teal { background: linear-gradient(135deg, #26A69A, #4DB6AC); }
.category-icon.purple { background: linear-gradient(135deg, #7E57C2, #9575CD); }
.category-icon.yellow { background: linear-gradient(135deg, #FDD835, #FFEE58); }

.category-name {
    font-size: 12px;
    color: var(--text-primary);
    text-align: center;
}

/* ==================== 新闻简报 ==================== */
.news-section {
    background: var(--bg-white);
    padding: 12px 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.news-tag {
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    color: white;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: var(--radius-small);
    white-space: nowrap;
}

.news-text {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==================== 课程区块 ==================== */
.course-section {
    background: var(--bg-white);
    padding: 15px;
    margin-bottom: 10px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.section-more {
    font-size: 14px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.section-more::after {
    content: '>';
    font-size: 12px;
}

/* ==================== 课程卡片网格 ==================== */
.course-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.course-card {
    background: var(--bg-white);
    border-radius: var(--radius-medium);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: transform 0.2s, box-shadow 0.2s;
}

.course-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.course-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: var(--bg-primary);
    overflow: hidden;
}

.course-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-thumbnail .no-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
    color: var(--text-muted);
    font-size: 14px;
}

.course-info {
    padding: 10px;
}

.course-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    min-height: 40px;
}

.course-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.course-tag {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: var(--radius-small);
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
    background: transparent;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.course-price {
    color: var(--primary-color);
    font-weight: 600;
}

.course-count {
    color: var(--text-muted);
}

/* ==================== 横向课程卡片（直播样式） ==================== */
.course-card-horizontal {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--bg-white);
    border-radius: var(--radius-medium);
    margin-bottom: 12px;
}

.course-card-horizontal .course-thumb {
    width: 140px;
    height: 90px;
    flex-shrink: 0;
    border-radius: var(--radius-medium);
    overflow: hidden;
    background: var(--bg-primary);
}

.course-card-horizontal .course-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-card-horizontal .course-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.course-card-horizontal .course-title {
    font-size: 15px;
    margin-bottom: 8px;
    -webkit-line-clamp: 2;
}

.live-tag {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-small);
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
    margin-bottom: 6px;
}

/* ==================== 底部导航栏 ==================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-white);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 4px 20px;
    color: var(--text-muted);
    transition: color 0.2s;
}

.nav-item.active {
    color: var(--secondary-color);
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

.nav-item span {
    font-size: 11px;
}

/* ==================== 视频详情页 ==================== */
.detail-container {
    background: var(--bg-white);
}

.video-preview-wrapper {
    width: 100%;
    background: #000;
}

.video-preview-wrapper img {
    width: 100%;
    height: auto;
}

.detail-content {
    padding: 15px;
}

.detail-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.detail-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.play-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 20px;
}

.play-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 149, 0, 0.4);
}

.play-button svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.auth-warning {
    background: #FFF8E1;
    border: 1px solid #FFE082;
    border-radius: var(--radius-medium);
    padding: 15px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #F57C00;
}

.instructor-section {
    margin-top: 20px;
}

.instructor-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
}

.instructor-card {
    display: flex;
    gap: 12px;
    padding: 15px;
    background: var(--bg-primary);
    border-radius: var(--radius-medium);
}

.instructor-avatar {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    object-fit: cover;
    background: var(--border-color);
}

.instructor-info h4 {
    font-size: 15px;
    margin-bottom: 4px;
}

.instructor-title {
    font-size: 13px;
    color: var(--text-muted);
}

.description-section {
    margin-top: 20px;
}

.description-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
}

.description-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ==================== 相关课程 ==================== */
.related-section {
    background: var(--bg-white);
    padding: 15px;
    margin-top: 10px;
}

.related-section h3 {
    font-size: 16px;
    margin-bottom: 15px;
}

/* ==================== 视频播放器页面 ==================== */
.player-container {
    background: var(--bg-white);
    min-height: 100vh;
}

.video-player {
    width: 100%;
    background: #000;
}

.video-player video {
    width: 100%;
    display: block;
}

.player-info {
    padding: 15px;
}

.player-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.player-meta {
    font-size: 13px;
    color: var(--text-muted);
}

/* ==================== 搜索结果页 ==================== */
.search-results {
    padding: 15px;
}

.search-result-header {
    margin-bottom: 15px;
}

.search-result-header h2 {
    font-size: 16px;
    color: var(--text-primary);
}

.search-result-header span {
    color: var(--primary-color);
}

/* ==================== 分类页面 ==================== */
.category-page-header {
    background: var(--bg-white);
    padding: 20px 15px;
    margin-bottom: 10px;
}

.category-page-header h1 {
    font-size: 20px;
    margin-bottom: 8px;
}

.category-page-header p {
    font-size: 14px;
    color: var(--text-muted);
}

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

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-muted);
}

/* ==================== 页脚（隐藏，使用底部导航） ==================== */
.footer {
    display: none;
}

/* ==================== 响应式设计 ==================== */

/* 平板及以上 */
@media (min-width: 768px) {
    body {
        padding-bottom: 0;
        background-color: #EBEEF5;
    }

    .main-content {
        max-width: 1200px;
        margin: 0 auto;
        padding: 20px;
    }

    .search-header {
        max-width: 1200px;
        margin: 0 auto;
        border-radius: 0 0 var(--radius-medium) var(--radius-medium);
    }

    .bottom-nav {
        display: none;
    }

    .category-grid {
        grid-template-columns: repeat(7, 1fr);
    }

    .course-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .course-card {
        border-radius: var(--radius-large);
    }

    .banner-section {
        padding: 20px 0;
    }

    .banner-slide {
        min-height: 200px;
        padding: 50px 30px;
    }

    .banner-content h2 {
        font-size: 28px;
    }

    .category-section {
        border-radius: var(--radius-medium);
        margin-bottom: 20px;
    }

    .category-icon {
        width: 60px;
        height: 60px;
    }

    .category-icon svg {
        width: 28px;
        height: 28px;
    }

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

    .news-section {
        border-radius: var(--radius-medium);
        margin-bottom: 20px;
    }

    .course-section {
        border-radius: var(--radius-medium);
        margin-bottom: 20px;
        padding: 20px;
    }

    .section-title {
        font-size: 20px;
    }

    .course-title {
        font-size: 15px;
    }

    .footer {
        display: block;
        background: #333;
        color: white;
        text-align: center;
        padding: 20px;
        margin-top: 0;
    }

    /* 详情页PC适配 */
    .detail-container {
        max-width: 900px;
        margin: 0 auto;
        border-radius: var(--radius-medium);
        overflow: hidden;
    }

    .detail-content {
        padding: 25px;
    }

    .detail-title {
        font-size: 24px;
    }

    .play-button {
        width: auto;
        padding: 14px 50px;
    }

    .related-section {
        max-width: 900px;
        margin: 20px auto;
        border-radius: var(--radius-medium);
    }

    /* 播放器PC适配 */
    .player-container {
        max-width: 900px;
        margin: 0 auto;
        border-radius: var(--radius-medium);
        overflow: hidden;
    }

    /* 搜索结果PC适配 */
    .search-results {
        max-width: 1200px;
        margin: 0 auto;
    }

    .category-page-header {
        max-width: 1200px;
        margin: 0 auto 20px;
        border-radius: var(--radius-medium);
    }
}

/* 大屏幕 */
@media (min-width: 1024px) {
    .course-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .banner-slide {
        min-height: 220px;
    }

    .banner-content h2 {
        font-size: 32px;
    }
}

/* 超大屏幕 */
@media (min-width: 1400px) {
    .main-content {
        max-width: 1400px;
    }

    .course-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ==================== 工具类 ==================== */
.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--secondary-color); }
.text-muted { color: var(--text-muted); }
.bg-white { background: var(--bg-white); }
.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }
