:root {
    --bg: #111827;
    --bg-soft: #1f2937;
    --bg-card: rgba(31, 41, 55, 0.58);
    --border: rgba(75, 85, 99, 0.62);
    --text: #f9fafb;
    --muted: #d1d5db;
    --subtle: #9ca3af;
    --sunset: #f59e0b;
    --sunset-dark: #d97706;
    --twilight: #f97316;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(217, 119, 6, 0.15), transparent 28rem),
        radial-gradient(circle at top right, rgba(249, 115, 22, 0.12), transparent 34rem),
        var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

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

button,
input,
select {
    font: inherit;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(17, 24, 39, 0.95);
    border-bottom: 1px solid rgba(31, 41, 55, 0.92);
    backdrop-filter: blur(16px);
}

.nav-wrap {
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 28px;
}

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    color: #111827;
    background: linear-gradient(135deg, var(--sunset), var(--twilight));
    border-radius: 999px;
    box-shadow: 0 10px 28px rgba(217, 119, 6, 0.34);
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-copy strong,
.footer-brand {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(90deg, var(--sunset), #fb923c, #fbbf24);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    white-space: nowrap;
}

.brand-copy small {
    margin-top: 4px;
    color: var(--subtle);
    font-size: 12px;
}

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

.desktop-nav a,
.mobile-nav a,
.site-footer a {
    color: var(--muted);
    transition: color 0.2s ease;
}

.desktop-nav a:hover,
.desktop-nav a.is-active,
.mobile-nav a:hover,
.mobile-nav a.is-active,
.site-footer a:hover {
    color: var(--sunset);
}

.nav-search {
    position: relative;
    width: 260px;
}

.nav-search input,
.mobile-nav input,
.filter-panel input,
.filter-panel select {
    width: 100%;
    color: var(--muted);
    background: rgba(31, 41, 55, 0.86);
    border: 1px solid rgba(75, 85, 99, 0.78);
    border-radius: 999px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nav-search input,
.mobile-nav input {
    padding: 10px 16px;
}

.nav-search input:focus,
.mobile-nav input:focus,
.filter-panel input:focus,
.filter-panel select:focus {
    border-color: var(--sunset-dark);
    box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.14);
}

.menu-toggle {
    display: none;
    margin-left: auto;
    width: 42px;
    height: 42px;
    color: var(--text);
    background: rgba(31, 41, 55, 0.9);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
}

.mobile-nav {
    display: none;
    padding: 0 16px 16px;
    border-top: 1px solid rgba(31, 41, 55, 0.92);
}

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

.hero-carousel {
    position: relative;
    height: 70vh;
    min-height: 520px;
    overflow: hidden;
}

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

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

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

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, #111827 0%, rgba(17, 24, 39, 0.78) 36%, rgba(17, 24, 39, 0.05) 100%),
        linear-gradient(90deg, rgba(17, 24, 39, 0.7), transparent 62%);
}

.hero-content {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding-bottom: 70px;
}

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

.hero-eyebrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    color: var(--sunset);
    font-weight: 700;
}

.hero-eyebrow span + span::before {
    content: "|";
    margin-right: 10px;
    color: rgba(209, 213, 219, 0.65);
}

.hero-copy h1 {
    margin: 0 0 18px;
    font-size: clamp(42px, 6vw, 76px);
    line-height: 0.98;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.hero-copy p,
.page-hero p,
.detail-info p {
    color: var(--muted);
    font-size: 18px;
    line-height: 1.8;
}

.hero-copy p {
    max-width: 640px;
    margin: 0 0 28px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-actions,
.detail-info .btn {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 26px;
    border-radius: 999px;
    font-weight: 800;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    color: white;
    background: linear-gradient(90deg, var(--sunset-dark), var(--twilight));
    box-shadow: 0 16px 32px rgba(217, 119, 6, 0.25);
}

.btn-ghost {
    color: var(--text);
    border: 1px solid rgba(245, 158, 11, 0.38);
    background: rgba(0, 0, 0, 0.35);
}

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 50px;
    height: 50px;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    transform: translateY(-50%);
    transition: background 0.2s ease;
    font-size: 34px;
    line-height: 1;
}

.hero-arrow:hover {
    background: rgba(0, 0, 0, 0.72);
}

.hero-arrow--left {
    left: 20px;
}

.hero-arrow--right {
    right: 20px;
}

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

.hero-dots button {
    width: 10px;
    height: 10px;
    padding: 0;
    background: rgba(255, 255, 255, 0.55);
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    transition: width 0.2s ease, background 0.2s ease;
}

.hero-dots button.is-active {
    width: 36px;
    background: var(--sunset);
}

.section {
    margin-top: 58px;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.section-heading h2 {
    margin: 0;
    color: white;
    font-size: clamp(26px, 3vw, 36px);
    font-weight: 850;
}

.section-icon {
    color: var(--sunset);
    font-size: 24px;
}

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

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

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

.movie-card {
    display: block;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid rgba(75, 85, 99, 0.34);
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
    transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-6px) scale(1.02);
    background: rgba(31, 41, 55, 0.92);
    border-color: rgba(245, 158, 11, 0.26);
}

.poster-frame {
    position: relative;
    display: block;
    height: 260px;
    overflow: hidden;
}

.movie-card--large .poster-frame {
    height: 330px;
}

.movie-card--small .poster-frame {
    height: 210px;
}

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

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

.poster-gradient,
.category-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.16), transparent);
}

