:root {
    --stellar-dark: #0a0e27;
    --stellar-deep: #141b3d;
    --stellar-mid: #1e2847;
    --stellar-light: #2a3857;
    --stellar-glow: #4a90e2;
    --stellar-soft: rgba(74, 144, 226, 0.18);
    --text-main: #ffffff;
    --text-muted: #9ca3af;
    --text-soft: #d1d5db;
    --shadow-glow: 0 0 20px rgba(74, 144, 226, 0.3);
    --max-width: 1280px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text-main);
    background: var(--stellar-dark);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    line-height: 1.5;
}

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

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

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10, 14, 39, 0.95);
    border-bottom: 1px solid rgba(42, 56, 87, 0.7);
    backdrop-filter: blur(12px);
}

.nav-wrap,
.section-inner,
.footer-inner {
    width: min(100% - 32px, var(--max-width));
    margin: 0 auto;
}

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

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.logo-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(74, 144, 226, 0.18);
    color: var(--stellar-glow);
    box-shadow: var(--shadow-glow);
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 28px;
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 600;
}

.desktop-nav a,
.mobile-nav a {
    transition: color 0.2s ease, background 0.2s ease;
}

.desktop-nav a:hover,
.desktop-nav a.active {
    color: var(--stellar-glow);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-form {
    position: relative;
}

.search-form input {
    width: 260px;
    height: 40px;
    padding: 0 14px 0 40px;
    color: var(--text-main);
    background: var(--stellar-mid);
    border: 1px solid rgba(42, 56, 87, 0.9);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-form input:focus {
    border-color: var(--stellar-glow);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.16);
}

.search-form::before {
    content: "⌕";
    position: absolute;
    left: 14px;
    top: 7px;
    color: var(--text-muted);
    font-size: 18px;
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    color: var(--text-main);
    background: transparent;
    border: 0;
    border-radius: 10px;
}

.menu-toggle:hover {
    background: var(--stellar-mid);
}

.mobile-panel {
    display: none;
    border-top: 1px solid rgba(42, 56, 87, 0.7);
}

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

.mobile-nav {
    width: min(100% - 32px, var(--max-width));
    margin: 0 auto;
    padding: 16px 0 20px;
    display: grid;
    gap: 10px;
}

.mobile-nav a {
    padding: 10px 14px;
    border-radius: 10px;
    color: var(--text-soft);
}

.mobile-nav a:hover,
.mobile-nav a.active {
    color: var(--text-main);
    background: var(--stellar-glow);
}

.hero {
    position: relative;
    min-height: 70vh;
    overflow: hidden;
    background: var(--stellar-deep);
}

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

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

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

.hero-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--stellar-dark) 0%, rgba(10, 14, 39, 0.72) 45%, rgba(10, 14, 39, 0.18) 100%);
}

.hero-content {
    position: absolute;
    left: max(24px, calc((100vw - var(--max-width)) / 2 + 24px));
    right: max(24px, calc((100vw - var(--max-width)) / 2 + 24px));
    bottom: 76px;
    z-index: 2;
    max-width: 760px;
}

.hero-meta,
.card-badges,
.movie-meta,
.tag-list,
.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 10px;
    border-radius: 999px;
    color: var(--text-main);
    background: rgba(74, 144, 226, 0.9);
    font-size: 13px;
    font-weight: 700;
}

.badge.soft {
    color: var(--text-soft);
    background: rgba(42, 56, 87, 0.86);
}

.hero h1 {
    margin: 16px 0 16px;
    font-size: clamp(40px, 6vw, 72px);
    line-height: 1.04;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.hero p {
    max-width: 700px;
    margin: 0 0 28px;
    color: var(--text-soft);
    font-size: clamp(16px, 2vw, 20px);
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 22px;
    border-radius: 12px;
    color: var(--text-main);
    background: var(--stellar-glow);
    border: 1px solid transparent;
    font-weight: 800;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    box-shadow: var(--shadow-glow);
}

.btn:hover {
    transform: translateY(-2px);
    background: #3a7bc8;
}

.btn.secondary {
    color: var(--text-soft);
    background: rgba(30, 40, 71, 0.72);
    border-color: rgba(74, 144, 226, 0.38);
    box-shadow: none;
}

.hero-control {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 999px;
    color: var(--text-main);
    background: rgba(0, 0, 0, 0.5);
    transform: translateY(-50%);
    transition: background 0.2s ease;
}

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

.hero-prev {
    left: 18px;
}

.hero-next {
    right: 18px;
}

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

.hero-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.5);
    transition: width 0.2s ease, background 0.2s ease;
}

