:root {
    color-scheme: dark;
    --bg: #020617;
    --bg-soft: #0f172a;
    --panel: rgba(30, 41, 59, 0.64);
    --panel-strong: rgba(15, 23, 42, 0.86);
    --line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --cyan: #06b6d4;
    --cyan-bright: #22d3ee;
    --orange: #f97316;
    --pink: #ec4899;
    --green: #22c55e;
    --radius: 20px;
    --shadow: 0 24px 70px rgba(2, 6, 23, 0.46);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(8, 145, 178, 0.22), transparent 32rem),
        radial-gradient(circle at top right, rgba(249, 115, 22, 0.14), transparent 34rem),
        linear-gradient(180deg, #020617 0%, #0f172a 45%, #020617 100%);
}

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

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

button,
input {
    font: inherit;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 80;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(8, 47, 73, 0.94), rgba(15, 23, 42, 0.96));
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 12px 36px rgba(2, 6, 23, 0.3);
    backdrop-filter: blur(16px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    min-height: 68px;
}

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

.brand-mark {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--cyan), #0284c7);
    box-shadow: 0 12px 30px rgba(6, 182, 212, 0.24);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.brand-text strong {
    font-size: 18px;
    letter-spacing: 0.02em;
}

.brand-text small {
    margin-top: 4px;
    color: var(--cyan-bright);
    font-size: 12px;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 18px;
}

.nav-link,
.mobile-link {
    color: #e2e8f0;
    font-weight: 600;
    transition: color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active,
.mobile-link:hover,
.mobile-link.active {
    color: var(--cyan-bright);
}

.nav-link:hover {
    transform: translateY(-1px);
}

.header-search,
.mobile-search {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-search input,
.mobile-search input,
.filter-search input,
.search-hero input {
    width: 220px;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    outline: none;
    padding: 10px 14px;
    transition: border-color 0.2s ease, background 0.2s ease, width 0.2s ease;
}

.header-search input:focus {
    width: 280px;
}

.header-search input:focus,
.mobile-search input:focus,
.filter-search input:focus,
.search-hero input:focus {
    border-color: var(--cyan-bright);
    background: rgba(255, 255, 255, 0.13);
}

.header-search button,
.mobile-search button,
.search-hero button,
.btn-primary,
.btn-secondary,
.section-link,
.sort-button {
    border: 0;
    border-radius: 12px;
    padding: 10px 16px;
    font-weight: 700;
    cursor: pointer;
}

.header-search button,
.mobile-search button,
.search-hero button,
.btn-primary {
    color: white;
    background: linear-gradient(135deg, var(--cyan), #0284c7);
    box-shadow: 0 14px 28px rgba(6, 182, 212, 0.22);
}

.btn-secondary,
.section-link {
    color: #e0f2fe;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.menu-toggle {
    display: none;
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    padding: 9px 12px;
}

.mobile-panel {
    display: none;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 0 0 16px;
}

.mobile-panel.open {
    display: grid;
    gap: 12px;
}

.mobile-search input {
    width: 100%;
}

main {
    min-height: 70vh;
}

.hero-carousel {
    position: relative;
    min-height: 640px;
    overflow: hidden;
    border-bottom: 1px solid rgba(148, 163, 184, 0.13);
}

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

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

.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.08) contrast(1.04);
    transform: scale(1.02);
}

.hero-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.72) 44%, rgba(2, 6, 23, 0.38) 72%, rgba(2, 6, 23, 0.88) 100%),
        radial-gradient(circle at 20% 20%, rgba(34, 211, 238, 0.2), transparent 34rem),
        radial-gradient(circle at 85% 75%, rgba(249, 115, 22, 0.18), transparent 30rem);
}

.hero-inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.55fr);
    align-items: center;
    gap: 52px;
    min-height: 640px;
    padding: 70px 0 82px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--cyan-bright);
    background: rgba(8, 145, 178, 0.18);
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: 999px;
    padding: 8px 14px;
    margin-bottom: 18px;
    font-weight: 700;
}

.hero-copy h1,
.hero-copy h2 {
    margin: 0 0 18px;
    font-size: clamp(36px, 6vw, 68px);
    line-height: 1.02;
    letter-spacing: -0.04em;
}

.hero-copy p {
    max-width: 730px;
    margin: 0 0 22px;
    color: #cbd5e1;
    font-size: 18px;
    line-height: 1.8;
}

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

.hero-tags span,
.tag-row span,
.detail-tags span {
    color: #dff7ff;
    background: rgba(15, 118, 110, 0.28);
    border: 1px solid rgba(45, 212, 191, 0.18);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 13px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 28px 0 0;
}

.hero-poster {
    position: relative;
    display: block;
    border-radius: 30px;
    overflow: hidden;
    min-height: 470px;
    background: rgba(15, 23, 42, 0.64);
    box-shadow: var(--shadow);
    transform: rotate(1.4deg);
}

.hero-poster img {
    width: 100%;
    height: 100%;
    min-height: 470px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.hero-poster:hover img {
    transform: scale(1.05);
}

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

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

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

.hero-dot.active {
    width: 36px;
    background: var(--cyan-bright);
}

.section {
    padding: 54px 0 0;
}

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

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

.section-heading p,
.page-title p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

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

.category-tile {
    min-height: 156px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at top right, rgba(34, 211, 238, 0.16), transparent 10rem),
        rgba(30, 41, 59, 0.62);
    box-shadow: 0 16px 45px rgba(2, 6, 23, 0.2);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.category-tile:hover {
    transform: translateY(-4px);
    border-color: rgba(34, 211, 238, 0.38);
    background: rgba(30, 41, 59, 0.82);
}

.category-tile strong {
    display: block;
    margin-bottom: 10px;
    font-size: 20px;
}

.category-tile p {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
    font-size: 14px;
}

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

.movie-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: 0 16px 38px rgba(2, 6, 23, 0.22);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.movie-card:hover {
    transform: translateY(-5px);
    border-color: rgba(34, 211, 238, 0.34);
    background: rgba(30, 41, 59, 0.84);
}

.movie-poster {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(8, 47, 73, 0.72), rgba(15, 23, 42, 0.92));
}

