* {
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --accent: #7c3aed;
    --accent-soft: #eef2ff;
    --text: #111827;
    --muted: #64748b;
    --line: #e5e7eb;
    --soft: #f8fafc;
    --dark: #0f172a;
    --shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
    --radius: 20px;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    color: var(--text);
    background: #ffffff;
}

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

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

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

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

.brand,
.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 14px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 12px 25px rgba(37, 99, 235, 0.28);
}

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

.brand-copy strong {
    font-size: 20px;
    color: var(--primary);
}

.brand-copy small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.desktop-nav {
    display: flex;
    gap: 24px;
    margin-left: auto;
}

.nav-link,
.mobile-nav-link {
    font-weight: 700;
    color: #475569;
    transition: color 0.2s ease;
}

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

.header-search {
    display: flex;
    width: 275px;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    background: #ffffff;
}

.header-search input,
.mobile-search input,
.big-search input,
.search-line input,
.select-line select {
    width: 100%;
    border: 0;
    outline: 0;
    font: inherit;
    color: var(--text);
    background: #ffffff;
}

.header-search input {
    padding: 11px 12px;
}

.header-search button,
.mobile-search button {
    border: 0;
    padding: 0 14px;
    color: #ffffff;
    font-weight: 700;
    background: var(--primary);
    cursor: pointer;
}

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

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 4px auto;
    background: #334155;
}

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

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

.mobile-panel nav {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
}

.mobile-search {
    display: flex;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
}

.mobile-search input {
    padding: 12px;
}

main {
    min-height: 60vh;
}

.home-hero {
    position: relative;
    padding: 24px 0 0;
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 45%, #faf5ff 100%);
}

.hero-carousel {
    position: relative;
    width: min(1180px, calc(100% - 32px));
    min-height: 530px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 32px;
    box-shadow: 0 30px 70px rgba(15, 23, 42, 0.22);
    background: var(--dark);
}

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

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

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
}

.hero-mask {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.92) 0%, rgba(15, 23, 42, 0.55) 48%, rgba(15, 23, 42, 0.08) 100%);
}

.hero-content {
    position: absolute;
    left: 7%;
    bottom: 12%;
    width: min(610px, 82%);
    color: #ffffff;
}

.eyebrow,
.section-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: 12px;
    padding: 6px 12px;
    border-radius: 999px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--primary), var(--accent));
}

.hero-content h1 {
    margin: 0 0 18px;
    font-size: clamp(36px, 6vw, 72px);
    line-height: 1.02;
}

.hero-content p {
    max-width: 620px;
    margin: 0 0 18px;
    color: #dbeafe;
    font-size: 18px;
    line-height: 1.8;
}

.hero-meta,
.detail-meta,
.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-meta span,
.detail-meta span {
    padding: 8px 12px;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(8px);
}

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

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

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

.btn-light {
    color: var(--primary);
    background: #ffffff;
}

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

.btn-primary {
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.24);
}

.hero-control {
    position: absolute;
    top: 50%;
    z-index: 5;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    font-size: 34px;
    line-height: 1;
    background: rgba(15, 23, 42, 0.5);
    cursor: pointer;
}

.hero-control.prev {
    left: 22px;
}

.hero-control.next {
    right: 22px;
}

.hero-dots {
    position: absolute;
    left: 7%;
    bottom: 38px;
    display: flex;
    gap: 8px;
}

.hero-dots button {
    width: 28px;
    height: 4px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
}

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

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

.section-soft,
.section-gradient {
    width: 100%;
    padding-left: max(16px, calc((100% - 1180px) / 2));
    padding-right: max(16px, calc((100% - 1180px) / 2));
}

.section-soft {
    background: var(--soft);
}

.section-gradient {
    color: #ffffff;
    background: linear-gradient(135deg, #1e3a8a, #6d28d9);
}

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

.section-head h2 {
    margin: 0 0 8px;
    font-size: clamp(28px, 4vw, 42px);
}

.section-head p {
    max-width: 700px;
    margin: 0;
    color: var(--muted);
    line-height: 1.8;
}

.section-head.light p,
.section-more.light {
    color: #dbeafe;
}

.section-more {
    color: var(--primary);
    font-weight: 800;
    white-space: nowrap;
}

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

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

.category-card {
    position: relative;
    display: grid;
    min-height: 170px;
    padding: 24px;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.07);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

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

.category-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    margin-bottom: 22px;
    border-radius: 14px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
}

.category-card strong {
    font-size: 20px;
}

.category-card small,
.category-card em {
    margin-top: 8px;
    color: var(--muted);
    font-style: normal;
    line-height: 1.6;
}

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

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

.all-grid {
    grid-template-columns: repeat(5, 1fr);
}

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

.poster {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: #e2e8f0;
}

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

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

.poster-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 5px 9px;
    border-radius: 999px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    background: rgba(15, 23, 42, 0.72);
}

.card-body {
    padding: 16px;
}

.card-meta {
    gap: 8px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
}

.card-body h3 {
    margin: 10px 0 8px;
    font-size: 18px;
    line-height: 1.35;
}

