* {
    box-sizing: border-box;
}

:root {
    color-scheme: dark;
    --bg: #030712;
    --bg-soft: #07111f;
    --panel: rgba(15, 23, 42, 0.78);
    --panel-strong: rgba(15, 23, 42, 0.94);
    --line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --brand: #34d399;
    --brand-strong: #10b981;
    --brand-soft: rgba(16, 185, 129, 0.18);
    --amber: #f59e0b;
    --red: #fb7185;
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(16, 185, 129, 0.2), transparent 34rem),
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.16), transparent 32rem),
        var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

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

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

button,
input,
select {
    font: inherit;
}

main {
    padding-top: 72px;
}

.site-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 100;
    background: rgba(3, 7, 18, 0.78);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(22px);
}

.header-inner {
    width: min(1320px, 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;
    color: var(--brand);
    font-weight: 800;
    letter-spacing: 0.03em;
}

.brand-mark {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: #052e2b;
    background: linear-gradient(135deg, #6ee7b7, #10b981);
    box-shadow: 0 0 28px rgba(16, 185, 129, 0.45);
}

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

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

.nav-link {
    color: #cbd5e1;
    font-size: 15px;
    transition: color 0.2s ease;
}

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

.mobile-toggle {
    display: none;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.86);
    cursor: pointer;
}

.mobile-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    border-radius: 999px;
    background: var(--soft);
}

.mobile-panel {
    display: none;
    width: min(1320px, calc(100% - 32px));
    margin: 0 auto 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.94);
}

.mobile-panel.is-open {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.mobile-nav-link {
    padding: 12px 14px;
    border-radius: 14px;
    color: var(--soft);
    background: rgba(255, 255, 255, 0.04);
}

.hero-section {
    width: min(1320px, calc(100% - 32px));
    margin: 32px auto 0;
}

.hero-frame {
    position: relative;
    min-height: 620px;
    overflow: hidden;
    border: 1px solid rgba(52, 211, 153, 0.22);
    border-radius: var(--radius-xl);
    background: #020617;
    box-shadow: var(--shadow);
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: grid;
    align-items: center;
    padding: clamp(32px, 6vw, 80px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
}

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

.hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.42;
    transform: scale(1.02);
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(3, 7, 18, 0.98), rgba(3, 7, 18, 0.7) 46%, rgba(3, 7, 18, 0.24)),
        radial-gradient(circle at 20% 20%, rgba(16, 185, 129, 0.26), transparent 34rem);
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(820px, 100%);
}

.hero-eyebrow,
.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--brand);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero-content h1,
.hero-site-title,
.page-hero h1,
.detail-hero-content h1 {
    margin: 0;
    font-size: clamp(34px, 6vw, 72px);
    line-height: 1.04;
    letter-spacing: -0.05em;
}

.hero-content h2 {
    margin: 18px 0 10px;
    font-size: clamp(24px, 3.4vw, 42px);
    line-height: 1.15;
}

.hero-content p,
.page-hero p,
.detail-hero-content p,
.home-intro p {
    width: min(760px, 100%);
    margin: 16px 0 0;
    color: #dbeafe;
    font-size: 18px;
}

.hero-tags,
.detail-tags,
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-tags {
    margin-top: 24px;
}

.hero-tags span,
.detail-tags span,
.tag-list span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border: 1px solid rgba(52, 211, 153, 0.24);
    border-radius: 999px;
    color: #bbf7d0;
    background: rgba(16, 185, 129, 0.12);
    font-size: 12px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.primary-button,
.ghost-button,
.section-more,
.text-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    font-weight: 800;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.primary-button {
    color: #052e2b;
    background: linear-gradient(135deg, #6ee7b7, #10b981);
    box-shadow: 0 14px 34px rgba(16, 185, 129, 0.32);
}

.ghost-button,
.section-more,
.text-link {
    border: 1px solid var(--line);
    color: var(--soft);
    background: rgba(255, 255, 255, 0.05);
}

.primary-button:hover,
.ghost-button:hover,
.section-more:hover,
.text-link:hover {
    transform: translateY(-2px);
}

.ghost-button:hover,
.section-more:hover,
.text-link:hover {
    border-color: rgba(52, 211, 153, 0.5);
    color: var(--brand);
}

.hero-controls {
    position: absolute;
    right: 28px;
    bottom: 28px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 14px;
}

.hero-arrow,
.hero-dot {
    border: 0;
    cursor: pointer;
}

.hero-arrow {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    color: var(--text);
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid var(--line);
    font-size: 28px;
}

.hero-dots {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hero-dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.45);
}

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

