:root {
    --bg: #f8fafc;
    --text: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --card: #ffffff;
    --purple: #9333ea;
    --purple-dark: #6d28d9;
    --pink: #db2777;
    --red: #dc2626;
    --orange: #ea580c;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
    --soft-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

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

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

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(17, 24, 39, 0.92);
    color: #ffffff;
    backdrop-filter: blur(18px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

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

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

.logo-mark {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--purple), var(--pink));
    box-shadow: 0 10px 25px rgba(147, 51, 234, 0.38);
    font-size: 13px;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.nav-link,
.mobile-link {
    color: rgba(255, 255, 255, 0.78);
    padding: 10px 14px;
    border-radius: 999px;
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link.active,
.mobile-link:hover,
.mobile-link.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

.header-search,
.mobile-search {
    display: flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
}

.header-search input,
.mobile-search input {
    width: 220px;
    border: 0;
    color: #ffffff;
    outline: none;
    background: transparent;
    padding: 10px 14px;
}

.header-search input::placeholder,
.mobile-search input::placeholder {
    color: rgba(255, 255, 255, 0.62);
}

.header-search button,
.mobile-search button {
    border: 0;
    color: #ffffff;
    background: linear-gradient(135deg, var(--purple), var(--pink));
    padding: 10px 16px;
}

.menu-toggle {
    display: none;
    margin-left: auto;
    border: 0;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 9px 12px;
}

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

.mobile-panel.open {
    display: grid;
    gap: 10px;
}

.hero {
    position: relative;
    min-height: 78vh;
    overflow: hidden;
    color: #ffffff;
    background: radial-gradient(circle at 20% 15%, rgba(219, 39, 119, 0.35), transparent 30%), linear-gradient(135deg, #312e81 0%, #581c87 52%, #831843 100%);
}

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

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

.hero-slide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.28;
    transform: scale(1.02);
}

.hero-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.92) 0%, rgba(88, 28, 135, 0.74) 48%, rgba(15, 23, 42, 0.34) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    display: grid;
    align-content: center;
    min-height: 78vh;
    max-width: 760px;
    padding: 92px 0 112px;
}

.hero-kicker,
.section-kicker,
.detail-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 6px 14px;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(147, 51, 234, 0.86);
    font-size: 14px;
    font-weight: 700;
}

.hero h1 {
    margin: 18px 0 16px;
    max-width: 780px;
    font-size: clamp(42px, 7vw, 72px);
    line-height: 1.05;
    font-weight: 900;
    letter-spacing: -0.05em;
}

.hero p {
    max-width: 680px;
    margin: 0 0 26px;
    color: rgba(255, 255, 255, 0.86);
    font-size: clamp(17px, 2vw, 21px);
}

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

.hero-meta span,
.detail-meta span,
.card-tags span,
.movie-tags span {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    padding: 6px 12px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 13px;
}

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

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

.primary-button {
    color: #ffffff;
    background: linear-gradient(135deg, var(--purple), var(--pink));
    padding: 12px 24px;
    box-shadow: 0 18px 34px rgba(219, 39, 119, 0.28);
}

.primary-button:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 22px 46px rgba(219, 39, 119, 0.36);
}

.ghost-button {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    padding: 12px 22px;
}

.ghost-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

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

.hero-dot {
    width: 42px;
    height: 5px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.38);
}

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

.section {
    padding: 72px 0;
}

.section.alt {
    background: linear-gradient(135deg, #fff7ed, #fdf2f8 52%, #f5f3ff);
}

.section.dark {
    color: #ffffff;
    background: linear-gradient(135deg, #111827, #312e81 55%, #831843);
}

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

.section-head h2,
.page-hero h1,
.detail-title,
.content-block h2 {
    margin: 0;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.15;
    font-weight: 900;
    letter-spacing: -0.035em;
}

.section-head p,
.page-hero p,
.category-card p,
.movie-desc,
.content-block p {
    color: var(--muted);
}

.section.dark .section-head p,
.section.dark .movie-meta,
.section.dark .movie-desc {
    color: rgba(255, 255, 255, 0.68);
}

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

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

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

.poster-wrap,
.wide-poster,
.detail-poster {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 18px;
    background: linear-gradient(135deg, #312e81, #831843);
    box-shadow: var(--soft-shadow);
}

.poster-wrap {
    aspect-ratio: 3 / 4;
    margin-bottom: 12px;
}

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

.movie-card:hover img,
.detail-hero-card:hover img {
    transform: scale(1.08);
}

.poster-wrap::after,
.wide-poster::after,
.detail-poster::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 48%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.72), transparent);
}

.card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(220, 38, 38, 0.92);
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 700;
}

.poster-action {
    position: absolute;
    left: 14px;
    bottom: 14px;
    z-index: 2;
    color: #ffffff;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    font-weight: 800;
}

.movie-card:hover .poster-action {
    opacity: 1;
    transform: translateY(0);
}

.movie-card h3 {
    margin: 0 0 4px;
    font-size: 17px;
    line-height: 1.35;
    font-weight: 800;
}

