:root {
    color-scheme: dark;
    --bg: #020617;
    --panel: rgba(15, 23, 42, 0.78);
    --panel-strong: rgba(15, 23, 42, 0.94);
    --line: rgba(148, 163, 184, 0.16);
    --line-strong: rgba(34, 211, 238, 0.34);
    --text: #e2e8f0;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --cyan: #22d3ee;
    --blue: #3b82f6;
    --purple: #a855f7;
    --green: #10b981;
    --orange: #f59e0b;
    --danger: #ef4444;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
    --radius: 22px;
    --container: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at 15% 8%, rgba(34, 211, 238, 0.14), transparent 26rem),
        radial-gradient(circle at 90% 10%, rgba(168, 85, 247, 0.13), transparent 24rem),
        linear-gradient(180deg, #020617 0%, #0f172a 42%, #020617 100%);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    line-height: 1.65;
    min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(34, 211, 238, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(34, 211, 238, 0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: linear-gradient(180deg, black, transparent 74%);
    z-index: -1;
}

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

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

button,
input,
select {
    font: inherit;
}

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

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

.header-inner {
    display: flex;
    align-items: center;
    gap: 22px;
    min-height: 72px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 14px 34px rgba(34, 211, 238, 0.26);
}

.brand-text {
    display: grid;
    line-height: 1.18;
}

.brand-text strong {
    font-size: 1.16rem;
    background: linear-gradient(90deg, var(--cyan), #60a5fa);
    background-clip: text;
    color: transparent;
    letter-spacing: 0.02em;
}

.brand-text small {
    color: var(--muted);
    font-size: 0.75rem;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-left: auto;
    color: var(--soft);
    font-size: 0.95rem;
}

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

.desktop-nav a:hover,
.desktop-nav a.active,
.mobile-nav a:hover,
.mobile-nav a.active {
    color: var(--cyan);
}

.header-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
}

.header-search input,
.mobile-search input,
.filter-controls input,
.filter-controls select {
    color: var(--text);
    background: rgba(15, 23, 42, 0.84);
    border: 1px solid var(--line);
    border-radius: 12px;
    outline: none;
    min-height: 42px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.header-search input {
    width: 190px;
    padding: 0 13px;
}

.header-search input:focus,
.mobile-search input:focus,
.filter-controls input:focus,
.filter-controls select:focus {
    border-color: var(--line-strong);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
    background: rgba(15, 23, 42, 0.98);
}

.header-search button,
.mobile-search button,
.btn,
.player-button {
    color: #ffffff;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    border: 0;
    border-radius: 12px;
    min-height: 42px;
    padding: 0 16px;
    cursor: pointer;
    font-weight: 700;
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.header-search button:hover,
.mobile-search button:hover,
.btn:hover,
.player-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 38px rgba(34, 211, 238, 0.24);
}

.menu-toggle {
    display: none;
    margin-left: auto;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.76);
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    background: var(--text);
    border-radius: 4px;
}

.mobile-nav {
    display: none;
    padding: 14px 0 20px;
    border-top: 1px solid var(--line);
}

.mobile-nav.is-open {
    display: grid;
    gap: 12px;
}

.mobile-search {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.mobile-search input {
    padding: 0 12px;
}

.main {
    min-height: 64vh;
}

.container {
    padding: 44px 0;
}

.hero-carousel {
    position: relative;
    overflow: hidden;
    min-height: 680px;
    border-bottom: 1px solid var(--line);
    background: #020617;
}

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

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

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

.hero-backdrop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.22;
    filter: saturate(1.16) contrast(1.06);
}

.hero-backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.97) 0%, rgba(2, 6, 23, 0.78) 48%, rgba(2, 6, 23, 0.5) 100%),
        linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.2) 42%, rgba(2, 6, 23, 0.68) 100%);
}

.hero-layout {
    position: relative;
    z-index: 2;
    width: min(100% - 32px, var(--container));
    min-height: 680px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) 390px;
    gap: 50px;
    align-items: center;
    padding: 96px 0 70px;
}

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

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--cyan);
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.22);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.hero-copy h1,
.page-hero h1 {
    margin: 20px 0 18px;
    font-size: clamp(2.5rem, 8vw, 5.8rem);
    line-height: 0.98;
    letter-spacing: -0.06em;
}

.gradient-text {
    background: linear-gradient(90deg, var(--cyan), #60a5fa, #c084fc);
    background-clip: text;
    color: transparent;
}

.hero-copy p,
.page-hero p {
    color: var(--soft);
    font-size: 1.12rem;
    max-width: 680px;
    margin: 0 0 18px;
}

.hero-tags,
.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 9px;
    border-radius: 999px;
    color: var(--soft);
    background: rgba(51, 65, 85, 0.64);
    border: 1px solid rgba(148, 163, 184, 0.14);
    font-size: 0.78rem;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 132px;
}

