:root {
    color-scheme: light;
    --page-bg: #f8fafc;
    --ink: #111827;
    --muted: #6b7280;
    --soft: #e5e7eb;
    --card: #ffffff;
    --dark: #111827;
    --dark-2: #1f2937;
    --accent: #ef4444;
    --accent-dark: #dc2626;
    --ring: rgba(239, 68, 68, 0.26);
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: linear-gradient(135deg, #f8fafc 0%, #f3f4f6 52%, #fafaf9 100%);
    color: var(--ink);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

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

button,
input {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(229, 231, 235, 0.86);
    backdrop-filter: blur(18px);
}

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

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 16px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--dark), var(--dark-2));
    box-shadow: 0 12px 30px rgba(17, 24, 39, 0.18);
    transform: translateZ(0);
}

.brand:hover .brand-icon {
    transform: scale(1.04);
}

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

.brand-text strong {
    font-size: 20px;
    letter-spacing: -0.02em;
}

.brand-text em {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

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

.nav-link,
.mobile-nav-link {
    position: relative;
    color: #374151;
    font-weight: 650;
    transition: color 0.2s ease;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 100%;
    bottom: -8px;
    height: 2px;
    border-radius: 99px;
    background: var(--dark);
    transition: right 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active,
.mobile-nav-link:hover,
.mobile-nav-link.is-active {
    color: #111827;
}

.nav-link:hover::after,
.nav-link.is-active::after {
    right: 0;
}

.mobile-menu-button {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: #f3f4f6;
    cursor: pointer;
}

.mobile-nav {
    display: none;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 16px;
    padding: 12px;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

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

.mobile-nav-link {
    padding: 12px 14px;
    border-radius: 12px;
}

.mobile-nav-link:hover,
.mobile-nav-link.is-active {
    background: #f3f4f6;
}

main {
    min-height: 70vh;
}

.hero-shell {
    position: relative;
    overflow: hidden;
    min-height: 620px;
    background: #111827;
}

.hero-slides {
    position: relative;
    min-height: 620px;
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.48fr);
    gap: 46px;
    align-items: center;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 68px 0;
    opacity: 0;
    pointer-events: none;
    transform: translateY(18px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

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

.hero-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-size: cover;
    background-position: center;
    filter: saturate(1.08);
}

.hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(239, 68, 68, 0.23), transparent 34%), linear-gradient(180deg, rgba(17, 24, 39, 0.12), rgba(17, 24, 39, 0.86));
}

.hero-content {
    position: relative;
    z-index: 2;
    color: #ffffff;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
    font-size: 14px;
    backdrop-filter: blur(14px);
}

.hero-content h1 {
    max-width: 780px;
    margin: 0 0 20px;
    font-size: clamp(42px, 7vw, 84px);
    line-height: 0.96;
    letter-spacing: -0.06em;
}

.hero-summary {
    max-width: 760px;
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: clamp(17px, 2vw, 21px);
    line-height: 1.8;
}

.hero-tags,
.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.hero-tags span,
.tag-row span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.13);
    color: #ffffff;
    font-size: 13px;
}

.tag-row span {
    background: #f3f4f6;
    color: #374151;
}

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

.primary-button,
.ghost-button,
.section-more,
.plain-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border-radius: 999px;
    font-weight: 750;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-button {
    background: #ffffff;
    color: #111827;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.26);
}

.ghost-button {
    border: 1px solid rgba(255, 255, 255, 0.34);
    color: #ffffff;
    background: rgba(255, 255, 255, 0.09);
}

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

.hero-poster {
    position: relative;
    z-index: 2;
    display: block;
    overflow: hidden;
    width: min(360px, 100%);
    justify-self: end;
    aspect-ratio: 2 / 3;
    border-radius: 28px;
    background: #1f2937;
    box-shadow: 0 35px 90px rgba(0, 0, 0, 0.45);
}

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

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

.hero-poster span {
    position: absolute;
    left: 50%;
    top: 50%;
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    transform: translate(-50%, -50%);
    backdrop-filter: blur(10px);
}

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

.hero-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.38);
    cursor: pointer;
    transition: width 0.2s ease, background 0.2s ease;
}

.hero-dot.is-active {
    width: 32px;
    background: #ffffff;
}

