:root {
    --bg: #020617;
    --bg-soft: #0f172a;
    --bg-card: rgba(15, 23, 42, 0.84);
    --text: #f8fafc;
    --muted: #94a3b8;
    --line: rgba(148, 163, 184, 0.22);
    --cyan: #22d3ee;
    --blue: #3b82f6;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 0%, rgba(34, 211, 238, 0.18), transparent 28rem),
        radial-gradient(circle at 86% 10%, rgba(59, 130, 246, 0.18), transparent 24rem),
        linear-gradient(180deg, #020617 0%, #0f172a 48%, #020617 100%);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

button,
input,
select {
    font: inherit;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--line);
    background: rgba(2, 6, 23, 0.82);
    backdrop-filter: blur(18px);
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.2);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px 0;
}

.brand,
.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    color: #ffffff;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    box-shadow: 0 14px 34px rgba(34, 211, 238, 0.28);
    transition: transform 0.25s ease;
}

.brand:hover .brand-mark {
    transform: scale(1.08) rotate(-2deg);
}

.brand-text {
    display: grid;
    gap: 2px;
}

.brand-text strong {
    font-size: 24px;
    line-height: 1;
    background: linear-gradient(90deg, #60a5fa, #67e8f9);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    white-space: nowrap;
}

.brand-text small {
    color: var(--muted);
    font-size: 12px;
}

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

.nav-link,
.mobile-nav-link {
    color: #cbd5e1;
    font-weight: 650;
    transition: color 0.2s ease;
}

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

.header-search,
.mobile-search {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-search input,
.mobile-search input,
.filter-panel input,
.filter-panel select {
    width: 100%;
    color: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 999px;
    outline: none;
    background: rgba(15, 23, 42, 0.74);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search input,
.mobile-search input {
    width: 260px;
    padding: 10px 16px;
}

.header-search input:focus,
.mobile-search input:focus,
.filter-panel input:focus,
.filter-panel select:focus {
    border-color: rgba(34, 211, 238, 0.72);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.14);
}

.header-search button,
.mobile-search button,
.primary-button,
.secondary-button,
.filter-panel button {
    color: #ffffff;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--cyan), var(--blue));
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.header-search button,
.mobile-search button {
    padding: 10px 16px;
}

.header-search button:hover,
.mobile-search button:hover,
.primary-button:hover,
.secondary-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 38px rgba(34, 211, 238, 0.3);
}

.mobile-menu-button {
    display: none;
    width: 44px;
    height: 44px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.8);
}

.mobile-menu-button span {
    display: block;
    height: 2px;
    margin: 5px 0;
    background: #ffffff;
    border-radius: 999px;
}

.mobile-nav {
    display: none;
    padding: 0 16px 16px;
    border-top: 1px solid var(--line);
}

.mobile-nav.open {
    display: grid;
    gap: 14px;
}

.mobile-category-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.mobile-category-row a {
    padding: 7px 12px;
    color: #cbd5e1;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
}

.hero {
    position: relative;
    min-height: 620px;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

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

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

.hero-slide::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.86), rgba(2, 6, 23, 0.58), rgba(2, 6, 23, 0.08));
}

.hero-slide::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 160px;
    background: linear-gradient(0deg, #020617, transparent);
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    min-height: 620px;
}

.hero-copy {
    width: min(650px, 100%);
}

.hero-badge,
.section-kicker,
.card-badge,
.detail-badge,
.rank-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.16);
    color: #a5f3fc;
    border: 1px solid rgba(34, 211, 238, 0.32);
}

.hero-badge {
    padding: 8px 16px;
    margin-bottom: 18px;
    font-weight: 700;
}

.hero h1 {
    margin: 0 0 18px;
    font-size: clamp(42px, 7vw, 76px);
    line-height: 0.98;
    letter-spacing: -0.04em;
}

.hero p {
    max-width: 680px;
    margin: 0 0 24px;
    color: #dbeafe;
    font-size: clamp(18px, 2.4vw, 24px);
    line-height: 1.7;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 34px;
    color: #cbd5e1;
}

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

.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 0 24px;
    font-weight: 750;
}

.secondary-button {
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(15, 23, 42, 0.68);
    box-shadow: none;
}

.hero-control {
    position: absolute;
    top: 50%;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(14px);
    transform: translateY(-50%);
}

.hero-control:hover {
    background: rgba(255, 255, 255, 0.24);
}

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

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

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

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

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

.main-space {
    padding: 60px 0;
}

.section-stack {
    display: grid;
    gap: 68px;
}

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

.section-head h2,
.page-title h1,
.detail-title h1 {
    margin: 0;
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.section-head p,
.page-title p,
.category-card p,
.detail-summary p,
.footer-brand p {
    color: var(--muted);
    line-height: 1.8;
}

.section-kicker {
    padding: 6px 12px;
    margin-bottom: 10px;
    font-size: 14px;
}

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

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

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

.movie-card {
    position: relative;
    min-height: 340px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-card);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
}

.movie-card a,
.movie-card .poster,
.card-gradient {
    position: absolute;
    inset: 0;
}

.movie-card .poster,
.simple-movie-link span,
.rank-poster,
.detail-poster {
    background-size: cover;
    background-position: center;
    background-color: #172033;
    transition: transform 0.55s ease;
}

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

.card-gradient {
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.08), rgba(2, 6, 23, 0.18) 42%, rgba(0, 0, 0, 0.9));
}

.card-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 750;
}

