:root {
    --slate-950: #020617;
    --slate-900: #0f172a;
    --slate-850: #142033;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748b;
    --slate-400: #94a3b8;
    --slate-300: #cbd5e1;
    --amber-600: #d97706;
    --amber-500: #f59e0b;
    --amber-400: #fbbf24;
    --white: #ffffff;
    --soft-shadow: 0 18px 50px rgba(2, 6, 23, 0.35);
    --card-shadow: 0 12px 28px rgba(2, 6, 23, 0.28);
    color-scheme: dark;
}

* {
    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", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--slate-300);
    background: linear-gradient(180deg, var(--slate-900) 0%, var(--slate-800) 52%, var(--slate-900) 100%);
}

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(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(51, 65, 85, 0.85);
    backdrop-filter: blur(16px);
}

.site-header-inner {
    width: min(1280px, calc(100% - 32px));
    height: 64px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: max-content;
}

.brand-icon {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    color: var(--white);
    background: linear-gradient(135deg, var(--amber-500), var(--amber-600));
    box-shadow: 0 0 24px rgba(245, 158, 11, 0.36);
}

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

.brand-text strong {
    color: var(--white);
    font-size: 20px;
    letter-spacing: 0.02em;
}

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

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

.nav-link {
    color: var(--slate-300);
    font-weight: 600;
    transition: color 0.2s ease;
}

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

.header-search {
    position: relative;
    width: 250px;
    display: flex;
    align-items: center;
}

