:root {
    --bg: #020617;
    --bg-soft: #0f172a;
    --bg-card: rgba(15, 23, 42, 0.72);
    --bg-card-strong: rgba(15, 23, 42, 0.94);
    --line: rgba(148, 163, 184, 0.16);
    --text: #f8fafc;
    --muted: #94a3b8;
    --muted-strong: #cbd5e1;
    --cyan: #22d3ee;
    --cyan-deep: #0891b2;
    --cyan-soft: rgba(34, 211, 238, 0.18);
    --shadow: 0 24px 80px rgba(2, 6, 23, 0.48);
    --radius: 18px;
    --max: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

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

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

button,
input,
select {
    font: inherit;
}

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

.header-inner {
    width: min(100%, var(--max));
    margin: 0 auto;
    padding: 14px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.brand-mark {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--cyan-deep), var(--cyan));
    color: #001018;
    box-shadow: 0 12px 28px rgba(34, 211, 238, 0.24);
}

.brand-text {
    font-size: 20px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 26px;
}

.nav-link {
    color: var(--muted-strong);
    font-size: 15px;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--cyan);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-button,
.search-close {
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.72);
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.icon-button:hover,
.search-close:hover {
    background: rgba(34, 211, 238, 0.12);
    color: var(--cyan);
    transform: translateY(-1px);
}

.menu-toggle {
    display: none;
}

.mobile-panel {
    display: none;
    width: min(100%, var(--max));
    margin: 0 auto;
    padding: 0 22px 18px;
}

.mobile-panel.open {
    display: grid;
    gap: 10px;
}

.mobile-link {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.72);
    color: var(--muted-strong);
}

.search-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 90px 20px 20px;
    background: rgba(2, 6, 23, 0.76);
    backdrop-filter: blur(18px);
}

.search-overlay.open {
    display: flex;
}

.search-panel {
    width: min(720px, 100%);
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.96);
    box-shadow: var(--shadow);
    padding: 22px;
}

.search-panel-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

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

.global-search-input,
.search-page-form input,
.page-filter-search,
.filter-panel select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(2, 6, 23, 0.72);
    color: var(--text);
    padding: 13px 15px;
    outline: none;
}

.global-search-input:focus,
.search-page-form input:focus,
.page-filter-search:focus,
.filter-panel select:focus {
    border-color: rgba(34, 211, 238, 0.72);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

.primary-button,
.watch-button {
    border: 0;
    border-radius: 14px;
    background: var(--cyan-deep);
    color: #ffffff;
    padding: 13px 24px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease, transform 0.2s ease;
}

.primary-button:hover,
.watch-button:hover {
    background: #0e7490;
    transform: translateY(-1px);
}

.live-search-results {
    display: grid;
    gap: 10px;
    margin-top: 16px;
    max-height: 420px;
    overflow: auto;
}

.live-result {
    display: grid;
    grid-template-columns: 62px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: 14px;
    background: rgba(2, 6, 23, 0.46);
    transition: background 0.2s ease;
}

.live-result:hover {
    background: rgba(34, 211, 238, 0.12);
}

.live-result img {
    width: 62px;
    height: 82px;
    object-fit: cover;
    border-radius: 10px;
    background: #0f172a;
}

.live-result strong,
.live-result span {
    display: block;
}

.live-result span {
    color: var(--muted);
    font-size: 13px;
    margin-top: 4px;
}

.hero-section {
    position: relative;
    min-height: 70vh;
    overflow: hidden;
}

.hero-backdrop,
.hero-backdrop img,
.hero-fade {
    position: absolute;
    inset: 0;
}

.hero-backdrop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
    transition: opacity 0.35s ease, transform 0.6s ease;
}

.hero-fade {
    background: linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.84) 28%, rgba(2, 6, 23, 0.44) 58%, rgba(2, 6, 23, 0.12) 100%);
}

.hero-inner {
    position: relative;
    width: min(100%, var(--max));
    min-height: 70vh;
    margin: 0 auto;
    padding: 96px 22px 64px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 44px;
    align-items: end;
}

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

.pill,
.eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    color: var(--cyan);
    background: var(--cyan-soft);
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.eyebrow {
    margin: 0 0 12px;
    text-transform: uppercase;
}

.hero-title {
    margin: 18px 0 12px;
    font-size: clamp(40px, 6vw, 68px);
    line-height: 1.02;
    letter-spacing: -0.05em;
}

.hero-line {
    max-width: 620px;
    margin: 0 0 22px;
    color: var(--muted-strong);
    font-size: 18px;
    line-height: 1.7;
}

.hero-meta,
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    margin-bottom: 24px;
}

.hero-meta span,
.hero-meta a,
.detail-meta span,
.detail-meta a {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid var(--line);
    padding: 8px 12px;
    color: var(--muted-strong);
    font-size: 13px;
}

.hero-category,
.detail-meta a {
    color: var(--cyan) !important;
    background: var(--cyan-soft) !important;
}

.hero-stack {
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.76);
    box-shadow: var(--shadow);
    padding: 18px;
    backdrop-filter: blur(18px);
}

