:root {
    color-scheme: dark;
    --bg: #020617;
    --panel: #0f172a;
    --panel-soft: #111c33;
    --line: #1e293b;
    --text: #ffffff;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --blue: #2563eb;
    --blue-deep: #1d4ed8;
    --cyan: #06b6d4;
    --cyan-soft: rgba(6, 182, 212, 0.16);
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.36);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.2), transparent 34rem), var(--bg);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

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

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

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

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

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

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

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

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    box-shadow: 0 0 28px rgba(6, 182, 212, 0.36);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links a,
.mobile-panel a {
    border-radius: 999px;
    color: var(--soft);
    font-weight: 600;
    padding: 10px 14px;
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-links a:hover,
.nav-links a.is-active,
.mobile-panel a:hover,
.mobile-panel a.is-active {
    color: var(--text);
    background: rgba(37, 99, 235, 0.2);
}

.top-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border: 1px solid rgba(51, 65, 85, 0.8);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.8);
}

.top-search input,
.mobile-panel input,
.filter-input,
.filter-select {
    min-width: 0;
    border: 0;
    border-radius: 12px;
    outline: 0;
    color: var(--text);
    background: rgba(15, 23, 42, 0.92);
    padding: 10px 12px;
}

.top-search button,
.mobile-panel button,
.primary-btn,
.secondary-btn,
.filter-button {
    border: 0;
    border-radius: 12px;
    color: white;
    background: var(--blue);
    font-weight: 700;
    padding: 10px 16px;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.top-search button:hover,
.mobile-panel button:hover,
.primary-btn:hover,
.filter-button:hover {
    background: var(--blue-deep);
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.26);
}

.secondary-btn {
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.secondary-btn:hover {
    background: rgba(30, 41, 59, 0.95);
    transform: translateY(-1px);
}

.menu-toggle {
    display: none;
    border: 0;
    color: white;
    background: rgba(15, 23, 42, 0.96);
    border-radius: 12px;
    font-size: 24px;
    padding: 8px 12px;
}

.mobile-panel {
    display: none;
    padding: 0 16px 16px;
    border-top: 1px solid rgba(30, 41, 59, 0.8);
}

.mobile-panel form {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.hero-slider {
    position: relative;
    min-height: 640px;
    overflow: hidden;
    background: #050b18;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    background-position: center;
    background-size: cover;
    transform: scale(1.04);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.hero-slide::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.9), rgba(2, 6, 23, 0.62), rgba(2, 6, 23, 0.1));
}

.hero-slide::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 42%;
    background: linear-gradient(0deg, var(--bg), transparent);
}

.hero-content {
    position: relative;
    z-index: 2;
    min-height: 640px;
    display: flex;
    align-items: center;
}

.hero-copy {
    max-width: 720px;
    padding-top: 72px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.95);
    color: white;
    font-size: 14px;
    font-weight: 700;
    padding: 7px 12px;
}

.hero-copy h1,
.hero-copy h2,
.page-title h1,
.detail-copy h1 {
    margin: 0;
    color: white;
    font-size: clamp(36px, 6vw, 72px);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.hero-line {
    margin: 22px 0 8px;
    color: #e2e8f0;
    font-size: clamp(18px, 2vw, 24px);
    font-weight: 700;
}

.hero-summary {
    max-width: 680px;
    margin: 0;
    color: var(--soft);
    font-size: 16px;
    line-height: 1.8;
}

.hero-actions,
.detail-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: 28px;
}

.hero-dots {
    position: absolute;
    z-index: 5;
    left: 50%;
    bottom: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(-50%);
}

.hero-dot {
    width: 18px;
    height: 5px;
    border: 0;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.7);
    transition: width 0.2s ease, background 0.2s ease;
}

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

.hero-arrow {
    position: absolute;
    z-index: 5;
    top: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    color: white;
    background: rgba(0, 0, 0, 0.48);
    transform: translateY(-50%);
    transition: background 0.2s ease;
}

.hero-arrow:hover {
    background: rgba(0, 0, 0, 0.74);
}

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

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

.section,
.page-section {
    padding: 64px 0;
}

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

.section-head h2,
.page-title h1,
.detail-section h2 {
    margin: 0;
    font-size: clamp(26px, 4vw, 40px);
    letter-spacing: -0.03em;
}

.section-head p,
.page-title p,
.detail-section p,
.category-card p,
.card-body p,
.rank-info small,
.footer-grid p {
    color: var(--muted);
    line-height: 1.75;
}

.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.88);
    color: white;
    font-weight: 700;
    padding: 13px 18px;
    transition: background 0.2s ease, transform 0.2s ease, border 0.2s ease;
}

.category-pill:hover {
    border-color: rgba(37, 99, 235, 0.5);
    background: rgba(37, 99, 235, 0.72);
    transform: translateY(-2px);
}

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

.movie-card {
    min-width: 0;
}

.poster-link {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 16px;
    background: #111827;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

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

.poster-link::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.85), transparent 64%);
    transition: opacity 0.25s ease;
}

.movie-card:hover .poster-link img {
    transform: scale(1.08);
    filter: brightness(0.76);
}

.movie-card:hover .poster-link::after,
.movie-card:hover .play-badge {
    opacity: 1;
}

.play-badge {
    position: absolute;
    z-index: 2;
    left: 50%;
    top: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    color: white;
    background: rgba(37, 99, 235, 0.92);
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.2s ease, background 0.2s ease;
}

.card-type,
.card-year {
    position: absolute;
    z-index: 3;
    top: 10px;
    border-radius: 999px;
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 9px;
}

.card-type {
    left: 10px;
    background: var(--blue);
}

