:root {
    color-scheme: dark;
    --bg: #020617;
    --panel: rgba(15, 23, 42, 0.82);
    --panel-strong: #0f172a;
    --panel-soft: rgba(30, 41, 59, 0.72);
    --line: rgba(148, 163, 184, 0.22);
    --text: #e2e8f0;
    --muted: #94a3b8;
    --amber: #f59e0b;
    --amber-light: #fbbf24;
    --cyan: #22d3ee;
    --red: #ef4444;
    --white: #ffffff;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 8%, rgba(245, 158, 11, 0.18), transparent 28rem),
        radial-gradient(circle at 88% 0%, rgba(34, 211, 238, 0.14), transparent 30rem),
        linear-gradient(180deg, #020617 0%, #0f172a 46%, #020617 100%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

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

button,
input,
select {
    font: inherit;
}

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

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

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--white);
    font-size: clamp(18px, 2vw, 24px);
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--red), var(--amber));
    box-shadow: 0 18px 40px rgba(245, 158, 11, 0.25);
}

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

.nav-link {
    padding: 10px 16px;
    color: #cbd5e1;
    border-radius: 999px;
    transition: 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.menu-toggle span {
    width: 18px;
    height: 2px;
    margin: 0 auto;
    border-radius: 999px;
    background: currentColor;
}

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

.hero {
    position: relative;
    width: min(1380px, calc(100% - 32px));
    margin: 22px auto 0;
    min-height: 620px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 34px;
    background: #020617;
    box-shadow: var(--shadow);
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.55fr);
    gap: clamp(24px, 5vw, 60px);
    align-items: center;
    padding: clamp(28px, 6vw, 72px);
    opacity: 0;
    transform: scale(1.02);
    pointer-events: none;
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.36;
    filter: saturate(1.1);
}

.hero-slide::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.95) 0%, rgba(2, 6, 23, 0.7) 46%, rgba(2, 6, 23, 0.42) 100%),
        linear-gradient(0deg, rgba(2, 6, 23, 0.92) 0%, transparent 60%);
}

.hero-content,
.hero-poster-wrap {
    position: relative;
    z-index: 2;
}

.hero-kicker,
.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--amber-light);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero h1 {
    margin: 18px 0 16px;
    max-width: 850px;
    color: white;
    font-size: clamp(38px, 7vw, 78px);
    line-height: 0.98;
    font-weight: 950;
    letter-spacing: -0.06em;
}

.hero-summary {
    max-width: 760px;
    margin: 0 0 24px;
    color: #cbd5e1;
    font-size: clamp(16px, 2vw, 20px);
    line-height: 1.85;
}

.hero-actions,
.filter-row,
.section-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 12px 18px;
    border: 1px solid transparent;
    border-radius: 14px;
    font-weight: 800;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

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

.btn-primary {
    color: white;
    background: linear-gradient(135deg, var(--red), var(--amber));
    box-shadow: 0 18px 36px rgba(245, 158, 11, 0.22);
}

.btn-ghost {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(14px);
}

.hero-poster {
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    aspect-ratio: 3 / 4;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5);
}

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

.hero-poster-info {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 18px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.76);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.hero-poster-info strong {
    display: block;
    color: white;
    font-size: 20px;
    margin-bottom: 6px;
}

.hero-dots {
    position: absolute;
    z-index: 4;
    left: clamp(28px, 6vw, 72px);
    bottom: 34px;
    display: flex;
    gap: 9px;
}

.hero-dot {
    width: 38px;
    height: 5px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.26);
    cursor: pointer;
}

.hero-dot.is-active {
    background: var(--amber-light);
}

.search-panel {
    width: min(1200px, calc(100% - 32px));
    margin: -44px auto 46px;
    position: relative;
    z-index: 8;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
}

.search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
}

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

.search-input:focus,
.select-input:focus {
    border-color: rgba(251, 191, 36, 0.74);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.12);
}

.section {
    margin: 62px 0;
}

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

.section-title {
    margin: 8px 0 0;
    color: white;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.12;
    font-weight: 950;
    letter-spacing: -0.04em;
}

.section-desc {
    max-width: 720px;
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.8;
}

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

.movie-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.74);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.24);
    transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(251, 191, 36, 0.52);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.32);
}

.movie-cover {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    background: #111827;
}

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

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

.movie-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.76), transparent 48%);
}

.movie-year,
.movie-play {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.movie-year {
    top: 12px;
    right: 12px;
    min-width: 54px;
    height: 28px;
    padding: 0 10px;
    color: white;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.92);
    font-weight: 800;
    font-size: 13px;
}

.movie-play {
    left: 50%;
    top: 50%;
    width: 54px;
    height: 54px;
    color: white;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.92);
    transform: translate(-50%, -50%) scale(0.88);
    opacity: 0;
    transition: 0.24s ease;
}

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

.movie-info {
    padding: 16px;
}

.movie-info h3 {
    margin: 0 0 8px;
    color: white;
    font-size: 18px;
    line-height: 1.35;
    font-weight: 900;
}

.movie-info h3 a:hover {
    color: var(--amber-light);
}

.movie-meta,
.movie-genre,
.movie-line {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.65;
}

.movie-line {
    color: #cbd5e1;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-list span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 9px;
    color: #fde68a;
    border: 1px solid rgba(245, 158, 11, 0.22);
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.1);
    font-size: 12px;
}

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

