:root {
    --color-primary: 30 30 35;
    --color-secondary: 45 45 50;
    --color-accent: 70 130 180;
    --color-success: 46 125 50;
    --color-warning: 255 152 0;
    --color-error: 211 47 47;
    --color-text-primary: 240 240 245;
    --color-text-secondary: 180 180 190;
    --color-text-muted: 120 120 130;
    --color-bg-primary: 18 18 22;
    --color-bg-secondary: 25 25 30;
    --color-bg-tertiary: 35 35 40;
    --color-border: 50 50 60;
    --shadow-soft: 0 25px 50px rgba(0, 0, 0, 0.28);
    --radius-lg: 24px;
    --radius-md: 16px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: rgb(var(--color-bg-primary));
    color: rgb(var(--color-text-primary));
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 16% 12%, rgba(70, 130, 180, 0.20), transparent 32%),
        radial-gradient(circle at 78% 2%, rgba(255, 255, 255, 0.08), transparent 30%),
        linear-gradient(180deg, rgba(18, 18, 22, 0.2), rgb(var(--color-bg-primary)) 64%);
    z-index: -1;
}

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

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

button,
input,
select {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(var(--color-bg-secondary), 0.94);
    border-bottom: 1px solid rgb(var(--color-border));
    backdrop-filter: blur(12px);
}

