:root {
    color-scheme: dark;
    --bg: #030712;
    --bg-soft: #111827;
    --bg-card: #151c2c;
    --bg-card-strong: #1f2937;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.16);
    --text: #f9fafb;
    --muted: #9ca3af;
    --muted-strong: #d1d5db;
    --red: #dc2626;
    --red-dark: #b91c1c;
    --orange: #f97316;
    --blue: #2563eb;
    --radius: 18px;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(220, 38, 38, 0.18), transparent 34rem),
        radial-gradient(circle at top right, rgba(249, 115, 22, 0.12), transparent 28rem),
        var(--bg);
}

body.menu-open {
    overflow: hidden;
}

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

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

button,
input,
select {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(17, 24, 39, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
}

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

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--red), var(--orange));
    box-shadow: 0 12px 28px rgba(220, 38, 38, 0.34);
}

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

.brand-text strong {
    font-size: 22px;
    background: linear-gradient(90deg, #ef4444, #fb923c);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

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

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

.nav-link,
.mobile-link {
    color: var(--muted-strong);
    border-radius: 12px;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-link {
    padding: 10px 14px;
    font-weight: 600;
}

.nav-link:hover,
.nav-link.is-active,
.mobile-link:hover,
.mobile-link.is-active {
    color: white;
    background: rgba(220, 38, 38, 0.95);
}

.header-search,
.mobile-search {
    display: flex;
    align-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: rgba(3, 7, 18, 0.42);
    overflow: hidden;
}

.header-search input,
.mobile-search input {
    width: 180px;
    min-width: 0;
    border: 0;
    outline: 0;
    color: white;
    background: transparent;
    padding: 10px 12px 10px 16px;
}

.header-search button,
.mobile-search button,
.primary-button,
.secondary-button,
.filter-panel button,
.search-panel button,
.player-overlay {
    border: 0;
    color: white;
    background: linear-gradient(135deg, var(--red), var(--orange));
    cursor: pointer;
}

.header-search button,
.mobile-search button {
    align-self: stretch;
    padding: 0 16px;
    font-weight: 700;
}

.mobile-menu-button {
    display: none;
    width: 44px;
    height: 44px;
    margin-left: auto;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
}

.mobile-menu-button span {
    width: 21px;
    height: 2px;
    border-radius: 2px;
    background: white;
}

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

.mobile-link {
    display: block;
    padding: 13px 14px;
    margin-bottom: 6px;
    font-weight: 700;
}

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

.hero {
    position: relative;
    width: 100%;
    min-height: 620px;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #111827, #030712);
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    background-size: cover;
    background-position: center;
}

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

.hero-slide::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.54), rgba(0, 0, 0, 0.18)),
        linear-gradient(0deg, #030712 0%, rgba(3, 7, 18, 0.1) 42%);
}

.hero-content {
    position: relative;
    width: min(1280px, calc(100% - 32px));
    min-height: 620px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.7fr);
    gap: 42px;
    align-items: center;
    padding: 86px 0 52px;
}

.hero-copy {
    max-width: 760px;
}

.eyebrow,
.movie-category {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border: 1px solid rgba(248, 113, 113, 0.45);
    border-radius: 999px;
    color: #fecaca;
    background: rgba(220, 38, 38, 0.16);
    font-size: 13px;
    font-weight: 700;
    padding: 6px 10px;
}

.hero h1,
.hero h2,
.page-hero h1,
.detail-title {
    margin: 18px 0 16px;
    font-size: clamp(36px, 6vw, 76px);
    line-height: 1.04;
    letter-spacing: -0.045em;
}

.hero-lead,
.page-hero p,
.detail-lead {
    max-width: 740px;
    color: var(--muted-strong);
    font-size: clamp(17px, 2vw, 24px);
    line-height: 1.72;
}

.hero-summary {
    max-width: 680px;
    margin-top: 18px;
    color: var(--muted);
    line-height: 1.8;
}

.hero-actions,
.section-actions,
.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
}

.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border-radius: 13px;
    padding: 0 20px;
    font-weight: 800;
    box-shadow: 0 16px 32px rgba(220, 38, 38, 0.22);
}

.secondary-button {
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid var(--line-strong);
    box-shadow: none;
}

.hero-poster {
    position: relative;
    border-radius: 26px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow);
    transform: rotate(2deg);
}

.hero-poster img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 20px;
    background: var(--bg-card-strong);
}

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

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

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

.page-hero {
    padding: 72px 0 34px;
}

.page-hero h1 {
    max-width: 920px;
}

.section {
    padding: 44px 0;
}

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

.section-header h2,
.content-block h2,
.player-section h2,
.related-section h2 {
    margin: 0;
    font-size: clamp(24px, 3vw, 34px);
}

.section-header p {
    margin: 8px 0 0;
    color: var(--muted);
}

.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 20px;
}

.movie-grid.large-grid {
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
}

.movie-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(21, 28, 44, 0.86);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(248, 113, 113, 0.45);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
}

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

.poster-link img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    transition: transform 0.28s ease, filter 0.28s ease;
}

.movie-card:hover .poster-link img {
    transform: scale(1.05);
    filter: saturate(1.08);
}

.movie-year {
    position: absolute;
    right: 10px;
    top: 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.72);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 5px 8px;
}

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

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

.movie-card h3 a:hover,
.rank-item:hover strong,
.footer-links a:hover {
    color: #fca5a5;
}

