:root {
    color-scheme: dark;
    --bg: #020617;
    --bg-soft: #0f172a;
    --panel: rgba(15, 23, 42, 0.72);
    --panel-strong: rgba(30, 41, 59, 0.9);
    --line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --accent: #6366f1;
    --accent-2: #8b5cf6;
    --accent-3: #22d3ee;
    --danger: #f43f5e;
    --radius: 22px;
    --shadow: 0 24px 60px rgba(2, 6, 23, 0.42);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(99, 102, 241, 0.22), transparent 34rem),
        radial-gradient(circle at top right, rgba(34, 211, 238, 0.14), transparent 30rem),
        linear-gradient(180deg, #020617 0%, #0f172a 46%, #020617 100%);
    color: var(--text);
}

body.menu-open {
    overflow: hidden;
}

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;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(2, 6, 23, 0.78);
    backdrop-filter: blur(18px);
}

.header-inner {
    width: min(1180px, calc(100% - 32px));
    height: 76px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand,
.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
}

.brand-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: white;
    box-shadow: 0 14px 36px rgba(99, 102, 241, 0.28);
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

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

.brand-copy small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 28px;
    color: var(--soft);
}

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

.desktop-nav a:hover,
.desktop-nav a.active,
.mobile-nav a:hover,
.mobile-nav a.active,
.footer-links a:hover {
    color: white;
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.68);
    color: white;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    border-radius: 99px;
    background: currentColor;
}

.mobile-nav {
    display: none;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.94);
}

.mobile-nav a {
    display: block;
    padding: 12px 14px;
    color: var(--soft);
    border-radius: 12px;
}

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

.hero {
    position: relative;
    min-height: 620px;
    overflow: hidden;
    background: #020617;
}

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

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

.hero-slide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.03);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.94), rgba(2, 6, 23, 0.58), rgba(2, 6, 23, 0.16)),
        linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.24) 42%, rgba(2, 6, 23, 0.08) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(1180px, calc(100% - 32px));
    min-height: 620px;
    margin: 0 auto;
    padding: 120px 0 92px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
}

.hero-kicker,
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    color: #c7d2fe;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-kicker {
    padding: 8px 12px;
    border: 1px solid rgba(199, 210, 254, 0.24);
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.42);
    backdrop-filter: blur(12px);
}

.hero h1 {
    max-width: 760px;
    margin: 0 0 18px;
    font-size: clamp(42px, 7vw, 76px);
    line-height: 0.96;
    letter-spacing: -0.06em;
}

.hero p {
    max-width: 720px;
    margin: 0 0 22px;
    color: #dbeafe;
    font-size: clamp(17px, 2vw, 22px);
    line-height: 1.72;
}

.hero-meta,
.hero-tags,
.tag-row,
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.hero-meta span,
.detail-meta span {
    color: var(--soft);
    font-size: 14px;
}

.hero-tags span,
.tag-row span {
    padding: 6px 10px;
    border: 1px solid rgba(99, 102, 241, 0.22);
    border-radius: 999px;
    color: #c7d2fe;
    background: rgba(99, 102, 241, 0.12);
    font-size: 12px;
}

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

.primary-btn,
.ghost-btn,
.home-search button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 22px;
    border-radius: 14px;
    font-weight: 800;
    transition: transform 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}

.primary-btn,
.home-search button {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: white;
    box-shadow: 0 18px 42px rgba(99, 102, 241, 0.26);
}

.ghost-btn {
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(15, 23, 42, 0.48);
    color: white;
    backdrop-filter: blur(12px);
}

.primary-btn:hover,
.ghost-btn:hover,
.home-search button:hover {
    transform: translateY(-2px);
}

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.52);
    color: white;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
    transition: background 0.22s ease, transform 0.22s ease;
}

.hero-arrow:hover {
    background: rgba(15, 23, 42, 0.86);
    transform: translateY(-50%) scale(1.06);
}

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

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

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

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

.hero-dots button.active {
    width: 34px;
    background: white;
}

.quick-panel {
    position: relative;
    z-index: 5;
    margin-top: -44px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.86);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.quick-panel h2,
