:root {
    --dark-950: #0f1419;
    --dark-900: #1f2933;
    --dark-850: #273442;
    --dark-800: #323f4b;
    --dark-700: #3e4c59;
    --dark-600: #52606d;
    --dark-500: #616e7c;
    --dark-400: #9aa5b1;
    --dark-300: #cbd2d9;
    --dark-200: #e4e7eb;
    --mystery-900: #581c87;
    --mystery-800: #6b21a8;
    --mystery-700: #7e22ce;
    --mystery-600: #9333ea;
    --mystery-500: #a855f7;
    --mystery-400: #c084fc;
    --mystery-300: #d8b4fe;
    --accent-500: #f97316;
    --primary-500: #4169b3;
    --radius-xl: 20px;
    --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.28);
    --shadow-glow: 0 0 34px rgba(147, 51, 234, 0.34);
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: radial-gradient(circle at 15% 0%, rgba(147, 51, 234, 0.18), transparent 30%), var(--dark-950);
    color: #ffffff;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    text-rendering: optimizeLegibility;
}

body.menu-open {
    overflow: hidden;
}

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

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

button,
input,
select {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(31, 41, 51, 0.95);
    border-bottom: 1px solid var(--dark-800);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(18px);
}

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

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    gap: 22px;
}

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

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--mystery-600), var(--mystery-800));
    box-shadow: var(--shadow-glow);
    color: #ffffff;
    font-weight: 800;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-text strong {
    font-size: 22px;
    letter-spacing: 0.02em;
}

.brand-text small {
    margin-top: 4px;
    color: var(--dark-400);
    font-size: 12px;
}

.brand.compact .brand-mark {
    width: 38px;
    height: 38px;
}

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

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    color: var(--dark-300);
    font-size: 15px;
    font-weight: 600;
}

.desktop-nav a {
    transition: color 0.2s ease;
}

.desktop-nav a:hover,
.desktop-nav a:focus-visible {
    color: #ffffff;
}

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

.quick-search {
    display: flex;
    align-items: center;
    width: 260px;
    background: var(--dark-800);
    border: 1px solid var(--dark-700);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.quick-search:focus-within {
    border-color: var(--mystery-600);
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.25);
}

.quick-search input,
.mobile-search input,
.filter-input {
    width: 100%;
    border: 0;
    outline: 0;
    color: #ffffff;
    background: transparent;
}

.quick-search input {
    padding: 10px 0 10px 14px;
}

.quick-search button {
    border: 0;
    background: transparent;
    color: var(--dark-300);
    width: 44px;
    height: 42px;
    cursor: pointer;
}

.menu-button {
    display: none;
    width: 44px;
    height: 44px;
    padding: 11px;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.menu-button span {
    display: block;
    height: 2px;
    margin: 5px 0;
    background: var(--dark-300);
    border-radius: 999px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-button.is-active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-button.is-active span:nth-child(2) {
    opacity: 0;
}

.menu-button.is-active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.mobile-panel {
    display: none;
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 0 0 18px;
}

.mobile-panel.is-open {
    display: block;
}

.mobile-search {
    display: flex;
    gap: 10px;
    margin: 8px 0 16px;
}

.mobile-search input {
    background: var(--dark-800);
    border: 1px solid var(--dark-700);
    border-radius: 12px;
    padding: 11px 14px;
}

.mobile-search button,
.btn,
.rank-action,
.filter-chip {
    border: 0;
    cursor: pointer;
    color: #ffffff;
    background: linear-gradient(135deg, var(--mystery-600), var(--mystery-800));
    border-radius: 999px;
    padding: 11px 18px;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.mobile-search button:hover,
.btn:hover,
.rank-action:hover,
.filter-chip:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.mobile-panel nav {
    display: grid;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--dark-800);
}

.mobile-panel nav a {
    color: var(--dark-300);
    padding: 8px 0;
}

.hero-carousel {
    position: relative;
    height: min(72vh, 640px);
    min-height: 520px;
    overflow: hidden;
    background: var(--dark-950);
}

.hero-track,
.hero-slide {
    position: absolute;
    inset: 0;
}

.hero-slide {
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease;
}

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

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

.hero-slide.is-active .hero-bg {
    animation: slowZoom 8s ease forwards;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--dark-950), rgba(15, 20, 25, 0.78) 50%, rgba(15, 20, 25, 0.1));
}

