:root {
    --slate-950: #020617;
    --slate-900: #0f172a;
    --slate-850: #111827;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748b;
    --slate-300: #cbd5e1;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --slate-50: #f8fafc;
    --white: #ffffff;
    --gold: #fbbf24;
    --red: #ef4444;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 12px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    color: var(--slate-800);
    background: linear-gradient(180deg, var(--slate-50), var(--slate-100));
}

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

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

button,
input,
select {
    font: inherit;
}

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

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

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

.site-logo,
.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 800;
    color: var(--white);
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    color: var(--slate-900);
    background: linear-gradient(135deg, var(--white), var(--slate-300));
    font-size: 14px;
}

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

.nav-link,
.mobile-link {
    color: var(--slate-300);
    font-weight: 700;
    transition: color 0.25s ease, transform 0.25s ease;
}

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

.header-search {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-search input,
.mobile-search input,
.filter-bar input,
.filter-bar select {
    border: 1px solid rgba(148, 163, 184, 0.38);
    outline: none;
    border-radius: 999px;
    padding: 11px 16px;
    color: var(--slate-800);
    background: rgba(255, 255, 255, 0.96);
}

.header-search input {
    width: 230px;
}

.header-search button,
.mobile-search button,
.primary-btn,
.ghost-btn,
.text-btn,
.section-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.header-search button,
.mobile-search button,
.primary-btn {
    color: var(--white);
    background: var(--slate-700);
    padding: 11px 18px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.26);
}

.header-search button:hover,
.mobile-search button:hover,
.primary-btn:hover {
    transform: translateY(-2px);
    background: var(--slate-900);
}

.ghost-btn {
    padding: 11px 18px;
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.36);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
}

.ghost-btn:hover {
    color: var(--slate-900);
    background: var(--white);
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    padding: 9px;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
}

.menu-toggle span {
    display: block;
    height: 2px;
    margin: 5px 0;
    background: var(--white);
}

.mobile-panel {
    display: none;
    padding: 0 16px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

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

.mobile-search {
    display: flex;
    gap: 8px;
    margin: 16px auto;
    width: min(100%, 540px);
}

.mobile-search input {
    flex: 1;
}

.mobile-panel nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: min(100%, 540px);
    margin: 0 auto;
}

.mobile-link {
    display: block;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
}

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

.hero-track,
.hero-slide {
    position: absolute;
    inset: 0;
}

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

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

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

.hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(2, 6, 23, 0.94), rgba(15, 23, 42, 0.62), rgba(15, 23, 42, 0.1));
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    height: 100%;
}

.hero-copy {
    max-width: 680px;
    color: var(--white);
}

.hero-kicker,
.page-hero p,
.section-heading p {
    display: inline-flex;
    align-items: center;
    margin: 0 0 14px;
    color: var(--gold);
    font-weight: 900;
    letter-spacing: 0.08em;
}

.hero-copy h1 {
    margin: 0;
    font-size: clamp(42px, 7vw, 72px);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.hero-copy p {
    margin: 22px 0 0;
    color: var(--slate-200);
    font-size: 20px;
    line-height: 1.75;
}

.hero-meta,
.detail-meta,
.movie-meta-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.hero-meta {
    margin: 26px 0;
}

.hero-meta span,
.detail-meta span,
.movie-meta-line span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 4px 11px;
    color: var(--slate-100);
    background: rgba(255, 255, 255, 0.14);
}

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

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

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

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

.quick-categories {
    margin-top: -42px;
    position: relative;
    z-index: 5;
}

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

.quick-category-grid a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 84px;
    padding: 18px;
    border-radius: var(--radius-lg);
    color: var(--white);
    background: linear-gradient(135deg, var(--slate-800), var(--slate-950));
    box-shadow: var(--shadow);
    font-weight: 900;
}

.quick-category-grid span {
    min-width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: var(--slate-900);
    background: var(--white);
    font-size: 13px;
}

.home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    padding: 64px 0;
}