.movie-card h3 a:hover,
.text-link:hover,
.rank-list a:hover {
    color: var(--purple);
}

.movie-meta {
    margin: 0 0 7px;
    color: var(--muted);
    font-size: 14px;
}

.movie-desc {
    display: -webkit-box;
    min-height: 44px;
    margin: 0;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 14px;
}

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

.card-wide {
    display: grid;
    grid-template-columns: 132px 1fr;
    gap: 18px;
    align-items: stretch;
    padding: 16px;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: var(--soft-shadow);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

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

.wide-poster {
    aspect-ratio: 1 / 1;
}

.wide-body h3 {
    margin: 0 0 6px;
    font-size: 20px;
}

.text-link {
    color: var(--purple);
    margin-top: 10px;
    font-size: 14px;
}

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

.category-card {
    padding: 24px;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: var(--soft-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.category-card h2,
.category-card h3 {
    margin: 0 0 10px;
    font-size: 22px;
}

.category-card p {
    margin: 0 0 16px;
}

.category-card .mini-list {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
}

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

.rank-item {
    display: grid;
    grid-template-columns: 54px 74px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--text);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.rank-no {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--orange), var(--red));
    font-weight: 900;
}

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

.rank-title {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 900;
}

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

.page-hero {
    color: #ffffff;
    background: radial-gradient(circle at 15% 20%, rgba(236, 72, 153, 0.32), transparent 32%), linear-gradient(135deg, #111827, #312e81 50%, #831843);
    padding: 82px 0 64px;
}

.page-hero p {
    max-width: 780px;
    color: rgba(255, 255, 255, 0.76);
    font-size: 18px;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    padding: 18px;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: var(--soft-shadow);
}

.filter-bar input,
.filter-bar select {
    border: 1px solid var(--line);
    border-radius: 999px;
    outline: none;
    padding: 11px 15px;
    background: #ffffff;
}

.filter-bar input {
    min-width: min(100%, 360px);
    flex: 1;
}

.detail-hero {
    position: relative;
    overflow: hidden;
    color: #ffffff;
    background: linear-gradient(135deg, #111827, #312e81 48%, #831843);
}

.detail-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.18;
    filter: blur(3px);
}

.detail-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(17, 24, 39, 0.94), rgba(49, 46, 129, 0.82), rgba(131, 24, 67, 0.62));
}

.detail-hero-inner {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 34px;
    align-items: center;
    padding: 70px 0;
}

.detail-poster {
    aspect-ratio: 3 / 4;
    box-shadow: var(--shadow);
}

.detail-title {
    margin-top: 16px;
    color: #ffffff;
}

.detail-summary {
    max-width: 860px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 18px;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
    gap: 28px;
    padding: 44px 0 72px;
}

.content-block,
.side-block {
    border-radius: 24px;
    background: #ffffff;
    padding: 28px;
    box-shadow: var(--soft-shadow);
}

.content-block + .content-block,
.side-block + .side-block {
    margin-top: 24px;
}

.content-block p {
    margin: 12px 0 0;
    font-size: 17px;
}

.player-section {
    background: #050505;
}

.player-inner {
    width: min(1180px, 100%);
    margin: 0 auto;
}

.player-box {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000000;
}

.video-view {
    width: 100%;
    height: 100%;
    background: #000000;
}

.player-cover {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 0;
    color: #ffffff;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0.74));
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.player-cover span {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--purple), var(--pink));
    padding: 15px 26px;
    font-weight: 900;
    box-shadow: 0 18px 40px rgba(219, 39, 119, 0.32);
}

.player-box.is-playing .player-cover {
    opacity: 0;
    visibility: hidden;
}

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

.side-block .movie-card + .movie-card {
    margin-top: 18px;
}

.site-footer {
    color: rgba(255, 255, 255, 0.78);
    background: #111827;
    padding-top: 44px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 28px;
}

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

.footer-grid a {
    display: block;
    margin: 7px 0;
}

.footer-grid a:hover {
    color: #ffffff;
}

.footer-logo {
    color: #ffffff;
    font-size: 20px;
}

.footer-bottom {
    margin-top: 34px;
    padding: 18px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.55);
}

.empty-state {
    display: none;
    padding: 30px;
    border-radius: 22px;
    text-align: center;
    color: var(--muted);
    background: #ffffff;
    box-shadow: var(--soft-shadow);
}

.empty-state.show {
    display: block;
}

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

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

@media (max-width: 860px) {
    .desktop-nav,
    .header-search {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .mobile-search input {
        width: 100%;
    }

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

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

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

    .footer-grid {
        grid-template-columns: 1fr;
    }
}

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

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

    .section {
        padding: 48px 0;
    }

    .section-head {
        display: block;
    }

    .movie-grid,
    .movie-grid.compact,
    .category-grid,
    .wide-list,
    .related-grid {
        grid-template-columns: 1fr;
    }

    .card-wide {
        grid-template-columns: 112px 1fr;
        padding: 12px;
    }

    .rank-item {
        grid-template-columns: 42px 64px 1fr;
    }

    .rank-item .primary-button {
        grid-column: 1 / -1;
    }
}
