:root {
    color-scheme: dark;
    --bg: #020617;
    --bg-soft: #0f172a;
    --panel: #111827;
    --panel-2: #1e293b;
    --line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --muted-2: #cbd5e1;
    --brand: #f59e0b;
    --brand-2: #fbbf24;
    --danger: #ef4444;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(180deg, #020617 0%, #0f172a 45%, #020617 100%);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

body.menu-open {
    overflow: hidden;
}

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

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

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(2, 6, 23, 0.82);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
}

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

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.logo-mark {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: #0f172a;
    background: linear-gradient(135deg, var(--brand-2), var(--brand));
    box-shadow: 0 10px 26px rgba(245, 158, 11, 0.36);
}

.desktop-nav,
.footer-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.desktop-nav a,
.mobile-nav a,
.footer-links a {
    color: var(--muted-2);
    border-radius: 999px;
    transition: 0.2s ease;
}

.desktop-nav a {
    padding: 9px 16px;
}

.desktop-nav a:hover,
.desktop-nav a.active,
.mobile-nav a:hover,
.mobile-nav a.active,
.footer-links a:hover {
    color: #111827;
    background: var(--brand-2);
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--text);
    background: rgba(15, 23, 42, 0.8);
}

.mobile-nav {
    display: none;
    border-top: 1px solid var(--line);
    padding: 12px 16px 18px;
    background: rgba(2, 6, 23, 0.96);
}

.mobile-nav a {
    display: block;
    padding: 12px 14px;
    margin: 4px 0;
}

.hero-carousel {
    position: relative;
    min-height: 560px;
    overflow: hidden;
    background: var(--bg-soft);
}

.hero-slide {
    display: none;
    min-height: 560px;
    align-items: center;
    background-size: cover;
    background-position: center;
}

.hero-slide.active {
    display: flex;
    animation: heroFade 0.5s ease both;
}

@keyframes heroFade {
    from {
        opacity: 0.55;
        transform: scale(1.01);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.hero-content {
    padding: 104px 0 88px;
}

.hero-copy {
    max-width: 720px;
}

.eyebrow,
.badge,
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--brand);
    color: #111827;
    font-weight: 800;
}

.eyebrow {
    padding: 8px 16px;
    font-size: 14px;
    margin-bottom: 18px;
}

.hero-copy h1 {
    margin: 0 0 18px;
    font-size: clamp(38px, 7vw, 72px);
    line-height: 1.02;
    letter-spacing: -0.06em;
}

.hero-copy p {
    max-width: 660px;
    margin: 0 0 22px;
    color: #e5e7eb;
    font-size: clamp(17px, 2vw, 22px);
}

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

.hero-meta span,
.detail-meta span,
.card-meta span,
.tag-row span {
    color: var(--muted-2);
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
}

.hero-actions,
.section-actions,
.filter-row,
.pagination-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-actions {
    margin-top: 28px;
}

.primary-button,
.secondary-button,
.small-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: 0.2s ease;
    font-weight: 800;
}

.primary-button {
    padding: 0 24px;
    color: #111827;
    background: linear-gradient(135deg, var(--brand-2), var(--brand));
    box-shadow: 0 14px 32px rgba(245, 158, 11, 0.28);
}

.secondary-button {
    padding: 0 22px;
    color: var(--text);
    background: rgba(15, 23, 42, 0.72);
    border-color: var(--line);
}

.small-button {
    min-height: 38px;
    padding: 0 16px;
    color: var(--text);
    background: rgba(15, 23, 42, 0.8);
    border-color: var(--line);
}

.primary-button:hover,
.secondary-button:hover,
.small-button:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
}

.hero-control {
    position: absolute;
    top: 50%;
    z-index: 5;
    width: 48px;
    height: 48px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    background: rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(10px);
    transform: translateY(-50%);
    transition: 0.2s ease;
}

.hero-control:hover {
    background: rgba(245, 158, 11, 0.82);
    color: #111827;
}

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

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

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

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

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

.section {
    padding: 58px 0;
}

.section.alt {
    background: rgba(15, 23, 42, 0.46);
}

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

