:root {
    color-scheme: dark;
    --bg: #020617;
    --panel: rgba(15, 23, 42, 0.82);
    --panel-strong: rgba(15, 23, 42, 0.95);
    --line: rgba(148, 163, 184, 0.18);
    --line-strong: rgba(245, 158, 11, 0.28);
    --text: #f8fafc;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --accent: #f59e0b;
    --accent-dark: #d97706;
    --accent-soft: rgba(245, 158, 11, 0.16);
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.36);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(245, 158, 11, 0.12), transparent 26rem),
        linear-gradient(180deg, #020617 0%, #0f172a 46%, #020617 100%);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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: 80;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.98));
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(18px);
}

.nav-shell,
.footer-shell,
.content-shell {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
}

.nav-shell {
    min-height: 68px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: max-content;
    font-weight: 800;
    font-size: 1.18rem;
    letter-spacing: 0.02em;
}

.brand-mark {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #f97316);
    box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.11);
}

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

.nav-links a,
.mobile-panel a {
    color: var(--soft);
    font-weight: 600;
    transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.is-active,
.mobile-panel a:hover,
.mobile-panel a.is-active {
    color: #fbbf24;
}

.search-form {
    position: relative;
    display: flex;
    align-items: center;
    width: min(300px, 28vw);
}

.search-input {
    width: 100%;
    height: 40px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    padding: 0 46px 0 14px;
    outline: none;
    color: var(--text);
    background: rgba(15, 23, 42, 0.82);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
    border-color: rgba(245, 158, 11, 0.65);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

.search-button,
.nav-toggle {
    border: 0;
    color: var(--soft);
    background: transparent;
    cursor: pointer;
}

.search-button {
    position: absolute;
    right: 9px;
    width: 30px;
    height: 30px;
    border-radius: 10px;
}

.search-button:hover,
.nav-toggle:hover {
    color: #fbbf24;
}

.nav-toggle {
    display: none;
    margin-left: auto;
    font-size: 1.6rem;
}

.mobile-panel {
    display: none;
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 0 0 18px;
    border-top: 1px solid var(--line);
}

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

.mobile-panel nav {
    display: grid;
    gap: 12px;
    padding-top: 16px;
}

.main-bg {
    min-height: 70vh;
}

.hero {
    position: relative;
    height: 600px;
    overflow: hidden;
    background: #020617;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.9s ease;
}

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

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
}

.hero-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(0deg, #020617 0%, rgba(15, 23, 42, 0.82) 38%, rgba(2, 6, 23, 0.12) 100%),
        linear-gradient(90deg, rgba(2, 6, 23, 0.78), rgba(2, 6, 23, 0.2));
}

.hero-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 56px 0 74px;
}

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

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fbbf24;
    font-weight: 800;
    margin-bottom: 18px;
}

.hero h1,
.hero h2 {
    max-width: 820px;
    margin: 0 0 18px;
    font-size: clamp(2.2rem, 5vw, 4.6rem);
    line-height: 1.05;
    font-weight: 900;
    letter-spacing: -0.05em;
}

.hero p {
    max-width: 760px;
    margin: 0 0 24px;
    color: #d1d5db;
    font-size: clamp(1rem, 1.7vw, 1.18rem);
    line-height: 1.8;
}

.meta-row,
.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.meta-row {
    margin-bottom: 26px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 7px 13px;
    background: rgba(15, 23, 42, 0.68);
    color: var(--soft);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.badge-accent {
    color: #fbbf24;
    background: var(--accent-soft);
    border-color: rgba(245, 158, 11, 0.26);
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border-radius: 12px;
    font-weight: 800;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    box-shadow: 0 14px 30px rgba(245, 158, 11, 0.22);
}

.btn-ghost {
    color: var(--text);
    border: 1px solid var(--line);
    background: rgba(15, 23, 42, 0.68);
}

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 4;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 0;
    color: #fff;
    background: rgba(0, 0, 0, 0.48);
    cursor: pointer;
    font-size: 1.8rem;
    transition: background 0.2s ease;
}

