* {
    box-sizing: border-box;
}

:root {
    --page-bg: #f8fafc;
    --soft-bg: #eff6ff;
    --panel: rgba(255, 255, 255, 0.92);
    --text: #0f172a;
    --muted: #64748b;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --cyan: #06b6d4;
    --border: rgba(148, 163, 184, 0.32);
    --shadow: 0 22px 60px rgba(15, 23, 42, 0.14);
    --radius: 24px;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.16), transparent 36rem),
        linear-gradient(135deg, #f8fafc 0%, #eff6ff 48%, #f1f5f9 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

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

button,
input,
select {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 80;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(18px);
    box-shadow: 0 6px 30px rgba(15, 23, 42, 0.06);
}

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

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

.site-logo__icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--cyan));
    border-radius: 14px;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24);
}

.site-logo__text strong {
    display: block;
    font-size: 22px;
    line-height: 1.1;
    letter-spacing: -0.03em;
    background: linear-gradient(90deg, var(--primary), var(--cyan));
    -webkit-background-clip: text;
    color: transparent;
}

.site-logo__text em {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

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

.site-nav a {
    padding: 10px 14px;
    color: #334155;
    border-radius: 12px;
    transition: 0.2s ease;
}

.site-nav a:hover {
    color: var(--primary);
    background: rgba(37, 99, 235, 0.08);
}

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

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 4px auto;
    background: #0f172a;
    border-radius: 999px;
}

.hero {
    position: relative;
    height: min(620px, 82vh);
    min-height: 500px;
    overflow: hidden;
    background: #020617;
}

.hero-track,
.hero-slide {
    position: absolute;
    inset: 0;
}

.hero-slide {
    opacity: 0;
    transition: opacity 1000ms ease;
}

.hero-slide.is-active {
    opacity: 1;
    z-index: 2;
}

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

.hero-slide__shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.86) 0%, rgba(2, 6, 23, 0.44) 48%, rgba(2, 6, 23, 0.1) 100%),
        linear-gradient(0deg, rgba(2, 6, 23, 0.86), transparent 58%);
}

.hero-slide__content {
    position: absolute;
    left: max(24px, calc((100vw - 1180px) / 2));
    bottom: 78px;
    z-index: 4;
    width: min(680px, calc(100% - 48px));
    color: white;
}

.eyebrow,
.section-heading p,
.page-hero p,
.category-overview-card__body p {
    margin: 0 0 10px;
    color: #38bdf8;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero-slide h1 {
    margin: 0 0 18px;
    font-size: clamp(38px, 6vw, 72px);
    line-height: 1.02;
    letter-spacing: -0.06em;
    text-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

.hero-slide__line {
    max-width: 640px;
    margin: 0 0 24px;
    color: rgba(226, 232, 240, 0.94);
    font-size: 18px;
    line-height: 1.8;
}

.hero-slide__meta,
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 26px;
}

.hero-slide__meta span,
.detail-meta span,
.movie-card__tags span,
.detail-tags span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    color: #334155;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.hero-slide__actions,
.detail-info .button {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

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

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

.button-primary {
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--cyan));
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.3);
}

.button-ghost {
    color: white;
    background: rgba(15, 23, 42, 0.34);
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(12px);
}

.hero-control {
    position: absolute;
    top: 50%;
    z-index: 8;
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    color: white;
    border: 0;
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.48);
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.24);
    cursor: pointer;
    transform: translateY(-50%);
}

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

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

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

.hero-dots button {
    width: 9px;
    height: 9px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    transition: 0.25s ease;
}

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

.home-intro {
    padding: 54px 16px 0;
}

