*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --dark-950: #0f1419;
    --dark-900: #1f2933;
    --dark-850: #263340;
    --dark-800: #323f4b;
    --dark-700: #3e4c59;
    --dark-500: #61707c;
    --dark-400: #7b8794;
    --dark-300: #9aa5b1;
    --dark-200: #cbd2d9;
    --mystery-800: #6b21a8;
    --mystery-700: #7e22ce;
    --mystery-600: #9333ea;
    --mystery-500: #a855f7;
    --mystery-400: #c084fc;
    --primary-500: #3b82f6;
    --accent-500: #f97316;
    --green-500: #22c55e;
    --card: rgba(31, 41, 51, 0.92);
    --line: rgba(126, 34, 206, 0.28);
    --shadow-glow: 0 0 24px rgba(147, 51, 234, 0.32);
    --shadow-card: 0 18px 45px rgba(0, 0, 0, 0.34);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: #ffffff;
    background:
        radial-gradient(circle at 15% 0%, rgba(147, 51, 234, 0.16), transparent 30rem),
        radial-gradient(circle at 90% 10%, rgba(59, 130, 246, 0.10), transparent 28rem),
        var(--dark-950);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

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

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

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(31, 41, 51, 0.95);
    border-bottom: 1px solid rgba(50, 63, 75, 0.95);
    backdrop-filter: blur(14px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.nav-wrap {
    height: 76px;
    display: flex;
    align-items: center;
    gap: 24px;
    justify-content: space-between;
}

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

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-grid;
    place-items: center;
    color: #ffffff;
    background: linear-gradient(135deg, var(--mystery-600), var(--mystery-800));
    box-shadow: 0 0 15px rgba(147, 51, 234, 0.3);
}

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

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

.brand-text em {
    margin-top: 3px;
    color: var(--dark-400);
    font-size: 12px;
    font-style: normal;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 26px;
    color: var(--dark-300);
    font-weight: 600;
}

.main-nav a,
.mobile-panel a {
    transition: color 0.2s ease, transform 0.2s ease;
}

.main-nav a:hover,
.main-nav a.is-active,
.mobile-panel a:hover,
.mobile-panel a.is-active {
    color: #ffffff;
}

.header-search {
    position: relative;
    width: min(270px, 24vw);
}

.header-search input,
.mobile-panel input,
.filter-bar input,
.search-hero input,
.filter-bar select {
    width: 100%;
    border: 1px solid var(--dark-700);
    border-radius: 14px;
    outline: none;
    color: #ffffff;
    background: rgba(50, 63, 75, 0.88);
    padding: 11px 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: rgba(50, 63, 75, 0.72);
    color: #ffffff;
    padding: 10px;
}

.menu-toggle span {
    display: block;
    height: 2px;
    margin: 5px 0;
    background: #ffffff;
    border-radius: 2px;
}

.mobile-panel {
    display: none;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 0 0 18px;
    animation: fadeIn 0.28s ease;
}

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

.mobile-panel nav,
.mobile-cats {
    display: grid;
    gap: 12px;
    padding-top: 14px;
}

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

.mobile-cats a {
    color: var(--dark-300);
    border: 1px solid var(--dark-700);
    border-radius: 12px;
    padding: 10px 12px;
}

.hero-slider {
    position: relative;
    min-height: 72vh;
    overflow: hidden;
    background: var(--dark-900);
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.7s ease;
    background-image:
        linear-gradient(90deg, rgba(15, 20, 25, 0.96) 0%, rgba(15, 20, 25, 0.78) 43%, rgba(15, 20, 25, 0.28) 100%),
        var(--hero-image);
    background-size: cover;
    background-position: center;
}

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

.hero-inner {
    min-height: 72vh;
    display: grid;
    align-items: center;
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.72fr);
    gap: 44px;
    padding: 70px 0 84px;
}

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

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--mystery-400);
    background: rgba(147, 51, 234, 0.14);
    border: 1px solid rgba(192, 132, 252, 0.28);
    border-radius: 999px;
    padding: 7px 13px;
    font-size: 14px;
    font-weight: 700;
}

.hero-copy h1,
.page-hero h1,
.detail-copy h1 {
    margin: 18px 0 16px;
    font-size: clamp(34px, 6vw, 64px);
    line-height: 1.06;
    letter-spacing: -0.035em;
}

