:root {
    color-scheme: dark;
    --bg: #050915;
    --panel: rgba(10, 18, 34, 0.84);
    --panel-strong: #0c1428;
    --line: rgba(148, 163, 184, 0.18);
    --text: #eef6ff;
    --muted: #91a4bf;
    --blue: #38bdf8;
    --cyan: #67e8f9;
    --violet: #818cf8;
    --hot: #f97316;
    --radius: 24px;
    --shadow: 0 26px 70px rgba(0, 0, 0, 0.38);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 20% 0%, rgba(14, 165, 233, 0.28), transparent 35%),
        radial-gradient(circle at 80% 10%, rgba(99, 102, 241, 0.24), transparent 28%),
        linear-gradient(180deg, #050915 0%, #08111f 48%, #060812 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.65;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    content: "";
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.82), transparent 82%);
}

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;
    border-bottom: 1px solid var(--line);
    background: rgba(5, 9, 21, 0.82);
    backdrop-filter: blur(18px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(1220px, calc(100% - 32px));
    margin: 0 auto;
    padding: 16px 0;
}

.logo,
.footer-logo {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.logo-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--blue), var(--violet));
    box-shadow: 0 0 35px rgba(56, 189, 248, 0.4);
    font-size: 13px;
}

.desktop-nav,
.footer-links {
    display: flex;
    gap: 26px;
    align-items: center;
}

.desktop-nav a,
.mobile-nav a,
.footer-links a {
    color: var(--muted);
    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,
.footer-links a:hover {
    color: var(--cyan);
}

.header-actions {
    display: flex;
    gap: 10px;
}

.icon-button {
    display: inline-grid;
    width: 40px;
    height: 40px;
    place-items: center;
    color: #fff;
    cursor: pointer;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    transition: transform 0.2s ease, background 0.2s ease;
}

.icon-button:hover {
    background: rgba(56, 189, 248, 0.16);
    transform: translateY(-1px);
}

.nav-button {
    display: none;
}

.search-panel,
.mobile-nav {
    display: none;
    border-top: 1px solid var(--line);
}

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

.global-search-form {
    display: flex;
    gap: 12px;
    width: min(960px, calc(100% - 32px));
    margin: 0 auto;
    padding: 14px 0;
}

.global-search-form input,
.filter-input,
.filter-select {
    width: 100%;
    color: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    padding: 13px 16px;
}

.global-search-form input:focus,
.filter-input:focus,
.filter-select:focus {
    border-color: rgba(103, 232, 249, 0.7);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
}

.global-search-form button,
.btn {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    color: #04111f;
    cursor: pointer;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    padding: 12px 22px;
    font-weight: 800;
    box-shadow: 0 16px 36px rgba(56, 189, 248, 0.24);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

.btn.secondary {
    color: #dcecff;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.global-search-form button:hover,
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 42px rgba(56, 189, 248, 0.34);
}

.mobile-nav {
    width: min(1220px, calc(100% - 32px));
    margin: 0 auto;
    padding: 12px 0 18px;
}

.mobile-nav a {
    display: block;
    padding: 10px 0;
}

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

.hero-stage {
    position: relative;
    min-height: 620px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 34px;
    background: #07101f;
    box-shadow: var(--shadow);
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.72fr);
    gap: 32px;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.55s ease;
    padding: clamp(26px, 5vw, 64px);
}

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

.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(18px) saturate(1.15) brightness(0.54);
    transform: scale(1.08);
}

.hero-shade {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 80% 30%, rgba(56, 189, 248, 0.34), transparent 35%),
        linear-gradient(90deg, rgba(3, 7, 18, 0.96) 0%, rgba(3, 7, 18, 0.66) 50%, rgba(3, 7, 18, 0.42) 100%);
}

.hero-content,
.hero-poster {
    position: relative;
    z-index: 2;
}

.hero-kicker,
.eyebrow {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    color: var(--cyan);
    border: 1px solid rgba(103, 232, 249, 0.28);
    border-radius: 999px;
    background: rgba(8, 47, 73, 0.5);
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 700;
}