.btn.secondary {
    color: var(--text);
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid var(--line);
    box-shadow: none;
}

.hero-poster {
    display: block;
    position: relative;
    border-radius: 28px;
    overflow: hidden;
    min-height: 510px;
    background: rgba(15, 23, 42, 0.76);
    box-shadow: var(--shadow);
    border: 1px solid rgba(34, 211, 238, 0.2);
}

.hero-poster img {
    width: 100%;
    height: 100%;
    min-height: 510px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.hero-poster:hover img {
    transform: scale(1.06);
}

.hero-poster-badge {
    position: absolute;
    left: 18px;
    bottom: 18px;
    right: 18px;
    display: grid;
    gap: 4px;
    padding: 15px;
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.76);
    border: 1px solid rgba(148, 163, 184, 0.18);
    backdrop-filter: blur(14px);
}

.hero-poster-badge strong {
    color: #ffffff;
}

.hero-poster-badge small {
    color: var(--muted);
}

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

.hero-dots button {
    width: 34px;
    height: 6px;
    border: 0;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.34);
    cursor: pointer;
    padding: 0;
}

.hero-dots button.is-active {
    background: linear-gradient(90deg, var(--cyan), var(--blue));
}

.page-hero {
    padding: 88px 0 32px;
    background:
        radial-gradient(circle at 16% 30%, rgba(34, 211, 238, 0.16), transparent 24rem),
        linear-gradient(135deg, rgba(15, 23, 42, 0.88), rgba(2, 6, 23, 0.4));
    border-bottom: 1px solid var(--line);
}

.page-hero .container {
    padding: 0;
}

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

.section-head h2,
.filter-panel h2 {
    margin: 10px 0 0;
    font-size: clamp(1.55rem, 3vw, 2.45rem);
    line-height: 1.1;
}

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

.section-link {
    color: var(--cyan);
    font-weight: 800;
}

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

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

.movie-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    border-radius: var(--radius);
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.16);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(34, 211, 238, 0.44);
    box-shadow: 0 22px 60px rgba(34, 211, 238, 0.12);
}

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

.movie-cover {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    background: rgba(15, 23, 42, 0.82);
}

.movie-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.42s ease;
}

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

.movie-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.82), rgba(2, 6, 23, 0.05) 52%, transparent);
}

.movie-type,
.movie-year {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.78);
    border: 1px solid rgba(34, 211, 238, 0.24);
    color: var(--cyan);
    font-size: 0.76rem;
    font-weight: 800;
    backdrop-filter: blur(8px);
}

.movie-type {
    top: 12px;
    left: 12px;
}

.movie-year {
    right: 12px;
    bottom: 12px;
    color: var(--soft);
    border-color: rgba(148, 163, 184, 0.22);
}

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

.movie-info h3 {
    margin: 0 0 8px;
    color: #ffffff;
    font-size: 1.04rem;
    line-height: 1.25;
}

.movie-info h3 a:hover {
    color: var(--cyan);
}

.movie-info p {
    flex: 1;
    color: var(--muted);
    margin: 0 0 14px;
    font-size: 0.92rem;
}

.movie-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding-top: 13px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.82rem;
}

.movie-card-large {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
}

.movie-card-large .movie-cover {
    aspect-ratio: auto;
    min-height: 100%;
}

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

.category-card {
    display: grid;
    gap: 16px;
    min-height: 230px;
    padding: 24px;
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.62)),
        radial-gradient(circle at 90% 0%, rgba(34, 211, 238, 0.2), transparent 15rem);
    border: 1px solid var(--line);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.category-card:hover {
    transform: translateY(-4px);
    border-color: var(--line-strong);
}

.category-card h2,
.category-card h3 {
    margin: 0;
    font-size: 1.55rem;
}

.category-card p {
    margin: 0;
    color: var(--muted);
}

.category-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-preview a {
    color: var(--soft);
    background: rgba(51, 65, 85, 0.5);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.82rem;
}

.category-preview a:hover {
    color: var(--cyan);
}

.filter-panel {
    display: grid;
    grid-template-columns: 1fr minmax(320px, 0.95fr);
    gap: 24px;
    align-items: end;
    margin-bottom: 26px;
    padding: 22px;
    border-radius: var(--radius);
    background: var(--panel);
    border: 1px solid var(--line);
}

.filter-controls {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 10px;
}

.filter-controls input,
.filter-controls select {
    width: 100%;
    padding: 0 12px;
}

.rank-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 22px;
}

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

