:root {
    --night-950: #081b2f;
    --night-900: #102a43;
    --night-850: #183753;
    --night-800: #243b53;
    --night-700: #334e68;
    --night-600: #486581;
    --text-main: #f3f4f6;
    --text-soft: #cbd5e1;
    --text-muted: #94a3b8;
    --amber: #f59e0b;
    --amber-dark: #d97706;
    --line: rgba(148, 163, 184, 0.18);
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at 18% 8%, rgba(245, 158, 11, 0.14), transparent 28%),
        linear-gradient(180deg, var(--night-900), var(--night-950));
    color: var(--text-main);
}

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

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

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

main {
    min-height: 60vh;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(36, 59, 83, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
}

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

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1.28rem;
    font-weight: 800;
    white-space: nowrap;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--amber), #fbbf24);
    color: white;
    box-shadow: 0 0 26px rgba(245, 158, 11, 0.35);
}

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

.desktop-nav a,
.mobile-panel a {
    color: var(--text-soft);
    transition: color 0.25s ease;
}

.desktop-nav a:hover,
.desktop-nav a.active,
.mobile-panel a:hover,
.mobile-panel a.active {
    color: #fbbf24;
}

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

.header-search input,
.page-filter input,
.mobile-panel input {
    width: 240px;
    border: 1px solid transparent;
    outline: none;
    color: var(--text-main);
    background: rgba(16, 42, 67, 0.78);
    border-radius: 12px;
    padding: 10px 14px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.header-search input:focus,
.page-filter input:focus,
.mobile-panel input:focus {
    border-color: rgba(245, 158, 11, 0.8);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.header-search button,
.page-filter button,
.mobile-panel button {
    border: 0;
    color: white;
    background: var(--amber);
    border-radius: 12px;
    padding: 10px 16px;
}

.mobile-toggle {
    display: none;
    margin-left: auto;
    border: 0;
    background: transparent;
    color: var(--text-main);
    font-size: 1.5rem;
}

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

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

.mobile-panel nav {
    display: grid;
    gap: 12px;
    padding: 12px 0;
}

.mobile-panel form {
    display: flex;
    gap: 8px;
}

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

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

.hero-slide.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

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

.hero-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(8, 27, 47, 0.94) 0%, rgba(16, 42, 67, 0.74) 42%, rgba(16, 42, 67, 0.32) 100%),
        linear-gradient(0deg, rgba(8, 27, 47, 0.78), transparent 48%);
}

.hero-content {
    position: absolute;
    left: max(24px, calc((100% - 1180px) / 2));
    top: 50%;
    width: min(650px, calc(100% - 48px));
    transform: translateY(-50%);
    animation: fade-in 0.7s ease both;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.36);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.88rem;
    font-weight: 700;
}

.hero h1,
.page-hero h1,
.detail-info h1 {
    margin: 18px 0 14px;
    font-size: clamp(2.4rem, 6vw, 5.2rem);
    line-height: 1.05;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

.hero p,
.page-hero p,
.detail-one-line {
    color: var(--text-soft);
    font-size: 1.12rem;
    line-height: 1.8;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
}

.tag-row,
.detail-tags,
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.tag-row span,
.detail-tags a,
.detail-meta span {
    color: var(--text-soft);
    background: rgba(36, 59, 83, 0.75);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 0.9rem;
}

.hero-actions,
.section-heading,
.split-section,
.detail-layout {
    display: flex;
    align-items: center;
    gap: 18px;
}

.btn-primary,
.btn-secondary,
.section-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    padding: 12px 22px;
    font-weight: 700;
    transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.btn-primary {
    background: var(--amber);
    color: white;
    box-shadow: 0 0 24px rgba(245, 158, 11, 0.28);
}

.btn-primary:hover,
.section-more:hover {
    background: var(--amber-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(72, 101, 129, 0.78);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(96, 125, 153, 0.9);
    transform: translateY(-2px);
}

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

.hero-dots button {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.52);
    transition: width 0.25s ease, background 0.25s ease;
}

.hero-dots button.active {
    width: 34px;
    background: var(--amber);
}

.home-search-block {
    width: min(980px, calc(100% - 32px));
    margin: -46px auto 70px;
    position: relative;
    z-index: 4;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(36, 59, 83, 0.92);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
    text-align: center;
}

.home-search-block h2 {
    margin: 0 0 8px;
    font-size: clamp(1.5rem, 4vw, 2.3rem);
}

.home-search-block p {
    margin: 0 auto 18px;
    max-width: 760px;
    color: var(--text-soft);
}

.home-search-block form {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.home-search-block input {
    width: min(520px, 100%);
    border: 1px solid rgba(148, 163, 184, 0.25);
    outline: none;
    background: rgba(8, 27, 47, 0.66);
    color: var(--text-main);
    border-radius: 12px;
    padding: 14px 16px;
}

.home-search-block button {
    border: 0;
    border-radius: 12px;
    background: var(--amber);
    color: white;
    padding: 14px 22px;
    font-weight: 700;
}

.section-heading {
    justify-content: space-between;
    margin: 0 0 26px;
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(1.6rem, 3vw, 2.5rem);
}

.section-heading p {
    margin: 8px 0 0;
    color: var(--text-muted);
}

.section-more {
    color: white;
    background: rgba(245, 158, 11, 0.9);
    padding: 10px 16px;
}

.featured-section,
.container {
    margin-bottom: 76px;
}

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

.feature-card {
    min-height: 460px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--night-800);
    box-shadow: var(--shadow);
}

.feature-card a {
    position: relative;
    display: block;
    height: 100%;
    min-height: 460px;
}

.feature-card img {
    width: 100%;
    height: 100%;
    min-height: 460px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.feature-card:hover img {
    transform: scale(1.08);
}

.feature-card a::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.82), transparent 58%);
}

