:root {
    --red: #dc2626;
    --red-dark: #991b1b;
    --blue: #2563eb;
    --ink: #111827;
    --muted: #6b7280;
    --soft: #f8fafc;
    --line: #e5e7eb;
    --card: #ffffff;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--ink);
    background: #f3f4f6;
    line-height: 1.6;
}

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

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

button,
input,
select {
    font: inherit;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(18px);
    box-shadow: 0 1px 20px rgba(15, 23, 42, 0.08);
}

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

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--red);
    font-size: 22px;
    font-weight: 900;
    white-space: nowrap;
}

.brand-mark {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--red), #f97316);
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.3);
    font-size: 15px;
}

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

.nav-link {
    color: #374151;
    font-weight: 700;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active,
.mobile-nav-link.active {
    color: var(--red);
}

.top-search {
    margin-left: auto;
    display: flex;
    align-items: center;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.top-search input,
.mobile-search input,
.search-page-form input {
    border: 0;
    outline: 0;
    background: transparent;
    padding: 10px 14px;
    min-width: 230px;
}

.top-search button,
.mobile-search button,
.search-page-form button {
    border: 0;
    color: #ffffff;
    background: var(--red);
    padding: 10px 18px;
    font-weight: 800;
    cursor: pointer;
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    background: transparent;
    padding: 8px;
}

.menu-toggle span {
    display: block;
    height: 2px;
    margin: 6px 0;
    background: #111827;
    border-radius: 999px;
}

.mobile-nav {
    display: grid;
    gap: 12px;
    padding: 0 16px 18px;
    background: #ffffff;
    border-top: 1px solid #f3f4f6;
}

.mobile-nav[hidden] {
    display: none;
}

.mobile-nav-link {
    padding: 10px 0;
    font-weight: 800;
}

.mobile-search {
    display: flex;
    border-radius: 999px;
    overflow: hidden;
    background: #f3f4f6;
}

.hero-carousel {
    position: relative;
    min-height: 650px;
    background: #050505;
    overflow: hidden;
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: center;
    gap: 48px;
    padding: 72px max(32px, calc((100vw - 1180px) / 2)) 96px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.7s ease;
}

.hero-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.hero-slide::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--hero-image);
    background-size: cover;
    background-position: center;
    filter: blur(20px) saturate(1.1);
    transform: scale(1.08);
    opacity: 0.34;
}

.hero-backdrop {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.62) 48%, rgba(0, 0, 0, 0.2));
}

.hero-copy,
.hero-poster {
    position: relative;
    z-index: 2;
}

.eyebrow,
.hero-meta,
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.eyebrow span,
.eyebrow strong,
.hero-meta span,
.detail-meta span {
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 800;
}

.eyebrow span {
    color: #ffffff;
    background: var(--red);
}

.eyebrow strong {
    color: #fbbf24;
    background: rgba(255, 255, 255, 0.12);
}

.hero-copy h1 {
    margin: 22px 0 18px;
    color: #ffffff;
    font-size: clamp(42px, 7vw, 74px);
    line-height: 1.03;
    letter-spacing: -0.04em;
}

.hero-copy p {
    max-width: 720px;
    color: #d1d5db;
    font-size: 19px;
}

.hero-meta {
    margin: 26px 0 34px;
}

