:root {
    color-scheme: dark;
    --bg: #020617;
    --bg-soft: #0f172a;
    --bg-card: #1e293b;
    --bg-card-soft: rgba(30, 41, 59, 0.72);
    --text: #f8fafc;
    --muted: #94a3b8;
    --muted-strong: #cbd5e1;
    --accent: #ef4444;
    --accent-dark: #dc2626;
    --cyan: #22d3ee;
    --line: rgba(148, 163, 184, 0.16);
    --shadow: 0 22px 60px rgba(0, 0, 0, 0.32);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(180deg, #020617 0%, #0f172a 48%, #020617 100%);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

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

button,
input,
select {
    font: inherit;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(2, 6, 23, 0.82);
    backdrop-filter: blur(18px);
}

.site-header-inner {
    width: min(1180px, calc(100% - 32px));
    height: 72px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

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

.site-logo-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), #fb7185);
    box-shadow: 0 12px 30px rgba(239, 68, 68, 0.28);
    font-size: 16px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link,
.mobile-link {
    color: var(--muted-strong);
    border-radius: 999px;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-link {
    padding: 10px 16px;
}

.nav-link:hover,
.nav-link.active,
.mobile-link:hover,
.mobile-link.active {
    color: #fff;
    background: rgba(239, 68, 68, 0.16);
}

.mobile-menu-button {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.86);
    color: #fff;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
}

.mobile-menu-button span {
    width: 20px;
    height: 2px;
    border-radius: 99px;
    background: #fff;
}

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

.mobile-nav.is-open {
    display: grid;
    gap: 6px;
}

.mobile-link {
    padding: 12px 14px;
}

.hero {
    position: relative;
    height: 78vh;
    min-height: 560px;
    overflow: hidden;
    background: #020617;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

.hero-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.76) 32%, rgba(2, 6, 23, 0.34) 100%),
        radial-gradient(circle at 20% 72%, rgba(239, 68, 68, 0.32), transparent 34%),
        linear-gradient(90deg, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.1));
}

.hero-content {
    position: relative;
    height: 100%;
    display: flex;
    align-items: flex-end;
    padding-bottom: 86px;
}

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

.hero-kicker,
.page-hero span,
.section-title span {
    display: inline-flex;
    color: #fecaca;
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid rgba(239, 68, 68, 0.28);
    border-radius: 999px;
    padding: 7px 13px;
    font-size: 14px;
    font-weight: 700;
    backdrop-filter: blur(12px);
}

.hero h1 {
    margin: 20px 0 16px;
    font-size: clamp(42px, 7vw, 78px);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.hero p {
    max-width: 680px;
    color: #d1d5db;
    font-size: clamp(17px, 2vw, 22px);
    line-height: 1.75;
}

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

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 20px;
    border-radius: 13px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    font-weight: 800;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

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

.button.primary {
    border-color: transparent;
    background: linear-gradient(135deg, var(--accent), #f97316);
    box-shadow: 0 16px 36px rgba(239, 68, 68, 0.28);
}

.button.ghost {
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(12px);
}

.button.small {
    min-height: 48px;
    white-space: nowrap;
}

.hero-arrow {
    position: absolute;
    top: 50%;
    width: 52px;
    height: 52px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 42px;
    line-height: 1;
    display: grid;
    place-items: center;
    transform: translateY(-50%);
    transition: background 0.2s ease, transform 0.2s ease;
    backdrop-filter: blur(12px);
}

.hero-arrow:hover {
    background: rgba(0, 0, 0, 0.72);
    transform: translateY(-50%) scale(1.05);
}

.hero-prev {
    left: 22px;
}

.hero-next {
    right: 22px;
}

.hero-dots {
    position: absolute;
    left: 50%;
    bottom: 32px;
    display: flex;
    gap: 8px;
    transform: translateX(-50%);
}

.hero-dot {
    width: 9px;
    height: 9px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.5);
    transition: width 0.25s ease, background 0.25s ease;
}

.hero-dot.active {
    width: 34px;
    background: var(--accent);
}

.search-panel {
    position: relative;
    z-index: 5;
    margin-top: -38px;
    display: grid;
    grid-template-columns: 1fr minmax(320px, 540px);
    gap: 20px;
    align-items: center;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.88);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.search-panel h2 {
    margin: 0 0 6px;
    font-size: 24px;
}

.search-panel p,
.page-hero p,
.category-overview-card p,
.category-tile p,
.movie-card-body p,
.detail-content-card p,
.site-footer p,
.rank-item p {
    color: var(--muted);
}

.filter-row {
    display: flex;
    gap: 12px;
}

.filter-row.inline-filter {
    margin-top: 24px;
    max-width: 780px;
}

.filter-row.wide {
    max-width: 920px;
}

.filter-input,
.filter-select {
    min-height: 48px;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(2, 6, 23, 0.72);
    color: #fff;
    padding: 0 14px;
    outline: none;
}

.filter-input:focus,
.filter-select:focus {
    border-color: rgba(239, 68, 68, 0.68);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

.section-block {
    padding: 72px 0;
}

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

.section-title h2,
.page-hero h1 {
    margin: 12px 0 0;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.15;
}

.section-title a {
    color: #fca5a5;
    font-weight: 800;
}

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

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

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

.movie-card {
    min-width: 0;
}

.movie-card-link {
    display: block;
    height: 100%;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.13);
    border-radius: 20px;
    background: rgba(30, 41, 59, 0.86);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
    transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.movie-card-link:hover {
    transform: translateY(-6px);
    border-color: rgba(239, 68, 68, 0.32);
    box-shadow: 0 24px 54px rgba(239, 68, 68, 0.14);
}

.movie-poster {
    position: relative;
    height: 250px;
    overflow: hidden;
    background: #334155;
}

.movie-card-small .movie-poster {
    height: 210px;
}

.movie-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.movie-card-link:hover .movie-poster img {
    transform: scale(1.1);
}

.movie-poster-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.04));
}