.hero-pick {
    width: 100%;
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    align-items: center;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: var(--text);
    padding: 10px;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.hero-pick:hover,
.hero-pick.active {
    background: rgba(34, 211, 238, 0.12);
    transform: translateX(2px);
}

.hero-pick img {
    width: 72px;
    height: 52px;
    object-fit: cover;
    border-radius: 12px;
    background: #0f172a;
}

.hero-pick strong,
.hero-pick em {
    display: block;
}

.hero-pick strong {
    font-size: 14px;
    line-height: 1.35;
}

.hero-pick em {
    color: var(--muted);
    font-size: 12px;
    margin-top: 3px;
    font-style: normal;
}

.content-section {
    width: min(100%, var(--max));
    margin: 0 auto;
    padding: 70px 22px;
}

.surface-section {
    width: 100%;
    max-width: none;
    padding-left: max(22px, calc((100vw - var(--max)) / 2 + 22px));
    padding-right: max(22px, calc((100vw - var(--max)) / 2 + 22px));
    background: rgba(15, 23, 42, 0.36);
}

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

.section-heading h2,
.page-hero h1,
.detail-title-block h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 42px);
    letter-spacing: -0.03em;
}

.text-link {
    color: var(--cyan);
    font-weight: 700;
}

.movie-grid {
    display: grid;
    gap: 20px;
}

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

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

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

.mosaic-grid {
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: 12px;
}

.movie-card {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--line);
    box-shadow: 0 18px 48px rgba(2, 6, 23, 0.22);
    transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-4px);
    border-color: rgba(34, 211, 238, 0.38);
    background: var(--bg-card-strong);
}

.poster-wrap {
    position: relative;
    display: block;
    overflow: hidden;
    background: #0f172a;
}

.movie-card.large .poster-wrap {
    aspect-ratio: 16 / 9;
}

.movie-card.medium .poster-wrap,
.movie-card.small .poster-wrap {
    aspect-ratio: 2 / 3;
}

.movie-card.mosaic .poster-wrap {
    aspect-ratio: 1;
}

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

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

.poster-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.12) 58%, rgba(0, 0, 0, 0));
}

.play-badge {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(8, 145, 178, 0.92);
    color: #ffffff;
    transform: translate(-50%, -50%) scale(0.86);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

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

.movie-info {
    position: absolute;
    inset: auto 0 0 0;
    display: block;
    padding: 18px;
}

.movie-info strong,
.movie-info span {
    display: block;
}

.movie-info strong {
    color: #ffffff;
    line-height: 1.35;
}

.movie-line {
    color: var(--muted-strong);
    font-size: 13px;
    line-height: 1.55;
    margin-top: 8px;
}

.movie-meta {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    margin-top: 10px;
}

.small .movie-info {
    padding: 12px;
}

.small .movie-line {
    display: none;
}

.mosaic-grid .movie-card:nth-child(1),
.mosaic-grid .movie-card:nth-child(5),
.mosaic-grid .movie-card:nth-child(9) {
    grid-column: span 2;
    grid-row: span 2;
}

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

.category-tile,
.category-overview-card {
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.64);
    overflow: hidden;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

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

.category-covers,
.category-overview-media {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
    padding: 3px;
    background: rgba(2, 6, 23, 0.72);
}

.category-covers img,
.category-overview-media img {
    width: 100%;
    height: 112px;
    object-fit: cover;
    background: #0f172a;
}

.category-copy,
.category-overview-body {
    display: block;
    padding: 18px;
}

.category-copy strong,
.category-copy em,
.category-overview-body h2,
.category-overview-body p {
    display: block;
}

.category-copy strong,
.category-overview-body h2 {
    margin: 0 0 8px;
    font-size: 20px;
}

.category-copy em,
.category-overview-body p {
    color: var(--muted);
    font-style: normal;
    line-height: 1.65;
}

.category-overview-grid {
    display: grid;
    gap: 24px;
}

.category-overview-card {
    display: grid;
    grid-template-columns: 44% 1fr;
}

.category-overview-media {
    grid-template-columns: repeat(3, 1fr);
}

.category-overview-media img {
    height: 150px;
}

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

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

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

.related-list .rank-item,
.rank-list:not(.full):not(.compact) .rank-item {
    grid-template-columns: 104px 1fr;
}

.related-list .rank-number,
.rank-list:not(.full):not(.compact) .rank-number {
    display: none;
}

.rank-item:hover {
    background: rgba(15, 23, 42, 0.95);
    transform: translateX(3px);
    border-color: rgba(34, 211, 238, 0.32);
}

.rank-number {
    color: rgba(148, 163, 184, 0.42);
    font-size: 30px;
    font-weight: 900;
}

.rank-thumb img {
    width: 112px;
    height: 72px;
    border-radius: 12px;
    object-fit: cover;
    background: #0f172a;
}

.related-list .rank-thumb img,
.rank-list:not(.full):not(.compact) .rank-thumb img {
    width: 104px;
    height: 78px;
}

.rank-copy strong,
.rank-copy span,
.rank-copy em {
    display: block;
}

.rank-copy strong {
    color: #ffffff;
    line-height: 1.35;
}

.rank-copy span {
    color: var(--muted-strong);
    font-size: 13px;
    line-height: 1.5;
    margin-top: 6px;
}

.rank-copy em {
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
    margin-top: 6px;
}

.page-hero {
    width: min(100%, var(--max));
    margin: 0 auto;
    padding: 76px 22px 24px;
}

.compact-hero > div {
    border: 1px solid var(--line);
    border-radius: 26px;
    background: radial-gradient(circle at 20% 0%, rgba(34, 211, 238, 0.18), transparent 32%), rgba(15, 23, 42, 0.66);
    padding: 38px;
    box-shadow: var(--shadow);
}

.compact-hero p:last-child {
    max-width: 740px;
    color: var(--muted-strong);
    line-height: 1.7;
}

.filter-panel {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 170px 170px 170px;
    gap: 12px;
    margin-bottom: 26px;
}

.detail-shell {
    width: min(100%, var(--max));
    margin: 0 auto;
    padding: 32px 22px 80px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 22px;
}

.breadcrumb a {
    color: var(--cyan);
}

.breadcrumb strong {
    color: var(--muted-strong);
    font-weight: 500;
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
    gap: 32px;
}

.player-card {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    background: #000000;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

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

.player-start,
.player-loader,
.player-error {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.42);
    border: 0;
}

.player-start {
    cursor: pointer;
}

.player-start span {
    width: 76px;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(8, 145, 178, 0.94);
    box-shadow: 0 18px 46px rgba(34, 211, 238, 0.28);
    font-size: 30px;
}

.player-start strong {
    font-size: 18px;
}

.player-loader {
    display: none;
    background: rgba(0, 0, 0, 0.68);
}

.player-card.loading .player-loader {
    display: flex;
}

.player-card.started .player-start {
    display: none;
}

.player-error {
    background: rgba(0, 0, 0, 0.82);
    color: #ffffff;
    padding: 22px;
    text-align: center;
}

.player-error[hidden] {
    display: none;
}

.detail-title-block {
    margin: 26px 0;
}

.info-card {
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.58);
    padding: 24px;
    margin-bottom: 18px;
}

