* {
    box-sizing: border-box;
}

:root {
    color-scheme: dark;
    --bg: #020617;
    --panel: #0f172a;
    --panel-soft: #111827;
    --panel-card: #1e293b;
    --text: #f8fafc;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --cyan: #06b6d4;
    --cyan-dark: #0891b2;
    --blue: #3b82f6;
    --line: rgba(148, 163, 184, 0.18);
    --shadow: 0 22px 70px rgba(0, 0, 0, 0.45);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    line-height: 1.6;
}

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

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

button,
input,
select {
    font: inherit;
}

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

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    min-height: 72px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: linear-gradient(90deg, #22d3ee, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 0 32px rgba(6, 182, 212, 0.45);
}

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

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

.desktop-nav a:hover,
.desktop-nav a.active,
.mobile-nav a:hover,
.mobile-nav a.active {
    color: #22d3ee;
}

.mobile-toggle {
    display: none;
    border: 0;
    background: transparent;
    color: #e2e8f0;
    font-size: 28px;
    cursor: pointer;
}

.mobile-nav {
    display: none;
    padding: 0 24px 22px;
    border-top: 1px solid var(--line);
}

.mobile-nav.open {
    display: grid;
    gap: 16px;
}

.hero {
    position: relative;
    min-height: 70vh;
    overflow: hidden;
    background: #020617;
}

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

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

.hero-shade,
.detail-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #020617 0%, rgba(2, 6, 23, 0.88) 42%, rgba(2, 6, 23, 0.18) 100%);
}

.hero-content {
    position: relative;
    width: min(680px, calc(100% - 48px));
    margin-left: max(24px, calc((100vw - 1280px) / 2 + 24px));
    padding: 80px 0;
}

.hero-tags,
.detail-facts,
.side-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    color: #cbd5e1;
    font-weight: 600;
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 16px;
    border-radius: 999px;
    color: white;
    background: var(--cyan);
}

.hero h1 {
    margin: 24px 0 18px;
    color: white;
    font-size: clamp(42px, 7vw, 76px);
    line-height: 1.05;
    letter-spacing: -0.05em;
}

.hero p {
    max-width: 640px;
    margin: 0;
    color: #cbd5e1;
    font-size: 19px;
}

.hero-actions,
.page-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 30px;
}

.primary-btn,
.ghost-btn,
.filter-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 26px;
    border-radius: 999px;
    font-weight: 800;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.primary-btn {
    color: white;
    background: var(--cyan);
    box-shadow: 0 14px 40px rgba(6, 182, 212, 0.28);
}

.primary-btn:hover {
    background: var(--cyan-dark);
    transform: translateY(-2px);
}

.ghost-btn,
.filter-link {
    color: #e2e8f0;
    border: 1px solid var(--line);
    background: rgba(15, 23, 42, 0.68);
    backdrop-filter: blur(10px);
}

.ghost-btn:hover,
.filter-link:hover {
    color: #22d3ee;
    border-color: rgba(34, 211, 238, 0.6);
    transform: translateY(-2px);
}

.hero-nav {
    position: absolute;
    top: 50%;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 999px;
    color: white;
    background: rgba(0, 0, 0, 0.46);
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
    backdrop-filter: blur(10px);
}

.hero-nav:hover {
    background: rgba(0, 0, 0, 0.68);
}

.hero-prev {
    left: 20px;
}

.hero-next {
    right: 20px;
}

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

.hero-dot {
    width: 10px;
    height: 10px;
    border: 0;
    border-radius: 99px;
    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);
}

.section {
    padding: 72px 24px;
    background: #0f172a;
}

