:root {
    --color-purple: #7c3aed;
    --color-pink: #db2777;
    --color-indigo: #312e81;
    --color-dark: #111827;
    --color-muted: #6b7280;
    --color-border: #e5e7eb;
    --color-bg: #f9fafb;
    --radius-lg: 18px;
    --radius-md: 14px;
    --shadow-soft: 0 16px 38px rgba(15, 23, 42, 0.10);
    --shadow-hover: 0 24px 54px rgba(76, 29, 149, 0.22);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    background: var(--color-bg);
    color: var(--color-dark);
    line-height: 1.6;
}

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

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

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: linear-gradient(90deg, rgba(88, 28, 135, 0.96), rgba(147, 51, 234, 0.96), rgba(219, 39, 119, 0.94));
    color: #fff;
    box-shadow: 0 8px 28px rgba(17, 24, 39, 0.22);
    backdrop-filter: blur(14px);
}

.nav-shell {
    display: flex;
    align-items: center;
    min-height: 68px;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 800;
    white-space: nowrap;
}

.brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

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

.nav-link,
.mobile-nav-link {
    color: rgba(255, 255, 255, 0.82);
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-link {
    padding: 8px 10px;
    border-radius: 999px;
}

.nav-link:hover,
.nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
}

.header-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.13);
    padding: 6px;
    border-radius: 999px;
}

.header-search input {
    width: 160px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    padding: 6px 8px;
}

.header-search input::placeholder {
    color: rgba(255, 255, 255, 0.70);
}

.header-search button,
.primary-button,
.secondary-button {
    border: 0;
    cursor: pointer;
    border-radius: 999px;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.header-search button {
    padding: 8px 14px;
    color: var(--color-purple);
    background: #fff;
}

.menu-button {
    display: none;
    width: 44px;
    height: 44px;
    border: 0;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 10px;
}

.menu-button span {
    display: block;
    width: 100%;
    height: 2px;
    margin: 5px 0;
    background: #fff;
    border-radius: 4px;
}

.mobile-nav {
    display: none;
    padding: 0 16px 18px;
}

.mobile-nav.open {
    display: block;
}

.mobile-nav-link {
    display: block;
    padding: 11px 0;
}

.mobile-category-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.mobile-category-links a {
    padding: 9px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.88);
}

.hero-carousel {
    position: relative;
    height: 78vh;
    min-height: 560px;
    overflow: hidden;
    background: linear-gradient(135deg, #312e81, #581c87 48%, #831843);
}

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

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

.hero-slide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.32;
    transform: scale(1.04);
}

.hero-slide img.image-empty,
.poster-box img.image-empty,
.detail-poster img.image-empty,
.related-poster img.image-empty,
.category-tile img.image-empty,
.category-preview img.image-empty,
.movie-video.image-empty {
    opacity: 0;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(168, 85, 247, 0.35), transparent 34%),
        linear-gradient(90deg, rgba(15, 23, 42, 0.86), rgba(88, 28, 135, 0.44), rgba(15, 23, 42, 0.24));
}

.hero-content {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

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

.hero-kicker {
    display: inline-flex;
    align-items: center;
    padding: 7px 16px;
    margin-bottom: 18px;
    border-radius: 999px;
    background: rgba(147, 51, 234, 0.82);
    box-shadow: 0 10px 24px rgba(147, 51, 234, 0.28);
    font-size: 14px;
}

.hero-copy h1 {
    margin: 0 0 18px;
    font-size: clamp(42px, 7vw, 72px);
    line-height: 1.05;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.hero-copy p {
    max-width: 680px;
    margin: 0 0 24px;
    color: rgba(255, 255, 255, 0.84);
    font-size: clamp(18px, 2.2vw, 23px);
}

.hero-tags,
.hero-mini-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}

.hero-tags span,
.hero-mini-tags span {
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.13);
    color: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(10px);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 26px;
    color: #fff;
    background: linear-gradient(90deg, var(--color-purple), var(--color-pink));
    box-shadow: 0 14px 30px rgba(219, 39, 119, 0.35);
}

.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
}

.primary-button:hover,
.secondary-button:hover,
.header-search button:hover {
    transform: translateY(-2px) scale(1.02);
}

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

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

.hero-dot.active {
    width: 34px;
    background: #fff;
}

.content-section {
    padding: 64px 0;
}

.white-section {
    background: #fff;
}

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

.section-heading.compact {
    margin-bottom: 18px;
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(28px, 3.5vw, 38px);
    line-height: 1.15;
    font-weight: 850;
}

.section-heading p {
    margin: 8px 0 0;
    color: var(--color-muted);
}

