* {
    box-sizing: border-box;
}

: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(147, 51, 234, 0.26);
    --line-soft: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --amber: #f59e0b;
    --amber-light: #fde68a;
    --purple: #7c3aed;
    --pink: #db2777;
    --shadow: 0 24px 70px rgba(2, 6, 23, 0.46);
    --radius: 24px;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(124, 58, 237, 0.32), transparent 34rem),
        radial-gradient(circle at 80% 10%, rgba(245, 158, 11, 0.18), transparent 28rem),
        linear-gradient(180deg, #0f172a 0%, #020617 62%, #020617 100%);
    color: var(--text);
}

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

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

button,
input,
select {
    font: inherit;
}

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

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

.header-inner {
    width: min(1220px, calc(100% - 28px));
    min-height: 72px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: max-content;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #1f1300;
    font-weight: 900;
    background: linear-gradient(135deg, #fef3c7, #f59e0b 58%, #a855f7);
    box-shadow: 0 10px 34px rgba(245, 158, 11, 0.24);
}

.brand-text {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    background: linear-gradient(90deg, var(--amber-light), var(--amber), #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    color: #cbd5e1;
    font-size: 0.96rem;
    font-weight: 600;
}

.site-nav a {
    transition: color 0.2s ease, transform 0.2s ease;
}

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

.site-nav a:hover {
    transform: translateY(-1px);
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.72);
    color: var(--text);
    padding: 10px;
}

.nav-toggle span {
    display: block;
    height: 2px;
    margin: 5px 0;
    border-radius: 99px;
    background: var(--amber-light);
}

.hero {
    position: relative;
    height: 72vh;
    min-height: 560px;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

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

.hero-slide {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.9s ease, visibility 0.9s ease;
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
}

.hero-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.16) contrast(1.08);
}

.hero-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(15, 23, 42, 0.78) 38%, rgba(15, 23, 42, 0.22) 70%),
        linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.34) 42%, rgba(2, 6, 23, 0.18) 100%);
}

.hero-content {
    position: relative;
    z-index: 3;
    width: min(1180px, calc(100% - 32px));
    height: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding-top: 54px;
    padding-bottom: 150px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--amber-light);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.hero h1 {
    max-width: 780px;
    margin: 0;
    font-size: clamp(2.8rem, 7vw, 5.8rem);
    line-height: 0.98;
    letter-spacing: -0.06em;
    text-shadow: 0 18px 42px rgba(0, 0, 0, 0.5);
}

.hero-desc {
    max-width: 700px;
    margin: 24px 0 0;
    color: #dbeafe;
    font-size: clamp(1rem, 2.2vw, 1.25rem);
    line-height: 1.8;
}

.hero-tags,
.tag-row,
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-tags {
    margin-top: 22px;
}

.hero-tags span,
.tag-row span,
.detail-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border: 1px solid rgba(253, 230, 138, 0.24);
    border-radius: 999px;
    color: #fde68a;
    background: rgba(15, 23, 42, 0.62);
    font-size: 0.78rem;
    font-weight: 700;
}

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

.primary-btn,
.ghost-btn,
.section-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-btn {
    color: #1f1300;
    background: linear-gradient(135deg, #fde68a, #f59e0b 58%, #f97316);
    box-shadow: 0 14px 38px rgba(245, 158, 11, 0.28);
}

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

.ghost-btn,
.section-link {
    color: #f8fafc;
    border-color: rgba(253, 230, 138, 0.22);
    background: rgba(15, 23, 42, 0.54);
}

.primary-btn.small {
    min-height: 38px;
    padding: 0 14px;
    font-size: 0.9rem;
}

.hero-arrow {
    position: absolute;
    z-index: 5;
    top: 50%;
    width: 48px;
    height: 64px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: #fff;
    background: rgba(15, 23, 42, 0.58);
    cursor: pointer;
    font-size: 2rem;
    transform: translateY(-50%);
    backdrop-filter: blur(12px);
}

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

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

.hero-thumbs {
    position: absolute;
    z-index: 6;
    left: 50%;
    bottom: 28px;
    width: min(1060px, calc(100% - 32px));
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    transform: translateX(-50%);
}

.hero-thumb {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px;
    border: 1px solid rgba(253, 230, 138, 0.14);
    border-radius: 18px;
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.68);
    cursor: pointer;
    text-align: left;
    backdrop-filter: blur(12px);
}

.hero-thumb.active {
    border-color: rgba(245, 158, 11, 0.76);
    background: rgba(245, 158, 11, 0.16);
}