.hero-dot.active {
    width: 32px;
    background: var(--stellar-glow);
}

.section {
    padding: 72px 0;
}

.section.deep {
    background: var(--stellar-deep);
}

.section.dark {
    background: var(--stellar-dark);
}

.section.gradient-up {
    background: linear-gradient(to bottom, var(--stellar-dark), var(--stellar-deep));
}

.section.gradient-down {
    background: linear-gradient(to bottom, var(--stellar-deep), var(--stellar-dark));
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 30px;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: var(--stellar-glow);
    background: rgba(74, 144, 226, 0.14);
}

.section h2,
.page-title,
.detail-title {
    margin: 0;
    color: var(--text-main);
    font-size: clamp(28px, 4vw, 38px);
    font-weight: 900;
    letter-spacing: -0.03em;
}

.section-lead,
.page-lead {
    max-width: 820px;
    margin: 12px 0 0;
    color: var(--text-muted);
    font-size: 17px;
}

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

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

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

.movie-card {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    background: var(--stellar-mid);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.card-poster {
    position: relative;
    aspect-ratio: 2 / 3;
    overflow: hidden;
}

.movie-card.large .card-poster {
    aspect-ratio: 16 / 9;
}

.movie-card.wide .card-poster {
    aspect-ratio: 16 / 9;
}

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

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

.card-poster::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0));
    opacity: 0.84;
    transition: opacity 0.2s ease;
}

.movie-card:hover .card-poster::after {
    opacity: 0.95;
}

.play-hover {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.movie-card:hover .play-hover {
    opacity: 1;
}

.play-circle {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(74, 144, 226, 0.9);
}

.card-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 3;
}

.card-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    padding: 18px;
}

