:root {
    color-scheme: dark;
    --bg: #020617;
    --panel: rgba(15, 23, 42, 0.76);
    --panel-strong: rgba(30, 41, 59, 0.92);
    --border: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --muted-2: #64748b;
    --amber: #f59e0b;
    --amber-dark: #d97706;
    --radius: 22px;
    --shadow: 0 24px 80px rgba(2, 6, 23, 0.45);
}

* {
    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.16), transparent 28rem),
        radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.14), transparent 32rem),
        linear-gradient(180deg, #020617 0%, #0f172a 48%, #020617 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

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

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

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    background: linear-gradient(90deg, rgba(2, 6, 23, 0.94), rgba(15, 23, 42, 0.88), rgba(2, 6, 23, 0.94));
    backdrop-filter: blur(18px);
}

.header-inner {
    width: min(1240px, calc(100% - 32px));
    height: 72px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 22px;
}

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    color: #111827;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 0 32px rgba(245, 158, 11, 0.38);
    font-size: 15px;
}

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

.brand-text strong {
    font-size: 20px;
    letter-spacing: 0.06em;
}

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

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.nav-link {
    padding: 10px 14px;
    border-radius: 12px;
    color: #cbd5e1;
    font-size: 14px;
    transition: 0.22s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #fff;
    background: rgba(148, 163, 184, 0.13);
}

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

.header-search input,
.mobile-search input,
.local-search {
    width: 220px;
    border: 1px solid var(--border);
    border-radius: 14px;
    outline: none;
    color: var(--text);
    background: rgba(15, 23, 42, 0.78);
    padding: 11px 14px;
    transition: 0.2s ease;
}

.header-search input:focus,
.mobile-search input:focus,
.local-search:focus {
    border-color: rgba(245, 158, 11, 0.66);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1);
}

.header-search button,
.mobile-search button,
.primary-btn,
.ghost-btn,
.section-more,
.filter-btn {
    border: 0;
    border-radius: 14px;
    padding: 11px 16px;
    color: #111827;
    font-weight: 700;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.header-search button:hover,
.mobile-search button:hover,
.primary-btn:hover,
.section-more:hover,
.filter-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(245, 158, 11, 0.22);
}

.ghost-btn {
    color: #fff;
    background: rgba(148, 163, 184, 0.13);
    border: 1px solid var(--border);
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.78);
}

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    background: #fff;
    border-radius: 2px;
}

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

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

.mobile-panel nav,
.mobile-category-links {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.mobile-panel a {
    padding: 10px 12px;
    border-radius: 12px;
    color: #cbd5e1;
    background: rgba(30, 41, 59, 0.5);
}

.page-main {
    padding-top: 72px;
}

.hero-carousel {
    position: relative;
    min-height: 640px;
    overflow: hidden;
    isolation: isolate;
}

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

.hero-slide {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.02);
    transition: opacity 0.7s ease, transform 0.9s ease;
}

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

.hero-backdrop {
    background-size: cover;
    background-position: center;
    z-index: -2;
}

.hero-carousel::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 190px;
    background: linear-gradient(0deg, var(--bg), transparent);
    z-index: -1;
}

.hero-content {
    width: min(1240px, calc(100% - 32px));
    min-height: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 70px 420px 70px 0;
}

.hero-kicker,
.eyebrow {
    display: inline-flex;
    width: fit-content;
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.24);
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.hero-content h1,
.inner-hero h1,
.detail-main-info h1 {
    margin: 20px 0 18px;
    font-size: clamp(40px, 6vw, 76px);
    line-height: 1.05;
    letter-spacing: -0.05em;
}

.hero-content p,
.inner-hero p,
.detail-one-line {
    max-width: 720px;
    color: #cbd5e1;
    font-size: 18px;
    line-height: 1.9;
}

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

.hero-tags,
.detail-tags {
    margin: 24px 0;
}

.hero-tags span,
.tag-row span,
.detail-meta span,
.detail-meta a,
.card-meta a,
.card-meta span,
.small-meta span,
.small-meta a {
    border: 1px solid var(--border);
    border-radius: 999px;
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.62);
    padding: 7px 10px;
    font-size: 12px;
}

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