.hero-arrow:hover {
    background: rgba(0, 0, 0, 0.72);
}

.hero-prev {
    left: 18px;
}

.hero-next {
    right: 18px;
}

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

.hero-dot {
    width: 9px;
    height: 9px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: width 0.2s ease, background 0.2s ease;
}

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

.section {
    padding: 56px 0 0;
}

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

.section-title {
    margin: 0;
    font-size: clamp(1.45rem, 3vw, 2.1rem);
    line-height: 1.2;
    font-weight: 900;
}

.section-desc {
    max-width: 720px;
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.8;
}

.more-link {
    min-width: max-content;
    color: #fbbf24;
    font-weight: 800;
}

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

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

.movie-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.62);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
    transition: transform 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}

.movie-card:hover {
    transform: translateY(-4px);
    border-color: rgba(245, 158, 11, 0.42);
    background: rgba(30, 41, 59, 0.78);
}

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

.movie-grid.compact .movie-card .poster-wrap,
.movie-card.horizontal .poster-wrap {
    aspect-ratio: 16 / 9;
}

.movie-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.play-layer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    background: rgba(0, 0, 0, 0.36);
    transition: opacity 0.2s ease;
}

.movie-card:hover .play-layer {
    opacity: 1;
}

.play-circle {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #fff;
    background: rgba(245, 158, 11, 0.92);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
}

.card-chip {
    position: absolute;
    top: 10px;
    right: 10px;
    border-radius: 999px;
    padding: 5px 9px;
    color: #fff;
    font-size: 0.76rem;
    font-weight: 800;
    background: rgba(0, 0, 0, 0.66);
}

.card-score {
    position: absolute;
    left: 10px;
    bottom: 10px;
    border-radius: 999px;
    padding: 5px 9px;
    color: #fbbf24;
    font-size: 0.78rem;
    font-weight: 900;
    background: rgba(0, 0, 0, 0.68);
}

.movie-card-body {
    padding: 14px;
}

.movie-card h3 {
    margin: 0 0 8px;
    color: #fff;
    font-size: 0.98rem;
    font-weight: 850;
    line-height: 1.45;
    transition: color 0.2s ease;
}

.movie-card:hover h3 {
    color: #fbbf24;
}

.movie-card p {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.65;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: #64748b;
    font-size: 0.78rem;
}

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

.category-tile {
    min-height: 190px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 22px;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.16), transparent 12rem),
        rgba(15, 23, 42, 0.72);
    transition: transform 0.22s ease, border-color 0.22s ease;
}

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

.category-tile h3 {
    margin: 0 0 10px;
    font-size: 1.3rem;
    font-weight: 900;
}

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

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

.rank-item {
    display: grid;
    grid-template-columns: 56px 94px 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.62);
    transition: background 0.2s ease, transform 0.2s ease;
}

.rank-item:hover {
    transform: translateX(4px);
    background: rgba(30, 41, 59, 0.78);
}

.rank-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    font-weight: 900;
    color: #fbbf24;
    background: var(--accent-soft);
}

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

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

.rank-main h3 {
    margin: 0 0 7px;
    font-size: 1rem;
    font-weight: 850;
}

.rank-main p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.rank-score {
    color: #fbbf24;
    font-weight: 900;
    min-width: max-content;
}

.page-hero {
    padding: 64px 0 34px;
    border-bottom: 1px solid var(--line);
    background:
        radial-gradient(circle at 16% 20%, rgba(245, 158, 11, 0.16), transparent 22rem),
        linear-gradient(180deg, rgba(15, 23, 42, 0.56), rgba(2, 6, 23, 0));
}

.page-hero h1 {
    max-width: 900px;
    margin: 0 0 14px;
    font-size: clamp(2.1rem, 4vw, 3.6rem);
    line-height: 1.1;
    font-weight: 950;
    letter-spacing: -0.045em;
}

.page-hero p {
    max-width: 760px;
    margin: 0;
    color: var(--soft);
    font-size: 1.05rem;
    line-height: 1.8;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 0.94rem;
}

.breadcrumb a {
    color: #fbbf24;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin: 24px 0 28px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.62);
}

