:root {
    color-scheme: dark;
    --bg: #020617;
    --bg-soft: #0f172a;
    --panel: rgba(15, 23, 42, 0.72);
    --panel-strong: rgba(15, 23, 42, 0.94);
    --line: rgba(59, 130, 246, 0.25);
    --text: #f8fafc;
    --muted: #94a3b8;
    --muted-strong: #cbd5e1;
    --cyan: #22d3ee;
    --blue: #3b82f6;
    --purple: #8b5cf6;
    --yellow: #facc15;
    --radius: 22px;
    --shadow: 0 24px 80px rgba(2, 6, 23, 0.55);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: radial-gradient(circle at 15% 0%, rgba(34, 211, 238, 0.16), transparent 30%), radial-gradient(circle at 85% 10%, rgba(59, 130, 246, 0.18), transparent 34%), linear-gradient(180deg, #020617 0%, #0f172a 42%, #020617 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 78%);
    z-index: -1;
}

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

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

button,
input,
select {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(30, 64, 175, 0.86), rgba(15, 23, 42, 0.96));
    backdrop-filter: blur(18px);
    box-shadow: 0 10px 40px rgba(2, 6, 23, 0.36);
}

.header-inner,
.footer-inner,
.content-section,
.rank-section,
.page-main,
.quick-search {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

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

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.brand-icon {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    color: #02111f;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    border-radius: 12px;
    box-shadow: 0 0 28px rgba(34, 211, 238, 0.45);
}

.brand-text {
    font-size: clamp(1.15rem, 2vw, 1.6rem);
    background: linear-gradient(90deg, var(--cyan), #93c5fd);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    color: var(--muted-strong);
    font-weight: 700;
    white-space: nowrap;
}

.nav-link {
    transition: color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
    color: var(--cyan);
}

.nav-link:hover {
    transform: translateY(-1px);
}

.mobile-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.7);
    color: var(--text);
}

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

.mobile-nav {
    display: none;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 0 0 18px;
    color: var(--muted-strong);
}

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

.hero {
    position: relative;
    height: clamp(520px, 72vh, 760px);
    overflow: hidden;
    isolation: isolate;
}

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

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

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

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

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.16) 0%, rgba(2, 6, 23, 0.52) 42%, rgba(2, 6, 23, 0.96) 100%), linear-gradient(90deg, rgba(2, 6, 23, 0.82) 0%, rgba(2, 6, 23, 0.35) 48%, rgba(2, 6, 23, 0.72) 100%);
}

.hero-content {
    position: absolute;
    left: max(24px, calc((100% - 1180px) / 2));
    right: max(24px, calc((100% - 1180px) / 2));
    bottom: 84px;
    max-width: 720px;
    filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.45));
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--cyan);
    font-size: 0.85rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

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

.hero p,
.page-hero p,
.detail-header p {
    max-width: 780px;
    margin: 20px 0 0;
    color: var(--muted-strong);
    font-size: clamp(1rem, 2vw, 1.25rem);
    line-height: 1.8;
}

.hero-actions,
.search-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: 28px;
}

.primary-button,
.ghost-button,
.section-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 22px;
    border-radius: 999px;
    font-weight: 900;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-button {
    color: #02111f;
    background: linear-gradient(135deg, var(--cyan), #60a5fa);
    box-shadow: 0 18px 40px rgba(34, 211, 238, 0.26);
}

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

.ghost-button,
.section-link {
    color: var(--text);
    background: rgba(15, 23, 42, 0.62);
    border: 1px solid var(--line);
}

.small-button {
    min-height: 42px;
    padding: 0 18px;
}

.hero-dots {
    position: absolute;
    right: max(24px, calc((100% - 1180px) / 2));
    bottom: 42px;
    display: flex;
    gap: 10px;
    z-index: 3;
}

.hero-dots button {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: width 0.3s ease, background 0.3s ease;
}

.hero-dots button.is-active {
    width: 38px;
    background: var(--cyan);
}

.panel {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.78), rgba(30, 41, 59, 0.58));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.quick-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
    align-items: center;
    gap: 26px;
    margin-top: -42px;
    padding: 28px;
    position: relative;
    z-index: 4;
}

