*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --bg: #0a2540;
    --bg-soft: #123a60;
    --panel: rgba(255, 255, 255, 0.06);
    --panel-strong: rgba(255, 255, 255, 0.12);
    --border: rgba(255, 255, 255, 0.14);
    --text: #ffffff;
    --muted: rgba(255, 255, 255, 0.68);
    --muted-soft: rgba(255, 255, 255, 0.45);
    --cyan: #4fb3bf;
    --cyan-dark: #3a9aa5;
    --blue: #74b9ff;
    --orange: #ff9f43;
    --red: #ff6b6b;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    --radius: 22px;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(79, 179, 191, 0.28), transparent 32rem),
        linear-gradient(180deg, #0a2540 0%, #1a4d7a 48%, #0a2540 100%);
}

body.menu-open {
    overflow: hidden;
}

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

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

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 80;
    background: rgba(10, 37, 64, 0.78);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
}

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

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

.brand-mark {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 10px 30px rgba(79, 179, 191, 0.35);
    font-size: 14px;
}

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

.nav-link,
.mobile-link {
    color: var(--muted);
    font-weight: 600;
    border-radius: 999px;
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-link {
    padding: 10px 16px;
}

.mobile-link {
    display: block;
    padding: 15px 20px;
}

.nav-link:hover,
.nav-link.active,
.mobile-link:hover,
.mobile-link.active {
    color: var(--text);
    background: rgba(255, 255, 255, 0.1);
}

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    border: 0;
    border-radius: 14px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.menu-toggle span {
    width: 20px;
    height: 2px;
    background: #ffffff;
    border-radius: 999px;
}

.mobile-nav {
    display: none;
    border-top: 1px solid var(--border);
    background: rgba(10, 37, 64, 0.96);
}

.hero-carousel {
    position: relative;
    min-height: 74vh;
    overflow: hidden;
    background: #081d32;
}

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

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

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

.hero-bg {
    background-size: cover;
    background-position: center;
    transform: scale(1.04);
}

.hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 72% 48%, rgba(79, 179, 191, 0.22), transparent 18rem),
        linear-gradient(180deg, rgba(10, 37, 64, 0.12), #0a2540 98%);
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(1180px, calc(100% - 32px));
    height: 100%;
    margin: 0 auto;
    padding: 96px 0 86px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 1180px;
}

.hero-content h1 {
    width: min(720px, 100%);
    margin: 0 0 22px;
    font-size: clamp(42px, 7vw, 78px);
    line-height: 0.98;
    letter-spacing: -0.04em;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.42);
}

.hero-content p {
    width: min(650px, 100%);
    margin: 0 0 32px;
    color: rgba(255, 255, 255, 0.86);
    font-size: clamp(17px, 2.1vw, 22px);
    line-height: 1.75;
}

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

.hero-tags {
    margin-bottom: 22px;
}

.hero-tag,
.tag,
.card-badge,
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.hero-tag,
.tag {
    padding: 7px 12px;
    color: rgba(255, 255, 255, 0.88);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.hero-actions {
    gap: 14px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border-radius: 14px;
    border: 1px solid transparent;
    font-weight: 800;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn.primary {
    color: #ffffff;
    background: var(--cyan);
    box-shadow: 0 14px 28px rgba(79, 179, 191, 0.26);
}

.btn.primary:hover {
    background: var(--cyan-dark);
}

.btn.ghost,
.btn.block {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.18);
}

.btn.block {
    width: 100%;
}

.hero-poster {
    position: absolute;
    right: max(32px, calc((100vw - 1180px) / 2));
    top: 50%;
    z-index: 3;
    width: min(320px, 28vw);
    aspect-ratio: 3 / 4;
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow);
    transform: translateY(-45%);
}

.hero-poster img,
.movie-card img,
.feature-card img,
.category-tile img,
.poster-panel img,
.related-item img,
.category-covers img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-dots {
    position: absolute;
    left: 50%;
    bottom: 28px;
    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.32);
}

.hero-dot.active {
    width: 34px;
    background: var(--cyan);
}

.section {
    padding: 72px 0;
}

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

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

.section-head p,
.page-hero p,
.category-card p,
.category-tile p,
.feature-card p,
.detail-card p,
.site-footer p {
    color: var(--muted);
    line-height: 1.7;
}

