:root {
    color-scheme: dark;
    --bg: #020617;
    --panel: #0f172a;
    --panel-soft: rgba(15, 23, 42, 0.78);
    --panel-line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --accent: #f59e0b;
    --accent-strong: #d97706;
    --danger: #ef4444;
    --radius-xl: 24px;
    --radius-lg: 18px;
    --shadow-xl: 0 25px 70px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(245, 158, 11, 0.16), transparent 34rem),
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.12), transparent 36rem),
        var(--bg);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

body.search-open {
    overflow: hidden;
}

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

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

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

main {
    min-height: 70vh;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(2, 6, 23, 0.84);
    backdrop-filter: blur(16px);
}

.nav-shell,
.footer-grid,
.footer-bottom,
.section-shell,
.hero-content,
.detail-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.nav-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    gap: 24px;
}

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

.logo-icon {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), #f97316);
    color: #111827;
    box-shadow: 0 12px 28px rgba(245, 158, 11, 0.26);
    font-size: 16px;
}

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

.nav-link,
.search-button,
.menu-button {
    display: inline-flex;
    align-items: center;
    border: 0;
    border-radius: 12px;
    padding: 10px 15px;
    background: transparent;
    color: #cbd5e1;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active,
.search-button:hover,
.menu-button:hover {
    background: rgba(30, 41, 59, 0.9);
    color: #fff;
}

.nav-dropdown {
    position: relative;
}

.nav-drop-panel {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    display: grid;
    width: 210px;
    max-height: 420px;
    padding: 10px;
    overflow-y: auto;
    border: 1px solid var(--panel-line);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.96);
    box-shadow: var(--shadow-xl);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.nav-dropdown:hover .nav-drop-panel,
.nav-dropdown:focus-within .nav-drop-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-drop-panel a,
.mobile-nav a {
    border-radius: 10px;
    padding: 10px 12px;
    color: #cbd5e1;
}

.nav-drop-panel a:hover,
.mobile-nav a:hover {
    background: rgba(51, 65, 85, 0.9);
    color: #fff;
}

.menu-button {
    display: none;
    font-size: 22px;
}

.mobile-nav {
    display: none;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 0 0 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.mobile-nav.is-open {
    display: grid;
}

.search-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: start center;
    padding: 92px 16px 32px;
}

.search-modal[hidden] {
    display: none;
}

.search-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
}

.search-panel {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    max-height: min(76vh, 720px);
    overflow: hidden;
    border: 1px solid var(--panel-line);
    border-radius: 24px;
    background: #0f172a;
    box-shadow: var(--shadow-xl);
}

.search-panel-head {
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--panel-line);
    padding: 16px;
}

.search-panel-head input,
.local-filter input {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    outline: 0;
    padding: 13px 16px;
    background: rgba(2, 6, 23, 0.72);
    color: #fff;
}

.search-panel-head button {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: rgba(30, 41, 59, 0.9);
    color: #fff;
    font-size: 26px;
}

.search-results {
    max-height: 58vh;
    overflow-y: auto;
    padding: 12px;
}

.search-card {
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 14px;
    align-items: center;
    border-radius: 14px;
    padding: 10px;
    color: #e5e7eb;
    transition: background 0.2s ease;
}

.search-card:hover {
    background: rgba(51, 65, 85, 0.78);
}

.search-card img {
    width: 58px;
    height: 84px;
    border-radius: 10px;
    object-fit: cover;
    background: #111827;
}

.search-card strong {
    display: block;
    margin-bottom: 4px;
    color: #fff;
}

.search-card p,
.empty-state {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.hero-slider {
    position: relative;
    min-height: 650px;
    overflow: hidden;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    background: #020617;
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: grid;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

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

.hero-slide::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(90deg, rgba(2, 6, 23, 0.98) 0%, rgba(2, 6, 23, 0.78) 40%, rgba(2, 6, 23, 0.28) 100%),
        linear-gradient(0deg, rgba(2, 6, 23, 1) 0%, rgba(2, 6, 23, 0.08) 45%),
        var(--hero-image);
    background-position: center;
    background-size: cover;
    transform: scale(1.05);
}

.hero-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: center;
    gap: 54px;
    padding: 92px 0 96px;
}

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

.eyebrow {
    display: inline-flex;
    width: fit-content;
    margin: 0 0 18px;
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 999px;
    padding: 7px 12px;
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    font-size: 14px;
    font-weight: 700;
}

.hero-copy h1,
.hero-copy h2 {
    margin: 0;
    color: #fff;
    line-height: 1.04;
    text-shadow: 0 12px 34px rgba(0, 0, 0, 0.42);
}

.hero-copy h1 {
    font-size: clamp(38px, 6vw, 72px);
}