.section-more {
    display: inline-flex;
    padding: 10px 16px;
    border-radius: 999px;
    color: var(--color-purple);
    background: #f3e8ff;
    font-weight: 700;
}

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

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

.movie-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-soft);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.poster-box {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: linear-gradient(135deg, #312e81, #9333ea, #db2777);
}

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

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

.poster-badge,
.rank-number {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.92);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.rank-number {
    background: linear-gradient(90deg, #ef4444, #f97316);
}

.rank-number + img + .poster-badge {
    left: auto;
    right: 12px;
}

.poster-play {
    position: absolute;
    left: 50%;
    bottom: 16px;
    z-index: 2;
    transform: translate(-50%, 18px);
    opacity: 0;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--color-purple);
    font-weight: 800;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.poster-box::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.74), transparent 56%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.movie-card:hover .poster-box::after,
.movie-card:hover .poster-play {
    opacity: 1;
}

.movie-card:hover .poster-play {
    transform: translate(-50%, 0);
}

.movie-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 16px;
}

.movie-card-body h3 {
    margin: 0 0 8px;
    font-size: 17px;
    line-height: 1.35;
    font-weight: 800;
    color: #111827;
}

.movie-card-body p {
    flex: 1;
    margin: 0 0 14px;
    color: #4b5563;
    font-size: 14px;
}

.movie-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: #6b7280;
    font-size: 12px;
}

.movie-meta span {
    padding: 4px 8px;
    border-radius: 999px;
    background: #f3f4f6;
}

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

.category-tile {
    position: relative;
    min-height: 210px;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #312e81, #7c3aed, #db2777);
    box-shadow: var(--shadow-soft);
}

.category-tile img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.38;
    transition: transform 0.45s ease;
}

.category-tile:hover img {
    transform: scale(1.08);
}

.category-tile span,
.category-tile em {
    position: relative;
    z-index: 2;
    display: block;
    color: #fff;
}

.category-tile span {
    margin: 112px 18px 6px;
    font-size: 23px;
    font-style: normal;
    font-weight: 850;
}

.category-tile em {
    margin: 0 18px 18px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 14px;
    font-style: normal;
}

.page-hero {
    padding: 70px 0;
    color: #fff;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.18), transparent 28%),
        linear-gradient(110deg, #581c87, #7c3aed, #db2777);
}

.page-hero h1 {
    margin: 0 0 12px;
    font-size: clamp(36px, 6vw, 58px);
    line-height: 1.08;
    font-weight: 900;
}

.page-hero p {
    max-width: 760px;
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: 18px;
}

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

.category-card-large {
    display: grid;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-soft);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.category-card-large:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.category-preview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: 138px;
    overflow: hidden;
    background: linear-gradient(135deg, #312e81, #db2777);
}

.category-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.78;
}

.category-card-copy {
    display: block;
    padding: 20px;
}

.category-card-copy strong {
    display: block;
    margin-bottom: 8px;
    font-size: 22px;
}

.category-card-copy em {
    display: block;
    color: #6b7280;
    font-style: normal;
}

.filter-panel {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 28px;
    padding: 18px;
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.sticky-filter {
    position: sticky;
    top: 86px;
    z-index: 20;
}

.filter-field {
    display: grid;
    gap: 7px;
    min-width: 160px;
}

.filter-field.grow {
    flex: 1 1 280px;
}

.filter-field label {
    color: #374151;
    font-weight: 800;
    font-size: 14px;
}

.filter-field input,
.filter-field select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    outline: 0;
    padding: 0 12px;
    background: #fff;
}

.filter-field input:focus,
.filter-field select:focus {
    border-color: var(--color-purple);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.13);
}

.view-actions {
    display: flex;
    gap: 8px;
}

.view-actions button {
    min-height: 44px;
    border: 0;
    border-radius: 12px;
    padding: 0 14px;
    background: #f3f4f6;
    color: #4b5563;
    cursor: pointer;
    font-weight: 800;
}

.view-actions button.active {
    background: var(--color-purple);
    color: #fff;
}

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

.movie-grid.list-view .movie-card {
    display: grid;
    grid-template-columns: 150px 1fr;
}

.movie-grid.list-view .poster-box {
    aspect-ratio: 3 / 4;
}

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

.ranking-row {
    display: grid;
    grid-template-columns: 54px 1fr minmax(200px, 0.9fr);
    align-items: center;
    gap: 14px;
    padding: 15px 18px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ranking-row:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-soft);
}

.ranking-row span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--color-purple), var(--color-pink));
    color: #fff;
    font-weight: 900;
}

.ranking-row strong {
    font-size: 17px;
}

.ranking-row em {
    color: #6b7280;
    font-style: normal;
    font-size: 14px;
}

.split-layout {
    display: grid;
    grid-template-columns: 0.9fr 1.4fr;
    gap: 32px;
    align-items: start;
}

