:root {
    --bg: #0f172a;
    --bg-soft: #111827;
    --card: rgba(15, 23, 42, 0.78);
    --card-solid: #111827;
    --text: #f8fafc;
    --muted: #cbd5e1;
    --faint: #94a3b8;
    --line: rgba(255, 255, 255, 0.12);
    --red: #dc2626;
    --orange: #f97316;
    --gold: #facc15;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 8%, rgba(249, 115, 22, 0.22), transparent 28rem),
        radial-gradient(circle at 82% 0%, rgba(220, 38, 38, 0.2), transparent 30rem),
        linear-gradient(135deg, #0f172a 0%, #111827 46%, #27120f 100%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 72%);
    z-index: -1;
}

img,
video {
    max-width: 100%;
}

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

main {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(15, 23, 42, 0.8);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
}

.nav-wrap {
    width: min(1240px, calc(100% - 32px));
    min-height: 72px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo,
.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 0.03em;
}

.logo-mark {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--red), var(--orange));
    box-shadow: 0 14px 32px rgba(220, 38, 38, 0.35);
}

.desktop-nav,
.mobile-nav,
.footer-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link,
.footer-links a {
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--muted);
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.nav-link:hover,
.nav-link.active,
.footer-links a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.mobile-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.mobile-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    background: #ffffff;
    border-radius: 999px;
}

.mobile-nav {
    display: none;
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto 16px;
    padding: 10px;
    flex-wrap: wrap;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.92);
}

.hero-carousel {
    position: relative;
    margin: 32px 0 42px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 32px;
    min-height: 540px;
    background: linear-gradient(135deg, rgba(185, 28, 28, 0.82), rgba(15, 23, 42, 0.95));
    box-shadow: var(--shadow);
}

.hero-slides {
    position: relative;
    min-height: 540px;
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.48fr);
    align-items: center;
    gap: 36px;
    padding: 54px;
    opacity: 0;
    visibility: hidden;
    transform: scale(1.02);
    transition: opacity 0.6s ease, transform 0.6s ease, visibility 0.6s ease;
    background-image:
        linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.74), rgba(15, 23, 42, 0.48)),
        var(--hero-image),
        linear-gradient(135deg, rgba(220, 38, 38, 0.92), rgba(249, 115, 22, 0.72));
    background-size: cover;
    background-position: center;
}

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

.hero-copy {
    max-width: 760px;
}

