:root {
    color-scheme: dark;
    --bg: #0f172a;
    --panel: #111827;
    --panel-soft: #1e293b;
    --panel-strong: #020617;
    --text: #f8fafc;
    --muted: #94a3b8;
    --line: rgba(148, 163, 184, 0.22);
    --red: #ef4444;
    --red-dark: #dc2626;
    --orange: #f97316;
    --gold: #f59e0b;
    --radius: 22px;
    --shadow: 0 22px 55px rgba(2, 6, 23, 0.45);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 0%, rgba(239, 68, 68, 0.15), transparent 28rem),
        radial-gradient(circle at 90% 10%, rgba(249, 115, 22, 0.12), transparent 30rem),
        linear-gradient(180deg, #0f172a 0%, #020617 100%);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", 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: 50;
    background: rgba(15, 23, 42, 0.84);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
}

.nav-wrap {
    width: min(1240px, calc(100% - 32px));
    height: 68px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    font-size: 24px;
    letter-spacing: -0.03em;
    background: linear-gradient(90deg, var(--red), var(--orange));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    white-space: nowrap;
}

.brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    background: linear-gradient(135deg, var(--red), var(--orange));
    box-shadow: 0 10px 28px rgba(239, 68, 68, 0.35);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 22px;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 700;
}

.nav-links a {
    position: relative;
    padding: 22px 0;
    transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: #fff;
}

.nav-links a.active::after,
.nav-links a:hover::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 14px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--red), var(--orange));
}

.mobile-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: #fff;
    background: rgba(30, 41, 59, 0.8);
}

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

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.7s ease, visibility 0.7s ease;
}

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

.hero-bg,
.detail-hero::before,
.category-tile::before {
    background-image: var(--hero-image, var(--detail-image, var(--tile-image)));
    background-size: cover;
    background-position: center;
}

.hero-bg {
    position: absolute;
    inset: 0;
    transform: scale(1.08);
    filter: saturate(1.12) contrast(1.08);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.95) 0%, rgba(15, 23, 42, 0.75) 44%, rgba(15, 23, 42, 0.15) 100%),
        linear-gradient(0deg, #0f172a 0%, rgba(15, 23, 42, 0) 30%),
        radial-gradient(circle at 70% 20%, rgba(239, 68, 68, 0.22), transparent 28rem);
}

.hero-inner {
    position: relative;
    z-index: 2;
    width: min(1240px, calc(100% - 32px));
    min-height: 660px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: center;
    gap: 56px;
    padding: 70px 0 96px;
}

.eyebrow {
    margin: 0 0 14px;
    color: #fecaca;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 13px;
    font-weight: 900;
}

.hero-copy h1,
.page-hero h1,
.detail-copy h1 {
    margin: 0;
    max-width: 780px;
    font-size: clamp(40px, 7vw, 82px);
    line-height: 0.98;
    font-weight: 950;
    letter-spacing: -0.06em;
}

.hero-line,
.detail-line,
.page-hero p {
    max-width: 760px;
    margin: 24px 0 0;
    color: rgba(248, 250, 252, 0.86);
    font-size: clamp(18px, 2vw, 24px);
    line-height: 1.65;
}

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

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

.hero-tags span,
.tag-row span {
    border: 1px solid rgba(248, 250, 252, 0.18);
    background: rgba(248, 250, 252, 0.1);
    color: #fff;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 700;
    backdrop-filter: blur(12px);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 34px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 22px;
    border-radius: 999px;
    font-weight: 900;
    transition: transform 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}

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

.btn.primary {
    background: linear-gradient(135deg, var(--red), var(--orange));
    color: #fff;
    box-shadow: 0 18px 38px rgba(239, 68, 68, 0.35);
}

.btn.ghost {
    border: 1px solid rgba(255, 255, 255, 0.32);
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    backdrop-filter: blur(16px);
}

.btn.soft {
    background: rgba(15, 23, 42, 0.78);
    color: #fff;
    border: 1px solid rgba(148, 163, 184, 0.26);
}

.hero-poster {
    position: relative;
    overflow: hidden;
    display: block;
    height: 510px;
    border-radius: 32px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: rotate(2deg);
    transition: transform 0.3s ease;
}

.hero-poster:hover {
    transform: rotate(0deg) translateY(-6px);
}

.hero-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: linear-gradient(135deg, #991b1b, #111827);
}

.hero-poster span {
    position: absolute;
    left: 18px;
    bottom: 18px;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.72);
    color: #fff;
    font-weight: 900;
    backdrop-filter: blur(12px);
}

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

.hero-dots button {
    width: 38px;
    height: 4px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.32);
}

.hero-dots button.active {
    background: linear-gradient(90deg, var(--red), var(--orange));
}

.search-panel,
.filter-bar,
.section-wrap,
.rank-section,
.detail-content,
.player-section,
.page-hero {
    width: min(1240px, calc(100% - 32px));
    margin-left: auto;
    margin-right: auto;
}