.hero-meta span {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-actions,
.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.primary-btn,
.ghost-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 24px;
    border-radius: 999px;
    font-weight: 900;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-btn {
    color: #ffffff;
    background: linear-gradient(135deg, var(--red), #f97316);
    box-shadow: 0 14px 32px rgba(220, 38, 38, 0.34);
}

.ghost-btn {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.primary-btn:hover,
.ghost-btn:hover,
.movie-card:hover,
.category-card:hover {
    transform: translateY(-3px);
}

.hero-poster {
    display: block;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.55);
    transform: rotate(2deg);
}

.hero-poster img {
    width: 100%;
    height: 520px;
    object-fit: cover;
}

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

.hero-dot {
    width: 42px;
    height: 6px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.34);
    cursor: pointer;
}

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

.category-strip {
    margin-top: -38px;
    position: relative;
    z-index: 6;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 24px;
    align-items: center;
    padding: 22px;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.category-strip h2 {
    margin: 0;
    font-size: 22px;
}

.category-strip div {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.category-strip a {
    padding: 9px 16px;
    border-radius: 999px;
    background: #fee2e2;
    color: var(--red-dark);
    font-weight: 800;
}

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

.stacked-sections {
    display: grid;
    gap: 20px;
    margin-bottom: 58px;
}

.soft-section {
    padding: 28px;
    border-radius: 28px;
    background: linear-gradient(135deg, #fff7ed, #fff1f2);
}

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

.section-title span,
.page-hero span {
    color: var(--red);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.section-title h2,
.page-hero h1 {
    margin: 4px 0 0;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.1;
}

.section-title a {
    color: var(--red);
    font-weight: 900;
}

.home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: start;
}

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

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

.movie-card {
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: 0 8px 26px rgba(15, 23, 42, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.movie-card:hover {
    box-shadow: 0 20px 42px rgba(15, 23, 42, 0.16);
}

.poster-link {
    position: relative;
    display: block;
    overflow: hidden;
    background: #111827;
}

.poster-link img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    transition: transform 0.45s ease;
}

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

.card-play {
    position: absolute;
    left: 50%;
    top: 50%;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(220, 38, 38, 0.9);
    transform: translate(-50%, -50%) scale(0.82);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.movie-card:hover .card-play {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.quality,
.score,
.rank-badge {
    position: absolute;
    top: 10px;
    z-index: 2;
    border-radius: 999px;
    padding: 4px 8px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
}

.quality {
    left: 10px;
    background: rgba(0, 0, 0, 0.66);
}

.score {
    right: 10px;
    background: var(--red);
}

.rank-badge {
    left: 10px;
    top: 10px;
    min-width: 34px;
    text-align: center;
    background: linear-gradient(135deg, #facc15, #f97316);
}

.rank-badge + img + .card-play + .quality {
    top: 46px;
}

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

.movie-card h2 {
    margin: 0;
    font-size: 17px;
    line-height: 1.35;
}

.movie-card h2 a:hover {
    color: var(--red);
}

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

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

.meta-row span,
.tag-list span {
    color: #6b7280;
    background: #f3f4f6;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 800;
}

.tag-list span {
    color: var(--red-dark);
    background: #fee2e2;
}

.rank-panel {
    position: sticky;
    top: 88px;
    padding: 20px;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.rank-panel h2 {
    margin: 0 0 16px;
    font-size: 22px;
}

.mini-list {
    display: grid;
    gap: 10px;
}

.mini-card {
    display: grid;
    grid-template-columns: auto 72px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: 14px;
    transition: background 0.2s ease;
}

.mini-card:hover {
    background: #f9fafb;
}

.mini-rank {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    color: #ffffff;
    background: var(--red);
    font-weight: 900;
}

.mini-card img {
    width: 72px;
    height: 54px;
    object-fit: cover;
    border-radius: 10px;
}

.mini-card strong,
.mini-card em {
    display: block;
}

.mini-card strong {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.mini-card em {
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

.page-main {
    min-height: 70vh;
    padding-bottom: 70px;
}

.page-hero {
    padding: 72px 0;
    color: #ffffff;
    background: linear-gradient(135deg, #111827, #7f1d1d);
}

.page-hero.red-hero {
    background: linear-gradient(135deg, #7f1d1d, #dc2626);
}

.page-hero.blue-hero {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
}

.page-hero p {
    max-width: 760px;
    margin: 14px 0 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 18px;
}

.filter-panel {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 180px 180px;
    gap: 14px;
    margin: -28px 0 28px;
    padding: 18px;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.filter-panel label {
    display: grid;
    gap: 6px;
    color: #374151;
    font-weight: 800;
}

.filter-panel input,
.filter-panel select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    outline: 0;
    padding: 10px 12px;
    background: #ffffff;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    margin-top: -34px;
}

.category-card {
    position: relative;
    min-height: 220px;
    overflow: hidden;
    border-radius: 24px;
    color: #ffffff;
    background: #111827;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease;
}

.category-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.38;
}

.category-card span,
.category-card p {
    position: relative;
    z-index: 2;
    display: block;
    padding: 0 22px;
}

.category-card span {
    padding-top: 88px;
    font-size: 26px;
    font-weight: 900;
}

.category-card p {
    max-width: 360px;
    margin: 8px 0 0;
    color: rgba(255, 255, 255, 0.82);
}

.search-page-form {
    display: flex;
    width: min(600px, 100%);
    margin-top: 28px;
    overflow: hidden;
    border-radius: 999px;
    background: #ffffff;
}

.search-page-form input {
    flex: 1;
    color: var(--ink);
}

.search-results-wrap {
    padding-top: 42px;
}

.detail-main {
    background: #f3f4f6;
}

.detail-hero {
    position: relative;
    overflow: hidden;
    padding: 78px 0;
    color: #ffffff;
    background: #050505;
}

.detail-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--detail-image);
    background-size: cover;
    background-position: center;
    filter: blur(22px);
    transform: scale(1.08);
    opacity: 0.36;
}

.detail-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.58));
}

.detail-layout {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 42px;
    align-items: center;
}

.detail-poster {
    overflow: hidden;
    border-radius: 26px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.48);
}

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

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
}

.breadcrumb a:hover {
    color: #ffffff;
}

.detail-info h1 {
    margin: 0;
    font-size: clamp(36px, 6vw, 68px);
    line-height: 1.08;
}

.detail-one-line {
    max-width: 760px;
    margin: 18px 0;
    color: #d1d5db;
    font-size: 18px;
}

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

.detail-meta span {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

.detail-tags {
    margin-bottom: 26px;
}

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

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

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

.player-layer {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 0;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.58));
    cursor: pointer;
}

.player-layer span {
    display: grid;
    place-items: center;
    width: 92px;
    height: 92px;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(220, 38, 38, 0.92);
    font-size: 34px;
    box-shadow: 0 20px 50px rgba(220, 38, 38, 0.38);
    transition: transform 0.2s ease;
}

.player-layer:hover span {
    transform: scale(1.08);
}

.player-layer.is-hidden {
    display: none;
}

.detail-content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-top: 28px;
}

.text-panel {
    padding: 26px;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.text-panel h2 {
    margin: 0 0 12px;
    font-size: 24px;
}

.text-panel p {
    margin: 0;
    color: #4b5563;
}

.site-footer {
    margin-top: 70px;
    padding: 48px 0;
    color: #d1d5db;
    background: #111827;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 34px;
}

.footer-grid p {
    max-width: 460px;
    color: #9ca3af;
}

.footer-grid h2 {
    margin: 0 0 12px;
    color: #ffffff;
    font-size: 18px;
}

.footer-grid a:not(.footer-brand) {
    display: block;
    margin: 8px 0;
    color: #d1d5db;
}

.footer-grid a:hover {
    color: #ffffff;
}

.empty-state {
    grid-column: 1 / -1;
    padding: 58px;
    border-radius: 22px;
    text-align: center;
    background: #ffffff;
    color: var(--muted);
}

@media (max-width: 1100px) {
    .desktop-nav,
    .top-search {
        display: none;
    }

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

    .hero-slide {
        grid-template-columns: minmax(0, 1fr) 260px;
    }

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

    .rank-panel {
        position: static;
    }

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

@media (max-width: 760px) {
    .nav-shell {
        height: 62px;
    }

    .brand {
        font-size: 19px;
    }

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

    .hero-slide {
        grid-template-columns: 1fr;
        gap: 28px;
        padding: 44px 20px 88px;
    }

    .hero-poster {
        max-width: 240px;
        margin: 0 auto;
    }

    .hero-poster img {
        height: 330px;
    }

    .category-strip {
        grid-template-columns: 1fr;
        margin-top: -24px;
    }

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

    .movie-grid,
    .latest-grid,
    .compact-grid,
    .rank-grid,
    .category-grid,
    .detail-content,
    .footer-grid {
        grid-template-columns: 1fr;
    }

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

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

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

    .search-page-form {
        border-radius: 18px;
        flex-direction: column;
    }

    .search-page-form button {
        border-radius: 0;
    }
}
