* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-card: #1a1a1a;
    --bg-hover: #252525;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #666666;
    --accent: #e50914;
    --accent-hover: #f40612;
    --border: #2a2a2a;
    --header-height: 60px;
    --max-width: 1400px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    height: 100%;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav a {
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s;
}

.nav a:hover,
.nav a.active {
    color: var(--text-primary);
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 15px;
    gap: 8px;
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 14px;
    width: 200px;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
}

/* Banner / Slider */
.banner {
    margin-top: var(--header-height);
    position: relative;
    height: 500px;
    overflow: hidden;
}

.banner-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.6s;
}

.banner-slide.active {
    opacity: 1;
}

.banner-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(10,10,10,0.9) 0%, rgba(10,10,10,0.4) 50%, transparent 100%);
}

.banner-content {
    position: absolute;
    bottom: 60px;
    left: 40px;
    max-width: 500px;
}

.banner-tag {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.banner-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.2;
}

.banner-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.banner-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: #fff;
    padding: 12px 28px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.2s;
}

.banner-btn:hover {
    background: var(--accent-hover);
}

.banner-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.banner-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: all 0.2s;
}

.banner-dot.active {
    background: var(--accent);
    width: 24px;
    border-radius: 5px;
}

/* Section */
.section {
    padding: 30px 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.section-title {
    font-size: 22px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 22px;
    background: var(--accent);
    border-radius: 2px;
}

.section-more {
    color: var(--text-secondary);
    font-size: 14px;
}

.section-more:hover {
    color: var(--accent);
}

/* Card Grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}

.card {
    cursor: pointer;
    transition: transform 0.2s;
    min-width: 0;
}

.card:hover {
    transform: translateY(-5px);
}

.card-poster {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
    background: var(--bg-card);
    min-height: 0;
}
.card-poster > div {
    position: absolute;
    top: 0;
    left: 0;
}

.card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.card:hover .card-poster img {
    transform: scale(1.05);
}

.card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--accent);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.card-score {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.7);
    color: #ffcc00;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.card-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.2s;
}

.card:hover .card-play {
    opacity: 1;
}

.card-play-icon {
    width: 50px;
    height: 50px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.card-title {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.card-title:hover {
    color: var(--accent);
}

.card-info {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Horizontal List */
.h-list {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
}

.h-list::-webkit-scrollbar {
    height: 4px;
}

.h-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.h-card {
    flex: 0 0 200px;
    scroll-snap-align: start;
}

.h-card .card-poster {
    aspect-ratio: 16/9;
}

/* Rank List */
.rank-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px 4px;
}

.rank-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 4px;
    border-radius: 6px;
    transition: background 0.2s;
    cursor: pointer;
}

.rank-item:hover {
    background: var(--bg-hover);
}

.rank-num {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
}

.rank-item:nth-child(1) .rank-num {
    color: #ff4d4f;
}

.rank-item:nth-child(2) .rank-num {
    color: #ff7a45;
}

.rank-item:nth-child(3) .rank-num {
    color: #ffa940;
}

.rank-title {
    flex: 1;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank-title:hover {
    color: var(--accent);
}

/* Two Column Layout */
.two-col {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
}

/* List Page */
.list-page {
    margin-top: var(--header-height);
    padding: 30px 0;
}

.list-header {
    margin-bottom: 20px;
}

.list-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.list-breadcrumb a:hover {
    color: var(--accent);
}

.list-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 20px;
}

/* Filter */
.filter {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-label {
    width: 60px;
    color: var(--text-secondary);
    font-size: 14px;
    flex-shrink: 0;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-option {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.filter-option:hover,
.filter-option.active {
    background: var(--accent);
    color: #fff;
}

/* List Grid */
.list-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn:hover,
.page-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Detail Page */
.detail-page {
    margin-top: var(--header-height);
    padding: 30px 0;
}

.detail-hero {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
}

.detail-poster {
    width: 280px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
}

.detail-poster img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.detail-info {
    flex: 1;
}

.detail-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 15px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.detail-tag {
    padding: 4px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-secondary);
}

.detail-desc {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 25px;
}

.detail-actions {
    display: flex;
    gap: 15px;
}

.btn-play {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: #fff;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-play:hover {
    background: var(--accent-hover);
}

.btn-fav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px 25px;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-fav:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Episode List */
.episode-section {
    margin-bottom: 30px;
}

.episode-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.episode-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.episode-btn {
    min-width: 80px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.episode-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
}

/* Play Page */
.play-page {
    margin-top: var(--header-height);
    padding: 20px 0;
}

.player-container {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.player-placeholder {
    text-align: center;
    color: var(--text-secondary);
}

.player-placeholder .icon {
    font-size: 80px;
    margin-bottom: 15px;
    color: var(--accent);
}

.play-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.play-title {
    font-size: 20px;
    font-weight: 600;
}

.play-nav {
    display: flex;
    gap: 10px;
}

.play-nav-btn {
    padding: 6px 15px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.play-nav-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Related Section */
.related-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 30px 0;
    margin-top: 50px;
}

.footer-content {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 14px;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-friends {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    margin-top: 20px;
}

.friends-title {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.friends-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.friends-list a {
    color: var(--text-muted);
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 4px;
    transition: all 0.2s;
}

.friends-list a:hover {
    color: var(--accent);
    background: var(--bg-hover);
}

/* Responsive */
@media (max-width: 1200px) {
    .card-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    .list-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .related-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 992px) {
    .card-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .list-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .two-col {
        grid-template-columns: 1fr;
    }
    .related-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .rank-list {
        grid-template-columns: 1fr;
    }
    .detail-hero {
        flex-direction: column;
    }
    .detail-poster {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .nav {
        display: none;
    }
    .mobile-menu-btn {
        display: block;
    }
    .nav.show {
        display: flex;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 20px;
        gap: 15px;
        border-bottom: 1px solid var(--border);
    }
    .search-box input {
        width: 120px;
    }
    .banner {
        height: 300px;
    }
    .banner-title {
        font-size: 24px;
    }
    .banner-content {
        left: 20px;
        bottom: 40px;
    }
    .card-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    .list-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .related-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .section-title {
        font-size: 18px;
    }
}

@media (max-width: 576px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .list-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .filter-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .detail-poster {
        width: 150px;
    }
    .detail-title {
        font-size: 24px;
    }
    .episode-btn {
        min-width: 60px;
    }
}

/* 平板/窄窗口下导航横向滚动，避免栏目名被压缩成竖排 */
@media (max-width: 1199px) {
    .nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap;
    }
    .nav::-webkit-scrollbar {
        display: none;
    }
    .nav a {
        white-space: nowrap;
    }
}