.section-head p {
    margin: 8px 0 0;
}

.section-icon,
.eyebrow {
    display: inline-flex;
    margin-bottom: 12px;
    color: var(--orange);
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.section-more,
.toolbar-link {
    color: var(--cyan);
    font-weight: 800;
}

.feature-grid,
.category-grid,
.movie-grid,
.category-overview {
    display: grid;
    gap: 20px;
}

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

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

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

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

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

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.glass-card,
.movie-card,
.feature-card,
.category-tile {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
}

.feature-card {
    position: relative;
    min-height: 420px;
    overflow: hidden;
}

.feature-card::after,
.category-tile::after,
.poster-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.08));
}

.feature-card > span {
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 2;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--orange);
    font-size: 12px;
    font-weight: 900;
}

.feature-card > div {
    position: absolute;
    left: 22px;
    right: 22px;
    bottom: 22px;
    z-index: 2;
}

.feature-card h3,
.category-tile h3,
.movie-card h3 {
    margin: 0;
}

.feature-card h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.category-tile {
    position: relative;
    min-height: 210px;
    overflow: hidden;
}

.category-tile > div {
    position: absolute;
    inset: auto 18px 18px 18px;
    z-index: 2;
}

.category-tile h3 {
    font-size: 22px;
    margin-bottom: 6px;
}

.two-column {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 28px;
    align-items: start;
}

.rank-panel {
    position: sticky;
    top: 96px;
    padding: 24px;
}

.rank-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.rank-head span {
    display: inline-flex;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: var(--red);
    font-weight: 900;
}

.rank-head h2 {
    margin: 0;
}

.rank-panel ol {
    list-style: none;
    margin: 0 0 22px;
    padding: 0;
}

.rank-panel li + li {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.rank-panel li a {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 8px 10px;
    padding: 13px 0;
}

.rank-panel li span {
    grid-row: span 2;
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(79, 179, 191, 0.18);
    color: var(--cyan);
    font-weight: 900;
}

.rank-panel strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-panel em,
.card-meta,
.detail-meta,
.related-item em {
    color: var(--muted-soft);
    font-style: normal;
    font-size: 13px;
}

.inline-search,
.toolbar,
.search-panel,
.page-search {
    display: flex;
    gap: 12px;
}

.inline-search,
.toolbar,
.search-panel {
    margin-bottom: 24px;
}

.toolbar,
.search-panel {
    padding: 16px;
    align-items: center;
}

.inline-search input,
.toolbar input,
.search-panel input,
.search-panel select,
.page-search input {
    width: 100%;
    min-height: 48px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    outline: none;
    padding: 0 16px;
}

.search-panel select {
    width: 190px;
}

.inline-search input::placeholder,
.toolbar input::placeholder,
.search-panel input::placeholder,
.page-search input::placeholder {
    color: rgba(255, 255, 255, 0.52);
}

.page-search button {
    min-width: 88px;
    border: 0;
    border-radius: 14px;
    color: #ffffff;
    background: var(--cyan);
    font-weight: 800;
}

.movie-card {
    overflow: hidden;
}

.movie-card a {
    display: block;
    height: 100%;
}

.poster-wrap {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.24);
}

.movie-card img {
    transition: transform 0.5s ease;
}

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

.card-badge,
.rank-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    min-width: 34px;
    min-height: 28px;
    padding: 0 10px;
    color: #ffffff;
    background: var(--red);
}

.rank-badge {
    background: var(--orange);
}

.play-chip {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 2;
    padding: 6px 10px;
    border-radius: 999px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
    background: rgba(79, 179, 191, 0.88);
}

.card-body {
    padding: 14px;
}

