:root {
    --slate-950: #020617;
    --slate-900: #0f172a;
    --slate-850: #152033;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-400: #94a3b8;
    --slate-300: #cbd5e1;
    --white: #ffffff;
    --emerald: #10b981;
    --emerald-600: #059669;
    --blue: #3b82f6;
    --purple: #a855f7;
    --yellow: #facc15;
    --orange: #f97316;
    --pink: #ec4899;
    --shadow: 0 20px 45px rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--slate-950);
    color: var(--slate-300);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100%;
    background: linear-gradient(180deg, var(--slate-900), var(--slate-950));
}

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

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

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.97), rgba(30, 41, 59, 0.97), rgba(15, 23, 42, 0.97));
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(16px);
}

.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 64px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
    font-size: 20px;
    font-weight: 800;
    white-space: nowrap;
}

.brand-icon {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.16);
    color: var(--emerald);
}

.brand:hover .brand-text {
    color: #6ee7b7;
}

.search-form,
.mobile-search {
    position: relative;
    display: flex;
    flex: 1;
    max-width: 640px;
}

.search-form input,
.mobile-search input,
.search-panel input,
.search-panel select {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 999px;
    outline: none;
    background: rgba(51, 65, 85, 0.92);
    color: var(--white);
    padding: 11px 98px 11px 18px;
}

.search-form input::placeholder,
.mobile-search input::placeholder,
.search-panel input::placeholder {
    color: var(--slate-400);
}

.search-form input:focus,
.mobile-search input:focus,
.search-panel input:focus,
.search-panel select:focus {
    border-color: var(--emerald);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
}

.search-form button,
.mobile-search button {
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 999px;
    background: var(--emerald);
    color: var(--white);
    padding: 8px 18px;
}

.search-form button:hover,
.mobile-search button:hover,
.primary-button:hover {
    background: var(--emerald-600);
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    color: var(--slate-300);
    white-space: nowrap;
}

.nav-link,
.nav-dropdown > button {
    border: 0;
    background: transparent;
    color: var(--slate-300);
    padding: 20px 0;
}

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

.nav-dropdown {
    position: relative;
}

.nav-dropdown-panel {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 180px;
    padding: 8px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 14px;
    background: var(--slate-800);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: 0.2s ease;
}

.nav-dropdown:hover .nav-dropdown-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-panel a {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--slate-300);
}

.nav-dropdown-panel a:hover {
    background: var(--slate-700);
    color: var(--white);
}

.mobile-toggle {
    display: none;
    border: 0;
    background: transparent;
    color: var(--white);
    font-size: 28px;
}

.mobile-panel {
    display: none;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    background: var(--slate-800);
    padding: 16px;
}

.mobile-panel.open {
    display: block;
}

.mobile-panel > a {
    display: block;
    padding: 10px 0;
    color: var(--slate-300);
}

.mobile-category-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.mobile-category-grid a {
    padding: 10px;
    border-radius: 10px;
    background: var(--slate-700);
}

.hero {
    position: relative;
    height: 600px;
    overflow: hidden;
    background: #000;
}

.hero-track,
.hero-slide {
    position: absolute;
    inset: 0;
}

.hero-slide {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.55s ease;
}

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

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

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.52), rgba(0, 0, 0, 0.08));
}

.hero-content {
    position: absolute;
    left: 50%;
    bottom: 56px;
    transform: translateX(-50%);
}

.hero-kicker,
.section-heading span,
.page-hero span {
    display: inline-block;
    margin-bottom: 12px;
    border-radius: 999px;
    background: var(--emerald);
    color: var(--white);
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 700;
}

.hero h1 {
    max-width: 760px;
    margin: 0 0 16px;
    color: var(--white);
    font-size: clamp(36px, 6vw, 62px);
    line-height: 1.05;
}

.hero p {
    max-width: 680px;
    margin: 0 0 24px;
    color: var(--slate-300);
    font-size: 18px;
    line-height: 1.8;
}

.hero-tags,
.detail-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    color: var(--slate-300);
}

.hero-tags span:first-child,
.detail-stats span:first-child {
    color: var(--yellow);
    font-weight: 800;
}

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

.primary-button,
.ghost-button,
.section-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: 999px;
    padding: 0 24px;
    font-weight: 800;
    transition: 0.2s ease;
}

.primary-button {
    background: var(--emerald);
    color: var(--white);
}

.ghost-button {
    border: 1px solid rgba(255, 255, 255, 0.36);
    color: var(--white);
    background: rgba(255, 255, 255, 0.06);
}

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

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 44px;
    height: 44px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.48);
    color: var(--white);
    font-size: 36px;
    line-height: 1;
}

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

.hero-arrow-left {
    left: 24px;
}

.hero-arrow-right {
    right: 24px;
}

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

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

.hero-dot.active {
    width: 26px;
    background: var(--emerald);
}

