:root {
    --deep-950: #020617;
    --deep-900: #071426;
    --deep-850: #0b1f3a;
    --deep-800: #102a47;
    --ocean-500: #0ea5e9;
    --ocean-400: #38bdf8;
    --teal-400: #2dd4bf;
    --gold: #fbbf24;
    --text: #e5f2ff;
    --muted: #93b4d1;
    --line: rgba(148, 211, 255, 0.18);
    --card: rgba(10, 31, 55, 0.72);
    --glass: rgba(8, 25, 45, 0.68);
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 18% 8%, rgba(14, 165, 233, 0.18), transparent 28rem),
        radial-gradient(circle at 82% 18%, rgba(45, 212, 191, 0.12), transparent 24rem),
        linear-gradient(180deg, var(--deep-950), var(--deep-900) 42%, var(--deep-950));
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    min-height: 100vh;
}

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

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

button,
input {
    font: inherit;
}

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

.site-header__inner {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: max-content;
}

.site-logo__mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--ocean-500), var(--teal-400));
    box-shadow: 0 14px 32px rgba(14, 165, 233, 0.38);
}

.site-logo__text {
    display: grid;
    line-height: 1.12;
}

.site-logo__text strong {
    font-size: 20px;
    letter-spacing: 0.02em;
}

.site-logo__text small {
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.nav-link {
    padding: 10px 14px;
    border-radius: 12px;
    color: #c7e6ff;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
    color: #ffffff;
    background: rgba(56, 189, 248, 0.14);
    transform: translateY(-1px);
}

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

.header-search input,
.mobile-search input,
.search-hero input,
.search-page-form input {
    color: #ffffff;
    background: rgba(12, 35, 62, 0.88);
    border: 1px solid rgba(56, 189, 248, 0.28);
    border-radius: 14px;
    outline: none;
    padding: 12px 14px;
    min-width: 220px;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.header-search input:focus,
.mobile-search input:focus,
.search-hero input:focus,
.search-page-form input:focus {
    border-color: var(--ocean-400);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
}

.header-search button,
.mobile-search button,
.search-hero button,
.search-page-form button,
.hero-button,
.primary-button,
.secondary-button {
    border: 0;
    cursor: pointer;
    color: #ffffff;
    border-radius: 14px;
    padding: 12px 18px;
    background: linear-gradient(135deg, var(--ocean-500), var(--teal-400));
    box-shadow: 0 14px 34px rgba(14, 165, 233, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.header-search button:hover,
.mobile-search button:hover,
.search-hero button:hover,
.search-page-form button:hover,
.hero-button:hover,
.primary-button:hover,
.secondary-button:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
    box-shadow: 0 18px 42px rgba(14, 165, 233, 0.36);
}

.secondary-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: none;
}

.mobile-menu-button {
    display: none;
    margin-left: auto;
    color: #ffffff;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    padding: 10px 12px;
}

.mobile-panel {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(4, 18, 35, 0.94);
}

.mobile-panel nav {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.hero {
    position: relative;
    min-height: 72vh;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

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

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

.hero-slide__image {
    position: absolute;
    inset: 0;
}

.hero-slide__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.05) contrast(1.05);
}

.hero-slide__image::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(7, 20, 38, 0.82) 44%, rgba(7, 20, 38, 0.18) 100%),
        linear-gradient(0deg, rgba(2, 6, 23, 0.98), rgba(2, 6, 23, 0.12) 52%, rgba(2, 6, 23, 0.72));
}

.hero__content {
    position: relative;
    z-index: 2;
    width: min(1240px, calc(100% - 32px));
    min-height: 72vh;
    margin: 0 auto;
    display: grid;
    align-items: center;
    padding: 90px 0 72px;
}

.hero__text {
    width: min(690px, 100%);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #b7ecff;
    background: rgba(14, 165, 233, 0.18);
    border: 1px solid rgba(56, 189, 248, 0.24);
    border-radius: 999px;
    padding: 8px 12px;
    margin-bottom: 18px;
}