.hero-thumb img {
    width: 54px;
    height: 72px;
    flex: 0 0 auto;
    border-radius: 12px;
    object-fit: cover;
}

.hero-thumb span {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-weight: 800;
    line-height: 1.35;
}

.home-search {
    display: grid;
    grid-template-columns: 0.9fr 1.7fr;
    gap: 18px;
    align-items: center;
    margin-top: 34px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.62);
    box-shadow: var(--shadow);
}

.search-intro h2,
.section-heading h2,
.page-hero h1,
.detail-info h1,
.text-card h2 {
    margin: 0;
    letter-spacing: -0.03em;
}

.search-intro h2,
.section-heading h2 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.filter-panel {
    width: 100%;
}

.search-box,
.select-row label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: #cbd5e1;
    font-size: 0.86rem;
    font-weight: 700;
}

.search-box input,
.select-row select {
    min-height: 46px;
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    color: #f8fafc;
    background: rgba(2, 6, 23, 0.62);
    outline: none;
}

.search-box input {
    width: 100%;
    padding: 0 14px;
}

.select-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.select-row select {
    padding: 0 12px;
}

.empty-state {
    display: none;
    margin: 16px 0 0;
    color: #fecdd3;
    font-weight: 700;
}

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

.content-section {
    margin-top: 58px;
}

.section-heading,
.category-overview-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

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

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

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

.movie-card {
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.72);
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.25);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
    border-color: rgba(245, 158, 11, 0.48);
    box-shadow: 0 24px 50px rgba(2, 6, 23, 0.42);
    transform: translateY(-6px);
}

.poster {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.72);
}

.poster img,
.rank-cover img,
.detail-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.year-badge,
.rank-badge {
    position: absolute;
    z-index: 2;
    top: 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 900;
}

.year-badge {
    left: 10px;
    padding: 5px 9px;
    color: #1f1300;
    background: #fbbf24;
}

.rank-badge {
    right: 10px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: #fef3c7;
    background: rgba(124, 58, 237, 0.92);
}

.card-body {
    padding: 14px;
}

.card-title {
    display: -webkit-box;
    min-height: 2.65em;
    overflow: hidden;
    color: #f8fafc;
    font-size: 1.02rem;
    font-weight: 900;
    line-height: 1.32;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-title:hover,
.rank-title:hover {
    color: var(--amber-light);
}

.card-meta,
.card-desc {
    color: var(--muted);
    font-size: 0.86rem;
}

.card-meta {
    margin: 8px 0 0;
}

.card-desc {
    display: -webkit-box;
    overflow: hidden;
    min-height: 3.8em;
    margin: 9px 0 0;
    line-height: 1.65;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.tag-row {
    margin-top: 12px;
}

.compact .card-desc {
    -webkit-line-clamp: 2;
    min-height: 2.8em;
}

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

.category-card a {
    min-height: 230px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background:
        linear-gradient(145deg, rgba(124, 58, 237, 0.2), rgba(15, 23, 42, 0.72)),
        rgba(15, 23, 42, 0.72);
    transition: transform 0.22s ease, border-color 0.22s ease;
}

.category-card a:hover {
    border-color: rgba(245, 158, 11, 0.5);
    transform: translateY(-4px);
}

.category-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: #1f1300;
    font-size: 1.3rem;
    font-weight: 900;
    background: linear-gradient(135deg, #fef3c7, #f59e0b);
}

.category-card h3 {
    margin: 18px 0 8px;
    font-size: 1.3rem;
}

.category-card p,
.category-overview-card p,
.page-hero p,
.detail-lead,
.text-card p {
    color: #cbd5e1;
    line-height: 1.8;
}

.mini-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 16px;
    color: var(--amber-light);
    font-size: 0.86rem;
    font-weight: 700;
}

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

.rank-row {
    display: grid;
    grid-template-columns: 58px 74px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.7);
}

.rank-number {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: #1f1300;
    font-weight: 900;
    background: linear-gradient(135deg, #fde68a, #f59e0b);
}

.rank-cover {
    height: 98px;
    overflow: hidden;
    border-radius: 16px;
}

.rank-title {
    font-size: 1.08rem;
    font-weight: 900;
}

.rank-info p {
    display: -webkit-box;
    overflow: hidden;
    margin: 7px 0 0;
    color: var(--muted);
    line-height: 1.6;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.rank-heat {
    padding: 8px 12px;
    border-radius: 999px;
    color: #fef3c7;
    background: rgba(124, 58, 237, 0.42);
    font-weight: 900;
    white-space: nowrap;
}

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

.page-hero {
    padding: 38px;
    border: 1px solid var(--line);
    border-radius: 30px;
    background:
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.22), transparent 22rem),
        linear-gradient(135deg, rgba(124, 58, 237, 0.24), rgba(15, 23, 42, 0.82));
    box-shadow: var(--shadow);
}