.hero-poster {
    position: absolute;
    right: max(32px, calc((100vw - 1240px) / 2));
    top: 50%;
    width: min(330px, 30vw);
    transform: translateY(-50%);
    border-radius: 30px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(15, 23, 42, 0.5);
    box-shadow: var(--shadow);
}

.hero-poster img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

.hero-poster span {
    position: absolute;
    inset: auto 18px 18px;
    border-radius: 999px;
    text-align: center;
    padding: 12px;
    background: rgba(2, 6, 23, 0.78);
    backdrop-filter: blur(10px);
}

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

.hero-dot {
    width: 34px;
    height: 5px;
    border: 0;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.28);
    padding: 0;
}

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

.content-section {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 58px 0;
}

.section-head,
.panel-title,
.rank-heading,
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.section-head {
    margin-bottom: 26px;
}

.section-head h2 {
    margin: 12px 0 8px;
    font-size: clamp(28px, 4vw, 44px);
    letter-spacing: -0.04em;
}

.section-head p {
    color: var(--muted);
    line-height: 1.8;
}

.section-more {
    white-space: nowrap;
}

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

.category-tile,
.category-card-large {
    position: relative;
    min-height: 128px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.86), rgba(15, 23, 42, 0.74));
    padding: 20px;
    transition: 0.22s ease;
}

.category-tile:hover,
.category-card-large:hover,
.movie-card:hover,
.rank-row:hover {
    transform: translateY(-4px);
    border-color: rgba(245, 158, 11, 0.38);
    box-shadow: 0 20px 48px rgba(2, 6, 23, 0.35);
}

.category-tile strong,
.category-card-large strong {
    display: block;
    margin-bottom: 10px;
    font-size: 21px;
}

.category-tile span,
.category-card-large em {
    color: var(--muted);
    font-style: normal;
    line-height: 1.7;
}

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

.category-card-large {
    min-height: 230px;
    display: flex;
    align-items: flex-end;
}

.tile-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease;
}

.category-card-large:hover .tile-bg {
    transform: scale(1.06);
}

.tile-content {
    position: relative;
    z-index: 2;
}

.split-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 26px;
    align-items: start;
}

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

.featured-grid,
.related-grid,
.search-grid {
    grid-template-columns: repeat(4, 1fr);
}

.movie-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.56);
    transition: 0.22s ease;
}

.poster-wrap {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: #0f172a;
}

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

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

.poster-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(2, 6, 23, 0.42);
    opacity: 0;
    transition: 0.25s ease;
}

.movie-card:hover .poster-overlay {
    opacity: 1;
}

.play-mark,
.big-play {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    color: #111827;
    background: var(--amber);
    box-shadow: 0 0 32px rgba(245, 158, 11, 0.38);
}

.poster-badge,
.poster-year {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 9px;
    border-radius: 999px;
    color: #111827;
    background: var(--amber);
    font-size: 12px;
    font-weight: 800;
}

.poster-year {
    top: auto;
    right: auto;
    left: 12px;
    bottom: 12px;
    color: #fff;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(8px);
}

.card-body {
    padding: 16px;
}

.card-body h3 {
    margin: 0 0 8px;
    font-size: 17px;
    line-height: 1.45;
}

.card-body h3 a:hover,
.rank-title:hover,
.rank-heading h2 a:hover {
    color: var(--amber);
}

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

.card-meta {
    margin-bottom: 12px;
    justify-content: space-between;
}

.tag-row {
    gap: 6px;
}

.tag-row span {
    padding: 5px 8px;
}

.ranking-panel,
.story-panel,
.rank-row {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.62);
    box-shadow: 0 18px 50px rgba(2, 6, 23, 0.22);
}

.ranking-panel {
    position: sticky;
    top: 94px;
    padding: 22px;
}

.panel-title {
    margin-bottom: 18px;
}

.panel-title span {
    font-size: 22px;
    font-weight: 800;
}

.panel-title a {
    color: var(--amber);
    font-size: 14px;
}

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

.ranking-list a {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(30, 41, 59, 0.48);
}

.rank-no,
.rank-index {
    color: var(--amber);
    font-weight: 900;
}

