:root {
    color-scheme: dark;
    --bg: #020617;
    --bg-soft: #0f172a;
    --panel: rgba(15, 23, 42, 0.72);
    --panel-strong: rgba(15, 23, 42, 0.92);
    --line: rgba(148, 163, 184, 0.18);
    --line-strong: rgba(6, 182, 212, 0.38);
    --text: #f8fafc;
    --muted: #94a3b8;
    --cyan: #22d3ee;
    --blue: #2563eb;
    --orange: #fb923c;
    --green: #34d399;
    --shadow: 0 24px 80px rgba(8, 47, 73, 0.35);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top left, rgba(8, 145, 178, 0.18), transparent 32rem), linear-gradient(180deg, #020617 0%, #0f172a 48%, #020617 100%);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

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

button,
input,
select {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 80;
    background: rgba(2, 6, 23, 0.92);
    border-bottom: 1px solid rgba(51, 65, 85, 0.85);
    backdrop-filter: blur(18px);
    box-shadow: 0 12px 38px rgba(0, 0, 0, 0.32);
}

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

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

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.brand-mark {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    color: #020617;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    border-radius: 12px;
    box-shadow: 0 0 32px rgba(34, 211, 238, 0.38);
}

.brand-text {
    font-size: 24px;
    background: linear-gradient(90deg, #67e8f9, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 26px;
    color: #cbd5e1;
    font-weight: 600;
}

.desktop-nav a,
.mobile-nav a,
.footer-links a {
    transition: color 0.24s ease, transform 0.24s ease;
}

.desktop-nav a:hover,
.mobile-nav a:hover,
.footer-links a:hover {
    color: var(--cyan);
}

.top-search,
.mobile-search,
.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-search input,
.mobile-search input,
.search-box input,
.category-filter input {
    width: 260px;
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(71, 85, 105, 0.9);
    border-radius: 14px;
    outline: none;
    padding: 12px 14px;
    transition: border-color 0.24s ease, box-shadow 0.24s ease;
}

.top-search input:focus,
.mobile-search input:focus,
.search-box input:focus,
.category-filter input:focus {
    border-color: rgba(34, 211, 238, 0.75);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

.top-search button,
.mobile-search button,
.search-box button,
.primary-button,
.secondary-button {
    border: 0;
    color: white;
    cursor: pointer;
    border-radius: 14px;
    padding: 12px 18px;
    font-weight: 800;
    background: linear-gradient(135deg, #06b6d4, #2563eb);
    box-shadow: 0 16px 38px rgba(37, 99, 235, 0.24);
    transition: transform 0.24s ease, box-shadow 0.24s ease, filter 0.24s ease;
}

.top-search button:hover,
.mobile-search button:hover,
.search-box button:hover,
.primary-button:hover,
.secondary-button:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
    box-shadow: 0 22px 48px rgba(34, 211, 238, 0.28);
}

.secondary-button {
    background: rgba(15, 23, 42, 0.68);
    border: 1px solid rgba(34, 211, 238, 0.38);
}

.mobile-toggle {
    display: none;
    width: 42px;
    height: 42px;
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(71, 85, 105, 0.8);
    border-radius: 12px;
}

.mobile-nav {
    display: none;
    padding: 16px;
    border-top: 1px solid rgba(51, 65, 85, 0.7);
    background: rgba(15, 23, 42, 0.96);
}

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

.mobile-nav nav {
    display: grid;
    gap: 12px;
    margin-top: 14px;
    color: #cbd5e1;
    font-weight: 700;
}

.hero {
    position: relative;
    height: 70vh;
    min-height: 560px;
    overflow: hidden;
    background: #020617;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1000ms ease;
}

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

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
}

.hero-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.84) 38%, rgba(2, 6, 23, 0.32) 100%), radial-gradient(circle at 28% 55%, rgba(8, 145, 178, 0.28), transparent 26rem);
}

.hero-content {
    position: absolute;
    left: max(24px, calc((100% - 1180px) / 2));
    right: max(24px, calc((100% - 1180px) / 2));
    bottom: 64px;
    z-index: 2;
    max-width: 760px;
}

.hero-kicker,
.section-kicker,
.breadcrumbs {
    color: var(--cyan);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero h1 {
    margin: 14px 0 16px;
    font-size: clamp(36px, 6vw, 72px);
    line-height: 0.98;
    letter-spacing: -0.06em;
    text-shadow: 0 24px 50px rgba(0, 0, 0, 0.52);
}

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

.hero-meta,
.movie-meta,
.detail-meta,
.breadcrumbs,
.tag-row,
.hero-actions,
.category-tabs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-meta {
    margin: 18px 0 28px;
    color: #e2e8f0;
}

.hero-meta span,
.movie-meta span,
.detail-meta span {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.18);
    padding: 6px 10px;
}

