:root {
    color-scheme: dark;
    --bg: #020617;
    --bg-soft: #0f172a;
    --panel: rgba(15, 23, 42, 0.78);
    --panel-strong: rgba(15, 23, 42, 0.94);
    --line: rgba(148, 163, 184, 0.18);
    --text: #e2e8f0;
    --muted: #94a3b8;
    --soft: #64748b;
    --cyan: #22d3ee;
    --blue: #3b82f6;
    --green: #22c55e;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 18% 0%, rgba(34, 211, 238, 0.15), transparent 32rem),
        radial-gradient(circle at 78% 18%, rgba(59, 130, 246, 0.14), transparent 30rem),
        linear-gradient(180deg, #020617 0%, #0f172a 46%, #020617 100%);
}

body.menu-open {
    overflow: hidden;
}

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

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

button,
input {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.nav-shell {
    width: min(1180px, calc(100% - 32px));
    height: 72px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.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-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 12px 30px rgba(34, 211, 238, 0.22);
}

.brand-text {
    font-size: 24px;
    background: linear-gradient(90deg, var(--cyan), #60a5fa);
    background-clip: text;
    color: transparent;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    color: #cbd5e1;
    font-size: 15px;
    white-space: nowrap;
}

.desktop-nav a,
.mobile-panel a,
.site-footer a {
    transition: color 0.22s ease;
}

.desktop-nav a:hover,
.mobile-panel a:hover,
.site-footer a:hover {
    color: var(--cyan);
}

.nav-search,
.mobile-search,
.page-search {
    display: flex;
    align-items: center;
    background: rgba(2, 6, 23, 0.72);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
}

.nav-search input,
.mobile-search input,
.page-search input {
    width: 220px;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
    padding: 11px 14px;
}

.nav-search button,
.mobile-search button,
.page-search button {
    border: 0;
    color: #ffffff;
    cursor: pointer;
    padding: 11px 16px;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
}

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

.menu-button span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    background: currentColor;
}

.mobile-panel {
    display: none;
    padding: 18px;
    border-top: 1px solid var(--line);
    background: rgba(15, 23, 42, 0.98);
}

.mobile-panel a {
    display: block;
    padding: 12px 4px;
    color: #cbd5e1;
}

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

.hero-track,
.hero-slide,
.hero-bg,
.hero-overlay {
    position: absolute;
    inset: 0;
}

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

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

.hero-bg img {
    transform: scale(1.04);
    filter: saturate(1.06) contrast(1.08);
}

.media-frame {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(34, 211, 238, 0.16), rgba(59, 130, 246, 0.08)),
        #0f172a;
}

.media-frame img.is-missing {
    opacity: 0;
}

.hero-overlay {
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.76) 42%, rgba(2, 6, 23, 0.24) 100%),
        linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.55) 38%, transparent 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(1180px, calc(100% - 32px));
    height: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 48px;
}

.hero-tags,
.card-tags,
.detail-tags,
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.hero-tags span,
.card-tags span,
.tag-cloud span {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(34, 211, 238, 0.36);
    border-radius: 999px;
    color: #67e8f9;
    background: rgba(34, 211, 238, 0.1);
}

.hero-tags span {
    padding: 7px 12px;
    font-size: 13px;
}

.hero-content h1 {
    max-width: 760px;
    margin: 22px 0 16px;
    color: #ffffff;
    font-size: clamp(40px, 7vw, 78px);
    line-height: 0.96;
    letter-spacing: -0.06em;
}

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

.hero-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.hero-keywords span {
    padding: 8px 12px;
    border-radius: 12px;
    color: #dbeafe;
    background: rgba(15, 23, 42, 0.76);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.hero-actions,
.detail-info .btn-primary {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.btn-primary,
.btn-ghost,
.btn-plain,
.section-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: 14px;
    padding: 0 20px;
    font-weight: 700;
    transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, color 0.22s ease;
}

.btn-primary {
    color: #ffffff;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 18px 36px rgba(34, 211, 238, 0.18);
}

.btn-ghost {
    color: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(15, 23, 42, 0.72);
}

.btn-plain,
.section-more {
    color: #67e8f9;
    background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.24);
}

.btn-primary:hover,
.btn-ghost:hover,
.btn-plain:hover,
.section-more:hover {
    transform: translateY(-2px);
}

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 5;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    color: #ffffff;
    background: rgba(2, 6, 23, 0.48);
    cursor: pointer;
    font-size: 34px;
    line-height: 1;
    transform: translateY(-50%);
}