.section-head h2,
.rank-panel h2,
.page-hero h1,
.detail-card h1,
.detail-card h2,
.side-card h2 {
    margin: 0;
    color: white;
    letter-spacing: -0.03em;
}

.quick-panel h2 {
    font-size: clamp(26px, 4vw, 42px);
}

.quick-panel p,
.page-hero p,
.category-card p,
.category-preview p,
.detail-card p,
.site-footer p {
    color: var(--muted);
    line-height: 1.75;
}

.home-search,
.filter-bar {
    display: flex;
    gap: 12px;
    margin-top: 22px;
}

.home-search input,
.filter-bar input,
.filter-bar select {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(2, 6, 23, 0.58);
    color: white;
    outline: none;
    padding: 0 16px;
}

.filter-bar select {
    max-width: 180px;
}

.home-search input:focus,
.filter-bar input:focus,
.filter-bar select:focus {
    border-color: rgba(99, 102, 241, 0.8);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
}

.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.category-pills a {
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--soft);
    background: rgba(30, 41, 59, 0.58);
    transition: color 0.22s ease, border-color 0.22s ease, transform 0.22s ease;
}

.category-pills a:hover {
    color: white;
    border-color: rgba(99, 102, 241, 0.6);
    transform: translateY(-2px);
}

.section-wrap + .section-wrap,
.section-wrap.split-layout {
    margin-top: 70px;
}

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

.section-head h2 {
    font-size: clamp(26px, 3vw, 36px);
}

.section-head a,
.rank-panel-head a {
    color: #a5b4fc;
    font-weight: 800;
}

.compact-head {
    align-items: center;
    margin-bottom: 18px;
}

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

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

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

.movie-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.62);
    box-shadow: 0 18px 38px rgba(2, 6, 23, 0.18);
    transition: transform 0.24s ease, border-color 0.24s ease, background 0.24s ease;
}

.movie-card:hover {
    transform: translateY(-6px) scale(1.01);
    border-color: rgba(99, 102, 241, 0.44);
    background: rgba(30, 41, 59, 0.78);
}

.card-link {
    display: block;
    height: 100%;
}

.poster-wrap {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.8);
}

.compact-card .poster-wrap {
    aspect-ratio: 1 / 1;
}

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

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

.poster-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 20%, rgba(2, 6, 23, 0.72) 100%);
}

.play-chip,
.rank-badge {
    position: absolute;
    z-index: 2;
    top: 12px;
    border-radius: 999px;
    color: white;
    font-size: 12px;
    font-weight: 800;
}

.play-chip {
    right: 12px;
    padding: 7px 10px;
    background: rgba(99, 102, 241, 0.86);
}

.rank-badge {
    left: 12px;
    min-width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #f97316, #e11d48);
}

.card-body {
    padding: 18px;
}

.meta-line {
    margin: 0 0 8px;
    color: #a5b4fc;
    font-size: 12px;
    font-weight: 800;
}

.movie-card h3 {
    margin: 0 0 10px;
    color: white;
    font-size: 18px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-desc {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tag-row {
    gap: 7px;
}

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

.rank-panel,
.detail-card,
.side-card,
.filter-panel,
.category-preview {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.66);
    box-shadow: var(--shadow);
}

.rank-panel {
    position: sticky;
    top: 100px;
    padding: 24px;
}

.rank-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.rank-panel ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.rank-panel li + li {
    border-top: 1px solid var(--line);
}

.rank-panel li a {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 10px;
    padding: 13px 0;
    align-items: center;
}

.rank-number {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: white;
    background: rgba(99, 102, 241, 0.32);
    font-weight: 900;
}

.rank-title {
    color: white;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-meta {
    grid-column: 2;
    color: var(--muted);
    font-size: 12px;
}

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

.category-card {
    min-height: 160px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(15, 23, 42, 0.68)),
        rgba(15, 23, 42, 0.6);
    transition: transform 0.24s ease, border-color 0.24s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: rgba(129, 140, 248, 0.58);
}

.category-card span {
    display: block;
    margin-bottom: 10px;
    color: white;
    font-size: 22px;
    font-weight: 900;
}

.page-hero {
    padding: 78px 0 20px;
}

.slim-hero {
    max-width: 1180px;
}

.page-hero h1 {
    max-width: 820px;
    font-size: clamp(38px, 5vw, 58px);
}

.page-hero p {
    max-width: 760px;
    font-size: 17px;
}

.large-category-grid {
    margin-top: 20px;
}

.category-preview {
    margin-bottom: 28px;
    padding: 24px;
}

.filter-panel {
    padding: 24px;
}

.filter-bar {
    margin-top: 0;
    margin-bottom: 26px;
}

.wide-filter input {
    min-height: 54px;
}

.ranking-page {
    margin-top: 30px;
}

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

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 26px 0 18px;
    color: var(--muted);
    font-size: 14px;
}