.hero-content {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: min(1200px, calc(100% - 32px));
    transform: translateX(-50%);
    padding-bottom: 72px;
}

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

.hero-eyebrow,
.section-kicker,
.category-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    color: var(--mystery-300);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-main-title {
    margin: 0 0 4px;
    color: #ffffff;
    font-size: clamp(28px, 6vw, 58px);
    line-height: 1.08;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.hero-title {
    margin: 0 0 18px;
    color: #ffffff;
    font-size: clamp(26px, 5vw, 52px);
    line-height: 1.1;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.hero-desc {
    max-width: 680px;
    margin: 0 0 24px;
    color: var(--dark-200);
    font-size: clamp(16px, 2vw, 20px);
}

.hero-tags,
.card-tags,
.detail-tags,
.poster-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-tags {
    margin-bottom: 18px;
}

.hero-tags span,
.card-tags span,
.detail-tags span,
.poster-tags span,
.meta-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: rgba(147, 51, 234, 0.78);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 10px;
    backdrop-filter: blur(12px);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.btn.secondary,
.filter-chip {
    background: rgba(31, 41, 51, 0.82);
    border: 1px solid rgba(203, 210, 217, 0.18);
}

.hero-controls {
    position: absolute;
    z-index: 4;
    left: 50%;
    bottom: 28px;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(-50%);
}

.hero-dot {
    width: 28px;
    height: 4px;
    border: 0;
    border-radius: 999px;
    background: var(--dark-600);
    cursor: pointer;
    transition: width 0.2s ease, background 0.2s ease;
}

.hero-dot.is-active {
    width: 42px;
    background: var(--mystery-500);
}

.hero-arrow {
    position: absolute;
    z-index: 5;
    top: 50%;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    color: #ffffff;
    background: rgba(31, 41, 51, 0.82);
    transform: translateY(-50%);
    cursor: pointer;
    backdrop-filter: blur(12px);
    transition: background 0.2s ease, transform 0.2s ease;
}

.hero-arrow:hover {
    background: var(--mystery-600);
    transform: translateY(-50%) scale(1.05);
}

.hero-arrow.prev {
    left: 24px;
}

.hero-arrow.next {
    right: 24px;
}

.section-panel,
.page-hero,
.detail-hero,
.player-section,
.content-section {
    padding: 68px 0;
}

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

.section-head h2,
.page-hero h1,
.detail-title h1,
.content-section h2,
.player-section h2 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.16;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.section-head p,
.page-hero p,
.detail-lead,
.content-section p {
    color: var(--dark-300);
}

.bg-band {
    background: rgba(31, 41, 51, 0.52);
    border-top: 1px solid rgba(62, 76, 89, 0.4);
    border-bottom: 1px solid rgba(62, 76, 89, 0.4);
}

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

.movie-card,
.category-card,
.detail-card,
.search-panel {
    background: var(--dark-900);
    border: 1px solid rgba(62, 76, 89, 0.75);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

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

.movie-card:hover {
    transform: translateY(-4px);
    border-color: rgba(147, 51, 234, 0.75);
    box-shadow: var(--shadow-glow);
}

.poster {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: var(--dark-800);
}

.poster img,
.card-image img,
.rank-cover img,
.detail-poster img,
.player-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.movie-card:hover img,
.rank-row:hover img,
.category-card:hover img {
    transform: scale(1.08);
}

.poster-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 20, 25, 0.92), transparent 58%);
}

