:root {
    color-scheme: dark;
    --bg: #020617;
    --surface: #0f172a;
    --surface-soft: rgba(15, 23, 42, 0.82);
    --panel: #111827;
    --border: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --accent: #f59e0b;
    --accent-strong: #d97706;
    --danger: #ef4444;
    --shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
    --radius: 22px;
    --container: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(245, 158, 11, 0.18), transparent 32rem),
        linear-gradient(180deg, #020617 0%, #0f172a 45%, #020617 100%);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

body::-webkit-scrollbar,
*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

body::-webkit-scrollbar-track,
*::-webkit-scrollbar-track {
    background: #0f172a;
}

body::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-thumb {
    background: #b45309;
    border-radius: 999px;
}

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

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

button,
input,
select {
    font: inherit;
}

.container {
    width: min(var(--container), calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(2, 6, 23, 0.86);
    backdrop-filter: blur(16px);
}

.header-inner {
    width: min(var(--container), calc(100% - 32px));
    min-height: 72px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    color: #111827;
    background: linear-gradient(135deg, #fbbf24, #f97316);
    box-shadow: 0 12px 36px rgba(245, 158, 11, 0.35);
}

.brand-text {
    font-size: 1.2rem;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.main-nav a {
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--soft);
    transition: color 0.2s ease, background 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.12);
}

.nav-toggle {
    display: none;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 14px;
    color: var(--text);
    background: rgba(15, 23, 42, 0.88);
}

.hero-section {
    position: relative;
    min-height: 600px;
    overflow: hidden;
    background: #020617;
}

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

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

.hero-backdrop {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.78) 42%, rgba(2, 6, 23, 0.25) 100%),
        linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.1) 48%, rgba(2, 6, 23, 0.42) 100%),
        var(--hero-image) center / cover no-repeat;
    filter: saturate(1.1);
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(var(--container), calc(100% - 32px));
    min-height: 600px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) 360px;
    align-items: center;
    gap: 52px;
    padding: 94px 0 76px;
}

.hero-copy {
    max-width: 760px;
}

.eyebrow,
.section-kicker {
    display: inline-flex;
    align-items: center;
    width: max-content;
    margin-bottom: 14px;
    padding: 6px 12px;
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 999px;
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.12);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.hero-copy h1 {
    margin: 0;
    font-size: clamp(2.7rem, 6vw, 5.8rem);
    line-height: 0.98;
    letter-spacing: -0.06em;
}

.hero-copy p {
    max-width: 690px;
    margin: 22px 0 0;
    color: var(--soft);
    font-size: clamp(1rem, 1.7vw, 1.2rem);
}

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

.hero-tags {
    margin-top: 24px;
}

.hero-tags span,
.tag-row span {
    padding: 5px 10px;
    border-radius: 999px;
    color: #fde68a;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.2);
    font-size: 0.8rem;
}

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

.primary-button,
.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 22px;
    border-radius: 999px;
    font-weight: 800;
    transition: transform 0.2s ease, background 0.2s ease, border 0.2s ease;
}

.primary-button {
    color: #111827;
    background: linear-gradient(135deg, #fbbf24, #f97316);
    box-shadow: 0 16px 44px rgba(245, 158, 11, 0.32);
}

.ghost-button {
    border: 1px solid rgba(245, 158, 11, 0.28);
    color: #fbbf24;
    background: rgba(15, 23, 42, 0.58);
}

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

.hero-poster {
    display: block;
    overflow: hidden;
    border: 1px solid rgba(245, 158, 11, 0.26);
    border-radius: 28px;
    background: rgba(15, 23, 42, 0.72);
    box-shadow: var(--shadow);
}

.hero-poster img {
    aspect-ratio: 16 / 21;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.hero-poster:hover img {
    transform: scale(1.04);
}

.hero-control {
    position: absolute;
    left: 50%;
    bottom: 26px;
    z-index: 4;
    width: min(var(--container), calc(100% - 32px));
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.hero-control button,
.hero-dots button {
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-radius: 999px;
    color: var(--text);
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(10px);
}

.hero-control > button {
    padding: 9px 14px;
}

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

.hero-dots button {
    width: 34px;
    height: 34px;
}

.hero-dots button.is-active {
    color: #111827;
    background: #fbbf24;
}

.section {
    padding: 56px 0;
}

.section-heading,
.footer-inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.section-heading h2,
.page-hero h1 {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 3rem);
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.text-link {
    color: #fbbf24;
    font-weight: 800;
}

.search-entry {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    align-items: end;
    gap: 28px;
}

.filter-panel {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(120px, 0.32fr));
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.72);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.24);
}