.play-mask {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: white;
    font-size: 44px;
    background: rgba(0, 0, 0, 0.36);
    opacity: 0;
    transition: opacity 0.25s ease;
}

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

.poster-frame strong {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 2;
    color: white;
    font-size: 17px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.movie-card:hover .poster-frame strong {
    color: #fbbf24;
}

.poster-meta {
    position: absolute;
    left: 14px;
    top: 14px;
    z-index: 2;
    display: flex;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
}

.poster-meta span,
.rank-badge,
.tag-chip {
    border: 1px solid rgba(245, 158, 11, 0.28);
    background: rgba(0, 0, 0, 0.45);
    border-radius: 999px;
}

.poster-meta span {
    padding: 4px 8px;
}

.rank-badge {
    position: absolute;
    right: 14px;
    top: 14px;
    z-index: 2;
    display: grid;
    place-items: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    color: white;
    font-weight: 900;
    background: linear-gradient(135deg, var(--sunset-dark), var(--twilight));
}

.card-body {
    display: block;
    padding: 14px 16px 16px;
}

.card-desc {
    display: -webkit-box;
    min-height: 44px;
    color: var(--subtle);
    font-size: 14px;
    line-height: 1.55;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-info {
    display: block;
    margin-top: 10px;
    color: #6b7280;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rail {
    overflow-x: auto;
    scrollbar-width: none;
}

.rail::-webkit-scrollbar {
    display: none;
}

.rail-track {
    display: flex;
    gap: 18px;
    padding-bottom: 6px;
}

.rail-track .movie-card {
    width: 280px;
    flex: 0 0 280px;
}

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

.category-card {
    position: relative;
    min-height: 180px;
    overflow: hidden;
    border: 1px solid rgba(75, 85, 99, 0.35);
    border-radius: 18px;
    background: rgba(31, 41, 55, 0.62);
    box-shadow: var(--shadow);
}

.category-card--wide {
    min-height: 220px;
}

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

.category-card:hover img {
    transform: scale(1.08);
}

.category-card span:last-child {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 18px;
    z-index: 2;
}

.category-card strong {
    display: block;
    color: white;
    font-size: 24px;
    font-weight: 850;
}

.category-card small {
    display: -webkit-box;
    margin-top: 8px;
    color: var(--muted);
    line-height: 1.6;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.page-hero {
    position: relative;
    padding: 72px 0 46px;
    background:
        linear-gradient(135deg, rgba(217, 119, 6, 0.22), rgba(249, 115, 22, 0.08) 42%, transparent),
        rgba(17, 24, 39, 0.7);
    border-bottom: 1px solid rgba(75, 85, 99, 0.28);
}

.page-hero--category {
    padding-top: 82px;
}

.page-hero h1 {
    margin: 12px 0 8px;
    font-size: clamp(38px, 5vw, 64px);
    line-height: 1;
    font-weight: 900;
}

.page-hero p {
    max-width: 760px;
    margin: 0;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    color: var(--subtle);
    font-size: 14px;
}

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

.breadcrumb strong {
    color: var(--muted);
    font-weight: 600;
}

.filter-panel {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(160px, 220px));
    gap: 16px;
    margin-bottom: 26px;
    padding: 18px;
    background: rgba(31, 41, 55, 0.58);
    border: 1px solid rgba(75, 85, 99, 0.38);
    border-radius: 18px;
}

.filter-panel label {
    display: grid;
    gap: 8px;
    color: var(--subtle);
    font-size: 13px;
}

.filter-panel input,
.filter-panel select {
    min-height: 44px;
    padding: 0 15px;
    border-radius: 12px;
}

.empty-state {
    display: none;
    padding: 50px 20px;
    color: var(--subtle);
    text-align: center;
    background: rgba(31, 41, 55, 0.5);
    border: 1px solid rgba(75, 85, 99, 0.32);
    border-radius: 18px;
}

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

.category-preview-list {
    display: grid;
    gap: 34px;
}

.category-preview {
    padding: 24px;
    background: rgba(31, 41, 55, 0.4);
    border: 1px solid rgba(75, 85, 99, 0.28);
    border-radius: 18px;
}

.category-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.category-preview-head h2 {
    margin: 0;
    color: white;
    font-size: 24px;
}

.category-preview-head a {
    color: var(--sunset);
    font-weight: 700;
}

.detail-hero {
    padding: 46px 0 26px;
    background: radial-gradient(circle at 20% 0%, rgba(217, 119, 6, 0.16), transparent 30rem);
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.85fr);
    gap: 28px;
    align-items: stretch;
    margin-top: 24px;
}

.player-card,
.detail-info,
.content-card {
    background: rgba(31, 41, 55, 0.58);
    border: 1px solid rgba(75, 85, 99, 0.35);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.player-card {
    padding: 14px;
}

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

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

.player-start {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: white;
    background: rgba(0, 0, 0, 0.25);
    border: 0;
    cursor: pointer;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.player-start span {
    display: grid;
    place-items: center;
    width: 86px;
    height: 86px;
    padding-left: 6px;
    background: linear-gradient(135deg, var(--sunset-dark), var(--twilight));
    border-radius: 999px;
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
    font-size: 38px;
}

.video-shell.is-playing .player-start {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.detail-info {
    padding: 30px;
}

.detail-meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--sunset);
    font-weight: 800;
}

.detail-meta-line span {
    padding: 6px 10px;
    background: rgba(217, 119, 6, 0.12);
    border: 1px solid rgba(217, 119, 6, 0.28);
    border-radius: 999px;
}

.detail-info h1 {
    margin: 18px 0 12px;
    color: white;
    font-size: clamp(32px, 4vw, 54px);
    line-height: 1.08;
    font-weight: 900;
}

.detail-info p {
    margin: 0 0 22px;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 26px;
}

.tag-chip {
    display: inline-flex;
    padding: 7px 11px;
    color: #fbbf24;
    font-size: 13px;
}

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

.content-card {
    padding: 24px;
}

.content-card h2 {
    margin: 0 0 14px;
    color: white;
    font-size: 24px;
}

.content-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.9;
}

.info-card dl {
    display: grid;
    grid-template-columns: 74px 1fr;
    gap: 10px 12px;
    margin: 0;
}

.info-card dt {
    color: var(--subtle);
}

.info-card dd {
    margin: 0;
    color: var(--muted);
}

.site-footer {
    margin-top: 72px;
    padding: 42px 0 24px;
    background: rgba(17, 24, 39, 0.9);
    border-top: 1px solid rgba(31, 41, 55, 0.92);
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) 1fr 1.2fr;
    gap: 32px;
}

