:root {
    --bg: #020617;
    --bg-soft: #0f172a;
    --panel: rgba(15, 23, 42, 0.72);
    --panel-strong: rgba(15, 23, 42, 0.92);
    --line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --muted-strong: #cbd5e1;
    --blue: #3b82f6;
    --cyan: #22d3ee;
    --shadow: rgba(59, 130, 246, 0.22);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at 20% 0%, rgba(59, 130, 246, 0.17), transparent 32rem),
        radial-gradient(circle at 80% 12%, rgba(34, 211, 238, 0.12), transparent 28rem),
        linear-gradient(180deg, #020617 0%, #0f172a 45%, #020617 100%);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

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

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.98), rgba(15, 23, 42, 0.91));
    border-bottom: 1px solid rgba(59, 130, 246, 0.16);
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 45px rgba(2, 6, 23, 0.35);
}

.nav-shell,
.footer-shell,
.content-section,
.hero-content,
.page-hero,
.detail-layout {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
}

.nav-shell {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(90deg, #60a5fa, #67e8f9, #3b82f6);
    -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: white;
    font-size: 15px;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    border-radius: 12px;
    box-shadow: 0 0 24px var(--shadow);
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link,
.mobile-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 12px;
    color: var(--muted-strong);
    font-weight: 600;
    transition: 0.25s ease;
}

.nav-link:hover,
.nav-link.is-active,
.mobile-link:hover,
.mobile-link.is-active {
    color: #dbeafe;
    background: rgba(59, 130, 246, 0.18);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.12);
}

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

.mobile-nav {
    display: none;
    padding: 8px 16px 16px;
    border-top: 1px solid var(--line);
}

.mobile-nav.is-open {
    display: grid;
    gap: 8px;
}

.page-main {
    min-height: 72vh;
}

.home-main {
    padding-bottom: 72px;
}

.inner-main {
    padding-top: 96px;
    padding-bottom: 72px;
}

.hero-carousel {
    position: relative;
    min-height: 82vh;
    overflow: hidden;
    background: #020617;
}

.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-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.62), rgba(2, 6, 23, 0.22)),
        linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.55) 44%, transparent 72%);
}

.hero-content {
    position: absolute;
    left: 50%;
    bottom: 14%;
    transform: translateX(-50%);
    max-width: 1200px;
}

.hero-content > * {
    max-width: 760px;
}

.hero-labels,
.hero-meta,
.hero-actions,
.detail-meta,
.detail-tags,
.movie-tags,
.movie-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.hero-labels span,
.hero-labels a,
.section-kicker,
.movie-type,
.rank-badge,
.detail-tags span,
.movie-tags span {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.hero-labels span,
.section-kicker {
    padding: 7px 14px;
    color: white;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    box-shadow: 0 10px 28px rgba(59, 130, 246, 0.25);
}

.hero-labels a {
    padding: 7px 14px;
    color: #dbeafe;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--line);
}

.hero-content h1 {
    margin: 22px 0 16px;
    font-size: clamp(42px, 8vw, 78px);
    line-height: 0.98;
    letter-spacing: -0.06em;
    text-shadow: 0 16px 40px rgba(0, 0, 0, 0.52);
}

.hero-content p,
.page-hero p,
.search-panel p {
    color: var(--muted-strong);
    font-size: clamp(16px, 2vw, 20px);
    line-height: 1.8;
}

.hero-meta {
    margin: 24px 0;
    color: #dbeafe;
}

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

.primary-button,
.ghost-button,
.section-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 22px;
    border-radius: 14px;
    font-weight: 800;
    transition: 0.25s ease;
}

.primary-button {
    color: white;
    background: linear-gradient(135deg, var(--blue), #2563eb);
    box-shadow: 0 18px 42px rgba(59, 130, 246, 0.28);
}

.primary-button:hover,
.ghost-button:hover,
.section-more:hover {
    transform: translateY(-2px);
}

.ghost-button,
.section-more {
    color: #dbeafe;
    border: 1px solid var(--line);
    background: rgba(15, 23, 42, 0.72);
}

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 48px;
    height: 48px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.78);
    color: white;
    font-size: 36px;
    line-height: 1;
    transform: translateY(-50%);
    transition: 0.25s ease;
}

