:root {
    color-scheme: dark;
    --bg: #020617;
    --panel: rgba(15, 23, 42, 0.78);
    --panel-strong: rgba(15, 23, 42, 0.94);
    --border: rgba(148, 163, 184, 0.16);
    --text: #f8fafc;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --cyan: #22d3ee;
    --blue: #3b82f6;
    --violet: #8b5cf6;
    --red: #ef4444;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    background:
        radial-gradient(circle at 18% 8%, rgba(34, 211, 238, 0.18), transparent 28rem),
        radial-gradient(circle at 84% 18%, rgba(139, 92, 246, 0.18), transparent 32rem),
        linear-gradient(180deg, #020617 0%, #0f172a 45%, #020617 100%);
    color: var(--text);
    min-height: 100vh;
}

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

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

button,
input {
    font: inherit;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.78));
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
}

.nav-wrap {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    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.02em;
}

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

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

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    color: var(--soft);
    font-size: 14px;
}

.desktop-nav a,
.mobile-nav a,
.footer-links a,
.section-link {
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

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

.menu-toggle {
    display: none;
    border: 1px solid var(--border);
    color: var(--text);
    background: rgba(15, 23, 42, 0.8);
    border-radius: 12px;
    padding: 8px 12px;
}

.mobile-nav {
    display: none;
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 0 0 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.mobile-nav a {
    padding: 11px 14px;
    border-radius: 12px;
    background: rgba(30, 41, 59, 0.72);
    color: var(--soft);
}

.mobile-nav.open {
    display: grid;
}

.hero {
    position: relative;
    min-height: 78vh;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}

.hero-stage,
.hero-slide,
.hero-bg,
.hero-overlay {
    position: absolute;
    inset: 0;
}

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

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

.hero-bg img,
.detail-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.1) contrast(1.08);
}

.hero-overlay {
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.72) 45%, rgba(2, 6, 23, 0.3) 100%),
        linear-gradient(180deg, rgba(2, 6, 23, 0.35), #020617 96%);
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(1240px, calc(100% - 32px));
    min-height: 78vh;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.45fr);
    align-items: center;
    gap: 44px;
    padding: 72px 0 96px;
}

.eyebrow {
    color: var(--cyan);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 0 0 14px;
}

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

.hero-summary,
.page-hero p,
.detail-line,
.intro-copy p {
    color: var(--soft);
    font-size: clamp(16px, 2vw, 20px);
    line-height: 1.75;
    max-width: 760px;
}

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

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

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

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

.primary-btn:hover,
.ghost-btn:hover,
.movie-card:hover,
.category-card:hover {
    transform: translateY(-3px);
}

.hero-poster {
    position: relative;
    border-radius: 28px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(34, 211, 238, 0.28);
    box-shadow: var(--shadow);
}

.hero-poster img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.hero-poster span {
    position: absolute;
    left: 16px;
    bottom: 16px;
    right: 16px;
    text-align: center;
    padding: 12px;
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.76);
    backdrop-filter: blur(12px);
    color: var(--text);
    font-weight: 700;
}

.hero-controls {
    position: absolute;
    left: 50%;
    bottom: 32px;
    z-index: 5;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 14px;
}

.hero-prev,
.hero-next,
.hero-dot {
    border: 1px solid var(--border);
    color: var(--text);
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(12px);
}

.hero-prev,
.hero-next {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 26px;
    line-height: 1;
}

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

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

.hero-dot.active {
    width: 28px;
    background: var(--cyan);
    border-color: var(--cyan);
}

.content-section,
.page-hero,
.detail-wrap {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
}

.content-section {
    padding: 54px 0;
}

.intro-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
    gap: 28px;
    align-items: center;
}

.intro-copy h1 {
    margin: 0 0 14px;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.14;
}

.quick-search,
.search-panel {
    display: flex;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.76);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.quick-search input,
.search-panel input {
    width: 100%;
    border: 0;
    outline: 0;
    border-radius: 16px;
    padding: 0 14px;
    min-height: 48px;
    color: var(--text);
    background: rgba(30, 41, 59, 0.82);
}

.quick-search button,
.search-panel button {
    border: 0;
    border-radius: 16px;
    padding: 0 20px;
    color: #00111a;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    font-weight: 800;
}

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

.section-head h2 {
    margin: 0 0 8px;
    font-size: clamp(24px, 3vw, 36px);
    letter-spacing: -0.03em;
}

.section-head p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.section-link {
    color: var(--cyan);
    font-weight: 800;
    flex: 0 0 auto;
}

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

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

.category-card,
.movie-card,
.player-card,
.detail-copy article {
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.88), rgba(15, 23, 42, 0.58));
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
    transition: transform 0.24s ease, border-color 0.24s ease, background 0.24s ease;
}

.category-card {
    padding: 16px;
}

.category-card:hover,
.movie-card:hover {
    border-color: rgba(34, 211, 238, 0.42);
}

.category-covers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 14px;
}

.category-covers img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 12px;
    background: rgba(30, 41, 59, 0.72);
}

