:root {
    color-scheme: dark;
    --bg: #0f172a;
    --bg-soft: #1e293b;
    --bg-card: rgba(30, 41, 59, 0.82);
    --bg-card-strong: #1e293b;
    --line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #cbd5e1;
    --soft: #94a3b8;
    --cyan: #22d3ee;
    --cyan-deep: #0891b2;
    --orange: #f97316;
    --green: #22c55e;
    --yellow: #facc15;
    --shadow: 0 28px 80px rgba(2, 6, 23, 0.42);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(34, 211, 238, 0.14), transparent 34rem),
        linear-gradient(180deg, #0f172a 0%, #172033 46%, #0f172a 100%);
}

body::selection {
    background: rgba(34, 211, 238, 0.35);
}

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

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

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(15, 23, 42, 0.92);
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: 0 16px 48px rgba(2, 6, 23, 0.28);
    backdrop-filter: blur(18px);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 68px;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.logo-mark {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: #ffffff;
    background: linear-gradient(135deg, var(--cyan), var(--cyan-deep));
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(34, 211, 238, 0.28);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1 1 auto;
    font-size: 14px;
    color: var(--muted);
}

.site-nav a {
    padding: 8px 0;
    transition: color 0.2s ease;
}

.site-nav a:hover,
.site-nav a.active {
    color: var(--cyan);
}

.nav-divider {
    width: 1px;
    height: 18px;
    background: var(--line);
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--text);
    background: rgba(30, 41, 59, 0.82);
}

.top-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 290px;
}

.top-search input,
.filter-panel input,
.filter-panel select {
    width: 100%;
    height: 42px;
    color: var(--text);
    background: rgba(15, 23, 42, 0.86);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 12px;
    outline: none;
    padding: 0 14px;
}

.top-search input:focus,
.filter-panel input:focus,
.filter-panel select:focus {
    border-color: rgba(34, 211, 238, 0.72);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

.top-search button,
.primary-btn,
.ghost-btn,
.section-more,
.category-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    white-space: nowrap;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.top-search button,
.primary-btn {
    color: #ffffff;
    background: linear-gradient(135deg, var(--cyan), var(--cyan-deep));
    padding: 0 18px;
    box-shadow: 0 18px 36px rgba(8, 145, 178, 0.28);
}

.primary-btn {
    min-height: 50px;
    padding: 0 26px;
}

.ghost-btn,
.section-more,
.category-link {
    color: var(--cyan);
    background: rgba(15, 23, 42, 0.44);
    border: 1px solid rgba(34, 211, 238, 0.35);
    padding: 0 18px;
}

.top-search button:hover,
.primary-btn:hover,
.ghost-btn:hover,
.section-more:hover,
.category-link:hover {
    transform: translateY(-1px);
}

.hero {
    position: relative;
    height: 70vh;
    min-height: 520px;
    overflow: hidden;
    background: #0f172a;
}

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

.hero-slide.active {
    opacity: 1;
    z-index: 1;
}

.hero-slide > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.035);
    filter: saturate(1.08) contrast(1.02);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(15, 23, 42, 0.98) 0%, rgba(15, 23, 42, 0.78) 48%, rgba(15, 23, 42, 0.34) 100%),
        linear-gradient(0deg, #0f172a 0%, rgba(15, 23, 42, 0.14) 45%, rgba(15, 23, 42, 0.38) 100%);
}

.hero-content {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
}

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

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--cyan);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.hero h1,
.page-hero h1,
.detail-info h1 {
    margin: 0 0 18px;
    font-size: clamp(38px, 6vw, 72px);
    line-height: 1.02;
    letter-spacing: -0.06em;
}

.hero p {
    max-width: 680px;
    margin: 0 0 24px;
    color: var(--muted);
    font-size: clamp(18px, 2vw, 22px);
    line-height: 1.72;
}

.hero-meta,
.detail-meta,
.card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    color: var(--muted);
}

.hero-meta span,
.detail-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border-radius: 999px;
    padding: 0 12px;
    background: rgba(30, 41, 59, 0.74);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.hero-tags,
