:root {
    color-scheme: dark;
    --bg: #020617;
    --bg-soft: #0f172a;
    --bg-card: rgba(15, 23, 42, 0.82);
    --bg-card-strong: rgba(15, 23, 42, 0.96);
    --line: rgba(148, 163, 184, 0.18);
    --text: #e5eefb;
    --muted: #94a3b8;
    --cyan: #22d3ee;
    --blue: #3b82f6;
    --amber: #f59e0b;
    --green: #34d399;
    --danger: #fb7185;
    --shadow: 0 24px 70px rgba(2, 8, 23, 0.48);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

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

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

button,
input {
    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: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.94), rgba(15, 23, 42, 0.96));
    border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 40px rgba(2, 8, 23, 0.32);
    backdrop-filter: blur(18px);
}

.nav-wrap {
    width: min(1180px, calc(100% - 32px));
    min-height: 68px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 18px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

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

.nav-search {
    flex: 1;
    display: flex;
    align-items: center;
    max-width: 430px;
    margin-left: auto;
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid var(--line);
    border-radius: 999px;
    overflow: hidden;
}

.nav-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    padding: 11px 16px;
    color: var(--text);
    background: transparent;
}

.nav-search button {
    border: 0;
    padding: 11px 18px;
    color: white;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    font-weight: 700;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.main-nav a,
.category-strip a,
.footer-links a,
.quick-links a {
    color: #cbd5e1;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.main-nav a {
    padding: 9px 10px;
    border-radius: 999px;
}

.main-nav a:hover,
.category-strip a:hover,
.footer-links a:hover,
.quick-links a:hover {
    color: white;
    background: rgba(34, 211, 238, 0.12);
}

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

.category-strip {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 0 0 12px;
    scrollbar-width: thin;
}

.category-strip a {
    flex: 0 0 auto;
    padding: 7px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    font-size: 14px;
}

.search-panel {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 90px 16px 24px;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(12px);
}

.search-panel.open {
    display: flex;
}

.search-panel-inner {
    width: min(760px, 100%);
    max-height: min(720px, calc(100vh - 120px));
    overflow: hidden;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.search-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
}

.search-panel-head button {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    color: white;
    background: rgba(148, 163, 184, 0.15);
    font-size: 24px;
    line-height: 1;
}

.search-results {
    max-height: calc(100vh - 220px);
    overflow: auto;
    padding: 12px;
}

.search-result {
    display: grid;
    grid-template-columns: 74px 1fr;
    gap: 14px;
    padding: 10px;
    border-radius: 18px;
    border: 1px solid transparent;
}

.search-result:hover {
    border-color: rgba(34, 211, 238, 0.28);
    background: rgba(34, 211, 238, 0.08);
}

.search-result img {
    width: 74px;
    height: 98px;
    object-fit: cover;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.8);
}

.search-result strong {
    display: block;
    margin-bottom: 5px;
}

.search-result p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.hero {
    position: relative;
    min-height: 640px;
    overflow: hidden;
    isolation: isolate;
}

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

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

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.12) contrast(1.06);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.92) 0%, rgba(15, 23, 42, 0.76) 42%, rgba(15, 23, 42, 0.28) 100%),
        linear-gradient(180deg, rgba(2, 6, 23, 0.05) 0%, rgba(2, 6, 23, 0.92) 100%);
}

.hero-content {
    position: absolute;
    inset: 0;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 72px 0 110px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--cyan);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 800;
    font-size: 13px;
}

.hero h1 {
    width: min(780px, 100%);
    margin: 0;
    font-size: clamp(42px, 7vw, 88px);
    line-height: 0.98;
    font-weight: 950;
    letter-spacing: -0.055em;
    text-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

.hero-text {
    width: min(680px, 100%);
    margin: 24px 0 0;
    color: #dbeafe;
    font-size: clamp(16px, 1.9vw, 21px);
    line-height: 1.8;
}

.hero-tags,
.card-tags,
.channel-mini {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag,
.card-tags a,
.channel-mini span {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(34, 211, 238, 0.22);
    border-radius: 999px;
    padding: 6px 10px;
    color: #cffafe;
    background: rgba(8, 145, 178, 0.12);
    font-size: 13px;
}

.hero-tags {
    margin-top: 20px;
}

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

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

.btn:hover {
    transform: translateY(-2px);
}

.btn.primary {
    color: #04131d;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 18px 40px rgba(34, 211, 238, 0.26);
}

.btn.ghost {
    color: white;
    border: 1px solid rgba(226, 232, 240, 0.22);
    background: rgba(15, 23, 42, 0.66);
}

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

.hero-dot {
    width: 34px;
    height: 8px;
    border: 0;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.28);
}

.hero-dot.active {
    background: linear-gradient(90deg, var(--cyan), var(--blue));
}

.glass-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-card);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.search-block {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
    margin-top: -56px;
    padding: 28px;
}

