:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-soft: #f1f5f9;
    --text: #0f172a;
    --muted: #64748b;
    --muted-strong: #334155;
    --line: #e2e8f0;
    --red: #dc2626;
    --red-dark: #b91c1c;
    --orange: #f97316;
    --blue: #2563eb;
    --blue-dark: #1e3a8a;
    --purple: #7e22ce;
    --shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

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

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

button,
input,
select {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(18px);
}

.nav-shell,
.footer-shell,
.container {
    width: min(1280px, calc(100% - 40px));
    margin: 0 auto;
}

.nav-shell {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 76px;
}

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

.brand-mark {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 14px;
    color: #fff;
    font-size: 24px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--red), var(--orange));
    box-shadow: 0 12px 24px rgba(220, 38, 38, 0.26);
    transition: transform 0.25s ease;
}

.brand:hover .brand-mark {
    transform: scale(1.08) rotate(-4deg);
}

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

.brand-text strong {
    font-size: 20px;
    font-weight: 900;
    color: #1e293b;
}

.site-footer .brand-text strong {
    color: #fff;
}

.brand-text em {
    margin-top: 4px;
    color: #94a3b8;
    font-size: 12px;
    font-style: normal;
}

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

.desktop-nav a,
.mobile-panel a {
    color: var(--muted-strong);
    font-weight: 700;
    transition: color 0.2s ease;
}

.desktop-nav a:hover,
.mobile-panel a:hover {
    color: var(--red);
}

.header-search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 290px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
}

.header-search input,
.mobile-search input,
.search-panel input,
.search-panel select {
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
}

.header-search input {
    flex: 1;
    padding-left: 10px;
}

.header-search button,
.mobile-search button,
.search-panel button {
    border: 0;
    border-radius: 999px;
    padding: 8px 14px;
    color: #fff;
    font-weight: 800;
    background: linear-gradient(135deg, var(--red), var(--orange));
    cursor: pointer;
}

.menu-toggle {
    display: none;
    margin-left: auto;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 14px;
    color: #fff;
    font-size: 22px;
    background: linear-gradient(135deg, var(--red), var(--orange));
}

.mobile-panel {
    display: none;
    padding: 0 20px 20px;
    border-top: 1px solid var(--line);
    background: #fff;
}

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

.mobile-panel nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.mobile-panel nav a {
    padding: 14px;
    border-radius: 16px;
    background: var(--surface-soft);
}

.mobile-search {
    display: flex;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 18px;
}

.mobile-search input {
    flex: 1;
}

.hero-carousel {
    position: relative;
    min-height: 660px;
    overflow: hidden;
    color: #fff;
    background: #020617;
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 430px);
    align-items: center;
    gap: 60px;
    padding: 96px max(32px, calc((100vw - 1280px) / 2)) 80px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
}

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

.hero-slide::before {
    position: absolute;
    inset: 0;
    content: "";
    background-image: linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(30, 41, 59, 0.84) 44%, rgba(15, 23, 42, 0.56) 100%), var(--cover-image);
    background-size: cover;
    background-position: center;
    filter: saturate(1.12);
    transform: scale(1.05);
}

.hero-backdrop {
    position: absolute;
    inset: auto 10% -24% auto;
    width: 480px;
    height: 480px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(248, 113, 113, 0.32), rgba(37, 99, 235, 0));
}

.hero-content,
.hero-cover {
    position: relative;
    z-index: 2;
}

.hero-kicker,
.page-kicker,
.section-heading span {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 8px 14px;
    border-radius: 999px;
    color: #fee2e2;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.04em;
    background: rgba(220, 38, 38, 0.22);
    border: 1px solid rgba(248, 113, 113, 0.36);
}

.hero-content h1 {
    max-width: 760px;
    margin: 22px 0 20px;
    font-size: clamp(42px, 8vw, 82px);
    line-height: 0.95;
    font-weight: 950;
    letter-spacing: -0.06em;
}

.hero-content p {
    max-width: 720px;
    margin: 0;
    color: #cbd5e1;
    font-size: 20px;
    line-height: 1.75;
}

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

.hero-tags {
    margin-top: 26px;
}

