:root {
    --bg: #0b0d10;
    --bg-soft: #101419;
    --bg-card: #151a21;
    --bg-line: #1a2129;
    --line: #333d47;
    --text: #ffffff;
    --muted: #a7b0bd;
    --muted-deep: #6f7a86;
    --primary: #f5871f;
    --primary-soft: #f79f3f;
    --primary-deep: #d66d0f;
    --shadow: 0 22px 65px rgba(0, 0, 0, 0.38);
    --radius: 18px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    line-height: 1.6;
}

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

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

button,
input,
select {
    font: inherit;
}

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

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

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
}

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

.brand-mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--primary-soft));
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(245, 135, 31, 0.28);
}

.brand-text {
    font-size: 20px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-link {
    color: #c8d0da;
    font-size: 15px;
    font-weight: 700;
    transition: color 0.25s ease;
}

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

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    color: #ffffff;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.menu-toggle span {
    width: 24px;
    height: 2px;
    background: #ffffff;
    border-radius: 999px;
}

.hero-slider {
    position: relative;
    height: 70vh;
    min-height: 520px;
    max-height: 820px;
    overflow: hidden;
    background: #000000;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(1.02);
    transition: opacity 0.8s ease, transform 1.2s ease;
    pointer-events: none;
}

.hero-slide.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.hero-slide > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-shade {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 75% 30%, rgba(245, 135, 31, 0.18), transparent 28%),
        linear-gradient(90deg, rgba(11, 13, 16, 0.98), rgba(11, 13, 16, 0.78) 42%, rgba(11, 13, 16, 0.2) 100%),
        linear-gradient(0deg, rgba(11, 13, 16, 0.92), transparent 38%);
}

.hero-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    align-items: center;
}

.hero-copy {
    max-width: 650px;
    padding-top: 48px;
}

.hero-kicker,
.section-heading span,
.page-hero-inner > span,
.detail-kicker {
    display: inline-flex;
    align-items: center;
    color: var(--primary);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-copy h1 {
    margin: 14px 0 18px;
    font-size: clamp(40px, 6vw, 72px);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.hero-copy p {
    margin: 0 0 22px;
    max-width: 620px;
    color: #d9e0e8;
    font-size: 18px;
}

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

.hero-tags span,
.tag-row span,
.detail-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 12px;
    color: var(--primary-soft);
    background: rgba(245, 135, 31, 0.13);
    border: 1px solid rgba(245, 135, 31, 0.22);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

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

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

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

.btn-primary {
    color: #ffffff;
    background: var(--primary);
    box-shadow: 0 12px 30px rgba(245, 135, 31, 0.22);
}

.btn-primary:hover {
    background: var(--primary-deep);
}

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

.btn-ghost:hover {
    border-color: rgba(245, 135, 31, 0.42);
}

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

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

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

.home-search-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: -38px;
    padding: 24px;
    position: relative;
    z-index: 6;
    background: rgba(21, 26, 33, 0.94);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.home-search-strip span {
    color: var(--primary);
    font-weight: 800;
}

.home-search-strip strong {
    display: block;
    margin-top: 4px;
    font-size: 22px;
}

.content-section {
    padding: 64px 0 0;
}

.compact-section {
    padding-top: 42px;
}

.section-heading {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 26px;
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(28px, 4vw, 38px);
    line-height: 1.15;
}

.section-heading p {
    margin: 0;
    max-width: 760px;
    color: var(--muted);
}

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

.movie-card {
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--bg-line);
    border-radius: var(--radius-sm);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(245, 135, 31, 0.45);
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.34);
}

.poster-link {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: #050607;
}

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

.movie-card:hover .poster-link img {
    transform: scale(1.08);
    opacity: 0.78;
}

.poster-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    padding: 4px 9px;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    backdrop-filter: blur(12px);
}