.movie-year,
.movie-play,
.movie-badges {
    position: absolute;
}

.movie-year {
    top: 12px;
    right: 12px;
    padding: 5px 8px;
    border-radius: 9px;
    background: rgba(0, 0, 0, 0.62);
    font-size: 12px;
    font-weight: 800;
    backdrop-filter: blur(12px);
}

.movie-play {
    left: 50%;
    top: 50%;
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.88);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
    transition: opacity 0.24s ease, transform 0.24s ease;
}

.movie-card-link:hover .movie-play {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.movie-badges {
    left: 12px;
    right: 12px;
    bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.movie-badges span,
.movie-tags span,
.detail-tags span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.8);
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 700;
}

.movie-badges span:first-child {
    background: rgba(239, 68, 68, 0.88);
}

.movie-card-body {
    padding: 16px;
}

.movie-card-body h3 {
    margin: 0 0 8px;
    min-height: 48px;
    color: #fff;
    font-size: 16px;
    line-height: 1.45;
    transition: color 0.2s ease;
}

.movie-card-link:hover h3 {
    color: #f87171;
}

.movie-card-body p {
    min-height: 44px;
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.6;
}

.movie-tags,
.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.wide-band {
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.42), rgba(30, 41, 59, 0.86), rgba(15, 23, 42, 0.42));
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.wide-band.deep {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.88), rgba(2, 6, 23, 0.96));
}

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

.category-tile,
.category-overview-card a {
    display: block;
    height: 100%;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.82);
    transition: transform 0.22s ease, border-color 0.22s ease;
}

.category-tile:hover,
.category-overview-card a:hover {
    transform: translateY(-5px);
    border-color: rgba(34, 211, 238, 0.38);
}

.category-thumbs,
.overview-posters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.overview-posters {
    grid-template-columns: repeat(4, 1fr);
}

.category-thumbs img,
.overview-posters img {
    width: 100%;
    height: 92px;
    object-fit: cover;
    border-radius: 14px;
}

.category-tile h3,
.category-overview-card h2 {
    margin: 0 0 10px;
    font-size: 20px;
}

.category-tile p,
.category-overview-card p {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
}

.horizontal-scroll {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 230px;
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 12px;
    scrollbar-width: thin;
}

.compact-card {
    display: block;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(30, 41, 59, 0.78);
}

.compact-card img {
    width: 100%;
    height: 138px;
    object-fit: cover;
}

.compact-card span,
.compact-card small {
    display: block;
    padding: 0 14px;
}

.compact-card span {
    margin-top: 12px;
    color: #fff;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compact-card small {
    margin: 6px 0 14px;
    color: var(--muted);
}

.page-main,
.detail-main {
    padding-top: 52px;
}

.page-hero {
    padding: 64px 0 20px;
}

.page-hero.compact {
    max-width: 1180px;
}

.page-hero p {
    max-width: 760px;
    font-size: 18px;
    line-height: 1.8;
}

.rank-list {
    display: grid;
    gap: 14px;
    padding: 48px 0 80px;
}

.rank-item a {
    display: grid;
    grid-template-columns: 68px 96px 1fr;
    gap: 18px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.74);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.rank-item a:hover {
    transform: translateY(-3px);
    border-color: rgba(239, 68, 68, 0.34);
}

.rank-num {
    color: #fca5a5;
    font-size: 28px;
    font-weight: 900;
    text-align: center;
}