.detail-top {
    padding: 56px 0;
    color: #fff;
    background:
        radial-gradient(circle at 80% 20%, rgba(236, 72, 153, 0.34), transparent 30%),
        linear-gradient(135deg, #111827, #312e81 48%, #581c87);
}

.detail-top-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 36px;
    align-items: center;
}

.detail-poster {
    overflow: hidden;
    border-radius: 24px;
    background: linear-gradient(135deg, #312e81, #9333ea, #db2777);
    box-shadow: 0 28px 64px rgba(0, 0, 0, 0.28);
    aspect-ratio: 3 / 4;
}

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

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    color: rgba(255, 255, 255, 0.72);
}

.breadcrumb a:hover {
    color: #fff;
}

.detail-title-block h1 {
    margin: 0 0 16px;
    font-size: clamp(36px, 6vw, 64px);
    line-height: 1.06;
    font-weight: 900;
}

.detail-title-block p {
    max-width: 820px;
    margin: 0 0 22px;
    color: rgba(255, 255, 255, 0.84);
    font-size: 18px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
}

.detail-meta span {
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.86);
}

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

.player-card,
.story-card,
.aside-card {
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.player-card {
    overflow: hidden;
    margin-bottom: 24px;
}

.player {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #030712;
}

.movie-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.play-cover {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.18), rgba(0, 0, 0, 0.34));
    cursor: pointer;
}

.play-cover span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 78px;
    height: 78px;
    padding-left: 5px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--color-purple), var(--color-pink));
    color: #fff;
    font-size: 32px;
    box-shadow: 0 18px 38px rgba(219, 39, 119, 0.36);
}

.play-cover.hidden {
    display: none;
}

.story-card {
    padding: 28px;
}

.story-card h2,
.aside-card h2 {
    margin: 0 0 12px;
    font-size: 22px;
    font-weight: 850;
}

.story-card p {
    margin: 0 0 24px;
    color: #374151;
    white-space: pre-line;
}

.tag-block div {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.tag-block span {
    padding: 7px 11px;
    border-radius: 999px;
    background: #f3e8ff;
    color: #6d28d9;
    font-size: 14px;
    font-weight: 700;
}

.detail-aside {
    position: sticky;
    top: 88px;
}

.aside-card {
    padding: 22px;
}

.related-card {
    display: grid;
    grid-template-columns: 104px 1fr;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid #f1f5f9;
}

.related-card:first-of-type {
    border-top: 0;
}

.related-poster {
    display: block;
    overflow: hidden;
    border-radius: 12px;
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, #312e81, #9333ea, #db2777);
}

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

.related-info strong {
    display: block;
    margin-bottom: 4px;
    line-height: 1.35;
}

.related-info em {
    display: block;
    color: #6b7280;
    font-style: normal;
    font-size: 13px;
}

.site-footer {
    color: #d1d5db;
    background: linear-gradient(135deg, #111827, #1e293b, #111827);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 34px;
    padding: 46px 0;
}

.footer-brand {
    margin-bottom: 12px;
    color: #fff;
    font-size: 24px;
    font-weight: 900;
}

.site-footer h2 {
    margin: 0 0 14px;
    color: #fff;
    font-size: 18px;
}

.site-footer p {
    margin: 0;
    color: #9ca3af;
}

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

.site-footer a {
    color: #c4b5fd;
}

.site-footer a:hover {
    color: #fff;
}

.footer-bottom {
    padding: 18px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #9ca3af;
    text-align: center;
}

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

    .menu-button {
        display: block;
        margin-left: auto;
    }

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

    .category-large-grid,
    .split-layout,
    .detail-layout,
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .detail-aside {
        position: static;
    }
}

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

    .hero-carousel {
        height: 76vh;
        min-height: 560px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .primary-button,
    .secondary-button {
        width: 100%;
    }

    .content-section {
        padding: 44px 0;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .movie-grid,
    .category-grid,
    .category-large-grid,
    .split-layout,
    .detail-layout,
    .footer-grid {
        grid-template-columns: 1fr;
    }

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

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

    .detail-poster {
        width: min(250px, 78vw);
    }

    .ranking-row,
    .ranking-row.detailed {
        grid-template-columns: 46px 1fr;
    }

    .ranking-row em {
        grid-column: 2;
    }

    .movie-grid.list-view .movie-card {
        grid-template-columns: 110px 1fr;
    }

    .filter-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-field {
        width: 100%;
    }

    .view-actions button {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .movie-grid,
    .compact-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

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

    .movie-card-body h3 {
        font-size: 15px;
    }

    .movie-card-body p {
        display: none;
    }

    .category-preview {
        height: 110px;
    }
}