.hero h1,
.hero h2,
.page-hero h1,
.detail-title h1 {
    max-width: 820px;
    margin: 18px 0 16px;
    font-size: clamp(38px, 6vw, 76px);
    line-height: 1.04;
    letter-spacing: -0.04em;
}

.hero h2 {
    font-size: clamp(34px, 5.5vw, 68px);
}

.gradient-text {
    background: linear-gradient(135deg, #fff, var(--cyan), var(--blue));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-text,
.page-hero p,
.detail-title p {
    max-width: 760px;
    color: #c6d3e5;
    font-size: 18px;
}

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

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

.hero-tags em,
.tag-row em,
.meta-row span {
    color: #dbeafe;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    padding: 5px 10px;
    font-size: 12px;
    font-style: normal;
}

.tag-row.small em {
    font-size: 11px;
    padding: 3px 8px;
}

.hero-poster {
    justify-self: center;
    width: min(360px, 100%);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.45);
    transform: rotate(2deg);
}

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

.hero-thumbs {
    position: absolute;
    z-index: 5;
    right: 34px;
    bottom: 28px;
    left: 34px;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.hero-thumb {
    display: flex;
    gap: 10px;
    align-items: center;
    min-width: 0;
    color: #fff;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(14px);
    padding: 8px;
    opacity: 0.72;
    transition: opacity 0.2s ease, transform 0.2s ease, border 0.2s ease;
}

.hero-thumb img {
    width: 42px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
}

.hero-thumb span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.hero-thumb.active,
.hero-thumb:hover {
    opacity: 1;
    border-color: rgba(103, 232, 249, 0.55);
    transform: translateY(-2px);
}

.section,
.page-hero,
.detail-wrap {
    width: min(1220px, calc(100% - 32px));
    margin: 54px auto 0;
}

.page-hero {
    border: 1px solid var(--line);
    border-radius: 30px;
    background:
        linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(99, 102, 241, 0.08)),
        rgba(255, 255, 255, 0.05);
    box-shadow: var(--shadow);
    padding: clamp(26px, 5vw, 54px);
}

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

.section-heading h2,
.section-heading h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.1;
}

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

.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 24px 0;
}

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

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

.movie-card {
    position: relative;
    display: flex;
    min-width: 0;
    overflow: hidden;
    color: inherit;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035));
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
    transition: transform 0.24s ease, border 0.24s ease, box-shadow 0.24s ease;
    flex-direction: column;
}

.movie-card:hover {
    transform: translateY(-7px);
    border-color: rgba(103, 232, 249, 0.5);
    box-shadow: 0 24px 60px rgba(14, 165, 233, 0.18);
}

.poster-wrap {
    position: relative;
    overflow: hidden;
    background: #111827;
}

.poster-wrap img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    transform: scale(1.01);
    transition: transform 0.35s ease;
}

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

.poster-glow {
    position: absolute;
    inset: auto 0 0;
    height: 45%;
    background: linear-gradient(180deg, transparent, rgba(3, 7, 18, 0.85));
}

.play-badge {
    position: absolute;
    right: 12px;
    bottom: 12px;
    color: #07111f;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 800;
}

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

.card-title {
    display: -webkit-box;
    min-height: 3em;
    overflow: hidden;
    font-size: 17px;
    line-height: 1.45;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-meta,
.card-desc,
.rank-info small {
    color: var(--muted);
    font-size: 13px;
}

.card-desc {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

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

.category-tile {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.06);
    padding: 14px;
    transition: transform 0.24s ease, border 0.24s ease;
}

.category-tile:hover {
    transform: translateY(-5px);
    border-color: rgba(103, 232, 249, 0.45);
}

.tile-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.tile-images img {
    aspect-ratio: 2 / 3;
    border-radius: 14px;
    object-fit: cover;
}

.tile-body strong {
    display: block;
    margin-bottom: 8px;
    font-size: 22px;
}

.tile-body small {
    color: var(--muted);
}

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

.rank-panel {
    border: 1px solid var(--line);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.055);
    padding: 18px;
}

.rank-panel h2,
.rank-panel h3 {
    margin: 0 0 16px;
}

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

