:root {
    --page-bg: #f5f7fb;
    --ink: #111827;
    --muted: #5b6575;
    --line: #e5e7eb;
    --brand: #2563eb;
    --brand-strong: #1d4ed8;
    --panel: #ffffff;
    --dark: #0b1020;
    --shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
}

body {
    background: var(--page-bg);
    color: var(--ink);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

img {
    max-width: 100%;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    backdrop-filter: blur(14px);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--ink);
    text-decoration: none;
}

.brand-mark {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    box-shadow: 0 12px 26px rgba(37, 99, 235, 0.28);
}

.brand-text {
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    padding: 0.65rem 0.9rem;
    border-radius: 0.75rem;
    color: #4b5563;
    font-size: 0.95rem;
    font-weight: 650;
    text-decoration: none;
    transition: 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
    color: #1d4ed8;
    background: #dbeafe;
}

.menu-toggle {
    display: none;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 1.25rem;
}

.hero-slider {
    position: relative;
    min-height: 60vh;
    height: 70vh;
    overflow: hidden;
    background: #111827;
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    background-position: center;
    background-size: cover;
    transition: opacity 0.8s ease, visibility 0.8s ease, transform 4.5s ease;
    transform: scale(1.02);
}

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

.hero-layer {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 80% 20%, rgba(37, 99, 235, 0.28), transparent 32%),
        linear-gradient(90deg, rgba(4, 8, 20, 0.92) 0%, rgba(4, 8, 20, 0.62) 48%, rgba(4, 8, 20, 0.14) 100%),
        linear-gradient(0deg, rgba(0, 0, 0, 0.45), transparent 55%);
}

.hero-content {
    position: relative;
    max-width: 760px;
    margin-left: max(1rem, calc((100vw - 1280px) / 2 + 1rem));
    padding-right: 1rem;
    color: #fff;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.92);
    box-shadow: 0 18px 50px rgba(37, 99, 235, 0.3);
    backdrop-filter: blur(8px);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 1.15rem;
}

.hero-content h1 {
    font-size: clamp(2.4rem, 6vw, 4.8rem);
    line-height: 1;
    letter-spacing: -0.055em;
    font-weight: 900;
    margin: 0 0 1rem;
}

.hero-content p {
    color: rgba(241, 245, 249, 0.9);
    font-size: clamp(1rem, 2vw, 1.25rem);
    line-height: 1.75;
    max-width: 680px;
    margin: 0 0 1.2rem;
}

.hero-tags,
.detail-tags,
.card-tags,
.overview-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.hero-tags span,
.detail-tags span {
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 0.9rem;
    backdrop-filter: blur(8px);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.primary-button,
.ghost-button,
.text-button,
.clear-search {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 750;
    text-decoration: none;
    transition: 0.2s ease;
}

.primary-button {
    background: var(--brand);
    color: #fff;
    padding: 0.85rem 1.45rem;
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.32);
}

.primary-button:hover {
    background: var(--brand-strong);
    transform: translateY(-1px);
}

.ghost-button {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.36);
    padding: 0.85rem 1.45rem;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
}

.ghost-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.hero-arrow {
    position: absolute;
    top: 50%;
    width: 3rem;
    height: 3rem;
    transform: translateY(-50%);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.48);
    color: #fff;
    font-size: 2rem;
    backdrop-filter: blur(8px);
    transition: 0.2s ease;
}

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

.hero-prev {
    left: 1rem;
}

.hero-next {
    right: 1rem;
}

.hero-dots {
    position: absolute;
    left: 50%;
    bottom: 2rem;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

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

.hero-dot.is-active {
    width: 2.2rem;
    background: #fff;
}

.page-main,
.detail-main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2.5rem 1rem 4rem;
}

.narrow-page {
    max-width: 1080px;
}

.content-section {
    margin-top: 3rem;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.section-heading h2,
.page-title-block h1,
.detail-copy h1,
.player-section h2,
.detail-article h2 {
    color: var(--ink);
    font-weight: 850;
    letter-spacing: -0.04em;
}

.section-heading h2 {
    font-size: clamp(1.45rem, 3vw, 2rem);
}

.section-link,
.text-button {
    color: var(--brand);
    font-weight: 750;
    text-decoration: none;
}

.section-link:hover,
.text-button:hover {
    color: var(--brand-strong);
}

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

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

.poster-link {
    display: block;
    height: 100%;
    overflow: hidden;
    border-radius: 1rem;
    background: var(--panel);
    color: inherit;
    text-decoration: none;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    transition: 0.25s ease;
}

.poster-link:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.poster-frame {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #dbe2ea;
}

.card-wide .poster-frame {
    aspect-ratio: 16 / 9;
}

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

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

.poster-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.58), transparent 48%);
    opacity: 0.9;
}

