:root {
    color-scheme: dark;
    --bg: #0f172a;
    --bg-soft: #111827;
    --panel: rgba(30, 41, 59, 0.68);
    --panel-strong: rgba(15, 23, 42, 0.92);
    --text: #f8fafc;
    --muted: #94a3b8;
    --muted-2: #64748b;
    --line: rgba(148, 163, 184, 0.18);
    --sky: #38bdf8;
    --sky-strong: #0ea5e9;
    --blue: #2563eb;
    --yellow: #facc15;
    --red: #ef4444;
    --orange: #f97316;
    --green: #22c55e;
    --purple: #a855f7;
    --radius: 18px;
    --shadow: 0 24px 70px rgba(2, 8, 23, 0.42);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: linear-gradient(180deg, #020617 0%, #0f172a 42%, #111827 100%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    min-height: 100vh;
}

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

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

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: 100;
    background: rgba(15, 23, 42, 0.78);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
}

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

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

.logo-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: white;
    background: linear-gradient(135deg, var(--sky), var(--blue));
    box-shadow: 0 14px 34px rgba(14, 165, 233, 0.28);
}

.logo-copy strong,
.footer-logo {
    display: block;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.logo-copy small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-left: auto;
}

.nav-link,
.mobile-link {
    color: #cbd5e1;
    font-weight: 650;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active,
.mobile-link:hover,
.mobile-link.is-active {
    color: white;
}

.top-search {
    width: 210px;
}

.top-search input,
.mobile-nav input,
.hero-search input,
.search-panel input,
.inline-filter input,
.inline-filter select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: white;
    outline: none;
    padding: 12px 16px;
}

.top-search input:focus,
.mobile-nav input:focus,
.hero-search input:focus,
.search-panel input:focus,
.inline-filter input:focus,
.inline-filter select:focus {
    border-color: rgba(56, 189, 248, 0.7);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.1);
}

.menu-button {
    display: none;
    margin-left: auto;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    color: white;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.65);
}

.mobile-nav {
    display: none;
    padding: 0 16px 16px;
    border-top: 1px solid var(--line);
    background: rgba(15, 23, 42, 0.94);
}

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

.hero-carousel {
    position: relative;
    min-height: 78vh;
    overflow: hidden;
    background: #020617;
}

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

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

.hero-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.08) contrast(1.05);
}

.hero-shade {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 70% 38%, rgba(56, 189, 248, 0.12), transparent 36%),
        linear-gradient(90deg, rgba(2, 6, 23, 0.9), rgba(15, 23, 42, 0.58) 48%, rgba(2, 6, 23, 0.82)),
        linear-gradient(0deg, #0f172a 0%, rgba(15, 23, 42, 0.28) 42%, rgba(15, 23, 42, 0.2) 100%);
}

.hero-content {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    padding-top: 64px;
}

.hero-text {
    max-width: 720px;
    padding: 42px 0;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--yellow);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.hero-text h1,
.hero-text h2 {
    margin: 0;
    color: white;
    font-size: clamp(42px, 7vw, 78px);
    line-height: 0.98;
    font-weight: 900;
    letter-spacing: -0.06em;
    text-shadow: 0 16px 50px rgba(0, 0, 0, 0.42);
}

.hero-desc {
    max-width: 640px;
    color: #dbeafe;
    font-size: clamp(16px, 2.2vw, 21px);
    line-height: 1.8;
    margin: 26px 0 0;
}

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

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

.hero-tags span,
.detail-meta span,
.detail-tags span,
.tag-row span {
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.16);
    color: #dbeafe;
    border: 1px solid rgba(148, 163, 184, 0.18);
    padding: 7px 12px;
    font-size: 13px;
}

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

.primary-button,
.ghost-button,
.search-panel button,
.hero-search button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    min-height: 48px;
    padding: 0 24px;
    font-weight: 800;
    border: 0;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.primary-button,
.search-panel button,
.hero-search button {
    color: white;
    background: linear-gradient(135deg, var(--sky-strong), var(--blue));
    box-shadow: 0 16px 36px rgba(14, 165, 233, 0.25);
}

.ghost-button {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(12px);
}

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

.hero-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 52px;
    height: 52px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(2, 6, 23, 0.46);
    color: white;
    font-size: 42px;
    line-height: 1;
    backdrop-filter: blur(10px);
}

.hero-prev {
    left: 22px;
}

.hero-next {
    right: 22px;
}

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

.hero-dot {
    width: 28px;
    height: 5px;
    border-radius: 999px;
    border: 0;
    background: rgba(255, 255, 255, 0.35);
    transition: width 0.25s ease, background 0.25s ease;
}

.hero-dot.is-active {
    width: 48px;
    background: white;
}

