:root {
    color-scheme: dark;
    --bg: #020617;
    --bg-soft: #0f172a;
    --panel: rgba(15, 23, 42, 0.84);
    --panel-strong: rgba(15, 23, 42, 0.96);
    --line: rgba(148, 163, 184, 0.18);
    --text: #e5e7eb;
    --muted: #94a3b8;
    --muted-strong: #cbd5e1;
    --accent: #34d399;
    --accent-strong: #10b981;
    --accent-warm: #facc15;
    --danger: #fb7185;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --max: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 15% 5%, rgba(16, 185, 129, 0.20), transparent 28rem),
        radial-gradient(circle at 85% 0%, rgba(14, 165, 233, 0.18), transparent 24rem),
        linear-gradient(180deg, #0f172a 0%, #020617 46%, #020617 100%);
}

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

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

button,
input {
    font: inherit;
}

.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(20px);
}

.header-inner {
    width: min(100%, var(--max));
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 22px;
    min-height: 72px;
    padding: 0 20px;
}

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    letter-spacing: 0.02em;
    color: #fff;
    white-space: nowrap;
}

.brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    color: #022c22;
    background: linear-gradient(135deg, var(--accent), #67e8f9);
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.34);
}

.top-search {
    flex: 1;
    display: flex;
    align-items: center;
    max-width: 430px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.78);
    overflow: hidden;
}

.top-search input,
.large-search input,
.toolbar input,
.hero-search-card input {
    width: 100%;
    border: 0;
    outline: 0;
    color: #fff;
    background: transparent;
}

.top-search input {
    padding: 11px 16px;
}

.top-search button,
.large-search button,
.hero-search-card button {
    border: 0;
    padding: 10px 18px;
    color: #022c22;
    background: var(--accent);
    font-weight: 800;
    cursor: pointer;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    color: var(--muted-strong);
    font-size: 15px;
}

.desktop-nav a,
.nav-menu > button {
    transition: color 0.2s ease;
}

.desktop-nav a:hover,
.nav-menu > button:hover,
.mobile-panel a:hover {
    color: var(--accent);
}

.nav-menu {
    position: relative;
}

.nav-menu > button {
    border: 0;
    color: var(--muted-strong);
    background: transparent;
}

.nav-submenu {
    position: absolute;
    top: calc(100% + 16px);
    right: 0;
    min-width: 170px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel-strong);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: 0.2s ease;
}

.nav-menu:hover .nav-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-submenu a {
    display: block;
    padding: 9px 12px;
    border-radius: 12px;
}

.nav-submenu a:hover {
    background: rgba(52, 211, 153, 0.10);
}

.mobile-toggle {
    display: none;
    border: 0;
    color: #fff;
    background: transparent;
    font-size: 28px;
}

.mobile-panel {
    display: none;
    padding: 12px 20px 20px;
    border-top: 1px solid var(--line);
    background: rgba(2, 6, 23, 0.94);
}

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

.mobile-panel a {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--muted-strong);
    background: rgba(15, 23, 42, 0.75);
}

.hero {
    width: min(100% - 40px, var(--max));
    margin: 32px auto 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 22px;
    align-items: stretch;
}

.hero-slider {
    position: relative;
    min-height: 540px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: #0f172a;
    box-shadow: var(--shadow);
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(1.03);
    transition: opacity 0.7s ease, transform 1.2s ease;
    pointer-events: none;
}

.hero-slide.is-active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.hero-slide img,
.detail-backdrop img {
    height: 100%;
    object-fit: cover;
}

.hero-mask,
.detail-backdrop::after {
    position: absolute;
    inset: 0;
    content: "";
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.94) 0%, rgba(2, 6, 23, 0.68) 45%, rgba(2, 6, 23, 0.20) 100%),
        linear-gradient(180deg, transparent 0%, rgba(2, 6, 23, 0.82) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(680px, 88%);
    padding: 76px 58px;
}

.hero-kicker,
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    margin-bottom: 16px;
    padding: 7px 12px;
    border: 1px solid rgba(52, 211, 153, 0.35);
    border-radius: 999px;
    color: var(--accent);
    background: rgba(16, 185, 129, 0.10);
    font-size: 13px;
    font-weight: 800;
}

.hero h1,
.page-hero h1,
.detail-main h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(38px, 6vw, 76px);
    line-height: 0.98;
    letter-spacing: -0.06em;
}

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

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

.hero-tags,
.detail-meta,
.detail-tags {
    margin-top: 22px;
}

.hero-tags span,
.detail-meta span,
.tag-row span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted-strong);
    background: rgba(15, 23, 42, 0.72);
    font-size: 12px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 32px;
}

.primary-button,
.ghost-button,
.section-link,
.row-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border-radius: 999px;
    font-weight: 900;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.primary-button,
