:root {
    --bg: #111827;
    --bg-deep: #05070c;
    --panel: #1f2937;
    --panel-soft: rgba(31, 41, 55, 0.72);
    --panel-strong: rgba(17, 24, 39, 0.92);
    --line: rgba(255, 255, 255, 0.08);
    --text: #ffffff;
    --muted: #9ca3af;
    --muted-strong: #d1d5db;
    --amber: #f59e0b;
    --amber-deep: #d97706;
    --amber-soft: rgba(245, 158, 11, 0.18);
    --shadow: 0 25px 60px rgba(0, 0, 0, 0.38);
    --radius: 22px;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(245, 158, 11, 0.12), transparent 34rem),
        linear-gradient(180deg, #111827 0%, #182233 46%, #05070c 100%);
}

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

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

button,
input,
select {
    font: inherit;
}

button {
    border: 0;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--line);
    background: rgba(17, 24, 39, 0.82);
    backdrop-filter: blur(16px);
}

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

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

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

.logo-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    color: #111827;
    background: linear-gradient(135deg, #fbbf24, #d97706);
    box-shadow: 0 0 32px rgba(245, 158, 11, 0.38);
}

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

.main-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--muted-strong);
    font-size: 15px;
}

.main-nav a {
    transition: color 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
    color: #fcd34d;
}

.nav-search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 220px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.24);
    padding: 8px 10px 8px 16px;
}

.nav-search input {
    width: 100%;
    color: var(--text);
    border: 0;
    outline: 0;
    background: transparent;
}

.nav-search input::placeholder {
    color: #6b7280;
}

.nav-search button,
.mobile-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    background: var(--amber);
    border-radius: 999px;
    cursor: pointer;
}

.nav-search button {
    width: 34px;
    height: 34px;
}

.mobile-toggle {
    display: none;
    width: 42px;
    height: 42px;
    font-size: 22px;
}

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

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(1.02);
    transition: opacity 1s ease, transform 1.2s ease;
}

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

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

.hero-mask {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(17, 24, 39, 0.96) 0%, rgba(17, 24, 39, 0.72) 44%, rgba(17, 24, 39, 0.22) 100%),
        linear-gradient(0deg, #111827 0%, rgba(17, 24, 39, 0.2) 42%, rgba(17, 24, 39, 0.18) 100%);
}

.hero-content {
    position: absolute;
    left: max(16px, calc((100vw - 1280px) / 2));
    bottom: 76px;
    width: min(720px, calc(100% - 32px));
    z-index: 2;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fcd34d;
    font-weight: 700;
    margin-bottom: 16px;
}

.eyebrow::before {
    content: "";
    width: 30px;
    height: 3px;
    border-radius: 999px;
    background: var(--amber);
}

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

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

.hero-meta {
    margin: 22px 0 18px;
}

.hero p {
    margin: 0 0 28px;
    color: #e5e7eb;
    font-size: 18px;
    line-height: 1.75;
}

.badge,
.meta-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    white-space: nowrap;
}

.badge {
    padding: 6px 12px;
    color: white;
    background: var(--amber);
    font-size: 13px;
    font-weight: 700;
}

.meta-pill {
    padding: 5px 10px;
    color: #fcd34d;
    background: var(--amber-soft);
    font-size: 13px;
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 20px;
    color: white;
    border-radius: 999px;
    background: var(--amber);
    font-weight: 800;
    box-shadow: 0 18px 40px rgba(245, 158, 11, 0.25);
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
    background: var(--amber-deep);
    transform: translateY(-2px);
    box-shadow: 0 22px 50px rgba(245, 158, 11, 0.38);
}

.btn-ghost {
    color: #fcd34d;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(252, 211, 77, 0.28);
    box-shadow: none;
}

.hero-control {
    position: absolute;
    top: 50%;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    color: white;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    cursor: pointer;
    transform: translateY(-50%);
    transition: background 0.2s ease;
}

.hero-control:hover {
    background: rgba(0, 0, 0, 0.7);
}

.hero-prev {
    left: 24px;
}

.hero-next {
    right: 24px;
}

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

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

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

.section {
    padding: 64px 0 0;
}

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

.section-title {
    margin: 0;
    font-size: clamp(26px, 3vw, 38px);
    letter-spacing: -0.03em;
}

.section-subtitle {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.more-link {
    color: #fcd34d;
    font-weight: 700;
    white-space: nowrap;
}

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

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

.movie-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(31, 41, 55, 0.92), rgba(17, 24, 39, 0.92));
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-8px);
    border-color: rgba(245, 158, 11, 0.42);
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.34);
}

.poster-link,
.poster-frame {
    position: relative;
    display: block;
}

.poster-frame {
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: #0f172a;
}

.movie-card.wide .poster-frame {
    aspect-ratio: 16 / 9;
}

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

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

.poster-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 38%, rgba(0, 0, 0, 0.82));
    opacity: 0.88;
}

.card-play {
    position: absolute;
    left: 50%;
    top: 50%;
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    color: #111827;
    border-radius: 999px;
    background: #fbbf24;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
    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: 16px;
}

.card-title {
    display: -webkit-box;
    min-height: 48px;
    margin: 0 0 10px;
    overflow: hidden;
    font-size: 18px;
    line-height: 1.35;
    font-weight: 800;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.movie-grid.compact .card-title {
    min-height: 40px;
    font-size: 15px;
}

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

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.tag {
    padding: 4px 8px;
    border-radius: 999px;
    color: #fcd34d;
    background: rgba(245, 158, 11, 0.12);
    font-size: 12px;
}

.rail {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 4px 2px 18px;
    scroll-snap-type: x proximity;
}

.rail .movie-card {
    flex: 0 0 244px;
    scroll-snap-align: start;
}

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

.category-tile {
    min-height: 190px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.2), transparent 55%),
        linear-gradient(145deg, rgba(31, 41, 55, 0.96), rgba(17, 24, 39, 0.86));
    padding: 22px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-tile:hover {
    transform: translateY(-6px);
    border-color: rgba(245, 158, 11, 0.42);
}