.card-body h3 {
    display: -webkit-box;
    min-height: 44px;
    overflow: hidden;
    color: #ffffff;
    font-size: 15px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.card-body p {
    display: -webkit-box;
    min-height: 42px;
    margin: 8px 0 12px;
    overflow: hidden;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.card-meta {
    justify-content: space-between;
}

.page-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
    gap: 32px;
    align-items: end;
    padding: 76px 0 24px;
}

.page-hero p {
    max-width: 760px;
    font-size: 18px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
    color: var(--muted-soft);
    font-size: 14px;
}

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

.category-card {
    overflow: hidden;
}

.category-card a {
    display: block;
    padding: 18px;
}

.category-covers {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    height: 150px;
    margin-bottom: 18px;
}

.category-covers img {
    border-radius: 14px;
}

.category-card h2 {
    margin: 0 0 10px;
}

.category-card span {
    color: var(--cyan);
    font-size: 13px;
}

.search-status {
    min-height: 24px;
    margin-bottom: 18px;
    color: var(--muted);
}

.detail-shell {
    padding: 36px 0 72px;
}

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

.detail-main,
.detail-side {
    display: grid;
    gap: 22px;
}

.player-card,
.detail-card,
.poster-panel,
.related-panel {
    border-radius: var(--radius);
    overflow: hidden;
}

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

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

.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.32));
    transition: opacity 0.2s ease;
}

.player-overlay.hidden {
    opacity: 0;
}

.play-button {
    width: 84px;
    height: 84px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    color: #ffffff;
    background: rgba(79, 179, 191, 0.9);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
}

.play-button span {
    margin-left: 5px;
    font-size: 32px;
}

.player-message {
    position: absolute;
    left: 18px;
    bottom: 16px;
    padding: 8px 12px;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.82);
    background: rgba(0, 0, 0, 0.56);
    font-size: 13px;
}

.player-message.error {
    color: #ffffff;
    background: rgba(255, 107, 107, 0.84);
}

.detail-card {
    padding: 26px;
}

.detail-card h1 {
    margin-bottom: 14px;
}

.detail-card h2,
.related-panel h2 {
    margin: 0 0 16px;
    font-size: 22px;
}

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

.tag-row {
    margin-bottom: 24px;
}

.detail-card p {
    margin: 0;
    font-size: 16px;
}

.detail-card p + p {
    margin-top: 14px;
}

.detail-card .lead {
    color: rgba(255, 255, 255, 0.86);
    font-size: 18px;
}

.poster-panel,
.related-panel {
    padding: 18px;
}

.poster-panel {
    position: sticky;
    top: 96px;
}

.poster-panel img {
    width: 100%;
    aspect-ratio: 3 / 4;
    margin-bottom: 14px;
    border-radius: 18px;
}

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

.related-item {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 10px;
    align-items: center;
    min-height: 72px;
    padding: 8px;
    border-radius: 16px;
    transition: background 0.2s ease;
}

.related-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.related-item img {
    grid-row: span 2;
    height: 72px;
    border-radius: 12px;
}

.related-item span {
    display: -webkit-box;
    overflow: hidden;
    font-weight: 800;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.site-footer {
    border-top: 1px solid var(--border);
    background: rgba(5, 22, 38, 0.7);
}

.footer-grid {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 28px;
}

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

.site-footer p {
    margin: 14px 0 0;
}

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

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

.footer-bottom {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 20px 0 30px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted-soft);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
}

.hidden-by-filter {
    display: none !important;
}

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

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

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

    .rank-panel,
    .poster-panel {
        position: static;
    }

    .hero-poster {
        opacity: 0.28;
        width: 280px;
    }
}

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

    .menu-toggle {
        display: inline-flex;
    }

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

    .hero-carousel {
        min-height: 78vh;
    }

    .hero-content {
        padding-top: 86px;
    }

    .hero-poster {
        display: none;
    }

    .hero-actions,
    .inline-search,
    .toolbar,
    .search-panel,
    .page-search {
        flex-direction: column;
    }

    .page-hero {
        grid-template-columns: 1fr;
        padding-top: 46px;
    }

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

    .section {
        padding: 48px 0;
    }

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

    .feature-card,
    .category-tile {
        min-height: 280px;
    }

    .search-panel select {
        width: 100%;
    }

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

    .footer-bottom {
        flex-direction: column;
    }
}

@media (max-width: 520px) {
    .nav-shell,
    .shell,
    .hero-content,
    .footer-grid,
    .footer-bottom {
        width: min(100% - 22px, 1180px);
    }

    .brand {
        font-size: 17px;
    }

    .brand-mark {
        width: 32px;
        height: 32px;
    }

    .feature-grid,
    .category-grid,
    .category-overview,
    .movie-grid,
    .movie-grid.dense {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .card-body {
        padding: 11px;
    }

    .detail-card,
    .poster-panel,
    .related-panel {
        padding: 16px;
    }
}
