* {
    box-sizing: border-box;
}

:root {
    color-scheme: dark;
    --bg: #020617;
    --panel: #0f172a;
    --panel-soft: #111827;
    --line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --accent: #f97316;
    --accent-soft: #fb923c;
    --gold: #f59e0b;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(249, 115, 22, 0.16), transparent 34rem),
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.12), transparent 30rem),
        linear-gradient(180deg, #020617 0%, #0f172a 48%, #020617 100%);
    color: var(--text);
}

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

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

button,
input {
    font: inherit;
}

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

.nav-shell {
    width: min(1180px, calc(100% - 32px));
    height: 68px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(90deg, var(--accent), var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-mark {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--gold));
    box-shadow: 0 12px 30px rgba(249, 115, 22, 0.34);
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    color: #e2e8f0;
    font-weight: 650;
}

.desktop-nav a,
.nav-dropdown > button {
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    padding: 8px 0;
    transition: color 0.2s ease;
}

.desktop-nav a:hover,
.nav-dropdown:hover > button {
    color: var(--accent-soft);
}

.nav-dropdown {
    position: relative;
}

.dropdown-panel {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    width: 210px;
    display: grid;
    gap: 2px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.98);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s ease;
}

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

.dropdown-panel a {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
}

.dropdown-panel a:hover {
    background: rgba(249, 115, 22, 0.12);
}

.header-search {
    width: min(360px, 32vw);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.7);
}

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

.header-search input::placeholder,
.mobile-panel input::placeholder,
.quick-search-panel input::placeholder,
.inline-filter input::placeholder,
.search-page-form input::placeholder {
    color: #64748b;
}

.header-search button,
.quick-search-panel button,
.search-page-form button {
    border: 0;
    border-radius: 999px;
    padding: 9px 16px;
    background: linear-gradient(135deg, var(--accent), var(--gold));
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 10px 24px rgba(249, 115, 22, 0.25);
}

.mobile-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.9);
    color: #fff;
    cursor: pointer;
}

.mobile-panel {
    display: none;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 14px 0 20px;
    border-top: 1px solid var(--line);
}

.mobile-panel.is-open {
    display: grid;
    gap: 10px;
}

.mobile-panel a {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.72);
}

.mobile-panel form {
    display: flex;
    gap: 10px;
    padding: 8px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(2, 6, 23, 0.68);
}

.mobile-panel button {
    border: 0;
    border-radius: 12px;
    padding: 8px 12px;
    background: var(--accent);
    color: #fff;
}

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

.hero-carousel {
    position: relative;
    min-height: 610px;
    margin: 26px auto 34px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 34px;
    background: #020617;
    box-shadow: var(--shadow);
}

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

.hero-slide {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.7s ease, transform 0.7s ease;
    transform: scale(1.02);
}

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

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.08) contrast(1.05);
}

.hero-layer {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.8) 38%, rgba(2, 6, 23, 0.2) 100%),
        linear-gradient(0deg, rgba(2, 6, 23, 0.84), transparent 42%);
}

.hero-content {
    position: absolute;
    left: clamp(26px, 7vw, 84px);
    bottom: clamp(76px, 12vw, 120px);
    width: min(650px, calc(100% - 52px));
}

.eyebrow,
.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--accent-soft);
    font-size: 13px;
    font-weight: 850;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero-content h1,
.page-hero h1,
.detail-info h1 {
    margin: 0;
    font-size: clamp(36px, 6vw, 74px);
    line-height: 0.98;
    letter-spacing: -0.06em;
}

.hero-content p,
.page-hero p,
.lead-text {
    max-width: 760px;
    margin: 20px 0 0;
    color: #cbd5e1;
    font-size: 18px;
    line-height: 1.8;
}

.hero-tags,
.detail-tags,
.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-tags,
.detail-tags {
    margin-top: 22px;
}

.hero-tags span,
.detail-tags span,
.tag-row span {
    border: 1px solid rgba(251, 146, 60, 0.25);
    border-radius: 999px;
    background: rgba(249, 115, 22, 0.12);
    color: #fed7aa;
}

.hero-tags span,
.detail-tags span {
    padding: 8px 12px;
}

.tag-row span {
    padding: 5px 8px;
    font-size: 12px;
}

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

.primary-btn,
.ghost-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 22px;
    border-radius: 999px;
    font-weight: 850;
}