.header-search input,
.mobile-search input,
.search-hero-form input,
.filter-bar input,
.filter-bar select {
    width: 100%;
    border: 1px solid rgba(71, 85, 105, 0.65);
    border-radius: 10px;
    outline: none;
    color: var(--white);
    background: rgba(30, 41, 59, 0.9);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search input {
    padding: 10px 42px 10px 14px;
}

.header-search input:focus,
.mobile-search input:focus,
.search-hero-form input:focus,
.filter-bar input:focus,
.filter-bar select:focus {
    border-color: var(--amber-500);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.header-search button {
    position: absolute;
    right: 8px;
    border: 0;
    color: var(--slate-400);
    background: transparent;
    cursor: pointer;
}

.menu-toggle {
    display: none;
    margin-left: auto;
    border: 0;
    border-radius: 10px;
    padding: 8px 10px;
    color: var(--white);
    background: rgba(51, 65, 85, 0.9);
    cursor: pointer;
}

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

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

.mobile-link {
    display: block;
    padding: 8px 0;
    color: var(--slate-300);
    font-weight: 600;
}

.mobile-search {
    display: flex;
    gap: 10px;
    padding-top: 8px;
}

.mobile-search input {
    padding: 10px 12px;
}

.mobile-search button,
.search-hero-form button,
.filter-bar button {
    border: 0;
    border-radius: 10px;
    padding: 10px 16px;
    color: var(--white);
    background: var(--amber-500);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.mobile-search button:hover,
.search-hero-form button:hover,
.filter-bar button:hover,
.btn.primary:hover {
    background: var(--amber-600);
}

.content-shell {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
}

.stacked {
    padding-top: 48px;
    display: grid;
    gap: 64px;
}

.hero-carousel {
    position: relative;
    height: 60vh;
    min-height: 520px;
    overflow: hidden;
    background: var(--slate-950);
}

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

.hero-slide.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(0deg, var(--slate-900) 0%, rgba(15, 23, 42, 0.62) 46%, rgba(15, 23, 42, 0.12) 100%);
}

.hero-content {
    position: absolute;
    left: max(24px, calc((100vw - 1280px) / 2));
    right: 24px;
    bottom: 72px;
    max-width: 680px;
}

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

.hero-tags span,
.tag-row span {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 10px;
    color: var(--white);
    background: var(--amber-500);
    font-size: 13px;
    font-weight: 700;
}

.hero-content h1 {
    margin: 14px 0;
    color: var(--white);
    font-size: clamp(34px, 6vw, 58px);
    line-height: 1.08;
}

.hero-content p {
    margin: 0 0 22px;
    color: var(--slate-300);
    font-size: clamp(16px, 2vw, 19px);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.hero-meta {
    margin-bottom: 24px;
    color: var(--slate-300);
}

.hero-meta strong {
    color: var(--amber-500);
    font-size: 18px;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: 10px;
    padding: 0 22px;
    font-weight: 800;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.btn:hover,
.movie-card:hover,
.category-card:hover,
.catalog-card:hover {
    transform: translateY(-2px);
}

.btn.primary {
    color: var(--white);
    background: var(--amber-500);
}

.btn.ghost {
    color: var(--white);
    background: rgba(2, 6, 23, 0.56);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
}

.btn.ghost:hover {
    color: var(--amber-400);
    background: rgba(15, 23, 42, 0.8);
}

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 999px;
    color: var(--white);
    background: rgba(0, 0, 0, 0.5);
    font-size: 36px;
    cursor: pointer;
    transform: translateY(-50%);
    transition: background 0.2s ease;
}

.hero-arrow:hover {
    background: rgba(0, 0, 0, 0.72);
}

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

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

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

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

.hero-dot.active {
    width: 32px;
    background: var(--amber-500);
}

.home-section {
    display: grid;
    gap: 24px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.section-heading h2 {
    margin: 0;
    color: var(--white);
    font-size: clamp(26px, 3vw, 34px);
}

.section-heading a {
    color: var(--amber-500);
    font-weight: 700;
}

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

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

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

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

.movie-card {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    transition: transform 0.22s ease, box-shadow 0.22s ease, outline-color 0.22s ease;
}

.poster-card {
    background: rgba(30, 41, 59, 0.94);
    box-shadow: var(--card-shadow);
}

.movie-card:hover {
    outline: 2px solid var(--amber-500);
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.45);
}

.poster-frame {
    position: relative;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: var(--slate-700);
}

.poster-frame img,
.large-card img,
.category-card img,
.catalog-card img,
.horizontal-cover img,
.cover-box img,
.related-panel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.year-badge,
.rank-badge {
    position: absolute;
    z-index: 2;
    top: 10px;
    right: 10px;
    border-radius: 8px;
    padding: 4px 8px;
    color: var(--white);
    background: var(--amber-500);
    font-size: 12px;
    font-weight: 800;
}

.rank-badge {
    left: 10px;
    right: auto;
    background: rgba(245, 158, 11, 0.94);
}

.poster-info {
    padding: 14px;
}

.poster-info h3,
.horizontal-info h3,
.large-content h3 {
    margin: 0;
    color: var(--white);
    font-size: 16px;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.movie-card:hover h3 {
    color: var(--amber-500);
}

.poster-info .tag-row {
    margin: 10px 0;
}

.poster-info .tag-row span {
    color: var(--slate-300);
    background: var(--slate-700);
    font-size: 12px;
    font-weight: 500;
}

.meta-row {
    color: var(--slate-400);
    font-size: 12px;
    justify-content: space-between;
}

.horizontal-list,
.ranking-list {
    display: grid;
    gap: 14px;
}

.horizontal {
    display: grid;
    grid-template-columns: 168px minmax(0, 1fr);
    min-height: 112px;
    background: rgba(30, 41, 59, 0.96);
}

.horizontal-cover {
    position: relative;
    min-height: 112px;
    overflow: hidden;
}

.horizontal-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px;
}

.horizontal-info p {
    margin: 8px 0 12px;
    color: var(--slate-400);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.category-card,
.catalog-card {
    position: relative;
    min-height: 210px;
    overflow: hidden;
    border-radius: 18px;
    box-shadow: var(--soft-shadow);
    background: var(--slate-800);
    transition: transform 0.22s ease, outline-color 0.22s ease;
}

.category-card img,
.catalog-card img {
    position: absolute;
    inset: 0;
}

.category-shade,
.catalog-card span {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.94) 0%, rgba(2, 6, 23, 0.52) 48%, rgba(2, 6, 23, 0.05) 100%);
}

.category-card div,
.catalog-card div {
    position: absolute;
    left: 22px;
    right: 22px;
    bottom: 22px;
}

.category-card h3,
.catalog-card h2 {
    margin: 0 0 8px;
    color: var(--white);
    font-size: 26px;
}

.category-card p,
.catalog-card p {
    margin: 0;
    color: var(--slate-300);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.large-card {
    min-height: 270px;
    background: var(--slate-800);
}

.large-card img,
.large-shade {
    position: absolute;
    inset: 0;
}

.large-shade {
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.95) 0%, rgba(2, 6, 23, 0.52) 55%, transparent 100%);
}

.large-content {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 24px;
}

.large-content h3 {
    margin: 12px 0 8px;
    font-size: 28px;
}

.large-content p {
    margin: 0 0 12px;
    color: var(--slate-300);
    line-height: 1.6;
}

.page-hero,
.detail-hero {
    position: relative;
    overflow: hidden;
    padding: 74px 0 54px;
    background: radial-gradient(circle at 20% 0%, rgba(245, 158, 11, 0.18), transparent 38%), linear-gradient(135deg, var(--slate-900), var(--slate-800));
}

.page-hero.slim {
    padding: 64px 0 42px;
}

.eyebrow,
.breadcrumb {
    margin-bottom: 12px;
    color: var(--amber-500);
    font-weight: 800;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.breadcrumb a {
    color: var(--slate-300);
}

.breadcrumb a:hover {
    color: var(--amber-500);
}

.page-hero h1,
.detail-hero h1 {
    margin: 0 0 14px;
    color: var(--white);
    font-size: clamp(34px, 5vw, 54px);
}

.page-hero p,
.detail-hero p {
    max-width: 760px;
    margin: 0;
    color: var(--slate-300);
    font-size: 18px;
    line-height: 1.8;
}

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

.catalog-card {
    min-height: 260px;
}

.filter-bar {
    position: sticky;
    top: 78px;
    z-index: 10;
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 180px 180px auto;
    gap: 14px;
    align-items: end;
    margin: 32px 0;
    padding: 16px;
    border: 1px solid rgba(71, 85, 105, 0.48);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(14px);
}

.filter-bar label {
    display: grid;
    gap: 8px;
    color: var(--slate-400);
    font-size: 13px;
    font-weight: 700;
}

.filter-bar input,
.filter-bar select {
    height: 42px;
    padding: 0 12px;
}

.empty-state {
    display: none;
    margin: 36px 0;
    padding: 36px;
    border-radius: 16px;
    color: var(--slate-400);
    text-align: center;
    background: rgba(30, 41, 59, 0.72);
}

.empty-state.show {
    display: block;
}

.ranking-page {
    padding: 48px 0;
}

.search-hero-form {
    display: flex;
    gap: 12px;
    max-width: 620px;
    margin-top: 24px;
}

.search-hero-form input {
    height: 48px;
    padding: 0 14px;
}

.search-page {
    padding: 48px 0;
}

.detail-hero {
    min-height: 440px;
    display: flex;
    align-items: end;
    padding: 120px 0 48px;
    background: var(--slate-950);
}

.detail-hero > img,
.detail-shade {
    position: absolute;
    inset: 0;
}

.detail-hero > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-shade {
    background: linear-gradient(0deg, var(--slate-900) 0%, rgba(15, 23, 42, 0.72) 42%, rgba(15, 23, 42, 0.28) 100%);
}

.detail-hero-content {
    position: relative;
    z-index: 2;
}

.detail-meta {
    margin-top: 22px;
}

.detail-meta span {
    border-radius: 999px;
    padding: 6px 12px;
    color: var(--slate-200);
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.detail-page {
    padding: 44px 0 0;
}

.player-card {
    overflow: hidden;
    border-radius: 18px;
    background: var(--slate-950);
    box-shadow: var(--soft-shadow);
}

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

.player-video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000000;
}

.player-overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 16px;
    border: 0;
    color: var(--white);
    background: radial-gradient(circle at center, rgba(245, 158, 11, 0.18), rgba(2, 6, 23, 0.7));
    cursor: pointer;
}

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

.play-circle {
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
    border-radius: 999px;
    color: var(--white);
    background: var(--amber-500);
    box-shadow: 0 0 36px rgba(245, 158, 11, 0.55);
    font-size: 34px;
}

.player-overlay strong {
    max-width: min(680px, 86vw);
    font-size: clamp(20px, 3vw, 32px);
}

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

.info-card,
.review-card,
.related-panel {
    border-radius: 16px;
    background: rgba(30, 41, 59, 0.92);
    box-shadow: var(--card-shadow);
}

.info-card {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 28px;
    padding: 24px;
}

.cover-box {
    overflow: hidden;
    border-radius: 12px;
    aspect-ratio: 2 / 3;
}

.info-content h2,
.review-card h2,
.related-panel h2 {
    margin: 0 0 18px;
    color: var(--white);
}

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

.lead-text {
    color: var(--amber-400);
    font-weight: 700;
}

.info-content p,
.review-card p {
    color: var(--slate-300);
    line-height: 1.85;
}

.info-content h3 {
    margin: 24px 0 8px;
    color: var(--white);
}

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

.fact-grid div {
    display: grid;
    gap: 4px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.62);
}