.poster-play {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    color: #ffffff;
    background: var(--primary);
    border-radius: 999px;
    transform: translate(-50%, -50%) scale(0.82);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

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

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

.movie-title {
    display: -webkit-box;
    min-height: 48px;
    overflow: hidden;
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.movie-title:hover {
    color: var(--primary-soft);
}

.movie-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 8px 0;
    color: var(--muted-deep);
    font-size: 12px;
}

.movie-meta span + span::before {
    content: "·";
    margin-right: 7px;
}

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

.movie-card .tag-row {
    gap: 6px;
}

.movie-card .tag-row span {
    min-height: 24px;
    padding: 3px 8px;
    font-size: 11px;
}

.compact-card .movie-card-body p {
    display: none;
}

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

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

.category-tile {
    position: relative;
    min-height: 190px;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--bg-line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.category-tile img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.52;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.category-tile:hover img {
    transform: scale(1.08);
    opacity: 0.72;
}

.category-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(11, 13, 16, 0.98), rgba(11, 13, 16, 0.28));
}

.category-content {
    position: absolute;
    inset: auto 18px 18px 18px;
}

.category-content strong {
    display: block;
    font-size: 24px;
    line-height: 1.2;
}

.category-content em {
    display: -webkit-box;
    margin-top: 8px;
    overflow: hidden;
    color: #c8d0da;
    font-size: 13px;
    font-style: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.rank-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.rank-item {
    display: grid;
    grid-template-columns: 42px 56px 1fr;
    align-items: center;
    gap: 12px;
    min-height: 84px;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--bg-line);
    border-radius: var(--radius-sm);
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.rank-item:hover {
    transform: translateY(-3px);
    border-color: rgba(245, 135, 31, 0.42);
}

.rank-no {
    color: var(--primary);
    font-size: 22px;
    font-weight: 900;
}

.rank-item img {
    width: 56px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
}

.rank-info {
    min-width: 0;
}

.rank-info strong,
.rank-info em {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-info strong {
    color: #ffffff;
    font-size: 15px;
}

.rank-info em {
    color: var(--muted-deep);
    font-size: 12px;
    font-style: normal;
}

.page-hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 78% 20%, rgba(245, 135, 31, 0.18), transparent 26%),
        linear-gradient(135deg, #151a21, #0b0d10 64%);
    border-bottom: 1px solid var(--bg-line);
}

.slim-hero,
.category-hero {
    padding: 78px 0 66px;
}

.page-hero-inner h1 {
    margin: 10px 0 14px;
    font-size: clamp(34px, 5vw, 56px);
    line-height: 1.1;
}

.page-hero-inner p {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
    font-size: 17px;
}

.filter-panel {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 28px;
    padding: 18px;
    background: var(--bg-card);
    border: 1px solid var(--bg-line);
    border-radius: var(--radius);
}

.filter-panel label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.filter-panel input,
.filter-panel select {
    width: 100%;
    min-height: 44px;
    color: #ffffff;
    background: #0b0d10;
    border: 1px solid var(--line);
    border-radius: 11px;
    outline: none;
    padding: 0 13px;
}

.filter-panel input:focus,
.filter-panel select:focus {
    border-color: var(--primary);
}

.empty-state {
    display: none;
    padding: 52px 0;
    color: var(--muted);
    text-align: center;
}

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

.rank-page-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
}

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

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

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

.detail-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.38;
    filter: blur(2px);
    transform: scale(1.03);
}

.detail-backdrop-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(11, 13, 16, 0.96), rgba(11, 13, 16, 0.78) 46%, rgba(11, 13, 16, 0.94)),
        linear-gradient(0deg, var(--bg), transparent 35%);
}

.detail-hero-inner {
    position: relative;
    z-index: 2;
    padding-top: 32px;
    padding-bottom: 70px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 28px;
    color: var(--muted);
    font-size: 14px;
}

.breadcrumb a:hover {
    color: var(--primary);
}

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