.search-block h2,
.section-head h2,
.page-hero h1,
.detail-info h1,
.detail-content h2 {
    margin: 0;
    font-weight: 900;
    letter-spacing: -0.035em;
}

.search-block h2 {
    font-size: clamp(24px, 3vw, 36px);
}

.search-block p,
.page-hero p,
.detail-content p,
.channel-card p,
.site-footer p {
    color: var(--muted);
    line-height: 1.8;
}

.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.quick-links a {
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
}

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

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

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

.text-link {
    color: var(--cyan);
    font-weight: 800;
}

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

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

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(34, 211, 238, 0.38);
    box-shadow: 0 26px 60px rgba(8, 145, 178, 0.18);
}

.poster {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.1), rgba(59, 130, 246, 0.12));
}

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

.movie-card:hover .poster img,
.category-card:hover img,
.channel-card:hover img {
    transform: scale(1.06);
}

.poster::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 42%, rgba(2, 6, 23, 0.8) 100%);
}

.poster-play {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 2;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #04131d;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
}

.rank-badge {
    position: absolute;
    left: 12px;
    top: 12px;
    z-index: 2;
    min-width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
    color: #111827;
    background: linear-gradient(135deg, #fbbf24, #f97316);
    font-weight: 900;
}

.card-body {
    padding: 16px;
}

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

.card-body h2 {
    margin: 9px 0 8px;
    font-size: 18px;
    line-height: 1.35;
    font-weight: 850;
}

.card-body h2 a:hover {
    color: var(--cyan);
}

.card-body p {
    min-height: 48px;
    margin: 0 0 14px;
    color: var(--muted);
    line-height: 1.65;
    font-size: 14px;
}

.compact-card .card-body p {
    min-height: 0;
}

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

.category-card {
    position: relative;
    min-height: 210px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    isolation: isolate;
    background: rgba(15, 23, 42, 0.78);
}

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

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

.category-card span {
    width: max-content;
    margin-bottom: 8px;
    padding: 5px 10px;
    border-radius: 999px;
    color: #cffafe;
    background: rgba(8, 145, 178, 0.28);
    font-size: 13px;
}

.category-card strong {
    font-size: 21px;
}

.category-card em {
    margin-top: 6px;
    color: #cbd5e1;
    font-style: normal;
    font-size: 13px;
    line-height: 1.6;
}

.split-section {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 28px;
    align-items: start;
}

.compact-head {
    margin-bottom: 16px;
}

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

.rank-row {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) minmax(160px, 0.75fr);
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.68);
}

.rank-row:hover {
    border-color: rgba(34, 211, 238, 0.32);
    background: rgba(34, 211, 238, 0.08);
}

.rank-num {
    color: var(--amber);
    font-weight: 900;
}

.rank-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
}

.rank-info {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

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

.page-main {
    padding: 42px 0 74px;
}

.page-hero {
    margin-bottom: 28px;
    padding: clamp(24px, 4vw, 44px);
}

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

.page-hero p {
    max-width: 820px;
    margin: 12px 0 0;
}

.page-filter {
    margin-top: 22px;
}

.page-filter input {
    width: min(620px, 100%);
    border: 1px solid var(--line);
    outline: 0;
    border-radius: 999px;
    padding: 14px 18px;
    color: var(--text);
    background: rgba(2, 6, 23, 0.48);
}

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

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

.channel-card {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 18px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.78);
}

.channel-cover {
    position: relative;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.5);
}

