:root {
    --primary-50: #f0f9ff;
    --primary-100: #e0f2fe;
    --primary-500: #0ea5e9;
    --primary-600: #0284c7;
    --primary-700: #0369a1;
    --accent-500: #f59e0b;
    --secondary-50: #f8fafc;
    --secondary-100: #f1f5f9;
    --secondary-200: #e2e8f0;
    --secondary-300: #cbd5e1;
    --secondary-400: #94a3b8;
    --secondary-500: #64748b;
    --secondary-700: #334155;
    --secondary-900: #0f172a;
    --white: #ffffff;
    --shadow-soft: 0 2px 15px -3px rgba(15, 23, 42, .10), 0 10px 20px -2px rgba(15, 23, 42, .05);
    --shadow-soft-lg: 0 18px 50px -18px rgba(15, 23, 42, .26);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--secondary-900);
    background: var(--secondary-50);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "Microsoft YaHei", sans-serif;
    line-height: 1.65;
}

img {
    display: block;
    max-width: 100%;
    background: linear-gradient(135deg, var(--primary-100), var(--secondary-200));
}

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

button,
input,
select {
    font: inherit;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid rgba(226, 232, 240, .9);
    box-shadow: 0 1px 8px rgba(15, 23, 42, .04);
    backdrop-filter: blur(18px);
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 22px;
    min-height: 68px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    font-weight: 800;
    color: var(--secondary-900);
}

.brand__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: var(--white);
    background: linear-gradient(135deg, var(--primary-600), var(--primary-500));
    border-radius: 11px;
    box-shadow: 0 10px 24px rgba(2, 132, 199, .28);
}

.brand__name {
    font-size: 20px;
    letter-spacing: -.02em;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 1 1 auto;
}

.nav-link {
    color: var(--secondary-700);
    font-weight: 650;
    white-space: nowrap;
    transition: color .2s ease;
}

.nav-link:hover,
.nav-link.is-active {
    color: var(--primary-600);
}

.header-search,
.mobile-search,
.hero-search,
.search-panel__form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-search input,
.mobile-search input,
.hero-search input,
.search-panel__form input,
.filter-panel input,
.filter-panel select {
    border: 1px solid var(--secondary-300);
    border-radius: 12px;
    color: var(--secondary-900);
    background: var(--white);
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.header-search input {
    width: 168px;
    padding: 9px 12px;
}

.header-search input:focus,
.mobile-search input:focus,
.hero-search input:focus,
.search-panel__form input:focus,
.filter-panel input:focus,
.filter-panel select:focus {
    border-color: transparent;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, .22);
}

.header-search button,
.mobile-search button,
.hero-search button,
.search-panel__form button,
.button {
    border: 0;
    border-radius: 12px;
    padding: 10px 16px;
    color: var(--white);
    background: var(--primary-600);
    font-weight: 750;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.header-search button:hover,
.mobile-search button:hover,
.hero-search button:hover,
.search-panel__form button:hover,
.button:hover {
    background: var(--primary-700);
    box-shadow: 0 12px 24px rgba(2, 132, 199, .24);
    transform: translateY(-1px);
}

.button--ghost {
    color: var(--white);
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .35);
    backdrop-filter: blur(12px);
}

.button--light {
    color: var(--primary-700);
    background: var(--white);
}

.mobile-menu-button {
    display: none;
    border: 0;
    background: transparent;
    color: var(--secondary-700);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.mobile-nav {
    display: none;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 12px 0 18px;
    border-top: 1px solid var(--secondary-200);
}

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

.mobile-nav a {
    color: var(--secondary-700);
    font-weight: 700;
}

.mobile-search input {
    width: 100%;
    padding: 10px 12px;
}

.hero {
    position: relative;
    height: 540px;
    overflow: hidden;
    background: var(--secondary-900);
}

.hero__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease;
}

.hero__slide.is-active {
    opacity: 1;
    pointer-events: auto;
}

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

.hero__shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(15, 23, 42, .92), rgba(15, 23, 42, .55) 45%, rgba(15, 23, 42, .18)), linear-gradient(0deg, rgba(15, 23, 42, .84), rgba(15, 23, 42, .05) 58%);
}