.content-section,
.filter-panel,
.player-section {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.content-section {
    padding-top: 64px;
}

.content-section--wide {
    width: min(1320px, calc(100% - 32px));
}

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

.section-heading--center {
    display: block;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.section-heading h1,
.section-heading h2,
.page-hero h1,
.category-overview-card__body h1 {
    margin: 0;
    color: #0f172a;
    font-size: clamp(28px, 4vw, 46px);
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.section-heading span,
.page-hero span,
.category-overview-card__body span {
    display: block;
    margin-top: 14px;
    color: var(--muted);
    line-height: 1.8;
}

.section-heading a {
    color: var(--primary);
    font-weight: 700;
}

.movie-rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(230px, 280px);
    gap: 22px;
    overflow-x: auto;
    padding: 6px 2px 18px;
    scroll-snap-type: x proximity;
}

.rail-card {
    scroll-snap-align: start;
}

.rail-card__poster {
    position: relative;
    display: block;
    overflow: hidden;
    height: 176px;
    border-radius: 22px;
    box-shadow: var(--shadow);
}

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

.rail-card:hover img,
.movie-card:hover img,
.category-card:hover img,
.rank-item:hover img {
    transform: scale(1.08);
}

.rail-card__poster span,
.movie-card__badge {
    position: absolute;
    right: 12px;
    top: 12px;
    padding: 6px 10px;
    color: white;
    background: rgba(37, 99, 235, 0.9);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.rail-card strong {
    display: block;
    margin: 14px 0 6px;
    font-size: 17px;
}

.rail-card em,
.movie-card__meta {
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
}

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

.category-card {
    position: relative;
    min-height: 210px;
    overflow: hidden;
    padding: 22px;
    color: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

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

.category-card span {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.82), rgba(2, 6, 23, 0.15));
}

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

.category-card strong {
    margin-top: 100px;
    font-size: 24px;
}

.category-card em {
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 13px;
    font-style: normal;
    line-height: 1.6;
}

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

.movie-grid--compact {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.movie-card {
    overflow: hidden;
    background: var(--panel);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 22px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

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

.movie-card__poster {
    position: relative;
    display: block;
    height: 300px;
    overflow: hidden;
    background: #e2e8f0;
}

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

.movie-card__body {
    padding: 18px;
}

.movie-card__body h2 {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 1.35;
}

.movie-card__line {
    min-height: 48px;
    margin: 12px 0;
    color: #475569;
    font-size: 14px;
    line-height: 1.7;
}

.movie-card__tags,
.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.movie-card__tags span,
.detail-tags span {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.1);
}

.rank-section {
    position: relative;
}

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

.rank-grid--full {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

.rank-item {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 16px;
    align-items: center;
    padding: 14px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 22px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.rank-item__poster {
    position: relative;
    overflow: hidden;
    height: 126px;
    border-radius: 16px;
}

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

.rank-item__poster span {
    position: absolute;
    left: 8px;
    top: 8px;
    padding: 4px 8px;
    color: white;
    background: rgba(2, 6, 23, 0.78);
    border-radius: 999px;
    font-weight: 800;
}

.rank-item h2 {
    margin: 0 0 8px;
    font-size: 18px;
}

.rank-item p {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.rank-item strong {
    color: var(--primary);
    font-size: 13px;
}

.filter-panel {
    padding-top: 64px;
}

.filter-panel__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 16px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--radius);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
}

.filter-panel label span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.filter-panel input,
.filter-panel select {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    color: #0f172a;
    background: white;
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 14px;
    outline: none;
}

.filter-panel input:focus,
.filter-panel select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.page-hero {
    position: relative;
    min-height: 340px;
    overflow: hidden;
    color: white;
    background: #020617;
}

.page-hero::before {
    position: absolute;
    inset: 0;
    content: "";
    background-image: var(--hero-image);
    background-size: cover;
    background-position: center;
    opacity: 0.42;
}

.page-hero::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(90deg, rgba(2, 6, 23, 0.86), rgba(2, 6, 23, 0.24));
}

.page-hero--small::before {
    background:
        radial-gradient(circle at 10% 20%, rgba(37, 99, 235, 0.5), transparent 32rem),
        radial-gradient(circle at 80% 20%, rgba(6, 182, 212, 0.46), transparent 32rem);
    opacity: 1;
}

.page-hero > div {
    position: relative;
    z-index: 2;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 92px 0;
}

.page-hero h1,
.page-hero span {
    color: white;
}

.page-hero span {
    max-width: 720px;
    color: rgba(226, 232, 240, 0.92);
}

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

.category-overview-card {
    overflow: hidden;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.category-overview-card__media {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: 170px;
    overflow: hidden;
}

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

.category-overview-card__body {
    padding: 24px;
}

.category-overview-card__body .button {
    margin-top: 20px;
}

.detail-hero {
    position: relative;
    overflow: hidden;
    color: white;
    background: #020617;
}

.detail-hero__backdrop {
    position: absolute;
    inset: 0;
    opacity: 0.42;
    filter: blur(3px);
}

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

.detail-hero::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(90deg, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.46)), linear-gradient(0deg, #020617, transparent 50%);
}

.detail-hero__inner {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 34px;
    align-items: end;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 72px 0;
}

.detail-poster {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: var(--radius);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.34);
}

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

.breadcrumb {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    color: rgba(226, 232, 240, 0.86);
    font-size: 14px;
}

.detail-info h1 {
    margin: 0 0 18px;
    font-size: clamp(32px, 5vw, 58px);
    line-height: 1.08;
    letter-spacing: -0.05em;
}

.detail-line {
    max-width: 820px;
    margin: 0 0 20px;
    color: rgba(226, 232, 240, 0.92);
    font-size: 18px;
    line-height: 1.8;
}

.detail-meta span {
    color: #0f172a;
}

.player-section {
    padding-top: 48px;
}

.player-wrap {
    position: relative;
    overflow: hidden;
    background: #020617;
    border-radius: 28px;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.24);
}

.movie-player {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #020617;
}

.player-start {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: white;
    border: 0;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.66), rgba(2, 6, 23, 0.2));
    cursor: pointer;
}

