:root {
    --bg: #020617;
    --panel: #0f172a;
    --panel-soft: #1e293b;
    --line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #cbd5e1;
    --subtle: #94a3b8;
    --cyan: #22d3ee;
    --blue: #3b82f6;
    --orange: #f97316;
    --red: #ef4444;
    --yellow: #facc15;
    --radius: 22px;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 20% 5%, rgba(34, 211, 238, 0.14), transparent 30%),
        radial-gradient(circle at 80% 15%, rgba(59, 130, 246, 0.12), transparent 28%),
        linear-gradient(180deg, #020617 0%, #0f172a 45%, #020617 100%);
    min-height: 100vh;
}

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

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

button,
input {
    font: inherit;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.header-inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 50%;
    color: white;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 10px 35px rgba(34, 211, 238, 0.32);
}

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

.nav-link {
    color: var(--muted);
    font-weight: 650;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
    color: white;
}

.nav-menu {
    position: relative;
}

.menu-trigger {
    background: transparent;
    border: 0;
    padding: 0;
}

.menu-panel {
    position: absolute;
    top: 34px;
    left: 0;
    width: 190px;
    padding: 10px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s ease;
}

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

.menu-panel a {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--muted);
}

.menu-panel a:hover {
    color: white;
    background: rgba(148, 163, 184, 0.12);
}

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

.header-search input,
.mobile-search input,
.toolbar input,
.search-large input,
.quick-search input {
    border: 1px solid var(--line);
    color: white;
    background: rgba(2, 6, 23, 0.62);
    border-radius: 999px;
    outline: none;
    padding: 11px 16px;
}

.header-search input {
    width: 190px;
    transition: width 0.25s ease, border-color 0.25s ease;
}

.header-search input:focus {
    width: 250px;
    border-color: var(--cyan);
}

.header-search button,
.mobile-search button,
.search-large button,
.quick-search button {
    border: 0;
    color: white;
    padding: 11px 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    cursor: pointer;
}

.mobile-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.72);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
}

.mobile-toggle span {
    width: 20px;
    height: 2px;
    background: white;
}

.mobile-nav {
    display: none;
    padding: 0 16px 18px;
    border-top: 1px solid var(--line);
}

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

.mobile-nav a {
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--muted);
    background: rgba(15, 23, 42, 0.5);
}

.mobile-search {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

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

.hero-slides,
.hero-slide {
    position: absolute;
    inset: 0;
}

.hero-slide {
    opacity: 0;
    transform: scale(1.02);
    transition: opacity 0.65s ease, transform 1.2s ease;
}

.hero-slide.is-active {
    opacity: 1;
    transform: scale(1);
}

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

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.98), rgba(15, 23, 42, 0.75) 45%, rgba(2, 6, 23, 0.25)),
        linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0) 42%);
}

.hero-content {
    position: relative;
    z-index: 3;
    height: 100%;
    min-height: 620px;
    display: flex;
    align-items: center;
}

.hero-copy {
    max-width: 680px;
    padding-top: 40px;
}

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

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

.hero-summary,
.page-hero p,
.lead {
    color: var(--muted);
    font-size: 20px;
    line-height: 1.75;
}

.hero-meta,
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 24px 0;
}

.hero-meta span,
.detail-meta span,
.tag-row span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(15, 23, 42, 0.72);
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

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

.btn-primary,
.btn-ghost,
.btn-line {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 22px;
    border-radius: 999px;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
    color: white;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 16px 40px rgba(34, 211, 238, 0.24);
}

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

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

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

.hero-dot {
    width: 32px;
    height: 8px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
}

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

.quick-search {
    margin-top: -50px;
    position: relative;
    z-index: 8;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(280px, 520px);
    gap: 24px;
    align-items: center;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.88);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.quick-search h2,
.section-head h2,
.toolbar-title h2,
.detail-content h2 {
    margin: 0;
    font-size: clamp(26px, 4vw, 38px);
    letter-spacing: -0.04em;
}