.hero__content {
    position: absolute;
    left: 50%;
    bottom: 74px;
    transform: translateX(-50%);
    color: var(--white);
}

.hero__content-inner {
    width: min(700px, 100%);
}

.eyebrow {
    margin: 0 0 12px;
    color: #bae6fd;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.hero h1,
.hero h2 {
    margin: 0 0 16px;
    max-width: 780px;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.08;
    letter-spacing: -.05em;
}

.hero__movie-title {
    display: block;
    margin-top: 12px;
    font-size: clamp(24px, 3vw, 36px);
    letter-spacing: -.03em;
}

.hero__summary {
    max-width: 720px;
    margin: 0 0 20px;
    color: rgba(255, 255, 255, .9);
    font-size: 18px;
}

.hero__meta,
.detail-meta,
.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.hero__meta span,
.detail-meta span,
.tag {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, .16);
    color: rgba(255, 255, 255, .92);
    font-size: 13px;
    font-weight: 700;
}

.tag {
    color: var(--primary-700);
    background: var(--primary-50);
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
}

.hero__control {
    position: absolute;
    top: 50%;
    z-index: 5;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 999px;
    color: var(--white);
    background: rgba(0, 0, 0, .5);
    cursor: pointer;
    transform: translateY(-50%);
    transition: background .2s ease, transform .2s ease;
}

.hero__control:hover {
    background: rgba(0, 0, 0, .72);
    transform: translateY(-50%) scale(1.04);
}

.hero__control--prev {
    left: 24px;
}

.hero__control--next {
    right: 24px;
}

.hero__dots {
    position: absolute;
    left: 50%;
    bottom: 24px;
    z-index: 6;
    display: flex;
    gap: 8px;
    transform: translateX(-50%);
}

.hero__dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .45);
    cursor: pointer;
}

.hero__dot.is-active {
    width: 28px;
    background: var(--white);
}

.hero-search {
    position: absolute;
    right: 0;
    bottom: 0;
    width: min(480px, 100%);
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 18px;
    background: rgba(15, 23, 42, .45);
    backdrop-filter: blur(16px);
}

.hero-search input {
    width: 100%;
    padding: 12px 14px;
}

.section {
    padding: 64px 0 0;
}

.section--soft {
    padding: 64px 0;
    margin-top: 64px;
    background: linear-gradient(180deg, var(--white), var(--secondary-100));
}

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

.section__header h1,
.section__header h2 {
    margin: 0;
    color: var(--secondary-900);
    font-size: clamp(26px, 3vw, 38px);
    line-height: 1.18;
    letter-spacing: -.03em;
}

.section__header p,
.lead {
    max-width: 760px;
    margin: 10px 0 0;
    color: var(--secondary-500);
}

.more-link {
    color: var(--primary-600);
    font-weight: 800;
    white-space: nowrap;
}

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

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

.movie-card {
    display: block;
    overflow: hidden;
    border-radius: 16px;
    background: var(--white);
    box-shadow: var(--shadow-soft);
    transition: transform .25s ease, box-shadow .25s ease;
}

.movie-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-soft-lg);
}

.movie-card__poster {
    position: relative;
    display: block;
    aspect-ratio: 4 / 5.4;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-100), var(--secondary-200));
}

.movie-grid--wide .movie-card__poster {
    aspect-ratio: 4 / 3;
}

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

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

.movie-card__badge {
    position: absolute;
    top: 10px;
    right: 10px;
    border-radius: 999px;
    padding: 4px 9px;
    color: var(--white);
    background: rgba(0, 0, 0, .62);
    font-size: 12px;
    font-weight: 800;
}

.movie-card__body {
    display: block;
    padding: 14px;
}

.movie-card__body strong {
    display: -webkit-box;
    min-height: 44px;
    overflow: hidden;
    color: var(--secondary-900);
    font-size: 16px;
    line-height: 1.38;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    transition: color .2s ease;
}