.hero-prev {
    left: 24px;
}

.hero-next {
    right: 24px;
}

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

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

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

.content-section,
.text-page,
.detail-content,
.player-section {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.content-section {
    padding: 64px 0 0;
}

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

.section-head h2,
.text-page h2,
.detail-content h2 {
    margin: 0 0 8px;
    color: #ffffff;
    font-size: clamp(26px, 4vw, 36px);
    letter-spacing: -0.03em;
}

.section-head p,
.page-hero p,
.text-page p,
.detail-content p {
    margin: 0;
    color: var(--muted);
    line-height: 1.8;
}

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

.movie-card {
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.62);
    box-shadow: 0 16px 46px rgba(0, 0, 0, 0.18);
    transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(34, 211, 238, 0.5);
    box-shadow: 0 22px 58px rgba(34, 211, 238, 0.12);
}

.card-media {
    display: block;
    height: 210px;
}

.card-media img,
.category-tile img,
.ranking-media img,
.rank-thumb img,
.detail-poster img,
.player-cover img {
    transition: transform 0.45s ease, opacity 0.25s ease;
}

.movie-card:hover .card-media img,
.category-tile:hover img,
.ranking-card:hover .ranking-media img {
    transform: scale(1.08);
}

.card-duration,
.play-badge {
    position: absolute;
    z-index: 2;
}

.card-duration {
    top: 12px;
    right: 12px;
    border-radius: 10px;
    padding: 5px 8px;
    color: #ffffff;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.62);
}

.play-badge {
    left: 50%;
    top: 50%;
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(34, 211, 238, 0.86);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.86);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.movie-card:hover .play-badge {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.card-body {
    padding: 16px;
}

.card-tags {
    margin-bottom: 10px;
}

.card-tags span {
    padding: 4px 8px;
    font-size: 12px;
}

.movie-card h3 {
    margin: 0;
    color: #f8fafc;
    font-size: 17px;
    line-height: 1.35;
}

.movie-card h3 a:hover {
    color: var(--cyan);
}

.movie-card p {
    min-height: 46px;
    margin: 9px 0 14px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
}

.card-meta,
.ranking-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--soft);
    font-size: 13px;
}

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

.category-tile {
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 18px;
    padding: 16px;
    isolation: isolate;
}

.category-tile::before,
.card-media::before,
.ranking-media::before,
.detail-bg::before,
.player-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.84), transparent 65%);
}

.category-tile img {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.category-tile span,
.category-tile small {
    position: relative;
    z-index: 2;
}

.category-tile span {
    color: #ffffff;
    font-size: 18px;
    font-weight: 800;
}

.category-tile small {
    margin-top: 6px;
    color: #cbd5e1;
    line-height: 1.5;
}

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

.rank-row {
    display: grid;
    grid-template-columns: 44px 86px 1fr 52px;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.62);
}

.rank-num,
.rank-score {
    color: var(--cyan);
    font-weight: 900;
}

.rank-thumb {
    height: 58px;
    border-radius: 12px;
}

.rank-main strong,
.rank-main em {
    display: block;
}

.rank-main strong {
    color: #f8fafc;
}

.rank-main em {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
}

.page-hero {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 76px 0 16px;
}

.small-hero > div {
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: var(--radius);
    padding: clamp(26px, 5vw, 46px);
    background:
        radial-gradient(circle at 88% 8%, rgba(34, 211, 238, 0.16), transparent 25rem),
        rgba(15, 23, 42, 0.66);
    box-shadow: var(--shadow);
}

.eyebrow {
    display: inline-flex;
    margin-bottom: 14px;
    color: var(--cyan);
    font-weight: 800;
    letter-spacing: 0.12em;
}

.page-hero h1 {
    margin: 0 0 12px;
    color: #ffffff;
    font-size: clamp(36px, 6vw, 58px);
    letter-spacing: -0.05em;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 38px 0 10px;
}

.pagination a,
.pagination span {
    min-width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 12px;
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.72);
}

.pagination .current {
    color: #ffffff;
    border-color: rgba(34, 211, 238, 0.5);
    background: rgba(34, 211, 238, 0.18);
}

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

.ranking-card {
    display: grid;
    grid-template-columns: 142px 1fr;
    gap: 18px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.62);
}

.ranking-media {
    height: 108px;
    border-radius: 16px;
}

.ranking-media span {
    position: absolute;
    left: 10px;
    bottom: 8px;
    z-index: 2;
    color: #ffffff;
    font-weight: 900;
}

