:root {
    color-scheme: dark;
    --dark: #0a0e1a;
    --dark-soft: #111827;
    --panel: rgba(15, 23, 42, 0.72);
    --panel-strong: rgba(15, 23, 42, 0.94);
    --primary: #38bdf8;
    --primary-deep: #0284c7;
    --text: #f8fafc;
    --muted: #94a3b8;
    --muted-strong: #cbd5e1;
    --line: rgba(56, 189, 248, 0.18);
    --shadow: 0 24px 80px rgba(2, 8, 23, 0.45);
}

* {
    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, sans-serif;
    background:
        radial-gradient(circle at 18% 4%, rgba(14, 165, 233, 0.22), transparent 34rem),
        radial-gradient(circle at 86% 8%, rgba(59, 130, 246, 0.18), transparent 30rem),
        linear-gradient(180deg, #0a0e1a 0%, #0f172a 52%, #0a0e1a 100%);
    color: var(--text);
}

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

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

button,
input {
    font: inherit;
}

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

.header-inner {
    width: min(1240px, calc(100% - 32px));
    height: 76px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 22px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: max-content;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-deep));
    box-shadow: 0 14px 34px rgba(14, 165, 233, 0.34);
    color: #00111d;
    font-weight: 900;
}

.brand-text {
    display: grid;
    line-height: 1.15;
}

.brand-text strong {
    font-size: 1.28rem;
    letter-spacing: 0.02em;
}

.brand-text em {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.78rem;
    font-style: normal;
}

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

.nav-link {
    padding: 9px 13px;
    border-radius: 999px;
    color: var(--muted-strong);
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #e0f2fe;
    background: rgba(14, 165, 233, 0.16);
}

.header-search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 280px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.76);
}

.header-search input {
    width: 100%;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
    padding: 8px 10px 8px 14px;
}

.header-search input::placeholder {
    color: #64748b;
}

.header-search button,
.btn-primary,
.btn-ghost,
.filter-button,
.play-overlay,
.rank-link {
    cursor: pointer;
    border: 0;
}

.header-search button {
    padding: 8px 14px;
    border-radius: 999px;
    color: #03111d;
    background: var(--primary);
    font-weight: 700;
}

.menu-button {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--text);
    background: rgba(15, 23, 42, 0.86);
}

.mobile-panel {
    display: none;
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto 14px;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.mobile-panel.open {
    display: grid;
}

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

.page {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0 64px;
}

.hero {
    position: relative;
    min-height: 680px;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
    background: #06101d;
}

.hero-stage {
    position: absolute;
    inset: 0;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(1.02);
    transition: opacity 0.8s ease, transform 1.1s ease;
}

.hero-slide.active {
    opacity: 1;
    transform: scale(1);
}

.hero-slide img {
    height: 100%;
    filter: saturate(1.1) contrast(1.05);
}

.hero-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(10, 14, 26, 0.94) 0%, rgba(10, 14, 26, 0.72) 38%, rgba(10, 14, 26, 0.26) 100%),
        linear-gradient(180deg, rgba(10, 14, 26, 0.2) 0%, #0a0e1a 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(1240px, calc(100% - 32px));
    min-height: 680px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 430px;
    align-items: center;
    gap: 54px;
    padding-top: 46px;
}

.hero-kicker,
.section-kicker,
.breadcrumb {
    color: var(--primary);
    letter-spacing: 0.12em;
    font-size: 0.83rem;
    font-weight: 800;
    text-transform: uppercase;
}

.hero h1 {
    margin: 16px 0 18px;
    max-width: 780px;
    font-size: clamp(2.5rem, 6vw, 5.6rem);
    line-height: 0.98;
    letter-spacing: -0.06em;
}

.hero p {
    max-width: 720px;
    margin: 0 0 24px;
    color: var(--muted-strong);
    font-size: 1.1rem;
    line-height: 1.9;
}