.nav-wrap {
    width: min(1280px, calc(100% - 32px));
    height: 68px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

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

.brand-mark {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(var(--color-accent), 0.18);
    color: rgb(var(--color-accent));
    box-shadow: inset 0 0 0 1px rgba(var(--color-accent), 0.24);
    transition: transform 0.3s ease;
}

.brand:hover .brand-mark {
    transform: rotate(12deg) scale(1.05);
}

.brand-text {
    font-size: 21px;
    background: linear-gradient(90deg, rgb(var(--color-text-primary)), rgb(var(--color-accent)));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

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

.nav-link {
    position: relative;
    padding: 23px 0;
    color: rgb(var(--color-text-secondary));
    font-size: 14px;
    font-weight: 650;
    transition: color 0.2s ease;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 16px;
    height: 2px;
    border-radius: 99px;
    background: rgb(var(--color-accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: rgb(var(--color-text-primary));
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    padding: 9px;
    border-radius: 12px;
    background: transparent;
}

.menu-toggle span {
    display: block;
    height: 2px;
    margin: 5px 0;
    background: rgb(var(--color-text-primary));
    border-radius: 99px;
}

.mobile-nav {
    display: none;
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 8px 0 18px;
    border-top: 1px solid rgb(var(--color-border));
}

.mobile-nav .nav-link {
    display: block;
    padding: 11px 14px;
    border-radius: 12px;
}

.mobile-nav .nav-link::after {
    display: none;
}

.mobile-nav.is-open {
    display: block;
}

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

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

.section-title,
.page-title {
    margin: 0;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.15;
    font-weight: 850;
    background: linear-gradient(90deg, rgb(var(--color-text-primary)), rgb(var(--color-text-secondary)));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.section-lead,
.page-lead {
    margin: 10px 0 0;
    max-width: 760px;
    color: rgb(var(--color-text-secondary));
    line-height: 1.8;
}

.hero {
    position: relative;
    min-height: calc(100vh - 68px);
    overflow: hidden;
    background: rgb(var(--color-bg-primary));
}

.hero-slider {
    position: relative;
    min-height: calc(100vh - 68px);
}

.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-bg {
    position: absolute;
    inset: 0;
}

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

.gradient-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.84), rgba(0, 0, 0, 0.42) 52%, rgba(0, 0, 0, 0.70)),
        linear-gradient(0deg, rgb(var(--color-bg-primary)) 0%, rgba(18, 18, 22, 0.04) 42%);
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    min-height: calc(100vh - 68px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: end;
    gap: 48px;
    padding: 78px 0 72px;
}

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

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 8px 12px;
    color: rgb(var(--color-accent));
    background: rgba(var(--color-accent), 0.14);
    border: 1px solid rgba(var(--color-accent), 0.28);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 750;
}

.hero h1 {
    margin: 0 0 12px;
    font-size: clamp(40px, 7vw, 76px);
    line-height: 0.98;
    letter-spacing: -0.04em;
    font-weight: 900;
    color: white;
    text-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}

.hero h2 {
    margin: 0 0 16px;
    font-size: clamp(26px, 4vw, 48px);
    line-height: 1.08;
    font-weight: 820;
    color: white;
}

.hero p {
    margin: 0;
    max-width: 680px;
    color: rgb(226, 232, 240);
    font-size: 18px;
    line-height: 1.75;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 24px 0 28px;
}

.hero-meta span,
.card-tags span,
.detail-tags span,
.filter-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    color: rgb(var(--color-text-primary));
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-meta span {
    padding: 7px 12px;
    backdrop-filter: blur(8px);
}

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

.btn-primary,
.btn-secondary,
.search-panel button,
.player-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: 13px;
    padding: 0 20px;
    font-weight: 800;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn-primary,
.search-panel button,
.player-button {
    color: white;
    background: rgb(var(--color-accent));
}

.btn-secondary {
    color: white;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(10px);
}

.btn-primary:hover,
.btn-secondary:hover,
.search-panel button:hover,
.player-button:hover {
    transform: translateY(-2px);
}

.hero-poster {
    display: block;
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    aspect-ratio: 2 / 3;
    background: rgb(var(--color-bg-tertiary));
}

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

.hero-poster span {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 18px;
    color: white;
    font-size: 18px;
    font-weight: 800;
    text-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.hero-controls {
    position: absolute;
    left: 50%;
    bottom: 28px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(-50%);
}

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

.hero-dot.active {
    background: rgb(var(--color-accent));
}

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 5;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: white;
    background: rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(10px);
    transform: translateY(-50%);
    transition: background 0.2s ease, opacity 0.2s ease;
}

.hero-arrow:hover {
    background: rgba(0, 0, 0, 0.72);
}

.hero-arrow.prev {
    left: 22px;
}

.hero-arrow.next {
    right: 22px;
}

.search-panel {
    display: flex;
    gap: 12px;
    width: min(720px, 100%);
    padding: 8px;
    margin-top: 28px;
    border-radius: 18px;
    background: rgba(var(--color-bg-secondary), 0.82);
    border: 1px solid rgb(var(--color-border));
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.search-panel input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    color: rgb(var(--color-text-primary));
    background: transparent;
    padding: 0 14px;
}

.search-panel input::placeholder {
    color: rgb(var(--color-text-muted));
}

.search-page-tools {
    display: grid;
    grid-template-columns: 1fr 180px 160px;
    gap: 12px;
    margin: 28px 0;
}

.search-page-tools input,
.search-page-tools select {
    min-height: 48px;
    border: 1px solid rgb(var(--color-border));
    border-radius: 14px;
    padding: 0 14px;
    color: rgb(var(--color-text-primary));
    background: rgb(var(--color-bg-secondary));
    outline: none;
}

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

.movie-card {
    min-width: 0;
    overflow: hidden;
    border-radius: 18px;
    background: rgb(var(--color-bg-secondary));
    border: 1px solid rgba(var(--color-border), 0.8);
    transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.movie-card:hover {
    transform: translateY(-8px) scale(1.02);
    background: rgb(var(--color-bg-tertiary));
    box-shadow: var(--shadow-soft);
}

.poster-link {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: rgb(var(--color-bg-tertiary));
}

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

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

.poster-shade {
    position: absolute;
    inset: auto 0 0;
    height: 54%;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.78), transparent);
}

.score-badge {
    position: absolute;
    right: 10px;
    top: 10px;
    display: inline-flex;
    min-width: 42px;
    min-height: 28px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #facc15;
    background: rgba(0, 0, 0, 0.64);
    font-weight: 850;
    backdrop-filter: blur(8px);
}

.card-body {
    padding: 14px;
}

.card-body h3 {
    margin: 0 0 7px;
    font-size: 16px;
    line-height: 1.35;
    font-weight: 800;
}

.card-body h3 a:hover,
.rank-info h3 a:hover {
    color: rgb(var(--color-accent));
}

.card-body p {
    margin: 0 0 12px;
    min-height: 44px;
    color: rgb(var(--color-text-secondary));
    font-size: 13px;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-tags,
.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.card-tags span,
.detail-tags span,
.filter-chip {
    padding: 5px 9px;
    color: rgb(var(--color-accent));
    background: rgba(var(--color-accent), 0.12);
    border-color: rgba(var(--color-accent), 0.22);
    font-size: 12px;
}

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

.category-card {
    position: relative;
    min-height: 178px;
    overflow: hidden;
    border-radius: var(--radius-lg);
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(var(--color-accent), 0.22), rgba(var(--color-bg-secondary), 0.95)),
        rgb(var(--color-bg-secondary));
    border: 1px solid rgba(var(--color-accent), 0.18);
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.category-card:hover {
    transform: translateY(-6px);
    border-color: rgba(var(--color-accent), 0.52);
}

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

.category-card p {
    margin: 0;
    color: rgb(var(--color-text-secondary));
    line-height: 1.75;
}

.category-card .category-link-text {
    position: absolute;
    left: 24px;
    bottom: 22px;
    color: rgb(var(--color-accent));
    font-weight: 800;
}

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

.rank-row {
    display: grid;
    grid-template-columns: 56px 88px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 14px;
    border-radius: 18px;
    background: rgb(var(--color-bg-secondary));
    border: 1px solid rgba(var(--color-border), 0.72);
    transition: transform 0.25s ease, background 0.25s ease;
}

.rank-row:hover {
    transform: translateX(6px);
    background: rgb(var(--color-bg-tertiary));
}

.rank-num {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: white;
    background: rgba(var(--color-accent), 0.22);
    font-weight: 900;
}

.rank-thumb {
    width: 88px;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 12px;
    background: rgb(var(--color-bg-tertiary));
}

.rank-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rank-info h3 {
    margin: 0 0 6px;
    font-size: 18px;
}

.rank-info p {
    margin: 0 0 8px;
    color: rgb(var(--color-text-secondary));
    line-height: 1.65;
}

.meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: rgb(var(--color-text-muted));
    font-size: 13px;
}

.meta-line span:not(:last-child)::after {
    content: "·";
    margin-left: 8px;
}

.rank-score {
    color: #facc15;
    font-size: 20px;
}

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

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

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 28px;
}