.type-badge,
.year-badge {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    max-width: calc(100% - 1rem);
    padding: 0.35rem 0.55rem;
    border-radius: 0.55rem;
    background: rgba(0, 0, 0, 0.68);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    backdrop-filter: blur(8px);
}

.type-badge {
    top: 0.55rem;
    right: 0.55rem;
}

.year-badge {
    left: 0.55rem;
    bottom: 0.55rem;
}

.card-copy {
    padding: 0.95rem;
}

.card-copy h3 {
    font-weight: 800;
    color: var(--ink);
    margin: 0 0 0.45rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: 0.2s ease;
}

.poster-link:hover h3 {
    color: var(--brand);
}

.card-copy p {
    min-height: 2.8em;
    margin: 0 0 0.7rem;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-tags {
    margin-bottom: 0.7rem;
}

.card-tags span,
.overview-chips span {
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #374151;
    font-size: 0.75rem;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    color: #6b7280;
    font-size: 0.8rem;
}

.movie-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(180px, 220px);
    gap: 1rem;
    overflow-x: auto;
    padding: 0.25rem 0.25rem 1rem;
    scroll-behavior: smooth;
    scrollbar-width: thin;
}

.scroll-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.scroll-actions button {
    width: 2.45rem;
    height: 2.45rem;
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
    font-size: 1.45rem;
}

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

.category-card {
    position: relative;
    min-height: 160px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    border-radius: 1.2rem;
    padding: 1.2rem;
    color: #fff;
    text-decoration: none;
    box-shadow: var(--shadow);
}

.category-cover,
.category-mask {
    position: absolute;
    inset: 0;
}

.category-cover {
    background-position: center;
    background-size: cover;
    transform: scale(1.03);
    transition: transform 0.45s ease;
}

.category-card:hover .category-cover {
    transform: scale(1.1);
}

.category-mask {
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.1));
}

.category-card strong,
.category-card em {
    position: relative;
    z-index: 2;
}

.category-card strong {
    font-size: 1.25rem;
    font-style: normal;
}

.category-card em {
    margin-top: 0.25rem;
    color: rgba(255, 255, 255, 0.78);
    font-style: normal;
}

.rank-list {
    display: grid;
    gap: 0.75rem;
}

.rank-item {
    display: grid;
    grid-template-columns: 3rem 5rem 1fr auto;
    gap: 0.9rem;
    align-items: center;
    padding: 0.7rem;
    border-radius: 1rem;
    background: #fff;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.07);
    transition: 0.2s ease;
}

.rank-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.rank-no {
    color: var(--brand);
    font-size: 1.15rem;
    font-weight: 900;
    text-align: center;
}

.rank-item img {
    width: 5rem;
    aspect-ratio: 16 / 10;
    border-radius: 0.7rem;
    object-fit: cover;
}

.rank-copy {
    min-width: 0;
}