.card-play {
    position: absolute;
    top: 50%;
    left: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    color: #ffffff;
    border-radius: 50%;
    background: rgba(34, 211, 238, 0.72);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.movie-card:hover .card-play {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.card-content {
    position: absolute;
    right: 16px;
    bottom: 16px;
    left: 16px;
    display: grid;
    gap: 7px;
}

.card-content strong {
    font-size: 19px;
    line-height: 1.25;
}

.card-content em,
.card-content small {
    color: #cbd5e1;
    font-style: normal;
}

.card-content small {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.movie-card-large {
    min-height: 460px;
}

.movie-card-horizontal {
    min-height: 190px;
}

.movie-card-horizontal .card-content {
    left: 42%;
}

.movie-card-horizontal .poster {
    right: 58%;
}

.category-strip {
    padding: 28px;
    border: 1px solid rgba(34, 211, 238, 0.14);
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(8, 47, 73, 0.62));
    box-shadow: var(--shadow);
}

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

.category-card {
    display: grid;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(2, 6, 23, 0.48);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-card:hover {
    border-color: rgba(34, 211, 238, 0.5);
    transform: translateY(-4px);
}

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

.category-preview {
    display: grid;
    gap: 10px;
}

.simple-movie-link {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 10px;
    align-items: center;
    min-width: 0;
}

.simple-movie-link span {
    width: 64px;
    height: 42px;
    border-radius: 10px;
}

.simple-movie-link strong {
    overflow: hidden;
    color: #e2e8f0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.simple-movie-link small {
    grid-column: 2;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-hero {
    padding: 66px 0 36px;
}

.page-title {
    max-width: 760px;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    color: var(--muted);
}

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

.filter-panel {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 14px;
    padding: 18px;
    margin: 28px 0;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.68);
}

.filter-panel label {
    display: grid;
    gap: 8px;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 650;
}

.filter-panel input,
.filter-panel select {
    height: 44px;
    padding: 0 14px;
}

.empty-state {
    display: none;
    padding: 28px;
    margin-top: 18px;
    color: var(--muted);
    text-align: center;
    border: 1px dashed var(--line);
    border-radius: 22px;
}

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

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

.rank-item {
    display: grid;
    grid-template-columns: 72px 118px 1fr auto;
    gap: 18px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.72);
}

.rank-number {
    font-size: 28px;
    font-weight: 900;
    color: #67e8f9;
    text-align: center;
}

.rank-poster {
    width: 118px;
    height: 74px;
    border-radius: 14px;
}

.rank-info {
    display: grid;
    gap: 7px;
}

.rank-info strong {
    font-size: 20px;
}

.rank-info p {
    margin: 0;
    color: var(--muted);
}

.rank-badge {
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 750;
}

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

.player-box {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(34, 211, 238, 0.18);
    border-radius: 24px;
    background: #000000;
    box-shadow: var(--shadow);
}

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

.play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    color: #ffffff;
    background: radial-gradient(circle at center, rgba(34, 211, 238, 0.2), rgba(0, 0, 0, 0.48));
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.play-overlay span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 82px;
    height: 82px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 22px 48px rgba(34, 211, 238, 0.32);
    font-size: 32px;
}

.player-box.is-playing .play-overlay {
    opacity: 0;
    pointer-events: none;
}

.player-message {
    position: absolute;
    right: 16px;
    bottom: 16px;
    left: 16px;
    display: none;
    padding: 10px 14px;
    color: #fecaca;
    border-radius: 14px;
    background: rgba(127, 29, 29, 0.72);
}

.player-message.show {
    display: block;
}

.detail-panel,
.related-panel {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.72);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
}

.detail-panel {
    margin-top: 22px;
    padding: 26px;
}

.detail-title {
    display: grid;
    gap: 16px;
    margin-bottom: 20px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: #cbd5e1;
}

.detail-badge {
    padding: 6px 12px;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0;
}

.detail-tags span {
    padding: 6px 10px;
    color: #dbeafe;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.14);
}

.detail-summary {
    display: grid;
    gap: 24px;
}

.detail-summary h2 {
    margin: 0 0 10px;
    font-size: 24px;
}

.detail-summary p {
    margin: 0;
}

.related-panel {
    position: sticky;
    top: 96px;
    padding: 22px;
}

.related-panel h2 {
    margin: 0 0 18px;
    font-size: 24px;
}

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

.more-section {
    margin-top: 52px;
}

.site-footer {
    margin-top: 70px;
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.78), rgba(0, 0, 0, 0.72));
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 34px;
    padding: 42px 0;
}

.footer-logo strong {
    font-size: 20px;
}

.site-footer h3 {
    margin: 0 0 14px;
    font-size: 18px;
}

.site-footer ul {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-footer a,
.footer-bottom {
    color: var(--muted);
}

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

.footer-bottom {
    padding: 18px 0 24px;
    text-align: center;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
}

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

    .mobile-menu-button {
        display: block;
    }

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

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

    .related-panel {
        position: static;
    }
}

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

    .brand-text strong {
        font-size: 20px;
    }

    .hero,
    .hero-content {
        min-height: 560px;
    }

    .hero-control {
        display: none;
    }

    .main-space {
        padding: 42px 0;
    }

    .section-head {
        display: grid;
    }

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

    .movie-card {
        min-height: 280px;
        border-radius: 18px;
    }

    .movie-card-horizontal {
        min-height: 280px;
    }

    .movie-card-horizontal .poster,
    .movie-card-horizontal .card-content {
        inset: 0;
    }

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

    .rank-item {
        grid-template-columns: 54px 92px 1fr;
    }

    .rank-badge {
        grid-column: 2 / -1;
        width: fit-content;
    }

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

@media (max-width: 500px) {
    .movie-grid,
    .movie-grid.compact,
    .movie-grid.wide,
    .category-grid {
        grid-template-columns: 1fr;
    }

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

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

    .mobile-search {
        display: grid;
        grid-template-columns: 1fr auto;
    }

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