:root {
    --bg: #020617;
    --panel: #0f172a;
    --panel-soft: rgba(15, 23, 42, 0.78);
    --panel-light: #1e293b;
    --border: rgba(148, 163, 184, 0.16);
    --border-strong: rgba(245, 158, 11, 0.32);
    --text: #f8fafc;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --accent: #f59e0b;
    --accent-light: #fbbf24;
    --accent-dark: #d97706;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.36);
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at 18% 10%, rgba(245, 158, 11, 0.12), transparent 26rem),
        radial-gradient(circle at 82% 0%, rgba(249, 115, 22, 0.1), transparent 22rem),
        var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

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

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

button,
input,
select {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(30, 41, 59, 0.92);
    background: rgba(2, 6, 23, 0.82);
    backdrop-filter: blur(16px);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 13rem;
}

.brand-mark {
    width: 2.65rem;
    height: 2.65rem;
    display: grid;
    place-items: center;
    border-radius: 1rem;
    background: linear-gradient(135deg, var(--accent-light), var(--accent-dark));
    color: white;
    font-weight: 800;
    box-shadow: 0 14px 34px rgba(245, 158, 11, 0.28);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.18;
}

.brand-text strong,
.footer-logo {
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}

.brand-text small {
    color: var(--muted);
    margin-top: 0.18rem;
    font-size: 0.75rem;
}

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

.desktop-nav a,
.mobile-nav a {
    color: var(--soft);
    font-weight: 650;
    transition: color 0.2s ease;
}

.desktop-nav a:hover,
.desktop-nav a.active,
.mobile-nav a:hover {
    color: var(--accent-light);
}

.header-search {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding-left: 0.5rem;
}

.header-search input {
    width: 15rem;
    border: 1px solid rgba(51, 65, 85, 0.92);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.92);
    color: var(--text);
    padding: 0.6rem 0.95rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search input:focus,
.filter-bar input:focus,
.filter-bar select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.16);
}

.header-search button,
.filter-bar button,
.primary-button,
.secondary-button,
.section-more {
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
}

.header-search button,
.primary-button {
    background: linear-gradient(135deg, var(--accent-light), var(--accent-dark));
    color: white;
    font-weight: 750;
    box-shadow: 0 16px 36px rgba(245, 158, 11, 0.2);
}

.header-search button {
    padding: 0.58rem 0.9rem;
}

.menu-toggle {
    display: none;
    width: 2.6rem;
    height: 2.6rem;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    background: rgba(15, 23, 42, 0.85);
    color: var(--text);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.28rem;
}

.menu-toggle span {
    width: 1.2rem;
    height: 2px;
    border-radius: 999px;
    background: var(--accent-light);
}

.mobile-nav {
    display: none;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.45rem;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.25rem 1rem;
}

.mobile-nav a {
    border: 1px solid var(--border);
    border-radius: 0.95rem;
    padding: 0.72rem 0.5rem;
    background: rgba(15, 23, 42, 0.82);
    text-align: center;
}

.hero {
    position: relative;
    height: min(72vh, 760px);
    min-height: 34rem;
    overflow: hidden;
    background: #000;
}

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

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

.hero-slide img,
.detail-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.95), rgba(2, 6, 23, 0.42), rgba(2, 6, 23, 0.86)),
        linear-gradient(0deg, var(--bg), transparent 58%);
}

.hero-content {
    position: absolute;
    left: max(1.25rem, calc((100vw - 1280px) / 2 + 1.25rem));
    bottom: 7rem;
    width: min(46rem, calc(100vw - 2.5rem));
}

.hero-meta,
.detail-meta,
.meta-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.55rem;
    color: var(--soft);
}

.hero-badge,
.eyebrow {
    display: inline-flex;
    align-items: center;
    width: max-content;
    border-radius: 999px;
    color: var(--accent-light);
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.24);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.hero-badge {
    padding: 0.42rem 0.85rem;
    color: white;
    background: var(--accent);
}

.eyebrow {
    padding: 0.36rem 0.72rem;
    margin-bottom: 0.85rem;
}

.hero h1 {
    margin: 1.1rem 0 1rem;
    font-size: clamp(2.35rem, 6vw, 5rem);
    line-height: 1.03;
    letter-spacing: -0.05em;
    text-shadow: 0 18px 44px rgba(0, 0, 0, 0.44);
}

.hero p,
.page-hero p,
.section-heading p,
.detail-one-line,
.movie-info p,
.footer-inner p,
.category-tile p,
.detail-text p {
    color: var(--soft);
}

.hero p {
    max-width: 41rem;
    margin: 0 0 1.3rem;
    font-size: 1.08rem;
}

.hero-tags,
.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.hero-tags span,
.tag-row span {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.62);
    color: var(--soft);
    padding: 0.28rem 0.62rem;
    font-size: 0.78rem;
}

.hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 1.5rem;
}

.primary-button,
.secondary-button,
.section-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.7rem;
    padding: 0.78rem 1.25rem;
    font-weight: 800;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.primary-button:hover,
.secondary-button:hover,
.section-more:hover,
.movie-card:hover {
    transform: translateY(-3px);
}