.card-year {
    right: 10px;
    background: rgba(0, 0, 0, 0.62);
}

.card-body {
    padding: 12px 2px 0;
}

.card-body h3 {
    margin: 0 0 6px;
    color: white;
    font-size: 16px;
    line-height: 1.35;
}

.card-body h3 a:hover {
    color: #60a5fa;
}

.card-body p {
    margin: 0;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 13px;
}

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

.rank-item {
    display: grid;
    grid-template-columns: 42px 58px 1fr;
    align-items: center;
    gap: 14px;
    min-width: 0;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.82);
    padding: 12px;
    transition: transform 0.2s ease, border 0.2s ease, background 0.2s ease;
}

.rank-item:hover {
    border-color: rgba(37, 99, 235, 0.45);
    background: rgba(15, 23, 42, 0.98);
    transform: translateY(-2px);
}

.rank-number {
    color: #38bdf8;
    font-size: 20px;
    font-weight: 900;
}

.rank-item img {
    width: 58px;
    height: 78px;
    border-radius: 10px;
    object-fit: cover;
}

.rank-info {
    min-width: 0;
}

.rank-info strong,
.rank-info small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.category-card {
    display: block;
    min-height: 210px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(15, 23, 42, 0.92));
    padding: 26px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, border 0.2s ease;
}

.category-card:hover {
    border-color: rgba(6, 182, 212, 0.46);
    transform: translateY(-4px);
}

.category-card h2 {
    margin: 0 0 12px;
    font-size: 24px;
}

.category-card p {
    margin: 0 0 22px;
}

.category-card span {
    color: #67e8f9;
    font-weight: 800;
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 170px 150px;
    gap: 12px;
    margin: 26px 0 30px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.78);
    padding: 12px;
}

.filter-select {
    border: 1px solid rgba(51, 65, 85, 0.8);
}

.empty-result {
    display: none;
    border: 1px dashed rgba(148, 163, 184, 0.28);
    border-radius: 16px;
    color: var(--muted);
    padding: 28px;
    text-align: center;
}

.detail-hero {
    position: relative;
    overflow: hidden;
    background-position: center;
    background-size: cover;
}

.detail-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(2, 6, 23, 0.95), rgba(2, 6, 23, 0.72), rgba(2, 6, 23, 0.35));
}

.detail-hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 35%;
    background: linear-gradient(0deg, var(--bg), transparent);
}

.detail-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 42px;
    align-items: center;
    min-height: 560px;
    padding: 72px 0;
}

.detail-poster {
    overflow: hidden;
    border-radius: 22px;
    background: #111827;
    box-shadow: var(--shadow);
}

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

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

.breadcrumb a:hover {
    color: #67e8f9;
}

.detail-copy h1 {
    font-size: clamp(34px, 5vw, 60px);
}

.detail-one-line {
    margin: 18px 0 0;
    color: #e2e8f0;
    font-size: 20px;
    line-height: 1.65;
}

.meta-chips,
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.meta-chips span,
.tag-list span {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #e2e8f0;
    font-weight: 700;
    padding: 8px 12px;
}

.player-wrap {
    margin-top: -36px;
    position: relative;
    z-index: 3;
}

.player-shell {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 24px;
    background: #000000;
    box-shadow: var(--shadow);
    aspect-ratio: 16 / 9;
}

.player-shell video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000000;
}

.player-cover {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    color: white;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.28), rgba(0, 0, 0, 0.62));
    transition: opacity 0.22s ease;
}

.player-cover.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.play-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    font-size: 38px;
    box-shadow: 0 16px 40px rgba(37, 99, 235, 0.38);
}

.detail-section {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 36px;
    padding: 42px 0 72px;
}

.detail-panel {
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.78);
    padding: 28px;
}

.detail-panel + .detail-panel {
    margin-top: 22px;
}

.detail-panel h2,
.side-panel h2 {
    margin: 0 0 16px;
    font-size: 26px;
}

.detail-panel p {
    margin: 0;
    font-size: 16px;
}

.side-panel {
    position: sticky;
    top: 92px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.78);
    padding: 18px;
}

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

.related-list .rank-item {
    grid-template-columns: 54px 1fr;
}

.related-list .rank-number {
    display: none;
}

.related-list img {
    width: 54px;
    height: 72px;
}

.site-footer {
    border-top: 1px solid rgba(30, 41, 59, 0.8);
    background: rgba(2, 6, 23, 0.92);
    padding-top: 44px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr 1fr;
    gap: 36px;
}

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

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

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

.footer-links a:hover {
    color: #67e8f9;
}

.footer-bottom {
    margin-top: 38px;
    border-top: 1px solid rgba(30, 41, 59, 0.8);
    color: var(--muted);
    padding: 22px;
    text-align: center;
}

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

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

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

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

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

    .side-panel {
        position: static;
    }
}

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

    .menu-toggle {
        display: inline-flex;
    }

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

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

    .hero-arrow {
        display: none;
    }

    .section,
    .page-section {
        padding: 42px 0;
    }

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

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

    .rank-grid,
    .category-grid,
    .footer-grid,
    .filter-bar {
        grid-template-columns: 1fr;
    }

    .detail-grid {
        min-height: auto;
        padding: 42px 0 80px;
    }

    .play-circle {
        width: 72px;
        height: 72px;
        font-size: 30px;
    }
}

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

    .brand {
        font-size: 18px;
    }

    .hero-copy h1,
    .hero-copy h2 {
        font-size: 34px;
    }

    .movie-grid {
        gap: 14px;
    }

    .card-body h3 {
        font-size: 14px;
    }
}