.rank-title {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.rank-score {
    color: #fef3c7;
}

.inner-hero,
.detail-hero {
    min-height: 340px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
}

.inner-hero > div,
.detail-layout {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
}

.small-hero {
    min-height: 280px;
    background:
        radial-gradient(circle at 15% 20%, rgba(245, 158, 11, 0.20), transparent 24rem),
        linear-gradient(135deg, rgba(2, 6, 23, 0.98), rgba(15, 23, 42, 0.86));
}

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

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

.toolbar {
    margin-bottom: 24px;
    align-items: flex-start;
}

.local-search.large-input {
    width: min(100%, 420px);
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.filter-btn {
    color: #cbd5e1;
    background: rgba(30, 41, 59, 0.78);
    border: 1px solid var(--border);
}

.filter-btn.active {
    color: #111827;
    background: var(--amber);
}

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

.rank-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 18px;
    padding: 14px;
    transition: 0.22s ease;
}

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

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

.rank-heading h2 {
    margin: 0;
    flex: 1;
    font-size: 22px;
}

.rank-info p {
    color: var(--muted);
    line-height: 1.75;
}

.detail-hero {
    min-height: 560px;
}

.detail-layout {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    gap: 42px;
    align-items: center;
    padding: 58px 0;
}

.detail-poster {
    overflow: hidden;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: var(--shadow);
}

.detail-poster img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

.detail-meta {
    margin: 18px 0;
}

.player-section {
    padding-bottom: 24px;
}

.video-player {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(245, 158, 11, 0.26);
    border-radius: 28px;
    background: #000;
    box-shadow: var(--shadow);
    aspect-ratio: 16 / 9;
}

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

.player-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 14px;
    border: 0;
    color: #fff;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.38), rgba(2, 6, 23, 0.82));
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.big-play {
    width: 86px;
    height: 86px;
    font-size: 30px;
}

.detail-content-grid {
    display: grid;
    grid-template-columns: 1.35fr 0.85fr;
    gap: 24px;
}

.story-panel {
    padding: 26px;
}

.story-panel h2 {
    margin: 14px 0;
    font-size: 28px;
}

.story-panel p {
    color: #cbd5e1;
    line-height: 2;
    font-size: 16px;
}

.accent-panel {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(15, 23, 42, 0.64));
}

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

.footer-grid {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0;
    display: grid;
    grid-template-columns: 1.3fr 0.8fr 1.2fr;
    gap: 32px;
}

.footer-grid p,
.footer-links a {
    color: var(--muted);
    line-height: 1.8;
}

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

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

.footer-links.two-column {
    grid-template-columns: repeat(2, 1fr);
}

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

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

[data-card].is-hidden {
    display: none;
}

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

    .movie-grid,
    .featured-grid,
    .related-grid,
    .search-grid {
        grid-template-columns: repeat(3, 1fr);
    }

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

    .split-section,
    .detail-content-grid {
        grid-template-columns: 1fr;
    }

    .ranking-panel {
        position: static;
    }

    .hero-content {
        padding-right: 330px;
    }
}

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

    .menu-toggle {
        display: block;
        margin-left: auto;
    }

    .header-inner {
        height: 66px;
    }

    .page-main {
        padding-top: 66px;
    }

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

    .hero-content {
        padding: 52px 0 260px;
    }

    .hero-poster {
        width: 190px;
        right: 18px;
        top: auto;
        bottom: 78px;
        transform: none;
    }

    .category-grid,
    .category-overview-grid,
    .movie-grid,
    .featured-grid,
    .related-grid,
    .search-grid,
    .footer-grid,
    .detail-layout {
        grid-template-columns: 1fr 1fr;
    }

    .detail-layout {
        align-items: start;
    }

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

    .filter-buttons {
        justify-content: flex-start;
    }
}

@media (max-width: 620px) {
    .brand-text strong {
        font-size: 17px;
    }

    .brand-text small {
        display: none;
    }

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

    .hero-content h1,
    .inner-hero h1,
    .detail-main-info h1 {
        font-size: 38px;
    }

    .category-grid,
    .category-overview-grid,
    .movie-grid,
    .featured-grid,
    .related-grid,
    .search-grid,
    .footer-grid,
    .detail-layout,
    .rank-row {
        grid-template-columns: 1fr;
    }

    .hero-poster {
        display: none;
    }

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

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

    .mobile-search {
        align-items: stretch;
        flex-direction: column;
    }

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