.card-body p {
    min-height: 44px;
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-row span {
    padding: 5px 8px;
    border-radius: 999px;
    color: #475569;
    font-size: 12px;
    background: #f1f5f9;
}

.tag-row.big span {
    padding: 8px 12px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
}

.compact-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.mini-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.mini-card img {
    width: 58px;
    height: 76px;
    border-radius: 12px;
    object-fit: cover;
}

.mini-card strong,
.mini-card small {
    display: block;
}

.mini-card small {
    margin-top: 6px;
    color: #bfdbfe;
}

.rank-no {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 12px;
    color: #ffffff;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), var(--accent));
}

.split-panel,
.search-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: center;
    padding: 32px;
    border-radius: 28px;
    background: linear-gradient(135deg, #eff6ff, #faf5ff);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.big-search,
.search-line,
.select-line {
    display: flex;
    gap: 12px;
}

.big-search input,
.search-line input,
.select-line select {
    min-height: 48px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
}

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

.page-hero {
    padding: 76px max(16px, calc((100% - 1180px) / 2));
}

.small-hero {
    padding-top: 56px;
    padding-bottom: 56px;
}

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

.page-hero p {
    max-width: 760px;
    margin: 0;
    color: #dbeafe;
    font-size: 18px;
    line-height: 1.8;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.filter-pill {
    min-height: 38px;
    border: 0;
    border-radius: 999px;
    padding: 0 16px;
    color: #475569;
    font-weight: 800;
    background: #f1f5f9;
    cursor: pointer;
}

.filter-pill.is-active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
}

.rank-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
}

.rank-main {
    display: grid;
    gap: 18px;
}

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

.movie-card-wide .poster {
    aspect-ratio: auto;
    min-height: 220px;
}

.rank-side {
    position: sticky;
    top: 92px;
    align-self: start;
    padding: 20px;
    border-radius: 24px;
    background: var(--dark);
    color: #ffffff;
}

.rank-side h2 {
    margin: 0 0 16px;
}

.rank-side .mini-card {
    margin-bottom: 10px;
}

.search-panel {
    grid-template-columns: 1fr;
    margin-bottom: 28px;
}

.search-count {
    margin: 0;
    color: var(--muted);
    font-weight: 800;
}

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

.detail-bg {
    position: absolute;
    inset: 0;
}

.detail-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(16px) brightness(0.45);
    transform: scale(1.06);
}

.detail-inner {
    position: relative;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 64px 0;
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.8fr);
    gap: 34px;
    align-items: center;
}

.player-shell {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: 28px;
    background: #000000;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.38);
}

.movie-player {
    width: 100%;
    height: 100%;
    background: #000000;
}

.player-cover {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    border: 0;
    color: #ffffff;
    text-align: center;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.25), rgba(15, 23, 42, 0.78));
    cursor: pointer;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.play-ring {
    display: grid;
    width: 78px;
    height: 78px;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.55);
    font-size: 28px;
}

.player-cover strong {
    font-size: 24px;
}

.player-cover small {
    color: #dbeafe;
    font-size: 15px;
}

.detail-copy h1 {
    margin: 14px 0;
    font-size: clamp(36px, 5vw, 62px);
    line-height: 1.08;
}

.crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: #dbeafe;
    font-size: 14px;
}

.detail-one-line {
    margin: 0 0 18px;
    color: #dbeafe;
    font-size: 18px;
    line-height: 1.8;
}

.detail-meta {
    margin-bottom: 18px;
}

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

.content-card {
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.07);
}

.content-card h2 {
    margin: 0 0 14px;
}

.content-card p {
    margin: 0;
    color: #334155;
    line-height: 2;
}

.site-footer {
    color: #cbd5e1;
    background: #0f172a;
}

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

.footer-logo strong,
.site-footer h3 {
    color: #ffffff;
}

.footer-logo p,
.site-footer p {
    color: #94a3b8;
    line-height: 1.7;
}

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

.site-footer li {
    margin: 10px 0;
}

.site-footer a:hover {
    color: #ffffff;
}

[data-card].is-hidden {
    display: none;
}

@media (max-width: 1120px) {
    .featured-grid,
    .related-grid,
    .all-grid {
        grid-template-columns: repeat(4, 1fr);
    }

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

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

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

    .menu-toggle {
        display: block;
        margin-left: auto;
    }

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

    .hero-mask {
        background: linear-gradient(180deg, rgba(15, 23, 42, 0.25), rgba(15, 23, 42, 0.92));
    }

    .hero-content {
        left: 24px;
        bottom: 70px;
        width: calc(100% - 48px);
    }

    .hero-control {
        display: none;
    }

    .section-head,
    .split-panel,
    .detail-inner,
    .detail-section,
    .rank-layout,
    .footer-inner {
        grid-template-columns: 1fr;
    }

    .section-head {
        display: grid;
        align-items: start;
    }

    .featured-grid,
    .related-grid,
    .all-grid,
    .movie-grid,
    .category-grid,
    .category-grid.large {
        grid-template-columns: repeat(2, 1fr);
    }

    .rank-side {
        position: static;
    }
}

@media (max-width: 560px) {
    .header-inner {
        height: 66px;
    }

    .brand-copy small {
        display: none;
    }

    .hero-carousel {
        width: calc(100% - 20px);
        min-height: 520px;
        border-radius: 18px;
    }

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

    .hero-content p {
        font-size: 15px;
    }

    .section,
    .section-soft,
    .section-gradient {
        padding-top: 48px;
        padding-bottom: 48px;
    }

    .featured-grid,
    .related-grid,
    .all-grid,
    .movie-grid,
    .category-grid,
    .category-grid.large,
    .compact-list {
        grid-template-columns: 1fr;
    }

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

    .movie-card-wide .poster {
        min-height: auto;
        aspect-ratio: 2 / 3;
    }

    .big-search,
    .search-line,
    .select-line {
        flex-direction: column;
    }

    .detail-inner {
        padding: 38px 0;
    }
}
