:root {
    color-scheme: dark;
    --bg: #06020f;
    --bg-soft: #120720;
    --bg-card: rgba(255, 255, 255, 0.07);
    --border: rgba(255, 255, 255, 0.12);
    --text: #ffffff;
    --muted: #d8c8ff;
    --subtle: #a99ac8;
    --accent: #facc15;
    --accent-2: #d946ef;
    --accent-3: #7c3aed;
    --radius-lg: 24px;
    --radius-md: 18px;
    --shadow: 0 24px 80px rgba(7, 0, 24, 0.42);
}

* {
    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", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 0%, rgba(250, 204, 21, 0.12), transparent 28rem),
        radial-gradient(circle at 88% 10%, rgba(217, 70, 239, 0.18), transparent 28rem),
        linear-gradient(135deg, #0f172a 0%, #3b0764 42%, #09090b 100%);
}

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

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: linear-gradient(90deg, rgba(49, 46, 129, 0.96), rgba(88, 28, 135, 0.96), rgba(131, 24, 67, 0.96));
    border-bottom: 1px solid rgba(168, 85, 247, 0.28);
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.nav-shell,
.hero-inner,
.content-section,
.footer-shell,
.page-hero,
.detail-shell {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
}

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

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    font-size: clamp(1.2rem, 2vw, 1.65rem);
    font-weight: 900;
    letter-spacing: 0.02em;
    background: linear-gradient(90deg, #fef08a, #fbcfe8, #ddd6fe);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    color: #3b0764;
    background: linear-gradient(135deg, #facc15, #fb7185);
    box-shadow: 0 0 28px rgba(250, 204, 21, 0.36);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
}

.main-nav a {
    padding: 9px 13px;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.84);
    font-weight: 700;
    transition: transform 0.22s ease, background 0.22s ease, color 0.22s ease;
}

.main-nav a:hover,
.main-nav a.is-active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.nav-category-links {
    display: none;
}

.header-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 1 360px;
}

.header-search input,
.search-panel input,
.filter-input {
    width: 100%;
    border: 1px solid rgba(216, 180, 254, 0.34);
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    outline: none;
    padding: 12px 16px;
}

.header-search input::placeholder,
.search-panel input::placeholder,
.filter-input::placeholder {
    color: rgba(233, 213, 255, 0.72);
}

.header-search button,
.hero-button,
.section-link,
.search-panel button,
.play-button,
.load-more-button {
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, #9333ea, #db2777);
    padding: 12px 18px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 16px 30px rgba(147, 51, 234, 0.28);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.header-search button:hover,
.hero-button:hover,
.section-link:hover,
.search-panel button:hover,
.play-button:hover,
.load-more-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(217, 70, 239, 0.36);
}

.menu-toggle {
    display: none;
    margin-left: auto;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    padding: 9px 12px;
    font-size: 1.4rem;
}

.hero {
    position: relative;
    overflow: hidden;
    min-height: 620px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.7s ease;
    background-image:
        linear-gradient(90deg, rgba(2, 6, 23, 0.93), rgba(88, 28, 135, 0.58), rgba(0, 0, 0, 0.2)),
        var(--hero-image);
    background-size: cover;
    background-position: center;
}

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

.hero-inner {
    position: relative;
    z-index: 2;
    min-height: 620px;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.55fr);
    gap: clamp(28px, 5vw, 70px);
    align-items: center;
    padding: 70px 0 86px;
}

.hero-copy {
    max-width: 760px;
}

.hero-kicker,
.detail-kicker,
.page-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 8px 13px;
    border: 1px solid rgba(250, 204, 21, 0.32);
    border-radius: 999px;
    color: #fde68a;
    background: rgba(250, 204, 21, 0.1);
    font-weight: 800;
}

.hero h1,
.page-hero h1,
.detail-title h1 {
    margin: 0;
    font-size: clamp(2.2rem, 6vw, 5.4rem);
    line-height: 1.02;
    letter-spacing: -0.05em;
}

.hero p,
.page-hero p,
.detail-title p {
    color: var(--muted);
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.85;
}

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

.hero-meta,
.detail-meta,
.movie-meta {
    color: #c4b5fd;
    font-weight: 700;
}

.hero-poster {
    border-radius: 32px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: var(--shadow);
    transform: rotate(2deg);
}

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

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

.hero-dot {
    width: 36px;
    height: 6px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
}

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

.content-section,
.page-hero,
.detail-shell {
    padding: 44px 0;
}

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

.section-heading h2,
.detail-section h2 {
    margin: 0;
    font-size: clamp(1.7rem, 3vw, 2.5rem);
}

.section-heading p {
    margin: 8px 0 0;
    color: var(--subtle);
}

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

.movie-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    box-shadow: 0 12px 42px rgba(0, 0, 0, 0.22);
    transition: transform 0.24s ease, border-color 0.24s ease, background 0.24s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(250, 204, 21, 0.42);
    background: rgba(255, 255, 255, 0.1);
}

.movie-card-cover {
    position: relative;
    display: block;
    overflow: hidden;
}

