:root {
    --slate-950: #020617;
    --slate-900: #0f172a;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748b;
    --slate-300: #cbd5e1;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --slate-50: #f8fafc;
    --emerald-700: #047857;
    --emerald-600: #059669;
    --emerald-500: #10b981;
    --emerald-400: #34d399;
    --cyan-600: #0891b2;
    --white: #ffffff;
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.1), 0 2px 4px -2px rgba(15, 23, 42, 0.1);
    --shadow-xl: 0 20px 40px -18px rgba(15, 23, 42, 0.45);
    --shadow-2xl: 0 28px 60px -18px rgba(15, 23, 42, 0.55);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

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

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

button,
input {
    font: inherit;
}

.container {
    width: min(1200px, 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: var(--shadow-md);
}

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

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: opacity 0.2s ease;
}

.brand:hover {
    opacity: 0.85;
}

.brand-icon {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    color: var(--slate-900);
    background: var(--emerald-400);
    border-radius: 999px;
    font-size: 15px;
}

.brand-text strong,
.brand-text small {
    display: block;
}

.brand-text strong {
    font-size: 24px;
    line-height: 1.1;
}

.brand-text small {
    margin-top: 3px;
    color: var(--slate-300);
    font-size: 12px;
}

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

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

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

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
}

.mobile-nav {
    display: none;
    padding: 0 16px 16px;
}

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

.mobile-nav-link {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
}

.hero-section,
.page-hero,
.detail-hero {
    color: var(--white);
    background: radial-gradient(circle at 12% 16%, rgba(16, 185, 129, 0.34), transparent 28%), linear-gradient(135deg, var(--slate-800), var(--slate-700) 45%, #065f46);
}

.hero-shell {
    position: relative;
    padding: 72px 0 58px;
}

.hero-slider {
    position: relative;
    min-height: 460px;
    overflow: hidden;
    border-radius: 28px;
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
    gap: 34px;
    align-items: center;
    padding: 42px;
    opacity: 0;
    pointer-events: none;
    transform: translateX(24px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.4));
}

.hero-slide.is-active {
    position: relative;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    margin-bottom: 14px;
    color: var(--emerald-400);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.hero-copy h1,
.page-hero h1,
.detail-info-card h1 {
    margin: 0 0 18px;
    font-size: clamp(34px, 5vw, 56px);
    line-height: 1.08;
    font-weight: 800;
}

.hero-copy h2 {
    margin: 0 0 14px;
    color: var(--slate-100);
    font-size: clamp(24px, 3vw, 38px);
    line-height: 1.15;
}

.hero-copy p,
.page-hero p,
.detail-info-card p {
    max-width: 720px;
    margin: 0 0 24px;
    color: var(--slate-200);
    font-size: 18px;
}

.hero-tags,
.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-tags span,
.tag-row span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    color: var(--slate-600);
    background: var(--slate-100);
    border-radius: 999px;
    font-size: 12px;
}

.hero-tags span {
    color: var(--white);
    background: rgba(255, 255, 255, 0.14);
}

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

.primary-btn,
.ghost-btn,
.site-search button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border-radius: 12px;
    font-weight: 700;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.primary-btn,
.site-search button {
    color: var(--white);
    background: var(--emerald-600);
}

.primary-btn:hover,
.site-search button:hover {
    background: var(--emerald-700);
    transform: translateY(-1px);
}

.ghost-btn {
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
}

.ghost-btn:hover {
    background: rgba(255, 255, 255, 0.16);
}

.hero-cover {
    position: relative;
    min-height: 380px;
    overflow: hidden;
    border-radius: 24px;
    box-shadow: var(--shadow-2xl);
}

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

.hero-cover:hover img {
    transform: scale(1.06);
}

.hero-cover span {
    position: absolute;
    right: 18px;
    bottom: 18px;
    padding: 10px 16px;
    color: var(--white);
    background: rgba(5, 150, 105, 0.92);
    border-radius: 999px;
    font-weight: 700;
}

.hero-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.hero-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.38);
}

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

.hero-search {
    max-width: 920px;
    margin: 26px auto 0;
}

.site-search {
    position: relative;
    display: flex;
    gap: 10px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
}

.site-search-input {
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    color: var(--slate-800);
    border: 0;
    border-radius: 12px;
    outline: none;
    background: var(--white);
}