.feature-card div {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    padding: 26px;
}

.badge {
    display: inline-flex;
    margin-bottom: 12px;
    color: white;
    background: var(--amber);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.86rem;
    font-weight: 700;
}

.feature-card h2 {
    margin: 0 0 10px;
    font-size: 1.55rem;
}

.feature-card p,
.feature-card small {
    color: var(--text-soft);
}

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

.category-tile {
    display: block;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(36, 59, 83, 0.72);
    padding: 16px;
    min-height: 260px;
    transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.category-tile:hover {
    transform: translateY(-4px);
    border-color: rgba(245, 158, 11, 0.58);
    background: rgba(51, 78, 104, 0.8);
}

.category-thumbs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 16px;
}

.category-thumbs img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 10px;
}

.category-tile h2 {
    margin: 0 0 8px;
    font-size: 1.2rem;
}

.category-tile p,
.category-tile span {
    color: var(--text-muted);
    line-height: 1.7;
}

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

.movie-card {
    min-width: 0;
}

.poster-link {
    display: block;
}

.poster-wrap {
    position: relative;
    margin: 0;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 16px;
    background: var(--night-800);
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.28);
}

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

.poster-wrap figcaption {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: white;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.72), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.play-icon {
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.92);
}

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

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

.card-body {
    padding: 12px 2px 0;
}

.card-body h2 {
    margin: 0 0 6px;
    color: var(--text-main);
    font-size: 1rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.25s ease;
}

.movie-card:hover .card-body h2 {
    color: #fbbf24;
}

.card-meta,
.card-text {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.55;
}

.card-text {
    margin-top: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.split-section {
    align-items: stretch;
}

.split-section > div {
    flex: 1;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(36, 59, 83, 0.62);
    padding: 24px;
}

.ranking-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.ranking-list a {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(16, 42, 67, 0.55);
    transition: background 0.25s ease;
}

.ranking-list a:hover {
    background: rgba(72, 101, 129, 0.72);
}

.ranking-list strong {
    color: #fbbf24;
    font-size: 1.2rem;
}

.ranking-list span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-list em {
    color: var(--text-muted);
    font-style: normal;
}

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

.compact-grid.slim {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-top: 18px;
}

.compact-card {
    display: block;
}

.compact-card img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 8px;
}

.compact-card span,
.compact-card em {
    display: block;
    color: var(--text-soft);
    font-size: 0.88rem;
    line-height: 1.4;
}

.compact-card em {
    color: var(--text-muted);
    font-style: normal;
}

.page-hero {
    padding: 86px 0 64px;
    background:
        radial-gradient(circle at 84% 18%, rgba(245, 158, 11, 0.16), transparent 28%),
        linear-gradient(135deg, rgba(36, 59, 83, 0.96), rgba(8, 27, 47, 0.96));
    border-bottom: 1px solid var(--line);
}

.page-hero.small h1 {
    max-width: 840px;
    font-size: clamp(2.2rem, 5vw, 4rem);
}

.page-hero.small p {
    max-width: 820px;
}

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

.breadcrumb a:hover {
    color: #fbbf24;
}

.page-filter {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}

.page-filter input {
    width: min(640px, 100%);
    padding: 14px 16px;
}

.category-overview-list {
    display: grid;
    gap: 22px;
    margin-top: 60px;
}

.category-overview-card {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 28px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(36, 59, 83, 0.68);
}

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

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