.card-title {
    margin: 0 0 8px;
    color: var(--text-main);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.movie-card:hover .card-title {
    color: var(--stellar-glow);
}

.card-desc,
.card-genre {
    margin: 0;
    color: var(--text-soft);
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.horizontal-strip {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    padding: 4px 2px 18px;
    scrollbar-color: var(--stellar-glow) var(--stellar-mid);
}

.horizontal-strip .movie-card {
    width: 210px;
    flex: 0 0 auto;
}

.year-block,
.category-block,
.panel {
    padding: 28px;
    border-radius: 22px;
    background: var(--stellar-mid);
}

.category-block h3,
.year-block h3 {
    margin: 0 0 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-main);
    font-size: 24px;
}

.category-block h3::before,
.year-block h3::before {
    content: "";
    width: 5px;
    height: 28px;
    border-radius: 999px;
    background: var(--stellar-glow);
}

.filter-panel {
    display: grid;
    grid-template-columns: 1.8fr repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 30px;
    padding: 18px;
    border-radius: 18px;
    background: var(--stellar-mid);
}

.filter-panel input,
.filter-panel select {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid rgba(74, 144, 226, 0.24);
    border-radius: 12px;
    color: var(--text-main);
    background: var(--stellar-dark);
    outline: none;
}

.filter-panel input:focus,
.filter-panel select:focus {
    border-color: var(--stellar-glow);
}

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

.category-tile {
    min-height: 190px;
    padding: 26px;
    border-radius: 22px;
    background: linear-gradient(135deg, var(--stellar-mid), rgba(42, 56, 87, 0.82));
    border: 1px solid rgba(74, 144, 226, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-tile:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
}

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

.category-tile p {
    margin: 0;
    color: var(--text-muted);
}

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

.rank-item {
    display: grid;
    grid-template-columns: 58px 120px 1fr auto;
    gap: 18px;
    align-items: center;
    padding: 14px;
    border-radius: 18px;
    background: var(--stellar-mid);
    transition: background 0.2s ease, transform 0.2s ease;
}

.rank-item:hover {
    background: var(--stellar-light);
    transform: translateX(4px);
}

.rank-num {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: var(--text-main);
    background: rgba(74, 144, 226, 0.2);
    font-weight: 900;
}

.rank-cover {
    width: 120px;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 12px;
}

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

.rank-title {
    margin: 0 0 8px;
    color: var(--text-main);
    font-size: 18px;
    font-weight: 800;
}

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

.breadcrumbs {
    margin-bottom: 22px;
    color: var(--text-muted);
    font-size: 14px;
}

.breadcrumbs a:hover {
    color: var(--stellar-glow);
}

.detail-hero {
    background: linear-gradient(to bottom, var(--stellar-deep), var(--stellar-dark));
    padding: 34px 0 72px;
}

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

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

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

.player-start {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    border: 0;
    color: var(--text-main);
    background: rgba(0, 0, 0, 0.28);
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.player-start.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.player-start span {
    width: 80px;
    height: 80px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(74, 144, 226, 0.92);
    box-shadow: var(--shadow-glow);
    font-size: 32px;
}

.detail-panel {
    margin-top: 24px;
    padding: 26px;
    border-radius: 18px;
    background: var(--stellar-mid);
}

.detail-title {
    margin-bottom: 18px;
}

.movie-meta {
    margin-bottom: 24px;
}

.detail-panel h2,
.detail-panel h3,
.sidebar h2,
.sidebar h3 {
    margin: 0 0 12px;
    color: var(--text-main);
}

.detail-panel p {
    margin: 0 0 22px;
    color: var(--text-soft);
    line-height: 1.8;
}

.tag-list {
    margin-bottom: 18px;
}

.tag {
    display: inline-flex;
    padding: 6px 12px;
    border-radius: 999px;
    color: var(--text-soft);
    background: var(--stellar-light);
    font-size: 13px;
}

.sidebar {
    position: sticky;
    top: 88px;
    padding: 24px;
    border-radius: 18px;
    background: var(--stellar-mid);
}

.side-card {
    display: grid;
    grid-template-columns: 118px 1fr;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.side-card-img {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 12px;
}

.side-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.side-card h4 {
    margin: 0 0 6px;
    font-size: 15px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.side-card:hover h4 {
    color: var(--stellar-glow);
}

.side-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 12px;
}

.site-footer {
    border-top: 1px solid rgba(42, 56, 87, 0.7);
    background: var(--stellar-deep);
}

.footer-inner {
    padding: 46px 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 32px;
}

.footer-title {
    margin: 0 0 14px;
    color: var(--text-main);
    font-weight: 800;
}

.footer-text,
.footer-links a,
.footer-bottom {
    color: var(--text-muted);
    font-size: 14px;
}

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

.footer-links a:hover {
    color: var(--stellar-glow);
}

.footer-bottom {
    margin-top: 32px;
    padding-top: 26px;
    border-top: 1px solid rgba(42, 56, 87, 0.7);
}

.hidden-card {
    display: none !important;
}

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

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

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

    .menu-toggle {
        display: inline-grid;
        place-items: center;
    }

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

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

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

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

    .sidebar {
        position: static;
    }

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

@media (max-width: 640px) {
    .nav-wrap,
    .section-inner,
    .footer-inner,
    .mobile-nav {
        width: min(100% - 24px, var(--max-width));
    }

    .hero {
        min-height: 76vh;
    }

    .hero-content {
        left: 18px;
        right: 18px;
        bottom: 70px;
    }

    .hero-control {
        width: 40px;
        height: 40px;
    }

    .section {
        padding: 52px 0;
    }

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

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

    .card-title {
        font-size: 16px;
    }

    .card-content {
        padding: 14px;
    }

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

    .category-list {
        grid-template-columns: 1fr;
    }

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

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

    .rank-cover {
        width: 88px;
    }

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

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