.play-button,
.play-dot {
    position: absolute;
    display: grid;
    place-items: center;
    color: #ffffff;
    background: rgba(147, 51, 234, 0.9);
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.play-button {
    left: 50%;
    top: 50%;
    width: 54px;
    height: 54px;
    transform: translate(-50%, -50%) scale(0.9);
}

.poster:hover .play-button,
.card-image:hover .play-dot,
.rank-cover:hover .play-dot {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.poster-tags {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
}

.card-body {
    padding: 16px;
}

.card-body h3,
.rank-info h3,
.category-card h2,
.detail-card h3 {
    margin: 0 0 9px;
    color: #ffffff;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.35;
}

.card-body h3 a,
.rank-info h3 a {
    transition: color 0.2s ease;
}

.card-body h3 a:hover,
.rank-info h3 a:hover {
    color: var(--mystery-400);
}

.card-body p,
.rank-info p,
.category-card p,
.detail-card p {
    margin: 0 0 12px;
    color: var(--dark-400);
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta,
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    color: var(--dark-500);
    font-size: 13px;
}

.card-meta span:not(:last-child)::after,
.detail-meta span:not(:last-child)::after {
    content: "";
    display: inline-block;
    width: 4px;
    height: 4px;
    margin-left: 12px;
    border-radius: 50%;
    background: var(--dark-600);
    vertical-align: middle;
}

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

.movie-card.horizontal {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
    padding: 12px;
    background: transparent;
    box-shadow: none;
}

.movie-card.horizontal:hover {
    background: rgba(31, 41, 51, 0.65);
    transform: none;
    box-shadow: none;
}

.card-image {
    position: relative;
    min-height: 104px;
    border-radius: 14px;
    overflow: hidden;
    background: var(--dark-800);
}

.card-image .play-dot,
.rank-cover .play-dot {
    left: 50%;
    top: 50%;
    width: 38px;
    height: 38px;
    transform: translate(-50%, -50%) scale(0.9);
}

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

.category-card {
    position: relative;
    min-height: 210px;
    padding: 24px;
    overflow: hidden;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.category-card:hover {
    transform: translateY(-4px);
    border-color: rgba(147, 51, 234, 0.75);
    box-shadow: var(--shadow-glow);
}

.category-card::before {
    content: "";
    position: absolute;
    inset: -60px -40px auto auto;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(147, 51, 234, 0.26);
    filter: blur(4px);
}

.category-card h2,
.category-card p,
.category-card ul,
.category-card .category-link {
    position: relative;
}

.category-card ul {
    display: grid;
    gap: 6px;
    margin: 16px 0 20px;
    padding: 0;
    list-style: none;
    color: var(--dark-300);
    font-size: 14px;
}

.category-link {
    color: var(--mystery-300);
    font-weight: 800;
}

.filter-bar,
.search-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 26px;
}

.filter-input,
.search-panel input {
    min-width: min(100%, 360px);
    flex: 1;
    background: var(--dark-800);
    border: 1px solid var(--dark-700);
    border-radius: 14px;
    color: #ffffff;
    padding: 13px 16px;
    outline: 0;
}

.filter-input:focus,
.search-panel input:focus {
    border-color: var(--mystery-600);
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.24);
}

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

.rank-row {
    display: grid;
    grid-template-columns: 62px 112px minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(31, 41, 51, 0.78);
    border: 1px solid rgba(62, 76, 89, 0.7);
    transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.rank-row:hover {
    transform: translateY(-2px);
    border-color: rgba(147, 51, 234, 0.72);
    background: rgba(50, 63, 75, 0.65);
}

.rank-badge {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent-500), var(--mystery-600));
    color: #ffffff;
    font-size: 18px;
    font-style: normal;
    font-weight: 900;
}

.rank-cover {
    position: relative;
    display: block;
    width: 112px;
    aspect-ratio: 16 / 10;
    border-radius: 14px;
    overflow: hidden;
    background: var(--dark-800);
}

.rank-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
}

.page-hero {
    background: radial-gradient(circle at 18% 20%, rgba(147, 51, 234, 0.24), transparent 34%), rgba(31, 41, 51, 0.36);
    border-bottom: 1px solid rgba(62, 76, 89, 0.48);
}

