:root {
    --bg: #020617;
    --panel: rgba(15, 23, 42, 0.82);
    --panel-strong: rgba(15, 23, 42, 0.96);
    --line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --cyan: #22d3ee;
    --blue: #2563eb;
    --shadow: 0 24px 80px rgba(8, 47, 73, 0.35);
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at 20% 0%, rgba(34, 211, 238, 0.18), transparent 26rem),
        radial-gradient(circle at 85% 12%, rgba(37, 99, 235, 0.2), transparent 28rem),
        linear-gradient(180deg, #020617 0%, #0f172a 46%, #020617 100%);
    color: var(--text);
}

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

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

button,
input {
    font: inherit;
}

.page-shell {
    min-height: 100vh;
    overflow-x: hidden;
}

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

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

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

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

.brand-text,
.footer-brand {
    font-size: 24px;
    background: linear-gradient(90deg, var(--cyan), #60a5fa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    color: var(--soft);
    font-size: 15px;
    font-weight: 700;
}

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

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

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

.header-search input,
.mobile-search input,
.search-page-form input {
    width: 100%;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
}

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

.header-search button,
.mobile-search button,
.search-page-form button {
    border: 0;
    color: #ffffff;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    cursor: pointer;
    font-weight: 800;
}

.header-search button {
    padding: 11px 18px;
}

.mobile-toggle {
    display: none;
    margin-left: auto;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.8);
    cursor: pointer;
}

.mobile-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    border-radius: 99px;
    background: var(--text);
}

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

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

.mobile-panel nav {
    display: grid;
    gap: 12px;
    margin-top: 16px;
    color: var(--soft);
    font-weight: 700;
}

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

.mobile-search input,
.search-page-form input {
    padding: 13px 16px;
}

.mobile-search button,
.search-page-form button {
    padding: 13px 18px;
}

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

.hero-stage {
    position: relative;
    height: 70vh;
    min-height: 540px;
    overflow: hidden;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 900ms 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-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.92) 0%, rgba(2, 6, 23, 0.72) 42%, rgba(2, 6, 23, 0.18) 100%),
        linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.36) 48%, rgba(2, 6, 23, 0.52) 100%);
}

.hero-content {
    position: absolute;
    left: max(24px, calc((100vw - 1240px) / 2 + 24px));
    bottom: 84px;
    width: min(650px, calc(100vw - 48px));
    padding: 28px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 28px;
    background: rgba(15, 23, 42, 0.56);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.hero-kicker,
.detail-kicker,
.meta-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--muted);
}

.hero-kicker span:first-child,
.detail-kicker span:first-child {
    border: 1px solid rgba(34, 211, 238, 0.45);
    border-radius: 999px;
    padding: 6px 12px;
    color: var(--cyan);
    background: rgba(34, 211, 238, 0.12);
    font-weight: 800;
}

.hero h1 {
    margin: 18px 0 16px;
    font-size: clamp(38px, 7vw, 68px);
    line-height: 0.98;
    letter-spacing: -0.06em;
}

.hero p {
    margin: 0 0 22px;
    color: var(--soft);
    font-size: 18px;
    line-height: 1.7;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
    color: var(--muted);
}

.hero-meta span {
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--line);
}

.primary-button,
.side-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 24px;
    border-radius: 14px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 18px 45px rgba(37, 99, 235, 0.28);
    font-weight: 900;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-button:hover,
.side-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 56px rgba(34, 211, 238, 0.32);
}

.hero-arrow {
    position: absolute;
    top: 50%;
    width: 48px;
    height: 48px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: #ffffff;
    background: rgba(2, 6, 23, 0.6);
    backdrop-filter: blur(12px);
    cursor: pointer;
    font-size: 38px;
    line-height: 1;
}

.hero-prev {
    left: 24px;
}

.hero-next {
    right: 24px;
}

.hero-dots {
    position: absolute;
    right: max(24px, calc((100vw - 1240px) / 2 + 24px));
    bottom: 36px;
    display: flex;
    gap: 8px;
}

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

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

main {
    max-width: 1240px;
    margin: 0 auto;
    padding: 42px 24px 70px;
}

.content-section {
    margin-top: 54px;
}

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

.section-heading h2,
.page-hero h1,
.detail-text h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.05;
    letter-spacing: -0.05em;
}

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

.section-kicker {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--cyan);
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 900;
}

.compact-heading {
    margin-bottom: 18px;
}

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

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

.movie-card {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 24px;
    overflow: hidden;
    background: var(--panel);
    box-shadow: 0 18px 60px rgba(2, 6, 23, 0.32);
    transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(34, 211, 238, 0.42);
    box-shadow: 0 26px 76px rgba(8, 47, 73, 0.36);
}

.poster-wrap {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.82);
}

.featured-grid .poster-wrap {
    aspect-ratio: 16 / 10;
}

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

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

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

.play-dot,
.big-play {
    position: absolute;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 16px 46px rgba(34, 211, 238, 0.28);
}

.play-dot {
    right: 14px;
    bottom: 14px;
    width: 42px;
    height: 42px;
}

.rank-badge {
    position: absolute;
    left: 12px;
    top: 12px;
    z-index: 2;
    min-width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #ffffff;
    background: rgba(2, 6, 23, 0.78);
    border: 1px solid var(--line);
    font-weight: 900;
}

.card-body {
    padding: 16px;
}

.meta-line {
    justify-content: space-between;
    margin-bottom: 9px;
    font-size: 12px;
}

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

.movie-card h3 a:hover {
    color: var(--cyan);
}

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

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

