:root {
    --purple-900: #581c87;
    --purple-800: #6b21a8;
    --purple-700: #7e22ce;
    --purple-600: #9333ea;
    --pink-600: #db2777;
    --indigo-950: #1e1b4b;
    --gray-950: #030712;
    --gray-900: #111827;
    --gray-800: #1f2937;
    --gray-700: #374151;
    --gray-600: #4b5563;
    --gray-500: #6b7280;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --gray-50: #f9fafb;
    --white: #ffffff;
    --shadow-lg: 0 20px 45px rgba(17, 24, 39, 0.16);
    --shadow-md: 0 10px 25px rgba(17, 24, 39, 0.12);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--gray-900);
    background: var(--white);
    line-height: 1.65;
}

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

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

button,
input,
select {
    font: inherit;
}

[hidden] {
    display: none !important;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(17, 24, 39, 0.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

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

.logo-mark {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: var(--white);
    background: linear-gradient(135deg, var(--purple-600), var(--pink-600));
    box-shadow: 0 10px 22px rgba(147, 51, 234, 0.36);
    font-size: 14px;
}

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

.nav-link {
    color: rgba(255, 255, 255, 0.78);
    font-weight: 600;
    transition: color 0.2s ease;
}

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

.nav-toggle {
    display: none;
    color: var(--white);
    background: rgba(255, 255, 255, 0.12);
    border: 0;
    border-radius: 10px;
    padding: 8px 12px;
}

.hero-section {
    position: relative;
    min-height: 72vh;
    overflow: hidden;
    color: var(--white);
    background: linear-gradient(135deg, #312e81, var(--purple-900), #831843);
}

.hero-bg,
.hero-bg img,
.hero-overlay {
    position: absolute;
    inset: 0;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3;
    transform: scale(1.02);
}

.hero-overlay {
    background:
        radial-gradient(circle at 20% 20%, rgba(216, 180, 254, 0.24), transparent 36%),
        linear-gradient(90deg, rgba(3, 7, 18, 0.88), rgba(3, 7, 18, 0.45), rgba(3, 7, 18, 0.72));
}

.hero-content {
    position: relative;
    min-height: 72vh;
    display: flex;
    align-items: center;
}

.hero-text {
    width: min(760px, 100%);
}

.hero-badge {
    display: inline-flex;
    padding: 6px 16px;
    margin-bottom: 18px;
    border-radius: 999px;
    background: rgba(147, 51, 234, 0.92);
    font-size: 14px;
    font-weight: 700;
}

.hero-text h1 {
    margin: 0 0 18px;
    font-size: clamp(40px, 7vw, 72px);
    line-height: 1.05;
    font-weight: 900;
}

.hero-text p {
    margin: 0 0 24px;
    color: rgba(255, 255, 255, 0.86);
    font-size: clamp(18px, 2.2vw, 24px);
}

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

.hero-meta span,
.detail-meta span,
.detail-tags span,
.tag-row span {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.88);
    font-size: 13px;
}

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

.primary-btn,
.ghost-btn,
.section-more,
.play-pill {
    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 {
    min-height: 48px;
    padding: 0 28px;
    color: var(--white);
    background: linear-gradient(90deg, var(--purple-600), var(--pink-600));
    box-shadow: 0 16px 30px rgba(219, 39, 119, 0.3);
}

.primary-btn:hover,
.movie-card:hover .play-pill {
    transform: translateY(-2px) scale(1.02);
}

.ghost-btn {
    min-height: 48px;
    padding: 0 24px;
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.34);
    background: rgba(255, 255, 255, 0.1);
}

.content-section {
    padding: 72px 0;
}

.gray-section,
.soft-section {
    background: var(--gray-50);
}

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

.section-head h2 {
    margin: 0;
    font-size: clamp(28px, 4vw, 38px);
    line-height: 1.15;
    font-weight: 900;
    color: var(--gray-900);
}

.section-head p {
    margin: 8px 0 0;
    color: var(--gray-600);
}

.section-more {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0 18px;
    color: var(--purple-700);
    background: #faf5ff;
}

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

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

.movie-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border-radius: 18px;
    background: var(--white);
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.08);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

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

.poster-wrap {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: linear-gradient(135deg, #ede9fe, #fce7f3);
}

.poster-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.movie-card:hover .poster-wrap img {
    transform: scale(1.08);
}

.poster-mask {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 18px;
    background: linear-gradient(180deg, transparent, rgba(3, 7, 18, 0.76));
    opacity: 0;
    transition: opacity 0.24s ease;
}

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

.play-pill {
    min-height: 38px;
    padding: 0 16px;
    color: var(--white);
    background: linear-gradient(90deg, var(--purple-600), var(--pink-600));
}

.card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 16px;
}

.card-body h3 {
    margin: 0;
    color: var(--gray-900);
    font-size: 17px;
    line-height: 1.35;
    font-weight: 800;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.movie-meta {
    margin: 8px 0 0;
    color: var(--gray-500);
    font-size: 13px;
}

.movie-brief {
    margin: 10px 0 14px;
    color: var(--gray-600);
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tag-row {
    margin-top: auto;
}

.tag-row span {
    background: #f3e8ff;
    color: var(--purple-700);
}

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

.ranking-panel {
    position: sticky;
    top: 96px;
    padding: 24px;
    border-radius: 20px;
    background: var(--white);
    box-shadow: var(--shadow-md);
}

.ranking-panel h2 {
    margin: 0 0 18px;
    font-size: 26px;
}

.ranking-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

.ranking-item span,
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    background: linear-gradient(135deg, var(--purple-600), var(--pink-600));
    font-weight: 900;
}

.ranking-item span {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    font-size: 13px;
}

.ranking-item strong {
    overflow: hidden;
    color: var(--gray-900);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ranking-item em {
    color: var(--gray-500);
    font-style: normal;
}

.rank-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    min-width: 36px;
    height: 36px;
    border-radius: 12px;
}

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

.category-entry,
.category-card {
    overflow: hidden;
    border-radius: 20px;
    background: linear-gradient(135deg, #faf5ff, #fdf2f8);
    box-shadow: 0 10px 24px rgba(147, 51, 234, 0.1);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.category-entry {
    padding: 24px;
}

.category-entry:hover,
.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.category-entry span,
.category-card h2 {
    color: var(--gray-900);
    font-size: 22px;
    font-weight: 900;
}

.category-entry p,
.category-card p {
    margin: 8px 0 0;
    color: var(--gray-600);
}

.category-card {
    display: flex;
    flex-direction: column;
}

.category-card > div:last-child {
    padding: 22px;
}

.category-card h2 {
    margin: 0;
}

.category-card span {
    display: inline-flex;
    margin-top: 16px;
    color: var(--purple-700);
    font-weight: 800;
}

.category-thumbs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 4px;
    background: var(--gray-900);
}

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

.page-hero {
    padding: 84px 0;
    color: var(--white);
}

.purple-hero,
.category-hero,
.ranking-hero {
    background: linear-gradient(135deg, var(--indigo-950), var(--purple-900), #831843);
}

.page-hero h1 {
    margin: 0 0 12px;
    font-size: clamp(38px, 6vw, 58px);
    line-height: 1.1;
    font-weight: 900;
}

.page-hero p {
    margin: 0;
    width: min(760px, 100%);
    color: rgba(255, 255, 255, 0.84);
    font-size: 18px;
}

.breadcrumb {
    margin: 0 0 12px !important;
    color: rgba(255, 255, 255, 0.78) !important;
    font-size: 14px !important;
}

.breadcrumb a {
    color: var(--white);
    font-weight: 700;
}

.filter-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 170px 170px;
    gap: 14px;
    margin-bottom: 28px;
    padding: 16px;
    border-radius: 20px;
    background: var(--white);
    box-shadow: var(--shadow-md);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 16px;
    border: 1px solid var(--gray-200);
    border-radius: 999px;
    background: var(--gray-50);
}

.search-box span {
    color: var(--purple-700);
    font-size: 18px;
    font-weight: 900;
}

.search-box input,
.filter-panel select {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--gray-900);
}

.filter-panel select {
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid var(--gray-200);
    border-radius: 999px;
    background: var(--gray-50);
}

.no-result {
    margin: 24px 0;
    padding: 22px;
    border-radius: 18px;
    color: var(--gray-600);
    background: var(--gray-50);
    text-align: center;
}

.detail-hero {
    position: relative;
    overflow: hidden;
    color: var(--white);
    background: var(--gray-950);
}

.detail-bg,
.detail-bg img,
.detail-bg-mask {
    position: absolute;
    inset: 0;
}

.detail-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.25;
    filter: blur(1px);
}

.detail-bg-mask {
    background: linear-gradient(90deg, rgba(3, 7, 18, 0.95), rgba(3, 7, 18, 0.76), rgba(88, 28, 135, 0.72));
}

.detail-hero-inner {
    position: relative;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 36px;
    align-items: center;
    padding: 62px 0;
}

.detail-poster {
    overflow: hidden;
    border: 4px solid rgba(255, 255, 255, 0.12);
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
}

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

.detail-info h1 {
    margin: 0 0 16px;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.08;
    font-weight: 900;
}

.detail-one-line {
    margin: 0 0 22px;
    max-width: 860px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 19px;
}

.detail-tags {
    margin-top: 18px;
}

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

.video-shell {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    background: #000;
    box-shadow: var(--shadow-lg);
}

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

.video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    border: 0;
    color: var(--white);
    background: radial-gradient(circle, rgba(147, 51, 234, 0.36), rgba(3, 7, 18, 0.42));
    cursor: pointer;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.video-overlay span {
    width: 74px;
    height: 74px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--purple-600), var(--pink-600));
    box-shadow: 0 18px 34px rgba(219, 39, 119, 0.34);
}