.quick-search p,
.section-heading p {
    margin: 0 0 8px;
    color: var(--cyan);
    font-weight: 900;
    letter-spacing: 0.06em;
}

.quick-search h2,
.section-heading h2,
.rank-feature h2,
.side-rank h2,
.story-panel h2 {
    margin: 0;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    letter-spacing: -0.04em;
}

.search-bar input,
.filter-panel input,
.filter-panel select {
    width: 100%;
    min-height: 46px;
    color: var(--text);
    background: rgba(2, 6, 23, 0.6);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 18px;
    outline: none;
}

.search-bar input:focus,
.filter-panel input:focus,
.filter-panel select:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.14);
}

.search-bar {
    margin: 0;
}

.search-bar input {
    flex: 1 1 220px;
}

.content-section,
.rank-section {
    padding: 76px 0 0;
}

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

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

.compact-grid {
    grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
}

.movie-card {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.poster-wrap {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 64, 175, 0.32));
    border: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: 0 18px 48px rgba(2, 6, 23, 0.48);
}

.poster-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, filter 0.5s ease;
}

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

.poster-shade,
.category-card-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 32%, rgba(2, 6, 23, 0.88) 100%);
}

.play-chip,
.rank-badge {
    position: absolute;
    z-index: 2;
    color: var(--text);
    font-weight: 900;
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
}

.play-chip {
    right: 12px;
    bottom: 12px;
    padding: 8px 12px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.movie-card:hover .play-chip {
    opacity: 1;
    transform: translateY(0);
}

.rank-badge {
    left: 12px;
    top: 12px;
    min-width: 38px;
    min-height: 38px;
    display: inline-grid;
    place-items: center;
    color: #02111f;
    background: linear-gradient(135deg, var(--yellow), #fb923c);
}

.card-body {
    display: grid;
    gap: 8px;
}

.card-body strong {
    color: var(--text);
    font-size: 1.03rem;
    line-height: 1.38;
    transition: color 0.2s ease;
}

.movie-card:hover strong {
    color: var(--cyan);
}

.card-body em,
.rank-row em,
.overview-card em,
.category-card em {
    color: var(--muted);
    font-style: normal;
    font-size: 0.88rem;
}

.card-text {
    color: var(--muted-strong);
    font-size: 0.9rem;
    line-height: 1.6;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.tag-row span {
    color: var(--cyan);
    background: rgba(34, 211, 238, 0.11);
    border: 1px solid rgba(34, 211, 238, 0.16);
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 0.75rem;
    font-weight: 700;
}

.category-grid,
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.category-card,
.overview-card {
    position: relative;
    min-height: 190px;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

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

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

.category-card strong,
.category-card em {
    position: relative;
    z-index: 2;
}

.category-card strong,
.overview-card strong {
    font-size: 1.35rem;
    margin-bottom: 8px;
}

.overview-card {
    min-height: 260px;
    justify-content: space-between;
}

.thumb-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 18px;
}

.thumb-strip img {
    height: 118px;
    width: 100%;
    object-fit: cover;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.88);
}

.overview-card > span:last-child {
    color: var(--cyan);
    font-weight: 900;
}

.rank-section {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.75fr);
    gap: 24px;
}

.rank-panel,
.rank-feature,
.side-rank {
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.rank-panel {
    padding: 28px;
}

.rank-list {
    list-style: none;
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
}

.rank-list li {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 16px;
    min-height: 46px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.rank-list li span {
    color: var(--cyan);
    font-weight: 900;
}

.rank-list li a {
    font-weight: 800;
}

.rank-list li a:hover {
    color: var(--cyan);
}

.rank-list li em {
    color: var(--muted);
    font-style: normal;
}

.rank-feature {
    display: grid;
    min-height: 100%;
}

.rank-feature img {
    width: 100%;
    height: 320px;
    object-fit: cover;
}

.rank-feature div {
    padding: 28px;
}

.rank-feature p,
.story-panel p {
    color: var(--muted-strong);
    line-height: 1.9;
}

.page-main {
    padding-top: 42px;
}

.page-hero {
    padding: clamp(28px, 6vw, 54px);
    margin-bottom: 32px;
}

.filter-panel {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    padding: 18px;
    margin-bottom: 32px;
}

.advanced-filter {
    grid-template-columns: minmax(220px, 1.6fr) repeat(4, minmax(130px, 1fr));
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    margin-bottom: 20px;
}

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

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

.detail-main {
    display: grid;
    gap: 24px;
}

.player-box {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    background: #000;
    border: 1px solid rgba(34, 211, 238, 0.2);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.62), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.player-box video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.player-cover {
    position: absolute;
    inset: 0;
    padding: 0;
    border: 0;
    color: var(--text);
    background: transparent;
    cursor: pointer;
}

.player-cover.is-hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.player-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.68);
}

.player-shade {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(34, 211, 238, 0.18), rgba(0, 0, 0, 0.78));
}

