:root {
    --page-bg: #f8fafc;
    --text: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --card: #ffffff;
    --dark: #0f172a;
    --dark-2: #1e293b;
    --orange: #f97316;
    --red: #ef4444;
    --pink: #ec4899;
    --shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--page-bg);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
}

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

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

button,
input,
select {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.96));
    color: #ffffff;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.24);
    backdrop-filter: blur(18px);
}

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

.site-logo,
.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.logo-mark {
    width: 34px;
    height: 34px;
    border-radius: 14px;
    display: inline-grid;
    place-items: center;
    background: linear-gradient(135deg, var(--orange), var(--red), var(--pink));
    color: #ffffff;
    box-shadow: 0 14px 30px rgba(249, 115, 22, 0.35);
}

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

.nav-link {
    padding: 9px 14px;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.82);
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
}

.nav-highlight {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.26), rgba(239, 68, 68, 0.26));
    color: #ffffff;
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    padding: 10px;
}

.menu-toggle span {
    display: block;
    height: 2px;
    margin: 5px 0;
    background: #ffffff;
    border-radius: 999px;
}

.hero {
    position: relative;
    min-height: 75vh;
    overflow: hidden;
    background: radial-gradient(circle at 20% 20%, rgba(249, 115, 22, 0.28), transparent 36%), linear-gradient(135deg, #020617, #0f172a 45%, #111827);
}

.hero-track,
.hero-slide {
    position: absolute;
    inset: 0;
}

.hero-slide {
    opacity: 0;
    transform: scale(1.02);
    background-size: cover;
    background-position: center;
    transition: opacity 0.8s ease, transform 1.2s ease;
}

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

.hero-slide::before {
    content: "";
    position: absolute;
    inset: -40px;
    background: inherit;
    filter: blur(24px);
    transform: scale(1.08);
    opacity: 0.72;
}

.hero-backdrop {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(2, 6, 23, 0.94), rgba(2, 6, 23, 0.74), rgba(2, 6, 23, 0.36)), linear-gradient(0deg, #020617 0%, transparent 46%);
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(1200px, calc(100% - 32px));
    min-height: 75vh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #ffffff;
    padding: 88px 0 110px;
}

.eyebrow {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    color: #fed7aa;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero h1,
.page-hero h1,
.detail-copy h1 {
    margin: 0;
    max-width: 780px;
    font-size: clamp(40px, 7vw, 88px);
    line-height: 0.95;
    font-weight: 950;
    letter-spacing: -0.05em;
    background: linear-gradient(90deg, #ffffff, #fed7aa, #fb7185);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.hero-summary {
    max-width: 760px;
    margin: 24px 0 0;
    color: #e2e8f0;
    font-size: clamp(18px, 2vw, 24px);
}

.hero-tags,
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 24px 0 0;
}

.hero-tags span,
.detail-meta span,
.tag-row span {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 8px 12px;
    color: #ffffff;
    backdrop-filter: blur(10px);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 34px;
}

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

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

.btn-primary {
    color: #ffffff;
    background: linear-gradient(135deg, var(--orange), var(--red), var(--pink));
    box-shadow: 0 18px 36px rgba(239, 68, 68, 0.32);
}

.btn-ghost {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.22);
}

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

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

.hero-dots button.is-active {
    width: 34px;
    background: #ffffff;
}

.home-search-panel {
    position: relative;
    z-index: 5;
    width: min(1100px, calc(100% - 32px));
    margin: -44px auto 30px;
    padding: 20px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.home-search-form,
.search-page-form,
.filter-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
}

.home-search-form input,
.search-page-form input,
.filter-row input,
.filter-row select {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #ffffff;
    padding: 0 16px;
    color: var(--text);
    outline: none;
}

.home-search-form input:focus,
.search-page-form input:focus,
.filter-row input:focus,
.filter-row select:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.12);
}

.home-search-form button,
.search-page-form button,
.filter-row button {
    min-height: 48px;
    border: 0;
    border-radius: 16px;
    padding: 0 22px;
    color: #ffffff;
    font-weight: 900;
    background: linear-gradient(135deg, var(--orange), var(--red));
}

.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.quick-links a,
.text-link,
.section-more {
    color: #ea580c;
    font-weight: 900;
}

.content-section {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 44px 0;
}

.dark-section {
    width: 100%;
    max-width: none;
    margin: 28px 0;
    padding: 58px max(16px, calc((100% - 1200px) / 2));
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #ffffff;
}

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