.quick-search form,
.search-large {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.section {
    padding: 74px 0 0;
}

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

.section-more {
    color: var(--cyan);
    font-weight: 800;
}

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

.page-grid {
    padding-bottom: 74px;
}

.movie-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.82);
    box-shadow: 0 16px 46px rgba(0, 0, 0, 0.24);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
    transform: translateY(-8px);
    border-color: rgba(34, 211, 238, 0.5);
    box-shadow: 0 24px 70px rgba(34, 211, 238, 0.12);
}

.poster-link {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 20%, rgba(34, 211, 238, 0.18), transparent 40%),
        linear-gradient(135deg, #0f172a, #020617);
}

.poster-link img,
.compact-card img,
.category-tile img,
.detail-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.poster-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.92), transparent 58%);
}

.play-chip {
    position: absolute;
    left: 16px;
    bottom: 16px;
    padding: 8px 14px;
    border-radius: 999px;
    color: white;
    font-weight: 800;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s ease;
}

.movie-card:hover .play-chip {
    opacity: 1;
    transform: translateY(0);
}

.rank-badge {
    position: absolute;
    z-index: 3;
    left: 14px;
    top: 14px;
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 12px;
    color: white;
    font-weight: 900;
    background: linear-gradient(135deg, var(--orange), var(--red));
}

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

.card-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    color: var(--subtle);
    font-size: 14px;
}

.card-meta a {
    color: var(--cyan);
}

.movie-card h2 {
    margin: 0 0 10px;
    font-size: 19px;
    line-height: 1.35;
}

.movie-card p {
    display: -webkit-box;
    min-height: 48px;
    margin: 0 0 14px;
    overflow: hidden;
    color: var(--subtle);
    line-height: 1.55;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

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

.category-tile {
    position: relative;
    min-height: 240px;
    overflow: hidden;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    isolation: isolate;
}

.category-tile img {
    position: absolute;
    inset: 0;
    z-index: -2;
    opacity: 0.28;
}

.category-tile::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.95), rgba(15, 23, 42, 0.42));
}

.category-icon {
    display: grid;
    width: 56px;
    height: 56px;
    place-items: center;
    margin-bottom: 30px;
    border-radius: 18px;
    font-size: 28px;
    background: rgba(255, 255, 255, 0.12);
}

.category-tile h2,
.category-panel h2 {
    margin: 0 0 10px;
    font-size: 25px;
}

.category-tile p,
.category-panel p,
.toolbar p,
.detail-content p,
.site-footer p {
    color: var(--muted);
    line-height: 1.75;
}

.rank-layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 24px;
}

.rank-cover {
    position: relative;
    min-height: 420px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
}

.rank-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.55;
}

.rank-cover div {
    position: absolute;
    inset: auto 0 0;
    padding: 28px;
    background: linear-gradient(0deg, #020617, transparent);
}

.rank-cover h3 {
    margin: 0 0 12px;
    font-size: 36px;
}

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

.rank-list li {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.78);
}

.rank-list li span {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 12px;
    font-weight: 900;
    background: rgba(34, 211, 238, 0.16);
    color: var(--cyan);
}

.rank-list small {
    color: var(--yellow);
    font-weight: 800;
}

.page-hero {
    position: relative;
    padding: 92px 0 66px;
    border-bottom: 1px solid var(--line);
    background:
        radial-gradient(circle at 15% 0%, rgba(34, 211, 238, 0.18), transparent 30%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.88), rgba(2, 6, 23, 0.96));
}

.page-hero.compact h1 {
    max-width: 820px;
}

.page-hero.compact p {
    max-width: 780px;
}

.hero-channel-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.hero-channel-row a {
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(15, 23, 42, 0.72);
}

.toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    padding: 38px 0 26px;
}

.toolbar input {
    width: min(420px, 100%);
}