.search-panel {
    margin-top: -44px;
    position: relative;
    z-index: 5;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px;
    align-items: center;
    padding: 20px;
    border: 1px solid var(--line);
    background: rgba(15, 23, 42, 0.9);
    border-radius: 26px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.45);
    padding: 0 16px;
    min-height: 48px;
}

.search-box.wide {
    min-height: 58px;
}

.search-box span {
    color: var(--red);
    font-size: 24px;
    line-height: 1;
}

.search-box input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    color: #fff;
    background: transparent;
}

.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.quick-links a,
.more-link,
.page-neighbor a {
    color: #fecaca;
    font-weight: 900;
    transition: color 0.2s ease;
}

.quick-links a {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.12);
}

.quick-links a:hover,
.more-link:hover,
.page-neighbor a:hover {
    color: #fff;
}

.section-wrap,
.rank-section {
    padding: 74px 0 0;
}

.section-wrap.no-top {
    padding-top: 28px;
}

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

.section-head h2 {
    margin: 0;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

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

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

.movie-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(30, 41, 59, 0.72);
    box-shadow: 0 18px 34px rgba(2, 6, 23, 0.22);
    transition: transform 0.26s ease, box-shadow 0.26s ease, border-color 0.26s ease;
}

.movie-card:hover {
    transform: translateY(-8px);
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 28px 60px rgba(2, 6, 23, 0.36);
}

.movie-cover {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(135deg, #7f1d1d, #0f172a);
}

.movie-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.42s ease, opacity 0.42s ease;
}

.movie-card:hover .movie-cover img {
    transform: scale(1.08);
    opacity: 0.86;
}

.movie-year,
.movie-play {
    position: absolute;
    z-index: 2;
    border-radius: 999px;
    font-weight: 900;
}

.movie-year {
    top: 12px;
    left: 12px;
    padding: 5px 10px;
    background: rgba(2, 6, 23, 0.72);
    color: #fff;
    font-size: 12px;
    backdrop-filter: blur(10px);
}

.movie-play {
    right: 12px;
    bottom: 12px;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, var(--red), var(--orange));
    box-shadow: 0 16px 28px rgba(239, 68, 68, 0.36);
}

.movie-info {
    padding: 18px;
}

.movie-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.movie-meta a {
    color: #fecaca;
}

.movie-info h3,
.rank-body h3 {
    margin: 10px 0 8px;
    color: #fff;
    font-size: 19px;
    line-height: 1.28;
    letter-spacing: -0.02em;
}

.movie-info h3 a:hover,
.rank-body h3 a:hover {
    color: #fecaca;
}

.movie-info p,
.rank-body p {
    margin: 0;
    color: #cbd5e1;
    font-size: 14px;
}

.tag-row {
    margin-top: 14px;
    gap: 6px;
}

.tag-row span {
    padding: 4px 8px;
    color: #cbd5e1;
    font-size: 11px;
}

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

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

.category-tile {
    position: relative;
    overflow: hidden;
    min-height: 170px;
    border-radius: 26px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 8px;
    padding: 22px;
    border: 1px solid var(--line);
    background: #111827;
    box-shadow: 0 20px 40px rgba(2, 6, 23, 0.28);
}

.category-tile::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.34;
    transform: scale(1.08);
    transition: transform 0.28s ease, opacity 0.28s ease;
}

.category-tile::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(239, 68, 68, 0.78), rgba(15, 23, 42, 0.9));
}

.category-tile:hover::before {
    transform: scale(1.16);
    opacity: 0.52;
}

.category-tile span,
.category-tile strong {
    position: relative;
    z-index: 2;
}

.category-tile span {
    color: #fff;
    font-size: 24px;
    font-weight: 950;
    letter-spacing: -0.04em;
}

.category-tile strong {
    color: rgba(255, 255, 255, 0.82);
    font-size: 14px;
    font-weight: 600;
}

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

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

.rank-item {
    display: grid;
    grid-template-columns: 64px 96px 1fr;
    gap: 16px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(30, 41, 59, 0.68);
    padding: 14px;
    transition: transform 0.22s ease, border-color 0.22s ease;
}

.rank-item:hover {
    transform: translateY(-4px);
    border-color: rgba(239, 68, 68, 0.5);
}

.rank-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    color: #fff;
    background: rgba(148, 163, 184, 0.16);
    font-size: 18px;
    font-weight: 950;
}

.rank-item.top-three .rank-num {
    background: linear-gradient(135deg, var(--red), var(--gold));
    box-shadow: 0 16px 28px rgba(239, 68, 68, 0.24);
}

.rank-thumb {
    overflow: hidden;
    width: 96px;
    height: 76px;
    border-radius: 16px;
    background: linear-gradient(135deg, #7f1d1d, #111827);
}

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

.page-hero {
    position: relative;
    overflow: hidden;
    margin-top: 34px;
    padding: 70px;
    border: 1px solid var(--line);
    border-radius: 36px;
    background:
        radial-gradient(circle at 90% 0%, rgba(239, 68, 68, 0.25), transparent 30rem),
        linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(2, 6, 23, 0.95));
    box-shadow: var(--shadow);
}