.hero-tags span,
.tag-row span,
.meta-tags span {
    display: inline-flex;
    border-radius: 999px;
    padding: 6px 10px;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.tag-row span,
.meta-tags span {
    color: var(--red-dark);
    background: #fee2e2;
    border-color: #fecaca;
}

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

.primary-action,
.ghost-action,
.section-more,
.pager a,
.filter-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 900;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.primary-action {
    min-height: 50px;
    padding: 0 24px;
    color: #fff;
    background: linear-gradient(135deg, var(--red), var(--orange));
    box-shadow: 0 16px 30px rgba(220, 38, 38, 0.28);
}

.ghost-action {
    min-height: 50px;
    padding: 0 24px;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.primary-action:hover,
.ghost-action:hover,
.section-more:hover,
.pager a:hover,
.filter-chip:hover {
    transform: translateY(-2px);
}

.hero-cover-art,
.poster-surface,
.detail-poster-art,
.player-cover {
    background-image: linear-gradient(135deg, rgba(15, 23, 42, 0.12), rgba(220, 38, 38, 0.24)), var(--cover-image);
    background-size: cover;
    background-position: center;
}

.hero-cover-art {
    display: block;
    aspect-ratio: 3 / 4;
    border-radius: 34px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.46);
    border: 1px solid rgba(255, 255, 255, 0.24);
    transform: rotate(2deg);
}

.hero-controls {
    position: absolute;
    right: max(24px, calc((100vw - 1280px) / 2));
    bottom: 34px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero-controls button,
.carousel-dot {
    border: 0;
    cursor: pointer;
}

.hero-controls button {
    width: 46px;
    height: 46px;
    border-radius: 999px;
    color: #fff;
    font-size: 22px;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(10px);
}

.hero-dots {
    display: flex;
    gap: 8px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.36);
}

.carousel-dot.is-active {
    width: 30px;
    background: #fff;
}

.section,
.page-section {
    padding: 70px 0;
}

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

.section-heading h2 {
    margin: 14px 0 10px;
    color: #0f172a;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.1;
    font-weight: 950;
    letter-spacing: -0.04em;
}

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

.section-more,
.pager a,
.filter-chip {
    padding: 12px 18px;
    color: var(--blue);
    background: #dbeafe;
}

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

.movie-card {
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.poster-link {
    display: block;
}

.poster-surface {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
}

.poster-surface::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 44%, rgba(2, 6, 23, 0.74) 100%);
}

.poster-year {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    padding: 5px 9px;
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    background: rgba(0, 0, 0, 0.48);
}

.poster-play {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 2;
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, var(--red), var(--orange));
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
    transform: scale(0.92);
    transition: transform 0.2s ease;
}

.movie-card:hover .poster-play {
    transform: scale(1.06);
}