.main-layout,
.page-content {
    padding: 56px 0;
}

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

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

.section-heading.centered {
    justify-content: center;
    text-align: center;
}

.section-heading span {
    margin-bottom: 8px;
    background: rgba(16, 185, 129, 0.16);
    color: #6ee7b7;
}

.section-heading h2 {
    margin: 0;
    color: var(--white);
    font-size: 30px;
}

.section-link {
    min-height: 38px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: var(--slate-300);
    padding: 0 18px;
}

.section-link:hover {
    color: var(--white);
    border-color: var(--emerald);
}

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

.movie-card {
    display: block;
    overflow: hidden;
    border-radius: 14px;
    background: var(--slate-800);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.75), var(--shadow);
}

.movie-card-poster {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: linear-gradient(135deg, var(--slate-850), var(--slate-950));
}

.movie-card-poster img,
.poster-card img,
.side-item img,
.rank-row img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.movie-badge,
.movie-year {
    position: absolute;
    top: 10px;
    border-radius: 8px;
    padding: 5px 8px;
    font-size: 12px;
    font-weight: 800;
}

.movie-badge {
    left: 10px;
    background: var(--emerald);
    color: var(--white);
}

.movie-year {
    right: 10px;
    background: rgba(0, 0, 0, 0.68);
    color: var(--white);
}

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

.movie-card-body h3 {
    display: -webkit-box;
    min-height: 54px;
    margin: 0 0 10px;
    overflow: hidden;
    color: var(--white);
    font-size: 18px;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.movie-card-body p {
    display: -webkit-box;
    min-height: 44px;
    margin: 0 0 12px;
    overflow: hidden;
    color: var(--slate-400);
    font-size: 14px;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.movie-meta-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--slate-400);
    font-size: 14px;
}

.movie-meta-line span:first-child {
    color: var(--yellow);
    font-weight: 800;
}

.movie-card--compact {
    min-width: 300px;
}

.scroll-row {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    padding: 4px 4px 16px;
}

.category-block {
    border-radius: 24px;
    background: linear-gradient(90deg, var(--slate-800), var(--slate-900));
    padding: 32px;
}

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

.category-tile,
.category-card {
    display: flex;
    min-height: 150px;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 18px;
    padding: 24px;
    color: var(--white);
    overflow: hidden;
    transition: transform 0.22s ease;
}

.category-tile:hover,
.category-card:hover {
    transform: translateY(-4px) scale(1.015);
}

.category-tile span,
.category-card span {
    font-size: 24px;
    font-weight: 900;
}

.category-tile strong,
.category-card strong {
    color: rgba(255, 255, 255, 0.92);
}

.category-tile em,
.category-card em,
.category-card p {
    color: rgba(255, 255, 255, 0.78);
    font-style: normal;
}