.home-search-wrap,
.content-section,
.detail-wrap {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.home-search-wrap {
    margin-top: -56px;
    position: relative;
    z-index: 8;
}

.home-search-card,
.content-section,
.detail-main,
.detail-side .side-card,
.category-card {
    border: 1px solid rgba(229, 231, 235, 0.88);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.home-search-card {
    padding: clamp(22px, 4vw, 38px);
    border-radius: var(--radius);
}

.home-search-card h2,
.section-head h2,
.detail-main h1,
.detail-panel h2,
.side-card h2,
.category-card h2 {
    margin: 0;
    color: #111827;
    letter-spacing: -0.03em;
}

.home-search-card h2 {
    font-size: clamp(26px, 4vw, 38px);
}

.home-search-card p,
.section-head p,
.movie-line,
.category-card p,
.footer-brand p {
    color: var(--muted);
    line-height: 1.75;
}

.search-panel {
    margin-top: 18px;
}

.search-label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-weight: 700;
}

.search-input {
    width: 100%;
    height: 52px;
    border: 1px solid #d1d5db;
    border-radius: 16px;
    padding: 0 18px;
    color: #111827;
    background: #ffffff;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 5px var(--ring);
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.filter-chip {
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    color: #374151;
    background: #ffffff;
    cursor: pointer;
}

.filter-chip.is-active,
.filter-chip:hover {
    border-color: var(--dark);
    color: #ffffff;
    background: var(--dark);
}

.empty-result {
    display: none;
    margin: 18px 0 0;
    color: var(--muted);
}

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

.plain-link {
    margin-top: 16px;
    padding-left: 0;
    padding-right: 0;
    color: #111827;
}

.content-section {
    margin-top: 46px;
    padding: clamp(20px, 4vw, 32px);
    border-radius: var(--radius);
}

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

.section-head h2 {
    font-size: clamp(24px, 4vw, 34px);
}

.section-head p {
    margin: 8px 0 0;
}

.section-more {
    min-width: max-content;
    border: 1px solid #e5e7eb;
    color: #374151;
    background: #ffffff;
}

.section-more:hover {
    color: #ffffff;
    border-color: var(--dark);
    background: var(--dark);
}

.horizontal-cards {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    padding: 4px 4px 18px;
    scroll-snap-type: x mandatory;
}

.horizontal-cards::-webkit-scrollbar {
    height: 9px;
}

.horizontal-cards::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #d1d5db;
}

.movie-grid,
.category-grid,
.category-overview-grid,
.ranking-list {
    display: grid;
    gap: 20px;
}

.movie-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    margin-top: 24px;
}

.category-grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.category-overview-grid {
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}

.ranking-list {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.movie-card {
    min-width: 0;
}

.movie-card-compact {
    flex: 0 0 170px;
    scroll-snap-align: start;
}

.poster-link {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 2 / 3;
    border-radius: 18px;
    background: #e5e7eb;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.13);
}

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

.poster-link:hover img {
    transform: scale(1.06);
}

.poster-shade {
    position: absolute;
    inset: 0;
    opacity: 0;
    background: linear-gradient(180deg, transparent 20%, rgba(0, 0, 0, 0.84));
    transition: opacity 0.25s ease;
}

.poster-play {
    position: absolute;
    left: 50%;
    top: 50%;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.22);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.86);
    backdrop-filter: blur(10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.poster-link:hover .poster-shade,
.poster-link:hover .poster-play {
    opacity: 1;
}

.poster-link:hover .poster-play {
    transform: translate(-50%, -50%) scale(1);
}

.rank-badge {
    position: absolute;
    left: 10px;
    top: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: 999px;
    color: #ffffff;
    background: linear-gradient(135deg, #ef4444, #f59e0b);
    font-weight: 850;
    box-shadow: 0 10px 20px rgba(239, 68, 68, 0.25);
}

.movie-card-content {
    padding: 12px 2px 0;
}

.movie-card h3 {
    margin: 0;
    font-size: 15px;
    line-height: 1.45;
}

.movie-card h3 a:hover {
    color: var(--accent-dark);
}

.movie-meta {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.movie-line {
    margin: 8px 0 0;
    font-size: 13px;
}

.category-tile,
.category-card-images {
    position: relative;
    display: block;
    overflow: hidden;
    min-height: 180px;
    border-radius: 20px;
    background: #111827;
}

.category-tile img,
.category-card-images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-tile img {
    position: absolute;
    inset: 0;
}

.category-tile-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.08), rgba(17, 24, 39, 0.82));
}

.category-tile strong,
.category-tile em {
    position: absolute;
    left: 18px;
    right: 18px;
    color: #ffffff;
}

.category-tile strong {
    bottom: 56px;
    font-size: 22px;
}

.category-tile em {
    bottom: 18px;
    color: rgba(255, 255, 255, 0.76);
    font-size: 13px;
    font-style: normal;
    line-height: 1.5;
}

.page-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #111827, #1f2937);
    color: #ffffff;
}

.compact-hero {
    width: min(1180px, calc(100% - 32px));
    margin: 30px auto 0;
    padding: clamp(34px, 7vw, 72px);
    border-radius: 30px;
    box-shadow: var(--shadow);
}