.movie-card-body {
    padding: 18px;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.card-meta a {
    color: var(--red);
}

.card-meta span::before {
    content: "·";
    margin-right: 8px;
    color: #cbd5e1;
}

.movie-card h3 {
    margin: 0 0 10px;
    font-size: 19px;
    line-height: 1.35;
    font-weight: 950;
}

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

.movie-card p {
    display: -webkit-box;
    min-height: 46px;
    margin: 0 0 14px;
    overflow: hidden;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

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

.category-card {
    min-height: 190px;
    padding: 26px;
    border-radius: var(--radius);
    color: #fff;
    background: linear-gradient(135deg, #1e3a8a, #7e22ce 55%, #dc2626);
    box-shadow: var(--shadow);
    transition: transform 0.25s ease;
}

.category-card:nth-child(2n) {
    background: linear-gradient(135deg, #0f172a, #2563eb 48%, #f97316);
}

.category-card:hover {
    transform: translateY(-6px);
}

.category-card h3 {
    margin: 0 0 12px;
    font-size: 26px;
    font-weight: 950;
}

.category-card p {
    margin: 0 0 18px;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.7;
}

.category-card strong {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
}

.page-hero,
.detail-hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    background: radial-gradient(circle at top right, rgba(220, 38, 38, 0.34), transparent 34%), linear-gradient(135deg, #020617, #1e3a8a 48%, #0f172a);
}

.page-hero .container {
    position: relative;
    z-index: 2;
    padding: 80px 0;
}

.page-hero h1,
.detail-copy h1 {
    max-width: 920px;
    margin: 18px 0 18px;
    font-size: clamp(36px, 6vw, 64px);
    line-height: 1.02;
    font-weight: 950;
    letter-spacing: -0.05em;
}

.page-hero p,
.detail-copy p {
    max-width: 820px;
    margin: 0;
    color: #cbd5e1;
    font-size: 18px;
    line-height: 1.8;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-top: 38px;
}

.stat-card {
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
}

.stat-card strong {
    display: block;
    color: #fde68a;
    font-size: 30px;
    font-weight: 950;
}

.stat-card span {
    color: #cbd5e1;
    font-size: 14px;
}

.rank-list {
    display: grid;
    gap: 14px;
}

.rank-item {
    display: grid;
    grid-template-columns: 64px 82px minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 14px;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.rank-no {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 15px;
    color: #fff;
    font-size: 20px;
    font-weight: 950;
    background: linear-gradient(135deg, var(--red), var(--orange));
}

.rank-thumb {
    display: block;
    aspect-ratio: 3 / 4;
    border-radius: 14px;
    background-image: linear-gradient(135deg, rgba(15, 23, 42, 0.1), rgba(220, 38, 38, 0.24)), var(--cover-image);
    background-size: cover;
    background-position: center;
}

.rank-info h3 {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 950;
}

.rank-info p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.rank-score {
    color: var(--red);
    font-size: 22px;
    font-weight: 950;
}

.search-panel {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) repeat(3, minmax(130px, 180px)) auto;
    gap: 12px;
    padding: 18px;
    border-radius: 22px;
    background: #fff;
    box-shadow: var(--shadow);
}

.search-panel input,
.search-panel select {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-soft);
}

.search-empty {
    display: none;
    padding: 34px;
    border-radius: var(--radius);
    text-align: center;
    color: var(--muted);
    background: #fff;
}

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

.pager {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.pager a.is-current {
    color: #fff;
    background: linear-gradient(135deg, var(--red), var(--orange));
}

.detail-hero {
    padding: 70px 0;
}

.detail-layout {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 46px;
    align-items: center;
}

.detail-poster-art {
    display: block;
    aspect-ratio: 3 / 4;
    border-radius: 30px;
    box-shadow: 0 34px 70px rgba(0, 0, 0, 0.4);
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 24px 0;
}

.detail-meta span,
.detail-meta a {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    color: #fff;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.player-section {
    padding: 60px 0 30px;
}

.player-shell {
    overflow: hidden;
    border-radius: 30px;
    background: #020617;
    box-shadow: var(--shadow);
}

.player-box {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
}

.player-box video {
    width: 100%;
    height: 100%;
    background: #000;
}

.player-cover {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 0;
    color: #fff;
    cursor: pointer;
}

.player-cover::before {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.22), rgba(2, 6, 23, 0.72));
}

.player-cover.is-hidden {
    display: none;
}

.player-button-core {
    position: relative;
    z-index: 2;
    display: grid;
    width: 94px;
    height: 94px;
    place-items: center;
    border-radius: 999px;
    font-size: 42px;
    background: linear-gradient(135deg, var(--red), var(--orange));
    box-shadow: 0 18px 42px rgba(220, 38, 38, 0.34);
    transition: transform 0.2s ease;
}

.player-cover:hover .player-button-core {
    transform: scale(1.08);
}

.player-caption {
    padding: 24px;
    color: #cbd5e1;
}

.player-caption h2 {
    margin: 0 0 10px;
    color: #fff;
    font-size: 26px;
    font-weight: 950;
}

.player-caption p {
    margin: 0;
    line-height: 1.75;
}

.content-card {
    padding: 32px;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.content-card h2 {
    margin: 0 0 16px;
    font-size: 28px;
    font-weight: 950;
}

.content-card p {
    margin: 0 0 16px;
    color: var(--muted-strong);
    font-size: 17px;
    line-height: 1.9;
}

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

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    color: #cbd5e1;
    font-size: 14px;
}

.breadcrumb a {
    color: #fff;
    font-weight: 800;
}

.library-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.library-nav a {
    padding: 16px;
    border-radius: 18px;
    color: var(--blue-dark);
    font-weight: 900;
    text-align: center;
    background: #dbeafe;
    transition: transform 0.2s ease;
}

.library-nav a:hover {
    transform: translateY(-3px);
}

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

    .menu-toggle {
        display: block;
    }

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

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

@media (max-width: 900px) {
    .hero-carousel {
        min-height: 760px;
    }

    .hero-slide {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 72px 24px 86px;
    }

    .hero-cover-art {
        width: min(260px, 70vw);
        margin: 0 auto;
    }

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

    .category-cards,
    .stats-row,
    .library-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .search-panel {
        grid-template-columns: 1fr 1fr;
    }

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

    .detail-poster-art {
        width: min(300px, 80vw);
    }

    .rank-item {
        grid-template-columns: 52px 72px minmax(0, 1fr);
    }

    .rank-score {
        grid-column: 3;
    }
}

@media (max-width: 640px) {
    .nav-shell,
    .footer-shell,
    .container {
        width: min(100% - 28px, 1280px);
    }

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

    .hero-content h1,
    .page-hero h1,
    .detail-copy h1 {
        font-size: 38px;
    }

    .hero-content p,
    .page-hero p,
    .detail-copy p {
        font-size: 16px;
    }

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

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

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

    .category-cards,
    .stats-row,
    .search-panel,
    .library-nav {
        grid-template-columns: 1fr;
    }

    .rank-item {
        grid-template-columns: 46px minmax(0, 1fr);
    }

    .rank-thumb {
        display: none;
    }

    .rank-score {
        grid-column: 2;
    }

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

.site-footer {
    margin-top: 60px;
    color: #fff;
    background: linear-gradient(135deg, #020617, #1e3a8a 48%, #020617);
}

.footer-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 34px;
    padding: 56px 0;
}

.footer-shell p {
    max-width: 640px;
    margin: 18px 0 0;
    color: #cbd5e1;
    line-height: 1.8;
}

.footer-links {
    display: grid;
    gap: 12px;
    align-content: start;
}

.footer-links a {
    color: #dbeafe;
    font-weight: 800;
}

.footer-bottom {
    padding: 18px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    text-align: center;
}