.movie-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

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

.year-pill,
.rank-badge {
    position: absolute;
    z-index: 2;
    color: white;
    background: rgba(2, 6, 23, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 700;
}

.year-pill {
    right: 10px;
    bottom: 10px;
}

.rank-badge {
    left: 10px;
    top: 10px;
    background: linear-gradient(135deg, var(--orange), #dc2626);
}

.movie-info {
    padding: 16px;
}

.movie-title {
    display: block;
    color: #fff;
    font-weight: 800;
    font-size: 17px;
    line-height: 1.35;
    margin-bottom: 10px;
}

.movie-title:hover {
    color: var(--cyan-bright);
}

.movie-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 10px;
}

.movie-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.movie-info p,
.list-body p,
.detail-card p {
    margin: 0 0 12px;
    color: var(--soft);
    line-height: 1.65;
}

.rank-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
}

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

.list-card {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel);
}

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

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

.list-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: 800;
}

.list-rank {
    display: inline-grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 10px;
    color: white;
    background: linear-gradient(135deg, var(--orange), #dc2626);
    font-size: 14px;
}

.page-hero {
    padding: 58px 0 30px;
    background:
        radial-gradient(circle at 18% 20%, rgba(34, 211, 238, 0.2), transparent 28rem),
        linear-gradient(180deg, rgba(15, 23, 42, 0.7), transparent);
}

.page-title {
    max-width: 860px;
}

.filter-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px;
    margin: 0 0 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
}

.filter-search {
    flex: 1;
}

.filter-search input {
    width: min(100%, 520px);
}

.filter-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.sort-button {
    color: var(--soft);
    background: rgba(51, 65, 85, 0.68);
}

.sort-button.active,
.sort-button:hover {
    color: #fff;
    background: linear-gradient(135deg, var(--cyan), #0284c7);
}

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

.breadcrumbs a {
    color: var(--cyan-bright);
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
    align-items: start;
}

.player-card,
.detail-card,
.side-card,
.search-hero {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: 0 18px 46px rgba(2, 6, 23, 0.22);
}

.player-card {
    overflow: hidden;
}

.player-box {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
    cursor: pointer;
}

.player-box video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.play-button {
    position: absolute;
    left: 50%;
    top: 50%;
    display: grid;
    width: 82px;
    height: 82px;
    place-items: center;
    transform: translate(-50%, -50%);
    color: white;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--cyan), #0284c7);
    box-shadow: 0 18px 45px rgba(6, 182, 212, 0.34);
    cursor: pointer;
    z-index: 4;
}

.play-button span {
    margin-left: 5px;
    font-size: 32px;
}

.player-box.playing .play-button {
    opacity: 0;
    pointer-events: none;
}

.detail-card {
    padding: 24px;
    margin-top: 22px;
}

.detail-card h1 {
    margin: 0 0 16px;
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1.16;
}

.detail-card h2,
.side-card h2 {
    margin: 0 0 14px;
    font-size: 22px;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 0;
}

.info-table {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.info-table div {
    padding: 12px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.56);
    color: var(--soft);
}

.info-table strong {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 5px;
}

.side-card {
    position: sticky;
    top: 92px;
    padding: 18px;
}

.side-card .list-card {
    grid-template-columns: 112px minmax(0, 1fr);
    padding: 10px;
}

.side-card .list-top {
    font-size: 15px;
}

.side-card .movie-meta,
.side-card p {
    font-size: 12px;
}

.search-hero {
    padding: 24px;
    margin: 34px 0 24px;
}

.search-hero form {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.search-hero input {
    width: min(100%, 620px);
}

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

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr 0.8fr 1fr;
    gap: 28px;
    padding: 44px 0;
}

.footer-grid h3 {
    margin: 0 0 14px;
    color: var(--cyan-bright);
}

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

.footer-links {
    display: grid;
    gap: 10px;
}

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

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

.footer-bottom {
    padding: 18px 0;
    color: var(--muted);
    text-align: center;
    border-top: 1px solid var(--line);
}

.hidden-card {
    display: none !important;
}

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

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

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

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

    .side-card {
        position: static;
    }
}

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

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

    .hero-carousel,
    .hero-inner {
        min-height: 720px;
    }

    .hero-inner {
        grid-template-columns: 1fr;
        gap: 28px;
        padding-top: 42px;
    }

    .hero-poster,
    .hero-poster img {
        min-height: 280px;
    }

    .movie-grid,
    .category-grid,
    .footer-grid,
    .info-table {
        grid-template-columns: 1fr 1fr;
    }

    .filter-panel,
    .section-heading {
        align-items: stretch;
        flex-direction: column;
    }

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

@media (max-width: 560px) {
    .container {
        width: min(100% - 22px, 1180px);
    }

    .hero-copy p {
        font-size: 16px;
    }

    .movie-grid,
    .category-grid,
    .footer-grid,
    .info-table {
        grid-template-columns: 1fr;
    }

    .list-card,
    .side-card .list-card {
        grid-template-columns: 96px minmax(0, 1fr);
    }

    .search-hero form,
    .hero-actions {
        flex-direction: column;
    }

    .play-button {
        width: 66px;
        height: 66px;
    }
}