.detail-poster {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

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

.detail-copy h1 {
    margin: 12px 0 16px;
    font-size: clamp(36px, 6vw, 68px);
    line-height: 1.05;
}

.detail-one-line {
    max-width: 820px;
    color: #d8e0e8;
    font-size: 18px;
}

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

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

.player-section {
    margin-top: -46px;
    position: relative;
    z-index: 5;
}

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

.player-shell video {
    display: block;
    width: 100%;
    height: 100%;
    background: #000000;
    object-fit: contain;
    cursor: pointer;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    color: #ffffff;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.58), rgba(0, 0, 0, 0.2));
    cursor: pointer;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.player-button {
    display: grid;
    width: 82px;
    height: 82px;
    place-items: center;
    color: #ffffff;
    background: var(--primary);
    border: 0;
    border-radius: 50%;
    box-shadow: 0 18px 48px rgba(245, 135, 31, 0.35);
    cursor: pointer;
    font-size: 30px;
    transition: transform 0.25s ease, background 0.25s ease;
}

.player-button:hover {
    transform: scale(1.08);
    background: var(--primary-deep);
}

.player-overlay span {
    max-width: 80%;
    text-align: center;
    font-size: 20px;
    font-weight: 800;
}

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

.text-panel {
    padding: 26px;
    background: var(--bg-card);
    border: 1px solid var(--bg-line);
    border-radius: var(--radius);
}

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

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

.site-footer {
    margin-top: 76px;
    padding: 46px 0 0;
    background: var(--bg-soft);
    border-top: 1px solid var(--bg-line);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 32px;
}

.footer-about p {
    max-width: 560px;
    margin: 16px 0 0;
    color: var(--muted);
}

.footer-column h2 {
    margin: 0 0 14px;
    font-size: 17px;
}

.footer-column a {
    display: block;
    margin: 8px 0;
    color: var(--muted);
}

.footer-column a:hover {
    color: var(--primary);
}

.footer-bottom {
    margin-top: 38px;
    padding: 20px;
    color: var(--muted-deep);
    text-align: center;
    border-top: 1px solid var(--bg-line);
}

.footer-bottom p {
    margin: 0;
}

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

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

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

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

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

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

    .main-nav {
        position: absolute;
        left: 16px;
        right: 16px;
        top: 68px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 10px;
        background: rgba(16, 20, 25, 0.98);
        border: 1px solid var(--line);
        border-radius: 16px;
        box-shadow: var(--shadow);
    }

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

    .nav-link {
        padding: 12px 14px;
        border-radius: 10px;
    }

    .nav-link:hover,
    .nav-link.active {
        background: rgba(245, 135, 31, 0.1);
    }

    .hero-slider {
        height: 74vh;
        min-height: 560px;
    }

    .hero-shade {
        background:
            linear-gradient(0deg, rgba(11, 13, 16, 0.98), rgba(11, 13, 16, 0.52)),
            radial-gradient(circle at 50% 20%, rgba(245, 135, 31, 0.2), transparent 34%);
    }

    .hero-copy {
        padding-top: 20px;
    }

    .home-search-strip {
        align-items: flex-start;
        flex-direction: column;
        margin-top: -28px;
    }

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

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

    .filter-panel .search-box {
        grid-column: 1 / -1;
    }

    .detail-grid {
        grid-template-columns: 210px minmax(0, 1fr);
        gap: 22px;
    }

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

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

@media (max-width: 560px) {
    .container {
        width: min(100% - 22px, 1180px);
    }

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

    .hero-slider {
        min-height: 600px;
    }

    .hero-copy p {
        font-size: 16px;
    }

    .hero-actions,
    .page-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

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

    .category-grid,
    .category-grid-wide,
    .rank-list,
    .rank-aside .movie-grid {
        grid-template-columns: 1fr;
    }

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

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

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

    .movie-detail-hero {
        min-height: auto;
    }

    .detail-hero-inner {
        padding-bottom: 82px;
    }

    .player-button {
        width: 64px;
        height: 64px;
        font-size: 24px;
    }

    .player-overlay span {
        font-size: 16px;
    }
}