.hero-copy p,
.page-hero p,
.detail-copy p {
    color: var(--dark-200);
    font-size: clamp(16px, 2vw, 19px);
    max-width: 720px;
}

.hero-meta,
.detail-meta,
.movie-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    color: var(--dark-300);
    font-size: 14px;
}

.hero-meta span,
.detail-meta span,
.movie-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(50, 63, 75, 0.72);
}

.hero-actions,
.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 28px;
}

.primary-button,
.secondary-button,
.text-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border-radius: 14px;
    padding: 0 20px;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-button {
    color: #ffffff;
    background: linear-gradient(135deg, var(--mystery-600), var(--mystery-800));
    box-shadow: var(--shadow-glow);
}

.secondary-button {
    color: #ffffff;
    background: rgba(50, 63, 75, 0.78);
    border: 1px solid rgba(123, 135, 148, 0.22);
}

.text-button {
    color: var(--mystery-400);
    min-height: auto;
    padding: 0;
}

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

.hero-poster-card {
    position: relative;
    border-radius: 26px;
    overflow: hidden;
    background: rgba(31, 41, 51, 0.76);
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(126, 34, 206, 0.35);
}

.hero-poster-card img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.hero-poster-caption {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 16px;
    border-radius: 18px;
    padding: 14px;
    background: rgba(15, 20, 25, 0.78);
    backdrop-filter: blur(12px);
}

.hero-poster-caption strong {
    display: block;
    margin-bottom: 4px;
}

.hero-poster-caption span {
    color: var(--dark-300);
    font-size: 13px;
}

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

.hero-controls button {
    width: 38px;
    height: 6px;
    border: 0;
    border-radius: 999px;
    background: var(--dark-700);
    transition: width 0.2s ease, background 0.2s ease;
}

.hero-controls button.is-active {
    width: 58px;
    background: var(--mystery-500);
}

.section {
    padding: 70px 0;
}

.section.alt {
    background: rgba(31, 41, 51, 0.45);
}

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

.section-title {
    margin: 0;
    font-size: clamp(26px, 4vw, 36px);
    line-height: 1.2;
}

.section-desc {
    color: var(--dark-300);
    margin: 8px 0 0;
    max-width: 700px;
}

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

.movie-card,
.wide-card,
.category-card,
.info-panel,
.player-card,
.related-panel {
    border: 1px solid rgba(62, 76, 89, 0.82);
    background: var(--card);
    border-radius: 22px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

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

.movie-card:hover,
.wide-card:hover,
.category-card:hover {
    transform: translateY(-4px);
    border-color: rgba(192, 132, 252, 0.46);
    box-shadow: var(--shadow-glow);
}

.poster-link {
    position: relative;
    display: block;
    overflow: hidden;
    background: var(--dark-800);
}

.poster-link img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.movie-card:hover .poster-link img,
.wide-card:hover img {
    transform: scale(1.05);
}

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

.movie-card h3,
.wide-card h3,
.category-card h2 {
    margin: 10px 0 8px;
    color: #ffffff;
    font-size: 18px;
    line-height: 1.35;
}

.movie-card p,
.wide-card p,
.category-card p,
.info-panel p,
.related-panel p {
    margin: 0;
    color: var(--dark-300);
}

.movie-card p,
.wide-card p {
    display: -webkit-box;
    min-height: 3.15em;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.tag-row span,
.filter-tabs button {
    color: var(--mystery-400);
    background: rgba(147, 51, 234, 0.12);
    border: 1px solid rgba(147, 51, 234, 0.28);
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 700;
}

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

.wide-card {
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr);
    gap: 16px;
    padding: 12px;
    transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.wide-cover {
    border-radius: 16px;
    overflow: hidden;
    background: var(--dark-800);
}

.wide-cover img {
    width: 100%;
    height: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.wide-content {
    position: relative;
    min-width: 0;
    padding: 4px 0;
}

.rank-number,
.rank-badge {
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    color: #ffffff;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-500), var(--mystery-600));
    font-weight: 900;
}

.rank-badge {
    position: absolute;
    left: 10px;
    top: 10px;
    z-index: 2;
}

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

.category-card {
    display: flex;
    min-height: 210px;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(147, 51, 234, 0.14), rgba(15, 20, 25, 0.12)),
        var(--card);
    transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.category-card span {
    color: var(--mystery-400);
    font-weight: 800;
}

.page-hero {
    padding: 72px 0 38px;
    background:
        linear-gradient(135deg, rgba(147, 51, 234, 0.14), rgba(59, 130, 246, 0.08)),
        transparent;
}

.page-hero.compact {
    padding-bottom: 22px;
}

.page-hero h1 {
    max-width: 900px;
}

.filter-bar {
    display: grid;
    grid-template-columns: 1fr 220px 220px;
    gap: 14px;
    margin: 28px 0 26px;
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 26px;
}

.filter-tabs button {
    color: var(--dark-200);
    background: rgba(50, 63, 75, 0.52);
}

.filter-tabs button.is-active {
    color: #ffffff;
    background: var(--mystery-600);
}

.empty-state {
    padding: 50px 0;
    color: var(--dark-300);
    text-align: center;
}

.detail-hero {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(15, 20, 25, 0.98), rgba(15, 20, 25, 0.78)),
        var(--detail-image);
    background-size: cover;
    background-position: center;
}

.detail-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 82% 22%, rgba(147, 51, 234, 0.18), transparent 26rem);
}