.site-footer p {
    max-width: 560px;
    color: var(--subtle);
    line-height: 1.8;
}

.site-footer h3 {
    margin: 0 0 14px;
    color: white;
}

.site-footer a {
    display: block;
    margin: 8px 0;
}

.footer-bottom {
    width: min(1180px, calc(100% - 32px));
    margin: 28px auto 0;
    padding-top: 22px;
    color: var(--subtle);
    text-align: center;
    border-top: 1px solid rgba(31, 41, 55, 0.92);
}

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

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

    .menu-toggle {
        display: inline-grid;
        place-items: center;
    }

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

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

    .filter-panel,
    .detail-layout,
    .detail-columns,
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .container {
        width: min(100% - 24px, 1180px);
    }

    .brand-copy strong {
        font-size: 20px;
    }

    .brand-copy small {
        display: none;
    }

    .hero-carousel {
        height: 72vh;
        min-height: 520px;
    }

    .hero-content {
        padding-bottom: 76px;
    }

    .hero-copy p {
        font-size: 16px;
    }

    .hero-arrow {
        display: none;
    }

    .section {
        margin-top: 42px;
    }

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

    .poster-frame,
    .movie-card--large .poster-frame,
    .movie-card--small .poster-frame {
        height: 230px;
    }

    .card-body {
        padding: 12px;
    }

    .card-desc {
        min-height: 40px;
        font-size: 13px;
    }

    .category-card,
    .category-card--wide {
        min-height: 170px;
    }

    .detail-info,
    .content-card {
        padding: 20px;
    }
}

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

    .poster-frame,
    .movie-card--large .poster-frame,
    .movie-card--small .poster-frame {
        height: 310px;
    }

    .rail-track .movie-card {
        width: 245px;
        flex-basis: 245px;
    }
}