.hero-arrow:hover {
    background: rgba(59, 130, 246, 0.82);
}

.hero-prev {
    left: 24px;
}

.hero-next {
    right: 24px;
}

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

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

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

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

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

.section-heading h2,
.page-hero h1,
.search-panel h2,
.detail-copy h1 {
    margin: 10px 0 0;
    color: white;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

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

.movie-card,
.category-card,
.ranking-item,
.search-panel,
.story-panel,
.info-panel,
.cover-panel,
.player-card {
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: 0 20px 55px rgba(2, 6, 23, 0.28);
    backdrop-filter: blur(16px);
}

.movie-card {
    overflow: hidden;
    border-radius: 20px;
    transition: 0.25s ease;
}

.movie-card:hover,
.category-card:hover,
.ranking-item:hover {
    transform: translateY(-4px);
    border-color: rgba(59, 130, 246, 0.58);
    box-shadow: 0 24px 70px rgba(59, 130, 246, 0.18);
}

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

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

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

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

.movie-type {
    position: absolute;
    right: 10px;
    top: 10px;
    z-index: 2;
    padding: 5px 9px;
    color: #dbeafe;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.rank-badge {
    position: absolute;
    left: 10px;
    top: 10px;
    z-index: 3;
    width: 34px;
    height: 34px;
    justify-content: center;
    color: white;
    background: linear-gradient(135deg, #f97316, #ef4444);
}

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

.movie-card h3,
.ranking-item h3,
.category-card h3,
.category-card h2 {
    margin: 0;
    color: white;
    font-size: 17px;
    line-height: 1.35;
}

.movie-card p,
.ranking-item p,
.category-card p,
.story-panel p,
.footer-shell p {
    color: var(--muted);
    line-height: 1.72;
}

.movie-card p {
    min-height: 44px;
    margin: 8px 0 12px;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 14px;
}

.movie-meta {
    margin-bottom: 10px;
    color: #cbd5e1;
    font-size: 13px;
}

.movie-tags span,
.detail-tags span {
    padding: 4px 8px;
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.16);
    border: 1px solid rgba(59, 130, 246, 0.22);
}

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

.category-card {
    display: block;
    overflow: hidden;
    padding: 18px;
    border-radius: 24px;
    transition: 0.25s ease;
}

.category-posters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    height: 150px;
    margin-bottom: 18px;
}

.category-posters img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}

.category-card p {
    margin: 10px 0 0;
}

.category-card-large span {
    display: inline-flex;
    margin-top: 16px;
    color: #93c5fd;
    font-weight: 800;
}

.search-entry {
    margin-top: -74px;
    position: relative;
    z-index: 6;
}

.search-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px;
    border-radius: 26px;
}

.filter-bar {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 24px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.62);
}

.filter-bar label {
    display: grid;
    gap: 7px;
    color: var(--muted-strong);
    font-weight: 700;
    font-size: 13px;
}

.filter-bar input,
.filter-bar select {
    min-height: 46px;
    width: 100%;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(2, 6, 23, 0.72);
    color: white;
    outline: none;
}

.filter-bar input:focus,
.filter-bar select:focus {
    border-color: rgba(59, 130, 246, 0.82);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.page-hero {
    min-height: 310px;
    display: flex;
    align-items: end;
    padding: 56px 0;
    border-bottom: 1px solid var(--line);
}

.small-hero {
    background:
        radial-gradient(circle at 12% 24%, rgba(59, 130, 246, 0.24), transparent 30rem),
        radial-gradient(circle at 82% 8%, rgba(34, 211, 238, 0.16), transparent 28rem);
}

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

.breadcrumb a:hover {
    color: #93c5fd;
}

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

.player-card {
    padding: 12px;
    border-radius: 26px;
}

.player-shell {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: 18px;
    background: black;
}

.movie-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: black;
}

