:root {
    --blue-900: #0f2f68;
    --blue-800: #1554a1;
    --blue-700: #1d63c6;
    --blue-600: #2563eb;
    --blue-500: #3b82f6;
    --orange-500: #f97316;
    --red-500: #ef4444;
    --green-600: #059669;
    --purple-700: #6d28d9;
    --gray-950: #0f172a;
    --gray-900: #111827;
    --gray-800: #1f2937;
    --gray-700: #374151;
    --gray-600: #4b5563;
    --gray-500: #6b7280;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --gray-50: #f9fafb;
    --white: #ffffff;
    --shadow-sm: 0 6px 18px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 18px 45px rgba(15, 23, 42, 0.18);
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-xl: 30px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

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

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

button,
input {
    font: inherit;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    color: var(--white);
    background: linear-gradient(90deg, var(--blue-600), var(--blue-700), var(--blue-800));
    box-shadow: 0 10px 30px rgba(29, 78, 216, 0.26);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.brand-icon {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 2px solid rgba(255, 255, 255, 0.86);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.14);
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    font-size: 15px;
    font-weight: 650;
}

.desktop-nav a,
.mobile-nav a {
    opacity: 0.94;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.desktop-nav a:hover,
.mobile-nav a:hover {
    color: #bfdbfe;
    opacity: 1;
}

.mobile-toggle {
    display: none;
    border: 0;
    color: var(--white);
    background: transparent;
    font-size: 27px;
    cursor: pointer;
}

.mobile-nav {
    display: none;
    padding: 0 16px 16px;
}

.mobile-nav a {
    display: block;
    padding: 9px 0;
    font-weight: 650;
}

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

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

.gray-page {
    background: var(--gray-50);
}

.hero-carousel {
    position: relative;
    height: 60vh;
    min-height: 460px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--blue-900), var(--blue-800), var(--blue-600));
}

.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 {
    height: 100%;
    object-fit: cover;
}

.hero-layer {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.18));
}

.hero-content {
    position: absolute;
    left: 50%;
    bottom: 64px;
    transform: translateX(-50%);
    color: var(--white);
    max-width: 1180px;
}

.eyebrow {
    margin: 0 0 12px;
    color: #bfdbfe;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-content h1 {
    max-width: 760px;
    margin: 0 0 18px;
    font-size: clamp(36px, 6vw, 72px);
    line-height: 1;
    font-weight: 900;
    text-shadow: 0 4px 26px rgba(0, 0, 0, 0.34);
}

.hero-desc {
    max-width: 760px;
    margin: 0 0 28px;
    font-size: clamp(16px, 2vw, 21px);
    color: rgba(255, 255, 255, 0.9);
}

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

.primary-btn,
.ghost-btn,
.section-more,
.text-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-weight: 750;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-btn {
    min-height: 48px;
    padding: 0 28px;
    color: var(--white);
    background: var(--blue-600);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.32);
}

.primary-btn:hover {
    transform: translateY(-2px);
    background: var(--blue-700);
    box-shadow: 0 18px 36px rgba(37, 99, 235, 0.4);
}

.ghost-btn {
    min-height: 48px;
    padding: 0 24px;
    color: var(--white);
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(12px);
}

.ghost-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.26);
}

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

.hero-arrow:hover {
    background: rgba(0, 0, 0, 0.72);
    transform: translateY(-50%) scale(1.04);
}

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

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

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

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

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

