* {
    box-sizing: border-box;
}

:root {
    color-scheme: dark;
    --bg: #020617;
    --bg-soft: #0f172a;
    --bg-card: rgba(15, 23, 42, 0.72);
    --line: rgba(148, 163, 184, 0.18);
    --text: #e2e8f0;
    --muted: #94a3b8;
    --cyan: #22d3ee;
    --cyan-strong: #06b6d4;
    --blue: #38bdf8;
    --white: #ffffff;
    --shadow: 0 30px 90px rgba(2, 6, 23, 0.55);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 10% 5%, rgba(34, 211, 238, 0.18), transparent 28rem),
        radial-gradient(circle at 90% 0%, rgba(56, 189, 248, 0.12), transparent 26rem),
        linear-gradient(180deg, #020617 0%, #0f172a 46%, #020617 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 {
    font: inherit;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.94), rgba(15, 23, 42, 0.96));
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 50px rgba(2, 6, 23, 0.35);
}

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

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

.brand-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: #001018;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    border-radius: 999px;
    box-shadow: 0 0 34px rgba(34, 211, 238, 0.42);
}

.brand-text,
.footer-brand {
    display: flex;
    flex-direction: column;
}

.brand-text strong,
.footer-brand {
    color: var(--white);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.brand-text em {
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-link,
.mobile-link {
    color: #cbd5e1;
    font-weight: 600;
    transition: color 0.25s ease, background 0.25s ease;
}

.nav-link {
    position: relative;
    padding: 8px 0;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--cyan), var(--blue));
    transition: width 0.25s ease;
}

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

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.menu-button {
    width: 42px;
    height: 42px;
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 0 10px;
    color: var(--white);
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
}

.menu-button span {
    display: block;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
}

.mobile-nav {
    display: none;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 0 0 16px;
}

.mobile-nav.is-open {
    display: grid;
    gap: 8px;
}

.mobile-link {
    padding: 12px 14px;
    background: rgba(15, 23, 42, 0.62);
    border: 1px solid var(--line);
    border-radius: 14px;
}

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

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

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

.hero-slide > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.04);
    filter: saturate(1.08) contrast(1.05);
}

.hero-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.86) 20%, rgba(2, 6, 23, 0.18) 72%),
        linear-gradient(90deg, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.45), rgba(2, 6, 23, 0.1));
}

.hero-content {
    position: absolute;
    left: max(24px, calc((100vw - 1180px) / 2));
    bottom: 88px;
    width: min(680px, calc(100% - 48px));
    display: grid;
    gap: 18px;
}

.hero-label {
    width: fit-content;
    padding: 8px 16px;
    color: #ecfeff;
    background: rgba(6, 182, 212, 0.88);
    border: 1px solid rgba(207, 250, 254, 0.35);
    border-radius: 999px;
    box-shadow: 0 12px 32px rgba(6, 182, 212, 0.28);
    font-size: 14px;
    font-weight: 800;
}

.hero h1,
.page-hero h1,
.detail-info h1 {
    margin: 0;
    color: var(--white);
    font-size: clamp(36px, 6vw, 72px);
    line-height: 1.06;
    letter-spacing: -0.04em;
}

.hero p,
.page-hero p,
.detail-one-line {
    margin: 0;
    color: #cbd5e1;
    font-size: clamp(16px, 2vw, 21px);
    line-height: 1.75;
}

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

.hero-tags span,
.tag-row span,
.detail-meta span {
    padding: 6px 10px;
    color: #dbeafe;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    font-size: 12px;
}

.hero-actions,
.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}

.primary-button,
.ghost-button,
.section-link,
.filter-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 800;
    transition: transform 0.24s ease, background 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.primary-button {
    min-height: 50px;
    padding: 0 28px;
    color: #001018;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 14px 34px rgba(34, 211, 238, 0.32);
}