.search-box {
    display: grid;
    gap: 6px;
}

.search-box span {
    color: var(--muted);
    font-size: 0.8rem;
}

.filter-input,
.filter-select {
    width: 100%;
    min-height: 44px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    padding: 0 14px;
    color: var(--text);
    background: rgba(2, 6, 23, 0.8);
    outline: none;
}

.filter-input:focus,
.filter-select:focus {
    border-color: rgba(245, 158, 11, 0.62);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

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

.category-tile {
    min-height: 140px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(245, 158, 11, 0.12), transparent),
        rgba(15, 23, 42, 0.72);
    transition: transform 0.2s ease, border 0.2s ease;
}

.category-tile:hover {
    transform: translateY(-4px);
    border-color: rgba(245, 158, 11, 0.48);
}

.category-tile span {
    display: block;
    margin-bottom: 10px;
    font-size: 1.2rem;
    font-weight: 800;
}

.category-tile small {
    color: var(--muted);
}

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

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

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

.movie-card {
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.74);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease, border 0.2s ease, box-shadow 0.2s ease;
}

.movie-card:hover {
    transform: translateY(-5px);
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
}

.poster-link {
    position: relative;
    display: block;
    overflow: hidden;
    background: #0f172a;
}

.poster-link img {
    aspect-ratio: 16 / 21;
    object-fit: cover;
    transition: transform 0.35s ease, filter 0.35s ease;
}

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

.poster-glow {
    position: absolute;
    inset: auto 0 0;
    height: 50%;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.88), transparent);
}

.play-chip {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    color: #111827;
    background: #fbbf24;
    font-size: 0.78rem;
    font-weight: 800;
}

.card-body {
    padding: 16px;
}

.card-meta,
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 0.78rem;
}

.card-meta span,
.detail-meta span {
    display: inline-flex;
    align-items: center;
}

.card-meta span:not(:last-child)::after,
.detail-meta span:not(:last-child)::after {
    content: "";
    width: 4px;
    height: 4px;
    margin-left: 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.6);
}

.movie-card h3 {
    display: -webkit-box;
    min-height: 3.1em;
    margin: 10px 0 8px;
    overflow: hidden;
    font-size: 1.05rem;
    line-height: 1.35;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.movie-card p {
    display: -webkit-box;
    min-height: 3.2em;
    margin: 0 0 12px;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.9rem;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

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

.movie-card.compact h3 {
    font-size: 0.95rem;
}

.movie-card.compact p {
    display: none;
}

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

.rank-item {
    display: grid;
    grid-template-columns: 54px 88px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.72);
}

.rank-number {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    color: #111827;
    background: linear-gradient(135deg, #fbbf24, #f97316);
    font-weight: 900;
}

.rank-thumb {
    overflow: hidden;
    border-radius: 16px;
}

.rank-thumb img {
    aspect-ratio: 16 / 20;
    object-fit: cover;
}

.rank-item h3 {
    margin: 0 0 8px;
    font-size: 1.12rem;
}

.rank-item p {
    margin: 0 0 8px;
    color: var(--muted);
}

.full-rank {
    margin-top: 22px;
}

.page-hero {
    padding: 80px 0 34px;
}

.page-hero p {
    max-width: 760px;
    margin: 16px 0 0;
    color: var(--soft);
    font-size: 1.05rem;
}

.category-overview {
    padding-bottom: 44px;
}

.category-section {
    padding: 34px 0;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.movie-detail-hero {
    position: relative;
    overflow: hidden;
    min-height: 560px;
    background: #020617;
}

.detail-bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.68), rgba(2, 6, 23, 0.88)),
        var(--detail-image) center / cover no-repeat;
    filter: blur(2px) saturate(1.05);
    transform: scale(1.03);
}