.breadcrumb a {
    color: #a5b4fc;
}

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

.player-shell {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 24px;
    background: black;
    box-shadow: var(--shadow);
    aspect-ratio: 16 / 9;
}

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

.player-cover {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 100%;
    height: 100%;
    border: 0;
    background: radial-gradient(circle, rgba(15, 23, 42, 0.35), rgba(2, 6, 23, 0.76));
    color: white;
    cursor: pointer;
    z-index: 3;
}

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

.big-play {
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 18px 50px rgba(99, 102, 241, 0.38);
    font-size: 30px;
    text-indent: 4px;
}

.player-loading {
    position: absolute;
    left: 50%;
    bottom: 22px;
    z-index: 4;
    padding: 8px 13px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.82);
    color: white;
    transform: translateX(-50%);
}

.detail-card {
    margin-top: 22px;
    padding: 28px;
}

.detail-card h1 {
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.12;
}

.detail-meta {
    margin: 16px 0 18px;
}

.detail-tags {
    margin-bottom: 26px;
}

.detail-card h2 {
    margin-top: 28px;
    margin-bottom: 12px;
    font-size: 24px;
}

.detail-poster {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 22px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.side-card {
    margin-top: 20px;
    padding: 22px;
}

.side-links {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.side-links a {
    display: block;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(2, 6, 23, 0.34);
    transition: border-color 0.22s ease, transform 0.22s ease;
}

.side-links a:hover {
    border-color: rgba(99, 102, 241, 0.52);
    transform: translateX(3px);
}

.side-links span {
    display: block;
    color: white;
    font-weight: 800;
}

.side-links small {
    color: var(--muted);
}

.site-footer {
    margin-top: 86px;
    border-top: 1px solid var(--line);
    background: rgba(2, 6, 23, 0.48);
}

.footer-inner {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 42px 0 28px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.footer-logo {
    color: white;
    font-size: 22px;
}

.footer-inner p {
    max-width: 560px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 14px 22px;
    color: var(--muted);
}

.copyright {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 0 0 34px;
    color: #64748b;
    font-size: 13px;
}

.hidden-card {
    display: none !important;
}

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

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

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

    .rank-panel {
        position: static;
    }

    .detail-side {
        display: grid;
        grid-template-columns: 220px 1fr;
        gap: 20px;
        align-items: start;
    }

    .side-card {
        margin-top: 0;
    }
}

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

    .menu-toggle {
        display: block;
    }

    body.menu-open .mobile-nav {
        display: block;
    }

    .hero,
    .hero-content {
        min-height: 560px;
    }

    .hero-content {
        padding-top: 92px;
        padding-bottom: 78px;
    }

    .hero-arrow {
        display: none;
    }

    .quick-panel {
        margin-top: -26px;
        padding: 22px;
    }

    .home-search,
    .filter-bar,
    .footer-inner,
    .detail-side {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .filter-bar select {
        max-width: none;
    }

    .movie-grid,
    .featured-grid,
    .small-grid,
    .ranking-grid,
    .category-grid,
    .detail-side {
        grid-template-columns: 1fr;
    }

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

    .footer-links {
        justify-content: flex-start;
    }

    .page-hero {
        padding-top: 52px;
    }
}
