:root {
    color-scheme: dark;
    --bg: #020617;
    --bg-soft: #0f172a;
    --bg-card: rgba(15, 23, 42, 0.78);
    --line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --brand: #818cf8;
    --brand-strong: #4f46e5;
    --brand-light: #a5b4fc;
    --shadow: 0 22px 80px rgba(2, 6, 23, 0.45);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top left, rgba(79, 70, 229, 0.18), transparent 32rem), var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

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

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

.brand-mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand-strong), #ec4899);
    box-shadow: 0 12px 32px rgba(79, 70, 229, 0.45);
}

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

.brand-text strong {
    font-size: 18px;
    letter-spacing: 0.02em;
}

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

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link,
.mobile-link {
    color: var(--soft);
    transition: 0.2s ease;
}

.nav-link {
    padding: 10px 14px;
    border-radius: 999px;
}

.nav-link:hover,
.nav-link.active,
.mobile-link:hover,
.mobile-link.active {
    color: #ffffff;
    background: rgba(129, 140, 248, 0.14);
}

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

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

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

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

.mobile-link {
    padding: 12px 14px;
    border-radius: 14px;
}

.hero {
    position: relative;
    min-height: 610px;
    overflow: hidden;
    background: #0f172a;
}

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

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

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

.hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(2, 6, 23, 0.92) 0%, rgba(2, 6, 23, 0.66) 45%, rgba(2, 6, 23, 0.28) 100%), linear-gradient(0deg, var(--bg) 0%, rgba(2, 6, 23, 0) 55%);
}

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

.hero-tag,
.eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(79, 70, 229, 0.76);
    border: 1px solid rgba(199, 210, 254, 0.18);
    backdrop-filter: blur(8px);
    font-size: 13px;
    letter-spacing: 0.03em;
}

.hero h1 {
    max-width: 820px;
    margin: 20px 0 16px;
    font-size: clamp(38px, 6vw, 72px);
    line-height: 1.04;
    letter-spacing: -0.04em;
}

.hero p {
    max-width: 680px;
    margin: 0 0 24px;
    color: var(--soft);
    font-size: 18px;
    line-height: 1.8;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 30px;
    color: var(--muted);
}

.hero-meta span {
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid var(--line);
}

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