.ghost-button,
.section-link,
.filter-button {
    min-height: 46px;
    padding: 0 22px;
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.primary-button:hover,
.ghost-button:hover,
.section-link:hover,
.filter-button:hover,
.filter-button.is-active {
    transform: translateY(-2px);
    border-color: rgba(34, 211, 238, 0.5);
    box-shadow: 0 18px 46px rgba(8, 145, 178, 0.18);
}

.filter-button.is-active {
    color: #001018;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
}

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 4;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    color: var(--white);
    background: rgba(15, 23, 42, 0.52);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    cursor: pointer;
    transform: translateY(-50%);
}

.hero-prev {
    left: 24px;
}

.hero-next {
    right: 24px;
}

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

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

.hero-dot.is-active {
    background: var(--cyan);
}

.section {
    padding: 56px 0;
}

.page-main,
.detail-main {
    min-height: 60vh;
}

.page-hero,
.detail-hero {
    padding: 58px 0 26px;
}

.page-hero span {
    display: inline-flex;
    margin-bottom: 14px;
    color: var(--cyan);
    font-weight: 800;
}

.page-hero h1 {
    max-width: 880px;
    margin-bottom: 18px;
}

.page-hero p {
    max-width: 820px;
}

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

.section-heading h2 {
    margin: 0 0 8px;
    color: var(--white);
    font-size: clamp(26px, 3.4vw, 42px);
    line-height: 1.15;
}

.section-heading p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.search-panel {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 16px;
    margin-bottom: 34px;
    padding: 18px;
    background: rgba(15, 23, 42, 0.62);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.search-label {
    color: var(--cyan);
    font-weight: 800;
}

.search-panel input {
    width: 100%;
    min-height: 48px;
    color: var(--white);
    background: rgba(2, 6, 23, 0.62);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 999px;
    outline: none;
    padding: 0 20px;
}

.search-panel input:focus {
    border-color: rgba(34, 211, 238, 0.7);
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
}

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

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

.movie-card {
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 20px 60px rgba(2, 6, 23, 0.24);
    transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(34, 211, 238, 0.38);
    box-shadow: 0 26px 80px rgba(8, 145, 178, 0.16);
}

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

.poster-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.32s ease, filter 0.32s ease;
}

.movie-card:hover .poster-link img {
    transform: scale(1.06);
    filter: brightness(0.74);
}

.poster-badge,
.poster-play {
    position: absolute;
    z-index: 2;
    color: var(--white);
    background: rgba(2, 6, 23, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(12px);
}

.poster-badge {
    top: 12px;
    right: 12px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.poster-play {
    left: 50%;
    top: 50%;
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.85);
    transition: opacity 0.24s ease, transform 0.24s ease;
}

.movie-card:hover .poster-play {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.movie-card-body {
    display: grid;
    gap: 10px;
    padding: 16px;
}

.movie-title {
    color: var(--white);
    font-weight: 800;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.movie-title:hover {
    color: var(--cyan);
}

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

.movie-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: #64748b;
    font-size: 12px;
}

.tag-row {
    gap: 6px;
}

.tag-row span {
    padding: 4px 8px;
}

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

.category-card,
.category-overview-card,
.story-card {
    display: grid;
    gap: 12px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.86), rgba(30, 41, 59, 0.62));
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 22px 70px rgba(2, 6, 23, 0.24);
}

.category-card:hover,
.category-overview-card:hover {
    border-color: rgba(34, 211, 238, 0.42);
    transform: translateY(-3px);
}

.category-card span,
.category-overview-title {
    color: var(--white);
    font-size: 20px;
    font-weight: 900;
}

.category-card p,
.category-overview-card p,
.story-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.75;
}

.category-samples {
    display: grid;
    gap: 8px;
}

.category-samples a {
    color: #cbd5e1;
    font-size: 14px;
}

.category-samples a:hover {
    color: var(--cyan);
}

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

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

.rank-item {
    display: grid;
    grid-template-columns: 46px 64px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 12px;
    background: rgba(15, 23, 42, 0.64);
    border: 1px solid var(--line);
    border-radius: 18px;
    transition: transform 0.22s ease, border-color 0.22s ease;
}