.from-red {
    background: linear-gradient(135deg, #ef4444, #991b1b);
}

.from-blue {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
}

.from-green {
    background: linear-gradient(135deg, #22c55e, #166534);
}

.from-orange {
    background: linear-gradient(135deg, #f97316, #9a3412);
}

.from-pink {
    background: linear-gradient(135deg, #ec4899, #9d174d);
}

.from-purple {
    background: linear-gradient(135deg, #a855f7, #581c87);
}

.from-cyan {
    background: linear-gradient(135deg, #06b6d4, #155e75);
}

.from-yellow {
    background: linear-gradient(135deg, #eab308, #854d0e);
}

.from-slate {
    background: linear-gradient(135deg, #64748b, #1e293b);
}

.rank-panel {
    overflow: hidden;
    border-radius: 18px;
    background: var(--slate-800);
    padding: 12px;
}

.rank-panel.large {
    padding: 18px;
}

.rank-row {
    display: grid;
    grid-template-columns: 48px 96px 1fr auto;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 12px;
    padding: 14px;
}

.rank-row:last-child {
    border-bottom: 0;
}

.rank-row:hover {
    background: rgba(51, 65, 85, 0.76);
}

.rank-number {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 10px;
    background: var(--slate-700);
    color: var(--slate-300);
    font-weight: 900;
}

.rank-row:nth-child(-n + 3) .rank-number {
    background: linear-gradient(135deg, var(--yellow), var(--orange));
    color: var(--white);
}

.rank-row img {
    width: 96px;
    height: 58px;
    border-radius: 10px;
    background: var(--slate-900);
}

.rank-title {
    min-width: 0;
}

.rank-title strong,
.rank-title em {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-title strong {
    color: var(--white);
}

.rank-title em {
    color: var(--slate-400);
    font-style: normal;
    font-size: 14px;
}

.rank-score {
    color: var(--yellow);
    font-weight: 900;
}

.page-hero {
    padding: 72px 0;
    background: linear-gradient(90deg, #059669, #0f766e);
}

.page-hero.blue {
    background: linear-gradient(90deg, #2563eb, #9333ea);
}

.page-hero.purple {
    background: linear-gradient(90deg, #9333ea, #db2777);
}

.page-hero.category-hero {
    padding: 64px 0;
}

.page-hero span {
    background: rgba(255, 255, 255, 0.18);
}

.page-hero h1 {
    margin: 0 0 14px;
    color: var(--white);
    font-size: clamp(34px, 4vw, 54px);
}

.page-hero p {
    max-width: 760px;
    margin: 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 18px;
    line-height: 1.75;
}

.compact-actions {
    margin-top: 24px;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    border-radius: 18px;
    background: var(--slate-800);
    padding: 18px 22px;
}

.toolbar strong {
    color: var(--white);
}

.search-panel {
    display: grid;
    grid-template-columns: 1fr 220px 180px;
    gap: 16px;
    margin-bottom: 40px;
    border-radius: 20px;
    background: var(--slate-800);
    padding: 20px;
}

.search-panel input,
.search-panel select {
    border-radius: 14px;
    padding: 13px 14px;
}

.detail-page {
    padding: 32px 0 64px;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 22px;
    color: var(--slate-400);
    font-size: 14px;
}

.breadcrumbs a:hover {
    color: #6ee7b7;
}

.breadcrumbs strong {
    color: var(--white);
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(300px, 0.9fr);
    gap: 32px;
}

.player-card {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    background: #000;
    box-shadow: var(--shadow);
}

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

.player-cover {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.56), rgba(0, 0, 0, 0.18));
    color: var(--white);
    transition: opacity 0.2s ease;
}

.player-cover.hidden {
    opacity: 0;
    pointer-events: none;
}

.player-cover span {
    display: grid;
    width: 82px;
    height: 82px;
    place-items: center;
    border-radius: 999px;
    background: var(--emerald);
    box-shadow: 0 0 0 12px rgba(16, 185, 129, 0.2);
    font-size: 34px;
}

.detail-info,
.poster-card,
.side-card {
    border-radius: 18px;
    background: var(--slate-800);
    padding: 24px;
}

.detail-info {
    margin-top: 24px;
}

.detail-title-row {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

.detail-title-row h1 {
    margin: 0;
    color: var(--white);
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.2;
}

.category-pill {
    flex: none;
    border-radius: 999px;
    background: var(--emerald);
    color: var(--white);
    padding: 8px 14px;
    font-weight: 800;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.tag-list span {
    border-radius: 999px;
    background: var(--slate-700);
    color: var(--slate-300);
    padding: 7px 12px;
    font-size: 14px;
}

.tag-list span:first-child {
    background: var(--emerald);
    color: var(--white);
}

.text-block {
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    padding-top: 22px;
    margin-top: 22px;
}

.text-block h2,
.side-card h2,
.poster-card h2 {
    margin: 0 0 12px;
    color: var(--white);
}

.text-block p,
.poster-card p {
    margin: 0;
    color: var(--slate-300);
    line-height: 1.85;
}

.detail-side {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.poster-card img {
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    background: var(--slate-900);
    margin-bottom: 16px;
}

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

.side-item {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 12px;
    align-items: center;
    border-radius: 12px;
    padding: 8px;
}

.side-item:hover {
    background: var(--slate-700);
}

.side-item img {
    height: 70px;
    border-radius: 10px;
    background: var(--slate-900);
}

.side-item strong,
.side-item em {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.side-item strong {
    color: var(--white);
}

.side-item em {
    color: var(--slate-400);
    font-style: normal;
    font-size: 13px;
}

.related-section {
    margin-top: 48px;
}

.site-footer {
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    background: linear-gradient(180deg, var(--slate-900), var(--slate-950));
    color: var(--slate-400);
    padding: 48px 0 26px;
}

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

.footer-logo {
    margin-bottom: 12px;
    color: var(--white);
    font-size: 22px;
    font-weight: 900;
}

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

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

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

.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 34px;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    padding-top: 20px;
    font-size: 14px;
}

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

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

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

    .mobile-toggle {
        display: block;
    }

    .hero {
        height: 520px;
    }

    .hero-content {
        bottom: 54px;
    }

    .hero-arrow {
        display: none;
    }

    .movie-grid,
    .category-grid,
    .category-card-grid,
    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

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

    .hero {
        height: 480px;
    }

    .hero h1 {
        font-size: 34px;
    }

    .hero p {
        font-size: 15px;
    }

    .movie-grid,
    .category-grid,
    .category-card-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .category-block {
        padding: 22px;
    }

    .rank-row {
        grid-template-columns: 38px 72px 1fr;
    }

    .rank-score {
        grid-column: 3;
    }

    .rank-row img {
        width: 72px;
        height: 48px;
    }

    .detail-title-row,
    .toolbar,
    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }

    .side-item {
        grid-template-columns: 96px 1fr;
    }
}
