:root {
    color-scheme: light;
    --slate-950: #020617;
    --slate-900: #0f172a;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748b;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --slate-50: #f8fafc;
    --emerald-700: #047857;
    --emerald-600: #059669;
    --emerald-500: #10b981;
    --emerald-400: #34d399;
    --cyan-500: #06b6d4;
    --white: #ffffff;
    --shadow-soft: 0 18px 46px rgba(15, 23, 42, 0.14);
    --shadow-card: 0 12px 28px rgba(15, 23, 42, 0.12);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 12px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--slate-50);
    color: var(--slate-800);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

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

button,
input {
    font: inherit;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    color: var(--white);
    background: linear-gradient(90deg, var(--slate-800), var(--slate-900));
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.22);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 14px;
    color: var(--slate-900);
    background: var(--emerald-400);
    box-shadow: 0 8px 22px rgba(52, 211, 153, 0.3);
}

.logo-text strong,
.logo-text em {
    display: block;
}

.logo-text strong {
    font-size: 22px;
    line-height: 1.05;
}

.logo-text em {
    margin-top: 3px;
    color: #cbd5e1;
    font-size: 12px;
    font-style: normal;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-link {
    color: #e2e8f0;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--emerald-400);
}

.menu-toggle {
    display: none;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    color: var(--white);
    background: rgba(255, 255, 255, 0.08);
    padding: 8px 12px;
}

.mobile-panel {
    display: none;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: var(--slate-900);
}

.mobile-panel.open {
    display: block;
}

.mobile-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding-top: 14px;
    padding-bottom: 18px;
}

.mobile-links a {
    color: #e2e8f0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    padding: 10px 12px;
}

.hero-carousel {
    position: relative;
    min-height: 620px;
    overflow: hidden;
    color: var(--white);
    background: linear-gradient(135deg, var(--slate-800), var(--slate-700) 48%, var(--emerald-700));
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(1.02);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.hero-slide.active {
    opacity: 1;
    transform: scale(1);
    z-index: 1;
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.42;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 72% 18%, rgba(52, 211, 153, 0.28), transparent 34%),
        linear-gradient(90deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.68), rgba(15, 23, 42, 0.38));
}

.hero-content {
    position: absolute;
    left: max(32px, calc((100vw - 1180px) / 2));
    bottom: 108px;
    width: min(720px, calc(100% - 64px));
    z-index: 3;
}

.hero-kicker,
.page-hero span,
.rank-entry span {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    color: var(--emerald-100, #d1fae5);
    background: rgba(16, 185, 129, 0.18);
    padding: 6px 12px;
    font-size: 14px;
    letter-spacing: 0.02em;
}

.hero-content h1 {
    margin: 18px 0 18px;
    font-size: clamp(38px, 6vw, 68px);
    line-height: 1.05;
}

.hero-content p {
    max-width: 680px;
    color: #e2e8f0;
    font-size: clamp(16px, 2vw, 21px);
}

.hero-actions,
.detail-intro .btn {
    margin-top: 28px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border-radius: 999px;
    padding: 0 22px;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn.primary {
    color: var(--white);
    background: var(--emerald-600);
    box-shadow: 0 12px 28px rgba(5, 150, 105, 0.28);
}

.btn.ghost {
    margin-left: 12px;
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
}

.hero-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 36px;
    z-index: 4;
}

.hero-dots {
    display: flex;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    gap: 10px;
}

.hero-dot {
    width: 46px;
    height: 4px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.38);
    cursor: pointer;
}

.hero-dot.active {
    background: var(--emerald-400);
}

.search-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
    gap: 28px;
    align-items: center;
    margin-top: -54px;
    position: relative;
    z-index: 8;
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-soft);
    padding: 28px;
    backdrop-filter: blur(18px);
}

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

.search-hero p {
    margin: 0;
    color: var(--slate-600);
}

.search-box,
.inline-search {
    display: flex;
    gap: 10px;
}

.search-box input,
.inline-search input {
    width: 100%;
    border: 1px solid var(--slate-200);
    border-radius: 999px;
    background: var(--white);
    padding: 13px 18px;
    outline: none;
}

.search-box input:focus,
.inline-search input:focus {
    border-color: var(--emerald-500);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.14);
}

.search-box button {
    border: 0;
    border-radius: 999px;
    color: var(--white);
    background: var(--slate-900);
    padding: 0 22px;
    cursor: pointer;
}

.section {
    margin-top: 74px;
}

.section-head,
.list-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.section-head h2,
.list-toolbar h2,
.detail-main h2,
.detail-side h2 {
    margin: 0 0 8px;
    color: var(--slate-800);
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.2;
}

.section-head p,
.list-toolbar p {
    margin: 0;
    color: var(--slate-600);
}

