:root {
    --dark: #0a0e1a;
    --dark-soft: #111827;
    --panel: rgba(15, 23, 42, 0.72);
    --panel-strong: rgba(15, 23, 42, 0.94);
    --border: rgba(56, 189, 248, 0.22);
    --border-strong: rgba(56, 189, 248, 0.45);
    --primary: #38bdf8;
    --primary-dark: #0284c7;
    --primary-soft: rgba(56, 189, 248, 0.16);
    --text: #ffffff;
    --muted: #94a3b8;
    --muted-strong: #cbd5e1;
    --shadow: 0 24px 70px rgba(2, 132, 199, 0.18);
    --radius: 24px;
    --container: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    background:
        radial-gradient(circle at 18% 10%, rgba(14, 165, 233, 0.18), transparent 30%),
        radial-gradient(circle at 85% 0%, rgba(2, 132, 199, 0.16), transparent 26%),
        var(--dark);
    color: var(--text);
    min-height: 100vh;
}

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

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

button,
input {
    font: inherit;
}

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

.site-header {
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(10, 14, 26, 0.92);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(18px);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 76px;
}

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

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #ffffff;
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.42);
}

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

.brand-text strong {
    font-size: 22px;
    letter-spacing: 0.06em;
}

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

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
}

.nav-link {
    color: var(--muted-strong);
    font-weight: 600;
    transition: color 0.2s ease;
}

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

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

.header-search input,
.mobile-search input,
.library-search input {
    border: 1px solid var(--border);
    outline: none;
    border-radius: 999px;
    padding: 11px 16px;
    background: rgba(15, 23, 42, 0.62);
    color: var(--text);
    min-width: 220px;
}

.header-search input:focus,
.mobile-search input:focus,
.library-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}

.header-search button,
.mobile-search button,
.library-search button,
.primary-button {
    border: 0;
    border-radius: 999px;
    padding: 11px 18px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #ffffff;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 12px 36px rgba(2, 132, 199, 0.28);
}

.menu-button {
    display: none;
    margin-left: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 9px 12px;
    background: rgba(15, 23, 42, 0.72);
    color: var(--text);
    cursor: pointer;
}

.mobile-panel {
    display: none;
    border-top: 1px solid var(--border);
    padding: 16px;
    background: rgba(10, 14, 26, 0.98);
}

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

.mobile-panel nav {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.mobile-link {
    color: var(--muted-strong);
    padding: 12px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.52);
}

.hero {
    position: relative;
    min-height: 78vh;
    overflow: hidden;
    background: #050816;
}

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

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

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

.hero-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, var(--dark), rgba(10, 14, 26, 0.72), rgba(10, 14, 26, 0.28)),
        linear-gradient(90deg, rgba(10, 14, 26, 0.86), rgba(10, 14, 26, 0.18));
}

.hero-content {
    position: absolute;
    left: 50%;
    bottom: 80px;
    transform: translateX(-50%);
    max-width: var(--container);
}

.hero-label,
.section-heading p,
.page-hero p {
    margin: 0 0 12px;
    color: var(--primary);
    font-weight: 800;
    letter-spacing: 0.08em;
}

.hero h1,
.hero h2 {
    max-width: 820px;
    margin: 0 0 18px;
    font-size: clamp(42px, 7vw, 82px);
    line-height: 0.98;
    letter-spacing: -0.04em;
    text-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

.hero-desc {
    max-width: 760px;
    margin: 0 0 24px;
    color: var(--muted-strong);
    font-size: clamp(17px, 2vw, 22px);
    line-height: 1.7;
}

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

.hero-tags span,
.meta-list span,
.tag-row span,
.detail-tags span {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 7px 12px;
    background: rgba(15, 23, 42, 0.58);
    color: var(--muted-strong);
    backdrop-filter: blur(12px);
}

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

.ghost-button,
.text-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: 10px 18px;
    color: var(--primary);
    background: rgba(15, 23, 42, 0.52);
    font-weight: 800;
}

.hero-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: rgba(10, 14, 26, 0.56);
    color: #ffffff;
    font-size: 34px;
    cursor: pointer;
    backdrop-filter: blur(12px);
}

.hero-prev {
    left: 22px;
}

.hero-next {
    right: 22px;
}

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

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