.row-button {
    color: #022c22;
    background: linear-gradient(135deg, var(--accent), #67e8f9);
    box-shadow: 0 14px 30px rgba(16, 185, 129, 0.26);
}

.ghost-button,
.section-link {
    border: 1px solid var(--line);
    color: #fff;
    background: rgba(15, 23, 42, 0.65);
}

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

.hero-controls {
    position: absolute;
    left: 58px;
    bottom: 34px;
    z-index: 3;
    display: flex;
    gap: 10px;
}

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

.hero-dot.is-active {
    background: var(--accent);
}

.hero-search-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    padding: 26px;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.92)),
        radial-gradient(circle at top right, rgba(52, 211, 153, 0.22), transparent 18rem);
    box-shadow: var(--shadow);
}

.hero-search-card > span {
    display: block;
    margin-bottom: 16px;
    color: var(--accent);
    font-weight: 900;
}

.hero-search-card form,
.large-search {
    display: flex;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.52);
}

.hero-search-card input,
.large-search input {
    padding: 15px 16px;
}

.hero-quick-links {
    display: grid;
    gap: 12px;
    margin-top: 22px;
}

.hero-quick-links a {
    padding: 15px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    color: var(--muted-strong);
    background: rgba(15, 23, 42, 0.62);
    transition: 0.2s ease;
}

.hero-quick-links a:hover {
    color: #fff;
    border-color: rgba(52, 211, 153, 0.42);
    background: rgba(16, 185, 129, 0.10);
}

.content-section {
    width: min(100% - 40px, var(--max));
    margin: 72px auto 0;
}

.slim-section {
    margin-top: 58px;
}

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

.section-heading h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(26px, 4vw, 42px);
    line-height: 1.1;
}

.section-heading p {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

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

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

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

.movie-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(15, 23, 42, 0.72);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

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

.poster {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(14, 165, 233, 0.12));
}

.poster img {
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease, filter 0.4s ease;
}

.movie-card:hover .poster img {
    transform: scale(1.06);
    filter: saturate(1.12) contrast(1.04);
}

.poster::after {
    position: absolute;
    inset: auto 0 0;
    height: 56%;
    content: "";
    background: linear-gradient(180deg, transparent, rgba(2, 6, 23, 0.86));
}

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

.poster-badge {
    top: 12px;
    left: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    color: #111827;
    background: var(--accent-warm);
    font-size: 12px;
    font-weight: 900;
}

.poster-play {
    right: 12px;
    bottom: 12px;
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #022c22;
    background: var(--accent);
    box-shadow: 0 12px 28px rgba(16, 185, 129, 0.32);
}

.card-content {
    padding: 18px;
}

.meta-line {
    color: var(--muted);
    font-size: 12px;
}

.meta-line span:not(:last-child)::after {
    content: "·";
    margin-left: 8px;
    color: rgba(148, 163, 184, 0.55);
}

.movie-card h3,
.ranking-row h2 {
    margin: 12px 0 8px;
    color: #fff;
    font-size: 20px;
    line-height: 1.3;
}

.movie-card h3 a:hover,
.ranking-row h2 a:hover {
    color: var(--accent);
}

.movie-card p,
.ranking-row p,
.text-panel p,
.player-title p {
    margin: 0;
    color: var(--muted-strong);
    line-height: 1.75;
}

.tag-row {
    margin-top: 14px;
}

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

.category-tile,
.category-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(15, 23, 42, 0.72);
    transition: 0.2s ease;
}

.category-tile {
    padding: 22px;
}

.category-tile span,
.category-card h2 {
    display: block;
    color: #fff;
    font-size: 21px;
    font-weight: 900;
}

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

.category-tile:hover,
.category-card:hover {
    transform: translateY(-4px);
    border-color: rgba(52, 211, 153, 0.42);
    background: rgba(16, 185, 129, 0.10);
}

.page-hero {
    position: relative;
    width: min(100% - 40px, var(--max));
    margin: 32px auto 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    padding: 72px 58px;
    background:
        radial-gradient(circle at 20% 20%, rgba(52, 211, 153, 0.20), transparent 22rem),
        linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.95));
    box-shadow: var(--shadow);
}

.compact-hero h1,
.ranking-hero h1,
.search-hero h1 {
    font-size: clamp(34px, 5vw, 58px);
}

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

.category-card {
    position: relative;
    min-height: 240px;
    overflow: hidden;
}

