:root {
    --bg: #020617;
    --bg-soft: #0f172a;
    --panel: rgba(15, 23, 42, 0.72);
    --panel-strong: rgba(15, 23, 42, 0.92);
    --border: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --muted-strong: #cbd5e1;
    --emerald: #10b981;
    --emerald-dark: #059669;
    --cyan: #22d3ee;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: linear-gradient(180deg, #020617 0%, #0f172a 42%, #020617 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

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

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

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

.page-shell {
    min-height: 100vh;
    overflow-x: hidden;
}

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

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    gap: 24px;
}

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

.logo-mark {
    display: inline-grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--emerald), var(--cyan));
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.28);
}

.desktop-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 22px;
    color: var(--muted-strong);
    font-size: 14px;
}

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

.desktop-nav a:hover,
.mobile-nav a:hover {
    color: #6ee7b7;
}

.mobile-menu-button {
    display: none;
    width: 44px;
    height: 44px;
    padding: 10px;
    border: 0;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.95);
}

.mobile-menu-button span {
    display: block;
    height: 2px;
    margin: 5px 0;
    border-radius: 999px;
    background: var(--text);
}

.mobile-nav {
    display: none;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.96);
}

.mobile-nav.is-open {
    display: grid;
}

.mobile-nav a {
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--muted-strong);
    background: rgba(30, 41, 59, 0.62);
}

.hero {
    position: relative;
    height: 70vh;
    min-height: 540px;
    max-height: 840px;
    overflow: hidden;
    background: #020617;
}

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

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

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

.hero-layer {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 75% 30%, rgba(34, 211, 238, 0.18), transparent 26%),
        linear-gradient(180deg, rgba(2, 6, 23, 0.1), rgba(2, 6, 23, 0.78) 66%, #020617 100%),
        linear-gradient(90deg, rgba(2, 6, 23, 0.9), rgba(2, 6, 23, 0.42), rgba(2, 6, 23, 0.1));
}

.hero-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 72px 0;
}

.hero-content h1 {
    max-width: 850px;
    margin: 0 0 18px;
    font-size: clamp(42px, 7vw, 82px);
    line-height: 1.04;
    letter-spacing: -0.04em;
}

.hero-content p {
    max-width: 690px;
    margin: 0 0 30px;
    color: var(--muted-strong);
    font-size: clamp(17px, 2vw, 22px);
    line-height: 1.75;
}

.hero-pill,
.info-pill,
.category-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    color: #ecfdf5;
    background: rgba(16, 185, 129, 0.88);
    box-shadow: 0 12px 32px rgba(16, 185, 129, 0.22);
}

.hero-pill {
    margin-bottom: 18px;
    font-weight: 700;
}

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

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 24px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 700;
    transition: transform 0.2s ease, background 0.2s ease, border 0.2s ease;
}

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

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

.button-primary:hover {
    background: var(--emerald-dark);
}

.button-ghost {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(15, 23, 42, 0.72);
}

.button-ghost:hover {
    border-color: rgba(16, 185, 129, 0.55);
    background: rgba(15, 23, 42, 0.92);
}

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 5;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 999px;
    color: white;
    background: rgba(2, 6, 23, 0.62);
    transform: translateY(-50%);
    transition: background 0.2s ease, transform 0.2s ease;
}

.hero-arrow:hover {
    background: rgba(2, 6, 23, 0.86);
    transform: translateY(-50%) scale(1.04);
}

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

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

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

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

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

.main-content {
    padding: 56px 0 78px;
}

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

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

.section-heading h2 {
    margin: 0;
    font-size: clamp(26px, 4vw, 38px);
    line-height: 1.2;
}

.section-heading p {
    margin: 8px 0 0;
    color: var(--muted);
}

.section-more {
    flex: 0 0 auto;
    color: #6ee7b7;
    font-weight: 700;
}

.gradient-panel {
    border: 1px solid rgba(34, 211, 238, 0.18);
    border-radius: 32px;
    padding: clamp(24px, 4vw, 44px);
    background: linear-gradient(135deg, rgba(6, 95, 70, 0.24), rgba(8, 47, 73, 0.24));
    box-shadow: var(--shadow);
}

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

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

.movie-list {
    display: grid;
    gap: 18px;
}

