/* ========== 全局样式 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', sans-serif; background: #f5f5f5; }

/* ========== 导航栏样式 ========== */
.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Logo 样式 */
.nav-brand a {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
    text-decoration: none;
}

.nav-brand img {
    height: 28px;
    width: auto;
    display: block;
}

.nav-brand .logo-text {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
}

/* 导航链接 */
.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links a {
    color: #333;
    text-decoration: none;
}

.nav-links a:hover {
    color: #667eea;
}

/* 用户信息样式 */
.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logout-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 20px;
    cursor: pointer;
}

/* 通用容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
}

/* 通用按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-outline {
    border: 2px solid white;
    color: white;
    background: transparent;
}

/* 课程卡片样式 */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin: 0 30px 40px;
}

.course-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s;
    cursor: pointer;
}

.course-card:hover {
    transform: translateY(-5px);
}

.course-cover {
    height: 140px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}

.course-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff6b6b;
    color: white;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
}

.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255,255,255,0.3);
}

.progress-fill {
    height: 100%;
    background: #4caf50;
    width: 0%;
}

.course-info {
    padding: 20px;
}

.course-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.course-desc {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.4;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #999;
}

.course-price {
    color: #ff6b6b;
    font-weight: 600;
    font-size: 18px;
}

.free-badge {
    color: #4caf50;
    font-weight: 600;
}

/* 返回链接 */
.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #667eea;
    text-decoration: none;
}

/* 加载和空状态 */
.loading, .empty {
    text-align: center;
    padding: 50px;
    color: #666;
}

.empty-state {
    text-align: center;
    padding: 60px;
    background: white;
    border-radius: 20px;
}

/* 章节样式 */
.section {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.section-title {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 课时列表样式 */
.lesson-list {
    list-style: none;
}

.lesson-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}

.lesson-item:hover {
    background: #f8f9fa;
}

.lesson-title {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.lesson-title:hover {
    background: #f8f9ff;
    transform: translateX(4px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.lesson-status {
    font-size: 18px;
}

.lesson-status.completed {
    color: #4caf50;
}

/* 页脚 */
.footer {
    background: #2c3e50;
    color: white;
    padding: 40px;
    text-align: center;
    margin-top: 40px;
}

/* 响应式 */
@media (max-width: 768px) {
    .navbar {
        padding: 12px 20px;
        flex-wrap: wrap;
        gap: 10px;
    }
    .container {
        padding: 20px;
    }
    .course-grid {
        grid-template-columns: 1fr;
        margin: 0 20px 30px;
    }
    .hero h1 {
        font-size: 32px;
    }
}