:root {
    --primary-900: #333d4f;
    --primary-800: #39475d;
    --primary-700: #435571;
    --primary-600: #506688;
    --primary-100: #ebeef3;
    --accent-500: #eab308;
    --accent-400: #facc15;
    --neutral-950: #0f172a;
    --neutral-900: #171717;
    --neutral-700: #404040;
    --neutral-600: #525252;
    --neutral-500: #737373;
    --neutral-200: #e5e5e5;
    --neutral-100: #f5f5f5;
    --neutral-50: #fafafa;
    --white: #ffffff;
    --shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.18);
    --radius: 16px;
    --radius-sm: 10px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--neutral-900);
    background: var(--neutral-50);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

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

button,
input,
select {
    font: inherit;
}

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

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

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

.site-logo,
.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-900);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.logo-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    color: var(--white);
    background: linear-gradient(135deg, var(--primary-600), var(--primary-900));
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

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

.nav-link {
    color: var(--neutral-700);
    font-weight: 650;
    transition: color 0.2s ease;
}

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

.header-search {
    display: flex;
    align-items: center;
    width: 320px;
    overflow: hidden;
    border: 1px solid #d4d4d4;
    border-radius: 12px;
    background: var(--white);
}

.header-search input {
    min-width: 0;
    flex: 1;
    height: 42px;
    padding: 0 14px;
    border: 0;
    outline: 0;
}

.header-search button,
.search-page-form button {
    height: 42px;
    padding: 0 18px;
    color: var(--white);
    border: 0;
    background: var(--primary-600);
    cursor: pointer;
}

.menu-toggle {
    display: none;
    border: 0;
    background: var(--primary-100);
    color: var(--primary-900);
    width: 42px;
    height: 42px;
    border-radius: 12px;
    cursor: pointer;
}

.hero {
    position: relative;
    height: min(640px, 78vh);
    min-height: 520px;
    overflow: hidden;
    background: var(--neutral-900);
}

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

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

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

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.48), rgba(0, 0, 0, 0.06));
}

.hero-content {
    position: absolute;
    top: 50%;
    left: max(24px, calc((100vw - 1180px) / 2));
    width: min(650px, calc(100% - 48px));
    transform: translateY(-50%);
    color: var(--white);
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--accent-400);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero h1,
.page-hero h1,
.detail-intro h1 {
    margin: 0;
    font-size: clamp(38px, 6vw, 68px);
    line-height: 1.05;
    font-weight: 900;
    letter-spacing: -0.06em;
}

.hero-summary {
    max-width: 620px;
    margin: 22px 0 0;
    color: #e5e7eb;
    font-size: clamp(17px, 2vw, 22px);
    line-height: 1.7;
}

.hero-meta,
.detail-tags,
.rank-meta,
.card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.hero-meta {
    margin-top: 22px;
}

.hero-meta span,
.detail-tags span,
.detail-tags a,
.card-meta a,
.card-meta span,
.rank-meta a,
.rank-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 650;
}

.hero-meta span,
.detail-tags span,
.detail-tags a {
    color: var(--white);
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(8px);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

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

.btn-primary {
    color: var(--white);
    background: var(--primary-600);
    box-shadow: 0 12px 28px rgba(80, 102, 136, 0.32);
}

.btn-primary:hover,
.header-search button:hover,
.search-page-form button:hover {
    background: var(--primary-700);
}

.btn-ghost {
    color: var(--white);
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.24);
}

.btn-primary:hover,
.btn-ghost:hover,
.text-link:hover {
    transform: translateY(-2px);
}

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

.hero-prev {
    left: 20px;
}

.hero-next {
    right: 20px;
}

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

.hero-dots button {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.48);
    cursor: pointer;
    transition: width 0.2s ease, background 0.2s ease;
}

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

.section {
    padding: 54px 0;
}

.nested-section {
    padding-bottom: 0;
}

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

.section-head h2,
.rank-panel h2,
.related-panel h2,
.content-panel h2 {
    margin: 0;
    color: var(--neutral-900);
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.2;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.section-head > a,
.text-link {
    color: var(--primary-600);
    font-weight: 800;
}

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

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

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

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

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

.card-cover {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--primary-100);
}

.movie-card.is-compact .card-cover {
    aspect-ratio: 4 / 3;
}

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

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

.card-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.movie-card:hover .card-cover::after {
    opacity: 1;
}