.detail-layout {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    gap: 42px;
    padding: 60px 0 58px;
}

.detail-poster {
    overflow: hidden;
    border-radius: 26px;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(126, 34, 206, 0.36);
}

.detail-poster img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

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

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

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

.main-column,
.side-column {
    display: grid;
    gap: 24px;
}

.info-panel,
.player-card,
.related-panel {
    padding: 24px;
}

.info-panel h2,
.player-card h2,
.related-panel h2 {
    margin: 0 0 16px;
    font-size: 24px;
}

.info-panel p + p {
    margin-top: 14px;
}

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

.player-frame video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #000000;
}

.play-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: grid;
    place-items: center;
    gap: 12px;
    border: 0;
    color: #ffffff;
    background: linear-gradient(180deg, rgba(15, 20, 25, 0.18), rgba(15, 20, 25, 0.64));
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.play-overlay.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.play-circle {
    width: 78px;
    height: 78px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--mystery-600), var(--mystery-800));
    box-shadow: var(--shadow-glow);
}

.play-triangle {
    width: 0;
    height: 0;
    margin-left: 6px;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
    border-left: 22px solid #ffffff;
}

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

.related-item {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.related-item img {
    width: 72px;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 12px;
}

.related-item h3 {
    margin: 0 0 5px;
    font-size: 15px;
}

.related-item p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    color: var(--dark-400);
    font-size: 13px;
}

.search-hero {
    padding: 70px 0 34px;
}

.search-hero form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    max-width: 760px;
    margin-top: 24px;
}

.search-hero button {
    border: 0;
}

.search-results {
    display: grid;
    gap: 16px;
}

.search-result-card {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 16px;
    padding: 14px;
    border: 1px solid var(--dark-700);
    border-radius: 18px;
    background: var(--card);
}

.search-result-card img {
    width: 96px;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 14px;
}

.search-result-card h2 {
    margin: 4px 0 8px;
    font-size: 20px;
}

.search-result-card p {
    margin: 0;
    color: var(--dark-300);
}

.site-footer {
    border-top: 1px solid var(--dark-800);
    background: rgba(15, 20, 25, 0.96);
    margin-top: 60px;
}

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

.site-footer h2 {
    margin: 0 0 14px;
    font-size: 17px;
}

.site-footer p,
.site-footer a,
.footer-bottom {
    color: var(--dark-400);
}

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

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

.footer-bottom {
    display: flex;
    justify-content: center;
    gap: 18px;
    border-top: 1px solid rgba(50, 63, 75, 0.62);
    padding: 18px;
    font-size: 14px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1100px) {
    .movie-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

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

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

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

    .menu-toggle {
        display: block;
    }

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

    .hero-poster-card,
    .detail-poster {
        max-width: 340px;
    }

    .filter-bar {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 640px) {
    .nav-wrap {
        height: 68px;
    }

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

    .hero-slider,
    .hero-inner {
        min-height: 78vh;
    }

    .hero-inner {
        padding: 42px 0 82px;
    }

    .section {
        padding: 46px 0;
    }

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

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

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

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

    .wide-card,
    .search-result-card {
        grid-template-columns: 86px minmax(0, 1fr);
    }

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

    .detail-layout {
        padding: 36px 0;
    }

    .info-panel,
    .player-card,
    .related-panel {
        padding: 18px;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }
}