.tag-row span {
    padding: 5px 9px;
    border-radius: 999px;
    color: var(--cyan);
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.2);
    font-size: 12px;
    font-weight: 800;
}

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

.ranking-panel {
    position: sticky;
    top: 96px;
    border: 1px solid var(--line);
    border-radius: 26px;
    padding: 22px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

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

.rank-row {
    display: grid;
    grid-template-columns: 34px 56px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.62);
    border: 1px solid transparent;
    transition: border-color 0.2s ease, background 0.2s ease;
}

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

.rank-row img {
    width: 56px;
    height: 76px;
    object-fit: cover;
    border-radius: 12px;
}

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

.rank-row strong,
.rank-row em {
    display: block;
}

.rank-row strong {
    line-height: 1.35;
}

.rank-row em {
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

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

.category-card,
.channel-card {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.58));
    box-shadow: 0 16px 52px rgba(2, 6, 23, 0.28);
}

.category-card {
    padding: 20px;
}

.category-title {
    display: inline-block;
    color: var(--text);
    font-size: 20px;
    font-weight: 900;
}

.category-title:hover,
.channel-card h2 a:hover {
    color: var(--cyan);
}

.category-card p,
.channel-card p,
.page-hero p {
    color: var(--muted);
    line-height: 1.75;
}

.category-mini,
.channel-links {
    display: grid;
    gap: 8px;
    margin-top: 16px;
}

.category-mini a,
.channel-links a {
    color: var(--soft);
    font-size: 14px;
}

.category-mini a:hover,
.channel-links a:hover {
    color: var(--cyan);
}

.page-hero {
    position: relative;
    overflow: hidden;
    padding: 64px;
    border: 1px solid var(--line);
    border-radius: 34px;
    background:
        radial-gradient(circle at 85% 0%, rgba(34, 211, 238, 0.2), transparent 22rem),
        linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.64));
    box-shadow: var(--shadow);
}

.page-hero p {
    max-width: 720px;
    margin: 18px 0 0;
    font-size: 17px;
}

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

.channel-card {
    overflow: hidden;
    display: grid;
    grid-template-columns: 220px 1fr;
}

.poster-collage {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    background: rgba(15, 23, 42, 0.8);
}

.poster-collage img {
    width: 100%;
    height: 135px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.channel-content {
    padding: 24px;
}

.channel-content h2 {
    margin: 0 0 10px;
}

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

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 8px 0 24px;
    color: var(--muted);
}

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

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

.player-card {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 30px;
    background: #000000;
    box-shadow: var(--shadow);
}

.player-card video,
.player-cover,
.player-cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.player-card video {
    object-fit: contain;
}

.player-cover {
    border: 0;
    padding: 0;
    cursor: pointer;
    background: #000000;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.player-cover img {
    object-fit: cover;
    opacity: 0.56;
    filter: saturate(1.08);
}

.big-play {
    left: 50%;
    top: 50%;
    width: 84px;
    height: 84px;
    transform: translate(-50%, -50%);
    font-size: 30px;
}

.detail-text {
    margin-top: 26px;
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: var(--panel);
}

.detail-text h1 {
    margin-top: 16px;
}

.lead-text {
    margin: 18px 0;
    color: var(--soft);
    font-size: 18px;
    line-height: 1.8;
}

.detail-text h2 {
    margin: 30px 0 12px;
    font-size: 24px;
}

.detail-text p {
    color: var(--soft);
    line-height: 1.9;
}

.detail-tags {
    margin: 18px 0 2px;
}

.detail-side {
    position: sticky;
    top: 96px;
    display: grid;
    gap: 18px;
}

.side-poster {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: var(--panel);
}

.side-poster img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.info-list {
    list-style: none;
    margin: 0;
    padding: 18px;
    display: grid;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--panel);
}

.info-list li {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    color: var(--muted);
}

.info-list strong {
    color: var(--text);
    text-align: right;
}

.related-section {
    margin-top: 44px;
}

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

.search-page-form {
    max-width: 640px;
    margin-top: 24px;
}

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

.footer-inner {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 34px 24px;
}

.footer-inner p {
    max-width: 680px;
    margin: 12px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.footer-links {
    display: flex;
    gap: 18px;
    color: var(--soft);
    font-weight: 800;
}

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

    .mobile-toggle {
        display: block;
    }

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

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

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

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

    .ranking-panel,
    .detail-side {
        position: static;
    }

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

@media (max-width: 780px) {
    .header-inner {
        height: 64px;
        padding: 0 16px;
    }

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

    .hero-stage {
        height: 74vh;
        min-height: 560px;
    }

    .hero-content {
        left: 16px;
        right: 16px;
        bottom: 64px;
        width: auto;
        padding: 22px;
        border-radius: 22px;
    }

    .hero p {
        font-size: 16px;
    }

    .hero-arrow {
        display: none;
    }

    .hero-dots {
        right: 16px;
        bottom: 24px;
    }

    main {
        padding: 30px 16px 50px;
    }

    .page-hero {
        padding: 36px 24px;
        border-radius: 26px;
    }

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

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

    .poster-collage img {
        height: 120px;
    }

    .footer-inner {
        display: grid;
    }

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

    .detail-text {
        padding: 22px;
    }
}

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

    .movie-card.compact {
        display: grid;
        grid-template-columns: 120px 1fr;
    }

    .movie-card.compact .poster-wrap {
        aspect-ratio: 2 / 3;
        height: 100%;
    }

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

    .movie-card.compact p {
        -webkit-line-clamp: 3;
    }
}