.secondary-button,
.section-more {
    border: 1px solid var(--border-strong);
    background: rgba(15, 23, 42, 0.7);
    color: var(--accent-light);
}

.hero-dots {
    position: absolute;
    right: max(1.25rem, calc((100vw - 1280px) / 2 + 1.25rem));
    bottom: 2.2rem;
    display: flex;
    gap: 0.5rem;
}

.hero-dot {
    width: 0.75rem;
    height: 0.75rem;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.46);
    cursor: pointer;
    transition: width 0.25s ease, background 0.25s ease;
}

.hero-dot.active {
    width: 2.2rem;
    background: var(--accent);
}

.quick-panel {
    position: relative;
    z-index: 2;
    max-width: 1180px;
    margin: -3rem auto 0;
    padding: 0 1.25rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.quick-panel a,
.category-tile,
.movie-card,
.filter-bar,
.page-hero,
.player-shell,
.detail-text {
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
}

.quick-panel a {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    border-radius: 1.35rem;
    padding: 1.15rem;
}

.quick-panel span,
.category-tile span,
.meta-line,
.detail-meta,
.breadcrumb {
    color: var(--muted);
    font-size: 0.86rem;
}

.quick-panel strong {
    font-size: 1.05rem;
}

.main-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 4rem 1.25rem;
}

.page-top {
    padding-top: 2.8rem;
}

.section-block + .section-block {
    margin-top: 4.5rem;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.5rem;
    margin-bottom: 1.6rem;
}

.section-heading h2,
.page-hero h1,
.detail-copy h1,
.detail-text h2 {
    margin: 0;
    letter-spacing: -0.035em;
}

.section-heading h2 {
    font-size: clamp(1.65rem, 4vw, 2.45rem);
}

.section-heading p,
.page-hero p {
    margin: 0.35rem 0 0;
    max-width: 42rem;
}

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

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

.search-grid {
    margin-top: 1.5rem;
}

.movie-list {
    display: grid;
    gap: 1rem;
}

.movie-card {
    position: relative;
    overflow: hidden;
    border-radius: 1.25rem;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
    border-color: var(--border-strong);
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.46);
}

.poster {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: linear-gradient(135deg, #0f172a, #1e293b);
}

.poster-wide {
    aspect-ratio: 16 / 9;
    width: min(21rem, 38vw);
    flex: 0 0 auto;
}

.poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease, opacity 0.3s ease;
}

.movie-card:hover .poster img,
.category-tile:hover img {
    transform: scale(1.055);
    opacity: 0.88;
}

.play-chip,
.rank-badge {
    position: absolute;
    border-radius: 999px;
    color: white;
    font-weight: 800;
    line-height: 1;
}

.play-chip {
    right: 0.72rem;
    bottom: 0.72rem;
    padding: 0.46rem 0.65rem;
    background: rgba(245, 158, 11, 0.92);
    font-size: 0.78rem;
}

.rank-badge {
    left: 0.72rem;
    top: 0.72rem;
    min-width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.68);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.movie-info {
    padding: 1rem;
}

.movie-info h3 {
    margin: 0.45rem 0 0.5rem;
    font-size: 1.03rem;
    line-height: 1.35;
}

.movie-info h3 a {
    transition: color 0.2s ease;
}

.movie-info h3 a:hover {
    color: var(--accent-light);
}

.movie-info p {
    margin: 0 0 0.8rem;
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.movie-card-horizontal {
    display: flex;
    align-items: stretch;
}

.movie-card-horizontal .movie-info {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.gradient-panel {
    border: 1px solid rgba(245, 158, 11, 0.16);
    border-radius: 1.8rem;
    padding: clamp(1.2rem, 4vw, 2.2rem);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.72));
}

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

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

.category-tile {
    display: flex;
    gap: 1rem;
    border-radius: 1.4rem;
    padding: 1rem;
    overflow: hidden;
    transition: transform 0.22s ease, border-color 0.22s ease;
}

.category-tile:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
}

.category-covers {
    width: 5.6rem;
    min-width: 5.6rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem;
}

.category-covers img {
    width: 100%;
    height: 5rem;
    object-fit: cover;
    border-radius: 0.7rem;
    transition: transform 0.4s ease;
}

.category-tile h3 {
    margin: 0.25rem 0 0.3rem;
    font-size: 1.1rem;
}

.category-tile p {
    margin: 0;
    font-size: 0.88rem;
}

.page-hero {
    border-radius: 1.8rem;
    padding: clamp(1.4rem, 4vw, 3rem);
    background:
        linear-gradient(135deg, rgba(245, 158, 11, 0.13), transparent),
        rgba(15, 23, 42, 0.78);
}

.small-hero h1 {
    font-size: clamp(2rem, 5vw, 4rem);
}

.compact-actions {
    margin-top: 1.2rem;
}

