:root {
    color-scheme: dark;
    --bg: #020617;
    --panel: rgba(15, 23, 42, 0.78);
    --panel-strong: rgba(15, 23, 42, 0.94);
    --line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --accent: #10b981;
    --accent-strong: #059669;
    --gold: #facc15;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(16, 185, 129, 0.18), transparent 32rem),
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.12), transparent 30rem),
        var(--bg);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

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

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

button,
input {
    font: inherit;
}

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

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    min-height: 72px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}

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

.logo-mark {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), #22d3ee);
    color: white;
    font-size: 14px;
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.32);
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link,
.mobile-link {
    color: var(--soft);
    border-radius: 12px;
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-link {
    padding: 10px 14px;
}

.nav-link:hover,
.nav-link.active,
.mobile-link:hover {
    color: white;
    background: rgba(16, 185, 129, 0.12);
}

.header-search {
    margin-left: auto;
    width: min(360px, 34vw);
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.62);
}

.header-search input,
.mobile-search input,
.hero-search input,
.search-box-large input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    color: white;
    background: transparent;
}

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

.header-search button,
.mobile-search button,
.hero-search button,
.search-box-large button {
    border: 0;
    cursor: pointer;
    color: white;
    background: var(--accent);
    transition: background 0.2s ease, transform 0.2s ease;
}

.header-search button {
    padding: 10px 16px;
}

.header-search button:hover,
.mobile-search button:hover,
.hero-search button:hover,
.search-box-large button:hover,
.primary-btn:hover {
    background: var(--accent-strong);
}

.menu-toggle {
    display: none;
    margin-left: auto;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.72);
    color: white;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    background: white;
    border-radius: 999px;
}

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

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

.mobile-panel nav {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.mobile-link {
    padding: 11px 12px;
}

.mobile-link.muted {
    color: var(--muted);
}

.mobile-search {
    display: flex;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.72);
}

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

.mobile-search button {
    padding: 0 16px;
}

.hero-carousel {
    position: relative;
    min-height: 500px;
    height: 72vh;
    overflow: hidden;
    background: #020617;
}

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

.hero-slide.active {
    opacity: 1;
}

.hero-slide img,
.category-hero > img,
.detail-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #0f172a;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.9), rgba(2, 6, 23, 0.66), rgba(2, 6, 23, 0.1)),
        linear-gradient(0deg, rgba(2, 6, 23, 0.78), transparent 55%);
}

.hero-content {
    position: absolute;
    left: max(24px, calc((100vw - 1280px) / 2 + 24px));
    top: 50%;
    transform: translateY(-50%);
    width: min(680px, calc(100vw - 48px));
    animation: fadeUp 0.7s ease both;
}

.hero-kicker,
.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-content h1 {
    margin: 12px 0 18px;
    max-width: 760px;
    font-size: clamp(40px, 7vw, 78px);
    line-height: 1.05;
    font-weight: 900;
    letter-spacing: -0.05em;
}

.hero-content p {
    margin: 0 0 24px;
    color: #e2e8f0;
    font-size: clamp(17px, 2vw, 22px);
    max-width: 680px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-tags,
.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 26px;
}

.tag {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 12px;
    color: #a7f3d0;
    border: 1px solid rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.12);
    font-size: 13px;
}

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

.primary-btn,
.ghost-btn,
.more-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border-radius: 14px;
    padding: 0 20px;
    font-weight: 800;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.primary-btn {
    color: white;
    background: var(--accent);
    box-shadow: 0 18px 45px rgba(16, 185, 129, 0.28);
}

.ghost-btn,
.more-link {
    border: 1px solid var(--line);
    color: white;
    background: rgba(15, 23, 42, 0.58);
}

.primary-btn:hover,
.ghost-btn:hover,
.more-link:hover {
    transform: translateY(-2px);
}

.ghost-btn:hover,
.more-link:hover {
    border-color: rgba(16, 185, 129, 0.55);
    background: rgba(16, 185, 129, 0.12);
}

.hero-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: white;
    background: rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(10px);
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
}

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

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

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

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

.hero-dot.active {
    width: 34px;
    background: var(--accent);
}

.hero-search {
    position: absolute;
    right: max(24px, calc((100vw - 1280px) / 2 + 24px));
    bottom: 34px;
    z-index: 6;
    width: min(430px, calc(100vw - 48px));
    display: flex;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(16px);
}

.hero-search input {
    padding: 16px 18px;
}

.hero-search button {
    padding: 0 22px;
}

.page-shell {
    width: min(1280px, calc(100% - 48px));
    margin: 0 auto;
    padding: 64px 0;
}