.movie-card:hover strong {
    color: var(--primary-600);
}

.movie-card__meta {
    display: block;
    margin-top: 8px;
    color: var(--secondary-500);
    font-size: 13px;
}

.movie-card__body p {
    display: -webkit-box;
    min-height: 42px;
    margin: 8px 0 0;
    overflow: hidden;
    color: var(--secondary-500);
    font-size: 13px;
    line-height: 1.55;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

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

.category-card {
    position: relative;
    overflow: hidden;
    min-height: 220px;
    padding: 26px;
    border: 1px solid var(--secondary-200);
    border-radius: 22px;
    background: var(--white);
    box-shadow: var(--shadow-soft);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.category-card:hover {
    border-color: rgba(14, 165, 233, .36);
    box-shadow: var(--shadow-soft-lg);
    transform: translateY(-4px);
}

.category-card h2,
.category-card h3 {
    margin: 0 0 10px;
    font-size: 24px;
    letter-spacing: -.02em;
}

.category-card p {
    margin: 0 0 18px;
    color: var(--secondary-500);
}

.category-card__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

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

.ranking-item {
    display: grid;
    grid-template-columns: 54px 96px 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--secondary-200);
    border-radius: 16px;
    background: var(--white);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.ranking-item:hover {
    border-color: rgba(14, 165, 233, .34);
    box-shadow: var(--shadow-soft);
    transform: translateY(-2px);
}

.ranking-item__num {
    color: var(--primary-600);
    font-size: 22px;
    font-weight: 900;
    text-align: center;
}

.ranking-item img {
    width: 96px;
    height: 70px;
    object-fit: cover;
    border-radius: 12px;
}

.ranking-item h2,
.ranking-item h3 {
    margin: 0 0 6px;
    font-size: 18px;
}

.ranking-item p {
    margin: 0;
    color: var(--secondary-500);
}

.ranking-item__action {
    color: var(--primary-600);
    font-weight: 800;
}

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

.breadcrumb a {
    color: var(--primary-600);
    font-weight: 700;
}

.page-hero {
    padding: 58px 0 34px;
    background: radial-gradient(circle at top left, var(--primary-100), transparent 34%), linear-gradient(180deg, var(--white), var(--secondary-50));
}

.page-hero h1 {
    max-width: 850px;
    margin: 0;
    font-size: clamp(34px, 4vw, 52px);
    line-height: 1.12;
    letter-spacing: -.05em;
}

.page-hero p {
    max-width: 800px;
    margin: 16px 0 0;
    color: var(--secondary-500);
    font-size: 18px;
}

.filter-panel,
.search-panel {
    display: grid;
    grid-template-columns: 1.6fr .8fr .8fr;
    gap: 12px;
    margin: 24px 0 30px;
    padding: 16px;
    border: 1px solid var(--secondary-200);
    border-radius: 18px;
    background: var(--white);
    box-shadow: var(--shadow-soft);
}

.filter-panel input,
.filter-panel select,
.search-panel__form input {
    width: 100%;
    padding: 12px 14px;
}

.empty-state {
    display: none;
    padding: 28px;
    border: 1px dashed var(--secondary-300);
    border-radius: 18px;
    color: var(--secondary-500);
    background: var(--white);
    text-align: center;
}

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

.detail-hero {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 36px;
    align-items: center;
    padding: 42px;
    margin-top: 24px;
    border-radius: 28px;
    color: var(--white);
    background: linear-gradient(135deg, var(--secondary-900), #1e293b 58%, var(--primary-700));
    box-shadow: var(--shadow-soft-lg);
}

.detail-hero__poster {
    overflow: hidden;
    border-radius: 22px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .32);
}

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

.detail-hero h1 {
    margin: 0 0 16px;
    font-size: clamp(30px, 4vw, 52px);
    line-height: 1.12;
    letter-spacing: -.04em;
}

.detail-hero p {
    max-width: 820px;
    margin: 18px 0 0;
    color: rgba(255, 255, 255, .86);
    font-size: 18px;
}

.detail-meta span {
    background: rgba(255, 255, 255, .14);
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 22px 0 0;
}

.player-block,
.content-card {
    margin-top: 34px;
    padding: 28px;
    border: 1px solid var(--secondary-200);
    border-radius: 22px;
    background: var(--white);
    box-shadow: var(--shadow-soft);
}

.player-block h2,
.content-card h2 {
    margin: 0 0 16px;
    font-size: 26px;
    letter-spacing: -.03em;
}

.player-shell {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    background: #000;
    box-shadow: 0 22px 60px rgba(15, 23, 42, .28);
}

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

.player-mask {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    border: 0;
    color: var(--white);
    background: linear-gradient(180deg, rgba(0, 0, 0, .28), rgba(0, 0, 0, .68));
    cursor: pointer;
    transition: opacity .25s ease, visibility .25s ease;
}

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

.player-mask__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 74px;
    height: 74px;
    border-radius: 999px;
    color: var(--primary-700);
    background: var(--white);
    font-size: 32px;
    box-shadow: 0 20px 44px rgba(0, 0, 0, .32);
}

.player-mask strong {
    max-width: 80%;
    font-size: 22px;
    text-align: center;
}

.content-card p {
    margin: 0;
    color: var(--secondary-700);
    font-size: 17px;
}

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

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

.search-panel__form {
    align-items: stretch;
}

.search-results {
    margin-top: 28px;
}

.site-footer {
    margin-top: 74px;
    color: var(--secondary-300);
    background: var(--secondary-900);
}

.site-footer__grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr 1fr;
    gap: 34px;
    padding: 44px 0;
}