.section-title {
    margin: 0;
    font-size: clamp(26px, 4vw, 36px);
    letter-spacing: -0.04em;
}

.section-desc {
    margin: 8px 0 0;
    color: var(--muted);
    max-width: 720px;
}

.featured-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 20px;
}

.featured-side {
    display: grid;
    gap: 16px;
}

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

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

.movie-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    background: rgba(30, 41, 59, 0.88);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.24);
    transition: 0.22s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(251, 191, 36, 0.55);
    box-shadow: var(--shadow);
}

.movie-card.horizontal {
    flex-direction: row;
}

.poster-wrap {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: #0f172a;
}

.movie-card.horizontal .poster-wrap {
    width: 34%;
    min-width: 128px;
    aspect-ratio: auto;
}

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

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

.poster-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.76), rgba(0, 0, 0, 0.08) 58%, transparent);
    opacity: 0;
    transition: 0.24s ease;
}

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

.badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    padding: 4px 10px;
    font-size: 12px;
}

.play-icon {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 3;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #111827;
    background: var(--brand-2);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.88);
    transition: 0.24s ease;
}

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

.rank-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 4;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    color: #111827;
}

.card-body {
    padding: 16px;
    min-width: 0;
}

.card-body h3 {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 1.32;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.card-meta {
    justify-content: space-between;
    gap: 8px;
}

.card-meta span {
    padding: 4px 8px;
    font-size: 12px;
}

.scroller-wrap {
    position: relative;
}

.movie-row {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 12px;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.movie-row::-webkit-scrollbar {
    display: none;
}

.movie-row .movie-card {
    width: 280px;
    flex: 0 0 280px;
}

.icon-button {
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    background: rgba(30, 41, 59, 0.9);
    transition: 0.2s ease;
}

.icon-button:hover {
    color: #111827;
    background: var(--brand-2);
}

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

.category-card {
    position: relative;
    overflow: hidden;
    min-height: 190px;
    display: flex;
    align-items: end;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: rgba(30, 41, 59, 0.9);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
    transition: 0.22s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: rgba(251, 191, 36, 0.55);
}

.category-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.42;
    transition: 0.3s ease;
}

.category-card:hover img {
    transform: scale(1.08);
    opacity: 0.6;
}

.category-card div {
    position: relative;
    z-index: 2;
    padding: 22px;
}

.category-card h3 {
    margin: 0 0 8px;
    font-size: 22px;
}

.category-card p {
    margin: 0;
    color: var(--muted-2);
    font-size: 14px;
}

.page-hero {
    padding: 74px 0 36px;
    background:
        radial-gradient(circle at 20% 0%, rgba(245, 158, 11, 0.18), transparent 34%),
        radial-gradient(circle at 82% 18%, rgba(59, 130, 246, 0.14), transparent 32%);
}

.page-hero h1 {
    margin: 0 0 14px;
    font-size: clamp(34px, 6vw, 58px);
    line-height: 1.08;
    letter-spacing: -0.05em;
}

.page-hero p {
    max-width: 760px;
    margin: 0;
    color: var(--muted-2);
    font-size: 18px;
}

.filter-panel {
    margin: 30px 0 26px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.72);
}

.filter-row input,
.filter-row select {
    min-height: 46px;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.72);
    outline: none;
}

.filter-row input {
    flex: 1 1 260px;
    padding: 0 18px;
}

.filter-row select {
    flex: 0 0 150px;
    padding: 0 14px;
}

.detail-hero {
    position: relative;
    overflow: hidden;
    min-height: 520px;
    display: flex;
    align-items: end;
    background: var(--bg-soft);
}

.detail-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.32;
    filter: blur(3px);
    transform: scale(1.04);
}

.detail-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(2, 6, 23, 0.98), rgba(2, 6, 23, 0.62), rgba(2, 6, 23, 0.92));
}

.detail-layout {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 34px;
    padding: 88px 0 54px;
    align-items: end;
}

.detail-poster {
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: var(--shadow);
    background: #0f172a;
}

.detail-poster img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    display: block;
}

.breadcrumb {
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 14px;
}