.rank-item:hover {
    transform: translateX(4px);
    border-color: rgba(34, 211, 238, 0.42);
}

.rank-number {
    color: var(--cyan);
    font-size: 22px;
    font-weight: 900;
    text-align: center;
}

.rank-item img {
    width: 64px;
    height: 86px;
    object-fit: cover;
    border-radius: 12px;
}

.rank-text {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.rank-text strong {
    color: var(--white);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-text em {
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
}

.rank-score {
    color: #facc15;
    font-weight: 900;
}

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

.ranking-page {
    grid-template-columns: minmax(0, 1fr) 420px;
}

.long-rank {
    max-height: none;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
    color: var(--muted);
    font-size: 14px;
}

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

.detail-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 38px;
    align-items: end;
    padding: 28px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.82), rgba(2, 6, 23, 0.54));
    border: 1px solid var(--line);
    border-radius: 32px;
    box-shadow: var(--shadow);
}

.detail-poster img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 24px;
    box-shadow: 0 26px 80px rgba(2, 6, 23, 0.46);
}

.detail-info {
    display: grid;
    gap: 18px;
}

.detail-info h1 {
    font-size: clamp(34px, 5vw, 58px);
}

.detail-meta span {
    font-size: 13px;
}

.player-card {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #000;
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

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

.player-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 16px;
    color: var(--white);
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.72), rgba(2, 6, 23, 0.22));
    cursor: pointer;
}

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

.big-play-button {
    width: 86px;
    height: 86px;
    display: grid;
    place-items: center;
    color: #001018;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    border: 0;
    border-radius: 999px;
    box-shadow: 0 18px 54px rgba(34, 211, 238, 0.38);
    cursor: pointer;
}

.player-overlay strong {
    font-size: clamp(18px, 3vw, 30px);
}

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

.story-card h2 {
    margin: 0;
    color: var(--white);
    font-size: 24px;
}

.site-footer {
    margin-top: 48px;
    padding: 48px 0 26px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.76), rgba(2, 6, 23, 0.98));
    border-top: 1px solid var(--line);
}

.footer-inner {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 32px;
}

.footer-inner p {
    max-width: 520px;
    color: var(--muted);
    line-height: 1.75;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-content: start;
}

.footer-links a {
    padding: 10px 14px;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.footer-links a:hover {
    color: var(--cyan);
    border-color: rgba(34, 211, 238, 0.42);
}

.footer-copy {
    width: min(1180px, calc(100% - 32px));
    margin: 28px auto 0;
    padding-top: 22px;
    color: #64748b;
    border-top: 1px solid var(--line);
    font-size: 14px;
}

.movie-card.is-hidden {
    display: none;
}

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

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

    .split-section,
    .ranking-page {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 820px) {
    .main-nav {
        display: none;
    }

    .menu-button {
        display: flex;
    }

    .header-inner {
        height: 66px;
    }

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

    .brand-text em {
        display: none;
    }

    .hero {
        min-height: 620px;
        height: 78vh;
    }

    .hero-content {
        bottom: 72px;
    }

    .hero-arrow {
        display: none;
    }

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

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

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

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

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

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

@media (max-width: 540px) {
    .shell,
    .header-inner,
    .mobile-nav,
    .footer-inner,
    .footer-copy {
        width: min(100% - 22px, 1180px);
    }

    .hero h1,
    .page-hero h1,
    .detail-info h1 {
        font-size: 34px;
    }

    .hero-content {
        width: calc(100% - 28px);
        left: 14px;
    }

    .movie-grid,
    .compact-grid,
    .side-grid,
    .category-grid,
    .category-overview-grid {
        grid-template-columns: 1fr;
    }

    .rank-item {
        grid-template-columns: 36px 56px 1fr;
    }

    .rank-score {
        display: none;
    }

    .player-card {
        border-radius: 18px;
    }
}