.rank-copy strong,
.rank-copy em {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.rank-copy strong {
    font-weight: 800;
}

.rank-copy em {
    color: var(--muted);
    font-style: normal;
    font-size: 0.85rem;
}

.rank-score {
    padding: 0.35rem 0.55rem;
    border-radius: 0.6rem;
    background: #fef3c7;
    color: #92400e;
    font-weight: 800;
}

.page-title-block {
    padding: 2.3rem;
    border-radius: 1.4rem;
    background: linear-gradient(135deg, #fff, #eef5ff);
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
}

.page-title-block h1 {
    font-size: clamp(2rem, 5vw, 3.6rem);
    margin: 0 0 0.75rem;
}

.page-title-block p {
    max-width: 760px;
    color: var(--muted);
    line-height: 1.75;
    margin: 0;
}

.eyebrow {
    color: var(--brand);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.55rem;
}

.search-panel {
    display: flex;
    gap: 0.75rem;
    margin: 1.4rem 0;
    padding: 0.6rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.site-search {
    flex: 1;
    min-width: 0;
    padding: 0.8rem 1rem;
    border-radius: 0.8rem;
    outline: none;
    background: #f8fafc;
    color: var(--ink);
}

.site-search:focus {
    box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.35);
}

.clear-search {
    padding: 0 1rem;
    color: #fff;
    background: var(--brand);
}

.empty-search {
    display: none;
    color: var(--muted);
    padding: 1rem;
    border-radius: 0.9rem;
    background: #fff;
}

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

.category-overview-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
}

.category-overview {
    display: grid;
    grid-template-columns: minmax(180px, 280px) 1fr;
    gap: 1.25rem;
    padding: 1rem;
    border-radius: 1.2rem;
    background: #fff;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.category-overview-image {
    min-height: 180px;
    border-radius: 1rem;
    background-size: cover;
    background-position: center;
}

.category-overview h2 {
    margin: 0.35rem 0;
    font-size: 1.5rem;
    font-weight: 850;
}

.category-overview h2 a {
    color: inherit;
    text-decoration: none;
}

.category-overview p {
    color: var(--muted);
    line-height: 1.65;
}

.overview-chips {
    margin: 0.8rem 0 1rem;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    color: #64748b;
    font-size: 0.95rem;
}

.breadcrumb a {
    color: var(--brand);
    text-decoration: none;
}

.detail-hero {
    display: grid;
    grid-template-columns: minmax(210px, 320px) 1fr;
    gap: 2rem;
    align-items: center;
    padding: 1.2rem;
    border-radius: 1.5rem;
    background: linear-gradient(135deg, #fff, #edf4ff);
    box-shadow: var(--shadow);
}

.detail-poster img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 1.2rem;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.22);
}

.detail-copy h1 {
    font-size: clamp(2rem, 5vw, 4rem);
    margin: 0.2rem 0 1rem;
}

.detail-one-line {
    color: #334155;
    font-size: 1.1rem;
    line-height: 1.75;
    margin-bottom: 1rem;
}

.detail-tags span {
    background: #dbeafe;
    color: #1e3a8a;
}

.detail-meta-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.2rem;
}

.detail-meta-list span {
    padding: 0.55rem 0.85rem;
    border-radius: 0.8rem;
    background: #fff;
    color: #334155;
    font-weight: 650;
}

.player-section,
.detail-article {
    margin-top: 2rem;
    padding: 1.2rem;
    border-radius: 1.3rem;
    background: #fff;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.player-section h2,
.detail-article h2 {
    font-size: 1.55rem;
    margin: 0 0 1rem;
}

.player-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 1.1rem;
    background: #050816;
    aspect-ratio: 16 / 9;
}

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

.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.46), rgba(0, 0, 0, 0.1));
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.player-overlay span {
    width: 5rem;
    height: 5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.96);
    color: #fff;
    font-size: 2rem;
    box-shadow: 0 18px 45px rgba(37, 99, 235, 0.4);
}

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

.detail-article p {
    color: #334155;
    font-size: 1.02rem;
    line-height: 1.9;
    margin-bottom: 1.3rem;
}

.related-section {
    margin-top: 2rem;
}

.site-footer {
    background: #0b1020;
    color: #cbd5e1;
    padding: 2.5rem 1rem;
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    gap: 0.9rem;
}

.footer-logo {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 850;
    text-decoration: none;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links a {
    color: #93c5fd;
    text-decoration: none;
}

@media (min-width: 640px) {
    .movie-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.25rem;
    }

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

@media (min-width: 900px) {
    .movie-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

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

@media (min-width: 1180px) {
    .movie-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .main-nav {
        position: absolute;
        left: 1rem;
        right: 1rem;
        top: calc(100% + 0.4rem);
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 0.7rem;
        border-radius: 1rem;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: var(--shadow);
    }

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

    .hero-slider {
        height: 72vh;
    }

    .hero-content {
        margin-left: 1rem;
        margin-right: 1rem;
        padding-top: 2rem;
    }

    .hero-arrow {
        top: auto;
        bottom: 1rem;
        transform: none;
    }

    .hero-dots {
        bottom: 1.35rem;
    }

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

    .search-panel {
        flex-direction: column;
    }

    .clear-search {
        min-height: 2.7rem;
    }

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

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

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

    .rank-item {
        grid-template-columns: 2.2rem 4.5rem 1fr;
    }

    .rank-score {
        grid-column: 2 / 4;
        width: max-content;
    }
}