.detail-main,
.detail-side {
    min-width: 0;
}

.player-box {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-lg);
    background: #000;
    box-shadow: var(--shadow-soft);
}

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

.player-cover {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    background: #000;
}

.player-cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.58;
}

.player-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.74), rgba(0, 0, 0, 0.18));
}

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

.player-button {
    position: relative;
    z-index: 3;
    min-width: 128px;
    min-height: 54px;
    font-size: 17px;
    box-shadow: 0 15px 35px rgba(70, 130, 180, 0.35);
}

.detail-title {
    margin: 24px 0 10px;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.16;
}

.detail-intro {
    color: rgb(var(--color-text-secondary));
    font-size: 18px;
    line-height: 1.8;
}

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

.detail-meta span {
    padding: 7px 11px;
    border-radius: 12px;
    color: rgb(var(--color-text-secondary));
    background: rgb(var(--color-bg-secondary));
    border: 1px solid rgb(var(--color-border));
}

.content-panel {
    margin-top: 22px;
    padding: 24px;
    border-radius: var(--radius-lg);
    background: rgb(var(--color-bg-secondary));
    border: 1px solid rgba(var(--color-border), 0.72);
}

.content-panel h2 {
    margin: 0 0 14px;
    font-size: 22px;
}

.content-panel p {
    margin: 0;
    color: rgb(var(--color-text-secondary));
    line-height: 1.9;
    white-space: pre-line;
}

.side-panel {
    position: sticky;
    top: 92px;
    padding: 18px;
    border-radius: var(--radius-lg);
    background: rgb(var(--color-bg-secondary));
    border: 1px solid rgba(var(--color-border), 0.72);
}

.side-panel h2 {
    margin: 0 0 16px;
    font-size: 22px;
}

.side-related {
    display: grid;
    gap: 14px;
}

.movie-card.compact {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
    border-radius: 14px;
}

.movie-card.compact:hover {
    transform: translateY(-3px);
}

.movie-card.compact .poster-link {
    aspect-ratio: 2 / 3;
}

.movie-card.compact .card-body {
    padding: 12px 12px 12px 0;
}

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

.movie-card.compact .card-body p {
    min-height: 0;
    font-size: 12px;
}

.site-footer {
    margin-top: 48px;
    border-top: 1px solid rgb(var(--color-border));
    background: rgb(var(--color-bg-secondary));
}

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

.footer-inner p {
    margin: 12px 0 0;
    color: rgb(var(--color-text-secondary));
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}

.footer-links a {
    color: rgb(var(--color-text-secondary));
}

.footer-links a:hover {
    color: rgb(var(--color-accent));
}

.empty-state {
    display: none;
    margin: 30px 0;
    padding: 34px;
    text-align: center;
    border-radius: var(--radius-lg);
    color: rgb(var(--color-text-secondary));
    background: rgb(var(--color-bg-secondary));
}

.empty-state.is-visible {
    display: block;
}

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

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

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

    .menu-toggle {
        display: block;
    }

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

    .hero-poster {
        display: none;
    }

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

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

    .side-panel {
        position: static;
    }
}

@media (max-width: 760px) {
    .section-container {
        padding: 36px 0;
    }

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

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

    .category-grid,
    .search-page-tools {
        grid-template-columns: 1fr;
    }

    .hero-arrow {
        display: none;
    }

    .search-panel {
        flex-direction: column;
        padding: 12px;
    }

    .search-panel input {
        min-height: 44px;
    }

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

    .rank-score {
        display: none;
    }

    .rank-thumb {
        width: 64px;
    }
}