.site-footer .brand {
    color: var(--white);
}

.site-footer p {
    max-width: 520px;
    margin: 16px 0 0;
    color: var(--secondary-300);
}

.site-footer h2 {
    margin: 0 0 12px;
    color: var(--white);
    font-size: 18px;
}

.site-footer a:not(.brand) {
    display: block;
    margin: 8px 0;
    color: var(--secondary-300);
    transition: color .2s ease;
}

.site-footer a:hover {
    color: var(--primary-400);
}

.site-footer__bottom {
    padding: 18px 0;
    border-top: 1px solid rgba(148, 163, 184, .18);
    color: var(--secondary-400);
    font-size: 14px;
}

@media (max-width: 1100px) {
    .site-nav {
        gap: 12px;
    }

    .header-search input {
        width: 140px;
    }

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

@media (max-width: 860px) {
    .site-nav,
    .header-search {
        display: none;
    }

    .mobile-menu-button {
        display: inline-flex;
        margin-left: auto;
    }

    .hero {
        height: 620px;
    }

    .hero__content {
        bottom: 94px;
    }

    .hero-search {
        position: static;
        width: 100%;
        margin-top: 22px;
    }

    .hero__control {
        top: auto;
        bottom: 24px;
        transform: none;
    }

    .hero__control:hover {
        transform: scale(1.04);
    }

    .hero__control--prev {
        left: 16px;
    }

    .hero__control--next {
        right: 16px;
    }

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

    .category-grid,
    .site-footer__grid {
        grid-template-columns: 1fr;
    }

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

    .detail-hero {
        grid-template-columns: 1fr;
        padding: 24px;
    }

    .detail-hero__poster {
        width: min(260px, 72vw);
    }

    .ranking-item {
        grid-template-columns: 42px 78px 1fr;
    }

    .ranking-item__action {
        display: none;
    }

    .ranking-item img {
        width: 78px;
        height: 58px;
    }
}

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

    .brand__name {
        font-size: 18px;
    }

    .hero {
        height: 650px;
    }

    .hero h1,
    .hero h2 {
        font-size: 32px;
    }

    .hero__summary {
        font-size: 16px;
    }

    .hero__actions,
    .hero-search,
    .search-panel__form {
        flex-direction: column;
        align-items: stretch;
    }

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

    .section {
        padding-top: 48px;
    }

    .section__header {
        display: block;
    }

    .page-hero {
        padding: 42px 0 24px;
    }

    .player-block,
    .content-card {
        padding: 18px;
    }
}
