:root {
    --jelly-bg-primary: #f8f9fe;
    --jelly-text-primary: #263044;
    --jelly-text-secondary: #667085;
    --jelly-accent-purple: #7c3aed;
    --jelly-accent-pink: #ec4899;
    --jelly-accent-blue: #3b82f6;
    --jelly-glass: rgba(255, 255, 255, 0.74);
    --jelly-border: rgba(255, 255, 255, 0.34);
    --jelly-shadow: 0 18px 50px rgba(31, 38, 135, 0.22);
    --jelly-radius: 28px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--jelly-text-primary);
    background: linear-gradient(135deg, #667eea, #764ba2, #f093fb, #4facfe, #00f2fe);
    background-size: 400% 400%;
    animation: gradientShift 30s ease infinite;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.35), transparent 28%),
        radial-gradient(circle at 88% 20%, rgba(255, 196, 221, 0.4), transparent 24%),
        radial-gradient(circle at 45% 82%, rgba(196, 221, 255, 0.38), transparent 30%);
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

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

button,
input {
    font: inherit;
}

.jelly-glass,
.jelly-card {
    border: 1px solid var(--jelly-border);
    background: var(--jelly-glass);
    box-shadow: var(--jelly-shadow);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
}

.jelly-card {
    overflow: hidden;
    border-radius: var(--jelly-radius);
    transition: transform 0.35s ease, box-shadow 0.35s ease, background 0.35s ease;
}

.jelly-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 26px 70px rgba(31, 38, 135, 0.3);
    background: rgba(255, 255, 255, 0.86);
}

.moon-glow {
    position: relative;
    isolation: isolate;
}

.moon-glow::before {
    content: "";
    position: absolute;
    inset: -18px;
    z-index: -1;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(232, 234, 246, 0.72), transparent 68%);
    animation: moonPulse 4s ease-in-out infinite;
}

@keyframes moonPulse {
    0%, 100% { opacity: 0.62; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.12); }
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-radius: 0 0 26px 26px;
}

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

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

.brand-mark {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #ffffff;
    font-size: 22px;
    background: linear-gradient(135deg, #a78bfa, #f9a8d4);
}

.brand-name,
.footer-brand {
    font-size: clamp(19px, 2vw, 26px);
    background: linear-gradient(135deg, #ffffff, #faf5ff, #fce7f3);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
}

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

.site-nav a {
    padding: 10px 14px;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.92);
    font-weight: 700;
    transition: background 0.2s ease, transform 0.2s ease;
}

.site-nav a:hover,
.site-nav a.is-active {
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.28);
}

.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    border-radius: 999px;
    background: #ffffff;
}

.site-main {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
}

.page-main,
.detail-main {
    padding-top: 42px;
}

.hero-slider {
    position: relative;
    min-height: min(760px, calc(100vh - 90px));
    margin: 22px auto 70px;
    overflow: hidden;
    border-radius: 38px;
    box-shadow: 0 30px 90px rgba(28, 28, 80, 0.32);
}

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

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

.hero-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(90deg, rgba(23, 20, 46, 0.92) 0%, rgba(23, 20, 46, 0.62) 48%, rgba(23, 20, 46, 0.28) 100%),
        var(--hero-image);
    background-size: cover;
    background-position: center;
    transform: scale(1.04);
    filter: saturate(1.08);
}