.section-gradient {
    background: linear-gradient(180deg, #020617 0%, #0f172a 100%);
}

.section-soft {
    background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
}

.section-rank {
    background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
}

.section-head,
.footer-grid,
.movie-grid,
.horizontal-row,
.category-grid,
.rank-grid,
.rank-list-page,
.filter-panel,
.player-layout,
.movie-article,
.detail-hero-inner,
.page-hero > div {
    width: min(1280px, 100%);
    margin-left: auto;
    margin-right: auto;
}

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

.section-head h2,
.page-hero h1,
.movie-article h2,
.detail-copy h1,
.detail-side h2 {
    margin: 0;
    color: white;
    line-height: 1.15;
}

.section-head h2 {
    font-size: clamp(28px, 4vw, 42px);
}

.section-head a {
    color: #22d3ee;
    font-weight: 800;
}

.section-kicker {
    display: block;
    margin-bottom: 8px;
    color: #22d3ee;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.horizontal-row {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    padding: 6px 0 22px;
    scroll-snap-type: x proximity;
}

.horizontal-row .movie-card {
    flex: 0 0 260px;
    scroll-snap-align: start;
}

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

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

.movie-card {
    min-width: 0;
    border-radius: 18px;
    overflow: hidden;
    background: #1e293b;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.24);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.movie-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow);
}

.movie-card.hidden {
    display: none;
}

.card-link {
    display: block;
    height: 100%;
}

.poster-wrap {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #0f172a;
}

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

.movie-card:hover .poster-wrap img,
.category-tile:hover img {
    transform: scale(1.1);
}

.poster-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.82));
    opacity: 0.72;
    transition: opacity 0.2s ease;
}

.movie-card:hover .poster-wrap::after {
    opacity: 0.9;
}

.card-type,
.rank-badge {
    position: absolute;
    z-index: 2;
    top: 12px;
    right: 12px;
    padding: 5px 9px;
    border-radius: 10px;
    color: white;
    background: rgba(6, 182, 212, 0.9);
    font-size: 12px;
    font-weight: 800;
    backdrop-filter: blur(8px);
}

.rank-badge {
    left: 12px;
    right: auto;
    background: rgba(239, 68, 68, 0.92);
}

.card-play {
    position: absolute;
    z-index: 3;
    left: 50%;
    top: 50%;
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: white;
    background: rgba(6, 182, 212, 0.92);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.88);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.card-body {
    padding: 18px;
}

.card-body h3 {
    margin: 0 0 9px;
    color: white;
    font-size: 18px;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.movie-card:hover .card-body h3 {
    color: #22d3ee;
}

.card-body p {
    display: -webkit-box;
    min-height: 44px;
    margin: 0 0 14px;
    overflow: hidden;
    color: var(--muted);
    font-size: 14px;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #64748b;
    font-size: 12px;
}

.card-meta span:first-child {
    max-width: 54%;
    overflow: hidden;
    color: #22d3ee;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

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

.category-tile {
    position: relative;
    min-height: 220px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #111827;
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.24);
}

.category-tile img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.45;
    transition: transform 0.45s ease, opacity 0.3s ease;
}

.category-tile:hover img {
    opacity: 0.62;
}

.category-tile::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.1), rgba(2, 6, 23, 0.92));
}

.category-tile span {
    position: absolute;
    z-index: 2;
    left: 20px;
    right: 20px;
    bottom: 20px;
}

.category-tile strong {
    display: block;
    color: white;
    font-size: 22px;
}

.category-tile em {
    display: block;
    margin-top: 8px;
    color: #cbd5e1;
    font-size: 14px;
    font-style: normal;
}

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