.primary-btn {
    background: linear-gradient(135deg, var(--accent), var(--gold));
    color: #fff;
    box-shadow: 0 16px 36px rgba(249, 115, 22, 0.32);
}

.ghost-btn {
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(15, 23, 42, 0.48);
    color: #fff;
    backdrop-filter: blur(10px);
}

.hero-controls {
    position: absolute;
    left: clamp(24px, 7vw, 84px);
    bottom: 26px;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 4;
}

.hero-controls > button,
.hero-dot {
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(15, 23, 42, 0.58);
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.hero-controls > button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
}

.hero-dots {
    display: flex;
    gap: 8px;
}

.hero-dot {
    width: 12px;
    height: 12px;
    padding: 0;
    border-radius: 999px;
}

.hero-dot.is-active {
    width: 34px;
    background: linear-gradient(135deg, var(--accent), var(--gold));
    border-color: transparent;
}

.quick-search-panel,
.content-section,
.page-hero,
.detail-hero,
.player-section,
.detail-content article,
.channel-card {
    border: 1px solid var(--line);
    border-radius: 28px;
    background: rgba(15, 23, 42, 0.68);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.quick-search-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
    align-items: center;
    gap: 24px;
    padding: 26px;
    margin-bottom: 34px;
}

.quick-search-panel h2,
.section-head h2,
.page-hero h1,
.player-section h2,
.detail-content h2 {
    margin: 0;
}

.quick-search-panel form,
.search-page-form,
.inline-filter {
    display: flex;
    gap: 10px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.62);
}

.content-section {
    padding: 26px;
    margin: 34px 0;
}

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

.section-head a {
    color: var(--accent-soft);
    font-weight: 800;
}

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

.category-card,
.channel-main {
    display: block;
    min-height: 178px;
    padding: 18px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(249, 115, 22, 0.18), rgba(15, 23, 42, 0.66)),
        rgba(15, 23, 42, 0.8);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover,
.channel-main:hover,
.movie-card:hover,
.ranking-item:hover {
    transform: translateY(-4px);
    border-color: rgba(251, 146, 60, 0.42);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.category-card span,
.channel-card h2 {
    display: block;
    font-size: 22px;
    font-weight: 900;
}

.category-card p,
.channel-main p {
    color: var(--muted);
    line-height: 1.7;
}

.category-covers {
    display: flex;
    margin-top: 18px;
}

.category-covers img {
    width: 54px;
    height: 72px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

.category-covers img + img {
    margin-left: -18px;
}

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

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

.movie-card {
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.84);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card-cover {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #111827;
}

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

.movie-card:hover .card-cover img {
    transform: scale(1.06);
}

.card-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.82), transparent 48%);
    opacity: 0.9;
}

.card-play {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 2;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(249, 115, 22, 0.88);
    color: #fff;
    font-size: 13px;
    font-weight: 850;
}

.rank-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--gold));
    color: #fff;
}

.card-body {
    padding: 16px;
}

.card-meta {
    color: var(--accent-soft);
    font-size: 12px;
    font-weight: 800;
}

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

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

.split-section {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 28px;
}

.ranking-list {
    display: grid;
    gap: 14px;
}

.ranking-item {
    display: grid;
    grid-template-columns: 76px 44px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.44);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.ranking-cover {
    display: block;
    overflow: hidden;
    border-radius: 14px;
    aspect-ratio: 3 / 4;
}

.ranking-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ranking-number {
    font-size: 28px;
    font-weight: 950;
    color: var(--accent-soft);
    text-align: center;
}

.ranking-info h3 {
    margin: 0 0 6px;
    font-size: 18px;
}

.ranking-info p {
    margin: 0 0 8px;
    color: var(--muted);
    line-height: 1.55;
}

.ranking-info span {
    color: #cbd5e1;
    font-size: 13px;
}

.rail-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(210px, 1fr);
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-snap-type: x proximity;
}

.rail-row .movie-card {
    scroll-snap-align: start;
}

.page-main {
    padding: 28px 0 44px;
}

.page-hero {
    margin-bottom: 26px;
    padding: clamp(28px, 5vw, 48px);
}

.slim-hero {
    background:
        radial-gradient(circle at top right, rgba(249, 115, 22, 0.18), transparent 24rem),
        rgba(15, 23, 42, 0.72);
}

.category-hero {
    background:
        linear-gradient(135deg, rgba(249, 115, 22, 0.18), transparent 44%),
        rgba(15, 23, 42, 0.72);
}