.hero-search {
    position: absolute;
    z-index: 7;
    left: 50%;
    bottom: 72px;
    transform: translateX(-50%);
    width: min(620px, calc(100% - 40px));
    display: grid;
    grid-template-columns: 1fr 112px;
    gap: 10px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(16px);
}

.section-block {
    padding: 76px 0;
}

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

.section-heading p {
    margin: 0 0 4px;
    color: var(--sky);
    font-size: 13px;
    font-weight: 850;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(26px, 4vw, 38px);
    font-weight: 900;
    letter-spacing: -0.03em;
}

.section-heading a {
    color: var(--sky);
    font-weight: 800;
}

.movie-grid {
    display: grid;
    gap: 22px;
}

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

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

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

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

.movie-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--panel);
    box-shadow: 0 18px 44px rgba(2, 6, 23, 0.22);
    transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(56, 189, 248, 0.5);
    background: rgba(30, 41, 59, 0.88);
}

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

.movie-poster-wrap {
    position: relative;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: #020617;
}

.movie-card-wide .movie-poster-wrap {
    aspect-ratio: 16 / 9;
}

.movie-card-compact .movie-poster-wrap {
    aspect-ratio: 2 / 2.75;
}

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

.movie-card:hover .movie-poster {
    transform: scale(1.06);
}

.movie-poster-wrap::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 48%;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.85), transparent);
}

.movie-play-badge {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 2;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #0f172a;
    background: rgba(255, 255, 255, 0.9);
    opacity: 0;
    transform: scale(0.82);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.movie-card:hover .movie-play-badge {
    opacity: 1;
    transform: scale(1);
}

.card-rank {
    position: absolute;
    left: 12px;
    top: 12px;
    z-index: 2;
    min-width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: white;
    font-weight: 900;
    background: linear-gradient(135deg, var(--red), var(--orange));
}

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

.movie-card h3 {
    margin: 0 0 8px;
    color: white;
    font-size: 17px;
    font-weight: 850;
    line-height: 1.35;
}

.movie-meta,
.movie-desc {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.65;
}

.movie-desc {
    margin-top: 8px;
    color: #cbd5e1;
}

.tag-row {
    margin-top: 12px;
    gap: 6px;
}

.tag-row span {
    padding: 5px 8px;
    font-size: 12px;
}

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

.line-clamp-2 {
    -webkit-line-clamp: 2;
}

.line-clamp-3 {
    -webkit-line-clamp: 3;
}

.ranking-section,
.soft-section {
    background: rgba(30, 41, 59, 0.34);
    border-block: 1px solid var(--line);
}

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

.ranking-list {
    display: grid;
    gap: 16px;
}

.rank-item {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: stretch;
    gap: 14px;
}

.rank-number {
    width: 54px;
    min-height: 74px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: white;
    font-size: 22px;
    font-weight: 950;
    background: linear-gradient(135deg, var(--red), var(--orange));
    box-shadow: 0 16px 34px rgba(239, 68, 68, 0.16);
}

.rank-link {
    display: grid;
    grid-template-columns: 132px 1fr;
    gap: 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.45);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.rank-link:hover {
    background: rgba(30, 41, 59, 0.84);
    border-color: rgba(56, 189, 248, 0.5);
}

.rank-link img {
    width: 132px;
    height: 82px;
    object-fit: cover;
    border-radius: 12px;
    background: #020617;
}

.rank-link h3 {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 850;
}

.rank-link p,
.rank-link span {
    display: block;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.rank-link span {
    color: #cbd5e1;
    margin-top: 4px;
}

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

.category-tile,
.category-overview-card a {
    display: block;
    height: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(30, 41, 59, 0.55);
    overflow: hidden;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.category-tile:hover,
.category-overview-card a:hover {
    transform: translateY(-4px);
    border-color: rgba(56, 189, 248, 0.55);
}

.category-thumbs,
.overview-posters {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 8px;
    background: rgba(2, 6, 23, 0.34);
}

.overview-posters {
    grid-template-columns: repeat(3, 1fr);
}

.category-thumbs img,
.overview-posters img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 10px;
    background: #020617;
}

.category-tile h3,
.category-overview-card h2 {
    margin: 16px 16px 8px;
    font-size: 20px;
    font-weight: 900;
}

.category-tile p,
.category-overview-card span {
    display: block;
    margin: 0 16px 18px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

.overview-body p {
    margin: 16px 16px 0;
    color: var(--sky);
    font-size: 13px;
    font-weight: 850;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.page-main {
    min-height: 70vh;
}

.page-hero {
    padding: 76px 0 34px;
}

.slim-hero,
.category-hero {
    max-width: 960px;
}

.page-hero h1 {
    margin: 0;
    font-size: clamp(36px, 6vw, 64px);
    line-height: 1.05;
    font-weight: 950;
    letter-spacing: -0.05em;
}

.page-hero > p:not(.eyebrow) {
    margin: 18px 0 0;
    color: #cbd5e1;
    font-size: 18px;
    line-height: 1.85;
}

.inline-filter,
.search-panel {
    margin-top: 28px;
    display: grid;
    gap: 12px;
}

.inline-filter {
    grid-template-columns: 1fr 180px;
    max-width: 760px;
}

.search-panel {
    grid-template-columns: 1fr 120px;
    max-width: 760px;
}

.search-results:not(:empty) {
    margin-bottom: 44px;
}

.search-result-title {
    margin: 0 0 22px;
    font-size: 28px;
    font-weight: 900;
}

.breadcrumb-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    padding-top: 30px;
    font-size: 14px;
}

.breadcrumb-line a:hover {
    color: white;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) 360px;
    gap: 34px;
    padding: 28px 0 0;
}

.detail-main,
.detail-side {
    min-width: 0;
}

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

.movie-video {
    width: 100%;
    height: 100%;
    background: #000;
}

.player-overlay {
    position: absolute;
    inset: 0;
    border: 0;
    display: grid;
    place-items: center;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.58), rgba(2, 6, 23, 0.18));
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.big-play {
    width: 88px;
    height: 88px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    padding-left: 6px;
    color: #0f172a;
    background: rgba(255, 255, 255, 0.92);
    font-size: 38px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
}

.player-message {
    position: absolute;
    left: 18px;
    bottom: 18px;
    color: white;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.74);
    opacity: 0;
    pointer-events: none;
}