.hero-rail {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.hero-rail-card {
    position: relative;
    min-height: 126px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--panel);
}

.hero-rail-card img {
    width: 100%;
    height: 100%;
    min-height: 126px;
    object-fit: cover;
    opacity: 0.7;
    transition: transform 0.25s ease;
}

.hero-rail-card span {
    position: absolute;
    right: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 2;
    font-weight: 800;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
}

.hero-rail-card:hover img {
    transform: scale(1.06);
}

.home-intro,
.search-toolbar,
.content-section,
.page-hero,
.detail-hero,
.player-section,
.detail-text-block {
    width: min(1320px, calc(100% - 32px));
    margin: 28px auto 0;
}

.home-intro,
.search-toolbar,
.page-hero,
.detail-text-block,
.player-section {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: 0 14px 48px rgba(0, 0, 0, 0.22);
}

.home-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 30px;
}

.home-intro h2,
.section-heading h2,
.detail-text-block h2,
.player-section h2 {
    margin: 0;
    font-size: clamp(24px, 3vw, 34px);
    letter-spacing: -0.03em;
}

.search-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 180px 180px;
    gap: 14px;
    padding: 18px;
}

.search-box {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
}

.search-box input,
.filter-select {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 16px;
    color: var(--text);
    background: rgba(2, 6, 23, 0.78);
    outline: none;
}

.search-box input {
    padding: 0 16px;
}

.filter-select {
    align-self: end;
    padding: 0 12px;
}

.search-box input:focus,
.filter-select:focus {
    border-color: rgba(52, 211, 153, 0.55);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.13);
}

.content-section {
    padding: 10px 0;
}

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

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

.movie-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.96));
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
    transform: translateY(-5px);
    border-color: rgba(52, 211, 153, 0.42);
    box-shadow: 0 24px 54px rgba(0, 0, 0, 0.36);
}

.poster-wrap {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background:
        radial-gradient(circle at top, rgba(52, 211, 153, 0.22), transparent 60%),
        #111827;
}

.poster-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.28s ease, opacity 0.28s ease;
}

.poster-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 45%, rgba(2, 6, 23, 0.78));
}

.movie-card:hover .poster-wrap img {
    transform: scale(1.05);
}

.year-badge,
.rank-badge {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.year-badge {
    top: 10px;
    left: 10px;
    color: #dcfce7;
    background: rgba(5, 46, 43, 0.82);
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.rank-badge {
    top: 10px;
    right: 10px;
    color: #451a03;
    background: linear-gradient(135deg, #fde68a, #f59e0b);
}

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

.movie-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-size: 12px;
}

.movie-card h2 {
    min-height: 48px;
    margin: 8px 0 8px;
    color: var(--text);
    font-size: 16px;
    line-height: 1.45;
}

.movie-card h2 a:hover {
    color: var(--brand);
}

.movie-card p {
    display: -webkit-box;
    min-height: 66px;
    margin: 0 0 12px;
    overflow: hidden;
    color: var(--muted);
    font-size: 13px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.tag-list {
    gap: 6px;
}

.tag-list span {
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

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

.category-tile {
    position: relative;
    min-height: 210px;
    overflow: hidden;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--panel);
}

.category-tile img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.36;
    transition: transform 0.25s ease;
}

.category-tile::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent, rgba(2, 6, 23, 0.92));
}

.category-tile span,
.category-tile strong {
    position: relative;
    z-index: 2;
}

.category-tile span {
    color: var(--text);
    font-size: 22px;
    font-weight: 900;
}

.category-tile strong {
    margin-top: 8px;
    color: var(--soft);
    font-size: 13px;
    font-weight: 500;
}

.category-tile:hover img {
    transform: scale(1.08);
}

.page-hero {
    min-height: 360px;
    padding: clamp(30px, 6vw, 70px);
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.55fr);
    gap: 34px;
    align-items: center;
    background:
        radial-gradient(circle at 20% 20%, rgba(52, 211, 153, 0.2), transparent 28rem),
        linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(2, 6, 23, 0.92));
}

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

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

.category-card-large {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 22px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: var(--panel);
}

.category-card-large h2 {
    margin: 0 0 10px;
    font-size: 26px;
}

.category-card-large p {
    color: var(--muted);
}

.category-cover-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.category-cover-stack img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 16px;
}

.ranking-hero {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
}

.side-rank {
    display: grid;
    gap: 10px;
}

.side-rank-item {
    display: grid;
    grid-template-columns: 34px 48px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(2, 6, 23, 0.34);
}

.side-rank-item span {
    color: var(--brand);
    font-weight: 900;
    text-align: center;
}