.rank-item img {
    width: 96px;
    height: 126px;
    border-radius: 14px;
    object-fit: cover;
}

.rank-item h2 {
    margin: 0 0 8px;
    font-size: 21px;
}

.rank-item p {
    margin: 0 0 8px;
    line-height: 1.65;
}

.rank-item small {
    color: var(--muted-strong);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    align-items: center;
    padding-top: 26px;
    color: var(--muted);
    font-size: 14px;
}

.breadcrumb a {
    color: #fca5a5;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    padding: 28px 0 22px;
}

.detail-primary {
    display: grid;
    gap: 22px;
    min-width: 0;
}

.player-card,
.detail-content-card,
.side-info,
.side-poster {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.82);
    box-shadow: var(--shadow);
}

.player-shell {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
}

.player-video {
    width: 100%;
    height: 100%;
    background: #000;
    object-fit: contain;
}

.player-start {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 86px;
    height: 86px;
    border: 0;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.92);
    color: #fff;
    font-size: 30px;
    transform: translate(-50%, -50%);
    box-shadow: 0 18px 44px rgba(239, 68, 68, 0.38);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.player-start:hover {
    transform: translate(-50%, -50%) scale(1.06);
}

.player-shell.is-playing .player-start {
    opacity: 0;
    pointer-events: none;
}

.player-status {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 16px;
    color: #fecaca;
    text-align: center;
    font-size: 14px;
    pointer-events: none;
}

.detail-content-card {
    padding: 28px;
}

.detail-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
}

.detail-heading span {
    color: #fca5a5;
    font-weight: 800;
}

.detail-heading h1 {
    margin: 8px 0 0;
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.2;
}

.detail-one-line {
    margin: 22px 0;
    color: #e5e7eb;
    font-size: 18px;
    line-height: 1.8;
}

.detail-content-card h2 {
    margin: 28px 0 12px;
    font-size: 24px;
}

.detail-content-card p {
    margin: 0;
    color: #cbd5e1;
    line-height: 1.95;
}

.detail-tags span {
    background: rgba(34, 211, 238, 0.12);
    color: #a5f3fc;
}

.detail-side {
    display: grid;
    align-content: start;
    gap: 18px;
}

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

.side-info {
    padding: 20px;
}

.side-info h2 {
    margin: 0 0 16px;
    font-size: 22px;
}

.side-info dl {
    display: grid;
    grid-template-columns: 68px 1fr;
    gap: 10px 12px;
    margin: 0;
}

.side-info dt {
    color: var(--muted);
}

.side-info dd {
    margin: 0;
    color: #e2e8f0;
}

.related-block {
    padding-top: 36px;
}

.site-footer {
    border-top: 1px solid var(--line);
    background: rgba(2, 6, 23, 0.96);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 36px;
    padding: 48px 0 30px;
}

.site-footer h2 {
    margin: 0 0 16px;
    font-size: 17px;
}

.site-footer p {
    max-width: 520px;
    line-height: 1.8;
}

.site-footer a:not(.footer-logo) {
    display: block;
    margin: 9px 0;
    color: var(--muted-strong);
}

.footer-bottom {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0 30px;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    color: var(--muted);
    font-size: 14px;
}

.card-item.is-hidden {
    display: none;
}

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

    .detail-layout {
        grid-template-columns: 1fr;
    }

    .detail-side {
        grid-template-columns: 240px 1fr;
    }
}

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

    .mobile-menu-button {
        display: flex;
    }

    .hero {
        height: 70vh;
        min-height: 520px;
    }

    .hero-arrow {
        display: none;
    }

    .hero-content {
        padding-bottom: 72px;
    }

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

    .filter-row,
    .detail-heading,
    .footer-grid,
    .detail-side {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

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

    .section-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .detail-side {
        display: grid;
    }
}

@media (max-width: 560px) {
    .container,
    .site-header-inner,
    .mobile-nav,
    .footer-bottom {
        width: min(100% - 24px, 1180px);
    }

    .hero {
        min-height: 500px;
    }

    .hero h1 {
        font-size: 38px;
    }

    .movie-grid,
    .category-movie-grid,
    .ranking-grid,
    .related-grid,
    .category-grid,
    .category-overview-grid {
        grid-template-columns: 1fr;
    }

    .movie-poster {
        height: 300px;
    }

    .rank-item a {
        grid-template-columns: 54px 76px 1fr;
        gap: 12px;
    }

    .rank-item img {
        width: 76px;
        height: 102px;
    }

    .rank-item h2 {
        font-size: 17px;
    }

    .rank-item p {
        display: none;
    }

    .detail-content-card {
        padding: 20px;
    }

    .player-start {
        width: 66px;
        height: 66px;
        font-size: 24px;
    }
}