.compact-item {
    display: grid;
    grid-template-columns: auto 58px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid var(--line);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.compact-item:hover {
    transform: translateX(4px);
    border-color: var(--line-strong);
}

.compact-item img {
    width: 58px;
    height: 78px;
    border-radius: 10px;
    object-fit: cover;
    background: rgba(15, 23, 42, 0.8);
}

.rank-num,
.rank-dot {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    color: #ffffff;
    font-weight: 900;
    background: linear-gradient(135deg, var(--orange), var(--danger));
}

.rank-dot {
    width: 10px;
    height: 10px;
    background: var(--cyan);
}

.compact-copy {
    display: grid;
    min-width: 0;
}

.compact-copy strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compact-copy small {
    color: var(--muted);
}

.side-panel {
    padding: 20px;
    border-radius: var(--radius);
    background: var(--panel);
    border: 1px solid var(--line);
}

.side-panel h2,
.side-panel h3 {
    margin: 0 0 14px;
}

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

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    margin-bottom: 20px;
    font-size: 0.92rem;
}

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

.player-shell {
    position: relative;
    overflow: hidden;
    border-radius: 26px;
    background: #000000;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    aspect-ratio: 16 / 9;
}

.player-shell video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000000;
}

.player-layer {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    gap: 14px;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.68), rgba(2, 6, 23, 0.2));
    border: 0;
    color: #ffffff;
    cursor: pointer;
}

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

.player-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 0 24px;
    font-size: 1.05rem;
}

.player-play-icon {
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(34, 211, 238, 0.18);
    border: 1px solid rgba(34, 211, 238, 0.36);
    color: #ffffff;
    font-size: 1.8rem;
}

.detail-copy,
.detail-side-card {
    margin-top: 22px;
    padding: 24px;
    border-radius: var(--radius);
    background: var(--panel);
    border: 1px solid var(--line);
}

.detail-copy h1 {
    margin: 0 0 16px;
    font-size: clamp(1.75rem, 4vw, 3.15rem);
    line-height: 1.08;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--muted);
    margin: 0 0 20px;
}

.detail-meta span {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(51, 65, 85, 0.45);
    border: 1px solid var(--line);
}

.detail-copy h2 {
    margin: 28px 0 10px;
    font-size: 1.35rem;
}

.detail-copy p {
    color: var(--soft);
}

.detail-side-card {
    margin-top: 0;
    position: sticky;
    top: 96px;
}

.detail-side-card img {
    width: 100%;
    border-radius: 18px;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    background: rgba(15, 23, 42, 0.82);
}

.detail-side-card h2 {
    margin: 18px 0 8px;
}

.info-list {
    display: grid;
    gap: 10px;
    margin: 16px 0;
    color: var(--soft);
}

.info-list div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.info-list span:first-child {
    color: var(--muted);
}

.related-section {
    margin-top: 34px;
}

.site-footer {
    margin-top: 40px;
    padding: 38px 0 28px;
    border-top: 1px solid var(--line);
    background: rgba(2, 6, 23, 0.72);
}

.footer-inner {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 24px;
}

.footer-inner strong {
    color: #ffffff;
    font-size: 1.2rem;
}

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

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

.footer-inner nav a {
    color: var(--soft);
    background: rgba(51, 65, 85, 0.42);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 12px;
}

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

.copyright {
    width: min(100% - 32px, var(--container));
    margin: 22px auto 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.empty-state {
    display: none;
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--muted);
}

.empty-state.is-visible {
    display: block;
}

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

    .menu-toggle {
        display: block;
    }

    .hero-layout {
        grid-template-columns: 1fr;
        gap: 30px;
        padding-top: 88px;
    }

    .hero-poster {
        max-width: 360px;
        min-height: 450px;
    }

    .hero-poster img {
        min-height: 450px;
    }

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

    .filter-panel,
    .rank-layout,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-side-card {
        position: static;
    }
}

@media (max-width: 760px) {
    .header-inner,
    .mobile-nav,
    .container,
    .footer-inner,
    .copyright {
        width: min(100% - 24px, var(--container));
    }

    .brand-text small {
        display: none;
    }

    .hero-carousel,
    .hero-layout {
        min-height: 700px;
    }

    .hero-layout {
        padding: 72px 0 68px;
    }

    .hero-copy h1,
    .page-hero h1 {
        font-size: clamp(2.25rem, 14vw, 4rem);
    }

    .hero-poster {
        max-width: 270px;
        min-height: 360px;
    }

    .hero-poster img {
        min-height: 360px;
    }

    .section-head {
        display: grid;
    }

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

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

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

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

    .footer-inner nav {
        justify-content: flex-start;
    }
}

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

    .compact-item {
        grid-template-columns: auto 52px minmax(0, 1fr);
    }

    .hero-actions {
        display: grid;
    }

    .btn {
        width: 100%;
    }
}