.movie-card {
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.58);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
    transition: transform 0.24s ease, background 0.24s ease, border-color 0.24s ease;
}

.movie-card:hover {
    transform: translateY(-5px);
    border-color: rgba(16, 185, 129, 0.34);
    background: rgba(15, 23, 42, 0.9);
}

.poster-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.88);
}

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

.movie-card:hover .poster-frame img,
.related-card:hover img,
.rank-row:hover img {
    transform: scale(1.09);
}

.poster-hover {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    opacity: 0;
    background: rgba(0, 0, 0, 0.42);
    transition: opacity 0.2s ease;
}

.movie-card:hover .poster-hover,
.related-card:hover .poster-hover {
    opacity: 1;
}

.play-glyph {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.92);
    position: relative;
    box-shadow: 0 14px 34px rgba(16, 185, 129, 0.28);
}

.play-glyph::before {
    content: "";
    position: absolute;
    left: 19px;
    top: 14px;
    border-left: 15px solid white;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
}

.play-glyph-large {
    width: 72px;
    height: 72px;
}

.play-glyph-large::before {
    left: 29px;
    top: 21px;
    border-left-width: 22px;
    border-top-width: 15px;
    border-bottom-width: 15px;
}

.corner-badge,
.rank-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 5px 9px;
    border-radius: 999px;
    color: white;
    font-size: 12px;
    font-weight: 800;
    background: rgba(2, 6, 23, 0.82);
}

.rank-badge {
    left: 12px;
    right: auto;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
}

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

.movie-card h3,
.list-card-body h3 {
    margin: 0 0 10px;
    color: var(--text);
    font-size: 17px;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.movie-card:hover h3,
.related-card:hover h4,
.rank-row:hover h3 {
    color: #6ee7b7;
}

.movie-card p,
.list-card-body p {
    display: -webkit-box;
    margin: 0 0 14px;
    overflow: hidden;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.card-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #64748b;
    font-size: 13px;
}

.movie-card-list {
    border-radius: 18px;
}

.list-card-link {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 180px;
}

.list-poster {
    aspect-ratio: auto;
    min-height: 180px;
}

.list-card-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
}

.mini-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.mini-tags span,
.tag-list span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    color: #a7f3d0;
    background: rgba(16, 185, 129, 0.13);
}

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

.category-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 190px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 26px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.86), rgba(6, 78, 59, 0.26));
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
    transition: transform 0.24s ease, border-color 0.24s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: rgba(16, 185, 129, 0.4);
}

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

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

.category-card strong {
    color: #6ee7b7;
}

.page-hero {
    padding: 72px 0 38px;
    background: linear-gradient(135deg, rgba(6, 78, 59, 0.28), rgba(8, 47, 73, 0.28));
    border-bottom: 1px solid var(--border);
}

.page-hero h1 {
    margin: 0 0 14px;
    font-size: clamp(36px, 5vw, 58px);
    letter-spacing: -0.03em;
}

.page-hero p {
    max-width: 760px;
    margin: 0;
    color: var(--muted-strong);
    font-size: 18px;
    line-height: 1.8;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 28px;
}

.search-box {
    position: relative;
    flex: 1;
}

.search-box input,
.hero-search input {
    width: 100%;
    min-height: 52px;
    padding: 0 18px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 999px;
    color: var(--text);
    outline: none;
    background: rgba(15, 23, 42, 0.82);
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.search-box input:focus,
.hero-search input:focus {
    border-color: rgba(16, 185, 129, 0.7);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}

.hero-search {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    max-width: 760px;
    margin-top: 24px;
}

.filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 26px;
}

.filter-button,
.layout-button {
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 999px;
    color: var(--muted-strong);
    background: rgba(15, 23, 42, 0.74);
    transition: background 0.2s ease, color 0.2s ease, border 0.2s ease;
}

.filter-button.is-active,
.layout-button.is-active,
.filter-button:hover,
.layout-button:hover {
    color: white;
    border-color: rgba(16, 185, 129, 0.55);
    background: rgba(16, 185, 129, 0.72);
}

.layout-switch {
    display: flex;
    gap: 8px;
}

.result-count {
    color: var(--muted);
    margin-bottom: 18px;
}

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