.hero-dot.is-active {
    width: 36px;
    background: var(--primary);
}

.quick-categories {
    position: relative;
    z-index: 2;
    margin-top: -34px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    background: rgba(15, 23, 42, 0.82);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.compact-heading {
    margin-bottom: 16px;
}

.category-chip-row,
.filter-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.category-chip-row a,
.filter-pill {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 10px 15px;
    background: rgba(10, 14, 26, 0.52);
    color: var(--muted-strong);
    cursor: pointer;
}

.category-chip-row a:hover,
.filter-pill:hover,
.filter-pill.is-active {
    color: #ffffff;
    border-color: var(--primary);
    background: var(--primary-soft);
}

.section-block {
    padding-top: 68px;
}

.section-heading {
    margin-bottom: 28px;
}

.section-heading h2,
.page-hero h1,
.detail-content h2,
.detail-facts h2 {
    margin: 0;
    font-size: clamp(28px, 4vw, 42px);
    letter-spacing: -0.03em;
}

.section-heading.with-link {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
}

.section-heading.with-link > a {
    color: var(--primary);
    font-weight: 800;
}

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

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

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

.movie-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.56);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.movie-card-featured {
    min-height: 100%;
}

.card-cover {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.7);
}

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

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

.card-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 14, 26, 0.78), transparent 46%);
}

.play-hover,
.rank-badge {
    position: absolute;
    z-index: 2;
}

.play-hover {
    left: 50%;
    top: 50%;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0.88);
    background: rgba(56, 189, 248, 0.88);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.rank-badge {
    top: 12px;
    left: 12px;
    min-width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #ffffff;
}

.card-body {
    padding: 15px;
}

.card-meta {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 8px;
}

.card-body h3 {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 1.35;
}

.card-body h3 a:hover {
    color: var(--primary);
}

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

.tag-row span {
    padding: 5px 8px;
    font-size: 12px;
}

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

.compact-card {
    position: relative;
    display: grid;
    grid-template-columns: 74px 1fr;
    gap: 12px;
    min-height: 104px;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 12px;
    background: rgba(15, 23, 42, 0.52);
    overflow: hidden;
}

.compact-card:hover {
    border-color: var(--primary);
    box-shadow: 0 16px 48px rgba(2, 132, 199, 0.18);
}

.compact-card img {
    grid-row: span 2;
    width: 74px;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.compact-card span {
    position: absolute;
    top: 8px;
    left: 8px;
    min-width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(2, 132, 199, 0.92);
    color: #ffffff;
    font-weight: 900;
    font-size: 13px;
}

.compact-card strong {
    align-self: end;
    font-size: 16px;
    line-height: 1.35;
}

.compact-card small {
    color: var(--muted);
    line-height: 1.45;
}

.library-tools {
    display: grid;
    gap: 14px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 18px;
    background: rgba(15, 23, 42, 0.5);
}

.library-search input {
    flex: 1;
    min-width: min(360px, 100%);
}

.search-empty {
    display: none;
    margin: 0;
    color: var(--muted);
}

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

.page-main {
    padding-top: 100px;
}

.page-hero {
    padding: 56px 0 28px;
}

.page-hero-desc {
    max-width: 820px;
    color: var(--muted-strong);
    font-size: 18px;
    line-height: 1.8;
}

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
    color: var(--muted);
}

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

.category-overview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    padding-bottom: 64px;
}

.category-card {
    display: grid;
    grid-template-columns: 210px 1fr;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.58);
}

.category-preview {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    padding: 4px;
}

.category-preview img {
    width: 100%;
    height: 118px;
    object-fit: cover;
    border-radius: 14px;
}

.category-card-body {
    padding: 22px;
}

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

.category-card-body p {
    margin: 0 0 16px;
    color: var(--muted);
    line-height: 1.7;
}

.detail-main {
    padding-top: 94px;
}

.detail-breadcrumb {
    padding-top: 18px;
}

.detail-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 24px;
    align-items: start;
    padding-top: 16px;
}

.player-shell {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-strong);
    border-radius: 28px;
    aspect-ratio: 16 / 9;
    background: #000000;
    box-shadow: var(--shadow);
}

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