.play-orb {
    position: absolute;
    left: 50%;
    top: 50%;
    display: grid;
    width: 92px;
    height: 92px;
    place-items: center;
    color: #02111f;
    background: linear-gradient(135deg, var(--cyan), #93c5fd);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 45px rgba(34, 211, 238, 0.62);
    font-size: 2rem;
    font-weight: 900;
}

.detail-header,
.story-panel {
    padding: 28px;
}

.detail-header h1 {
    font-size: clamp(2rem, 6vw, 4.2rem);
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.detail-meta span {
    padding: 8px 13px;
    border-radius: 999px;
    color: var(--muted-strong);
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.16);
    font-weight: 800;
}

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

.detail-side {
    position: sticky;
    top: 92px;
    align-self: start;
}

.side-rank {
    padding: 20px;
    display: grid;
    gap: 14px;
}

.rank-row {
    display: grid;
    grid-template-columns: 72px 1fr;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 16px;
    background: rgba(2, 6, 23, 0.34);
    transition: background 0.2s ease, transform 0.2s ease;
}

.rank-row:hover {
    background: rgba(34, 211, 238, 0.1);
    transform: translateX(2px);
}

.rank-row img {
    width: 72px;
    height: 94px;
    object-fit: cover;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.9);
}

.rank-row span {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.rank-row strong {
    line-height: 1.35;
}

.page-rank {
    padding-top: 0;
}

.large-feature {
    grid-template-columns: 0.9fr 1fr;
}

.large-feature img {
    height: 100%;
    min-height: 360px;
}

.site-footer {
    margin-top: 86px;
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.35), rgba(2, 6, 23, 0.95));
}

.footer-inner {
    display: grid;
    place-items: center;
    gap: 18px;
    padding: 34px 0;
    color: var(--muted);
    text-align: center;
}

.footer-brand {
    color: var(--text);
    font-size: 1.2rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    justify-content: center;
}

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

.is-filtered-out {
    display: none;
}

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

    .mobile-toggle {
        display: block;
    }

    .quick-search,
    .rank-section,
    .detail-layout,
    .large-feature {
        grid-template-columns: 1fr;
    }

    .detail-side {
        position: static;
    }

    .filter-panel,
    .advanced-filter {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .header-inner,
    .footer-inner,
    .content-section,
    .rank-section,
    .page-main,
    .quick-search {
        width: min(100% - 20px, 1180px);
    }

    .hero {
        height: 620px;
    }

    .hero-content {
        left: 18px;
        right: 18px;
        bottom: 92px;
    }

    .hero-dots {
        left: 18px;
        right: auto;
    }

    .quick-search {
        margin-top: -30px;
        padding: 20px;
    }

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

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

    .filter-panel,
    .advanced-filter {
        grid-template-columns: 1fr;
    }

    .card-text {
        display: none;
    }

    .page-hero,
    .detail-header,
    .story-panel,
    .rank-panel {
        padding: 22px;
    }

    .play-orb {
        width: 70px;
        height: 70px;
    }
}
