:root {
    color-scheme: dark;
    --bg: #05030a;
    --panel: rgba(255, 255, 255, 0.08);
    --panel-strong: rgba(255, 255, 255, 0.14);
    --line: rgba(233, 213, 255, 0.22);
    --text: #ffffff;
    --muted: #c9b8df;
    --soft: #9ca3af;
    --purple: #a855f7;
    --pink: #ec4899;
    --blue: #3b82f6;
    --yellow: #facc15;
    --radius: 24px;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(168, 85, 247, 0.34), transparent 34rem),
        radial-gradient(circle at 80% 10%, rgba(236, 72, 153, 0.24), transparent 30rem),
        linear-gradient(135deg, #05030a 0%, #130a2a 45%, #2a0e34 100%);
    color: var(--text);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent 75%);
    z-index: -1;
}

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;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 18px;
    padding: 14px clamp(16px, 3vw, 48px);
    border-bottom: 1px solid rgba(233, 213, 255, 0.2);
    background: linear-gradient(90deg, rgba(49, 46, 129, 0.95), rgba(88, 28, 135, 0.95), rgba(131, 24, 67, 0.95));
    backdrop-filter: blur(18px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 19px;
    letter-spacing: 0.02em;
}

.logo-mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--purple), var(--pink));
    color: #fff;
    font-weight: 900;
    box-shadow: 0 12px 24px rgba(168, 85, 247, 0.32);
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.main-nav a {
    padding: 8px 12px;
    border-radius: 999px;
    color: #eadcff;
    transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.main-nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

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

.header-search input,
.big-search input {
    min-width: 220px;
    border: 1px solid rgba(233, 213, 255, 0.32);
    border-radius: 999px;
    padding: 11px 14px;
    background: rgba(255, 255, 255, 0.11);
    color: #fff;
    outline: none;
}

.header-search input::placeholder,
.big-search input::placeholder {
    color: rgba(233, 213, 255, 0.68);
}

.header-search button,
.big-search button,
.primary-btn,
.ghost-btn {
    border: 0;
    border-radius: 999px;
    padding: 11px 18px;
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.header-search button,
.big-search button,
.primary-btn {
    background: linear-gradient(135deg, var(--purple), var(--pink));
    box-shadow: 0 14px 28px rgba(168, 85, 247, 0.32);
}

.ghost-btn {
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.11);
}

.header-search button:hover,
.big-search button:hover,
.primary-btn:hover,
.ghost-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(236, 72, 153, 0.28);
}

.hero-shell {
    position: relative;
    width: min(1460px, calc(100% - 32px));
    margin: 24px auto 0;
}

.hero-carousel {
    position: relative;
    min-height: 660px;
    border: 1px solid rgba(233, 213, 255, 0.24);
    border-radius: 36px;
    overflow: hidden;
    box-shadow: var(--shadow);
    background: #0f0624;
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.48fr);
    align-items: center;
    gap: clamp(22px, 4vw, 72px);
    padding: clamp(28px, 5vw, 82px);
    opacity: 0;
    visibility: hidden;
    transform: scale(1.02);
    transition: opacity 0.7s ease, transform 0.7s ease, visibility 0.7s ease;
}

.hero-slide::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(5, 3, 10, 0.96) 0%, rgba(12, 6, 30, 0.76) 48%, rgba(5, 3, 10, 0.35) 100%),
        var(--hero-image) center / cover no-repeat;
    filter: saturate(1.1);
    z-index: -2;
}

.hero-slide::after {
    content: "";
    position: absolute;
    inset: auto -20% -46% 20%;
    height: 460px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.4), transparent 62%);
    z-index: -1;
}

.hero-slide.is-active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

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