.rank-row {
    display: grid;
    grid-template-columns: 74px 210px 1fr auto;
    gap: 18px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.62);
    transition: transform 0.2s ease, background 0.2s ease;
}

.rank-row:hover {
    transform: translateY(-3px);
    background: rgba(15, 23, 42, 0.9);
}

.rank-index {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 18px;
    font-size: 20px;
    font-weight: 900;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.rank-cover {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.9);
}

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

.rank-row h3 {
    margin: 0 0 8px;
    font-size: 20px;
    transition: color 0.2s ease;
}

.rank-row p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    line-height: 1.65;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.rank-meta {
    color: var(--muted-strong);
    white-space: nowrap;
}

.detail-main {
    padding: 38px 0 76px;
}

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

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

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

.player-card,
.detail-card,
.related-panel {
    border: 1px solid var(--border);
    border-radius: 26px;
    background: rgba(15, 23, 42, 0.64);
    box-shadow: var(--shadow);
}

.player-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 26px 26px 0 0;
    background: black;
    aspect-ratio: 16 / 9;
}

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

.player-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 0;
    color: white;
    background-size: cover;
    background-position: center;
    z-index: 4;
}

.player-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.12), rgba(2, 6, 23, 0.7));
}

.player-overlay span {
    position: relative;
    z-index: 2;
}

.player-overlay.is-hidden {
    display: none;
}

.player-title {
    padding: 22px 24px;
}

.player-title h1 {
    margin: 0 0 10px;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.22;
}

.info-line {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--muted-strong);
}

.detail-card {
    padding: 24px;
    margin-top: 24px;
}

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

.detail-card p {
    margin: 0 0 18px;
    color: var(--muted-strong);
    line-height: 1.9;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

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

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

.related-card {
    display: grid;
    grid-template-columns: 128px 1fr;
    gap: 12px;
    overflow: hidden;
    padding: 10px;
    border-radius: 18px;
    background: rgba(30, 41, 59, 0.56);
    transition: background 0.2s ease;
}

.related-card:hover {
    background: rgba(30, 41, 59, 0.86);
}

.related-card .poster-frame {
    border-radius: 13px;
}

.related-card h4 {
    display: -webkit-box;
    margin: 2px 0 8px;
    overflow: hidden;
    font-size: 15px;
    line-height: 1.45;
    transition: color 0.2s ease;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.related-card p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.site-footer {
    border-top: 1px solid var(--border);
    background: rgba(2, 6, 23, 0.72);
}

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

.footer-logo {
    margin-bottom: 16px;
}

.site-footer p {
    max-width: 520px;
    margin: 0;
    color: var(--muted);
    line-height: 1.75;
}

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

.site-footer a:not(.site-logo) {
    display: block;
    margin: 8px 0;
    color: var(--muted-strong);
}

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

.footer-bottom {
    padding: 18px 0 24px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

.back-to-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 40;
    display: none;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 999px;
    color: white;
    background: var(--emerald);
    box-shadow: 0 12px 32px rgba(16, 185, 129, 0.32);
}

.back-to-top.is-visible {
    display: block;
}

.empty-state {
    display: none;
    padding: 52px 20px;
    border: 1px dashed rgba(148, 163, 184, 0.26);
    border-radius: 24px;
    color: var(--muted);
    text-align: center;
    background: rgba(15, 23, 42, 0.5);
}

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

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

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

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

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

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

    .related-panel {
        position: static;
    }
}

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

    .hero {
        height: 76vh;
        min-height: 560px;
    }

    .hero-content {
        padding: 46px 0 78px;
    }

    .hero-arrow {
        display: none;
    }

    .hero-search,
    .toolbar,
    .section-heading,
    .footer-grid {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

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

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

    .list-card-link,
    .rank-row {
        grid-template-columns: 1fr;
    }

    .list-poster {
        min-height: 220px;
    }

    .rank-meta {
        white-space: normal;
    }

    .related-card {
        grid-template-columns: 116px 1fr;
    }

    .page-hero {
        padding-top: 48px;
    }
}

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

    .mobile-nav {
        grid-template-columns: 1fr;
    }

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

    .hero-actions,
    .action-row {
        flex-direction: column;
    }

    .button {
        width: 100%;
    }
}
