* {
    box-sizing: border-box;
}

:root {
    color-scheme: dark;
    --page-bg: #020617;
    --panel-bg: rgba(15, 23, 42, 0.86);
    --panel-strong: #0f172a;
    --panel-soft: rgba(30, 41, 59, 0.72);
    --line: rgba(148, 163, 184, 0.18);
    --text: #e2e8f0;
    --muted: #94a3b8;
    --dim: #64748b;
    --brand: #10b981;
    --brand-strong: #059669;
    --cyan: #22d3ee;
    --amber: #f59e0b;
    --danger: #f43f5e;
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.38);
    --shadow-md: 0 14px 36px rgba(0, 0, 0, 0.3);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 20% 0%, rgba(16, 185, 129, 0.15), transparent 32rem),
        radial-gradient(circle at 90% 12%, rgba(34, 211, 238, 0.12), transparent 30rem),
        linear-gradient(180deg, #020617 0%, #0f172a 42%, #020617 100%);
}

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

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

button,
input,
select {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(90deg, rgba(2, 6, 23, 0.94), rgba(15, 23, 42, 0.93), rgba(2, 6, 23, 0.94));
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.2);
}

.nav-shell {
    width: min(1200px, calc(100% - 32px));
    height: 68px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 28px;
}

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

.brand-mark {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    color: #00130d;
    background: linear-gradient(135deg, var(--brand), var(--cyan));
    border-radius: 50%;
    box-shadow: 0 0 26px rgba(16, 185, 129, 0.42);
}

.brand-text,
.footer-brand {
    font-size: 24px;
    background: linear-gradient(90deg, #34d399, #22d3ee);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    color: #cbd5e1;
}

.desktop-nav > a,
.nav-dropdown > a {
    padding: 22px 0;
    transition: color 0.2s ease;
}

.desktop-nav a:hover,
.desktop-nav a.is-active,
.nav-dropdown > a.is-active {
    color: var(--brand);
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-panel {
    position: absolute;
    top: 100%;
    left: -18px;
    width: 220px;
    padding: 10px;
    display: grid;
    gap: 4px;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: 0.24s ease;
}

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

.nav-dropdown-panel a {
    padding: 10px 12px;
    border-radius: 10px;
    color: #dbeafe;
}

.nav-dropdown-panel a:hover {
    background: rgba(16, 185, 129, 0.14);
}

.nav-search {
    margin-left: auto;
    display: flex;
    align-items: center;
    min-width: 300px;
    padding: 4px;
    background: rgba(30, 41, 59, 0.78);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.nav-search input {
    width: 100%;
    min-width: 0;
    padding: 10px 12px 10px 16px;
    color: var(--text);
    background: transparent;
    border: 0;
    outline: none;
}

.nav-search button,
.primary-btn,
.ghost-btn,
.player-button,
.load-more-btn {
    border: 0;
    cursor: pointer;
}

.nav-search button,
.primary-btn,
.player-button,
.load-more-btn {
    color: #ffffff;
    background: linear-gradient(135deg, var(--brand), var(--brand-strong));
    border-radius: 999px;
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.nav-search button {
    padding: 9px 18px;
}

.primary-btn,
.ghost-btn,
.player-button,
.load-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    font-weight: 700;
}

.primary-btn:hover,
.nav-search button:hover,
.player-button:hover,
.load-more-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 36px rgba(16, 185, 129, 0.34);
}

.ghost-btn {
    color: #d1fae5;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(16, 185, 129, 0.38);
}

.menu-button {
    display: none;
    width: 42px;
    height: 42px;
    padding: 10px;
    background: rgba(30, 41, 59, 0.75);
    border: 1px solid var(--line);
    border-radius: 14px;
}

.menu-button span {
    display: block;
    width: 100%;
    height: 2px;
    margin: 5px 0;
    background: #e2e8f0;
    border-radius: 4px;
}

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

.mobile-panel a {
    display: block;
    padding: 11px 12px;
    color: #dbeafe;
    border-radius: 10px;
}

.mobile-panel a:hover {
    background: rgba(16, 185, 129, 0.14);
}

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

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

.hero {
    position: relative;
    height: min(80vh, 760px);
    min-height: 560px;
    overflow: hidden;
    background: #020617;
}

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

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

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.12) contrast(1.05);
}

.hero-slide::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.95) 0%, rgba(2, 6, 23, 0.62) 42%, rgba(2, 6, 23, 0.2) 100%),
        linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.3) 34%, rgba(2, 6, 23, 0.2) 100%);
}