.section-heading h2 {
    margin: 0;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.05;
    font-weight: 950;
    letter-spacing: -0.04em;
    background: linear-gradient(90deg, #ea580c, #dc2626, #db2777);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.dark-section .section-heading h2 {
    background: linear-gradient(90deg, #ffffff, #fed7aa, #fb7185);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

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

.dark-section .section-heading p {
    color: #cbd5e1;
}

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

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

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

.movie-card {
    overflow: hidden;
    border-radius: 22px;
    background: var(--card);
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.10);
    border: 1px solid rgba(226, 232, 240, 0.78);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 26px 55px rgba(15, 23, 42, 0.18);
}

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

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

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

.type-badge,
.rank-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    border-radius: 999px;
    padding: 5px 9px;
    color: #ffffff;
    background: rgba(15, 23, 42, 0.72);
    font-size: 12px;
    font-weight: 900;
    backdrop-filter: blur(10px);
}

.rank-badge {
    left: auto;
    right: 10px;
    background: linear-gradient(135deg, var(--orange), var(--red));
}

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

.movie-title {
    display: -webkit-box;
    min-height: 48px;
    overflow: hidden;
    color: var(--text);
    font-size: 16px;
    font-weight: 950;
    line-height: 1.35;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.movie-title:hover {
    color: #ea580c;
}

.movie-meta,
.movie-one-line {
    display: -webkit-box;
    overflow: hidden;
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 12px;
}

.tag-row span {
    padding: 4px 8px;
    color: #9a3412;
    background: #ffedd5;
    border-color: #fed7aa;
    font-size: 12px;
}

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

.category-tile {
    position: relative;
    min-height: 210px;
    overflow: hidden;
    border-radius: var(--radius);
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background-size: cover;
    background-position: center;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
}

.category-tile::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.88), rgba(2, 6, 23, 0.32));
}

.category-tile span,
.category-tile strong,
.category-tile em {
    position: relative;
    z-index: 1;
}

.category-tile span {
    color: #fed7aa;
    font-weight: 900;
}

.category-tile strong {
    margin-top: 4px;
    font-size: 28px;
    line-height: 1;
}

.category-tile em {
    margin-top: 10px;
    color: #cbd5e1;
    font-style: normal;
    font-size: 14px;
}

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

.page-hero,
.detail-hero {
    position: relative;
    overflow: hidden;
    color: #ffffff;
    background: linear-gradient(135deg, #020617, #0f172a 42%, #1e293b);
}

.compact-hero {
    min-height: 360px;
    display: flex;
    align-items: center;
    padding: 78px max(16px, calc((100% - 1200px) / 2));
}

.compact-hero p {
    max-width: 760px;
    color: #cbd5e1;
    font-size: 18px;
}

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

.category-overview-card {
    overflow: hidden;
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
}

.category-cover {
    min-height: 180px;
    display: flex;
    align-items: flex-end;
    padding: 20px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.category-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.84), transparent);
}

.category-cover span {
    position: relative;
    color: #ffffff;
    font-size: 26px;
    font-weight: 950;
}

.category-overview-body {
    padding: 20px;
}

.category-overview-body h2 {
    margin: 0;
    font-size: 22px;
}

.category-overview-body p {
    color: var(--muted);
}

.category-overview-body ul {
    padding: 0;
    margin: 16px 0;
    list-style: none;
}

.category-overview-body li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
}

.category-overview-body li a {
    color: var(--text);
    font-weight: 800;
}

.filter-panel {
    padding: 18px;
    border-radius: var(--radius);
    background: #ffffff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.filter-row {
    grid-template-columns: 1fr 180px 180px auto;
}

.filter-count,
.search-tip {
    color: var(--muted);
    font-weight: 800;
}

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

.ranking-row {
    display: grid;
    grid-template-columns: 70px 96px 1fr auto;
    gap: 18px;
    align-items: center;
    padding: 16px;
    border-radius: 22px;
    background: #ffffff;
    border: 1px solid var(--line);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.ranking-number {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    color: #ffffff;
    font-size: 22px;
    font-weight: 950;
    background: linear-gradient(135deg, var(--orange), var(--red));
}

.ranking-thumb {
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 16px;
    background: #1e293b;
}

.ranking-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ranking-info h2 {
    margin: 0;
    font-size: 22px;
}

.ranking-info p,
.ranking-info span,
.ranking-heat {
    color: var(--muted);
}

.ranking-heat {
    font-weight: 950;
    color: #ea580c;
}

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

.detail-hero {
    min-height: 640px;
    background-size: cover;
    background-position: center;
}

.detail-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.82), rgba(2, 6, 23, 0.44)), linear-gradient(0deg, #020617 0%, transparent 45%);
    backdrop-filter: blur(10px);
}

