/* ========== 基础重置 ========== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    color: #e8eaed;
    background: #0f1118;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #60a5fa;
    text-decoration: none;
}
a:hover { color: #93c5fd; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* ========== Header ========== */
.header {
    background: rgba(15, 17, 24, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 64px;
    padding-top: 8px;
    padding-bottom: 8px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.logo:hover { color: inherit; }

.logo-img {
    height: 32px;
    width: auto;
    border-radius: 6px;
}

.logo-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: #f0f2f5;
    letter-spacing: 0.5px;
}
.logo:hover .logo-text { color: #60a5fa; }

.logo-badge {
    font-size: 0.65rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #f97316, #ef4444);
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    line-height: 1.4;
}

.nav { display: flex; gap: 24px; }
.nav a {
    color: #9ca3af;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
}
.nav a:hover { color: #60a5fa; }

/* ========== Main ========== */
.main {
    flex: 1;
    padding-top: 0;
    padding-bottom: 60px;
}

/* ========== Hero ========== */
.hero-section {
    background: linear-gradient(135deg, #0f1118 0%, #1a1d2e 50%, #0f1118 100%);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 60px 0 50px;
    margin-bottom: 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(96,165,250,0.03) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    position: relative;
}

.hero-title {
    font-size: 2rem;
    font-weight: 800;
    color: #f0f2f5;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: #60a5fa;
    font-weight: 500;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.hero-line {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #60a5fa, #a78bfa);
    border-radius: 2px;
    margin: 16px auto 0;
}

/* ========== Footer ========== */
.footer {
    background: rgba(15, 17, 24, 0.8);
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 20px 0;
    text-align: center;
    color: #6b7280;
    font-size: 0.85rem;
}

/* ========== Page Header ========== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-header h1 { font-size: 1.6rem; color: #f0f2f5; }
.header-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.subtitle { color: #9ca3af; margin-top: 4px; }

/* ========== Breadcrumb ========== */
.breadcrumb {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 20px;
    padding: 8px 0;
}
.breadcrumb a { color: #60a5fa; }
.breadcrumb span { color: #d1d5db; }

/* ========== Course Card Grid ========== */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.course-card {
    background: rgba(255,255,255,0.04);
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.08);
    display: block;
    color: inherit;
    backdrop-filter: blur(4px);
    cursor: pointer;
}
.course-card:hover {
    transform: translateY(-6px);
    border-color: rgba(96,165,250,0.3);
    box-shadow: 0 12px 40px rgba(0,0,0,0.3), 0 0 20px rgba(96,165,250,0.05);
    color: inherit;
}

.course-cover {
    height: 170px;
    background-size: cover;
    background-position: center;
    background-color: rgba(255,255,255,0.04);
    transition: filter 0.3s;
}

.course-cover-hover {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.35);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 2;
}
.course-card:hover .course-cover-hover {
    opacity: 1;
}
.course-card { position: relative; }

.play-icon {
    font-size: 2.6rem;
    color: rgba(255,255,255,0.9);
    transition: transform 0.3s;
}
.course-card:hover .play-icon {
    transform: scale(1.2);
}

.course-info { padding: 18px 20px 20px; }

.course-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #f0f2f5;
    transition: color 0.2s;
}
.course-card:hover .course-title { color: #60a5fa; }

.course-meta {
    color: #6b7280;
    font-size: 0.82rem;
}

/* ========== Video Page ========== */
.video-page {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.video-main { flex: 1; min-width: 0; }

.video-player {
    background: #000;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid rgba(255,255,255,0.06);
}
.video-player video {
    display: block;
    max-height: 70vh;
    width: 100%;
}

.video-content {
    background: rgba(255,255,255,0.04);
    padding: 24px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
}
.video-content h1 {
    font-size: 1.3rem;
    color: #f0f2f5;
    margin-bottom: 0;
}

/* ========== Sidebar ========== */
.video-sidebar {
    width: 300px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.04);
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    padding: 20px;
    position: sticky;
    top: 84px;
}
.video-sidebar h3 {
    font-size: 0.95rem;
    color: #9ca3af;
    margin-bottom: 16px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sidebar-chapters { display: flex; flex-direction: column; gap: 4px; }

.sidebar-chapter {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    transition: all 0.15s;
    font-size: 0.88rem;
    color: #d1d5db;
}
.sidebar-chapter:hover {
    background: rgba(255,255,255,0.06);
    color: #60a5fa;
}
.sidebar-chapter.active {
    background: rgba(96,165,250,0.12);
    color: #60a5fa;
    border: 1px solid rgba(96,165,250,0.15);
}
.sidebar-chapter.active:hover { color: #60a5fa; }

.ch-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
    color: #6b7280;
}
.sidebar-chapter.active .ch-number {
    background: rgba(96,165,250,0.2);
    color: #60a5fa;
}
.ch-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-icon { font-size: 0.65rem; color: #6b7280; }
.sidebar-chapter.active .ch-icon { color: #60a5fa; }

/* ========== Empty State ========== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #6b7280;
}
.empty-state a { color: #60a5fa; }
.empty-state code {
    background: rgba(255,255,255,0.08);
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #f87171;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .course-grid { grid-template-columns: 1fr; }
    .video-page { flex-direction: column; }
    .video-sidebar {
        width: 100%;
        position: static;
    }
    .page-header { flex-direction: column; align-items: flex-start; }
    .header-inner { gap: 12px; }
    .hero-title { font-size: 1.5rem; }
    .hero-subtitle { font-size: 0.9rem; letter-spacing: 2px; }
}

.text-muted { color: #6b7280; }

/* ========== Video Modal ========== */
.video-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.video-modal.show {
    display: flex;
}

.video-modal-content {
    background: #0f1118;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.1);
    width: 100%;
    max-width: 960px;
    overflow: hidden;
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.video-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.video-modal-title {
    font-size: 1rem;
    font-weight: 600;
    color: #f0f2f5;
}

.video-modal-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s;
}
.video-modal-close:hover {
    color: #fff;
}

.video-modal-body {
    line-height: 0;
}
.video-modal-body video {
    display: block;
    max-height: 80vh;
}