.category-card h2 {
    margin: 0 0 8px;
    font-size: 20px;
}

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

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

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

.movie-card {
    position: relative;
}

.poster {
    display: block;
    position: relative;
    overflow: hidden;
    background: rgba(30, 41, 59, 0.72);
}

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

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

.play-dot,
.rank-num {
    position: absolute;
    display: grid;
    place-items: center;
    border-radius: 999px;
    backdrop-filter: blur(10px);
}

.play-dot {
    left: 50%;
    top: 50%;
    width: 48px;
    height: 48px;
    transform: translate(-50%, -50%);
    color: white;
    background: rgba(2, 6, 23, 0.66);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.movie-card:hover .play-dot {
    opacity: 1;
}

.rank-num {
    left: 12px;
    top: 12px;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    color: #03121c;
    background: linear-gradient(135deg, #fde047, #22d3ee);
    font-weight: 900;
}

.card-body {
    padding: 14px;
}

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

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

.card-meta,
.card-text {
    margin: 0 0 10px;
    color: var(--muted);
    line-height: 1.55;
    font-size: 13px;
}

.card-text {
    color: var(--soft);
}

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

.tag-row span {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 0 9px;
    border-radius: 999px;
    color: #a5f3fc;
    background: rgba(8, 145, 178, 0.16);
    border: 1px solid rgba(34, 211, 238, 0.2);
    font-size: 12px;
}

.page-main {
    padding-top: 24px;
}

.page-hero {
    position: relative;
    padding: 72px 0 44px;
}

.page-hero.slim h1 {
    max-width: 920px;
}

.small-actions {
    margin-top: 22px;
}

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

.movie-card.horizontal {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
}

.movie-card.horizontal .poster img {
    aspect-ratio: 16 / 10;
    height: 100%;
}

.search-panel {
    margin-top: 26px;
    max-width: 760px;
}

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

.detail-hero {
    position: relative;
    min-height: 620px;
    overflow: hidden;
    margin-top: -24px;
}

.detail-bg,
.detail-overlay {
    position: absolute;
    inset: 0;
}

.detail-overlay {
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.97), rgba(2, 6, 23, 0.72), rgba(2, 6, 23, 0.42)),
        linear-gradient(180deg, rgba(2, 6, 23, 0.24), #020617 96%);
}

.detail-wrap {
    position: relative;
    z-index: 2;
    min-height: 620px;
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 44px;
    align-items: center;
    padding: 64px 0;
}

.detail-poster {
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(34, 211, 238, 0.28);
    box-shadow: var(--shadow);
}

.detail-poster img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

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

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

.detail-line {
    margin: 18px 0;
}

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

.detail-meta div {
    padding: 14px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.66);
    border: 1px solid var(--border);
}

.detail-meta dt {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 5px;
}

.detail-meta dd {
    margin: 0;
    color: var(--text);
    font-weight: 700;
}

.player-section {
    padding-top: 18px;
}

.player-card {
    padding: 16px;
}

.player-frame {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    background: #000;
}

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

.player-cover {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 14px;
    border: 0;
    color: white;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.2), rgba(2, 6, 23, 0.82));
    cursor: pointer;
    z-index: 3;
}

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

.play-icon {
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #00111a;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 18px 44px rgba(34, 211, 238, 0.26);
    font-size: 28px;
}

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

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

.detail-copy h2 {
    margin: 0 0 14px;
    font-size: 24px;
}

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

.footer {
    border-top: 1px solid var(--border);
    background: rgba(2, 6, 23, 0.76);
    margin-top: 40px;
}

.footer-grid {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 46px 0;
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 30px;
}

.footer p {
    color: var(--muted);
    line-height: 1.8;
}

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

.footer-links {
    display: grid;
    gap: 10px;
    color: var(--soft);
}

.copyright {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0 28px;
    color: var(--muted);
    border-top: 1px solid var(--border);
    font-size: 14px;
    text-align: center;
}

@media (max-width: 1120px) {
    .desktop-nav {
        gap: 13px;
        font-size: 13px;
    }

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

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

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

    .menu-toggle {
        display: inline-flex;
    }

    .hero-content,
    .intro-panel,
    .detail-wrap,
    .detail-copy,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .hero-content {
        padding-top: 46px;
        gap: 24px;
    }

    .hero-poster {
        max-width: 260px;
    }

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

    .detail-wrap {
        padding-top: 44px;
    }

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

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

@media (max-width: 560px) {
    .nav-wrap,
    .content-section,
    .page-hero,
    .detail-wrap,
    .footer-grid,
    .copyright {
        width: min(100% - 24px, 1240px);
    }

    .brand-name {
        font-size: 17px;
    }

    .hero,
    .hero-content {
        min-height: 84vh;
    }

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

    .hero-actions,
    .quick-search,
    .search-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .category-grid,
    .category-grid.large,
    .movie-grid,
    .movie-grid.compact,
    .rank-grid {
        grid-template-columns: 1fr;
    }

    .movie-card.horizontal {
        grid-template-columns: 1fr;
    }

    .section-head {
        align-items: flex-start;
        flex-direction: column;
    }

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