.info-card h2,
.sticky-box h2 {
    margin: 0 0 14px;
    font-size: 22px;
}

.info-card p {
    margin: 0;
    color: var(--muted-strong);
    line-height: 1.88;
}

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

.movie-facts div {
    border-radius: 14px;
    background: rgba(2, 6, 23, 0.36);
    padding: 14px;
}

.movie-facts dt {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 7px;
}

.movie-facts dd {
    margin: 0;
    color: #ffffff;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid var(--line);
    color: var(--muted-strong);
    padding: 8px 12px;
    transition: background 0.2s ease, color 0.2s ease;
}

.tag:hover {
    background: var(--cyan-soft);
    color: var(--cyan);
}

.detail-side {
    min-width: 0;
}

.sticky-box {
    position: sticky;
    top: 92px;
}

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

.footer-inner {
    width: min(100%, var(--max));
    margin: 0 auto;
    padding: 46px 22px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
    gap: 44px;
}

.footer-about p {
    max-width: 520px;
    color: var(--muted);
    line-height: 1.7;
}

.footer-columns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 26px;
}

.footer-columns h3 {
    margin: 0 0 14px;
}

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

.footer-columns a {
    color: var(--muted);
}

.footer-columns a:hover {
    color: var(--cyan);
}

.search-page-form {
    max-width: 680px;
    margin-top: 22px;
}

.empty-state {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.62);
    padding: 28px;
    color: var(--muted-strong);
}

@media (max-width: 1100px) {
    .large-grid,
    .medium-grid,
    .category-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

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

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

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

    .hero-stack .eyebrow {
        grid-column: 1 / -1;
    }

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

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

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .header-inner {
        padding: 12px 16px;
    }

    .hero-section,
    .hero-inner {
        min-height: auto;
    }

    .hero-inner {
        padding: 74px 16px 42px;
    }

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

    .content-section,
    .page-hero,
    .detail-shell {
        padding-left: 16px;
        padding-right: 16px;
    }

    .section-heading,
    .footer-inner {
        display: block;
    }

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

    .category-overview-card {
        grid-template-columns: 1fr;
    }

    .rank-list.compact {
        grid-template-columns: 1fr;
    }

    .rank-item,
    .related-list .rank-item,
    .rank-list:not(.full):not(.compact) .rank-item {
        grid-template-columns: 92px 1fr;
    }

    .rank-number {
        display: none;
    }

    .rank-thumb img,
    .related-list .rank-thumb img,
    .rank-list:not(.full):not(.compact) .rank-thumb img {
        width: 92px;
        height: 70px;
    }

    .filter-panel,
    .movie-facts,
    .footer-columns {
        grid-template-columns: 1fr;
    }

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

    .compact-hero > div {
        padding: 26px;
    }
}

@media (max-width: 480px) {
    .large-grid,
    .medium-grid,
    .small-grid,
    .category-grid,
    .mosaic-grid {
        grid-template-columns: 1fr;
    }

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

    .movie-info {
        padding: 14px;
    }

    .search-overlay {
        padding-top: 70px;
    }
}