.video-overlay strong {
    font-size: 20px;
}

.video-shell.is-playing .video-overlay {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.detail-content-section {
    padding-top: 40px;
}

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

.detail-article,
.detail-side {
    border-radius: 22px;
    background: var(--white);
    box-shadow: var(--shadow-md);
}

.detail-article {
    padding: 30px;
}

.detail-article h2,
.detail-side h2 {
    margin: 0 0 16px;
    color: var(--gray-900);
    font-size: 26px;
    font-weight: 900;
}

.detail-article h2:not(:first-child) {
    margin-top: 28px;
}

.detail-article p {
    margin: 0;
    color: var(--gray-700);
    font-size: 17px;
}

.detail-side {
    padding: 24px;
}

.detail-side dl {
    margin: 0;
}

.detail-side dt {
    margin-top: 14px;
    color: var(--gray-500);
    font-size: 13px;
}

.detail-side dd {
    margin: 3px 0 0;
    color: var(--gray-900);
    font-weight: 700;
}

.detail-side a {
    color: var(--purple-700);
}

.detail-nav-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 32px;
}

.detail-nav-links a {
    overflow: hidden;
    padding: 16px 18px;
    border-radius: 16px;
    color: var(--purple-700);
    background: var(--white);
    font-weight: 800;
    white-space: nowrap;
    text-overflow: ellipsis;
    box-shadow: 0 10px 22px rgba(17, 24, 39, 0.07);
}