.category-panels {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    padding: 54px 0 74px;
}

.category-panel {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.76);
}

.category-panel-head {
    display: flex;
    gap: 16px;
    margin-bottom: 22px;
}

.category-panel-head > span {
    display: grid;
    width: 56px;
    height: 56px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 18px;
    font-size: 28px;
    background: rgba(34, 211, 238, 0.12);
}

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

.compact-card {
    display: grid;
    gap: 8px;
}

.compact-card img {
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 14px;
    background: var(--panel-soft);
}

.compact-card span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-weight: 750;
}

.compact-card small {
    overflow: hidden;
    color: var(--subtle);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.search-page {
    padding: 46px 0 74px;
}

.search-large {
    margin-bottom: 20px;
}

.search-status {
    margin-bottom: 28px;
    color: var(--muted);
}

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

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

.detail-backdrop {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 1), rgba(15, 23, 42, 0.76), rgba(2, 6, 23, 0.38)),
        linear-gradient(0deg, #020617, rgba(2, 6, 23, 0));
}

.detail-hero-inner {
    position: relative;
    z-index: 2;
    padding: 34px 0 70px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 34px;
    color: var(--subtle);
}

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

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

.detail-poster {
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.detail-info .lead {
    max-width: 820px;
}

.player-section {
    margin-top: -60px;
    position: relative;
    z-index: 5;
}

.player-shell {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(34, 211, 238, 0.24);
    border-radius: 28px;
    background: #000;
    box-shadow: var(--shadow);
    aspect-ratio: 16 / 9;
}

.player-shell video {
    width: 100%;
    height: 100%;
    background: #000;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    color: white;
    border: 0;
    background: radial-gradient(circle, rgba(15, 23, 42, 0.36), rgba(2, 6, 23, 0.78));
    cursor: pointer;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.play-ring {
    display: grid;
    width: 84px;
    height: 84px;
    place-items: center;
    border-radius: 50%;
    font-size: 32px;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 18px 50px rgba(34, 211, 238, 0.34);
}

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

.detail-content article,
.detail-content aside {
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.72);
}

.detail-content article h2 + p {
    margin-top: 14px;
}

.detail-content article p + h2 {
    margin-top: 32px;
}

dl {
    display: grid;
    grid-template-columns: 70px 1fr;
    gap: 12px;
    margin: 18px 0 0;
}

dt {
    color: var(--subtle);
}

dd {
    margin: 0;
    color: var(--text);
}

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

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 30px;
    padding: 44px 0;
}

.site-footer h2 {
    margin: 0 0 12px;
    font-size: 18px;
}

.site-footer a:not(.footer-brand) {
    display: block;
    margin: 8px 0;
    color: var(--muted);
}

.footer-bottom {
    padding: 18px;
    text-align: center;
    color: var(--subtle);
    border-top: 1px solid var(--line);
}

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

    .mobile-toggle {
        display: flex;
        margin-left: auto;
    }

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

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

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

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

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

    .hero,
    .hero-content {
        min-height: 560px;
    }

    .hero h1,
    .page-hero h1,
    .detail-info h1 {
        font-size: 40px;
    }

    .quick-search,
    .toolbar,
    .footer-grid,
    .detail-layout,
    .category-panels {
        grid-template-columns: 1fr;
    }

    .toolbar {
        align-items: stretch;
    }

    .quick-search form,
    .search-large,
    .mobile-search {
        grid-template-columns: 1fr;
    }

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

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

    .movie-card h2 {
        font-size: 17px;
    }

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

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

    .player-section {
        margin-top: -24px;
    }

    .player-shell {
        border-radius: 18px;
    }
}

@media (max-width: 480px) {
    .movie-grid,
    .category-grid {
        grid-template-columns: 1fr;
    }

    .hero-meta,
    .detail-meta,
    .hero-actions {
        gap: 8px;
    }
}