.rank-card {
    display: grid;
    grid-template-columns: 42px 58px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    border: 1px solid transparent;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.055);
    padding: 10px;
    transition: border 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.rank-card:hover {
    border-color: rgba(103, 232, 249, 0.44);
    background: rgba(56, 189, 248, 0.1);
    transform: translateX(3px);
}

.rank-no {
    color: var(--cyan);
    font-size: 20px;
    font-weight: 900;
    text-align: center;
}

.rank-card img {
    width: 58px;
    height: 78px;
    border-radius: 12px;
    object-fit: cover;
}

.rank-info {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.rank-info strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) 360px;
    gap: 28px;
}

.detail-title {
    border: 1px solid var(--line);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.055);
    padding: clamp(24px, 4vw, 44px);
}

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

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

.player-shell {
    margin-top: 24px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    background: #000;
    box-shadow: var(--shadow);
}

.video-frame {
    position: relative;
    background: #000;
    aspect-ratio: 16 / 9;
}

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

.play-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    cursor: pointer;
    border: 0;
    background: radial-gradient(circle at center, rgba(15, 23, 42, 0.08), rgba(0, 0, 0, 0.52));
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.play-overlay span {
    display: grid;
    width: 82px;
    height: 82px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    color: #061121;
    font-size: 32px;
    box-shadow: 0 20px 50px rgba(56, 189, 248, 0.35);
}

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

.detail-wrap .section {
    width: auto;
    margin: 24px 0 0;
}

.detail-card,
.related-box {
    border: 1px solid var(--line);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.055);
    padding: 22px;
}

.detail-card h2,
.related-box h2 {
    margin-top: 0;
}

.detail-card p {
    color: #cbd8ea;
}

.side-poster {
    overflow: hidden;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: var(--shadow);
}

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

.sidebar {
    display: grid;
    gap: 20px;
    align-content: start;
}

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

.related-grid .movie-card .card-desc,
.related-grid .movie-card .tag-row {
    display: none;
}

.next-prev {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.next-prev a {
    color: #dbeafe;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
    padding: 14px;
}

.next-prev a:hover {
    border-color: rgba(103, 232, 249, 0.42);
}

.empty-state {
    display: none;
    color: var(--muted);
    border: 1px dashed var(--line);
    border-radius: 20px;
    padding: 28px;
    text-align: center;
}

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

.site-footer {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
    width: min(1220px, calc(100% - 32px));
    margin: 70px auto 0;
    border-top: 1px solid var(--line);
    padding: 32px 0 42px;
    color: var(--muted);
}

.site-footer p {
    max-width: 560px;
    margin: 8px 0 0;
}

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

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

    .hero-poster {
        display: none;
    }

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

    .sidebar {
        grid-template-columns: 240px minmax(0, 1fr);
    }
}

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

    .nav-button {
        display: inline-grid;
    }

    .hero-stage {
        min-height: 620px;
    }

    .hero-slide {
        padding: 28px 22px 150px;
    }

    .hero-thumbs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        right: 16px;
        bottom: 16px;
        left: 16px;
    }

    .hero-thumb:nth-child(n+4) {
        display: none;
    }

    .movie-grid,
    .movie-grid.dense,
    .category-grid,
    .ranking-layout,
    .related-grid,
    .next-prev {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .category-tile {
        grid-template-columns: 1fr;
    }

    .site-footer {
        align-items: flex-start;
        flex-direction: column;
    }

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

@media (max-width: 560px) {
    .header-inner,
    .section,
    .page-hero,
    .detail-wrap,
    .hero,
    .site-footer {
        width: min(100% - 20px, 1220px);
    }

    .hero-stage {
        min-height: 590px;
        border-radius: 24px;
    }

    .hero h1,
    .hero h2,
    .page-hero h1,
    .detail-title h1 {
        font-size: 34px;
    }

    .hero-text,
    .page-hero p,
    .detail-title p {
        font-size: 15px;
    }

    .hero-actions,
    .filter-bar,
    .global-search-form,
    .section-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .movie-grid,
    .movie-grid.dense,
    .category-grid,
    .ranking-layout,
    .related-grid,
    .next-prev {
        grid-template-columns: 1fr;
    }

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