.hero h1,
.hero h2,
.page-hero h1,
.detail-title h1 {
    margin: 0;
    color: #ffffff;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.06;
}

.hero h1,
.hero h2 {
    font-size: clamp(38px, 7vw, 78px);
}

.hero__summary {
    margin: 22px 0 0;
    font-size: clamp(17px, 2vw, 22px);
    color: #d6eeff;
    line-height: 1.75;
}

.hero__meta,
.movie-card__meta,
.compact-card__meta,
.detail-meta,
.tag-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
}

.hero__meta {
    margin: 24px 0 30px;
}

.hero__meta span,
.movie-card__meta span,
.compact-card__meta span,
.detail-meta span,
.tag-list span {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    color: #bfeaff;
    background: rgba(56, 189, 248, 0.14);
    border: 1px solid rgba(56, 189, 248, 0.18);
    font-size: 13px;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

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

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

.hero-dot.is-active {
    background: linear-gradient(90deg, var(--ocean-400), var(--teal-400));
}

.search-hero {
    position: relative;
    z-index: 4;
    width: min(1240px, calc(100% - 32px));
    margin: -44px auto 44px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(5, 21, 40, 0.88);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.search-hero form,
.search-page-form {
    display: flex;
    gap: 12px;
}

.search-hero input,
.search-page-form input {
    flex: 1;
}

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

.section-block {
    margin: 54px 0;
}

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

.section-heading h2,
.page-hero h1,
.detail-section h2 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(26px, 3vw, 38px);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.section-heading p,
.page-hero p,
.category-card p,
.detail-section p,
.search-empty {
    color: var(--muted);
    line-height: 1.75;
}

.text-link {
    color: #9de8ff;
    font-weight: 700;
}

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

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

.movie-card,
.category-card,
.info-panel,
.detail-section,
.player-card,
.ranking-card,
.search-result-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.22);
    overflow: hidden;
}

.movie-card {
    transition: transform 0.25s ease, border 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(56, 189, 248, 0.42);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
}

.movie-card__poster {
    position: relative;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: rgba(15, 45, 76, 0.78);
}

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

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

.movie-card__play {
    position: absolute;
    right: 12px;
    bottom: 12px;
    color: #ffffff;
    background: rgba(14, 165, 233, 0.88);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 700;
}

.movie-card__body {
    padding: 16px;
}

.movie-card h3,
.compact-card h3,
.category-card h2,
.search-result-card h2 {
    margin: 0;
    color: #ffffff;
    font-size: 18px;
    font-weight: 760;
    line-height: 1.35;
}

.movie-card p,
.compact-card p,
.search-result-card p {
    margin: 10px 0 14px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.68;
}

.movie-card__meta,
.compact-card__meta {
    gap: 6px;
}

.movie-card__meta span,
.compact-card__meta span {
    padding: 4px 8px;
    font-size: 12px;
}

.compact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.compact-card {
    position: relative;
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 12px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(8, 25, 45, 0.62);
}

.compact-card__rank {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #071426;
    font-weight: 900;
    background: linear-gradient(135deg, #fef08a, #fb923c);
}

.compact-card__poster {
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 15px;
    background: rgba(15, 45, 76, 0.78);
}

.compact-card__poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.category-card {
    padding: 24px;
    transition: transform 0.2s ease, border 0.2s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: rgba(56, 189, 248, 0.42);
}

.category-card__count {
    display: inline-flex;
    color: #cff4ff;
    margin: 16px 0;
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(14, 165, 233, 0.18);
}

.page-hero {
    padding: 74px 0 34px;
}

.page-hero__panel {
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 30px;
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 38%),
        rgba(5, 21, 40, 0.78);
    box-shadow: var(--shadow);
}

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

.breadcrumb a {
    color: #a9ebff;
}

.detail-hero {
    display: grid;
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
    gap: 34px;
    align-items: end;
    padding: 32px;
    border-radius: 32px;
    border: 1px solid var(--line);
    background:
        linear-gradient(135deg, rgba(8, 25, 45, 0.88), rgba(6, 78, 95, 0.32)),
        rgba(5, 21, 40, 0.86);
    box-shadow: var(--shadow);
}