.primary-btn,
.ghost-btn,
.section-more,
.inline-link,
.search-form button,
.search-box button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    font-weight: 700;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.primary-btn,
.search-form button,
.search-box button {
    color: #fff;
    border: 0;
    background: linear-gradient(135deg, var(--brand-strong), #7c3aed);
    box-shadow: 0 16px 32px rgba(79, 70, 229, 0.32);
    cursor: pointer;
}

.ghost-btn,
.section-more,
.inline-link {
    color: #dbeafe;
    background: rgba(15, 23, 42, 0.68);
    border: 1px solid var(--line);
}

.primary-btn:hover,
.ghost-btn:hover,
.section-more:hover,
.inline-link:hover,
.search-form button:hover,
.search-box button:hover {
    transform: translateY(-2px);
}

.hero-arrow {
    position: absolute;
    z-index: 5;
    top: 50%;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.55);
    color: #ffffff;
    font-size: 32px;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.hero-prev {
    left: 22px;
}

.hero-next {
    right: 22px;
}

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

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

.hero-dot.is-active {
    width: 34px;
    background: #ffffff;
}

.hero-strip {
    position: absolute;
    z-index: 6;
    left: 50%;
    bottom: 22px;
    width: min(820px, calc(100% - 32px));
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    transform: translateX(-50%);
}

.hero-thumb {
    display: grid;
    grid-template-columns: 54px 1fr;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(12px);
}

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

.hero-thumb span {
    overflow: hidden;
    color: var(--soft);
    font-size: 12px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.home-search {
    margin-top: -1px;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.95), rgba(15, 23, 42, 0.64));
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.home-search-inner,
.page-container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.home-search-inner {
    display: grid;
    grid-template-columns: 1fr minmax(300px, 520px);
    gap: 24px;
    align-items: center;
    padding: 32px 0;
}

.home-search h2 {
    margin: 0;
    font-size: clamp(24px, 4vw, 36px);
}

.search-form,
.search-box {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.search-form input,
.search-box input,
.filter-selects select {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 999px;
    outline: none;
    color: var(--text);
    background: rgba(15, 23, 42, 0.76);
    padding: 0 16px;
}

.filter-selects select {
    cursor: pointer;
}

.content-section {
    padding: 56px 0 0;
}

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

.section-heading h2,
.page-title-block h1,
.detail-copy h2,
.player-section h2 {
    margin: 0;
    color: #ffffff;
}

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

.section-heading p,
.page-title-block p,
.category-overview-body p,
.detail-copy p {
    color: var(--muted);
    line-height: 1.8;
}

.feature-grid,
.poster-grid,
.wide-grid,
.category-grid,
.category-overview-grid {
    display: grid;
    gap: 18px;
}

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

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

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

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

.movie-card,
.category-card,
.category-overview-card,
.detail-hero,
.player-section,
.detail-copy,
.filter-panel,
.detail-neighbor {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.movie-card {
    transition: transform 0.24s ease, border-color 0.24s ease, background 0.24s ease;
}

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

.movie-poster {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #111827;
}

.feature-grid .movie-poster,
.movie-card-wide .movie-poster {
    aspect-ratio: 16 / 9;
}

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

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

.poster-play,
.rank-badge {
    position: absolute;
    z-index: 2;
    display: inline-grid;
    place-items: center;
    color: #ffffff;
    background: rgba(79, 70, 229, 0.84);
    backdrop-filter: blur(8px);
}

.poster-play {
    right: 12px;
    bottom: 12px;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    opacity: 0;
    transform: scale(0.86);
    transition: 0.2s ease;
}

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

.rank-badge {
    left: 10px;
    top: 10px;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: 999px;
    font-weight: 800;
}

.movie-info {
    padding: 16px;
}

.movie-meta {
    margin-bottom: 8px;
    color: var(--brand-light);
    font-size: 13px;
}

.movie-info h3 {
    margin: 0 0 8px;
    font-size: 17px;
    line-height: 1.35;
}

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

.movie-info p {
    display: -webkit-box;
    min-height: 44px;
    margin: 0 0 14px;
    overflow: hidden;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

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

.tag-row span {
    padding: 4px 9px;
    border: 1px solid rgba(129, 140, 248, 0.26);
    border-radius: 999px;
    color: #c7d2fe;
    background: rgba(79, 70, 229, 0.12);
    font-size: 12px;
}

.movie-card-wide {
    display: grid;
    grid-template-columns: 230px 1fr;
}

.movie-card-wide .movie-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.category-card {
    display: flex;
    min-height: 144px;
    flex-direction: column;
    justify-content: space-between;
    padding: 22px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.28), rgba(15, 23, 42, 0.88));
    transition: transform 0.2s ease;
}

.category-card:hover {
    transform: translateY(-4px);
}

.category-card strong {
    font-size: 22px;
}

.category-card span {
    color: var(--soft);
    line-height: 1.7;
}

.top-space {
    padding-top: 46px;
}

.page-title-block {
    margin-bottom: 28px;
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.22), rgba(15, 23, 42, 0.78));
}

.page-title-block h1 {
    margin-top: 16px;
    font-size: clamp(32px, 5vw, 54px);
    line-height: 1.12;
}

.page-title-block p {
    max-width: 820px;
    margin-bottom: 0;
}

.category-overview-grid {
    grid-template-columns: repeat(2, 1fr);
    padding-bottom: 40px;
}

.category-cover-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 8px;
    background: rgba(2, 6, 23, 0.55);
}

.category-cover-row img {
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 14px;
    object-fit: cover;
}

.category-overview-body {
    padding: 20px;
}