.hero-content {
    position: absolute;
    left: 50%;
    bottom: 86px;
    width: min(1200px, calc(100% - 32px));
    transform: translateX(-50%);
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 15px;
    margin-bottom: 18px;
    color: #ecfeff;
    background: rgba(16, 185, 129, 0.86);
    border-radius: 999px;
    font-weight: 700;
}

.hero h1,
.hero h2 {
    max-width: 780px;
    margin: 0 0 18px;
    color: #ffffff;
    font-size: clamp(38px, 6vw, 76px);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.hero p {
    max-width: 680px;
    margin: 0 0 28px;
    color: #cbd5e1;
    font-size: clamp(17px, 2.2vw, 22px);
    line-height: 1.75;
}

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

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 52px;
    height: 52px;
    color: white;
    background: rgba(0, 0, 0, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    cursor: pointer;
    transform: translateY(-50%);
    transition: background 0.2s ease, transform 0.2s ease;
}

.hero-arrow:hover {
    background: rgba(0, 0, 0, 0.68);
    transform: translateY(-50%) scale(1.04);
}

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

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

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

.hero-dots button {
    width: 12px;
    height: 12px;
    padding: 0;
    background: rgba(255, 255, 255, 0.5);
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    transition: width 0.2s ease, background 0.2s ease;
}

.hero-dots button.is-active {
    width: 34px;
    background: var(--brand);
}

.section {
    padding: 58px 0 0;
}

.section-card {
    padding: 32px;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.88), rgba(30, 41, 59, 0.52));
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

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

.section-eyebrow {
    display: inline-flex;
    margin-bottom: 10px;
    color: var(--brand);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.section h1,
.section h2,
.page-hero h1,
.detail-title h1 {
    margin: 0;
    color: #ffffff;
    line-height: 1.2;
}

.section h2,
.page-hero h1 {
    font-size: clamp(28px, 3.5vw, 42px);
}

.section-head p,
.page-hero p,
.category-card p,
.detail-title p {
    color: var(--muted);
    line-height: 1.75;
}

.text-link {
    color: #5eead4;
    font-weight: 700;
}

.text-link:hover {
    color: #99f6e4;
}

.quick-search {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    margin-top: 24px;
    padding: 8px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.quick-search input {
    min-width: 0;
    padding: 13px 18px;
    color: #ffffff;
    background: transparent;
    border: 0;
    outline: none;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.filter-chip {
    padding: 9px 14px;
    color: #cbd5e1;
    background: rgba(30, 41, 59, 0.75);
    border: 1px solid var(--line);
    border-radius: 999px;
    cursor: pointer;
}

.filter-chip.is-active,
.filter-chip:hover {
    color: #ffffff;
    background: rgba(16, 185, 129, 0.22);
    border-color: rgba(16, 185, 129, 0.5);
}

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

.movie-card {
    overflow: hidden;
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
    transform: translateY(-7px);
    border-color: rgba(16, 185, 129, 0.48);
    box-shadow: 0 24px 52px rgba(0, 0, 0, 0.32);
}

.card-cover {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(34, 211, 238, 0.12)),
        #111827;
}

.card-cover img,
.mini-card img,
.rank-item img,
.detail-poster img,
.related-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.movie-card:hover .card-cover img,
.related-card:hover img {
    transform: scale(1.06);
}

.card-play {
    position: absolute;
    right: 14px;
    bottom: 14px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: #ffffff;
    background: rgba(16, 185, 129, 0.92);
    border-radius: 50%;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}

.card-body {
    padding: 16px;
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: var(--dim);
    font-size: 13px;
}

.card-meta a {
    color: #34d399;
}

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

.card-body h2 a:hover {
    color: #5eead4;
}

.card-body p {
    min-height: 48px;
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
}

.tag-line {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.tag-line span,
.meta-pill,
.hero-meta span {
    display: inline-flex;
    align-items: center;
    padding: 6px 9px;
    color: #d1fae5;
    background: rgba(16, 185, 129, 0.16);
    border: 1px solid rgba(16, 185, 129, 0.22);
    border-radius: 999px;
    font-size: 12px;
}

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

.category-card {
    min-height: 190px;
    padding: 22px;
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.13), rgba(34, 211, 238, 0.06));
    border: 1px solid var(--line);
    border-radius: 22px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

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

.category-card strong {
    display: block;
    margin-bottom: 12px;
    color: #ffffff;
    font-size: 21px;
}

.category-card span {
    color: #5eead4;
    font-weight: 700;
}

.rank-layout {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 24px;
}

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

.rank-item {
    display: grid;
    grid-template-columns: 48px 72px 1fr;
    gap: 14px;
    align-items: center;
    padding: 12px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid var(--line);
    border-radius: 18px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.rank-item:hover {
    background: rgba(30, 41, 59, 0.88);
    transform: translateX(4px);
}

.rank-item strong {
    color: var(--amber);
    font-size: 24px;
}

.rank-item img {
    aspect-ratio: 16 / 10;
    border-radius: 12px;
    background: #111827;
}

.rank-item b {
    display: block;
    margin-bottom: 6px;
    color: #ffffff;
    font-size: 17px;
}

.rank-item em,
.mini-card em {
    color: var(--muted);
    font-style: normal;
    font-size: 13px;
}

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

.mini-card {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid var(--line);
    border-radius: 16px;
}

.mini-card img {
    aspect-ratio: 16 / 10;
    border-radius: 12px;
    background: #111827;
}

.mini-card span {
    display: block;
    color: #ffffff;
    font-weight: 700;
    line-height: 1.35;
}

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

.page-hero-inner {
    padding: 36px;
    background:
        radial-gradient(circle at 80% 0%, rgba(16, 185, 129, 0.24), transparent 30rem),
        linear-gradient(145deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.55));
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

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

.breadcrumb a {
    color: #67e8f9;
}

.detail-hero {
    padding: 34px 0 0;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.48fr) minmax(300px, 0.52fr);
    gap: 28px;
}

.player-panel,
.detail-side,
.content-panel {
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.player-frame {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #000000;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.player-frame video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #000000;
}

.play-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.66)),
        rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.play-layer.is-hidden {
    display: none;
}

.player-button {
    min-width: 150px;
    min-height: 52px;
    font-size: 18px;
}

.player-info {
    padding: 24px;
}

.detail-title h1 {
    font-size: clamp(30px, 4vw, 48px);
}

.hero-meta,
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0;
}