.page-hero .container {
    display: grid;
    gap: 18px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--dark-400);
    font-size: 14px;
}

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

.detail-hero .container {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 34px;
    align-items: center;
}

.detail-poster {
    border-radius: 28px;
    overflow: hidden;
    background: var(--dark-800);
    box-shadow: var(--shadow-soft);
    aspect-ratio: 3 / 4;
}

.detail-title h1 {
    margin-bottom: 16px;
}

.detail-lead {
    max-width: 760px;
    margin: 18px 0 22px;
    font-size: 18px;
}

.detail-tags {
    margin: 18px 0;
}

.player-wrap {
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.26), rgba(15, 20, 25, 0.75));
    border: 1px solid rgba(147, 51, 234, 0.28);
    padding: 14px;
    box-shadow: var(--shadow-soft);
}

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

.player-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #000000;
}

.player-cover {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    border: 0;
    padding: 0;
    background: #000000;
    cursor: pointer;
    overflow: hidden;
}

.player-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.18));
}

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

.player-cover span {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: rgba(147, 51, 234, 0.92);
    box-shadow: var(--shadow-glow);
    color: #ffffff;
    font-size: 34px;
    padding-left: 4px;
}

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

.detail-card {
    padding: 26px;
}

.detail-card p {
    display: block;
    margin-bottom: 16px;
    font-size: 16px;
    line-height: 1.85;
    color: var(--dark-300);
}

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

.search-panel {
    padding: 18px;
}

.no-results {
    display: none;
    padding: 28px;
    border: 1px dashed var(--dark-700);
    border-radius: 18px;
    color: var(--dark-300);
    text-align: center;
}

.no-results.is-visible {
    display: block;
}

.site-footer {
    background: var(--dark-950);
    border-top: 1px solid var(--dark-800);
}

.footer-inner {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 36px;
    padding: 56px 0 36px;
}

.footer-brand p,
.site-footer li a,
.footer-bottom {
    color: var(--dark-400);
    font-size: 14px;
}

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

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

.site-footer li a:hover {
    color: var(--mystery-300);
}

.footer-bottom {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0 28px;
    border-top: 1px solid rgba(62, 76, 89, 0.55);
}

@keyframes slowZoom {
    from {
        transform: scale(1.02);
    }
    to {
        transform: scale(1.1);
    }
}

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

    .menu-button {
        display: block;
    }

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

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

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

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

    .hero-content {
        padding-bottom: 84px;
    }

    .hero-arrow {
        display: none;
    }

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

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

    .movie-card.horizontal {
        grid-template-columns: 118px minmax(0, 1fr);
    }

    .rank-row {
        grid-template-columns: 44px 86px minmax(0, 1fr);
    }

    .rank-action {
        display: none;
    }

    .rank-badge {
        width: 38px;
        height: 38px;
        border-radius: 12px;
        font-size: 14px;
    }

    .rank-cover {
        width: 86px;
    }

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

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

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

@media (max-width: 540px) {
    .header-inner,
    .footer-inner,
    .container,
    .mobile-panel,
    .footer-bottom {
        width: min(100% - 24px, 1200px);
    }

    .brand-text small {
        display: none;
    }

    .brand-text strong {
        font-size: 18px;
    }

    .brand-mark {
        width: 38px;
        height: 38px;
        border-radius: 14px;
    }

    .hero-carousel {
        height: 600px;
    }

    .hero-tags span:nth-child(n + 3) {
        display: none;
    }

    .movie-grid,
    .horizontal-grid,
    .category-grid {
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

    .card-body {
        padding: 12px;
    }

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

    .card-body p {
        font-size: 13px;
    }

    .movie-card.horizontal {
        grid-column: span 2;
    }

    .rank-row {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .rank-cover {
        display: none;
    }

    .section-panel,
    .page-hero,
    .detail-hero,
    .player-section,
    .content-section {
        padding: 44px 0;
    }

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