* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #111827;
    background: #f8fafc;
}

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

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

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(15, 23, 42, 0.94);
    color: #f8fafc;
    backdrop-filter: blur(16px);
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.22);
}

.nav-bar {
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 22px;
}

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.brand-mark {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, #ef4444, #f97316);
    box-shadow: 0 12px 30px rgba(239, 68, 68, 0.35);
}

.brand-text {
    white-space: nowrap;
    font-size: 20px;
    background: linear-gradient(135deg, #fca5a5, #fdba74);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 1;
    font-size: 15px;
}

.nav-links a {
    color: #d1d5db;
    transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.is-active {
    color: #fb7185;
}

.nav-search {
    display: flex;
    align-items: center;
    background: #1e293b;
    border-radius: 999px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-search input {
    width: 210px;
    border: 0;
    outline: 0;
    color: #fff;
    background: transparent;
    padding: 9px 12px;
}

.nav-search input::placeholder {
    color: #94a3b8;
}

.nav-search button,
.btn,
.player-cover {
    border: 0;
    cursor: pointer;
    font: inherit;
}

.nav-search button {
    padding: 8px 14px;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, #dc2626, #ea580c);
}

.nav-toggle {
    display: none;
    margin-left: auto;
    border: 0;
    color: #fff;
    background: transparent;
    font-size: 26px;
}

.hero {
    position: relative;
    min-height: 650px;
    overflow: hidden;
    color: #fff;
    background: #020617;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(1.02);
    transition: opacity 0.7s ease, transform 1.2s ease;
    background-size: cover;
    background-position: center;
}

.hero-slide.is-active {
    opacity: 1;
    transform: scale(1);
}

.hero-slide::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 72% 30%, rgba(248, 113, 113, 0.25), transparent 34%),
        linear-gradient(90deg, rgba(2, 6, 23, 0.95), rgba(15, 23, 42, 0.74) 52%, rgba(15, 23, 42, 0.2));
}

.hero-inner {
    position: relative;
    z-index: 2;
    min-height: 650px;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) 390px;
    align-items: center;
    gap: 42px;
    padding: 58px 0 68px;
}

.hero-label,
.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    border-radius: 999px;
    padding: 8px 14px;
    color: #fff;
    background: rgba(220, 38, 38, 0.92);
    box-shadow: 0 14px 30px rgba(220, 38, 38, 0.24);
    font-size: 14px;
    font-weight: 700;
}

.hero h1 {
    margin: 22px 0 16px;
    font-size: clamp(40px, 6vw, 72px);
    line-height: 1.02;
    letter-spacing: -0.05em;
}

.hero-desc {
    max-width: 690px;
    color: #e5e7eb;
    font-size: 20px;
    line-height: 1.7;
}

.hero-meta,
.detail-meta,
.card-meta,
.breadcrumbs,
.result-count {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.hero-meta span,
.detail-meta span,
.card-meta span,
.breadcrumbs a,
.breadcrumbs span {
    border-radius: 999px;
    padding: 6px 10px;
    color: #e5e7eb;
    background: rgba(255, 255, 255, 0.1);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 30px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 22px;
    border-radius: 999px;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #dc2626, #f97316);
    box-shadow: 0 20px 40px rgba(220, 38, 38, 0.28);
}

.btn-secondary {
    color: #fff;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.btn:hover {
    transform: translateY(-2px);
}

.hero-panel {
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 28px;
    padding: 22px;
    background: rgba(15, 23, 42, 0.66);
    backdrop-filter: blur(20px);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.3);
}

.hero-poster {
    overflow: hidden;
    border-radius: 22px;
    aspect-ratio: 16 / 10;
    margin-bottom: 18px;
}

.hero-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-mini-list {
    display: grid;
    gap: 12px;
}

.hero-mini-list a {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 12px;
    align-items: center;
    color: #e5e7eb;
}

.hero-mini-list img {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    object-fit: cover;
}

.hero-dots {
    position: absolute;
    z-index: 5;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    display: flex;
    gap: 9px;
}

.hero-dots button {
    width: 34px;
    height: 6px;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.32);
}

.hero-dots button.is-active {
    background: #fb7185;
}