.category-card {
    position: relative;
    overflow: hidden;
    min-height: 210px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(34, 211, 238, 0.08)),
        rgba(15, 23, 42, 0.78);
    transition: transform 0.22s ease, border-color 0.22s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: rgba(251, 191, 36, 0.48);
}

.category-card h2,
.category-card h3 {
    margin: 0 0 12px;
    color: white;
    font-size: 24px;
    font-weight: 920;
}

.category-card p {
    margin: 0 0 18px;
    color: #cbd5e1;
    line-height: 1.75;
}

.category-samples {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
}

.rank-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.45fr);
    gap: 24px;
}

.rank-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.rank-row a {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.72);
    transition: 0.22s ease;
}

.rank-row a:hover {
    border-color: rgba(251, 191, 36, 0.48);
    transform: translateX(4px);
}

.rank-num {
    color: var(--amber-light);
    font-size: 18px;
    font-weight: 950;
}

.rank-title {
    min-width: 0;
    color: white;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-meta {
    color: var(--muted);
    font-size: 13px;
}

.page-hero {
    margin: 34px 0 30px;
    padding: clamp(28px, 5vw, 56px);
    border: 1px solid var(--line);
    border-radius: 30px;
    background:
        linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(245, 158, 11, 0.1)),
        rgba(15, 23, 42, 0.78);
    box-shadow: var(--shadow);
}

.page-hero h1 {
    margin: 0 0 14px;
    color: white;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.05;
    font-weight: 950;
    letter-spacing: -0.05em;
}

.page-hero p {
    max-width: 850px;
    margin: 0;
    color: #cbd5e1;
    line-height: 1.85;
    font-size: 17px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
    margin: 24px 0 14px;
}

.breadcrumb a {
    color: #fde68a;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 28px;
    align-items: start;
}

.detail-main,
.detail-side,
.content-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.78);
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.24);
}

.detail-main {
    overflow: hidden;
}

.player-block {
    position: relative;
    background: #000;
}

.player-block video {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
    background: #000;
}

.player-mask {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    cursor: pointer;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.16));
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.player-mask.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.play-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-width: 168px;
    min-height: 56px;
    color: white;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--red), var(--amber));
    box-shadow: 0 18px 38px rgba(245, 158, 11, 0.28);
    cursor: pointer;
    font-weight: 900;
}

.detail-body {
    padding: 24px;
}

.detail-body h1 {
    margin: 0 0 12px;
    color: white;
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.15;
    font-weight: 950;
    letter-spacing: -0.04em;
}

.detail-body h2,
.content-panel h2,
.detail-side h2 {
    margin: 0 0 14px;
    color: white;
    font-size: 24px;
    font-weight: 920;
}

.detail-body p,
.content-panel p,
.detail-side p {
    color: #cbd5e1;
    line-height: 1.85;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 14px 0 22px;
}

.detail-meta span {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: #fde68a;
    background: rgba(255, 255, 255, 0.06);
    font-size: 13px;
}

.detail-side {
    padding: 18px;
}

.detail-poster {
    overflow: hidden;
    border-radius: 18px;
    aspect-ratio: 3 / 4;
    background: #111827;
    margin-bottom: 18px;
}

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

.content-panel {
    padding: 24px;
    margin-top: 22px;
}

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

.compact .movie-info h3 {
    font-size: 16px;
}

.compact .movie-info {
    padding: 14px;
}

.filter-panel {
    margin: 0 0 24px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.72);
}

.site-footer {
    width: min(1200px, calc(100% - 32px));
    margin: 72px auto 0;
    padding: 34px 0 24px;
    border-top: 1px solid var(--line);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 28px;
}

.site-footer h2 {
    margin: 0 0 14px;
    color: white;
    font-size: 18px;
    font-weight: 900;
}

.site-footer p,
.footer-bottom {
    color: var(--muted);
    line-height: 1.8;
}

.footer-links {
    display: grid;
    gap: 10px;
}

.footer-links a {
    color: #cbd5e1;
}

.footer-links a:hover {
    color: var(--amber-light);
}

.footer-bottom {
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    font-size: 14px;
}

.hidden-by-filter {
    display: none !important;
}

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

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

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

    .detail-side {
        max-width: 520px;
    }
}

@media (max-width: 820px) {
    .menu-toggle {
        display: inline-flex;
    }

    .site-nav {
        position: absolute;
        left: 16px;
        right: 16px;
        top: 82px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
        border: 1px solid var(--line);
        border-radius: 22px;
        background: rgba(2, 6, 23, 0.96);
        box-shadow: var(--shadow);
    }

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

    .nav-link {
        border-radius: 14px;
    }

    .hero {
        min-height: 760px;
        border-radius: 26px;
    }

    .hero-slide {
        grid-template-columns: 1fr;
        align-content: center;
        padding: 28px;
    }

    .hero-poster-wrap {
        max-width: 280px;
    }

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

    .section-header {
        display: block;
    }

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

    .rank-row a {
        grid-template-columns: 46px minmax(0, 1fr);
    }

    .rank-meta {
        grid-column: 2;
    }
}

@media (max-width: 560px) {
    main,
    .site-footer,
    .site-header-inner,
    .hero,
    .search-panel {
        width: min(100% - 22px, 1200px);
    }

    .brand span:last-child {
        max-width: 210px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .hero {
        min-height: 700px;
    }

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

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

    .page-hero,
    .detail-body,
    .content-panel {
        padding: 20px;
    }
}