.card-year {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1;
    padding: 4px 10px;
    color: var(--white);
    background: rgba(0, 0, 0, 0.68);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.card-body {
    padding: 18px;
}

.card-title {
    display: -webkit-box;
    min-height: 54px;
    overflow: hidden;
    color: var(--neutral-900);
    font-size: 18px;
    line-height: 1.5;
    font-weight: 850;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-title:hover,
.rank-title:hover,
.mini-card:hover strong {
    color: var(--primary-600);
}

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

.card-meta a,
.card-meta span,
.rank-meta a,
.rank-meta span {
    color: var(--neutral-600);
    background: var(--primary-100);
}

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

.rank-panel,
.related-panel,
.content-panel,
.category-overview-card,
.filter-panel,
.search-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.rank-panel,
.related-panel,
.content-panel,
.category-overview-card {
    padding: 24px;
}

.rank-list-small {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.rank-list-small a {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border-radius: 12px;
    background: var(--neutral-50);
}

.rank-list-small span {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    color: var(--white);
    background: var(--primary-600);
    border-radius: 50%;
    font-weight: 900;
}

.rank-list-small strong {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.rank-list-small em,
.mini-card em {
    color: var(--neutral-500);
    font-style: normal;
    font-size: 13px;
}

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

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

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

.category-tile::after,
.overview-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(15, 23, 42, 0.86), rgba(15, 23, 42, 0.24));
}

.category-tile span,
.category-tile em {
    position: relative;
    z-index: 1;
    display: block;
}

.category-tile span {
    margin: 108px 18px 6px;
    font-size: 22px;
    font-weight: 900;
}

.category-tile em {
    margin: 0 18px;
    color: #e5e7eb;
    font-style: normal;
    font-size: 13px;
    line-height: 1.5;
}

.page-hero {
    color: var(--white);
    background: radial-gradient(circle at top left, rgba(250, 204, 21, 0.18), transparent 28%), linear-gradient(135deg, var(--primary-900), var(--neutral-950));
    padding: 74px 0;
}

.page-hero p:not(.eyebrow) {
    max-width: 760px;
    color: #e5e7eb;
    font-size: 18px;
    line-height: 1.8;
}

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

.overview-cover {
    position: relative;
    display: block;
    height: 180px;
    overflow: hidden;
    margin: -24px -24px 18px;
    border-radius: var(--radius) var(--radius) 0 0;
}

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

.overview-cover span {
    position: absolute;
    left: 20px;
    bottom: 18px;
    z-index: 1;
    color: var(--white);
    font-size: 25px;
    font-weight: 900;
}

.category-overview-card p {
    color: var(--neutral-600);
    line-height: 1.7;
}

.mini-list {
    display: grid;
    gap: 14px;
    margin: 18px 0;
}

.mini-card {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.mini-card img {
    width: 88px;
    height: 58px;
    object-fit: cover;
    border-radius: 10px;
    transition: transform 0.25s ease;
}

.mini-card strong {
    display: -webkit-box;
    overflow: hidden;
    color: var(--neutral-900);
    font-size: 15px;
    line-height: 1.45;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.filter-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px 180px;
    gap: 14px;
    padding: 18px;
    margin-bottom: 28px;
}

.filter-panel input,
.filter-panel select,
.search-page-form input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid #d4d4d4;
    border-radius: 12px;
    background: var(--white);
    outline: 0;
}

.filter-panel input:focus,
.filter-panel select:focus,
.search-page-form input:focus,
.header-search input:focus {
    border-color: var(--primary-600);
    box-shadow: 0 0 0 3px rgba(80, 102, 136, 0.18);
}

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

.rank-card {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 20px;
    overflow: hidden;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.rank-cover {
    position: relative;
    height: 150px;
    overflow: hidden;
}

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

.rank-cover span {
    position: absolute;
    left: 12px;
    top: 12px;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    color: var(--white);
    background: var(--accent-500);
    border-radius: 50%;
    font-weight: 900;
}

.rank-body {
    padding: 20px 20px 20px 0;
}

.rank-title {
    font-size: 22px;
    font-weight: 900;
}

.rank-body p {
    margin: 10px 0 16px;
    color: var(--neutral-600);
    line-height: 1.7;
}

.top-rank-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    max-width: 850px;
    margin-top: 26px;
}

.search-page-form {
    display: flex;
    max-width: 680px;
    overflow: hidden;
    margin-top: 28px;
    border-radius: 14px;
}

.search-page-form input {
    border-radius: 14px 0 0 14px;
    border-right: 0;
}

.search-page-form button {
    height: 48px;
    border-radius: 0 14px 14px 0;
}

.search-results {
    display: grid;
    gap: 18px;
}

.search-card {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 18px;
    overflow: hidden;
}

.search-card img {
    width: 160px;
    height: 110px;
    object-fit: cover;
}

.search-card div {
    padding: 18px 18px 18px 0;
}

.search-card h2 {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 900;
}

.search-card p {
    margin: 0 0 10px;
    color: var(--neutral-600);
    line-height: 1.6;
}

.detail-hero {
    min-height: 560px;
    color: var(--white);
    background-size: cover;
    background-position: center;
}

.detail-hero-inner {
    display: grid;
    grid-template-columns: 330px minmax(0, 1fr);
    gap: 42px;
    align-items: center;
    min-height: 560px;
    padding: 54px 0;
}

.detail-poster {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 22px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

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

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

.breadcrumb a:hover {
    color: var(--accent-400);
}

.detail-intro p:not(.eyebrow) {
    max-width: 780px;
    color: #e5e7eb;
    font-size: 19px;
    line-height: 1.8;
}

.detail-tags {
    margin: 22px 0 28px;
}

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

.player-shell {
    position: relative;
    overflow: hidden;
    background: #000000;
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
    aspect-ratio: 16 / 9;
}

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

.player-cover {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--white);
    border: 0;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.68));
    cursor: pointer;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.play-ring {
    display: grid;
    place-items: center;
    width: 86px;
    height: 86px;
    padding-left: 6px;
    color: var(--primary-900);
    background: var(--white);
    border-radius: 50%;
    font-size: 34px;
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.34);
}