.small-hero h1 {
    font-size: clamp(38px, 6vw, 66px);
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 170px 170px 170px auto;
    gap: 12px;
    align-items: center;
    padding-top: 28px;
}

.filter-bar select,
.view-toggle button {
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 14px;
    outline: 0;
    color: #fff;
    background: rgba(30, 41, 59, 0.8);
    padding: 0 14px;
}

.view-toggle {
    display: inline-flex;
    gap: 8px;
}

.view-toggle button.active {
    border-color: rgba(239, 68, 68, 0.55);
    background: linear-gradient(135deg, var(--red), var(--orange));
}

.movie-grid.list-view {
    display: grid;
    grid-template-columns: 1fr;
}

.movie-grid.list-view .movie-card {
    display: grid;
    grid-template-columns: 240px 1fr;
}

.movie-grid.list-view .movie-cover {
    aspect-ratio: auto;
    height: 100%;
    min-height: 190px;
}

.empty-state {
    display: none;
    margin: 24px 0;
    padding: 34px;
    text-align: center;
    color: #cbd5e1;
    border: 1px dashed var(--line);
    border-radius: 22px;
    background: rgba(30, 41, 59, 0.55);
}

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

.detail-hero {
    position: relative;
    min-height: 610px;
    overflow: hidden;
    background: #020617;
}

.detail-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    transform: scale(1.06);
    filter: saturate(1.08) blur(1px);
    opacity: 0.42;
}

.detail-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(15, 23, 42, 0.62), rgba(2, 6, 23, 0.88)),
        linear-gradient(0deg, #0f172a 0%, rgba(15, 23, 42, 0) 40%);
}

.detail-hero-inner {
    position: relative;
    z-index: 2;
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 46px 0 70px;
}

.back-link {
    display: inline-flex;
    margin-bottom: 28px;
    color: #fecaca;
    font-weight: 900;
}

.detail-grid {
    display: grid;
    grid-template-columns: 330px minmax(0, 1fr);
    gap: 52px;
    align-items: center;
}

.detail-poster {
    overflow: hidden;
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: var(--shadow);
    background: linear-gradient(135deg, #7f1d1d, #111827);
}

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

.player-section {
    padding-top: 44px;
}

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

.movie-video {
    width: 100%;
    height: 100%;
    background: #000;
}

.player-start {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
    justify-content: center;
    border: 0;
    color: #fff;
    background:
        radial-gradient(circle, rgba(239, 68, 68, 0.28), transparent 18rem),
        rgba(2, 6, 23, 0.52);
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.player-start span {
    width: 86px;
    height: 86px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--red), var(--orange));
    box-shadow: 0 20px 44px rgba(239, 68, 68, 0.38);
    font-size: 30px;
}

.player-start strong {
    font-size: 22px;
}

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

.detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr 360px;
    gap: 20px;
    padding-top: 34px;
}

.content-card {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(30, 41, 59, 0.72);
    padding: 26px;
}

.content-card h2 {
    margin: 0 0 14px;
    font-size: 24px;
    letter-spacing: -0.03em;
}

.content-card p {
    margin: 0;
    color: #dbeafe;
}

.info-card dl {
    display: grid;
    grid-template-columns: 70px 1fr;
    gap: 10px 14px;
    margin: 0;
}

.info-card dt {
    color: var(--muted);
    font-weight: 800;
}

.info-card dd {
    margin: 0;
    color: #fff;
}

.related-section {
    padding-bottom: 74px;
}

.page-neighbor {
    display: flex;
    gap: 18px;
}

.site-footer {
    margin-top: 80px;
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.5), #020617);
}

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

.footer-brand p {
    max-width: 420px;
    color: var(--muted);
}

.footer-links h2 {
    margin: 0 0 16px;
    font-size: 18px;
}

.footer-links div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
}

.footer-links a {
    color: #cbd5e1;
    font-size: 14px;
}

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

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

[hidden] {
    display: none !important;
}

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

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

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

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

@media (max-width: 820px) {
    .mobile-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .nav-links {
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 10px 22px 18px;
        background: rgba(15, 23, 42, 0.96);
        border-bottom: 1px solid var(--line);
    }

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

    .nav-links a {
        padding: 12px 0;
    }

    .hero,
    .hero-inner {
        min-height: 760px;
    }

    .hero-inner {
        grid-template-columns: 1fr;
        gap: 30px;
        padding-top: 40px;
    }

    .hero-poster {
        width: min(320px, 100%);
        height: 430px;
        transform: none;
    }

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

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

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

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

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

    .page-hero {
        padding: 42px 26px;
    }

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

@media (max-width: 560px) {
    .brand {
        font-size: 20px;
    }

    .hero-copy h1,
    .detail-copy h1,
    .page-hero h1 {
        font-size: 38px;
    }

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

    .movie-grid.list-view .movie-card {
        grid-template-columns: 1fr;
    }

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

    .rank-item {
        grid-template-columns: 48px 80px 1fr;
        gap: 10px;
        padding: 10px;
    }

    .rank-num {
        width: 42px;
        height: 42px;
        border-radius: 14px;
    }

    .rank-thumb {
        width: 80px;
        height: 64px;
    }

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