.movie-meta,
.movie-desc,
.content-block p,
.footer-inner p,
.breadcrumb,
.empty-result {
    color: var(--muted);
}

.movie-meta,
.movie-desc {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
}

.movie-desc {
    display: -webkit-box;
    min-height: 60px;
    margin-top: 8px;
    overflow: hidden;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.tag-row span {
    border-radius: 999px;
    color: #c7d2fe;
    background: rgba(37, 99, 235, 0.16);
    font-size: 12px;
    padding: 4px 8px;
}

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

.category-card {
    min-height: 190px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(220, 38, 38, 0.18), rgba(37, 99, 235, 0.1)),
        rgba(21, 28, 44, 0.8);
    transition: transform 0.22s ease, border-color 0.22s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: rgba(248, 113, 113, 0.45);
}

.category-card h2,
.category-card h3 {
    margin: 0 0 12px;
    font-size: 24px;
}

.category-card p {
    color: var(--muted);
    line-height: 1.7;
}

.category-count {
    display: inline-flex;
    margin-top: 16px;
    color: #fed7aa;
    font-weight: 800;
}

.filter-panel,
.search-panel {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 180px auto;
    gap: 12px;
    margin: 24px 0 30px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(21, 28, 44, 0.82);
}

.filter-panel input,
.filter-panel select,
.search-panel input,
.search-panel select {
    width: 100%;
    border: 1px solid var(--line-strong);
    outline: 0;
    border-radius: 12px;
    color: white;
    background: rgba(3, 7, 18, 0.42);
    padding: 12px 14px;
}

.filter-panel button,
.search-panel button {
    border-radius: 12px;
    padding: 0 18px;
    font-weight: 800;
}

.rank-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
}

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

.rank-item {
    display: grid;
    grid-template-columns: auto 58px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(21, 28, 44, 0.82);
}

.rank-item img {
    width: 58px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 10px;
    background: var(--bg-card-strong);
}

.rank-num {
    min-width: 38px;
    color: #fed7aa;
    font-weight: 900;
    font-size: 20px;
}

.rank-item strong,
.rank-item small {
    display: block;
}

.rank-item small {
    margin-top: 4px;
    color: var(--muted);
    line-height: 1.45;
}

.breadcrumb {
    padding: 26px 0 0;
    font-size: 14px;
}

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

.detail-hero {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 36px;
    align-items: center;
    padding: 36px 0 38px;
}

.detail-cover {
    padding: 10px;
    border: 1px solid var(--line-strong);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow);
}

.detail-cover img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 18px;
    background: var(--bg-card-strong);
}

.detail-title {
    max-width: 900px;
}

.detail-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
}

.detail-facts li {
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted-strong);
    background: rgba(255, 255, 255, 0.06);
    padding: 8px 12px;
}

.player-section,
.content-block,
.related-section {
    margin: 34px 0;
}

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

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

.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 14px;
    background:
        radial-gradient(circle at center, rgba(220, 38, 38, 0.32), rgba(0, 0, 0, 0.76)),
        rgba(0, 0, 0, 0.48);
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.player-overlay span {
    width: 78px;
    height: 78px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: white;
    color: var(--red);
    font-size: 34px;
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.35);
}

.player-overlay strong {
    font-size: 20px;
}

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

.content-block {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.content-block article {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(21, 28, 44, 0.78);
}

.content-block p {
    margin: 12px 0 0;
    line-height: 1.9;
    font-size: 16px;
}

.pagination-strip {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin: 30px 0 0;
}

.pagination-strip a {
    flex: 1;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(21, 28, 44, 0.72);
    color: var(--muted-strong);
}

.pagination-strip a:hover {
    border-color: rgba(248, 113, 113, 0.45);
    color: white;
}

.search-results {
    min-height: 260px;
}

.site-footer {
    margin-top: 64px;
    border-top: 1px solid var(--line);
    background: rgba(3, 7, 18, 0.72);
}

.footer-inner {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 26px;
    padding: 34px 0;
}

.footer-inner p {
    max-width: 680px;
    margin: 10px 0 0;
    line-height: 1.7;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: flex-end;
    gap: 12px 18px;
    color: var(--muted-strong);
}

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

    .hero-content {
        grid-template-columns: 1fr 280px;
    }

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

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

    .mobile-menu-button {
        display: inline-flex;
    }

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

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

    .hero-content {
        grid-template-columns: 1fr;
        align-content: center;
        gap: 24px;
    }

    .hero-poster {
        width: min(240px, 70vw);
        transform: none;
    }

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

    .detail-cover {
        width: min(280px, 80vw);
    }

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

    .filter-panel button,
    .search-panel button {
        min-height: 44px;
    }

    .footer-inner {
        flex-direction: column;
    }

    .footer-links {
        justify-content: flex-start;
    }
}

@media (max-width: 560px) {
    .header-inner {
        width: min(100% - 24px, 1280px);
        height: 68px;
    }

    .brand-mark {
        width: 38px;
        height: 38px;
    }

    .brand-text strong {
        font-size: 18px;
    }

    .brand-text small {
        display: none;
    }

    main,
    .hero-content,
    .footer-inner,
    .mobile-nav {
        width: min(100% - 24px, 1280px);
    }

    .movie-grid,
    .movie-grid.large-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

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

    .movie-desc {
        min-height: auto;
        -webkit-line-clamp: 2;
    }

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

    .pagination-strip {
        flex-direction: column;
    }
}