.hero-content {
    position: relative;
    z-index: 2;
    min-height: min(760px, calc(100vh - 90px));
    padding: clamp(32px, 6vw, 78px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
    align-items: center;
    gap: clamp(28px, 5vw, 70px);
}

.hero-copy {
    max-width: 720px;
    color: #ffffff;
}

.eyebrow {
    display: inline-flex;
    margin-bottom: 14px;
    color: rgba(255, 255, 255, 0.82);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 800;
}

.page-hero .eyebrow,
.section-heading .eyebrow,
.detail-content .eyebrow {
    color: #7c3aed;
}

.hero-copy h1 {
    margin: 0 0 18px;
    font-size: clamp(42px, 7vw, 82px);
    line-height: 0.98;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.hero-copy p {
    max-width: 660px;
    margin: 0 0 24px;
    color: rgba(255, 255, 255, 0.9);
    font-size: clamp(17px, 2vw, 22px);
    line-height: 1.75;
}

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

.hero-tags span,
.tag {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
}

.tag {
    background: rgba(124, 58, 237, 0.1);
    color: #6d28d9;
}

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

.primary-btn,
.secondary-btn,
.text-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-btn {
    padding: 13px 24px;
    color: #ffffff;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    box-shadow: 0 10px 24px rgba(124, 58, 237, 0.34);
}

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

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

.primary-btn.wide {
    width: 100%;
}

.text-link {
    color: #7c3aed;
}

.hero-poster {
    width: min(100%, 360px);
    aspect-ratio: 3 / 4;
    justify-self: end;
    border-radius: 32px;
}

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

.hero-controls {
    position: absolute;
    left: 50%;
    bottom: 24px;
    z-index: 4;
    display: flex;
    gap: 9px;
    transform: translateX(-50%);
}

.hero-dot {
    width: 34px;
    height: 9px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.36);
}

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

.section-heading,
.page-hero {
    margin-bottom: 24px;
}

.section-heading h2,
.page-hero h1,
.detail-content h1 {
    margin: 0 0 10px;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.1;
}

.section-heading p,
.page-hero p,
.detail-content p,
.card-body p,
.footer-grid p {
    color: var(--jelly-text-secondary);
    line-height: 1.72;
}

.page-hero,
.detail-content,
.rank-section,
.search-panel {
    border-radius: var(--jelly-radius);
    padding: clamp(22px, 4vw, 42px);
}

.quick-search,
.category-section,
.rank-section {
    margin-bottom: 74px;
}

.search-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 26px;
    padding: 16px;
}

.search-box {
    flex: 1 1 260px;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
}

.search-box input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--jelly-text-primary);
}

.filter-chip {
    border: 0;
    border-radius: 999px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.52);
    color: #4c1d95;
    font-weight: 800;
}

.filter-chip.is-active,
.filter-chip:hover {
    color: #ffffff;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
}

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

.movie-card {
    min-width: 0;
}

.poster-link {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.2);
}

.poster-link img,
.detail-cover,
.mini-card img,
.category-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.poster-link::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.65), transparent 60%);
    transition: opacity 0.25s ease;
}

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

.play-dot,
.rank-badge {
    position: absolute;
    z-index: 2;
    display: grid;
    place-items: center;
    color: #ffffff;
    font-weight: 900;
}

.play-dot {
    right: 14px;
    bottom: 14px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(124, 58, 237, 0.86);
    opacity: 0;
    transform: scale(0.82);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.movie-card:hover .play-dot {
    opacity: 1;
    transform: scale(1);
}

.rank-badge,
.mini-rank {
    left: 12px;
    top: 12px;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.card-body {
    padding: 18px;
}

.card-body h2 {
    margin: 8px 0 8px;
    font-size: 19px;
    line-height: 1.32;
}

.card-body h2 a:hover {
    color: #7c3aed;
}

.card-body p {
    min-height: 3.45em;
    margin: 0 0 14px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.meta-row {
    color: #7c3aed;
    font-size: 13px;
    font-weight: 800;
}

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

.category-tile {
    position: relative;
    min-height: 210px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    color: #ffffff;
}

.category-tile::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(22, 17, 40, 0.82), rgba(22, 17, 40, 0.08));
}

.category-tile img {
    position: absolute;
    inset: 0;
    transition: transform 0.4s ease;
}

.category-tile:hover img {
    transform: scale(1.08);
}

.category-tile span {
    position: relative;
    z-index: 2;
    padding: 22px;
}

.category-tile strong,
.category-overview h2,
.detail-content h2 {
    display: block;
    margin: 0 0 8px;
    font-size: 24px;
}

.category-tile small {
    display: block;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.55;
}

.rank-section {
    display: grid;
    grid-template-columns: minmax(260px, 340px) 1fr;
    gap: 24px;
}

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

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

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

.mini-card {
    display: grid;
    grid-template-columns: 74px 1fr;
    align-items: center;
    min-height: 102px;
    padding: 12px;
    gap: 14px;
    border-radius: 20px;
}

.mini-card img {
    width: 74px;
    aspect-ratio: 3 / 4;
    border-radius: 14px;
}

.mini-info {
    display: grid;
    gap: 4px;
}

.mini-info strong {
    font-size: 16px;
    line-height: 1.35;
}

.mini-info small {
    color: var(--jelly-text-secondary);
    line-height: 1.35;
}

.mini-rank {
    position: static;
    width: fit-content;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 12px;
}

.category-overview {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 20px;
    padding: 18px;
}

.category-cover-stack {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.category-cover-stack img {
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 16px;
    object-fit: cover;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0 0 22px;
    color: rgba(255, 255, 255, 0.88);
    font-weight: 700;
}

.breadcrumb a:hover {
    color: #ffffff;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
    align-items: start;
    margin-bottom: 30px;
}

.player-panel {
    padding: 14px;
}

.player-shell {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    background: #05030a;
    aspect-ratio: 16 / 9;
}

.movie-player,
.player-cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.movie-player {
    background: #000000;
}

.player-cover {
    z-index: 3;
    border: 0;
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    color: #ffffff;
    background: #0c0a18;
}

.player-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.08));
}