.text-link {
    flex: 0 0 auto;
    color: var(--emerald-600);
    font-weight: 700;
}

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

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

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

.movie-card {
    overflow: hidden;
    border-radius: 18px;
    background: var(--white);
    box-shadow: var(--shadow-card);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.movie-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
}

.movie-card.large {
    grid-column: span 2;
}

.poster-wrap {
    position: relative;
    display: block;
    height: 280px;
    overflow: hidden;
    background: var(--slate-200);
}

.movie-card.small .poster-wrap {
    height: 190px;
}

.movie-card.large .poster-wrap {
    height: 380px;
}

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

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

.poster-shade {
    position: absolute;
    inset: 0;
    opacity: 0;
    background: linear-gradient(180deg, transparent, rgba(2, 6, 23, 0.72));
    transition: opacity 0.25s ease;
}

.movie-card:hover .poster-shade {
    opacity: 1;
}

.play-badge {
    position: absolute;
    left: 50%;
    top: 50%;
    display: grid;
    width: 56px;
    height: 56px;
    place-items: center;
    border-radius: 999px;
    color: var(--white);
    background: var(--emerald-500);
    transform: translate(-50%, -50%) scale(0.82);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

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

.type-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    border-radius: 999px;
    color: var(--white);
    background: rgba(2, 6, 23, 0.68);
    padding: 5px 10px;
    font-size: 12px;
    backdrop-filter: blur(10px);
}

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

.movie-card-body h3 {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 1.3;
}

.movie-card-body h3 a:hover {
    color: var(--emerald-600);
}

.movie-card-body p {
    display: -webkit-box;
    min-height: 48px;
    margin: 0 0 12px;
    overflow: hidden;
    color: var(--slate-600);
    font-size: 14px;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

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

.movie-meta span {
    color: var(--slate-500);
    font-size: 13px;
}

.tag-row {
    margin-top: 10px;
}

.tag-row span {
    border-radius: 999px;
    color: var(--slate-600);
    background: var(--slate-100);
    padding: 4px 9px;
    font-size: 12px;
}

.panel-section {
    width: min(1180px, calc(100% - 32px));
    margin-left: auto;
    margin-right: auto;
    border-radius: var(--radius-xl);
    background: linear-gradient(90deg, #ecfdf5, #f0fdfa);
    padding: 32px;
}

.rank-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 74px;
    border-radius: var(--radius-xl);
    color: var(--white);
    background: linear-gradient(90deg, var(--slate-900), var(--slate-800), var(--emerald-700));
    padding: 34px;
    box-shadow: var(--shadow-soft);
}

.rank-entry h2 {
    margin: 12px 0 6px;
    font-size: clamp(24px, 3vw, 38px);
}

.rank-entry p {
    margin: 0;
    color: #dbeafe;
}

.page-hero {
    color: var(--white);
    background: linear-gradient(135deg, var(--slate-800), var(--slate-700), var(--emerald-700));
    padding: 80px 0 72px;
}

.page-hero h1 {
    margin: 16px 0 12px;
    font-size: clamp(36px, 5vw, 56px);
    line-height: 1.1;
}

.page-hero p {
    max-width: 760px;
    margin: 0;
    color: #e2e8f0;
    font-size: 18px;
}

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

.category-tile a {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 20px;
    height: 100%;
    border-radius: var(--radius-lg);
    background: var(--white);
    padding: 18px;
    box-shadow: var(--shadow-card);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.category-tile a:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 42px rgba(15, 23, 42, 0.16);
}

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

.category-covers img {
    width: 100%;
    aspect-ratio: 1 / 1.24;
    border-radius: 12px;
    object-fit: cover;
}

.category-info h2 {
    margin: 4px 0 10px;
    font-size: 24px;
}

.category-info p {
    margin: 0 0 14px;
    color: var(--slate-600);
}

.category-info span {
    color: var(--emerald-600);
    font-weight: 800;
}

.rank-list {
    display: grid;
    gap: 14px;
    margin-bottom: 64px;
}

.rank-row a {
    display: grid;
    grid-template-columns: 64px 86px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    border-radius: 18px;
    background: var(--white);
    padding: 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.rank-row strong {
    color: var(--emerald-600);
    font-size: 22px;
}

.rank-row img {
    width: 86px;
    height: 112px;
    border-radius: 12px;
    object-fit: cover;
    transition: transform 0.28s ease;
}

.rank-row b,
.rank-row em,
.rank-row small {
    display: block;
}

.rank-row b {
    margin-bottom: 4px;
    font-size: 19px;
}

.rank-row em {
    color: var(--slate-500);
    font-style: normal;
}

.rank-row small {
    margin-top: 8px;
    color: var(--slate-600);
    font-size: 14px;
}

.detail-hero {
    position: relative;
    overflow: hidden;
    color: var(--white);
    background: var(--slate-900);
}

.detail-backdrop {
    position: absolute;
    inset: 0;
}

.detail-backdrop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.18;
    filter: blur(12px) saturate(1.15);
    transform: scale(1.08);
}

.detail-hero::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.94), rgba(15, 23, 42, 0.72), rgba(15, 23, 42, 0.78));
}