.inner-page {
    padding-top: 44px;
}

.content-section {
    margin-bottom: 72px;
}

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

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

.section-head h2,
.compact-hero h1,
.category-hero h1,
.detail-info h1 {
    margin: 8px 0 0;
    font-size: clamp(28px, 3.8vw, 46px);
    line-height: 1.16;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.section-head p,
.compact-hero p,
.category-hero p,
.detail-line,
.detail-text p {
    color: var(--soft);
}

.section-head p,
.compact-hero p,
.category-hero p {
    margin: 8px 0 0;
    max-width: 720px;
}

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

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

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

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

.poster-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 2 / 3;
    margin-bottom: 12px;
    border-radius: 18px;
    background: #0f172a;
    box-shadow: var(--shadow);
}

.poster-wrap.small {
    width: 110px;
    min-width: 110px;
    margin: 0;
    border-radius: 16px;
}

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

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

.poster-gradient {
    position: absolute;
    inset: 0;
    opacity: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.82), transparent 58%);
    transition: opacity 0.25s ease;
}

.play-hover {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    font-size: 38px;
    background: rgba(0, 0, 0, 0.28);
    transition: opacity 0.25s ease;
}

.movie-card:hover .poster-gradient,
.movie-card:hover .play-hover {
    opacity: 1;
}

.rating,
.top-rank {
    position: absolute;
    z-index: 2;
    border-radius: 999px;
    color: white;
    font-size: 12px;
    font-weight: 800;
    backdrop-filter: blur(10px);
}

.rating {
    top: 10px;
    right: 10px;
    padding: 5px 9px;
    color: #fef3c7;
    background: rgba(0, 0, 0, 0.62);
}

.rating.large {
    top: 14px;
    right: 14px;
    font-size: 14px;
    padding: 7px 12px;
}

.top-rank {
    left: 10px;
    top: 10px;
    padding: 5px 9px;
    background: rgba(16, 185, 129, 0.82);
}

.movie-card h3 {
    margin: 0 0 4px;
    color: white;
    font-size: 16px;
    font-weight: 750;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.movie-card:hover h3 {
    color: #34d399;
}

.movie-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}

.slate-panel,
.ranking-block {
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 32px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

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

.category-card,
.category-large {
    position: relative;
    overflow: hidden;
    min-height: 210px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: #0f172a;
    isolation: isolate;
}

.category-card img,
.category-large img {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
    transition: transform 0.55s ease, opacity 0.2s ease;
}

.category-card::after,
.category-large::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.3));
}

.category-card {
    display: flex;
    align-items: end;
    padding: 22px;
}

.category-card:hover img,
.category-large:hover img {
    opacity: 0.72;
}

.category-card span,
.category-large span {
    color: #a7f3d0;
    font-size: 13px;
    font-weight: 800;
}

.category-card h3,
.category-large h2 {
    margin: 6px 0 8px;
    font-size: 22px;
    line-height: 1.2;
}

.category-card p,
.category-large p {
    margin: 0;
    color: var(--soft);
    font-size: 14px;
}

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

.movie-card.horizontal {
    display: flex;
    gap: 16px;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 12px;
    background: rgba(15, 23, 42, 0.64);
    transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.movie-card.horizontal:hover {
    transform: translateY(-2px);
    border-color: rgba(16, 185, 129, 0.45);
    background: rgba(15, 23, 42, 0.88);
}

.movie-card-body {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

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

.rank-num {
    color: var(--accent);
    font-size: 13px;
    font-weight: 900;
}

.page-hero,
.compact-hero {
    border: 1px solid var(--line);
    border-radius: 32px;
    padding: clamp(30px, 5vw, 56px);
    background:
        linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(14, 165, 233, 0.08)),
        rgba(15, 23, 42, 0.82);
    box-shadow: var(--shadow);
}

.category-overview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    margin-top: 32px;
}

.category-large {
    min-height: 300px;
}

.category-large-content {
    position: absolute;
    inset: auto 0 0 0;
    padding: 26px;
}

.sample-title {
    color: #a7f3d0 !important;
    margin-top: 12px !important;
}

.category-hero,
.detail-hero {
    position: relative;
    min-height: 520px;
    overflow: hidden;
    background: #020617;
}

.category-hero-overlay,
.detail-bg-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.95), rgba(2, 6, 23, 0.55), transparent),
        linear-gradient(0deg, rgba(2, 6, 23, 0.88), transparent 60%);
}