.eyebrow {
    margin: 0 0 12px;
    color: #d8b4fe;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero-copy h1,
.page-hero h1,
.detail-info h1 {
    margin: 0;
    font-size: clamp(42px, 6vw, 82px);
    line-height: 0.98;
    letter-spacing: -0.06em;
}

.hero-desc {
    margin: 24px 0 0;
    max-width: 660px;
    color: #e9d5ff;
    font-size: clamp(18px, 2vw, 23px);
    line-height: 1.75;
}

.hero-tags,
.tag-list,
.genre-row,
.meta-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.hero-tags {
    margin: 26px 0 0;
}

.hero-tags span,
.tag-list span,
.genre-row span,
.meta-pills span {
    border: 1px solid rgba(233, 213, 255, 0.25);
    border-radius: 999px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #f2e8ff;
    font-size: 13px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

.hero-poster {
    display: block;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.48);
    transform: rotate(2deg);
    transition: transform 0.25s ease;
}

.hero-poster:hover {
    transform: rotate(0deg) translateY(-4px);
}

.hero-poster img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.4), rgba(236, 72, 153, 0.22));
}

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

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

.hero-dot.is-active {
    background: linear-gradient(90deg, var(--purple), var(--pink));
}

.search-panel,
.section-block,
.page-hero,
.content-panel,
.player-section,
.detail-hero,
.breadcrumb {
    width: min(1460px, calc(100% - 32px));
    margin-left: auto;
    margin-right: auto;
}

.search-panel {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 18px;
    margin-top: 28px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
}

.search-panel h2,
.section-title h2,
.page-hero h1,
.content-panel h2 {
    margin: 0;
}

.quick-search-results {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.quick-result,
.wide-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid rgba(233, 213, 255, 0.14);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.07);
    transition: transform 0.2s ease, background 0.2s ease;
}

.quick-result:hover,
.wide-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.12);
}

.quick-result img,
.wide-item img {
    width: 52px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
}

.quick-result strong,
.wide-item strong {
    display: block;
    font-size: 14px;
}

.quick-result em,
.wide-item em {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

.search-empty {
    color: var(--muted);
}

.section-block {
    margin-top: 48px;
}

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

.section-title a {
    color: #d8b4fe;
}

.section-title h2 {
    font-size: clamp(26px, 3vw, 38px);
    letter-spacing: -0.03em;
}

.section-title.compact {
    align-items: center;
}

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

.category-grid.large {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.category-tile {
    min-height: 146px;
    padding: 22px;
    border: 1px solid rgba(233, 213, 255, 0.18);
    border-radius: 26px;
    background:
        linear-gradient(135deg, rgba(168, 85, 247, 0.18), rgba(236, 72, 153, 0.12)),
        rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 46px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-tile:hover {
    transform: translateY(-4px);
    border-color: rgba(216, 180, 254, 0.55);
}

.category-tile strong {
    display: block;
    margin-bottom: 12px;
    font-size: 21px;
}

.category-tile span {
    color: var(--muted);
    line-height: 1.65;
}

.split-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 26px;
    align-items: start;
}

.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(174px, 1fr));
    gap: 18px;
}

.movie-card {
    overflow: hidden;
    border: 1px solid rgba(233, 213, 255, 0.16);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.075);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.movie-card:hover {
    transform: translateY(-5px);
    border-color: rgba(216, 180, 254, 0.55);
    background: rgba(255, 255, 255, 0.11);
}

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

.poster-wrap {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 2 / 3;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.24), rgba(236, 72, 153, 0.14));
}

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

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

.poster-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.68), transparent 52%);
}

.play-dot,
.rank-badge {
    position: absolute;
    display: grid;
    place-items: center;
    color: #fff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}

.play-dot {
    right: 12px;
    bottom: 12px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple), var(--pink));
}

.rank-badge {
    left: 10px;
    top: 10px;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, #eab308, #f97316);
    font-size: 13px;
}

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

.movie-title {
    display: block;
    overflow: hidden;
    min-height: 44px;
    color: #fff;
    font-weight: 800;
    line-height: 1.35;
}

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