.player-message.is-visible {
    opacity: 1;
}

.detail-copy {
    margin-top: 28px;
}

.detail-copy h1 {
    margin: 0 0 16px;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.1;
    font-weight: 950;
    letter-spacing: -0.04em;
}

.detail-meta,
.detail-tags {
    margin-bottom: 18px;
}

.content-panel {
    margin-top: 18px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(30, 41, 59, 0.58);
}

.content-panel h2,
.detail-side h2 {
    margin: 0 0 12px;
    font-size: 22px;
    font-weight: 900;
}

.content-panel p {
    margin: 0;
    color: #cbd5e1;
    line-height: 1.9;
    font-size: 16px;
}

.detail-side {
    position: sticky;
    top: 96px;
    align-self: start;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(30, 41, 59, 0.5);
}

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

.related-card {
    display: grid;
    grid-template-columns: 104px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.48);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.related-card:hover {
    border-color: rgba(56, 189, 248, 0.45);
}

.related-card img {
    width: 104px;
    height: 66px;
    object-fit: cover;
    border-radius: 12px;
}

.related-card span {
    display: block;
    font-weight: 800;
    line-height: 1.4;
}

.related-card small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
}

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

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 36px;
    padding: 48px 0;
}

.site-footer p {
    max-width: 520px;
    color: var(--muted);
    line-height: 1.8;
}

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

.footer-links {
    display: grid;
    gap: 10px;
}

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

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid var(--line);
    color: var(--muted-2);
    text-align: center;
    padding: 18px;
    font-size: 14px;
}

[hidden] {
    display: none !important;
}

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

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

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

    .detail-side {
        position: static;
    }
}

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

    .menu-button {
        display: grid;
        place-items: center;
    }

    .header-inner {
        height: 66px;
    }

    .hero-carousel {
        min-height: 88vh;
    }

    .hero-content {
        padding: 80px 0 150px;
        align-items: end;
    }

    .hero-arrow {
        display: none;
    }

    .hero-search {
        bottom: 58px;
        grid-template-columns: 1fr;
        border-radius: 22px;
    }

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

    .featured-grid,
    .two-grid,
    .compact-grid,
    .category-grid,
    .category-overview-grid,
    .category-movie-grid,
    .ranking-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rank-item {
        grid-template-columns: 1fr;
    }

    .rank-number {
        min-height: 44px;
        width: 100%;
    }

    .rank-link {
        grid-template-columns: 104px 1fr;
    }

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

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

@media (max-width: 560px) {
    .container {
        width: min(100% - 24px, 1180px);
    }

    .logo-copy small {
        display: none;
    }

    .hero-text h1,
    .hero-text h2 {
        font-size: 40px;
    }

    .featured-grid,
    .compact-grid,
    .category-grid,
    .category-overview-grid,
    .category-movie-grid {
        grid-template-columns: 1fr;
    }

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

    .rank-link,
    .related-card {
        grid-template-columns: 92px 1fr;
    }

    .rank-link img,
    .related-card img {
        width: 92px;
        height: 60px;
    }

    .category-thumbs {
        grid-template-columns: repeat(4, 1fr);
    }
}