.breadcrumb a:hover {
    color: var(--brand-2);
}

.detail-copy h1 {
    margin: 0 0 16px;
    font-size: clamp(36px, 6vw, 64px);
    line-height: 1.04;
    letter-spacing: -0.05em;
}

.detail-copy p {
    max-width: 820px;
    color: #e2e8f0;
    font-size: 18px;
}

.player-section {
    padding: 48px 0 20px;
}

.player-shell {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: #000;
    box-shadow: var(--shadow);
}

.movie-video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
}

.player-overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--text);
    border: 0;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.24), rgba(2, 6, 23, 0.78));
    transition: 0.22s ease;
}

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

.big-play {
    width: 82px;
    height: 82px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 5px;
    border-radius: 999px;
    color: #111827;
    background: linear-gradient(135deg, var(--brand-2), var(--brand));
    box-shadow: 0 18px 42px rgba(245, 158, 11, 0.35);
    font-size: 34px;
}

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

.story-card,
.side-card {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.72);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.2);
}

.story-card {
    padding: 28px;
}

.story-card h2,
.side-card h2 {
    margin: 0 0 14px;
    font-size: 24px;
}

.story-card p {
    margin: 0 0 22px;
    color: var(--muted-2);
    font-size: 17px;
}

.side-card {
    padding: 22px;
}

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

.side-links a {
    padding: 12px 14px;
    border-radius: 14px;
    color: var(--muted-2);
    background: rgba(30, 41, 59, 0.78);
    border: 1px solid var(--line);
    transition: 0.2s ease;
}

.side-links a:hover {
    color: #111827;
    background: var(--brand-2);
}

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

.rank-item {
    display: grid;
    grid-template-columns: 60px 120px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(30, 41, 59, 0.78);
    transition: 0.2s ease;
}

.rank-item:hover {
    transform: translateY(-3px);
    border-color: rgba(251, 191, 36, 0.48);
}

.rank-no {
    font-size: 24px;
    font-weight: 900;
    color: var(--brand-2);
    text-align: center;
}

.rank-cover {
    overflow: hidden;
    border-radius: 12px;
    aspect-ratio: 16 / 10;
    background: #0f172a;
}

.rank-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rank-info h3 {
    margin: 0 0 8px;
    font-size: 20px;
}

.rank-info p {
    margin: 0;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.site-footer {
    border-top: 1px solid var(--line);
    background: rgba(2, 6, 23, 0.92);
    padding: 34px 0;
}

.footer-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
}

.site-footer p {
    margin: 12px 0 0;
    color: var(--muted);
}

.footer-links {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.footer-links a {
    padding: 8px 12px;
}

.empty-state {
    display: none;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 20px;
    color: var(--muted-2);
    background: rgba(15, 23, 42, 0.72);
}

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

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

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

    .detail-layout {
        grid-template-columns: 220px minmax(0, 1fr);
    }
}

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

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

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

    .hero-carousel,
    .hero-slide {
        min-height: 620px;
    }

    .hero-content {
        padding: 90px 0 110px;
    }

    .hero-control {
        top: auto;
        bottom: 76px;
        transform: none;
    }

    .hero-control.prev {
        left: 24px;
    }

    .hero-control.next {
        right: 24px;
    }

    .section-head,
    .footer-inner {
        display: block;
    }

    .section-actions,
    .footer-links {
        margin-top: 16px;
        justify-content: flex-start;
    }

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

    .movie-card.horizontal {
        flex-direction: column;
    }

    .movie-card.horizontal .poster-wrap {
        width: 100%;
        aspect-ratio: 16 / 10;
    }

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

    .detail-layout {
        grid-template-columns: 1fr;
        padding-top: 98px;
    }

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

    .filter-row input,
    .filter-row select {
        flex: 1 1 100%;
    }
}

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

    .movie-grid,
    .movie-grid.compact,
    .category-grid {
        grid-template-columns: 1fr;
    }

    .movie-row .movie-card {
        width: 236px;
        flex-basis: 236px;
    }

    .card-body h3 {
        font-size: 16px;
    }

    .rank-item {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .rank-cover {
        display: none;
    }
}