.search-panel {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 24px;
    align-items: center;
    margin: 34px 0 14px;
    padding: 28px;
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.search-panel h2 {
    margin: 0 0 8px;
    font-size: clamp(24px, 4vw, 36px);
}

.search-panel p {
    margin: 0;
    color: var(--gray-600);
}

.inline-search {
    display: flex;
    gap: 10px;
}

.inline-search input,
.filter-bar input {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 0 15px;
    background: var(--gray-50);
    outline: none;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

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

.inline-search button,
.filter-buttons button {
    min-height: 48px;
    border: 0;
    border-radius: 12px;
    padding: 0 20px;
    color: var(--white);
    background: var(--blue-600);
    font-weight: 750;
    cursor: pointer;
}

.section-block {
    margin: 42px 0;
    padding: 34px 0;
}

.section-block.soft-green,
.section-block.soft-purple,
.section-block.soft-orange {
    margin: 50px -18px;
    padding: 36px 18px;
    border-radius: var(--radius-xl);
}

.soft-green {
    background: linear-gradient(90deg, #ecfdf5, #d1fae5);
}

.soft-purple {
    background: linear-gradient(135deg, #eff6ff, #eef2ff, #faf5ff);
}

.soft-orange {
    background: linear-gradient(90deg, #fff1f2, #fffbeb);
}

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

.section-heading h2 {
    margin: 0 0 4px;
    font-size: clamp(24px, 4vw, 34px);
    line-height: 1.16;
}

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

.section-more,
.text-link {
    color: var(--blue-700);
    white-space: nowrap;
}

.section-more:hover,
.text-link:hover {
    color: var(--blue-900);
}

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

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

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

.poster-link {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, var(--blue-900), var(--blue-600));
}

.movie-card:not(.horizontal-card) .poster-link {
    aspect-ratio: 3 / 4;
}

.poster-link img {
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.movie-card:hover .poster-link img,
.category-tile:hover img,
.category-cover:hover img {
    transform: scale(1.08);
}

.play-mark {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--white);
    background: rgba(0, 0, 0, 0.28);
    font-size: 34px;
    opacity: 0;
    transition: opacity 0.22s ease;
}

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

.card-body {
    padding: 16px;
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    color: var(--gray-500);
    font-size: 13px;
}

.card-title {
    display: -webkit-box;
    margin: 8px 0;
    overflow: hidden;
    color: var(--gray-950);
    font-size: 18px;
    font-weight: 850;
    line-height: 1.28;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-title:hover {
    color: var(--blue-700);
}

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

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

.tag-row span,
.detail-tags span {
    border-radius: 999px;
    padding: 3px 9px;
    color: #1d4ed8;
    background: #dbeafe;
    font-size: 12px;
    font-weight: 700;
}

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

.horizontal-card {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: 170px;
}

.horizontal-card .poster-link {
    height: 100%;
    aspect-ratio: auto;
}

.horizontal-card .card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

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

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

.scroll-row {
    display: grid;
    grid-auto-columns: 250px;
    grid-auto-flow: column;
    gap: 18px;
    overflow-x: auto;
    padding: 4px 2px 18px;
    scroll-snap-type: x mandatory;
}

.scroll-row .movie-card {
    scroll-snap-align: start;
}

.rank-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    color: var(--white);
    background: linear-gradient(135deg, var(--red-500), var(--orange-500));
    box-shadow: 0 10px 22px rgba(239, 68, 68, 0.35);
}

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

.category-tile {
    position: relative;
    display: block;
    overflow: hidden;
    min-height: 210px;
    border-radius: var(--radius-md);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.category-tile img {
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.category-tile::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.28));
}

.category-tile span,
.category-tile strong {
    position: absolute;
    z-index: 1;
    left: 18px;
    right: 18px;
}

.category-tile span {
    bottom: 58px;
    font-size: 24px;
    font-weight: 900;
}

.category-tile strong {
    bottom: 18px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 13px;
    font-weight: 600;
}

.page-hero {
    color: var(--white);
    background: radial-gradient(circle at 20% 20%, rgba(96, 165, 250, 0.45), transparent 36%), linear-gradient(135deg, var(--blue-900), var(--blue-800), var(--blue-600));
}

.compact-hero {
    padding: 64px 0;
}

.ranking-hero {
    padding: 74px 0;
    background: radial-gradient(circle at 18% 22%, rgba(251, 146, 60, 0.48), transparent 34%), linear-gradient(135deg, #7f1d1d, #b45309, #1e40af);
}

.page-hero h1 {
    margin: 0 0 12px;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.08;
}

.page-hero p:last-child {
    max-width: 780px;
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: 18px;
}

.category-page-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    padding: 42px 0;
}

.category-card {
    display: grid;
    grid-template-columns: 230px 1fr;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.category-cover {
    position: relative;
    overflow: hidden;
    min-height: 260px;
    color: var(--white);
}

.category-cover img {
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.category-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.74), transparent);
}

.category-cover span {
    position: absolute;
    z-index: 1;
    left: 18px;
    bottom: 16px;
    font-size: 24px;
    font-weight: 900;
}

.category-info {
    padding: 24px;
}

.category-info h2 {
    margin: 0 0 10px;
}

.category-info p {
    margin: 0 0 14px;
    color: var(--gray-600);
}

.category-info ul,
.site-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-info li {
    padding: 4px 0;
    color: var(--gray-700);
}

.category-info li a:hover {
    color: var(--blue-700);
}

.listing-wrap {
    padding: 32px 0 56px;
}

.filter-bar {
    display: grid;
    gap: 16px;
    margin-bottom: 24px;
    padding: 18px;
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-buttons button {
    color: var(--gray-700);
    background: var(--gray-100);
}

.filter-buttons button.is-active,
.filter-buttons button:hover {
    color: var(--white);
    background: var(--blue-600);
}

.wide-filter {
    position: sticky;
    top: 78px;
    z-index: 20;
}

.listing-grid {
    align-items: stretch;
}

.ranking-list .movie-card:nth-child(n + 21) {
    display: grid;
    grid-template-columns: 180px 1fr;
}

.ranking-list .movie-card:nth-child(n + 21) .poster-link {
    height: 150px;
    aspect-ratio: auto;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 22px 0;
    color: var(--gray-600);
    font-size: 14px;
}

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

.detail-page {
    padding-bottom: 48px;
}

.detail-hero {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 32px;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 32px;
    padding: 32px;
    border-radius: var(--radius-xl);
    color: var(--white);
    background: radial-gradient(circle at 18% 18%, rgba(59, 130, 246, 0.55), transparent 34%), linear-gradient(135deg, var(--gray-950), #1e3a8a, var(--blue-700));
    box-shadow: var(--shadow-lg);
}

.detail-cover {
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.34);
}

.detail-cover img {
    height: 100%;
    object-fit: cover;
}

.detail-info h1 {
    margin: 0 0 14px;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.08;
}

.detail-line {
    max-width: 780px;
    margin: 0 0 18px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 18px;
}

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

.detail-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 24px;
}

.detail-meta div {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
}

.detail-meta dt {
    color: rgba(255, 255, 255, 0.66);
    font-size: 12px;
}

.detail-meta dd {
    margin: 0;
    font-weight: 750;
}

.player-section {
    position: relative;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 32px;
    overflow: hidden;
    border-radius: var(--radius-xl);
    background: #030712;
    box-shadow: var(--shadow-lg);
    aspect-ratio: 16 / 9;
}

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

.player-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    gap: 10px;
    border: 0;
    color: var(--white);
    background: radial-gradient(circle, rgba(37, 99, 235, 0.26), rgba(0, 0, 0, 0.58));
    cursor: pointer;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.player-overlay span {
    display: grid;
    place-items: center;
    width: 82px;
    height: 82px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--blue-700);
    font-size: 34px;
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.32);
}