.inline-filter {
    width: min(520px, 100%);
    margin-top: 26px;
}

.empty-state {
    display: none;
    margin: 26px 0;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 18px;
    color: var(--muted);
    background: rgba(15, 23, 42, 0.72);
    text-align: center;
}

.empty-state.is-visible {
    display: block;
}

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

.channel-card {
    padding: 0;
    overflow: hidden;
}

.channel-main {
    border: 0;
    border-radius: 28px 28px 0 0;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.14), rgba(15, 23, 42, 0.8));
}

.channel-links {
    display: grid;
    gap: 8px;
    padding: 16px;
}

.channel-links a {
    padding: 9px 10px;
    border-radius: 12px;
    color: #cbd5e1;
    background: rgba(2, 6, 23, 0.36);
}

.channel-links a:hover {
    color: var(--accent-soft);
}

.full-ranking {
    gap: 16px;
}

.search-page-form {
    width: min(720px, 100%);
    margin-top: 24px;
}

.detail-main {
    padding: 28px 0 44px;
}

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

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

.detail-hero {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 30px;
    padding: 28px;
    margin-bottom: 28px;
}

.poster-panel {
    overflow: hidden;
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.poster-panel img {
    width: 100%;
    height: 100%;
    min-height: 430px;
    object-fit: cover;
}

.detail-info {
    align-self: center;
}

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

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

.detail-meta-grid div {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(2, 6, 23, 0.38);
}

.detail-meta-grid strong,
.detail-meta-grid span {
    display: block;
}

.detail-meta-grid strong {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
}

.detail-meta-grid span {
    color: #fff;
    font-weight: 800;
}

.player-section {
    padding: 24px;
    margin-bottom: 28px;
}

.movie-player {
    position: relative;
    margin-top: 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    background: #000;
    aspect-ratio: 16 / 9;
}

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

.player-start {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    border: 0;
    border-radius: 999px;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--accent), var(--gold));
    color: #fff;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 18px 42px rgba(249, 115, 22, 0.42);
}

.player-start.is-hidden {
    display: none;
}

.play-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}

.detail-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    margin-bottom: 28px;
}

.detail-content article {
    padding: 24px;
}

.detail-content p {
    color: #cbd5e1;
    line-height: 1.9;
}

.related-section {
    margin-top: 0;
}

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

.footer-inner {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 30px 0;
    display: flex;
    justify-content: space-between;
    gap: 26px;
    color: var(--muted);
}

.footer-inner strong {
    color: #fff;
    font-size: 20px;
}

.footer-inner p {
    max-width: 640px;
    line-height: 1.7;
}

.footer-inner nav {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-content: start;
}

.footer-inner a:hover {
    color: var(--accent-soft);
}

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

    .mobile-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .header-search {
        width: min(420px, 45vw);
    }

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

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

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

@media (max-width: 820px) {
    .nav-shell {
        height: auto;
        min-height: 66px;
        padding: 10px 0;
    }

    .brand {
        font-size: 20px;
    }

    .header-search {
        display: none;
    }

    .hero-carousel {
        min-height: 540px;
        border-radius: 24px;
    }

    .hero-layer {
        background: linear-gradient(0deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.3));
    }

    .hero-content {
        left: 22px;
        bottom: 82px;
        width: calc(100% - 44px);
    }

    .hero-content h1,
    .page-hero h1 {
        font-size: 38px;
    }

    .quick-search-panel {
        grid-template-columns: 1fr;
        padding: 20px;
    }

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

    .detail-hero {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .poster-panel img {
        min-height: auto;
        max-height: 520px;
    }

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

    .footer-inner {
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    main,
    .page-main,
    .detail-main,
    .nav-shell,
    .mobile-panel,
    .footer-inner {
        width: min(100% - 22px, 1180px);
    }

    .hero-carousel {
        min-height: 500px;
        margin-top: 14px;
    }

    .hero-content p,
    .page-hero p,
    .lead-text {
        font-size: 15px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-controls {
        left: 22px;
        bottom: 20px;
    }

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

    .content-section,
    .player-section,
    .page-hero {
        padding: 18px;
        border-radius: 22px;
    }

    .ranking-item {
        grid-template-columns: 64px 36px minmax(0, 1fr);
        gap: 10px;
    }

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

    .quick-search-panel form,
    .search-page-form {
        border-radius: 20px;
        flex-direction: column;
    }

    .quick-search-panel button,
    .search-page-form button {
        width: 100%;
    }
}