.main-section {
    padding: 56px 0;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 26px;
}

.section-head h2,
.page-hero h1,
.detail-title {
    margin: 0;
    color: #111827;
    font-size: clamp(28px, 4vw, 44px);
    letter-spacing: -0.04em;
}

.section-head p,
.page-hero p,
.category-copy,
.detail-copy {
    color: #64748b;
    line-height: 1.8;
}

.movie-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
}

.movie-card {
    overflow: hidden;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.16);
}

.card-cover {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    background: linear-gradient(135deg, #111827, #334155);
}

.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.movie-card:hover .card-cover img {
    transform: scale(1.07);
}

.card-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, 0.72));
}

.card-play {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 2;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, #dc2626, #f97316);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
}

.rank-badge {
    position: absolute;
    left: 12px;
    top: 12px;
    z-index: 2;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.card-body {
    padding: 16px;
}

.card-title {
    display: -webkit-box;
    min-height: 48px;
    overflow: hidden;
    color: #111827;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.42;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-title:hover {
    color: #dc2626;
}

.card-desc {
    display: -webkit-box;
    min-height: 44px;
    overflow: hidden;
    margin: 10px 0 12px;
    color: #64748b;
    line-height: 1.55;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-meta {
    gap: 6px;
    font-size: 12px;
}

.card-meta span {
    color: #64748b;
    background: #f1f5f9;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.tag-row span {
    border-radius: 999px;
    padding: 5px 9px;
    color: #991b1b;
    background: #fee2e2;
    font-size: 12px;
}

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

.category-card {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 22px;
    padding: 22px;
    color: #fff;
    background:
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.2), transparent 30%),
        linear-gradient(135deg, #991b1b, #1e293b);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
    transition: transform 0.2s ease;
}

.category-card:hover {
    transform: translateY(-5px);
}

.category-card h2,
.category-card h3 {
    margin: 0;
    font-size: 24px;
}

.category-card p {
    margin: 10px 0 0;
    color: #fecaca;
    line-height: 1.6;
}

.rank-layout {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 22px;
}

.rank-list {
    display: grid;
    gap: 12px;
}

.rank-item {
    display: grid;
    grid-template-columns: 44px 62px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    border-radius: 18px;
    padding: 12px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.rank-num {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, #dc2626, #f97316);
    font-weight: 900;
}

.rank-item img {
    width: 62px;
    height: 62px;
    border-radius: 16px;
    object-fit: cover;
}

.rank-title {
    overflow: hidden;
    color: #111827;
    font-weight: 800;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.rank-sub {
    grid-column: 3 / 4;
    margin-top: -12px;
    color: #64748b;
    font-size: 13px;
}

.page-hero {
    color: #fff;
    padding: 58px 0;
    background:
        radial-gradient(circle at 88% 10%, rgba(249, 115, 22, 0.28), transparent 28%),
        linear-gradient(135deg, #0f172a, #1e293b 48%, #7f1d1d);
}

.page-hero h1 {
    color: #fff;
}

.page-hero p {
    max-width: 760px;
    color: #e5e7eb;
    font-size: 18px;
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    margin: 0 0 26px;
}

.filter-bar input,
.filter-bar select,
.search-panel input,
.search-panel select {
    width: 100%;
    min-height: 48px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    outline: 0;
    background: #fff;
    padding: 0 18px;
    color: #111827;
    font: inherit;
}

.filter-bar input:focus,
.search-panel input:focus,
.search-panel select:focus {
    border-color: #f43f5e;
    box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.12);
}

.search-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px 160px;
    gap: 12px;
    border-radius: 24px;
    padding: 18px;
    margin-bottom: 28px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.detail-hero {
    padding: 34px 0 42px;
    color: #fff;
    background:
        radial-gradient(circle at 80% 10%, rgba(249, 115, 22, 0.28), transparent 28%),
        linear-gradient(135deg, #020617, #111827 56%, #7f1d1d);
}

.breadcrumbs {
    margin-bottom: 22px;
    font-size: 14px;
}

.breadcrumbs a,
.breadcrumbs span {
    color: #e5e7eb;
    background: rgba(255, 255, 255, 0.1);
}

.detail-head-grid {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 32px;
    align-items: end;
}

.detail-poster {
    overflow: hidden;
    border-radius: 24px;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.34);
}

.detail-poster img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.detail-title {
    color: #fff;
    font-size: clamp(34px, 5vw, 60px);
}

.detail-copy {
    max-width: 820px;
    color: #e5e7eb;
    font-size: 18px;
}

.detail-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 28px;
    padding: 36px 0 60px;
}

.player-wrap {
    overflow: hidden;
    border-radius: 28px;
    background: #020617;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
}

.video-box {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #020617;
}

.player-video {
    width: 100%;
    height: 100%;
    display: block;
    background: #020617;
}

.player-cover {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: #fff;
    background:
        linear-gradient(180deg, rgba(2, 6, 23, 0.1), rgba(2, 6, 23, 0.88)),
        radial-gradient(circle at 50% 42%, rgba(239, 68, 68, 0.32), transparent 38%);
    font-size: 18px;
    font-weight: 800;
}

.player-wrap.is-playing .player-cover {
    display: none;
    pointer-events: none;
}

.play-circle {
    width: 76px;
    height: 76px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, #dc2626, #f97316);
    box-shadow: 0 20px 45px rgba(220, 38, 38, 0.3);
    font-size: 28px;
}

.content-card,
.side-card {
    border-radius: 24px;
    padding: 26px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.content-card + .content-card {
    margin-top: 22px;
}

.content-card h2,
.side-card h2 {
    margin-top: 0;
    color: #111827;
}

.content-card p {
    color: #334155;
    font-size: 17px;
    line-height: 1.9;
}

.side-stack {
    display: grid;
    gap: 16px;
}

.side-card .rank-item {
    grid-template-columns: 52px minmax(0, 1fr);
    box-shadow: none;
    border: 1px solid #e2e8f0;
}

.side-card .rank-item img {
    width: 52px;
    height: 52px;
}

.site-footer {
    color: #cbd5e1;
    background: linear-gradient(180deg, #0f172a, #020617);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 32px;
    padding: 42px 0;
}

.site-footer p {
    color: #94a3b8;
    line-height: 1.8;
}

.site-footer h3 {
    color: #fff;
}

.site-footer a {
    display: block;
    color: #cbd5e1;
    margin: 8px 0;
}

.site-footer a:hover {
    color: #fb7185;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 18px;
    text-align: center;
    color: #94a3b8;
}

.empty-state {
    grid-column: 1 / -1;
    border-radius: 22px;
    padding: 42px;
    text-align: center;
    color: #64748b;
    background: #fff;
}

@media (max-width: 1040px) {
    .nav-search {
        display: none;
    }

    .nav-toggle {
        display: block;
    }

    .nav-links {
        position: absolute;
        left: 0;
        right: 0;
        top: 72px;
        display: none;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 14px 24px 22px;
        background: rgba(15, 23, 42, 0.98);
    }

    .nav-links.is-open {
        display: flex;
    }

    .nav-links a {
        width: 100%;
        padding: 12px 0;
    }

    .hero-inner,
    .detail-content,
    .rank-layout {
        grid-template-columns: 1fr;
    }

    .hero-panel {
        max-width: 560px;
    }

    .movie-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

@media (max-width: 760px) {
    .container {
        width: min(100% - 22px, 1180px);
    }

    .hero,
    .hero-inner {
        min-height: 720px;
    }

    .hero-inner {
        padding-top: 36px;
    }

    .hero-desc {
        font-size: 17px;
    }

    .hero-actions,
    .section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .movie-grid,
    .category-grid,
    .footer-grid,
    .detail-head-grid,
    .search-panel,
    .filter-bar {
        grid-template-columns: 1fr;
    }

    .rank-item {
        grid-template-columns: 38px 58px minmax(0, 1fr);
    }

    .detail-poster {
        width: 210px;
    }

    .content-card,
    .side-card {
        padding: 20px;
    }
}

@media (max-width: 520px) {
    .movie-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .card-body {
        padding: 12px;
    }

    .card-desc {
        display: none;
    }

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