.search-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 8px;
    right: 8px;
    z-index: 30;
    display: none;
    max-height: 390px;
    overflow: auto;
    color: var(--slate-800);
    background: var(--white);
    border-radius: 18px;
    box-shadow: var(--shadow-2xl);
}

.search-results.is-open {
    display: block;
}

.search-result-item {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--slate-100);
}

.search-result-item img {
    width: 54px;
    height: 72px;
    object-fit: cover;
    border-radius: 10px;
    background: var(--slate-200);
}

.search-result-item strong,
.search-result-item small {
    display: block;
}

.search-result-item strong {
    margin-bottom: 4px;
    color: var(--slate-800);
}

.search-result-item small {
    color: var(--slate-500);
}

.hero-category-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 16px;
}

.hero-category-links a {
    padding: 8px 12px;
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    transition: background 0.2s ease;
}

.hero-category-links a:hover {
    background: rgba(255, 255, 255, 0.2);
}

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

.panel-section {
    width: min(1200px, calc(100% - 32px));
    margin: 64px auto 0;
    padding: 34px;
    background: linear-gradient(90deg, #ecfdf5, #f0fdfa);
    border-radius: 28px;
}

.panel-section:nth-of-type(even) {
    background: linear-gradient(90deg, #eff6ff, #ecfeff);
}

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

.section-head h2 {
    margin: 0 0 6px;
    color: var(--slate-800);
    font-size: clamp(26px, 3vw, 36px);
    line-height: 1.15;
}

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

.section-head a {
    flex: 0 0 auto;
    color: var(--emerald-600);
    font-weight: 700;
}

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

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

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

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

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

.movie-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-2xl);
}

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

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

.movie-poster {
    position: relative;
    height: 260px;
    overflow: hidden;
    background: var(--slate-200);
}

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

.featured-grid .movie-card-large:first-child .movie-poster {
    height: 360px;
}

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

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

.movie-poster::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.2), transparent);
    transition: opacity 0.25s ease;
}

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

.movie-type,
.movie-year {
    position: absolute;
    z-index: 2;
    padding: 5px 9px;
    color: var(--white);
    background: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    font-size: 12px;
    backdrop-filter: blur(4px);
}

.movie-type {
    top: 12px;
    right: 12px;
}

.movie-year {
    left: 12px;
    bottom: 12px;
}

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

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

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

.movie-card-body h3 {
    margin: 0 0 8px;
    color: var(--slate-800);
    font-size: 18px;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s ease;
}

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

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

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

.compact-hero .container {
    padding: 58px 0;
}

.compact-hero h1 {
    max-width: 820px;
    margin: 0 0 16px;
    font-size: clamp(34px, 4vw, 52px);
    line-height: 1.12;
}

.compact-hero .site-search {
    max-width: 760px;
    margin-top: 28px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
    color: var(--slate-200);
    font-size: 14px;
}

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

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

.category-card {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 24px;
    overflow: hidden;
    min-height: 230px;
    padding: 22px;
    background: var(--white);
    border-radius: 24px;
    box-shadow: var(--shadow-md);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.category-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

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

.category-covers img {
    width: 100%;
    height: 186px;
    object-fit: cover;
    border-radius: 14px;
    background: var(--slate-200);
}

.category-covers img:nth-child(2) {
    margin-top: 18px;
}

.category-covers img:nth-child(3) {
    margin-top: 36px;
}

.category-info h2 {
    margin: 0 0 12px;
    font-size: 26px;
}

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

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

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 26px;
}

.filter-btn {
    min-height: 38px;
    padding: 0 14px;
    color: var(--slate-700);
    border: 1px solid var(--slate-200);
    border-radius: 999px;
    background: var(--white);
}

.filter-btn.active,
.filter-btn:hover {
    color: var(--white);
    border-color: var(--emerald-600);
    background: var(--emerald-600);
}

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

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