.filter-select,
.filter-text {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0 14px;
    color: var(--text);
    background: rgba(2, 6, 23, 0.7);
    outline: none;
}

.filter-text {
    min-width: min(320px, 100%);
    flex: 1;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 26px;
    padding-top: 30px;
}

.player-shell {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 24px;
    background: #000;
    box-shadow: var(--shadow);
}

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

.player-start {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    border: 0;
    color: #fff;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.72), rgba(2, 6, 23, 0.24));
    cursor: pointer;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.player-shell.is-playing .player-start {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.player-start .play-circle {
    width: 76px;
    height: 76px;
    font-size: 1.55rem;
}

.detail-panel,
.info-card {
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.66);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.18);
}

.detail-panel {
    margin-top: 22px;
    padding: 24px;
}

.detail-panel h2,
.info-card h2 {
    margin: 0 0 16px;
    font-size: 1.35rem;
    font-weight: 900;
}

.detail-panel p {
    margin: 0 0 18px;
    color: var(--soft);
    line-height: 1.9;
}

.info-card {
    padding: 22px;
}

.info-row {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
    color: var(--soft);
}

.info-row:last-child {
    border-bottom: 0;
}

.info-label {
    color: #64748b;
}

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

.search-panel {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: start center;
    padding: 84px 16px 32px;
    background: rgba(2, 6, 23, 0.76);
    backdrop-filter: blur(10px);
}

.search-panel[hidden] {
    display: none;
}

.search-dialog {
    width: min(920px, 100%);
    max-height: calc(100vh - 116px);
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--panel-strong);
    box-shadow: var(--shadow);
}

.search-dialog-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    background: rgba(15, 23, 42, 0.98);
}

.search-dialog-head h2 {
    margin: 0;
    font-size: 1.2rem;
}

.search-close {
    border: 0;
    border-radius: 12px;
    width: 38px;
    height: 38px;
    color: var(--text);
    background: rgba(148, 163, 184, 0.12);
    cursor: pointer;
}

.search-results {
    display: grid;
    gap: 12px;
    padding: 18px;
}

.search-result {
    display: grid;
    grid-template-columns: 84px 1fr;
    gap: 14px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 10px;
    background: rgba(2, 6, 23, 0.36);
}

.search-result img {
    width: 84px;
    height: 72px;
    border-radius: 12px;
    object-fit: cover;
}

.search-result h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.search-result p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

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

.footer-shell {
    padding: 42px 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: 28px;
}

.footer-title {
    margin: 0 0 14px;
    color: #fff;
    font-weight: 900;
}

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

.footer-shell ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-shell li + li {
    margin-top: 8px;
}

.footer-shell a:hover {
    color: #fbbf24;
}

.footer-bottom {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    color: #64748b;
    text-align: center;
}

.line-clamp-1,
.line-clamp-2,
.line-clamp-3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-1 {
    -webkit-line-clamp: 1;
}

.line-clamp-2 {
    -webkit-line-clamp: 2;
}

.line-clamp-3 {
    -webkit-line-clamp: 3;
}

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

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

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

@media (max-width: 820px) {
    .nav-links,
    .site-header > .nav-shell > .search-form {
        display: none;
    }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-panel .search-form {
        width: 100%;
        margin-top: 14px;
    }

    .hero {
        height: 540px;
    }

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

    .hero-arrow {
        display: none;
    }

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

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

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

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

    .rank-score {
        grid-column: 3;
    }

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

@media (max-width: 520px) {
    .nav-shell,
    .footer-shell,
    .content-shell,
    .hero-inner {
        width: min(100% - 22px, 1280px);
    }

    .brand {
        font-size: 1rem;
    }

    .hero {
        height: 500px;
    }

    .hero h1,
    .hero h2 {
        font-size: 2.05rem;
    }

    .movie-grid,
    .movie-grid.compact,
    .related-grid {
        gap: 12px;
    }

    .movie-card-body {
        padding: 12px;
    }

    .filter-bar {
        display: grid;
    }

    .filter-select,
    .filter-text {
        width: 100%;
    }

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