.movie-line {
    display: -webkit-box;
    overflow: hidden;
    min-height: 42px;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.tag-list {
    margin-top: 12px;
}

.tag-list span {
    font-size: 12px;
    color: #e9d5ff;
}

.ranking-panel {
    position: sticky;
    top: 86px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.wide-list {
    display: grid;
    gap: 12px;
}

.page-main,
.detail-main {
    padding: 26px 0 64px;
}

.page-hero {
    padding: clamp(28px, 5vw, 58px);
    border: 1px solid rgba(233, 213, 255, 0.22);
    border-radius: 32px;
    background:
        linear-gradient(135deg, rgba(49, 46, 129, 0.55), rgba(88, 28, 135, 0.34), rgba(131, 24, 67, 0.34)),
        rgba(255, 255, 255, 0.06);
    box-shadow: var(--shadow);
}

.page-hero p {
    max-width: 820px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.8;
}

.small-hero h1 {
    font-size: clamp(36px, 5vw, 64px);
}

.inline-filter {
    margin-top: 24px;
    justify-content: flex-start;
}

.filter-status {
    min-height: 22px;
    margin-bottom: 0;
    color: #d8b4fe;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 14px;
}

.detail-hero {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: clamp(24px, 4vw, 54px);
    align-items: center;
    padding: clamp(22px, 4vw, 50px);
    border: 1px solid rgba(233, 213, 255, 0.22);
    border-radius: 34px;
    background:
        radial-gradient(circle at right top, rgba(236, 72, 153, 0.24), transparent 28rem),
        rgba(255, 255, 255, 0.075);
    box-shadow: var(--shadow);
}

.detail-poster {
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.08);
}

.detail-poster img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
}

.detail-info h1 {
    font-size: clamp(38px, 5.2vw, 76px);
}

.detail-line {
    max-width: 880px;
    color: #e9d5ff;
    font-size: 20px;
    line-height: 1.8;
}

.meta-pills,
.strong-tags {
    margin-top: 18px;
}

.anchor-play {
    display: inline-flex;
    margin-top: 28px;
}

.player-section {
    margin-top: 26px;
}

.player-wrap {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(233, 213, 255, 0.22);
    border-radius: 30px;
    background: #000;
    box-shadow: var(--shadow);
}

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

.player-cover {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 0;
    background:
        radial-gradient(circle, rgba(168, 85, 247, 0.28), transparent 20rem),
        rgba(0, 0, 0, 0.48);
    color: #fff;
    cursor: pointer;
}

.player-cover span {
    display: grid;
    place-items: center;
    width: 94px;
    height: 94px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple), var(--pink));
    box-shadow: 0 26px 54px rgba(168, 85, 247, 0.38);
    font-size: 34px;
}

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

.content-panel {
    margin-top: 28px;
    padding: clamp(22px, 4vw, 42px);
    border: 1px solid rgba(233, 213, 255, 0.18);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.075);
}

.content-panel h2 {
    margin-top: 0;
    font-size: clamp(24px, 3vw, 34px);
}

.content-panel p {
    color: #e7d8ff;
    font-size: 17px;
    line-height: 2;
}

.genre-row {
    margin-top: 22px;
}

.related-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.site-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
    gap: 28px;
    width: min(1460px, calc(100% - 32px));
    margin: 62px auto 0;
    padding: 30px 0 44px;
    border-top: 1px solid rgba(233, 213, 255, 0.18);
    color: var(--muted);
}

.site-footer strong {
    color: #fff;
    font-size: 20px;
}

.site-footer p {
    line-height: 1.8;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px 14px;
}

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

@media (max-width: 1180px) {
    .site-header {
        grid-template-columns: auto auto;
    }

    .menu-toggle {
        display: block;
        justify-self: end;
    }

    .main-nav {
        display: none;
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

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

    .header-search {
        grid-column: 1 / -1;
        justify-content: stretch;
    }

    .header-search input {
        flex: 1;
    }

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

    .ranking-panel {
        position: static;
    }

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

@media (max-width: 820px) {
    .hero-carousel {
        min-height: 720px;
        border-radius: 26px;
    }

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

    .hero-poster {
        width: min(250px, 68vw);
        margin: 0 auto;
    }

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

    .big-search,
    .header-search {
        width: 100%;
    }

    .big-search input,
    .header-search input {
        min-width: 0;
        width: 100%;
    }

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

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

    .detail-poster {
        width: min(260px, 70vw);
    }

    .site-footer {
        grid-template-columns: 1fr;
    }

    .footer-links {
        justify-content: flex-start;
    }
}

@media (max-width: 540px) {
    .category-grid {
        grid-template-columns: 1fr;
    }

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

    .movie-title {
        min-height: auto;
    }

    .hero-copy h1,
    .detail-info h1,
    .page-hero h1 {
        letter-spacing: -0.04em;
    }
}