.detail-tags,
.tag-row,
.genre-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.hero-tags span,
.detail-tags span,
.tag-row span,
.genre-row span {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    color: #bff7ff;
    background: rgba(8, 145, 178, 0.22);
    border: 1px solid rgba(34, 211, 238, 0.24);
    padding: 0 10px;
    font-size: 12px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 4;
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    transform: translateY(-50%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    color: #ffffff;
    background: rgba(2, 6, 23, 0.48);
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

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

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

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

.hero-dot {
    width: 10px;
    height: 10px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.52);
    cursor: pointer;
    transition: width 0.2s ease, background 0.2s ease;
}

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

.content-section,
.page-main {
    padding: 58px 0;
}

.content-section + .content-section {
    padding-top: 12px;
}

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

.section-heading.single {
    align-items: flex-start;
}

.section-heading h2,
.detail-content h2 {
    margin: 0 0 8px;
    font-size: clamp(26px, 3vw, 36px);
    font-weight: 850;
    letter-spacing: -0.04em;
}

.section-heading p,
.page-hero p,
.detail-content p,
.category-card p,
.footer-grid p,
.rank-info p,
.detail-one-line {
    color: var(--muted);
    line-height: 1.75;
}

.movie-grid {
    display: grid;
    gap: 20px;
}

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

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

.movie-card {
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 18px 48px rgba(2, 6, 23, 0.18);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
    transform: translateY(-4px);
    border-color: rgba(34, 211, 238, 0.5);
    box-shadow: 0 26px 68px rgba(2, 6, 23, 0.36);
}

.card-poster {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: linear-gradient(135deg, #111827, #1e293b);
}

.movie-card.large .card-poster {
    aspect-ratio: 16 / 10;
}

.card-poster img,
.rank-poster img,
.detail-poster img,
.player-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-poster img {
    transition: transform 0.35s ease;
}

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

.card-badge,
.card-score,
.rank-number {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
}

.card-badge {
    left: 10px;
    top: 10px;
    min-height: 26px;
    padding: 0 10px;
    background: rgba(8, 145, 178, 0.88);
}

.card-score {
    right: 10px;
    top: 10px;
    min-width: 38px;
    height: 26px;
    color: #111827;
    background: var(--yellow);
}

.card-body {
    padding: 16px;
}

.movie-card.compact .card-body {
    padding: 13px;
}

.card-body h3,
.rank-info h3 {
    margin: 0 0 10px;
    font-size: 17px;
    line-height: 1.35;
}

.card-body h3 a:hover,
.rank-info h3 a:hover {
    color: var(--cyan);
}

.card-body p {
    display: -webkit-box;
    min-height: 46px;
    margin: 0 0 12px;
    overflow: hidden;
    color: var(--soft);
    font-size: 13px;
    line-height: 1.7;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-meta {
    gap: 8px;
    font-size: 12px;
    color: var(--soft);
}

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

.category-panel {
    border: 1px solid rgba(34, 211, 238, 0.18);
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.18), rgba(8, 145, 178, 0.14));
    padding: 34px;
}

.category-stack {
    display: grid;
    gap: 34px;
}

.category-strip {
    display: grid;
    gap: 16px;
}

.strip-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.strip-title h3 {
    margin: 0;
    font-size: 22px;
}

.strip-title a {
    color: var(--cyan);
    font-weight: 700;
}

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

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

.rank-item {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 16px;
    padding: 12px;
}

.rank-poster {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 14px;
    background: #0f172a;
}

.rank-number {
    left: 8px;
    top: 8px;
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--orange), var(--yellow));
    color: #111827;
    box-shadow: 0 12px 24px rgba(249, 115, 22, 0.35);
}

.rank-info {
    align-self: center;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 22px;
    color: var(--soft);
    font-size: 14px;
}

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

.breadcrumb span::before,
.breadcrumb a + a::before,
.breadcrumb a + span::before {
    content: "/";
    margin-right: 9px;
    color: rgba(148, 163, 184, 0.48);
}

.page-hero.small {
    margin-bottom: 34px;
    padding: 42px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background:
        radial-gradient(circle at 78% 20%, rgba(34, 211, 238, 0.2), transparent 28rem),
        linear-gradient(135deg, rgba(30, 41, 59, 0.86), rgba(15, 23, 42, 0.88));
    box-shadow: var(--shadow);
}

.page-hero.small h1 {
    font-size: clamp(36px, 5vw, 58px);
}

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

.category-card {
    min-height: 230px;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.86), rgba(15, 23, 42, 0.76));
    transition: transform 0.22s ease, border-color 0.22s ease;
}

.category-card:hover {
    transform: translateY(-4px);
    border-color: rgba(34, 211, 238, 0.45);
}

.category-icon {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 16px;
    background: rgba(34, 211, 238, 0.15);
    color: var(--cyan);
}

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

.filter-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px 180px;
    gap: 12px;
    margin-bottom: 26px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(30, 41, 59, 0.55);
}