.fact-grid span {
    color: var(--slate-500);
    font-size: 12px;
}

.fact-grid strong {
    color: var(--slate-200);
}

.review-card {
    margin-top: 24px;
    padding: 24px;
}

.related-panel {
    position: sticky;
    top: 92px;
    align-self: start;
    padding: 20px;
}

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

.related-list .horizontal {
    grid-template-columns: 100px minmax(0, 1fr);
    min-height: 130px;
}

.related-list .horizontal-cover {
    min-height: 130px;
}

.related-list .horizontal-info p {
    display: none;
}

.more-section {
    margin-top: 52px;
}

.site-footer {
    margin-top: 80px;
    border-top: 1px solid rgba(51, 65, 85, 0.9);
    background: linear-gradient(90deg, var(--slate-900), var(--slate-800), var(--slate-900));
}

.footer-grid {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1.6fr;
    gap: 40px;
    padding: 44px 0;
}

.footer-brand p {
    max-width: 480px;
    color: var(--slate-400);
    line-height: 1.7;
}

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

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

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

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

.footer-links a:hover {
    color: var(--amber-500);
}

.footer-bottom {
    border-top: 1px solid rgba(51, 65, 85, 0.72);
    padding: 20px 16px;
    color: var(--slate-500);
    text-align: center;
}

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

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

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

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

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

    .related-panel {
        position: static;
    }
}