.hero-actions,
.section-actions,
.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

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

.btn-primary {
    color: #04111f;
    background: linear-gradient(135deg, var(--primary), #7dd3fc);
    box-shadow: 0 18px 38px rgba(14, 165, 233, 0.28);
}

.btn-ghost {
    color: #e2e8f0;
    border: 1px solid var(--line);
    background: rgba(15, 23, 42, 0.72);
}

.btn-primary:hover,
.btn-ghost:hover,
.movie-card:hover,
.category-card:hover,
.rank-item:hover {
    transform: translateY(-3px);
}

.hero-panel {
    border: 1px solid var(--line);
    border-radius: 28px;
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.hero-panel img {
    aspect-ratio: 16 / 10;
}

.hero-panel-body {
    padding: 22px;
}

.hero-panel-body h2 {
    margin: 0 0 8px;
    font-size: 1.55rem;
}

.hero-panel-body p {
    margin: 0 0 16px;
    font-size: 0.96rem;
    line-height: 1.7;
}

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

.hero-dot {
    width: 36px;
    height: 5px;
    border: 0;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.34);
}

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

.section {
    margin-top: 48px;
}

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

.section-head h2,
.page-title h1,
.detail-title h1 {
    margin: 7px 0 0;
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.section-head p,
.page-title p,
.detail-title p,
.category-intro p {
    margin: 10px 0 0;
    max-width: 780px;
    color: var(--muted);
    line-height: 1.85;
}

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

.movie-card,
.category-card,
.rank-item,
.detail-panel,
.player-section,
.search-panel {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.58);
    box-shadow: 0 16px 44px rgba(2, 8, 23, 0.24);
}

.movie-card {
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.movie-card:hover {
    border-color: rgba(56, 189, 248, 0.45);
}

.poster {
    position: relative;
    display: block;
    overflow: hidden;
    background: linear-gradient(135deg, #0f172a, #111827);
}

.poster img {
    aspect-ratio: 2 / 3;
    transition: transform 0.36s ease;
}

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

.poster::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 44%;
    background: linear-gradient(180deg, transparent, rgba(10, 14, 26, 0.92));
}

.poster-badge {
    position: absolute;
    right: 10px;
    top: 10px;
    z-index: 2;
    padding: 5px 9px;
    border-radius: 999px;
    color: #e0f2fe;
    background: rgba(2, 132, 199, 0.86);
    font-size: 0.78rem;
    font-weight: 800;
}

.card-body {
    padding: 15px;
}

.card-title {
    display: block;
    color: #fff;
    font-size: 1.08rem;
    font-weight: 850;
    line-height: 1.35;
}

.card-meta {
    margin-top: 8px;
    color: var(--primary);
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-body p {
    display: -webkit-box;
    min-height: 3.2em;
    margin: 9px 0 12px;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.62;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

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

.tag-row span,
.detail-tags span,
.filter-button {
    border: 1px solid rgba(56, 189, 248, 0.16);
    border-radius: 999px;
    color: #bae6fd;
    background: rgba(14, 165, 233, 0.1);
    font-size: 0.78rem;
}

.tag-row span {
    padding: 4px 8px;
}

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

.category-card {
    display: block;
    padding: 22px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-card:hover {
    border-color: rgba(56, 189, 248, 0.45);
}

.category-card strong {
    display: block;
    font-size: 1.2rem;
}

.category-card span {
    display: block;
    margin-top: 9px;
    color: var(--muted);
    line-height: 1.65;
}

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

.rank-item {
    display: grid;
    grid-template-columns: 70px 76px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 12px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.rank-num {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 18px;
    color: #03111d;
    background: linear-gradient(135deg, var(--primary), #7dd3fc);
    font-size: 1.2rem;
    font-weight: 900;
}

.rank-thumb img {
    aspect-ratio: 2 / 3;
    border-radius: 14px;
}

.rank-info h3 {
    margin: 0 0 6px;
    font-size: 1.1rem;
}

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

.rank-link {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    color: #03111d;
    background: var(--primary);
    font-weight: 800;
}

.page-title,
.category-intro,
.search-panel {
    margin: 24px 0 28px;
}

.category-intro,
.search-panel {
    padding: 26px;
}

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

.filter-button {
    padding: 9px 13px;
}

.filter-button.active {
    color: #03111d;
    background: var(--primary);
}

.search-panel {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
}

.search-panel input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    outline: 0;
    padding: 14px 16px;
    color: var(--text);
    background: rgba(2, 6, 23, 0.34);
}

.search-panel button {
    border: 0;
    border-radius: 16px;
    padding: 0 22px;
    color: #03111d;
    background: var(--primary);
    font-weight: 850;
}

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

.detail-cover {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.detail-cover img {
    aspect-ratio: 2 / 3;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    letter-spacing: 0.02em;
    text-transform: none;
}

.detail-title h1 {
    font-size: clamp(2.2rem, 5vw, 4.6rem);
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0;
    color: var(--muted-strong);
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.detail-tags span {
    padding: 6px 10px;
}

.player-section {
    margin-top: 42px;
    overflow: hidden;
}

.player-frame {
    position: relative;
    background: #020617;
}

.player-frame video {
    display: block;
    width: 100%;
    min-height: 360px;
    max-height: 72vh;
    background: #020617;
}

.play-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    gap: 12px;
    color: #fff;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.08), rgba(2, 6, 23, 0.62));
}

.play-overlay.hidden {
    display: none;
}

.play-overlay span {
    display: grid;
    place-items: center;
    width: 86px;
    height: 86px;
    border-radius: 50%;
    color: #03111d;
    background: var(--primary);
    box-shadow: 0 22px 60px rgba(14, 165, 233, 0.36);
    font-size: 2.1rem;
    font-weight: 900;
}

.player-caption {
    padding: 18px 22px;
    color: var(--muted-strong);
}

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

.detail-panel {
    padding: 24px;
}

.detail-panel h2 {
    margin: 0 0 14px;
    font-size: 1.5rem;
}

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

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

.related-list a {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 8px;
    border-radius: 16px;
    background: rgba(2, 6, 23, 0.22);
}

.related-list img {
    aspect-ratio: 2 / 3;
    border-radius: 12px;
}

.related-list strong {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-list span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.85rem;
}

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

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

.footer-brand {
    font-size: 1.4rem;
    font-weight: 900;
}

.site-footer p {
    color: var(--muted);
    line-height: 1.8;
}

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

.footer-links {
    display: grid;
    gap: 9px;
    color: var(--muted-strong);
}

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

.footer-bottom {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0 28px;
    color: #64748b;
    border-top: 1px solid rgba(56, 189, 248, 0.11);
}

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

    .hero-content {
        grid-template-columns: 1fr;
        padding: 120px 0 80px;
    }

    .hero-panel {
        max-width: 520px;
    }

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

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

    .detail-cover {
        max-width: 340px;
    }
}

@media (max-width: 760px) {
    .header-inner {
        height: 68px;
    }

    .main-nav {
        display: none;
    }

    .menu-button {
        display: grid;
        place-items: center;
        margin-left: auto;
    }

    .brand-text em {
        display: none;
    }

    .hero,
    .hero-content {
        min-height: 620px;
    }

    .hero-content {
        gap: 24px;
        padding-top: 88px;
    }

    .section-head {
        display: block;
    }

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

    .card-body {
        padding: 12px;
    }

    .rank-item {
        grid-template-columns: 50px 58px minmax(0, 1fr);
    }

    .rank-link {
        display: none;
    }

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

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

    .player-frame video {
        min-height: 240px;
    }
}

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

    .mobile-panel {
        grid-template-columns: repeat(2, 1fr);
    }
}