.ranking-card h2 {
    margin: 4px 0 8px;
    font-size: 20px;
}

.ranking-card p {
    margin: 0 0 12px;
    color: var(--muted);
    line-height: 1.65;
}

.search-hero .page-search {
    width: min(620px, 100%);
    margin-top: 22px;
}

.search-hero .page-search input {
    flex: 1;
    width: auto;
}

.search-status {
    margin-bottom: 18px;
    color: var(--muted);
}

.search-hidden {
    display: none;
}

.detail-hero {
    position: relative;
    overflow: hidden;
    min-height: 620px;
    background: #020617;
}

.detail-bg {
    position: absolute;
    inset: 0;
    opacity: 0.36;
    filter: blur(2px);
}

.detail-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, #020617 0%, rgba(2, 6, 23, 0.84) 52%, rgba(2, 6, 23, 0.48) 100%),
        linear-gradient(0deg, #020617 0%, transparent 45%);
}

.detail-shell {
    position: relative;
    z-index: 2;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 44px 0 72px;
}

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

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

.detail-grid {
    display: grid;
    grid-template-columns: 330px 1fr;
    gap: 42px;
    align-items: end;
}

.detail-poster {
    height: 460px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 26px;
    box-shadow: var(--shadow);
}

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

.detail-one-line {
    max-width: 760px;
    color: #dbeafe;
    font-size: 19px;
    line-height: 1.8;
}

.tag-cloud {
    margin: 22px 0 28px;
}

.tag-cloud span {
    padding: 7px 10px;
}

.player-section {
    padding: 0 0 64px;
}

.player-box {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(34, 211, 238, 0.24);
    border-radius: 26px;
    background: #000000;
    box-shadow: 0 26px 80px rgba(0, 0, 0, 0.45);
    aspect-ratio: 16 / 9;
}

.player-box video,
.player-cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.player-box video {
    z-index: 1;
    background: #000000;
}

.player-cover {
    z-index: 3;
    padding: 0;
    border: 0;
    cursor: pointer;
    color: #ffffff;
}

.player-box.is-playing .player-cover {
    display: none;
}

.player-play {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 4;
    width: 86px;
    height: 86px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #ffffff;
    font-size: 30px;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 22px 46px rgba(34, 211, 238, 0.28);
    transform: translate(-50%, -50%);
}

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

.detail-content article,
.detail-content aside,
.text-page {
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.62);
    box-shadow: var(--shadow);
}

.detail-content article,
.detail-content aside {
    padding: 28px;
}

.detail-content p,
.text-page p {
    color: #cbd5e1;
    font-size: 16px;
}

.detail-content dl {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 14px 12px;
    margin: 0;
}

.detail-content dt {
    color: var(--soft);
}

.detail-content dd {
    margin: 0;
    color: #f8fafc;
}

.text-page {
    padding: 34px;
    margin-top: 42px;
}

.site-footer {
    margin-top: 80px;
    border-top: 1px solid var(--line);
    background: rgba(15, 23, 42, 0.82);
}

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

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

.site-footer p,
.site-footer a,
.footer-bottom {
    color: var(--muted);
    line-height: 1.75;
}

.site-footer a {
    display: block;
    margin: 6px 0;
}

.footer-bottom {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0 28px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--line);
    font-size: 14px;
}

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

    .menu-button {
        display: block;
    }

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

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

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

    .detail-grid,
    .detail-content,
    .footer-grid,
    .ranking-page {
        grid-template-columns: 1fr;
    }

    .detail-poster {
        width: min(330px, 100%);
    }
}

@media (max-width: 760px) {
    .nav-shell {
        height: 64px;
    }

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

    .hero {
        min-height: 620px;
        height: 78vh;
    }

    .hero-content {
        justify-content: flex-end;
        padding-bottom: 100px;
    }

    .hero-arrow {
        display: none;
    }

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

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

    .rank-row {
        grid-template-columns: 34px 70px 1fr;
    }

    .rank-score {
        display: none;
    }

    .ranking-card {
        grid-template-columns: 112px 1fr;
    }

    .ranking-media {
        height: 96px;
    }

    .detail-grid {
        gap: 24px;
    }

    .detail-poster {
        height: 420px;
    }
}

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

    .card-media {
        height: 236px;
    }

    .rank-list,
    .ranking-page {
        grid-template-columns: 1fr;
    }

    .ranking-card {
        grid-template-columns: 1fr;
    }

    .ranking-media {
        height: 190px;
    }

    .detail-poster {
        height: 380px;
    }

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