@media (max-width: 820px) {
    .hero-carousel {
        height: 68vh;
        min-height: 520px;
    }

    .hero-content {
        left: 20px;
        bottom: 68px;
    }

    .hero-arrow {
        display: none;
    }

    .poster-grid,
    .catalog-movies,
    .compact-grid,
    .feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .category-grid,
    .catalog-grid,
    .large-grid {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        position: static;
        grid-template-columns: 1fr;
    }

    .horizontal {
        grid-template-columns: 122px minmax(0, 1fr);
    }

    .horizontal-info p {
        -webkit-line-clamp: 1;
    }

    .detail-hero {
        min-height: 380px;
        padding-top: 92px;
    }

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

    .cover-box {
        max-width: 260px;
    }

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

@media (max-width: 540px) {
    .site-header-inner {
        width: min(100% - 24px, 1280px);
    }

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

    .brand-text small {
        font-size: 11px;
    }

    .hero-content p {
        -webkit-line-clamp: 3;
    }

    .hero-actions,
    .search-hero-form,
    .mobile-search {
        flex-direction: column;
    }

    .btn,
    .search-hero-form button,
    .mobile-search button {
        width: 100%;
    }

    .poster-info {
        padding: 10px;
    }

    .poster-info h3 {
        font-size: 14px;
    }

    .tag-row span {
        font-size: 11px;
    }

    .horizontal {
        grid-template-columns: 104px minmax(0, 1fr);
        min-height: 118px;
    }

    .horizontal-cover {
        min-height: 118px;
    }

    .horizontal-info {
        padding: 12px;
    }
}