.content-section,
.catalog-section,
.related-section,
.ranking-panel,
.category-overview-card,
.detail-article,
.detail-side,
.player-shell {
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow);
}

.content-section {
    padding: 28px;
    margin-bottom: 28px;
}

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

.section-heading.small {
    align-items: center;
}

.section-heading h2 {
    margin: 0;
    color: var(--slate-900);
    font-size: clamp(26px, 4vw, 36px);
    line-height: 1.15;
}

.section-link,
.text-btn {
    color: var(--slate-700);
    background: var(--slate-100);
    padding: 10px 16px;
}

.section-link:hover,
.text-btn:hover {
    color: var(--white);
    background: var(--slate-800);
}

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

.movie-card {
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

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

.movie-cover {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: linear-gradient(135deg, var(--slate-800), var(--slate-950));
}

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

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

.movie-rank {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 5px 8px;
    border-radius: 999px;
    color: var(--slate-900);
    background: var(--white);
    font-size: 12px;
    font-weight: 900;
}

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

.movie-meta-line {
    gap: 6px;
    margin-bottom: 10px;
}

.movie-meta-line span {
    min-height: 22px;
    color: var(--slate-600);
    background: var(--slate-100);
    font-size: 12px;
    font-weight: 700;
}

.movie-card h3,
.ranking-card h2 {
    margin: 0;
    color: var(--slate-900);
    font-size: 18px;
    line-height: 1.35;
}

.movie-card p,
.category-overview-card p,
.ranking-card p,
.site-footer p,
.detail-copy p,
.detail-article p,
.page-hero span {
    color: var(--slate-600);
    line-height: 1.75;
}

.movie-card p {
    min-height: 50px;
    margin: 9px 0 12px;
    font-size: 14px;
}

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

.tag-row span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 9px;
    border-radius: 999px;
    color: var(--slate-700);
    background: var(--slate-100);
    font-size: 12px;
    font-weight: 700;
}

.ranking-panel {
    position: sticky;
    top: 96px;
    align-self: start;
    padding: 24px;
}

.rank-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rank-list li + li {
    border-top: 1px solid var(--slate-100);
}

.rank-list a {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 8px;
    padding: 14px 0;
}

.rank-num {
    grid-row: span 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    color: var(--white);
    background: var(--slate-800);
    font-weight: 900;
}

.rank-title {
    overflow: hidden;
    color: var(--slate-900);
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-type {
    overflow: hidden;
    color: var(--slate-500);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.page-hero {
    padding: 92px 0;
    color: var(--white);
    background: radial-gradient(circle at 20% 20%, rgba(148, 163, 184, 0.22), transparent 28%), linear-gradient(135deg, var(--slate-800), var(--slate-950));
}

.page-hero.compact {
    padding: 70px 0;
}

.page-hero h1 {
    margin: 0 0 14px;
    font-size: clamp(34px, 6vw, 56px);
    line-height: 1.1;
}

.page-hero span {
    display: block;
    max-width: 740px;
    color: var(--slate-200);
    font-size: 18px;
}

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

.category-overview-card {
    padding: 26px;
}

.category-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--slate-900);
    font-size: 26px;
    font-weight: 900;
}

.category-title-row strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    height: 34px;
    border-radius: 999px;
    color: var(--white);
    background: var(--slate-800);
    font-size: 14px;
}

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

.mini-grid .movie-card-body p,
.mini-grid .tag-row,
.mini-grid .movie-meta-line {
    display: none;
}

.mini-grid .movie-card h3 {
    font-size: 14px;
}

.catalog-section {
    padding: 28px;
    margin: 48px auto;
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 180px 160px auto;
    gap: 12px;
    margin-bottom: 26px;
}

.filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0 16px;
    color: var(--white);
    background: var(--slate-800);
    font-weight: 800;
}

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

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

.ranking-card {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 20px;
    padding: 18px;
    border-radius: var(--radius-xl);
    background: var(--white);
    box-shadow: var(--shadow);
}