.detail-shell {
    position: relative;
    z-index: 1;
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0 70px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin: 20px 0 40px;
    color: #cbd5e1;
}

.breadcrumb a:hover {
    color: #fed7aa;
}

.detail-grid {
    display: grid;
    grid-template-columns: 310px 1fr;
    gap: 42px;
    align-items: center;
}

.detail-poster {
    overflow: hidden;
    border-radius: 30px;
    background: #1e293b;
    box-shadow: 0 35px 80px rgba(0, 0, 0, 0.36);
}

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

.detail-line {
    max-width: 760px;
    margin: 22px 0 0;
    color: #e2e8f0;
    font-size: 20px;
}

.detail-tags span {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.detail-copy .btn {
    margin-top: 28px;
}

.detail-section {
    padding-top: 34px;
}

.player-shell {
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    background: #020617;
    box-shadow: 0 34px 80px rgba(15, 23, 42, 0.24);
}

.movie-player {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #020617;
}

.play-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    border: 0;
    color: #ffffff;
    background: radial-gradient(circle, rgba(15, 23, 42, 0.12), rgba(2, 6, 23, 0.66));
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.play-overlay span {
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--orange), var(--red));
    box-shadow: 0 18px 40px rgba(239, 68, 68, 0.36);
    font-size: 32px;
}

.play-overlay.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.player-status {
    position: absolute;
    left: 18px;
    bottom: 14px;
    margin: 0;
    color: #e2e8f0;
    font-size: 14px;
}

.detail-text-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.detail-panel,
.prose-section {
    border-radius: var(--radius);
    background: #ffffff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 28px;
}

.detail-panel h2,
.prose-section h2 {
    margin: 0 0 14px;
    font-size: 26px;
}

.detail-panel p,
.prose-section p {
    margin: 0 0 16px;
    color: #334155;
    font-size: 17px;
}

.site-footer {
    margin-top: 60px;
    color: #ffffff;
    background: linear-gradient(90deg, #1e293b, #0f172a, #1e293b);
}

.footer-shell {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0 28px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 28px;
}

.footer-grid p,
.footer-grid li,
.footer-bottom {
    color: #cbd5e1;
}

.footer-grid h3 {
    margin: 0 0 14px;
    color: #fed7aa;
}

.footer-grid ul {
    padding: 0;
    margin: 0;
    list-style: none;
}

.footer-grid li {
    margin: 8px 0;
}

.footer-grid a:hover {
    color: #fed7aa;
}

.footer-bottom {
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    text-align: center;
}

.back-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 900;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--orange), var(--red));
    box-shadow: 0 16px 36px rgba(239, 68, 68, 0.34);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.back-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

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

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

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

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

@media (max-width: 820px) {
    .menu-toggle {
        display: block;
    }

    .site-nav {
        position: absolute;
        top: 72px;
        left: 16px;
        right: 16px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
        border-radius: 20px;
        background: rgba(15, 23, 42, 0.98);
        box-shadow: var(--shadow);
    }

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

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

    .home-search-form,
    .search-page-form,
    .filter-row {
        grid-template-columns: 1fr;
    }

    .featured-grid,
    .ranking-strip,
    .related-grid,
    .category-grid,
    .movie-grid,
    .search-results,
    .category-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

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

    .ranking-row {
        grid-template-columns: 52px 76px 1fr;
    }

    .ranking-heat {
        grid-column: 3;
    }
}

@media (max-width: 560px) {
    .header-shell,
    .content-section,
    .footer-shell,
    .detail-shell,
    .home-search-panel {
        width: min(100% - 24px, 1200px);
    }

    .featured-grid,
    .ranking-strip,
    .related-grid,
    .category-grid,
    .movie-grid,
    .search-results,
    .category-overview-grid {
        grid-template-columns: 1fr;
    }

    .hero h1,
    .page-hero h1,
    .detail-copy h1 {
        font-size: 42px;
    }

    .section-heading {
        display: block;
    }

    .section-more {
        display: inline-block;
        margin-top: 10px;
    }

    .ranking-row {
        grid-template-columns: 48px 1fr;
    }

    .ranking-thumb {
        display: none;
    }

    .ranking-info,
    .ranking-heat {
        grid-column: 2;
    }
}