.category-overview-body h2 {
    margin: 0 0 10px;
    font-size: 1.8rem;
}

.category-overview-body p,
.category-overview-body span {
    color: var(--text-soft);
    line-height: 1.75;
}

.detail-hero {
    padding: 64px 0;
    background:
        radial-gradient(circle at 22% 18%, rgba(245, 158, 11, 0.14), transparent 24%),
        linear-gradient(135deg, rgba(36, 59, 83, 0.92), rgba(8, 27, 47, 0.96));
}

.detail-layout {
    align-items: center;
}

.detail-poster {
    width: min(330px, 36vw);
    flex: 0 0 auto;
}

.detail-poster img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.detail-info {
    flex: 1;
}

.detail-info h1 {
    font-size: clamp(2.2rem, 5vw, 4.8rem);
}

.player-section h2,
.detail-content h2 {
    margin: 0 0 18px;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.player-shell {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    background: #000;
    box-shadow: var(--shadow);
}

.player-shell video {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.play-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.56), rgba(0, 0, 0, 0.18));
    color: white;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.play-overlay span {
    display: grid;
    place-items: center;
    width: 86px;
    height: 86px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.95);
    box-shadow: 0 0 36px rgba(245, 158, 11, 0.38);
    font-size: 2rem;
}

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

.detail-content article {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(36, 59, 83, 0.68);
    padding: 28px;
}

.detail-content p {
    margin: 0 0 24px;
    color: var(--text-soft);
    line-height: 1.9;
    font-size: 1.04rem;
}

.detail-content p:last-child {
    margin-bottom: 0;
}

.ranking-page-list {
    display: grid;
    gap: 14px;
    margin-top: 52px;
}

.ranking-card a {
    display: grid;
    grid-template-columns: 72px 86px 1fr;
    gap: 18px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(36, 59, 83, 0.66);
    transition: background 0.25s ease, transform 0.25s ease;
}

.ranking-card a:hover {
    transform: translateY(-2px);
    background: rgba(51, 78, 104, 0.84);
}

.ranking-card strong {
    color: #fbbf24;
    font-size: 1.45rem;
    text-align: center;
}

.ranking-card img {
    width: 86px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 12px;
}

.ranking-card h2 {
    margin: 0 0 8px;
    font-size: 1.2rem;
}

.ranking-card p {
    margin: 0 0 8px;
    color: var(--text-soft);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ranking-card span {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.empty-state {
    display: none;
    margin: 36px 0;
    color: var(--text-muted);
    text-align: center;
}

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

.site-footer {
    border-top: 1px solid var(--line);
    background: rgba(36, 59, 83, 0.86);
    margin-top: 80px;
    padding: 46px 0;
}

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

.site-footer h2 {
    margin: 0 0 14px;
    font-size: 1.1rem;
}

.site-footer p,
.site-footer a {
    color: var(--text-muted);
    line-height: 1.8;
}

.site-footer a:hover {
    color: #fbbf24;
}

.site-footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    .header-search {
        margin-left: auto;
    }

    .mobile-toggle {
        display: block;
    }

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

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

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

    .hero {
        min-height: 620px;
    }

    .hero-shade {
        background: linear-gradient(0deg, rgba(8, 27, 47, 0.96), rgba(8, 27, 47, 0.42));
    }

    .hero-content {
        top: auto;
        bottom: 80px;
        transform: none;
    }

    .home-search-block form,
    .page-filter,
    .mobile-panel form,
    .split-section,
    .detail-layout {
        flex-direction: column;
        align-items: stretch;
    }

    .home-search-block button,
    .page-filter button,
    .mobile-panel button {
        width: 100%;
    }

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

    .feature-grid,
    .footer-grid,
    .category-overview-card {
        grid-template-columns: 1fr;
    }

    .detail-poster {
        width: min(320px, 100%);
    }

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

    .ranking-card a {
        grid-template-columns: 48px 74px 1fr;
    }

    .ranking-card img {
        width: 74px;
    }
}

@media (max-width: 560px) {
    .container,
    .header-inner,
    .footer-grid,
    .mobile-panel {
        width: min(100% - 24px, 1180px);
    }

    .brand {
        font-size: 1.06rem;
    }

    .brand-mark {
        width: 32px;
        height: 32px;
    }

    .hero {
        height: 78vh;
        min-height: 560px;
    }

    .hero h1 {
        font-size: 2.25rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .home-search-block {
        padding: 20px;
    }

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

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

    .ranking-card a {
        grid-template-columns: 42px 1fr;
    }

    .ranking-card img {
        display: none;
    }

    .card-text {
        display: none;
    }
}