.hero-copy h2 {
    margin-top: 12px;
    font-size: clamp(30px, 4vw, 56px);
}

.hero-copy p {
    max-width: 680px;
    margin: 20px 0 0;
    color: #d1d5db;
    font-size: clamp(16px, 2vw, 20px);
    line-height: 1.8;
}

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

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

.hero-meta span,
.detail-meta span,
.detail-tags span,
.movie-tags span,
.category-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    background: rgba(30, 41, 59, 0.86);
    color: #dbeafe;
    font-size: 13px;
}

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

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    padding: 14px 22px;
    font-weight: 800;
    transition: transform 0.2s ease, background 0.2s ease, border 0.2s ease;
}

.btn-primary {
    background: var(--accent);
    color: #111827;
    box-shadow: 0 18px 34px rgba(245, 158, 11, 0.22);
}

.btn-secondary {
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.74);
    color: #fff;
}

.btn-primary:hover,
.btn-secondary:hover {
    transform: translateY(-2px) scale(1.02);
}

.btn-primary:hover {
    background: #fbbf24;
}

.hero-poster {
    position: relative;
    border-radius: 26px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    transform: rotate(2deg);
}

.hero-poster img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    background: #111827;
}

.hero-poster::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.34), transparent 45%);
}

.hero-control,
.hero-dot {
    position: absolute;
    z-index: 3;
    border: 0;
    color: #fff;
}

.hero-control {
    top: 50%;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    transform: translateY(-50%);
    transition: background 0.2s ease;
}

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

.hero-prev {
    left: 18px;
}

.hero-next {
    right: 18px;
}

.hero-dots {
    position: absolute;
    right: 0;
    bottom: 34px;
    left: 0;
    z-index: 3;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.hero-dot {
    position: static;
    width: 38px;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
}

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

.section-shell {
    padding: 58px 0 0;
}

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

.section-head h2,
.page-title h1,
.detail-title h1 {
    margin: 0;
    color: #fff;
    font-weight: 850;
    letter-spacing: -0.03em;
}

.section-head h2 {
    font-size: clamp(25px, 3vw, 38px);
}

.section-head p,
.page-title p,
.detail-title p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.75;
}

.section-more {
    color: #fbbf24;
    font-weight: 700;
}

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

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

.movie-card {
    min-width: 0;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 20px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.6);
    transition: transform 0.24s ease, box-shadow 0.24s ease, border 0.24s ease;
}

.movie-card.is-hidden {
    display: none;
}

.movie-card:hover {
    border-color: rgba(245, 158, 11, 0.35);
    box-shadow: 0 22px 44px rgba(0, 0, 0, 0.28);
    transform: translateY(-6px);
}

.movie-poster {
    position: relative;
    display: block;
    overflow: hidden;
    background: #111827;
}

.movie-poster img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    transition: transform 0.35s ease, filter 0.35s ease;
}

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

.movie-poster::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.72));
    opacity: 0.8;
}

.movie-score {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    border-radius: 999px;
    padding: 5px 9px;
    background: rgba(245, 158, 11, 0.94);
    color: #111827;
    font-size: 12px;
    font-weight: 850;
}

.movie-play {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    opacity: 0;
    transform: scale(0.86);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.movie-card:hover .movie-play {
    opacity: 1;
    transform: scale(1);
}

.movie-info {
    padding: 13px;
}

.movie-info h3 {
    margin: 0;
    color: #fff;
    font-size: 16px;
    line-height: 1.35;
}

.movie-info h3 a:hover,
.rank-item h3 a:hover,
.text-link:hover {
    color: #fbbf24;
}

.movie-info p {
    min-height: 42px;
    margin: 8px 0 10px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.movie-meta {
    color: #94a3b8;
    font-size: 12px;
}

.movie-tags {
    margin-top: 10px;
}

.movie-tags span {
    padding: 4px 8px;
    background: rgba(245, 158, 11, 0.12);
    color: #fcd34d;
}

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

.category-card {
    position: relative;
    min-height: 190px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 24px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.74));
    transition: transform 0.24s ease, border 0.24s ease;
}

.category-card:hover {
    border-color: rgba(245, 158, 11, 0.38);
    transform: translateY(-5px);
}

.category-card img {
    position: absolute;
    right: -12px;
    bottom: -28px;
    width: 130px;
    height: 190px;
    border-radius: 16px;
    object-fit: cover;
    opacity: 0.42;
    transform: rotate(8deg);
}

.category-card h2,
.category-card h3 {
    position: relative;
    z-index: 1;
    margin: 0 0 10px;
    color: #fff;
    font-size: 24px;
}

.category-card p {
    position: relative;
    z-index: 1;
    max-width: 72%;
    margin: 0;
    color: #cbd5e1;
    line-height: 1.7;
}

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