.player-cover {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: grid;
    place-items: center;
    gap: 12px;
    border: 0;
    background:
        radial-gradient(circle at center, rgba(56, 189, 248, 0.16), rgba(10, 14, 26, 0.68)),
        rgba(10, 14, 26, 0.35);
    color: #ffffff;
    cursor: pointer;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.big-play {
    display: grid;
    place-items: center;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    font-size: 42px;
    box-shadow: 0 0 55px rgba(56, 189, 248, 0.45);
}

.player-cover strong {
    font-size: 20px;
}

.detail-side {
    display: grid;
    gap: 16px;
}

.detail-poster {
    width: 100%;
    border-radius: 24px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border: 1px solid var(--border);
}

.detail-meta-card,
.detail-content,
.detail-facts {
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 22px;
    background: rgba(15, 23, 42, 0.58);
}

.detail-meta-card p {
    margin: 0 0 10px;
    color: var(--primary);
    font-weight: 800;
}

.detail-meta-card h1 {
    margin: 0 0 14px;
    font-size: 32px;
    line-height: 1.2;
}

.detail-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 24px;
    margin-top: 24px;
}

.detail-content p {
    color: var(--muted-strong);
    line-height: 1.9;
    font-size: 17px;
}

.detail-content .lead-text {
    color: #ffffff;
    font-size: 20px;
}

.detail-facts dl {
    display: grid;
    grid-template-columns: 74px 1fr;
    gap: 12px 16px;
    margin: 22px 0 0;
}

.detail-facts dt {
    color: var(--muted);
}

.detail-facts dd {
    margin: 0;
    color: var(--muted-strong);
}

.detail-facts a {
    color: var(--primary);
}

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

.rank-row {
    display: grid;
    grid-template-columns: 52px 96px minmax(0, 1fr) 72px;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 12px;
    background: rgba(15, 23, 42, 0.54);
}

.rank-row:hover {
    border-color: var(--primary);
}

.rank-num {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 900;
}

.rank-cover img {
    width: 96px;
    height: 128px;
    object-fit: cover;
    border-radius: 14px;
}

.rank-info h2 {
    margin: 0 0 8px;
    font-size: 22px;
}

.rank-info p {
    margin: 0 0 12px;
    color: var(--muted);
    line-height: 1.6;
}

.hot-score {
    color: #fbbf24;
    font-size: 24px;
    text-align: right;
}

.site-footer {
    margin-top: 78px;
    border-top: 1px solid var(--border);
    background: rgba(7, 11, 22, 0.94);
}

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

.footer-grid p {
    color: var(--muted);
    line-height: 1.7;
}

.footer-grid h2 {
    margin: 0 0 14px;
    font-size: 18px;
}

.footer-grid a:not(.footer-brand) {
    display: block;
    margin: 9px 0;
    color: var(--muted-strong);
}

.footer-grid a:hover {
    color: var(--primary);
}

.footer-bottom {
    border-top: 1px solid rgba(56, 189, 248, 0.14);
    padding: 18px 0;
    color: var(--muted);
    text-align: center;
}

[data-movie-card].is-hidden {
    display: none;
}

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

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

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

    .category-overview-grid,
    .detail-hero,
    .detail-content-grid {
        grid-template-columns: 1fr;
    }

    .detail-side {
        grid-template-columns: 220px 1fr;
    }
}

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

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

    .header-inner {
        min-height: 68px;
    }

    .hero {
        min-height: 72vh;
    }

    .hero-content {
        bottom: 70px;
    }

    .hero-control {
        display: none;
    }

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

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

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

    .category-preview img {
        height: 140px;
    }

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

    .detail-poster {
        max-width: 260px;
    }

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

    .hot-score {
        display: none;
    }

    .rank-cover img {
        width: 74px;
        height: 98px;
    }

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

@media (max-width: 560px) {
    .container {
        width: min(100% - 22px, var(--container));
    }

    .brand-text small {
        display: none;
    }

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

    .hero h1,
    .hero h2 {
        font-size: 38px;
    }

    .hero-tags span,
    .meta-list span,
    .tag-row span,
    .detail-tags span {
        font-size: 12px;
    }

    .library-search {
        display: grid;
    }

    .library-search input {
        min-width: 0;
        width: 100%;
    }

    .page-main {
        padding-top: 80px;
    }

    .detail-main {
        padding-top: 78px;
    }
}