.page-hero h1 {
    max-width: 880px;
    font-size: clamp(2.1rem, 5vw, 4rem);
}

.page-hero p {
    max-width: 760px;
    margin: 16px 0 0;
}

.category-overview-card {
    margin-top: 28px;
    padding: 26px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 28px;
    background: rgba(15, 23, 42, 0.58);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    color: #cbd5e1;
    font-size: 0.92rem;
}

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

.detail-hero {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 30px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 32px;
    background:
        radial-gradient(circle at 20% 0, rgba(245, 158, 11, 0.18), transparent 28rem),
        linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(30, 41, 59, 0.68));
    box-shadow: var(--shadow);
}

.detail-poster {
    overflow: hidden;
    border: 1px solid rgba(253, 230, 138, 0.18);
    border-radius: 26px;
    aspect-ratio: 2 / 3;
}

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

.detail-info h1 {
    font-size: clamp(2.2rem, 5vw, 4.6rem);
    line-height: 1.05;
}

.detail-lead {
    max-width: 820px;
    margin: 18px 0 0;
    font-size: 1.08rem;
}

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

.detail-tags {
    margin-top: 16px;
}

.player-section {
    margin-top: 34px;
}

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

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

.play-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 0;
    color: #1f1300;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.1), rgba(2, 6, 23, 0.62));
    cursor: pointer;
}

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

.play-button {
    width: 92px;
    height: 92px;
    display: grid;
    place-items: center;
    padding-left: 6px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fde68a, #f59e0b);
    box-shadow: 0 20px 60px rgba(245, 158, 11, 0.32);
    font-size: 2rem;
}

.detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-top: 32px;
}

.text-card {
    padding: 28px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 26px;
    background: rgba(15, 23, 42, 0.72);
}

.text-card h2 {
    color: var(--amber-light);
    font-size: 1.5rem;
}

.text-card p {
    margin-bottom: 0;
}

.site-footer {
    margin-top: 76px;
    border-top: 1px solid var(--line);
    background: rgba(2, 6, 23, 0.72);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    padding: 42px 0;
}

.footer-brand {
    margin-bottom: 12px;
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--amber-light);
}

.site-footer p {
    max-width: 560px;
    color: var(--muted);
    line-height: 1.8;
}

.site-footer h3 {
    margin-top: 0;
    color: var(--amber-light);
}

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

.footer-links a {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.86);
    color: #cbd5e1;
}

.footer-bottom {
    padding: 18px 16px 28px;
    color: #64748b;
    text-align: center;
}

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

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

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

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

@media (max-width: 820px) {
    .nav-toggle {
        display: block;
    }

    .site-nav {
        position: absolute;
        top: 72px;
        right: 14px;
        left: 14px;
        display: none;
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
        border: 1px solid var(--line);
        border-radius: 20px;
        background: rgba(2, 6, 23, 0.96);
    }

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

    .hero {
        min-height: 660px;
        height: 86vh;
    }

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

    .hero h1 {
        font-size: clamp(2.25rem, 12vw, 4rem);
    }

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

    .hero-thumb:not(.active) {
        display: none;
    }

    .hero-arrow {
        top: auto;
        bottom: 122px;
        transform: none;
    }

    .home-search,
    .detail-hero,
    .detail-content,
    .footer-grid {
        grid-template-columns: 1fr;
    }

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

    .select-row {
        grid-template-columns: 1fr;
    }

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

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

    .rank-heat {
        grid-column: 3;
        width: max-content;
    }
}

@media (max-width: 540px) {
    .header-inner {
        min-height: 66px;
    }

    .brand-text {
        font-size: 1.08rem;
    }

    .hero {
        min-height: 630px;
    }

    .hero-content {
        width: min(100% - 24px, 1180px);
    }

    .hero-arrow {
        width: 42px;
        height: 52px;
    }

    .home-search,
    .page-hero,
    .detail-hero,
    .text-card,
    .category-overview-card {
        padding: 20px;
        border-radius: 22px;
    }

    .movie-grid.full-grid,
    .movie-grid,
    .movie-grid.small-grid,
    .category-grid {
        grid-template-columns: 1fr;
    }

    .rank-row {
        grid-template-columns: 42px 58px 1fr;
        gap: 10px;
    }

    .rank-info p {
        -webkit-line-clamp: 1;
    }
}