.side-rank-item img {
    width: 48px;
    height: 64px;
    object-fit: cover;
    border-radius: 10px;
}

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

.detail-hero {
    display: grid;
    grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
    gap: clamp(22px, 4vw, 46px);
    align-items: center;
    padding: clamp(24px, 5vw, 56px);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background:
        radial-gradient(circle at 16% 20%, rgba(52, 211, 153, 0.2), transparent 30rem),
        linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(2, 6, 23, 0.96));
    box-shadow: var(--shadow);
}

.detail-poster img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 28px;
    border: 1px solid rgba(52, 211, 153, 0.2);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

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

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

.detail-tags {
    margin-top: 20px;
}

.detail-meta-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
}

.detail-meta-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(2, 6, 23, 0.34);
}

.detail-meta-list strong {
    color: var(--muted);
}

.detail-meta-list a,
.detail-meta-list span {
    color: var(--soft);
}

.player-section {
    padding: 20px;
}

.player-frame {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: 26px;
    background: #000;
    border: 1px solid rgba(52, 211, 153, 0.24);
}

.movie-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

.play-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    border: 0;
    color: var(--text);
    background:
        radial-gradient(circle at center, rgba(16, 185, 129, 0.16), transparent 20rem),
        rgba(2, 6, 23, 0.42);
    cursor: pointer;
    font-size: 18px;
    font-weight: 900;
}

.play-overlay.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.play-circle {
    width: 86px;
    height: 86px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-left: 6px;
    border-radius: 999px;
    color: #052e2b;
    background: linear-gradient(135deg, #6ee7b7, #10b981);
    box-shadow: 0 0 48px rgba(16, 185, 129, 0.48);
}

.detail-text-block {
    padding: 28px;
}

.detail-text-block p {
    margin: 14px 0 0;
    color: var(--soft);
    font-size: 17px;
}

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

.movie-card-compact {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
}

.movie-card-compact .poster-wrap {
    aspect-ratio: auto;
    min-height: 180px;
}

.movie-card-compact .movie-card h2,
.movie-card-compact h2 {
    min-height: auto;
}

.empty-state {
    margin: 22px 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    color: var(--muted);
    text-align: center;
    background: var(--panel);
}

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

.footer-grid {
    width: min(1320px, calc(100% - 32px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.4fr 0.8fr 1.2fr;
    gap: 34px;
    padding: 44px 0;
}

.footer-grid p {
    max-width: 520px;
    color: var(--muted);
}

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

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

.footer-links a {
    color: var(--muted);
}

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

.footer-bottom {
    width: min(1320px, calc(100% - 32px));
    margin: 0 auto;
    padding: 20px 0 32px;
    border-top: 1px solid var(--line);
    color: #64748b;
    text-align: center;
    font-size: 14px;
}

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

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

    .site-nav {
        gap: 16px;
    }
}

@media (max-width: 900px) {
    main {
        padding-top: 68px;
    }

    .site-nav {
        display: none;
    }

    .mobile-toggle {
        display: block;
    }

    .hero-frame {
        min-height: 620px;
    }

    .hero-slide {
        padding: 28px;
    }

    .hero-controls {
        right: 18px;
        bottom: 18px;
    }

    .home-intro,
    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .search-toolbar {
        grid-template-columns: 1fr;
    }

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

    .category-large-grid,
    .page-hero,
    .ranking-hero,
    .detail-hero,
    .footer-grid {
        grid-template-columns: 1fr;
    }

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

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

@media (max-width: 640px) {
    .header-inner {
        width: min(100% - 22px, 1320px);
    }

    .brand-text {
        font-size: 17px;
    }

    .hero-section,
    .home-intro,
    .search-toolbar,
    .content-section,
    .page-hero,
    .detail-hero,
    .player-section,
    .detail-text-block {
        width: min(100% - 22px, 1320px);
    }

    .hero-frame {
        min-height: 560px;
        border-radius: 24px;
    }

    .hero-content h1,
    .hero-site-title,
    .page-hero h1,
    .detail-hero-content h1 {
        font-size: 36px;
    }

    .hero-content h2 {
        font-size: 26px;
    }

    .hero-content p,
    .page-hero p,
    .detail-hero-content p,
    .home-intro p {
        font-size: 16px;
    }

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

    .movie-card h2 {
        font-size: 15px;
    }

    .movie-card p {
        min-height: 58px;
        -webkit-line-clamp: 2;
    }

    .category-tile {
        min-height: 170px;
    }

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

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

    .player-frame {
        border-radius: 18px;
    }

    .play-circle {
        width: 68px;
        height: 68px;
    }

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

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