.detail-poster {
    overflow: hidden;
    border-radius: 26px;
    aspect-ratio: 2 / 3;
    background: rgba(15, 45, 76, 0.78);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
}

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

.detail-title h1 {
    font-size: clamp(34px, 5vw, 62px);
}

.detail-title .one-line {
    margin: 20px 0 22px;
    color: #d6eeff;
    line-height: 1.82;
    font-size: 18px;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 28px;
    margin-top: 34px;
}

.player-card {
    padding: 22px;
}

.player-shell {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 22px;
    background: #000000;
    cursor: pointer;
}

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

.player-poster {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.38);
    z-index: 3;
}

.player-poster img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.45) saturate(1.1);
}

.player-poster.is-hidden {
    display: none;
}

.play-button {
    position: relative;
    z-index: 2;
    width: 84px;
    height: 84px;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    font-size: 30px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--ocean-500), var(--teal-400));
    box-shadow: 0 20px 50px rgba(14, 165, 233, 0.38);
}

.player-title {
    margin: 18px 0 0;
    color: #ffffff;
    font-size: 24px;
    font-weight: 800;
}

.detail-section {
    margin-top: 24px;
    padding: 26px;
}

.detail-section h2 {
    font-size: 25px;
    margin-bottom: 12px;
}

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

.info-panel {
    padding: 22px;
}

.info-panel h2 {
    margin: 0 0 14px;
    font-size: 21px;
    color: #ffffff;
}

.info-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

.info-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

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

.info-row dd {
    margin: 0;
    color: #ffffff;
    text-align: right;
}

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

.ranking-card {
    display: grid;
    grid-template-columns: 80px 98px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 14px;
}

.ranking-card__number {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    font-size: 20px;
    font-weight: 900;
    color: #071426;
    background: linear-gradient(135deg, #fef08a, #f97316);
}

.ranking-card__poster {
    overflow: hidden;
    border-radius: 14px;
    aspect-ratio: 2 / 3;
    background: rgba(15, 45, 76, 0.78);
}

.ranking-card__poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ranking-card h2 {
    margin: 0;
    font-size: 20px;
}

.ranking-card p {
    margin: 8px 0 10px;
    color: var(--muted);
    line-height: 1.6;
}

.ranking-card__score {
    color: #fef3c7;
    font-weight: 800;
}

.search-result-grid {
    display: grid;
    gap: 18px;
    margin-top: 28px;
}

.search-result-card {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 18px;
    padding: 14px;
}

.search-result-card img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 16px;
    background: rgba(15, 45, 76, 0.78);
}

.pagination-note {
    margin-top: 22px;
    color: var(--muted);
    text-align: center;
}

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

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

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

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

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

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

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

    .site-header__inner {
        min-height: 68px;
    }

    .site-logo__text strong {
        font-size: 17px;
    }

    .hero,
    .hero__content {
        min-height: 630px;
    }

    .search-hero form,
    .search-page-form {
        flex-direction: column;
    }

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

    .compact-grid,
    .category-grid,
    .side-panel {
        grid-template-columns: 1fr;
    }

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

    .detail-poster {
        max-width: 320px;
    }

    .ranking-card {
        grid-template-columns: 54px 84px minmax(0, 1fr);
    }

    .ranking-card__score {
        grid-column: 3;
    }
}

@media (max-width: 540px) {
    .site-header__inner,
    .mobile-panel,
    .main-wrap,
    .page-wrap,
    .detail-wrap,
    .hero__content,
    .search-hero {
        width: min(100% - 22px, 1240px);
    }

    .site-logo__text small {
        display: none;
    }

    .hero__actions,
    .section-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .movie-grid,
    .movie-grid.movie-grid--wide {
        grid-template-columns: 1fr;
    }

    .ranking-card,
    .search-result-card {
        grid-template-columns: 1fr;
    }

    .ranking-card__number {
        width: 48px;
        height: 48px;
    }
}