.filter-bar {
    display: grid;
    grid-template-columns: 1.5fr repeat(4, minmax(8rem, 1fr)) auto;
    gap: 0.9rem;
    border-radius: 1.35rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.filter-bar label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.filter-bar span {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.filter-bar input,
.filter-bar select {
    width: 100%;
    border: 1px solid rgba(51, 65, 85, 0.92);
    border-radius: 0.9rem;
    background: rgba(2, 6, 23, 0.62);
    color: var(--text);
    padding: 0.72rem 0.8rem;
    outline: none;
}

.filter-bar button {
    align-self: end;
    min-height: 2.85rem;
    padding: 0 1rem;
    background: rgba(245, 158, 11, 0.13);
    color: var(--accent-light);
    border: 1px solid rgba(245, 158, 11, 0.22);
}

.empty-state {
    display: none;
    border: 1px dashed rgba(148, 163, 184, 0.28);
    border-radius: 1.2rem;
    padding: 2rem;
    text-align: center;
    color: var(--muted);
    margin-top: 1rem;
}

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

.detail-page {
    background: var(--bg);
}

.detail-hero {
    position: relative;
    min-height: 34rem;
    overflow: hidden;
}

.detail-bg {
    position: absolute;
    inset: 0;
    filter: blur(10px) saturate(1.1);
    transform: scale(1.08);
    opacity: 0.5;
}

.detail-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(0deg, var(--bg), rgba(2, 6, 23, 0.28)),
        linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.4));
}

.detail-inner {
    position: relative;
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
}

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 1.6rem;
}

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

.detail-grid {
    display: grid;
    grid-template-columns: minmax(14rem, 18rem) 1fr;
    gap: clamp(1.4rem, 4vw, 3.2rem);
    align-items: center;
}

.detail-poster {
    overflow: hidden;
    border-radius: 1.5rem;
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow);
}

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

.detail-copy h1 {
    font-size: clamp(2.2rem, 6vw, 4.6rem);
    line-height: 1.06;
    margin-bottom: 1rem;
}

.detail-one-line {
    max-width: 52rem;
    margin: 0 0 1rem;
    font-size: 1.08rem;
}

.detail-meta {
    margin-bottom: 1rem;
}

.detail-meta span {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.17);
    padding: 0.36rem 0.68rem;
    background: rgba(2, 6, 23, 0.42);
}

.large-tags span {
    font-size: 0.86rem;
}

.detail-content {
    padding-top: 2rem;
}

.player-section {
    margin-bottom: 2.6rem;
}

.player-shell {
    position: relative;
    overflow: hidden;
    border-radius: 1.5rem;
    aspect-ratio: 16 / 9;
    background: #000;
}

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

.player-cover {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    border: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.58), rgba(0, 0, 0, 0.18));
    color: white;
    cursor: pointer;
    text-align: center;
    padding: 1rem;
}

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

.player-icon {
    width: 4.6rem;
    height: 4.6rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent-light), var(--accent-dark));
    box-shadow: 0 20px 48px rgba(245, 158, 11, 0.32);
    font-size: 1.6rem;
    padding-left: 0.2rem;
}

.player-cover strong {
    font-size: clamp(1.1rem, 3vw, 1.8rem);
}

.detail-text {
    border-radius: 1.5rem;
    padding: clamp(1.2rem, 4vw, 2rem);
}

.detail-text h2 {
    font-size: 1.45rem;
    margin: 0 0 0.75rem;
}

.detail-text h2 + p {
    margin-top: 0;
}

.detail-text p + h2 {
    margin-top: 1.5rem;
}

.detail-text p {
    font-size: 1rem;
    margin-bottom: 0;
}

.site-footer {
    border-top: 1px solid rgba(30, 41, 59, 0.92);
    background: rgba(2, 6, 23, 0.74);
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2.2rem 1.25rem;
    display: flex;
    justify-content: space-between;
    gap: 2rem;
}

.footer-logo {
    display: inline-block;
    color: var(--accent-light);
    font-weight: 850;
    margin-bottom: 0.55rem;
}

.footer-inner p {
    margin: 0;
    max-width: 36rem;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--soft);
}

.footer-links a:hover {
    color: var(--accent-light);
}

[data-movie-card].hidden-card {
    display: none;
}

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

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

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

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

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

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

    .filter-search {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .header-inner {
        padding-inline: 1rem;
    }

    .brand {
        min-width: 0;
    }

    .brand-text small {
        display: none;
    }

    .hero {
        min-height: 32rem;
        height: 68vh;
    }

    .hero-content {
        bottom: 5.4rem;
    }

    .hero h1 {
        font-size: clamp(2rem, 12vw, 3.6rem);
    }

    .quick-panel {
        grid-template-columns: 1fr;
        margin-top: 1rem;
    }

    .main-container {
        padding: 3rem 1rem;
    }

    .section-heading,
    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .movie-card-horizontal {
        display: block;
    }

    .poster-wide {
        width: 100%;
        aspect-ratio: 16 / 9;
    }

    .category-tile {
        display: block;
    }

    .category-covers {
        width: 100%;
        margin-bottom: 0.9rem;
    }

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

    .detail-poster {
        max-width: 14rem;
    }

    .filter-bar {
        grid-template-columns: 1fr;
    }
}

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

    .hero-dots {
        left: 1.25rem;
        right: auto;
    }

    .footer-links {
        flex-direction: column;
        align-items: flex-start;
    }
}