.channel-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.channel-cover span {
    position: absolute;
    left: 10px;
    top: 10px;
    border-radius: 999px;
    padding: 5px 9px;
    color: #cffafe;
    background: rgba(8, 145, 178, 0.72);
    font-size: 13px;
}

.channel-card h2 {
    margin: 4px 0 10px;
    font-size: 24px;
}

.full-rank-list {
    margin-top: 24px;
}

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

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

.detail-hero {
    display: grid;
    grid-template-columns: minmax(240px, 330px) minmax(0, 1fr);
    gap: 24px;
    align-items: stretch;
}

.detail-poster {
    overflow: hidden;
    padding: 12px;
}

.detail-poster img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 18px;
}

.detail-info {
    padding: clamp(24px, 4vw, 42px);
}

.detail-info h1 {
    font-size: clamp(34px, 5vw, 64px);
    line-height: 1.05;
}

.detail-one-line {
    margin: 18px 0 0;
    color: #dbeafe;
    font-size: 18px;
    line-height: 1.8;
}

.detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 24px 0;
}

.detail-meta-grid span {
    display: grid;
    gap: 5px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    color: #dbeafe;
    background: rgba(2, 6, 23, 0.26);
}

.detail-meta-grid b {
    color: var(--muted);
    font-size: 12px;
}

.player-section {
    margin-top: 26px;
    padding: 14px;
}

.player-box {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    aspect-ratio: 16 / 9;
    background: #000;
}

.player-box video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
    justify-content: center;
    padding: 18px;
    text-align: center;
    background:
        radial-gradient(circle, rgba(34, 211, 238, 0.18), transparent 28rem),
        rgba(2, 6, 23, 0.52);
}

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

.big-play {
    width: clamp(72px, 9vw, 98px);
    height: clamp(72px, 9vw, 98px);
    border: 0;
    border-radius: 50%;
    color: #06111f;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 20px 55px rgba(34, 211, 238, 0.34);
    font-size: 34px;
}

.player-overlay strong {
    max-width: 80%;
    font-size: clamp(20px, 3vw, 34px);
    text-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.player-message {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    padding: 9px 12px;
    border-radius: 999px;
    color: white;
    background: rgba(244, 63, 94, 0.82);
}

.detail-content {
    margin-top: 26px;
    padding: clamp(22px, 3vw, 34px);
}

.detail-content h2 {
    margin-top: 0;
    font-size: 26px;
}

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

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

.detail-content p {
    margin-bottom: 0;
    font-size: 16px;
}

.site-footer {
    margin-top: 54px;
    padding: 42px 0 28px;
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.42), rgba(2, 6, 23, 0.92));
}

.footer-grid {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

.footer-brand {
    margin-bottom: 10px;
    font-size: 24px;
    font-weight: 900;
}

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

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-links a {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
}

.copyright {
    width: min(1180px, calc(100% - 32px));
    margin: 26px auto 0;
    color: var(--muted);
    font-size: 14px;
}

.hidden-by-filter {
    display: none !important;
}

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

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

    .split-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .nav-wrap {
        flex-wrap: wrap;
        min-height: auto;
        padding: 12px 0;
    }

    .brand {
        flex: 1;
    }

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

    .nav-search {
        order: 3;
        flex-basis: 100%;
        max-width: none;
    }

    .main-nav {
        display: none;
        width: 100%;
        order: 4;
        padding-top: 10px;
    }

    .site-header.menu-open .main-nav {
        display: flex;
    }

    .category-strip {
        display: none;
        flex-wrap: wrap;
        overflow: visible;
        padding-top: 4px;
    }

    .site-header.menu-open .category-strip {
        display: flex;
    }

    .hero {
        min-height: 600px;
    }

    .hero-content {
        justify-content: flex-end;
        padding-bottom: 92px;
    }

    .search-block,
    .footer-grid,
    .detail-hero,
    .channel-grid {
        grid-template-columns: 1fr;
    }

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

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

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

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

    .rank-info {
        grid-column: 2;
    }

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

@media (max-width: 540px) {
    .container,
    .nav-wrap,
    .category-strip,
    .footer-grid,
    .copyright {
        width: min(100% - 24px, 1180px);
    }

    .hero {
        min-height: 560px;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
    }

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

    .channel-card {
        grid-template-columns: 112px 1fr;
    }

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