:root {
    --blue-50: #eff6ff;
    --blue-100: #dbeafe;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --blue-900: #1e3a8a;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 18px 45px rgba(15, 23, 42, 0.16);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

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

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

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(16px);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 72px;
}

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--blue-600);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.brand-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    color: var(--white);
    background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.25);
    font-size: 16px;
}

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

.nav-link {
    color: var(--gray-700);
    font-weight: 650;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active,
.mobile-link.is-active {
    color: var(--blue-600);
}

.search-form,
.mobile-search,
.large-search {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-form input,
.mobile-search input,
.large-search input,
.filter-bar input,
.filter-bar select {
    border: 1px solid var(--gray-200);
    outline: none;
    background: var(--white);
    border-radius: 999px;
    padding: 10px 14px;
    color: var(--gray-800);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-form input {
    width: 220px;
}

.search-form input:focus,
.mobile-search input:focus,
.large-search input:focus,
.filter-bar input:focus,
.filter-bar select:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.search-form button,
.mobile-search button,
.large-search button {
    border: 0;
    color: var(--white);
    background: var(--blue-600);
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 700;
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    background: var(--gray-100);
    border-radius: 12px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.nav-toggle span {
    width: 20px;
    height: 2px;
    background: var(--gray-700);
    border-radius: 999px;
}

.mobile-panel {
    display: none;
    border-top: 1px solid var(--gray-200);
    padding: 14px 16px 18px;
    background: var(--white);
}

.mobile-panel.is-open {
    display: block;
}

.mobile-panel nav {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.mobile-link {
    color: var(--gray-700);
    font-weight: 650;
}

.hero-slider {
    position: relative;
    min-height: 540px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--blue-900), var(--blue-700));
}

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

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

.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.32;
    filter: saturate(1.08);
}

.hero-shade {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 80% 30%, rgba(96, 165, 250, 0.35), transparent 28%),
        linear-gradient(90deg, rgba(15, 23, 42, 0.82), rgba(30, 64, 175, 0.66), rgba(15, 23, 42, 0.28));
}

.hero-content {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) 340px;
    align-items: center;
    gap: 48px;
    min-height: 540px;
}

.hero-copy {
    max-width: 680px;
    color: var(--white);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    color: var(--white);
    background: rgba(59, 130, 246, 0.92);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.hero-copy h1,
.page-hero h1,
.category-top h1,
.detail-hero h1 {
    margin: 18px 0 14px;
    font-size: clamp(36px, 6vw, 64px);
    line-height: 1.04;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.hero-copy p,
.page-hero p,
.category-top p,
.detail-hero p {
    max-width: 760px;
    color: rgba(255, 255, 255, 0.84);
    font-size: 18px;
}

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

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

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

.btn-light {
    color: var(--blue-700);
    background: var(--white);
}

.btn-ghost {
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.12);
}

.btn-primary {
    color: var(--white);
    background: var(--blue-600);
}

.hero-poster {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 28px;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.45);
    transform: rotate(2deg);
}

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

.hero-control {
    position: absolute;
    top: 50%;
    z-index: 5;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    color: var(--white);
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-50%);
    font-size: 34px;
    line-height: 1;
    transition: background 0.2s ease;
}

.hero-control:hover {
    background: rgba(255, 255, 255, 0.32);
}

.hero-prev {
    left: 22px;
}

.hero-next {
    right: 22px;
}

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

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

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

.section-block {
    padding: 56px 0 0;
}

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

.section-heading h2 {
    margin: 0;
    color: var(--gray-900);
    font-size: clamp(26px, 4vw, 36px);
    line-height: 1.1;
    font-weight: 900;
    letter-spacing: -0.03em;
}

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

.section-heading a {
    color: var(--blue-600);
    font-weight: 800;
    white-space: nowrap;
}

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