.player-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.05);
}

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

.big-play {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 4;
    width: 86px;
    height: 86px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    transform: translate(-50%, -50%);
    font-size: 32px;
}

.detail-side {
    padding: 16px;
}

.detail-cover {
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 22px;
    margin-bottom: 16px;
}

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

.detail-meta span {
    padding: 8px 10px;
    border-radius: 999px;
    color: #6d28d9;
    background: rgba(124, 58, 237, 0.1);
    font-size: 12px;
    font-weight: 800;
}

.detail-content {
    margin-bottom: 64px;
}

.detail-content .lead {
    font-size: clamp(18px, 2vw, 22px);
    color: #475467;
}

.detail-content h2 {
    margin-top: 30px;
}

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

.site-footer {
    width: min(1200px, calc(100% - 32px));
    margin: 70px auto 24px;
    padding: 34px;
    border-radius: 30px;
    color: #ffffff;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 26px;
}

.footer-grid h2 {
    margin: 0 0 12px;
    font-size: 18px;
}

.footer-grid a:not(.footer-brand) {
    display: block;
    margin: 8px 0;
    color: rgba(255, 255, 255, 0.82);
}

.footer-grid p {
    color: rgba(255, 255, 255, 0.82);
}

.footer-bottom {
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.22);
    color: rgba(255, 255, 255, 0.76);
}

.is-hidden-card {
    display: none !important;
}

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

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

    .detail-side {
        display: grid;
        grid-template-columns: 180px 1fr;
        gap: 18px;
        align-items: center;
    }

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

@media (max-width: 760px) {
    .header-inner {
        min-height: 68px;
    }

    .nav-toggle {
        display: block;
    }

    .site-nav {
        position: absolute;
        left: 16px;
        right: 16px;
        top: 74px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
        border-radius: 24px;
        background: rgba(255, 255, 255, 0.88);
        box-shadow: var(--jelly-shadow);
    }

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

    .site-nav a {
        color: #4c1d95;
    }

    .hero-slider,
    .hero-content {
        min-height: 720px;
    }

    .hero-content {
        grid-template-columns: 1fr;
        align-content: center;
        padding: 28px;
    }

    .hero-poster {
        width: 220px;
        justify-self: start;
    }

    .movie-grid,
    .rank-list,
    .rank-page-list,
    .category-grid,
    .category-overview-grid,
    .related-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

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

    .detail-side .detail-cover {
        max-width: 240px;
    }
}

@media (max-width: 460px) {
    .site-main,
    .site-footer {
        width: min(100% - 20px, 1200px);
    }

    .hero-copy h1 {
        font-size: 38px;
    }

    .page-hero,
    .detail-content,
    .rank-section,
    .search-panel {
        padding: 20px;
    }

    .mini-card {
        grid-template-columns: 64px 1fr;
    }
}