.detail-side {
    padding: 20px;
}

.detail-poster {
    overflow: hidden;
    aspect-ratio: 3 / 4;
    background: #111827;
    border-radius: 22px;
}

.detail-side h2,
.content-panel h2 {
    margin: 22px 0 12px;
    color: #ffffff;
}

.detail-side p,
.content-panel p {
    color: #cbd5e1;
    line-height: 1.85;
}

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

.content-panel {
    padding: 28px;
}

.content-panel h2:first-child {
    margin-top: 0;
}

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

.related-card {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 13px;
    align-items: center;
    padding: 10px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid var(--line);
    border-radius: 16px;
}

.related-card img {
    aspect-ratio: 16 / 10;
    border-radius: 12px;
    background: #111827;
}

.related-card strong {
    display: block;
    color: #ffffff;
    line-height: 1.35;
}

.related-card span {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
}

.search-empty {
    display: none;
    padding: 26px;
    color: var(--muted);
    text-align: center;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid var(--line);
    border-radius: 18px;
}

.load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 26px;
}

.site-footer {
    margin-top: 70px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.7), rgba(2, 6, 23, 0.96));
    border-top: 1px solid var(--line);
}

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

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

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

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

.footer-grid a:hover {
    color: #5eead4;
}

.footer-bottom {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0 28px;
    color: var(--dim);
    border-top: 1px solid var(--line);
}

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

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

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

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

    .menu-button {
        display: block;
        margin-left: auto;
    }

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

    .hero-content {
        bottom: 76px;
    }

    .hero-arrow {
        width: 42px;
        height: 42px;
    }

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

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

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

@media (max-width: 560px) {
    .nav-shell,
    .main-shell,
    .page-shell,
    .footer-grid,
    .footer-bottom,
    .mobile-panel {
        width: min(100% - 22px, 1200px);
    }

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

    .hero {
        min-height: 590px;
    }

    .hero-arrow {
        display: none;
    }

    .hero-actions,
    .quick-search {
        display: grid;
        grid-template-columns: 1fr;
        border-radius: 22px;
    }

    .movie-grid,
    .category-grid,
    .mini-grid {
        grid-template-columns: 1fr;
    }

    .section-card,
    .page-hero-inner,
    .content-panel {
        padding: 22px;
    }

    .rank-item {
        grid-template-columns: 36px 62px 1fr;
    }

    .mini-card,
    .related-card {
        grid-template-columns: 86px 1fr;
    }
}