.category-overview-body h2 {
    margin: 0 0 10px;
}

.filter-panel {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px;
}

.filter-selects {
    display: flex;
    gap: 10px;
}

.searchable-grid {
    padding-bottom: 36px;
}

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

.empty-state {
    display: none;
    margin: 30px 0 60px;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 20px;
    color: var(--muted);
    background: rgba(15, 23, 42, 0.72);
    text-align: center;
}

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

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

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

.detail-hero {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 30px;
    padding: 24px;
}

.detail-poster img {
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 18px;
    object-fit: cover;
}

.detail-info h1 {
    margin: 18px 0 14px;
    font-size: clamp(34px, 5vw, 56px);
    line-height: 1.12;
}

.detail-one-line {
    color: var(--soft);
    font-size: 18px;
    line-height: 1.8;
}

.detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 24px 0;
}

.detail-meta-grid span {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    color: var(--soft);
    background: rgba(2, 6, 23, 0.38);
}

.detail-meta-grid b {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
}

.large-tags span {
    padding: 7px 12px;
    font-size: 13px;
}

.player-section,
.detail-copy,
.detail-neighbor {
    margin-top: 24px;
    padding: 24px;
}

.player-section h2,
.detail-copy h2 {
    margin-bottom: 16px;
    font-size: 26px;
}

.player {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    background: #000000;
    aspect-ratio: 16 / 9;
}

.movie-video,
.player-cover,
.player-cover img {
    width: 100%;
    height: 100%;
}

.movie-video {
    display: block;
    background: #000000;
}

.player-cover {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 0;
    padding: 0;
    cursor: pointer;
    background: #000000;
}

.player-cover img {
    position: absolute;
    inset: 0;
    object-fit: cover;
    opacity: 0.58;
}

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

.big-play {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 86px;
    height: 86px;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(79, 70, 229, 0.88);
    box-shadow: 0 18px 60px rgba(79, 70, 229, 0.45);
    font-size: 34px;
}

.detail-copy p {
    margin: 0 0 24px;
    color: var(--soft);
    font-size: 16px;
}

.detail-neighbor {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.detail-neighbor a {
    flex: 1;
    padding: 14px 16px;
    border-radius: 16px;
    color: var(--soft);
    background: rgba(2, 6, 23, 0.35);
}

.detail-neighbor a:hover {
    color: #ffffff;
    background: rgba(79, 70, 229, 0.26);
}

.related-section {
    padding-bottom: 44px;
}

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

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

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

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

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

.footer-links a:hover {
    color: #ffffff;
}

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

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

    .menu-toggle {
        display: inline-block;
    }

    .hero {
        min-height: 680px;
    }

    .hero-content {
        min-height: 680px;
        padding-bottom: 190px;
    }

    .hero-strip {
        grid-template-columns: repeat(2, 1fr);
        bottom: 20px;
    }

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

    .home-search-inner,
    .filter-panel,
    .footer-wrap,
    .detail-hero {
        grid-template-columns: 1fr;
    }

    .feature-grid,
    .poster-grid,
    .wide-grid,
    .category-grid,
    .category-overview-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (max-width: 640px) {
    .nav-wrap,
    .home-search-inner,
    .page-container,
    .footer-wrap,
    .mobile-nav {
        width: min(100% - 24px, 1180px);
    }

    .brand-text small {
        display: none;
    }

    .hero h1 {
        font-size: 34px;
    }

    .hero-content {
        padding-top: 88px;
    }

    .hero-arrow {
        display: none;
    }

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

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

    .search-form,
    .search-box,
    .filter-selects,
    .detail-neighbor {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .feature-grid,
    .poster-grid,
    .wide-grid,
    .category-grid,
    .category-overview-grid {
        grid-template-columns: 1fr;
    }

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

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

    .page-title-block,
    .detail-hero,
    .player-section,
    .detail-copy,
    .detail-neighbor {
        padding: 20px;
    }
}