.eyebrow {
    margin: 0 0 10px;
    color: #fed7aa;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.hero-copy h1,
.page-hero h1,
.detail-info h1 {
    margin: 0;
    font-size: clamp(36px, 6vw, 72px);
    line-height: 1.02;
    letter-spacing: -0.04em;
}

.hero-desc,
.page-hero p,
.detail-summary,
.category-card p,
.content-section p,
.movie-body p {
    color: var(--muted);
}

.hero-desc {
    max-width: 660px;
    margin: 22px 0 0;
    font-size: 18px;
}

.hero-tags,
.meta-pills,
.tag-row,
.card-actions,
.detail-tags,
.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-tags {
    margin: 24px 0;
}

.hero-tags span,
.meta-pills span,
.tag-row span,
.detail-tags span,
.hot-score {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 11px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
    color: #ffffff;
    font-size: 13px;
}

.hero-actions,
.detail-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.primary-btn,
.ghost-btn,
.text-link,
.play-cover {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    font-weight: 800;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.primary-btn {
    min-height: 48px;
    padding: 0 24px;
    background: linear-gradient(135deg, var(--red), var(--orange));
    color: #ffffff;
    box-shadow: 0 16px 32px rgba(249, 115, 22, 0.26);
}

.ghost-btn {
    min-height: 48px;
    padding: 0 22px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.primary-btn:hover,
.ghost-btn:hover,
.text-link:hover {
    transform: translateY(-2px);
}

.hero-card {
    display: block;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 28px;
    background: rgba(15, 23, 42, 0.58);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(14px);
}

.hero-card strong,
.hero-card small {
    display: block;
}

.hero-card strong {
    margin: 14px 0 6px;
    font-size: 20px;
}

.hero-card small {
    color: var(--muted);
}

.poster,
.detail-poster,
.category-cover,
.player-poster {
    display: block;
    overflow: hidden;
    background-image:
        linear-gradient(145deg, rgba(220, 38, 38, 0.32), rgba(15, 23, 42, 0.28)),
        var(--poster-image),
        linear-gradient(135deg, #7f1d1d, #1f2937);
    background-size: cover;
    background-position: center;
}

.poster {
    aspect-ratio: 2 / 3;
    border-radius: 20px;
}

.poster.tall {
    min-height: 360px;
    border-radius: 22px;
}

.hero-bottom {
    position: absolute;
    left: 32px;
    right: 32px;
    bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    z-index: 5;
}

.hero-dots,
.quick-cats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-dot {
    width: 34px;
    height: 6px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.28);
}

.hero-dot.is-active {
    background: #ffffff;
}

.quick-cats a {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 13px;
}

.page-hero,
.detail-hero,
.search-panel,
.content-section,
.category-card,
.movie-card,
.player-block,
.info-panel,
.rank-strip {
    border: 1px solid var(--line);
    background: rgba(15, 23, 42, 0.72);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.page-hero {
    margin: 32px 0;
    padding: clamp(28px, 6vw, 60px);
    border-radius: 32px;
    background:
        radial-gradient(circle at right top, rgba(249, 115, 22, 0.28), transparent 32rem),
        linear-gradient(135deg, rgba(127, 29, 29, 0.82), rgba(15, 23, 42, 0.88));
}

.page-hero p {
    max-width: 760px;
    margin: 16px 0 0;
    font-size: 17px;
}

.search-panel {
    margin: 26px 0;
    padding: 24px;
    border-radius: 26px;
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1fr);
    gap: 22px;
    align-items: center;
}

.search-panel h2,
.section-heading h2,
.info-panel h2,
.player-block h2 {
    margin: 0;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.15;
}

.search-controls {
    display: grid;
    grid-template-columns: 1fr 170px;
    gap: 12px;
}

.search-controls input,
.search-controls select {
    width: 100%;
    min-height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    outline: none;
    padding: 0 16px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.search-controls option {
    color: #111827;
}

.content-section {
    margin: 32px 0;
    padding: 26px;
    border-radius: 30px;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

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

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

.movie-card {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(249, 115, 22, 0.42);
    box-shadow: 0 26px 56px rgba(0, 0, 0, 0.35);
}

.poster-link {
    position: relative;
    display: block;
    padding: 12px 12px 0;
}

.year-badge,
.quality-badge,
.rank-number {
    position: absolute;
    top: 20px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.year-badge {
    left: 20px;
    background: rgba(15, 23, 42, 0.76);
}

.quality-badge {
    right: 20px;
    background: linear-gradient(135deg, var(--red), var(--orange));
}

.rank-number {
    left: 20px;
    top: auto;
    bottom: 12px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    background: rgba(250, 204, 21, 0.92);
    color: #451a03;
    font-size: 16px;
}

.movie-body {
    padding: 14px 16px 18px;
}

.movie-meta-line {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fed7aa;
    font-size: 12px;
    font-weight: 700;
}

.movie-body h3 {
    margin: 7px 0 8px;
    font-size: 18px;
    line-height: 1.25;
}

.movie-body p {
    min-height: 46px;
    margin: 0;
    font-size: 14px;
}

.tag-row {
    margin: 12px 0;
}

.tag-row span {
    min-height: 24px;
    padding: 3px 8px;
    color: var(--muted);
    font-size: 12px;
}

.card-actions {
    justify-content: space-between;
}

.text-link {
    color: #fdba74;
}

.hot-score {
    min-height: 26px;
    padding: 3px 8px;
    color: #fde68a;
}

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

.category-card {
    overflow: hidden;
    border-radius: 26px;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: rgba(249, 115, 22, 0.45);
}

.category-cover {
    aspect-ratio: 16 / 10;
}

.category-card div {
    padding: 18px;
}

.category-card h2 {
    margin: 0 0 8px;
    font-size: 22px;
}

.category-card p {
    margin: 0 0 14px;
}

.detail-hero {
    margin: 32px 0;
    padding: clamp(22px, 5vw, 46px);
    border-radius: 32px;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 34px;
    align-items: center;
    background:
        radial-gradient(circle at right top, rgba(249, 115, 22, 0.24), transparent 28rem),
        linear-gradient(135deg, rgba(127, 29, 29, 0.72), rgba(15, 23, 42, 0.86));
}

.detail-poster {
    aspect-ratio: 2 / 3;
    border-radius: 26px;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.38);
}

.breadcrumbs {
    margin-bottom: 18px;
    color: #fed7aa;
    font-size: 14px;
}

.breadcrumbs a:hover {
    color: #ffffff;
}

.detail-summary {
    margin: 18px 0;
    font-size: 17px;
}

.detail-tags {
    margin: 18px 0;
}

.player-block {
    margin: 32px 0;
    padding: 24px;
    border-radius: 30px;
}

.player-shell {
    position: relative;
    overflow: hidden;
    margin-top: 18px;
    border-radius: 26px;
    background: #020617;
    aspect-ratio: 16 / 9;
}

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

.play-cover {
    position: absolute;
    inset: 0;
    width: 100%;
    min-height: 100%;
    cursor: pointer;
    background-image:
        linear-gradient(135deg, rgba(2, 6, 23, 0.62), rgba(127, 29, 29, 0.34)),
        var(--poster-image),
        linear-gradient(135deg, #111827, #7f1d1d);
    background-size: cover;
    background-position: center;
    color: #ffffff;
}

.play-cover.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.play-icon {
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--red), var(--orange));
    box-shadow: 0 20px 48px rgba(249, 115, 22, 0.36);
    font-size: 34px;
    transform: translateX(3px);
}

.info-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.45fr);
    gap: 24px;
    margin: 32px 0;
}

.info-panel {
    padding: 24px;
    border-radius: 28px;
}

.info-panel p {
    margin: 14px 0 0;
    color: var(--muted);
}

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

.rank-strip {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) 110px;
    gap: 16px;
    align-items: center;
    padding: 14px;
    border-radius: 20px;
}

.rank-index {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--red), var(--orange));
    font-weight: 900;
}