.mini-card {
    display: grid;
    grid-template-columns: auto 64px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(30, 41, 59, 0.72);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.mini-card:hover {
    transform: translateY(-3px);
    border-color: rgba(34, 211, 238, 0.5);
    background: rgba(30, 41, 59, 0.96);
}

.mini-card img {
    width: 64px;
    height: 86px;
    border-radius: 10px;
    object-fit: cover;
    background: #0f172a;
}

.mini-card strong {
    display: block;
    overflow: hidden;
    color: white;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-card em {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
}

.mini-rank {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: white;
    background: linear-gradient(135deg, #ef4444, #f97316);
    font-weight: 900;
}

.page-hero {
    padding: 86px 24px 54px;
    background: radial-gradient(circle at 16% 18%, rgba(6, 182, 212, 0.2), transparent 28%), linear-gradient(135deg, #020617, #0f172a 56%, #111827);
}

.compact-hero h1 {
    margin: 0 0 16px;
    font-size: clamp(38px, 5vw, 62px);
    letter-spacing: -0.04em;
}

.compact-hero p {
    max-width: 760px;
    margin: 0;
    color: #cbd5e1;
    font-size: 18px;
}

.filter-panel {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) repeat(3, minmax(150px, 190px)) auto;
    gap: 14px;
    align-items: end;
    margin-bottom: 28px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(2, 6, 23, 0.38);
}

.search-box {
    display: grid;
    gap: 8px;
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 800;
}

.search-box input,
.filter-panel select {
    width: 100%;
    min-height: 46px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 14px;
    outline: none;
    color: white;
    background: #0f172a;
    padding: 0 14px;
}

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

.detail-hero {
    position: relative;
    min-height: 560px;
    display: flex;
    align-items: end;
    padding: 96px 24px 56px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.detail-hero-inner {
    position: relative;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 34px;
    align-items: end;
}

.detail-cover {
    width: 260px;
    aspect-ratio: 3 / 4;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 24px;
    object-fit: cover;
    box-shadow: var(--shadow);
}

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    color: #cbd5e1;
    margin-bottom: 18px;
}

.breadcrumb a {
    color: #22d3ee;
}

.detail-copy h1 {
    font-size: clamp(42px, 6vw, 72px);
    letter-spacing: -0.05em;
}

.detail-line {
    max-width: 820px;
    color: #dbeafe;
    font-size: 19px;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 24px 0;
}

.tag,
.detail-facts span,
.side-meta span {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    color: #dbeafe;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid var(--line);
}

.detail-section {
    background: #020617;
}

.player-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 0.8fr);
    gap: 28px;
}

.player-box {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    background: #000;
    box-shadow: var(--shadow);
    aspect-ratio: 16 / 9;
}

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

.play-mask {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    color: white;
    cursor: pointer;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.18), rgba(2, 6, 23, 0.72));
}

.play-mask span {
    width: 88px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: white;
    font-size: 34px;
    background: rgba(6, 182, 212, 0.92);
    box-shadow: 0 0 48px rgba(6, 182, 212, 0.42);
    transition: transform 0.2s ease, background 0.2s ease;
}

.play-mask:hover span {
    transform: scale(1.08);
    background: var(--cyan-dark);
}

.play-mask.is-hidden {
    display: none;
}

.detail-side {
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.72);
}

.detail-side h2 {
    font-size: 28px;
}

.detail-side p,
.movie-article p,
.site-footer p {
    color: #cbd5e1;
}

.movie-article {
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.72);
}

.movie-article h2 {
    margin: 0 0 14px;
    font-size: 28px;
}

.movie-article p {
    margin: 0 0 28px;
    font-size: 17px;
}

.site-footer {
    padding: 58px 24px 28px;
    background: #020617;
    border-top: 1px solid var(--line);
}

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

.site-footer h3 {
    margin: 0 0 16px;
    color: white;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
}

.footer-links a {
    color: #94a3b8;
}

.footer-links a:hover {
    color: #22d3ee;
}

.footer-bottom {
    width: min(1280px, 100%);
    margin: 32px auto 0;
    padding-top: 22px;
    border-top: 1px solid var(--line);
    color: #64748b;
    font-size: 14px;
}

@media (max-width: 1180px) {
    .movie-grid,
    .six-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

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

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

    .mobile-toggle {
        display: block;
    }

    .hero-content {
        margin-left: 24px;
    }

    .hero-nav {
        display: none;
    }

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

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

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

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

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

    .detail-hero-inner,
    .player-layout,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .detail-cover {
        width: 210px;
    }
}

@media (max-width: 560px) {
    .header-inner {
        padding: 0 16px;
    }

    .brand {
        font-size: 20px;
    }

    .hero {
        min-height: 76vh;
    }

    .hero-content {
        width: calc(100% - 32px);
        margin-left: 16px;
    }

    .hero p,
    .compact-hero p,
    .detail-line {
        font-size: 16px;
    }

    .section,
    .page-hero,
    .detail-hero {
        padding-left: 16px;
        padding-right: 16px;
    }

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

    .card-body {
        padding: 13px;
    }

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

    .card-meta {
        align-items: start;
        flex-direction: column;
        gap: 4px;
    }

    .category-grid,
    .category-grid.large {
        grid-template-columns: 1fr;
    }

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

    .detail-cover {
        width: 168px;
    }

    .detail-side,
    .movie-article {
        padding: 22px;
    }

    .horizontal-row .movie-card {
        flex-basis: 220px;
    }
}