.movie-card {
    overflow: hidden;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.card-cover {
    position: relative;
    display: block;
    overflow: hidden;
    background: var(--gray-200);
}

.card-cover img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.movie-card:hover .card-cover img,
.category-card:hover img,
.category-overview-card:hover img,
.ranking-cover:hover img {
    transform: scale(1.08);
}

.card-cover span {
    position: absolute;
    right: 10px;
    bottom: 10px;
    color: var(--white);
    background: rgba(15, 23, 42, 0.76);
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 800;
}

.card-body {
    padding: 16px;
}

.card-title {
    display: -webkit-box;
    overflow: hidden;
    min-height: 52px;
    color: var(--gray-900);
    font-size: 18px;
    line-height: 1.35;
    font-weight: 850;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-title:hover,
.ranking-title:hover {
    color: var(--blue-600);
}

.card-body p {
    display: -webkit-box;
    overflow: hidden;
    min-height: 44px;
    margin: 10px 0 12px;
    color: var(--gray-600);
    font-size: 14px;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-meta,
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--gray-500);
    font-size: 13px;
}

.card-meta span,
.detail-meta span {
    border-radius: 999px;
    background: var(--blue-50);
    color: var(--blue-700);
    padding: 4px 8px;
    font-weight: 700;
}

.card-tags,
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.card-tags span,
.tag-cloud a {
    color: var(--gray-600);
    background: var(--gray-100);
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 700;
}

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

.category-card,
.category-overview-card {
    position: relative;
    display: block;
    overflow: hidden;
    min-height: 190px;
    color: var(--white);
    border-radius: 22px;
    box-shadow: var(--shadow);
    isolation: isolate;
}

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

.category-card::after,
.category-overview-card::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.18), rgba(15, 23, 42, 0.82));
    z-index: -1;
}

.category-card span,
.category-overview-card span {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 54px;
    font-size: 22px;
    font-weight: 900;
}

.category-card p,
.category-overview-card p {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 16px;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 13px;
}

.two-column-layout {
    display: grid;
    grid-template-columns: 0.78fr 1.22fr;
    gap: 24px;
}

.panel,
.content-panel,
.side-card {
    background: var(--white);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 24px;
}

.ranking-list {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ranking-list li {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}

.rank-number,
.rank-badge {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    color: var(--white);
    background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
    border-radius: 12px;
    font-weight: 900;
}

.ranking-list a {
    color: var(--gray-900);
    font-weight: 800;
}

.ranking-list small {
    grid-column: 2;
    color: var(--gray-500);
}

.wide-list {
    display: grid;
    gap: 16px;
}

.movie-card-wide {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
}

.movie-card-wide .card-cover img {
    height: 100%;
    min-height: 140px;
    aspect-ratio: auto;
}

.cta-panel {
    margin-top: 56px;
    margin-bottom: 56px;
    padding: 44px;
    color: var(--white);
    text-align: center;
    border-radius: 28px;
    background: linear-gradient(135deg, var(--blue-600), var(--blue-900));
    box-shadow: var(--shadow-lg);
}

.cta-panel h2 {
    margin: 0 0 12px;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.12;
}

.cta-panel p {
    max-width: 720px;
    margin: 0 auto 24px;
    color: rgba(255, 255, 255, 0.84);
}

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

.page-hero,
.compact-hero {
    margin-top: 28px;
    padding: 52px;
    color: var(--white);
    border-radius: 30px;
    background:
        radial-gradient(circle at 86% 16%, rgba(147, 197, 253, 0.32), transparent 24%),
        linear-gradient(135deg, var(--blue-900), var(--blue-700));
    box-shadow: var(--shadow-lg);
}

.page-hero p {
    margin: 0;
}

.large-search {
    max-width: 680px;
    margin-top: 24px;
}

.large-search input {
    flex: 1;
}

.category-top,
.detail-hero {
    position: relative;
    overflow: hidden;
    min-height: 360px;
    color: var(--white);
    background: var(--blue-900);
}

.category-top img,
.detail-hero > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.32;
}

.category-top-shade,
.detail-hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.86), rgba(30, 64, 175, 0.58));
}

.category-top-content,
.detail-hero-content {
    position: relative;
    z-index: 2;
    padding: 64px 0;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 14px;
}

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

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    padding: 18px;
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.filter-bar input {
    min-width: 260px;
    flex: 1;
}

.filter-grid .movie-card.is-hidden {
    display: none;
}

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

.category-overview-card {
    min-height: 260px;
}

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