.rank-strip h3 {
    margin: 0;
    font-size: 18px;
}

.rank-strip p {
    margin: 4px 0 0;
    color: var(--muted);
}

.site-footer {
    margin-top: 56px;
    padding: 42px 0 28px;
    border-top: 1px solid var(--line);
    background: rgba(2, 6, 23, 0.35);
}

.footer-inner {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 24px;
}

.footer-inner p,
.copyright {
    color: var(--faint);
}

.copyright {
    width: min(1240px, calc(100% - 32px));
    margin: 26px auto 0;
    font-size: 14px;
}

.is-filtered-out {
    display: none !important;
}

.empty-state {
    display: none;
    margin: 18px 0 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.06);
}

.empty-state.is-visible {
    display: block;
}

@media (max-width: 1120px) {
    .movie-grid,
    .category-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 920px) {
    main,
    .nav-wrap,
    .mobile-nav,
    .footer-inner,
    .copyright {
        width: min(100% - 24px, 1240px);
    }

    .desktop-nav {
        display: none;
    }

    .mobile-toggle {
        display: block;
    }

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

    .hero-slide {
        position: relative;
        grid-template-columns: 1fr;
        padding: 34px 24px 86px;
        min-height: 620px;
    }

    .hero-slides {
        min-height: 620px;
    }

    .hero-card {
        max-width: 280px;
    }

    .search-panel,
    .detail-hero,
    .info-grid {
        grid-template-columns: 1fr;
    }

    .detail-poster {
        width: min(280px, 100%);
    }

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

@media (max-width: 680px) {
    .hero-carousel {
        min-height: 680px;
    }

    .hero-slides {
        min-height: 680px;
    }

    .hero-copy h1,
    .page-hero h1,
    .detail-info h1 {
        font-size: 38px;
    }

    .hero-bottom,
    .section-heading,
    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .search-controls {
        grid-template-columns: 1fr;
    }

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

    .content-section,
    .player-block,
    .info-panel {
        padding: 18px;
    }

    .rank-strip {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .rank-strip .hot-score {
        grid-column: 2;
        justify-self: start;
    }
}

@media (max-width: 430px) {
    .movie-grid,
    .category-grid,
    .movie-grid.wide {
        grid-template-columns: 1fr;
    }

    .hero-slide {
        min-height: 720px;
    }

    .hero-slides {
        min-height: 720px;
    }
}