.ranking-cover {
    position: relative;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: var(--slate-900);
}

.ranking-cover img {
    height: 100%;
    object-fit: cover;
}

.ranking-cover span {
    position: absolute;
    top: 10px;
    left: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    color: var(--slate-900);
    background: var(--gold);
    font-weight: 900;
}

.detail-main {
    background: var(--slate-50);
}

.detail-hero {
    position: relative;
    overflow: hidden;
    min-height: 560px;
    background: var(--slate-900);
}

.detail-bg,
.detail-mask {
    position: absolute;
    inset: 0;
}

.detail-bg {
    height: 100%;
    object-fit: cover;
    filter: blur(10px) saturate(1.08);
    transform: scale(1.05);
    opacity: 0.62;
}

.detail-mask {
    background: linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(15, 23, 42, 0.78), rgba(15, 23, 42, 0.42));
}

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

.detail-poster {
    overflow: hidden;
    border-radius: var(--radius-xl);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.38);
}

.detail-poster img {
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

.detail-copy {
    color: var(--white);
}

.breadcrumb {
    display: flex;
    gap: 9px;
    margin-bottom: 18px;
    color: var(--slate-300);
    font-weight: 700;
}

.detail-copy h1 {
    margin: 0;
    font-size: clamp(40px, 7vw, 70px);
    line-height: 1.06;
}

.detail-copy p {
    max-width: 860px;
    color: var(--slate-200);
    font-size: 20px;
}

.detail-meta {
    margin: 24px 0;
}

.detail-tags span {
    color: var(--slate-900);
    background: var(--white);
}

.detail-copy .primary-btn {
    margin-top: 26px;
    background: var(--red);
}

.player-section {
    margin-top: -70px;
    position: relative;
    z-index: 5;
}

.player-shell {
    position: relative;
    overflow: hidden;
    padding: 0;
    background: #000000;
}

.movie-video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000000;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    color: var(--white);
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.18), rgba(2, 6, 23, 0.58));
    cursor: pointer;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.player-overlay span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 86px;
    height: 86px;
    border-radius: 999px;
    color: var(--slate-900);
    background: var(--white);
    font-size: 30px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.36);
}

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

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

.detail-article,
.detail-side {
    padding: 28px;
}

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

.detail-article h2:not(:first-child) {
    margin-top: 30px;
}

.detail-side dl {
    margin: 0;
}

.detail-side div {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--slate-100);
}

.detail-side dt {
    color: var(--slate-500);
    font-weight: 800;
}

.detail-side dd {
    margin: 0;
    color: var(--slate-800);
    font-weight: 700;
}

.related-section {
    padding: 28px;
    margin-bottom: 54px;
}

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

.site-footer {
    padding: 44px 0;
    color: var(--slate-300);
    background: var(--slate-950);
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 34px;
}

.site-footer h2 {
    margin: 0 0 15px;
    color: var(--white);
    font-size: 18px;
}

.site-footer p {
    color: var(--slate-300);
}

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

.footer-links a {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--slate-200);
    background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 1100px) {
    .header-search {
        display: none;
    }

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

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

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

    .ranking-panel {
        position: static;
    }

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

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

    .menu-toggle {
        display: block;
        margin-left: auto;
    }

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

    .quick-category-grid,
    .category-overview-grid,
    .ranking-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

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

    .detail-poster {
        max-width: 240px;
    }

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

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

    .site-logo {
        font-size: 19px;
    }

    .hero-copy p,
    .detail-copy p {
        font-size: 17px;
    }

    .movie-grid,
    .catalog-grid,
    .related-grid,
    .mini-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .content-section,
    .catalog-section,
    .related-section,
    .category-overview-card,
    .detail-article,
    .detail-side {
        padding: 18px;
    }

    .ranking-card {
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 14px;
    }

    .movie-card h3,
    .ranking-card h2 {
        font-size: 16px;
    }

    .movie-card p,
    .movie-meta-line,
    .tag-row {
        display: none;
    }
}