.empty-state {
    display: none;
    margin-bottom: 22px;
    padding: 18px;
    border: 1px solid rgba(34, 211, 238, 0.28);
    border-radius: 16px;
    color: var(--muted);
    background: rgba(8, 145, 178, 0.12);
}

.empty-state.show {
    display: block;
}

.detail-hero {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 34px;
    align-items: center;
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 30px;
    background:
        radial-gradient(circle at 80% 0%, rgba(34, 211, 238, 0.18), transparent 34rem),
        linear-gradient(135deg, rgba(30, 41, 59, 0.88), rgba(15, 23, 42, 0.78));
    box-shadow: var(--shadow);
}

.detail-poster {
    overflow: hidden;
    aspect-ratio: 2 / 3;
    border-radius: 24px;
    background: #111827;
    box-shadow: 0 26px 70px rgba(2, 6, 23, 0.48);
}

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

.detail-one-line {
    max-width: 760px;
    margin: 0 0 22px;
    font-size: 18px;
}

.detail-tags {
    margin-bottom: 26px;
}

.player-section,
.detail-content,
.related-section {
    margin-top: 42px;
}

.watch-player {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border: 1px solid rgba(34, 211, 238, 0.22);
    border-radius: 26px;
    background: #020617;
    box-shadow: var(--shadow);
}

.player-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #020617;
}

.player-cover {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    border: 0;
    color: #ffffff;
    background: transparent;
    cursor: pointer;
}

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

.player-cover img,
.player-shade {
    position: absolute;
    inset: 0;
}

.player-cover img {
    z-index: 1;
    filter: brightness(0.58) saturate(1.05);
}

.player-shade {
    z-index: 2;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.18), rgba(2, 6, 23, 0.54) 48%, rgba(2, 6, 23, 0.86) 100%);
}

.player-play {
    position: relative;
    z-index: 4;
    display: grid;
    width: 86px;
    height: 86px;
    place-items: center;
    border-radius: 50%;
    color: #ffffff;
    background: linear-gradient(135deg, var(--cyan), var(--cyan-deep));
    font-size: 34px;
    box-shadow: 0 24px 60px rgba(34, 211, 238, 0.35);
}

.player-title {
    position: relative;
    z-index: 4;
    font-size: 18px;
    font-weight: 800;
}

.detail-content {
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(30, 41, 59, 0.62);
}

.detail-content h2:not(:first-child) {
    margin-top: 30px;
}

.detail-content p {
    margin: 0;
    font-size: 17px;
}

.site-footer {
    margin-top: 70px;
    padding: 46px 0 24px;
    border-top: 1px solid var(--line);
    background: rgba(2, 6, 23, 0.44);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 34px;
}

.footer-logo {
    margin-bottom: 12px;
    font-size: 22px;
    font-weight: 850;
}

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

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    color: var(--muted);
}

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

.footer-bottom {
    margin-top: 34px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    color: var(--soft);
    text-align: center;
    font-size: 14px;
}

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

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

    .top-search {
        flex-basis: 230px;
    }
}

@media (max-width: 820px) {
    .header-inner {
        flex-wrap: wrap;
        padding: 12px 0;
    }

    .nav-toggle {
        display: inline-grid;
        place-items: center;
        margin-left: auto;
    }

    .site-nav {
        display: none;
        flex: 1 0 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 16px;
        background: rgba(15, 23, 42, 0.96);
    }

    .site-nav.open {
        display: flex;
    }

    .nav-divider {
        display: none;
    }

    .top-search {
        flex: 1 0 100%;
    }

    .hero {
        min-height: 620px;
    }

    .hero-overlay {
        background: linear-gradient(0deg, #0f172a 0%, rgba(15, 23, 42, 0.82) 58%, rgba(15, 23, 42, 0.46) 100%);
    }

    .hero-content {
        align-items: flex-end;
        padding-bottom: 82px;
    }

    .hero-arrow {
        display: none;
    }

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

    .category-panel,
    .page-hero.small,
    .detail-hero,
    .detail-content {
        padding: 24px;
    }

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

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

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

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

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

    .hero h1,
    .page-hero.small h1,
    .detail-info h1 {
        letter-spacing: -0.04em;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .movie-grid.four,
    .movie-grid.six,
    .rank-grid,
    .category-grid {
        grid-template-columns: 1fr;
    }

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

    .rank-info p {
        display: none;
    }

    .player-play {
        width: 68px;
        height: 68px;
        font-size: 28px;
    }
}