.category-card img {
    position: absolute;
    inset: 0;
    height: 100%;
    object-fit: cover;
    opacity: 0.42;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.category-card:hover img {
    transform: scale(1.06);
    opacity: 0.58;
}

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

.category-card div {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 24px;
    z-index: 2;
}

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

.toolbar {
    margin-bottom: 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 18px;
    background: rgba(15, 23, 42, 0.74);
}

.toolbar label {
    display: grid;
    gap: 10px;
    color: var(--muted-strong);
    font-weight: 800;
}

.toolbar input {
    min-height: 48px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(2, 6, 23, 0.56);
}

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

.ranking-row {
    display: grid;
    grid-template-columns: 76px 150px minmax(0, 1fr) auto;
    gap: 20px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 16px;
    background: rgba(15, 23, 42, 0.72);
}

.ranking-row > strong {
    color: var(--accent-warm);
    font-size: 28px;
}

.ranking-cover {
    overflow: hidden;
    border-radius: 16px;
    aspect-ratio: 16 / 10;
}

.ranking-cover img {
    height: 100%;
    object-fit: cover;
}

.large-search {
    max-width: 720px;
    margin-top: 28px;
}

.breadcrumb {
    width: min(100% - 40px, var(--max));
    margin: 24px auto 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--muted);
    font-size: 14px;
}

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

.detail-hero {
    position: relative;
    width: min(100% - 40px, var(--max));
    margin: 18px auto 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: #0f172a;
    box-shadow: var(--shadow);
}

.detail-backdrop {
    position: absolute;
    inset: 0;
    opacity: 0.58;
}

.detail-layout {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 36px;
    align-items: end;
    min-height: 500px;
    padding: 54px;
}

.detail-poster {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 26px;
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.46);
}

.detail-poster img {
    aspect-ratio: 3 / 4;
    height: 100%;
    object-fit: cover;
}

.detail-main h1 {
    font-size: clamp(42px, 6vw, 72px);
}

.player-section {
    width: min(100% - 40px, var(--max));
    margin: 42px auto 0;
}

.player-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: #000;
    box-shadow: var(--shadow);
}

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

.play-layer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    color: #022c22;
    background: radial-gradient(circle at center, rgba(2, 6, 23, 0.18), rgba(2, 6, 23, 0.62));
    cursor: pointer;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.play-layer span {
    display: flex;
    width: 92px;
    height: 92px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--accent);
    font-size: 36px;
    box-shadow: 0 20px 60px rgba(16, 185, 129, 0.36);
}

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

.player-title {
    padding: 22px 4px 0;
}

.player-title h2,
.text-panel h2 {
    margin: 0 0 10px;
    color: #fff;
    font-size: 26px;
}

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

.text-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 28px;
    background: rgba(15, 23, 42, 0.72);
}

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

.footer-grid {
    width: min(100% - 40px, var(--max));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 36px;
    padding: 42px 0;
}

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

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

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

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

.footer-bottom {
    width: min(100% - 40px, var(--max));
    margin: 0 auto;
    padding: 18px 0 26px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 14px;
}

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

@media (max-width: 1080px) {
    .hero {
        grid-template-columns: 1fr;
    }

    .hero-search-card {
        display: grid;
        grid-template-columns: 1fr;
    }

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

    .ranking-row {
        grid-template-columns: 58px 120px minmax(0, 1fr);
    }

    .row-button {
        grid-column: 3;
        width: fit-content;
    }
}

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

    .mobile-toggle {
        display: block;
        margin-left: auto;
    }

    .hero,
    .content-section,
    .page-hero,
    .breadcrumb,
    .detail-hero,
    .player-section,
    .footer-grid,
    .footer-bottom {
        width: min(100% - 28px, var(--max));
    }

    .hero-slider {
        min-height: 560px;
    }

    .hero-content,
    .page-hero {
        padding: 48px 28px;
    }

    .hero-controls {
        left: 28px;
    }

    .movie-grid,
    .featured-grid,
    .rank-grid,
    .category-grid,
    .category-card-grid,
    .related-grid,
    .detail-content,
    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

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

@media (max-width: 560px) {
    .header-inner {
        min-height: 64px;
        padding: 0 14px;
    }

    .mobile-panel.is-open,
    .movie-grid,
    .featured-grid,
    .rank-grid,
    .category-grid,
    .category-card-grid,
    .related-grid,
    .detail-content,
    .footer-grid {
        grid-template-columns: 1fr;
    }

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

    .hero-content {
        width: 100%;
        padding: 44px 24px;
    }

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

    .hero-actions,
    .section-heading,
    .ranking-row {
        align-items: stretch;
        flex-direction: column;
    }

    .section-heading {
        display: grid;
    }

    .ranking-row {
        grid-template-columns: 1fr;
    }

    .ranking-cover {
        width: 100%;
    }

    .row-button {
        grid-column: auto;
    }

    .page-hero {
        padding: 38px 24px;
    }

    .detail-layout {
        padding: 24px;
    }

    .play-layer span {
        width: 76px;
        height: 76px;
        font-size: 30px;
    }
}