.compact-hero::before {
    content: "";
    position: absolute;
    width: 360px;
    height: 360px;
    right: -80px;
    top: -120px;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.22);
    filter: blur(8px);
}

.compact-hero > div {
    position: relative;
    max-width: 760px;
}

.compact-hero h1 {
    margin: 0 0 14px;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.06;
    letter-spacing: -0.05em;
}

.compact-hero p:last-child {
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 18px;
    line-height: 1.8;
}

.category-card {
    overflow: hidden;
    border-radius: var(--radius);
}

.category-card-images {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    min-height: 210px;
    border-radius: 0;
}

.category-card-images img {
    min-width: 0;
}

.category-card-body {
    padding: 22px;
}

.category-card h2 {
    font-size: 24px;
}

.category-card p {
    min-height: 52px;
}

.detail-wrap {
    margin-top: 28px;
}

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

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

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

.detail-main,
.detail-side .side-card {
    border-radius: var(--radius);
}

.detail-main {
    padding: clamp(18px, 3vw, 28px);
}

.player-shell {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: 22px;
    background: #030712;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.player-shell video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #030712;
    object-fit: contain;
    z-index: 1;
}

.player-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 0;
    color: #ffffff;
    background: linear-gradient(180deg, rgba(3, 7, 18, 0.2), rgba(3, 7, 18, 0.7));
    cursor: pointer;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.player-overlay-icon {
    display: grid;
    place-items: center;
    width: 78px;
    height: 78px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.24);
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(12px);
}

.player-overlay-title {
    max-width: min(620px, calc(100% - 40px));
    font-size: clamp(22px, 4vw, 36px);
    font-weight: 850;
    line-height: 1.2;
    text-align: center;
}

.player-overlay-subtitle {
    color: rgba(255, 255, 255, 0.78);
}

.detail-main h1 {
    margin-top: 26px;
    font-size: clamp(30px, 5vw, 48px);
    line-height: 1.15;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
    color: var(--muted);
}

.detail-meta span {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f3f4f6;
}

.detail-panel {
    margin-top: 22px;
    padding: clamp(18px, 3vw, 24px);
    border-radius: 18px;
    background: linear-gradient(135deg, #f9fafb, #f1f5f9);
}

.review-panel {
    background: linear-gradient(135deg, #eff6ff, #ecfeff);
}

.detail-panel h2 {
    margin-bottom: 12px;
    font-size: 22px;
}

.detail-panel p {
    margin: 0;
    color: #374151;
    line-height: 1.92;
}

.detail-poster {
    display: block;
    overflow: hidden;
    border-radius: 22px;
    box-shadow: var(--shadow);
}

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

.side-card {
    margin-top: 20px;
    padding: 22px;
}

.side-card h2 {
    margin-bottom: 12px;
    font-size: 22px;
}

.side-card p {
    margin: 10px 0;
    color: #4b5563;
    line-height: 1.6;
}

.site-footer {
    margin-top: 68px;
    color: #d1d5db;
    background: linear-gradient(135deg, #111827, #0f172a);
}

.footer-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 32px;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0;
}

.footer-logo .brand-icon {
    color: #111827;
    background: #ffffff;
}

.footer-logo .brand-text strong {
    color: #ffffff;
}

.footer-logo .brand-text em,
.footer-brand p {
    color: #9ca3af;
}

.footer-brand p {
    max-width: 620px;
}

.footer-links h2 {
    margin: 0 0 16px;
    color: #ffffff;
    font-size: 18px;
}

.footer-links div {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-links a {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    color: #d1d5db;
}

.footer-links a:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.38);
}

.is-filtered-out,
.is-query-hidden {
    display: none !important;
}

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

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

    .hero-slide {
        grid-template-columns: 1fr;
        align-content: center;
        gap: 28px;
        padding-top: 52px;
        padding-bottom: 88px;
    }

    .hero-poster {
        justify-self: start;
        width: min(260px, 72vw);
    }

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

    .detail-side {
        display: grid;
        grid-template-columns: 210px minmax(0, 1fr);
        gap: 18px;
        align-items: start;
    }

    .side-card {
        margin-top: 0;
    }
}

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

    .brand-text strong {
        font-size: 17px;
    }

    .brand-icon {
        width: 38px;
        height: 38px;
    }

    .hero-shell,
    .hero-slides {
        min-height: 700px;
    }

    .hero-content h1 {
        font-size: 42px;
    }

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

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

    .movie-card-compact {
        flex-basis: 146px;
    }

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

    .category-card-images {
        min-height: 160px;
    }

    .footer-inner {
        padding: 36px 0;
    }
}