.rank-item {
    display: grid;
    grid-template-columns: 42px 58px 1fr;
    gap: 12px;
    align-items: center;
    padding: 12px;
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rank-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.rank-num {
    color: var(--emerald-600);
    font-size: 20px;
    font-weight: 800;
}

.rank-item img {
    width: 58px;
    height: 76px;
    object-fit: cover;
    border-radius: 10px;
    background: var(--slate-200);
}

.rank-title strong,
.rank-title small {
    display: block;
}

.rank-title strong {
    margin-bottom: 4px;
    overflow: hidden;
    color: var(--slate-800);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-title small {
    color: var(--slate-500);
    font-size: 12px;
}

.detail-hero .container {
    padding: 34px 0 52px;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
    gap: 28px;
    align-items: stretch;
}

.player-card {
    overflow: hidden;
    background: #000000;
    border-radius: 22px;
    box-shadow: var(--shadow-2xl);
}

.video-wrap {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000000;
}

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

.player-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--white);
    border: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.56), rgba(0, 0, 0, 0.18));
}

.player-overlay.is-hidden {
    display: none;
}

.player-button {
    display: grid;
    place-items: center;
    width: 86px;
    height: 86px;
    padding-left: 5px;
    background: var(--emerald-500);
    border-radius: 999px;
    box-shadow: 0 18px 40px rgba(16, 185, 129, 0.3);
    font-size: 32px;
    transition: transform 0.2s ease, background 0.2s ease;
}

.player-overlay:hover .player-button {
    transform: scale(1.08);
    background: var(--emerald-600);
}

.detail-info-card {
    display: grid;
    gap: 18px;
    align-content: start;
    padding: 18px;
    background: rgba(15, 23, 42, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 22px;
    backdrop-filter: blur(8px);
}

.detail-info-card img {
    width: 100%;
    max-height: 340px;
    object-fit: cover;
    border-radius: 18px;
    box-shadow: var(--shadow-xl);
}

.detail-info-card h1 {
    font-size: clamp(28px, 4vw, 42px);
}

.detail-tags span {
    color: var(--white);
    background: rgba(255, 255, 255, 0.14);
}

.detail-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
    padding-top: 42px;
}

.detail-article,
.side-panel {
    background: var(--white);
    border-radius: 22px;
    box-shadow: var(--shadow-md);
}

.detail-article {
    padding: 30px;
}

.detail-article h2,
.side-panel h2 {
    margin: 0 0 16px;
    color: var(--slate-800);
    font-size: 24px;
}

.detail-article p {
    margin: 0 0 24px;
    color: var(--slate-700);
    font-size: 16px;
}

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

.meta-table div {
    padding: 14px;
    background: var(--slate-50);
    border-radius: 14px;
}

.meta-table strong,
.meta-table span {
    display: block;
}

.meta-table strong {
    margin-bottom: 4px;
    color: var(--slate-500);
    font-size: 13px;
}

.meta-table span {
    color: var(--slate-800);
    font-weight: 700;
}

.next-prev {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--slate-200);
}

.next-prev a {
    color: var(--emerald-600);
    font-weight: 700;
}

.side-panel {
    align-self: start;
    padding: 20px;
}

.side-list {
    display: grid;
    gap: 12px;
}

.site-footer {
    margin-top: 80px;
    color: var(--slate-300);
    background: var(--slate-900);
}

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

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

.site-footer p,
.site-footer ul {
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--slate-400);
    font-size: 14px;
}

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

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

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

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

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

    .category-grid,
    .detail-layout,
    .detail-content-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

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

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

    .nav-toggle {
        display: inline-grid;
        place-items: center;
    }

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

    .hero-shell {
        padding: 38px 0;
    }

    .hero-slider {
        min-height: 0;
        border-radius: 22px;
    }

    .hero-slide {
        grid-template-columns: 1fr;
        padding: 24px;
    }

    .hero-cover {
        min-height: 260px;
    }

    .site-search {
        display: grid;
    }

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

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

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

    .movie-poster,
    .movie-card-small .movie-poster {
        height: 210px;
    }

    .featured-grid .movie-card-large:first-child .movie-poster {
        height: 260px;
    }

    .panel-section {
        padding: 24px;
    }

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

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

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

    .next-prev {
        flex-direction: column;
    }
}

@media (max-width: 460px) {
    .movie-grid,
    .featured-grid,
    .latest-grid,
    .catalog-grid,
    .small-grid {
        grid-template-columns: 1fr;
    }

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

    .hero-copy h1,
    .page-hero h1 {
        font-size: 32px;
    }

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