.rank-item {
    display: grid;
    grid-template-columns: 50px 76px 1fr;
    gap: 14px;
    align-items: center;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 18px;
    padding: 12px;
    background: rgba(15, 23, 42, 0.62);
    transition: transform 0.2s ease, border 0.2s ease;
}

.rank-item:hover {
    border-color: rgba(245, 158, 11, 0.32);
    transform: translateX(4px);
}

.rank-number {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(245, 158, 11, 0.13);
    color: #fbbf24;
    font-weight: 900;
}

.rank-thumb img {
    width: 76px;
    height: 104px;
    border-radius: 12px;
    object-fit: cover;
    background: #111827;
}

.rank-item h3 {
    margin: 0;
    color: #fff;
    font-size: 17px;
}

.rank-item p {
    margin: 7px 0 8px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
}

.page-hero {
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.84), rgba(2, 6, 23, 0.38)),
        radial-gradient(circle at 70% 0%, rgba(245, 158, 11, 0.16), transparent 32rem);
}

.page-title {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 64px 0 40px;
}

.page-title h1 {
    font-size: clamp(34px, 5vw, 58px);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    color: var(--muted);
    font-size: 14px;
}

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

.local-filter {
    margin-bottom: 24px;
}

.detail-shell {
    padding: 34px 0 0;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 28px;
    align-items: start;
}

.player-card,
.detail-card,
.side-card {
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.72);
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.22);
}

.player-card {
    overflow: hidden;
}

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

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

.player-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    border: 0;
    background: rgba(0, 0, 0, 0.38);
    color: #fff;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.play-icon-large {
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.94);
    color: #111827;
    font-size: 34px;
    box-shadow: 0 20px 50px rgba(245, 158, 11, 0.24);
}

.player-caption {
    padding: 18px 20px;
    color: #cbd5e1;
}

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

.detail-title h1 {
    font-size: clamp(28px, 4vw, 44px);
}

.detail-meta,
.detail-tags {
    margin-top: 18px;
}

.detail-section {
    margin-top: 26px;
}

.detail-section h2 {
    margin: 0 0 12px;
    color: #fff;
    font-size: 22px;
}

.detail-section p {
    margin: 0 0 12px;
    color: #d1d5db;
    line-height: 1.9;
}

.side-card {
    padding: 18px;
}

.side-card + .side-card {
    margin-top: 18px;
}

.side-poster {
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 18px;
    object-fit: cover;
    background: #111827;
}

.side-card h2 {
    margin: 0 0 16px;
    color: #fff;
    font-size: 21px;
}

.side-card .rank-item {
    grid-template-columns: 38px 58px 1fr;
    padding: 8px;
}

.side-card .rank-thumb img {
    width: 58px;
    height: 82px;
}

.side-card .rank-item p {
    display: none;
}

.side-card .rank-item h3 {
    font-size: 14px;
}

.site-footer {
    margin-top: 72px;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(2, 6, 23, 0.74);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 0.9fr 1fr 1.1fr;
    gap: 32px;
    padding: 42px 0;
}

.footer-grid h2 {
    margin: 0 0 14px;
    color: #fff;
    font-size: 18px;
}

.footer-grid p,
.footer-links a,
.footer-bottom {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.75;
}

.footer-logo {
    margin-bottom: 14px;
}

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

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

.footer-bottom {
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    padding: 18px 0 26px;
}

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

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

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

    .side-card .rank-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

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

    .nav-shell {
        min-height: 62px;
    }

    .hero-slider {
        min-height: 720px;
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 62px 0 88px;
    }

    .hero-poster {
        width: min(260px, 72vw);
        margin: 0 auto;
    }

    .hero-control {
        display: none;
    }

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

    .category-grid,
    .rank-list,
    .footer-grid,
    .side-card .rank-list {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 560px) {
    .nav-shell,
    .footer-grid,
    .footer-bottom,
    .section-shell,
    .hero-content,
    .detail-shell,
    .page-title {
        width: min(100% - 22px, 1180px);
    }

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

    .search-button {
        padding: 9px 11px;
    }

    .hero-slider {
        min-height: 690px;
    }

    .hero-meta span,
    .detail-meta span,
    .detail-tags span,
    .movie-tags span {
        font-size: 12px;
    }

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

    .movie-info {
        padding: 10px;
    }

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

    .movie-info p {
        font-size: 12px;
    }

    .rank-item {
        grid-template-columns: 42px 62px 1fr;
        gap: 10px;
    }

    .rank-thumb img {
        width: 62px;
        height: 88px;
    }

    .category-card p {
        max-width: 100%;
    }

    .category-card img {
        opacity: 0.18;
    }

    .detail-card,
    .side-card {
        padding: 16px;
    }

    .play-icon-large {
        width: 68px;
        height: 68px;
        font-size: 28px;
    }
}