.player-start {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: radial-gradient(circle, rgba(2, 6, 23, 0.08), rgba(2, 6, 23, 0.28));
    color: white;
    transition: 0.2s ease;
}

.player-start span {
    width: 86px;
    height: 86px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 6px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    box-shadow: 0 20px 55px rgba(59, 130, 246, 0.36);
    font-size: 34px;
}

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

.detail-copy,
.detail-aside {
    margin-top: 24px;
}

.detail-title-row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}

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

.detail-tags {
    margin-bottom: 22px;
}

.story-panel,
.info-panel,
.cover-panel {
    border-radius: 22px;
    padding: 24px;
}

.story-panel h2,
.info-panel h2 {
    margin: 0 0 12px;
    color: white;
    font-size: 22px;
}

.story-panel p {
    margin: 0 0 24px;
    white-space: pre-line;
}

.story-panel p:last-child {
    margin-bottom: 0;
}

.detail-aside {
    position: sticky;
    top: 96px;
    align-self: start;
    display: grid;
    gap: 18px;
}

.info-panel dl {
    display: grid;
    gap: 13px;
    margin: 0;
}

.info-panel div,
.info-panel dl {
    color: var(--muted-strong);
}

.info-panel dt {
    float: left;
    color: var(--muted);
}

.info-panel dd {
    margin-left: 78px;
    color: white;
}

.cover-panel {
    padding: 10px;
    overflow: hidden;
}

.cover-panel img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 16px;
}

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

.ranking-item {
    display: grid;
    grid-template-columns: auto 92px 1fr;
    gap: 16px;
    align-items: center;
    min-height: 120px;
    padding: 12px;
    border-radius: 20px;
    transition: 0.25s ease;
}

.ranking-item img {
    width: 92px;
    height: 108px;
    object-fit: cover;
    border-radius: 14px;
}

.rank-number {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    color: white;
    font-weight: 900;
}

.ranking-item p {
    margin: 6px 0;
}

.ranking-item span,
.ranking-item small {
    display: block;
    color: var(--muted);
}

.is-filtered-out {
    display: none !important;
}

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

.footer-shell {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 32px;
    padding: 42px 0 28px;
}

.footer-shell p {
    max-width: 720px;
}

.footer-links {
    display: grid;
    gap: 10px;
    align-content: start;
}

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

.footer-links a:hover {
    color: #93c5fd;
}

.copyright {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 0 0 32px;
    color: #64748b;
    font-size: 14px;
}

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

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

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

    .detail-aside {
        position: static;
        grid-template-columns: 1fr 220px;
    }
}

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

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

    .hero-carousel {
        min-height: 76vh;
    }

    .hero-content {
        bottom: 12%;
    }

    .hero-content h1 {
        font-size: 42px;
    }

    .hero-arrow {
        display: none;
    }

    .search-entry {
        margin-top: 0;
    }

    .search-panel,
    .section-heading,
    .detail-title-row,
    .footer-shell {
        display: grid;
    }

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

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

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

    .ranking-item {
        grid-template-columns: auto 72px 1fr;
    }

    .ranking-item img {
        width: 72px;
        height: 94px;
    }

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

@media (max-width: 560px) {
    .nav-shell,
    .footer-shell,
    .content-section,
    .hero-content,
    .page-hero,
    .detail-layout,
    .copyright {
        width: min(100% - 22px, 1200px);
    }

    .brand {
        font-size: 20px;
    }

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

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

    .movie-card-body {
        padding: 12px;
    }

    .movie-card h3 {
        font-size: 15px;
    }

    .hero-meta span,
    .detail-meta span {
        font-size: 13px;
        padding: 7px 10px;
    }

    .hero-actions {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .player-start span {
        width: 66px;
        height: 66px;
        font-size: 26px;
    }

    .story-panel,
    .info-panel {
        padding: 18px;
    }
}