.hero-nav {
    position: absolute;
    top: 50%;
    z-index: 3;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    color: white;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    font-size: 34px;
    line-height: 1;
    transition: background 0.24s ease, transform 0.24s ease;
}

.hero-nav:hover {
    background: rgba(0, 0, 0, 0.68);
    transform: translateY(-50%) scale(1.06);
}

.hero-prev {
    left: 24px;
}

.hero-next {
    right: 24px;
}

.hero-dots {
    position: absolute;
    right: max(24px, calc((100% - 1180px) / 2));
    bottom: 76px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hero-dot {
    width: 9px;
    height: 9px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.48);
    border: 0;
    border-radius: 999px;
    padding: 0;
    transition: width 0.24s ease, background 0.24s ease;
}

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

.page-wrap {
    padding: 56px 0;
}

.section {
    margin-bottom: 76px;
}

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

.page-head {
    align-items: center;
}

.section-title,
.page-title {
    margin: 8px 0 0;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.section-desc,
.page-desc {
    max-width: 760px;
    margin: 14px 0 0;
    color: var(--muted);
    line-height: 1.8;
}

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

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

.movie-card {
    overflow: hidden;
    background: rgba(15, 23, 42, 0.58);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
    transition: border-color 0.28s ease, transform 0.28s ease, box-shadow 0.28s ease;
}

.movie-card:hover {
    transform: translateY(-5px);
    border-color: rgba(34, 211, 238, 0.48);
    box-shadow: var(--shadow);
}

.movie-poster {
    position: relative;
    display: block;
    height: 248px;
    overflow: hidden;
    background: linear-gradient(135deg, #0f172a, #111827);
}

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

.movie-card:hover .movie-poster img,
.category-tile:hover img,
.rank-card:hover img,
.related-card:hover img {
    transform: scale(1.08);
}

.movie-poster::after,
.category-tile::after,
.related-card .poster::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.74), transparent 62%);
}

.duration {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    padding: 5px 8px;
    color: white;
    background: rgba(0, 0, 0, 0.72);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
}

.poster-play {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    transform: translate(-50%, -50%) scale(0.88);
    opacity: 0;
    color: white;
    background: rgba(34, 211, 238, 0.82);
    border-radius: 999px;
    transition: opacity 0.28s ease, transform 0.28s ease;
}

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

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

.movie-card h3,
.rank-card h3,
.related-card h3 {
    margin: 0 0 10px;
    color: #f8fafc;
    font-size: 18px;
    line-height: 1.35;
    transition: color 0.24s ease;
}

.movie-card h3:hover,
.rank-card h3:hover,
.related-card h3:hover {
    color: var(--cyan);
}

.movie-card p,
.rank-card p,
.related-card p {
    margin: 0 0 14px;
    color: var(--muted);
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.movie-meta,
.detail-meta {
    color: #94a3b8;
    font-size: 13px;
}

.tag-row {
    margin-top: 12px;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    color: #67e8f9;
    background: rgba(8, 145, 178, 0.14);
    border: 1px solid rgba(6, 182, 212, 0.28);
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 700;
}

.split-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
    gap: 28px;
    align-items: start;
}

.rank-list,
.latest-list {
    display: grid;
    gap: 16px;
}

.rank-card {
    position: relative;
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    min-height: 128px;
    padding: 14px;
    background: rgba(15, 23, 42, 0.58);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 18px;
    transition: border-color 0.28s ease, transform 0.28s ease, box-shadow 0.28s ease;
}

.rank-card:hover {
    transform: translateY(-3px);
    border-color: rgba(34, 211, 238, 0.38);
    box-shadow: var(--shadow);
}

.rank-poster {
    height: 100px;
    overflow: hidden;
    border-radius: 14px;
    background: #0f172a;
}

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

.rank-number {
    position: absolute;
    left: -8px;
    top: -8px;
    z-index: 3;
    min-width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: white;
    border-radius: 999px;
    background: linear-gradient(135deg, #f97316, #ef4444);
    font-weight: 900;
    box-shadow: 0 12px 28px rgba(239, 68, 68, 0.25);
}

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

.category-tile {
    position: relative;
    min-height: 210px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 20px;
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.2);
}

.category-tile img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.58;
    transition: transform 0.36s ease, opacity 0.36s ease;
}

.category-tile:hover img {
    opacity: 0.72;
}

.category-tile-content {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 2;
    padding: 20px;
}