.movie-card-cover img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    transition: transform 0.35s ease;
}

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

.type-badge,
.rank-badge {
    position: absolute;
    z-index: 2;
    top: 10px;
    left: 10px;
    padding: 6px 9px;
    border-radius: 999px;
    color: #fff;
    background: rgba(147, 51, 234, 0.88);
    font-size: 0.78rem;
    font-weight: 900;
}

.rank-badge {
    left: auto;
    right: 10px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
}

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

.movie-card h3 {
    margin: 8px 0 8px;
    font-size: 1.05rem;
    line-height: 1.35;
}

.movie-one-line {
    display: -webkit-box;
    min-height: 3.1em;
    margin: 0;
    overflow: hidden;
    color: #d8c8ff;
    line-height: 1.55;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 12px;
}

.tag-row span,
.info-chip {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    color: #ede9fe;
    background: rgba(255, 255, 255, 0.08);
    padding: 5px 9px;
    font-size: 0.78rem;
}

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

.category-card {
    min-height: 168px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 22px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.24), rgba(219, 39, 119, 0.16));
    transition: transform 0.24s ease, border-color 0.24s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: rgba(250, 204, 21, 0.44);
}

.category-card h3 {
    margin: 0;
    font-size: 1.35rem;
}

.category-card p {
    margin: 10px 0;
    color: #d8c8ff;
    line-height: 1.7;
}

.search-panel {
    display: flex;
    gap: 14px;
    align-items: center;
    margin: 24px 0;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.07);
}

.filter-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin: 0 0 24px;
}

.filter-input {
    max-width: 420px;
}

.result-count {
    color: #fde68a;
    font-weight: 800;
}

.detail-hero {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background-image:
        linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(88, 28, 135, 0.72), rgba(2, 6, 23, 0.4)),
        var(--detail-image);
    background-size: cover;
    background-position: center;
}

.detail-shell {
    display: grid;
    grid-template-columns: minmax(260px, 380px) minmax(0, 1fr);
    gap: clamp(24px, 5vw, 56px);
    align-items: center;
}

.detail-cover {
    overflow: hidden;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: var(--shadow);
}

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

.detail-title h1 {
    font-size: clamp(2rem, 5vw, 4.5rem);
}

.detail-info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0;
}

.player-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: #000;
    box-shadow: var(--shadow);
}

.player-wrap video {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.play-mask {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(2, 6, 23, 0.34), rgba(88, 28, 135, 0.42));
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.play-mask.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.play-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
}

.detail-section {
    border: 1px solid var(--border);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.07);
    padding: clamp(20px, 4vw, 34px);
    margin-bottom: 28px;
}

.detail-section p {
    color: #e9d5ff;
    line-height: 1.9;
    font-size: 1.04rem;
}

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

.rank-row {
    display: grid;
    grid-template-columns: 58px 78px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.07);
    padding: 12px;
}

.rank-row strong {
    color: #facc15;
    font-size: 1.3rem;
    text-align: center;
}

.rank-row img {
    width: 78px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 12px;
}

.rank-row h3 {
    margin: 0 0 6px;
    font-size: 1.05rem;
}

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

.site-footer {
    margin-top: 48px;
    border-top: 1px solid rgba(168, 85, 247, 0.22);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.72), #000);
}

.footer-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.9fr);
    gap: 30px;
    padding: 42px 0;
}

.footer-shell strong {
    font-size: 1.35rem;
}

.footer-shell p {
    color: var(--subtle);
    line-height: 1.8;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.footer-links a {
    padding: 8px 12px;
    border-radius: 999px;
    color: #e9d5ff;
    background: rgba(255, 255, 255, 0.08);
}

.hidden-by-filter {
    display: none !important;
}

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

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

@media (max-width: 900px) {
    .menu-toggle {
        display: inline-flex;
    }

    .nav-shell {
        flex-wrap: wrap;
        padding: 12px 0;
    }

    .main-nav {
        display: none;
        flex: 1 0 100%;
        flex-direction: column;
        align-items: stretch;
        order: 3;
    }

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

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

    .header-search {
        flex: 1 0 100%;
        order: 2;
    }

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

    .hero-inner,
    .detail-shell {
        grid-template-columns: 1fr;
    }

    .hero-poster,
    .detail-cover {
        max-width: 360px;
    }

    .rank-list,
    .footer-shell {
        grid-template-columns: 1fr;
    }

    .footer-links {
        justify-content: flex-start;
    }
}

@media (max-width: 720px) {
    .movie-grid,
    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .content-section,
    .page-hero,
    .detail-shell {
        padding: 30px 0;
    }

    .section-heading,
    .search-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .rank-row {
        grid-template-columns: 44px 64px minmax(0, 1fr);
    }

    .rank-row img {
        width: 64px;
    }
}

@media (max-width: 440px) {
    .movie-grid,
    .category-grid {
        grid-template-columns: 1fr;
    }

    .header-search {
        flex-direction: column;
        align-items: stretch;
    }
}