.player-start span {
    display: grid;
    width: 82px;
    height: 82px;
    place-items: center;
    padding-left: 5px;
    background: linear-gradient(135deg, var(--primary), var(--cyan));
    border-radius: 999px;
    box-shadow: 0 20px 50px rgba(37, 99, 235, 0.38);
    font-size: 28px;
}

.player-start strong {
    font-size: 18px;
}

.player-wrap.is-playing .player-start {
    display: none;
}

.detail-content article {
    padding: 34px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--radius);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

.detail-content h2 {
    margin: 0 0 14px;
    font-size: 26px;
}

.detail-content h2 + p {
    margin: 0 0 28px;
    color: #334155;
    font-size: 16px;
    line-height: 2;
}

.site-footer {
    margin-top: 76px;
    color: white;
    background: linear-gradient(135deg, #1e293b, #020617);
}

.site-footer__inner {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 34px;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0;
}

.site-footer__logo {
    margin-bottom: 14px;
    font-size: 24px;
    font-weight: 800;
}

.site-footer p,
.site-footer a,
.site-footer li {
    color: rgba(226, 232, 240, 0.76);
    line-height: 1.8;
}

.site-footer h2 {
    margin: 0 0 14px;
    color: #93c5fd;
    font-size: 16px;
}

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

.site-footer__bottom {
    padding: 20px 16px;
    color: rgba(226, 232, 240, 0.58);
    text-align: center;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

@media (max-width: 960px) {
    .site-nav {
        position: absolute;
        top: 76px;
        left: 16px;
        right: 16px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        background: white;
        border: 1px solid var(--border);
        border-radius: 18px;
        box-shadow: var(--shadow);
    }

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

    .menu-toggle {
        display: block;
    }

    .category-grid,
    .category-overview-grid,
    .rank-grid,
    .site-footer__inner {
        grid-template-columns: 1fr;
    }

    .detail-hero__inner {
        grid-template-columns: 1fr;
        padding: 38px 0 54px;
    }

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

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

@media (max-width: 640px) {
    .hero {
        min-height: 560px;
    }

    .hero-slide__content {
        bottom: 72px;
    }

    .hero-slide h1 {
        font-size: 36px;
    }

    .hero-control {
        display: none;
    }

    .section-heading {
        display: block;
    }

    .section-heading a {
        display: inline-block;
        margin-top: 12px;
    }

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

    .movie-card__poster {
        height: 220px;
    }

    .movie-card__body {
        padding: 14px;
    }

    .movie-card__line {
        display: none;
    }

    .detail-info h1 {
        font-size: 32px;
    }

    .player-start span {
        width: 66px;
        height: 66px;
    }
}