.player-cover strong {
    max-width: 80%;
    text-align: center;
    font-size: 24px;
}

.content-panel {
    margin-top: 28px;
}

.content-panel h2 {
    margin-top: 22px;
    font-size: 26px;
}

.content-panel h2:first-child {
    margin-top: 0;
}

.content-panel p {
    color: var(--neutral-700);
    font-size: 16px;
    line-height: 1.9;
}

.info-list {
    display: grid;
    gap: 12px;
    margin: 0;
}

.info-list div {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--neutral-200);
}

.info-list dt {
    color: var(--neutral-500);
    font-weight: 800;
}

.info-list dd {
    margin: 0;
    color: var(--neutral-900);
}

.related-panel {
    position: sticky;
    top: 94px;
}

.site-footer {
    margin-top: 42px;
    color: var(--white);
    background: var(--primary-900);
}

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

.footer-logo {
    color: var(--white);
}

.footer-inner p {
    max-width: 560px;
    color: #d4d4d4;
    line-height: 1.7;
}

.footer-links {
    display: grid;
    gap: 12px;
    color: #d4d4d4;
}

.footer-links a:hover {
    color: var(--accent-400);
}

.footer-bottom {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 20px 0;
    color: #d4d4d4;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 14px;
}

[hidden] {
    display: none !important;
}

@media (max-width: 1080px) {
    .movie-grid,
    .all-grid,
    .category-grid,
    .category-overview-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

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

    .related-panel {
        position: static;
    }
}

@media (max-width: 860px) {
    .header-inner {
        height: auto;
        min-height: 66px;
        flex-wrap: wrap;
        gap: 12px;
        padding: 12px 0;
    }

    .site-nav {
        display: none;
        width: 100%;
        order: 4;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin: 0;
        padding: 10px 0;
    }

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

    .nav-link {
        padding: 12px 4px;
    }

    .header-search {
        width: min(100%, 420px);
        margin-left: auto;
    }

    .menu-toggle {
        display: grid;
        place-items: center;
    }

    .hero {
        height: 620px;
    }

    .hero-content {
        left: 24px;
    }

    .hero-control {
        display: none;
    }

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

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

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

    .rank-cover,
    .search-card img {
        width: 100%;
        height: 220px;
    }

    .rank-body,
    .search-card div {
        padding: 20px;
    }

    .detail-poster {
        max-width: 320px;
    }

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

@media (max-width: 560px) {
    .site-logo {
        font-size: 20px;
    }

    .header-search {
        order: 3;
        width: 100%;
    }

    .movie-grid,
    .all-grid,
    .compact-grid,
    .category-grid,
    .category-overview-grid,
    .top-rank-row {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 38px 0;
    }

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

    .page-hero {
        padding: 54px 0;
    }

    .hero {
        min-height: 560px;
    }

    .hero-meta span:nth-child(n + 3) {
        display: none;
    }

    .btn-primary,
    .btn-ghost {
        width: 100%;
    }

    .detail-hero-inner {
        min-height: auto;
    }

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