.ranking-card {
    display: grid;
    grid-template-columns: 44px 160px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    padding: 16px;
    background: var(--white);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.ranking-cover {
    display: block;
    overflow: hidden;
    border-radius: 16px;
    background: var(--gray-200);
}

.ranking-cover img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.ranking-title {
    display: block;
    margin-bottom: 8px;
    font-size: 20px;
    font-weight: 900;
}

.ranking-card p {
    margin: 0 0 10px;
    color: var(--gray-600);
}

.detail-hero {
    min-height: 440px;
}

.detail-hero-content {
    padding: 74px 0;
}

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

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    margin-top: -72px;
    position: relative;
    z-index: 4;
}

.detail-main {
    display: grid;
    gap: 24px;
}

.player-shell {
    position: relative;
    overflow: hidden;
    background: #000000;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    aspect-ratio: 16 / 9;
}

.movie-video {
    width: 100%;
    height: 100%;
    background: #000000;
    object-fit: contain;
}

.player-cover {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(15, 23, 42, 0.56);
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.player-cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.42;
}

.player-cover button {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 86px;
    height: 86px;
    border: 0;
    color: var(--blue-700);
    background: var(--white);
    border-radius: 999px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.36);
}

.player-cover button span {
    margin-left: 4px;
    font-size: 34px;
}

.content-panel h2,
.side-card h2 {
    margin: 0 0 12px;
    font-size: 24px;
    font-weight: 900;
}

.content-panel p,
.side-card p {
    margin: 0;
    color: var(--gray-700);
    font-size: 16px;
}

.info-list {
    display: grid;
    gap: 12px;
    margin: 0;
}

.info-list div {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-100);
}

.info-list dt {
    color: var(--gray-500);
    font-weight: 800;
}

.info-list dd {
    margin: 0;
    color: var(--gray-900);
}

.detail-side {
    position: sticky;
    top: 96px;
    align-self: start;
}

.side-card img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 18px;
    margin-bottom: 18px;
}

.side-card .btn {
    width: 100%;
    margin-top: 18px;
}

.search-status {
    margin-bottom: 22px;
    color: var(--gray-700);
    font-weight: 800;
}

.site-footer {
    margin-top: 64px;
    color: var(--gray-300);
    background: var(--gray-900);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 36px;
    padding: 48px 0 32px;
}

.footer-brand {
    color: var(--white);
    margin-bottom: 14px;
}

.site-footer h2 {
    margin: 0 0 12px;
    color: var(--white);
    font-size: 17px;
}

.site-footer p {
    margin: 0;
    color: var(--gray-400);
}

.site-footer a:not(.footer-brand) {
    display: block;
    margin: 8px 0;
    color: var(--gray-400);
}

.site-footer a:hover {
    color: var(--blue-100);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--gray-500);
    font-size: 14px;
}

.back-to-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 80;
    display: none;
    width: 44px;
    height: 44px;
    border: 0;
    color: var(--white);
    background: var(--blue-600);
    border-radius: 999px;
    box-shadow: var(--shadow-lg);
    font-size: 20px;
    font-weight: 900;
}

.back-to-top.is-visible {
    display: block;
}

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

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

    .hero-content {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 46px 0;
    }

    .hero-poster {
        display: none;
    }

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

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

    .two-column-layout,
    .detail-layout,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .detail-side {
        position: static;
    }
}

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

    .header-inner {
        min-height: 64px;
    }

    .brand {
        font-size: 18px;
    }

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

    .hero-copy h1,
    .page-hero h1,
    .category-top h1,
    .detail-hero h1 {
        font-size: 36px;
    }

    .hero-control {
        display: none;
    }

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

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

    .movie-card-wide,
    .ranking-card {
        grid-template-columns: 1fr;
    }

    .page-hero,
    .compact-hero,
    .cta-panel {
        padding: 30px 22px;
        border-radius: 24px;
    }

    .filter-bar {
        flex-direction: column;
    }

    .filter-bar input,
    .filter-bar select {
        width: 100%;
        min-width: 0;
    }

    .detail-layout {
        margin-top: -40px;
    }

    .footer-bottom {
        flex-direction: column;
    }
}

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

    .hero-actions,
    .large-search,
    .mobile-search {
        align-items: stretch;
        flex-direction: column;
    }

    .card-title {
        min-height: auto;
    }
}