.category-tile h2,
.category-tile h3 {
    margin: 10px 0 8px;
    font-size: 22px;
}

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

.count-pill {
    color: #111827;
    background: #fbbf24;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
}

.page-hero {
    padding: 70px 0 28px;
}

.page-hero p {
    max-width: 820px;
    margin: 18px 0 0;
    color: var(--muted-strong);
    font-size: 17px;
    line-height: 1.8;
}

.filter-panel {
    position: sticky;
    top: 84px;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) repeat(3, 180px);
    gap: 12px;
    margin: 28px 0 28px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(17, 24, 39, 0.88);
    backdrop-filter: blur(16px);
}

.filter-panel input,
.filter-panel select {
    width: 100%;
    min-height: 44px;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 999px;
    outline: 0;
    background: rgba(0, 0, 0, 0.22);
    padding: 0 16px;
}

.filter-panel select option {
    color: #111827;
}

.result-count {
    margin: 0 0 20px;
    color: var(--muted);
}

.ranking-list {
    display: grid;
    gap: 14px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.rank-item {
    display: grid;
    grid-template-columns: 72px 112px 1fr auto;
    gap: 18px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--panel-soft);
    padding: 14px;
}

.rank-no {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    color: #111827;
    border-radius: 18px;
    background: linear-gradient(135deg, #fcd34d, #d97706);
    font-size: 20px;
    font-weight: 900;
}

.rank-cover {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 16px;
    background: #0f172a;
}

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

.rank-title {
    margin: 0 0 8px;
    font-size: 20px;
}

.rank-desc {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

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

.breadcrumb a {
    color: #fcd34d;
}

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

.player-frame {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    background: #000;
    box-shadow: var(--shadow);
}

.player-frame video {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #111827;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.56));
    cursor: pointer;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.play-bubble {
    display: grid;
    place-items: center;
    width: 86px;
    height: 86px;
    border-radius: 999px;
    background: #fbbf24;
    box-shadow: 0 0 50px rgba(245, 158, 11, 0.42);
    font-size: 32px;
}

.detail-panel,
.content-panel {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--panel-soft);
    padding: 24px;
}

.detail-cover {
    overflow: hidden;
    aspect-ratio: 2 / 3;
    border-radius: 20px;
    background: #0f172a;
    margin-bottom: 18px;
}

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

.detail-title {
    font-size: clamp(30px, 4vw, 48px);
    margin-bottom: 18px;
}

.detail-meta {
    margin-bottom: 20px;
}

.detail-summary {
    color: var(--muted-strong);
    line-height: 1.8;
}

.content-panel {
    margin-top: 28px;
}

.content-panel h2 {
    margin: 0 0 14px;
    font-size: 26px;
}

.content-panel p {
    margin: 0 0 24px;
    color: var(--muted-strong);
    line-height: 1.9;
}

.content-panel p:last-child {
    margin-bottom: 0;
}

.site-footer {
    margin-top: 72px;
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.12), rgba(0, 0, 0, 0.52));
}

.footer-inner {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 32px;
    padding: 42px 0;
    color: var(--muted);
}

.footer-inner h2,
.footer-inner h3 {
    margin: 0 0 12px;
    color: white;
    font-size: 18px;
}

.footer-inner p,
.footer-inner li {
    color: var(--muted);
    line-height: 1.75;
}

.footer-inner ul {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

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

.back-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 40;
    display: none;
    place-items: center;
    width: 48px;
    height: 48px;
    color: #111827;
    border-radius: 999px;
    background: #fbbf24;
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.35);
    cursor: pointer;
}

.back-top.is-visible {
    display: grid;
}

.empty-state {
    display: none;
    margin: 24px 0;
    color: var(--muted);
    text-align: center;
}

.empty-state.is-visible {
    display: block;
}

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

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

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

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

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

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

    .main-nav.is-open {
        position: absolute;
        left: 16px;
        right: 16px;
        top: 72px;
        display: grid;
        gap: 12px;
        border: 1px solid var(--line);
        border-radius: 22px;
        background: rgba(17, 24, 39, 0.96);
        padding: 18px;
        box-shadow: var(--shadow);
    }

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

    .hero-mask {
        background: linear-gradient(0deg, #111827 0%, rgba(17, 24, 39, 0.7) 46%, rgba(17, 24, 39, 0.3) 100%);
    }

    .hero-content {
        bottom: 72px;
    }

    .hero-control {
        display: none;
    }

    .section {
        padding-top: 46px;
    }

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

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

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

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

    .rank-action {
        grid-column: 2 / -1;
    }

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

@media (max-width: 540px) {
    .header-inner,
    .container {
        width: min(100% - 24px, 1280px);
    }

    .logo-text {
        font-size: 17px;
    }

    .hero h1,
    .page-hero h1 {
        font-size: 36px;
    }

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

    .movie-grid,
    .movie-grid.compact {
        grid-template-columns: 1fr 1fr;
    }

    .card-body {
        padding: 12px;
    }

    .card-title {
        min-height: 42px;
        font-size: 15px;
    }

    .card-desc,
    .tags {
        display: none;
    }

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

    .rail .movie-card {
        flex-basis: 180px;
    }

    .rank-item {
        grid-template-columns: 44px 1fr;
    }

    .rank-cover {
        display: none;
    }
}