.player-overlay strong {
    font-size: 20px;
}

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

.content-section,
.prev-next,
.related-block {
    width: min(1180px, calc(100% - 32px));
    margin-left: auto;
    margin-right: auto;
}

.content-section {
    padding: 30px;
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.content-section h2 {
    margin: 0 0 12px;
    font-size: 26px;
}

.content-section p {
    margin: 0 0 24px;
    color: var(--gray-700);
    font-size: 17px;
}

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

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

.prev-next a {
    padding: 18px;
    border-radius: var(--radius-md);
    background: var(--white);
    box-shadow: var(--shadow-sm);
    font-weight: 750;
}

.prev-next a:last-child {
    text-align: right;
}

.prev-next a:hover {
    color: var(--blue-700);
}

.site-footer {
    color: #d1d5db;
    background: var(--gray-900);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 30px;
    padding: 46px 0;
}

.site-footer h2,
.site-footer h3 {
    margin: 0 0 14px;
    color: var(--white);
}

.site-footer p,
.site-footer li {
    margin: 0 0 9px;
    color: #cbd5e1;
    font-size: 14px;
}

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

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 20px 16px;
    color: #94a3b8;
    text-align: center;
    font-size: 14px;
}

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

@media (max-width: 1024px) {
    .desktop-nav {
        gap: 14px;
        font-size: 14px;
    }

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

    .horizontal-list,
    .category-page-grid {
        grid-template-columns: 1fr;
    }

    .detail-hero {
        grid-template-columns: 260px 1fr;
    }

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

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

    .mobile-toggle {
        display: block;
    }

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

    .hero-content {
        bottom: 72px;
    }

    .hero-arrow {
        display: none;
    }

    .search-panel,
    .detail-hero,
    .category-card {
        grid-template-columns: 1fr;
    }

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

    .horizontal-card,
    .ranking-list .movie-card:nth-child(n + 21) {
        grid-template-columns: 150px 1fr;
    }

    .detail-cover {
        max-width: 330px;
    }

    .detail-meta,
    .prev-next {
        grid-template-columns: 1fr;
    }

    .prev-next a:last-child {
        text-align: left;
    }
}

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

    .brand {
        font-size: 18px;
    }

    .hero-carousel {
        min-height: 560px;
    }

    .hero-content h1,
    .page-hero h1,
    .detail-info h1 {
        font-size: 34px;
    }

    .inline-search {
        display: grid;
    }

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

    .horizontal-card,
    .ranking-list .movie-card:nth-child(n + 21) {
        grid-template-columns: 1fr;
    }

    .horizontal-card .poster-link,
    .ranking-list .movie-card:nth-child(n + 21) .poster-link {
        height: auto;
        aspect-ratio: 16 / 10;
    }

    .scroll-row {
        grid-auto-columns: 82%;
    }

    .detail-hero,
    .content-section {
        padding: 20px;
        border-radius: 18px;
    }

    .player-section {
        border-radius: 18px;
    }

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