/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    background: #0f0f0f;
    color: #e0e0e0;
    line-height: 1.6;
    min-height: 100vh;
}
a { color: #58a6ff; text-decoration: none; }
a:hover { color: #79c0ff; }
img { max-width: 100%; height: auto; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ── Header ── */
.header {
    background: #1a1a2e;
    border-bottom: 1px solid #2a2a3e;
    position: sticky; top: 0; z-index: 100;
}
.header .container {
    display: flex; align-items: center; justify-content: space-between;
    height: 56px;
}
.logo {
    font-size: 1.25rem; font-weight: 700; color: #e0e0e0 !important;
    letter-spacing: 0.5px;
}
.nav { display: flex; gap: 20px; }
.nav a { color: #8b949e; font-size: 0.9rem; }
.nav a:hover { color: #e0e0e0; }

/* ── Hero ── */
.hero {
    text-align: center; padding: 48px 16px 32px;
}
.hero h1 { font-size: 1.75rem; color: #f0f0f0; margin-bottom: 8px; }
.hero p { color: #8b949e; font-size: 1rem; }

/* ── Section ── */
.section { margin-bottom: 40px; }
.section h2 { font-size: 1.3rem; margin-bottom: 16px; color: #f0f0f0; }
.section h1 { font-size: 1.5rem; margin-bottom: 8px; color: #f0f0f0; }
.section-desc { color: #8b949e; margin-bottom: 20px; font-size: 0.9rem; }

/* ── Category Grid ── */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.category-card {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 24px 16px; background: #1a1a2e; border-radius: 10px;
    border: 1px solid #2a2a3e; transition: border-color 0.2s;
}
.category-card:hover { border-color: #58a6ff; }
.category-name { font-size: 1rem; font-weight: 600; color: #e0e0e0; }
.category-count { font-size: 0.8rem; color: #8b949e; margin-top: 4px; }

/* ── Video Grid ── */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.video-card {
    background: #1a1a2e; border-radius: 10px; overflow: hidden;
    border: 1px solid #2a2a3e; transition: transform 0.2s, border-color 0.2s;
}
.video-card:hover { transform: translateY(-2px); border-color: #58a6ff; }
.video-thumb {
    position: relative; width: 100%; padding-top: 56.25%;
    background-size: cover; background-position: center; background-color: #2a2a3e;
}
.video-thumb--placeholder {
    display: flex; align-items: center; justify-content: center;
}
.video-thumb--placeholder span {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem; color: #58a6ff; opacity: 0.6;
}
.video-info { padding: 12px; }
.video-title {
    font-size: 0.95rem; font-weight: 600; color: #e0e0e0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; line-height: 1.4; margin-bottom: 4px;
}
.video-meta { font-size: 0.8rem; color: #8b949e; }

/* ── Video Detail Page ── */
.video-player {
    position: relative; width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: #000; border-radius: 10px; overflow: hidden;
    margin-bottom: 20px;
}
.video-player iframe {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    border: none;
}
.video-detail { margin-bottom: 24px; }
.video-detail-title { font-size: 1.4rem; color: #f0f0f0; margin-bottom: 12px; }
.video-meta-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.video-badge {
    display: inline-block; padding: 3px 10px; border-radius: 4px;
    font-size: 0.8rem; background: #2a2a3e; color: #8b949e;
}
.video-badge--category { background: #1a3a5c; color: #58a6ff; }
.video-date { font-size: 0.85rem; color: #8b949e; }
.video-description { color: #b0b0b0; margin-bottom: 12px; font-size: 0.95rem; }

/* ── Tags ── */
.video-tags { margin-bottom: 20px; }
.video-tags strong { color: #8b949e; font-size: 0.9rem; }
.tag {
    display: inline-block; padding: 2px 10px; margin: 2px 4px 2px 0;
    border-radius: 4px; font-size: 0.8rem;
    background: #2a2a3e; color: #8b949e;
}
.tag:hover { background: #3a3a5e; color: #e0e0e0; }

/* ── Related Videos ── */
.related-videos h2 { font-size: 1.2rem; margin-bottom: 12px; }

/* ── Footer ── */
.footer {
    text-align: center; padding: 24px 0; margin-top: 40px;
    border-top: 1px solid #2a2a3e; color: #8b949e; font-size: 0.85rem;
}

/* ── Mobile ── */
@media (max-width: 640px) {
    .video-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .category-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .hero { padding: 32px 16px 24px; }
    .hero h1 { font-size: 1.4rem; }
    .video-detail-title { font-size: 1.1rem; }
}