.category-hero-content,
.detail-hero-inner {
    position: absolute;
    inset: 0;
    width: min(1280px, calc(100% - 48px));
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.category-hero-content p {
    max-width: 680px;
    margin-bottom: 24px;
}

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

.breadcrumb a:hover {
    color: #34d399;
}

.pager-links {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-top: 36px;
}

.pager-links a {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 16px;
    color: var(--soft);
    background: rgba(15, 23, 42, 0.72);
}

.pager-links a:hover {
    color: white;
    border-color: rgba(16, 185, 129, 0.45);
}

.detail-hero {
    min-height: 660px;
}

.detail-bg {
    position: absolute;
    inset: 0;
    filter: blur(2px);
    transform: scale(1.02);
}

.detail-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 44px;
    align-items: center;
}

.detail-poster {
    position: relative;
    overflow: hidden;
    aspect-ratio: 2 / 3;
    border-radius: 26px;
    background: #0f172a;
    box-shadow: var(--shadow);
}

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

.detail-info h1 {
    margin-top: 10px;
    max-width: 860px;
    font-size: clamp(34px, 6vw, 72px);
}

.detail-line {
    max-width: 780px;
    margin: 16px 0 24px;
    font-size: clamp(17px, 2vw, 22px);
}

.detail-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    max-width: 760px;
    margin-top: 28px;
}

.detail-stats div {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px 14px;
    background: rgba(15, 23, 42, 0.7);
}

.detail-stats span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.detail-stats strong {
    display: block;
    color: white;
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-shell {
    padding-top: 52px;
}

.player-section {
    margin-bottom: 64px;
}

.player-frame {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: #000;
    box-shadow: var(--shadow);
}

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

.player-cover {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    color: white;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.2), rgba(0, 0, 0, 0.42));
    cursor: pointer;
    z-index: 3;
}

.player-cover span {
    width: 88px;
    height: 88px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding-left: 5px;
    background: rgba(16, 185, 129, 0.88);
    box-shadow: 0 24px 70px rgba(16, 185, 129, 0.3);
    font-size: 38px;
}

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

.detail-text {
    font-size: 17px;
}

.detail-text p {
    margin: 0 0 16px;
}

.search-box-large {
    display: flex;
    overflow: hidden;
    width: min(680px, 100%);
    margin-top: 26px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.45);
}

.search-box-large input {
    padding: 18px 20px;
}

.search-box-large button {
    padding: 0 28px;
}

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

.footer-inner {
    width: min(1280px, calc(100% - 48px));
    margin: 0 auto;
    padding: 38px 0;
    display: flex;
    justify-content: space-between;
    gap: 24px;
}

.footer-inner p {
    max-width: 620px;
    margin: 10px 0 0;
    color: var(--muted);
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--soft);
}

.footer-links a:hover {
    color: #34d399;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(calc(-50% + 18px));
    }
    to {
        opacity: 1;
        transform: translateY(-50%);
    }
}

@media (max-width: 1180px) {
    .movie-grid,
    .movie-grid.all-grid,
    .movie-grid.related-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

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

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

    .menu-toggle {
        display: block;
    }

    .header-inner {
        padding: 0 18px;
    }

    .hero-search {
        left: 24px;
        right: 24px;
        bottom: 80px;
        width: auto;
    }

    .hero-dots {
        bottom: 30px;
    }

    .hero-arrow {
        display: none;
    }

    .page-shell,
    .category-hero-content,
    .detail-hero-inner,
    .footer-inner {
        width: min(100% - 32px, 1280px);
    }

    .movie-grid,
    .movie-grid.all-grid,
    .movie-grid.related-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }

    .ranking-grid,
    .ranking-list {
        grid-template-columns: 1fr;
    }

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

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

    .footer-inner {
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .hero-carousel {
        min-height: 620px;
        height: 78vh;
    }

    .hero-content {
        top: 44%;
        left: 18px;
        width: calc(100vw - 36px);
    }

    .hero-content h1 {
        font-size: 42px;
    }

    .page-shell {
        padding: 42px 0;
    }

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

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

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

    .slate-panel,
    .ranking-block,
    .page-hero,
    .compact-hero {
        border-radius: 22px;
        padding: 22px;
    }

    .category-hero,
    .detail-hero {
        min-height: auto;
    }

    .category-hero-content,
    .detail-hero-inner {
        position: relative;
        min-height: 560px;
        padding: 52px 0;
    }

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

    .detail-poster {
        width: min(260px, 76vw);
    }

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

    .player-cover span {
        width: 70px;
        height: 70px;
        font-size: 30px;
    }

    .poster-wrap.small {
        width: 92px;
        min-width: 92px;
    }

    .footer-links {
        flex-wrap: wrap;
    }
}