.detail-hero-inner {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 36px;
    align-items: center;
    padding: 74px 0;
}

.detail-poster img {
    width: 280px;
    aspect-ratio: 2 / 3;
    border-radius: var(--radius-xl);
    object-fit: cover;
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.35);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: #cbd5e1;
    margin-bottom: 16px;
}

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

.detail-intro h1 {
    margin: 0 0 16px;
    font-size: clamp(34px, 5vw, 62px);
    line-height: 1.1;
}

.detail-intro p {
    max-width: 760px;
    margin: 0;
    color: #e2e8f0;
    font-size: 18px;
}

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

.detail-meta span {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    color: #e2e8f0;
}

.detail-tags span {
    color: #dcfce7;
    background: rgba(16, 185, 129, 0.18);
}

.player-section {
    margin-top: 48px;
}

.video-frame {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    background: #000000;
    box-shadow: var(--shadow-soft);
    aspect-ratio: 16 / 9;
}

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

.video-cover {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    color: var(--white);
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.26), rgba(2, 6, 23, 0.78));
    cursor: pointer;
}

.video-cover.hidden {
    display: none;
}

.video-cover span {
    display: grid;
    width: 78px;
    height: 78px;
    place-items: center;
    border-radius: 50%;
    background: var(--emerald-500);
    box-shadow: 0 16px 34px rgba(16, 185, 129, 0.35);
    font-size: 30px;
}

.video-cover strong {
    font-size: clamp(22px, 3vw, 34px);
}

.video-cover em {
    color: #dbeafe;
    font-style: normal;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 32px;
    margin-top: 54px;
    margin-bottom: 72px;
}

.detail-main,
.detail-side {
    border-radius: var(--radius-xl);
    background: var(--white);
    box-shadow: var(--shadow-card);
    padding: 28px;
}

.detail-main p {
    margin: 0 0 28px;
    color: var(--slate-700);
    font-size: 17px;
    white-space: pre-line;
}

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

.prev-next a {
    border-radius: 14px;
    color: var(--slate-700);
    background: var(--slate-100);
    padding: 14px;
}

.prev-next a:last-child {
    text-align: right;
}

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

.compact-card {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.compact-card img {
    width: 72px;
    height: 94px;
    border-radius: 12px;
    object-fit: cover;
    transition: transform 0.28s ease;
}

.compact-card strong,
.compact-card em {
    display: block;
}

.compact-card strong {
    margin-bottom: 4px;
    line-height: 1.35;
}

.compact-card em {
    color: var(--slate-500);
    font-size: 13px;
    font-style: normal;
}

.site-footer {
    margin-top: 90px;
    color: #cbd5e1;
    background: var(--slate-900);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 32px;
    padding: 54px 0;
}

.site-footer h2,
.site-footer h3 {
    margin: 0 0 14px;
    color: var(--white);
}

.site-footer p {
    margin: 0;
    color: #94a3b8;
}

.site-footer ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-footer li + li {
    margin-top: 8px;
}

.site-footer a:hover {
    color: var(--emerald-400);
}

[data-movie-card].filtered-out {
    display: none;
}

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

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

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

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

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

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

    .hero-carousel {
        min-height: 560px;
    }

    .search-hero,
    .section-head,
    .list-toolbar,
    .rank-entry {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .search-hero {
        display: grid;
    }

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

    .movie-card.large {
        grid-column: span 2;
    }

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

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

    .detail-poster img {
        width: 220px;
    }
}

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

    .logo-text em {
        display: none;
    }

    .hero-content {
        left: 20px;
        bottom: 92px;
        width: calc(100% - 40px);
    }

    .btn.ghost {
        margin-left: 0;
        margin-top: 10px;
    }

    .hero-actions {
        display: grid;
        gap: 10px;
        width: min(260px, 100%);
    }

    .movie-grid,
    .feature-grid,
    .small-grid {
        grid-template-columns: 1fr;
    }

    .movie-card.large {
        grid-column: span 1;
    }

    .poster-wrap,
    .movie-card.small .poster-wrap,
    .movie-card.large .poster-wrap {
        height: 320px;
    }

    .rank-row a {
        grid-template-columns: 44px 74px minmax(0, 1fr);
        gap: 10px;
    }

    .rank-row img {
        width: 74px;
        height: 98px;
    }

    .rank-row small {
        display: none;
    }

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

    .prev-next {
        grid-template-columns: 1fr;
    }
}