.site-footer {
    color: rgba(255, 255, 255, 0.78);
    background: var(--gray-900);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: 32px;
    padding: 48px 0 32px;
}

.site-footer h3 {
    margin: 0 0 12px;
    color: var(--white);
}

.site-footer p {
    max-width: 520px;
}

.site-footer a:not(.footer-logo) {
    display: block;
    margin: 8px 0;
    transition: color 0.2s ease;
}

.site-footer a:hover {
    color: var(--white);
}

.footer-bottom {
    padding: 18px 0 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 14px;
}

@media (max-width: 1024px) {
    .movie-grid,
    .compact-grid,
    .mini-grid,
    .all-grid,
    .ranking-page-grid,
    .category-entry-grid,
    .category-card-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

    .ranking-panel {
        position: static;
    }
}

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

    .nav-toggle {
        display: inline-flex;
    }

    .main-nav {
        position: absolute;
        top: 64px;
        left: 16px;
        right: 16px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 12px;
        border-radius: 18px;
        background: rgba(17, 24, 39, 0.98);
        box-shadow: var(--shadow-lg);
    }

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

    .nav-link {
        padding: 12px 14px;
        border-radius: 12px;
    }

    .nav-link:hover,
    .nav-link.active {
        background: rgba(255, 255, 255, 0.08);
    }

    .hero-section,
    .hero-content {
        min-height: 76vh;
    }

    .content-section {
        padding: 48px 0;
    }

    .movie-grid,
    .compact-grid,
    .mini-grid,
    .all-grid,
    .ranking-page-grid,
    .category-entry-grid,
    .category-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

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

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

    .detail-hero-inner {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 42px 0;
    }

    .detail-poster {
        width: min(260px, 70%);
    }

    .detail-nav-links,
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        width: min(100% - 24px, 1180px);
    }

    .movie-grid,
    .compact-grid,
    .mini-grid,
    .all-grid,
    .ranking-page-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .card-body {
        padding: 12px;
    }

    .card-body h3 {
        font-size: 15px;
    }

    .movie-brief {
        display: none;
    }

    .detail-article,
    .detail-side {
        padding: 20px;
    }
}