.category-tile h2,
.category-tile h3 {
    margin: 0 0 8px;
    font-size: 22px;
}

.category-tile p {
    margin: 0;
    color: #cbd5e1;
    line-height: 1.55;
}

.category-filter {
    margin: 28px 0;
    padding: 20px;
    background: rgba(15, 23, 42, 0.58);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 20px;
}

.category-filter input,
.search-box input {
    width: min(560px, 100%);
}

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

.detail-panel,
.side-panel,
.player-panel {
    background: rgba(15, 23, 42, 0.58);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 22px;
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.2);
}

.detail-panel,
.side-panel {
    padding: 24px;
}

.player-panel {
    overflow: hidden;
    margin-bottom: 28px;
}

.player-shell {
    position: relative;
    background: #000;
}

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

.play-layer {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: grid;
    place-items: center;
    cursor: pointer;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.18));
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.play-button {
    width: 92px;
    height: 92px;
    display: grid;
    place-items: center;
    color: white;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.96), rgba(37, 99, 235, 0.96));
    border: 0;
    border-radius: 999px;
    font-size: 38px;
    box-shadow: 0 24px 64px rgba(34, 211, 238, 0.36);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.play-button:hover {
    transform: scale(1.06);
    box-shadow: 0 30px 86px rgba(34, 211, 238, 0.48);
}

.detail-info {
    padding: 24px;
}

.detail-info h1,
.page-head h1 {
    margin: 10px 0 14px;
    font-size: clamp(30px, 5vw, 52px);
    line-height: 1.08;
    letter-spacing: -0.05em;
}

.detail-summary h2,
.detail-panel h2,
.side-panel h2 {
    margin: 0 0 14px;
    font-size: 24px;
}

.detail-summary p,
.detail-panel p {
    color: #cbd5e1;
    line-height: 1.9;
    margin: 0 0 18px;
}

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

.related-card {
    overflow: hidden;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 18px;
}

.related-card .poster {
    position: relative;
    height: 160px;
    overflow: hidden;
}

.related-card .poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.28s ease;
}

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

.side-panel .rank-card {
    grid-template-columns: 74px minmax(0, 1fr);
    min-height: 96px;
    padding: 10px;
}

.side-panel .rank-poster {
    height: 76px;
}

.side-panel .rank-card p,
.side-panel .movie-meta {
    display: none;
}

.side-panel .rank-card h3 {
    font-size: 15px;
    margin-bottom: 0;
}

.search-box {
    align-items: stretch;
    margin: 28px 0 34px;
}

.search-results-empty {
    padding: 34px;
    text-align: center;
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.58);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 20px;
}

.breadcrumbs {
    margin-bottom: 22px;
    color: #94a3b8;
    text-transform: none;
    letter-spacing: 0;
}

.breadcrumbs a:hover {
    color: var(--cyan);
}

.site-footer {
    margin-top: 48px;
    border-top: 1px solid rgba(51, 65, 85, 0.82);
    background: rgba(2, 6, 23, 0.78);
}

.footer-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.7fr);
    gap: 36px;
    padding: 40px 0;
}

.footer-brand {
    color: #67e8f9;
    font-size: 22px;
}

.site-footer p {
    max-width: 620px;
    color: var(--muted);
    line-height: 1.8;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px 18px;
    color: #cbd5e1;
    font-weight: 700;
}

.footer-bottom {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0 30px;
    color: #64748b;
    border-top: 1px solid rgba(51, 65, 85, 0.62);
}

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

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

    .mobile-toggle {
        display: grid;
        place-items: center;
    }

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

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

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

@media (max-width: 760px) {
    .nav-wrap,
    .footer-wrap,
    .page-wrap {
        width: min(100% - 24px, 1180px);
    }

    .brand-text {
        font-size: 20px;
    }

    .hero {
        min-height: 520px;
    }

    .hero-content {
        left: 18px;
        right: 18px;
        bottom: 52px;
    }

    .hero-nav {
        display: none;
    }

    .hero-dots {
        left: 18px;
        right: auto;
        bottom: 22px;
    }

    .section-head,
    .page-head {
        display: block;
    }

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

    .movie-poster {
        height: 210px;
    }

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

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

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

    .footer-wrap {
        grid-template-columns: 1fr;
    }

    .footer-links {
        justify-content: flex-start;
    }
}

@media (max-width: 520px) {
    .card-grid,
    .card-grid.compact,
    .category-grid,
    .related-grid {
        grid-template-columns: 1fr;
    }

    .movie-poster {
        height: 250px;
    }

    .search-box {
        display: grid;
    }
}