.detail-hero-inner {
    position: relative;
    z-index: 2;
    padding: 34px 0 70px;
}

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

.breadcrumb a {
    color: #fbbf24;
}

.detail-layout {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    align-items: center;
    gap: 42px;
}

.detail-poster {
    display: block;
    overflow: hidden;
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-radius: 28px;
    background: #0f172a;
    box-shadow: var(--shadow);
}

.detail-poster img {
    aspect-ratio: 16 / 21;
    object-fit: cover;
}

.detail-copy h1 {
    max-width: 850px;
    margin: 0;
    font-size: clamp(2.3rem, 5vw, 4.8rem);
    line-height: 1;
    letter-spacing: -0.055em;
}

.detail-one-line {
    max-width: 830px;
    margin: 20px 0 0;
    color: var(--soft);
    font-size: 1.12rem;
}

.detail-meta {
    margin-top: 20px;
}

.detail-tags {
    margin: 20px 0 28px;
}

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

.movie-player {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-radius: 28px;
    background: #000;
    box-shadow: var(--shadow);
}

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

.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px;
    border: 0;
    color: #fff;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.72), rgba(2, 6, 23, 0.22));
    cursor: pointer;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.24s ease;
}

.movie-player.is-playing .player-overlay {
    opacity: 0;
    pointer-events: none;
}

.play-circle {
    display: grid;
    place-items: center;
    width: 78px;
    height: 78px;
    border-radius: 999px;
    color: #111827;
    background: #fbbf24;
    font-size: 2rem;
    box-shadow: 0 18px 52px rgba(245, 158, 11, 0.4);
}

.content-panel,
.side-panel {
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 26px;
    background: rgba(15, 23, 42, 0.72);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.2);
}

.content-panel {
    margin-top: 24px;
    padding: 28px;
}

.content-panel h2,
.side-panel h2 {
    margin: 0 0 14px;
    font-size: 1.4rem;
}

.content-panel p {
    margin: 0 0 24px;
    color: var(--soft);
    white-space: pre-line;
}

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

.side-panel {
    position: sticky;
    top: 96px;
    padding: 24px;
}

.side-panel dl {
    display: grid;
    gap: 12px;
    margin: 0;
}

.side-panel dt {
    color: var(--muted);
    font-size: 0.82rem;
}

.side-panel dd {
    margin: -8px 0 0;
    color: var(--text);
}

.site-footer {
    margin-top: 40px;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(2, 6, 23, 0.72);
}

.footer-inner {
    width: min(var(--container), calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0;
    align-items: center;
}

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

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: #fbbf24;
    font-weight: 700;
}

.is-hidden {
    display: none !important;
}

@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .hero-poster {
        display: none;
    }

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

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

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

    .search-entry,
    .detail-main {
        grid-template-columns: 1fr;
    }

    .side-panel {
        position: static;
    }
}

@media (max-width: 760px) {
    .header-inner {
        min-height: 64px;
    }

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

    .main-nav {
        position: absolute;
        left: 16px;
        right: 16px;
        top: 72px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        border: 1px solid var(--border);
        border-radius: 22px;
        background: rgba(2, 6, 23, 0.96);
        box-shadow: var(--shadow);
    }

    .main-nav.is-open {
        display: flex;
    }

    .hero-section,
    .hero-content {
        min-height: 560px;
    }

    .hero-content {
        padding-top: 78px;
        padding-bottom: 96px;
    }

    .hero-control {
        align-items: flex-end;
    }

    .hero-control > button {
        display: none;
    }

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

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

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

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

    .rank-item {
        grid-template-columns: 44px 72px minmax(0, 1fr);
        gap: 12px;
    }

    .rank-number {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

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

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

    .content-panel {
        padding: 20px;
    }
}

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

    .hero-copy h1,
    .detail-copy h1 {
        font-size: 2.4rem;
    }
}
