:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-soft: #eef4ff;
    --text: #111827;
    --muted: #64748b;
    --muted-strong: #475569;
    --line: #e2e8f0;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #dbeafe;
    --accent: #7c3aed;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 10px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "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: 80;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    backdrop-filter: blur(16px);
}

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

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

.brand-mark {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28);
}

.brand-name {
    font-size: 22px;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--muted-strong);
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
}

.nav-links a {
    transition: color 0.2s ease;
}

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

.mobile-menu-button {
    display: none;
    width: 42px;
    height: 42px;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
}

.mobile-menu-button span {
    display: block;
    height: 2px;
    margin: 5px 0;
    background: var(--text);
    border-radius: 999px;
}

.hero {
    position: relative;
    height: 70vh;
    min-height: 560px;
    overflow: hidden;
    background: #111827;
}

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

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

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 72% 20%, rgba(37, 99, 235, 0.25), transparent 34%),
        linear-gradient(90deg, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.58) 44%, rgba(0, 0, 0, 0.18) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(1180px, calc(100% - 32px));
    height: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    color: #fff;
}

.hero-kicker,
.eyebrow {
    margin: 0 0 10px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero-kicker {
    color: #bfdbfe;
}

.hero h1 {
    max-width: 760px;
    margin: 0 0 18px;
    font-size: clamp(42px, 7vw, 78px);
    line-height: 1.03;
    letter-spacing: -0.06em;
}

.hero-desc {
    max-width: 680px;
    margin: 0 0 24px;
    color: #e5e7eb;
    font-size: clamp(17px, 2.2vw, 22px);
}

.hero-tags,
.detail-tags,
.tag-list,
.page-hero-meta,
.detail-meta,
.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-tags span,
.detail-tags span,
.tag-list span,
.page-hero-meta span,
.detail-meta span,
.card-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.hero-tags span {
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(8px);
}

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

.primary-button,
.ghost-button,
.section-more,
.text-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.primary-button {
    min-height: 48px;
    padding: 0 24px;
    color: #fff;
    background: var(--primary);
    box-shadow: 0 14px 32px rgba(37, 99, 235, 0.35);
}

.primary-button:hover {
    transform: translateY(-2px);
    background: var(--primary-dark);
}

.ghost-button {
    min-height: 48px;
    padding: 0 24px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.42);
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(12px);
}

.ghost-button.dark {
    color: var(--text);
    border-color: var(--line);
    background: #fff;
}

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

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

.hero-dot.is-active {
    width: 34px;
    background: #fff;
}

.quick-search,
.filter-panel,
.content-section,
.page-hero,
.breadcrumb,
.detail-hero,
.player-section,
.detail-body {
    width: min(1180px, calc(100% - 32px));
    margin-inline: auto;
}

.quick-search {
    margin-top: -42px;
    position: relative;
    z-index: 6;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 28px;
    align-items: center;
    padding: 28px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.quick-search h2,
.filter-panel h2,
.section-heading h2,
.page-hero h1,
.detail-info h1,
.player-head h2,
.text-panel h2,
.info-panel h2 {
    margin: 0;
    line-height: 1.15;
    letter-spacing: -0.04em;
}

.quick-search p,
.filter-panel p,
.section-heading p,
.page-hero p,
.category-summary,
.card-desc,
.detail-one-line,
.text-panel p,
.info-panel dd,
.site-footer p {
    color: var(--muted);
}

.home-search-form {
    display: flex;
    gap: 12px;
}

.home-search-form input,
.filter-controls input,
.filter-controls select {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--text);
    outline: none;
}

.home-search-form input:focus,
.filter-controls input:focus,
.filter-controls select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.home-search-form button {
    min-width: 128px;
    border: 0;
    border-radius: 14px;
    color: #fff;
    background: var(--primary);
    font-weight: 800;
    cursor: pointer;
}

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

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

.section-heading h2 {
    font-size: clamp(28px, 3vw, 40px);
}

.section-more,
.text-link {
    color: var(--primary);
}

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

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

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

.catalog-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
}

.movie-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-8px);
    border-color: rgba(37, 99, 235, 0.28);
    box-shadow: var(--shadow);
}

.poster-link {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: linear-gradient(135deg, #dbeafe, #f5f3ff);
}

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

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

.poster-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 36%, rgba(0, 0, 0, 0.68));
    opacity: 0.9;
}

.year-badge,
.rank-badge,
.play-chip {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.year-badge {
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
}

.rank-badge {
    top: 10px;
    left: 10px;
    padding: 5px 10px;
    background: linear-gradient(135deg, #f97316, #ef4444);
}

.play-chip {
    left: 12px;
    bottom: 12px;
    padding: 7px 12px;
    background: var(--primary);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.movie-card:hover .play-chip {
    opacity: 1;
    transform: translateY(0);
}

.card-body {
    padding: 16px;
}

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

.compact-card .card-body h3 {
    font-size: 15px;
}

.card-body h3 a:hover {
    color: var(--primary);
}

.card-desc {
    min-height: 46px;
    margin: 0 0 12px;
    font-size: 13px;
}

.card-meta {
    gap: 6px;
    margin-bottom: 10px;
}

.card-meta span {
    color: var(--muted-strong);
    background: #f1f5f9;
}

.tag-list span {
    color: var(--primary-dark);
    background: var(--primary-soft);
}

.category-section {
    padding-bottom: 6px;
}

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

.category-card,
.category-overview-card,
.filter-panel,
.text-panel,
.info-panel,
.player-section,
.rank-panel {
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.category-card {
    padding: 24px;
}

.category-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.category-card-top p {
    margin: 0 0 6px;
    color: var(--primary);
    font-weight: 800;
}

.category-card-top h3 {
    margin: 0;
    font-size: 24px;
}

.category-card-top a {
    color: var(--primary);
    font-weight: 800;
}

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

.category-mini {
    min-width: 0;
}

.category-mini img {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    object-fit: cover;
    background: var(--surface-soft);
}

.category-mini span {
    display: block;
    margin-top: 6px;
    overflow: hidden;
    color: var(--muted-strong);
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-hero {
    margin-top: 36px;
    padding: 54px;
    border-radius: 30px;
    color: #fff;
    background:
        radial-gradient(circle at 88% 20%, rgba(124, 58, 237, 0.5), transparent 32%),
        linear-gradient(135deg, #0f172a, #1e3a8a 58%, #2563eb);
    box-shadow: var(--shadow);
}

.page-hero h1 {
    max-width: 760px;
    font-size: clamp(36px, 5vw, 64px);
}

.page-hero p {
    max-width: 760px;
    color: #dbeafe;
    font-size: 18px;
}

.page-hero-meta span,
.detail-meta span {
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
}

.filter-panel {
    display: grid;
    grid-template-columns: 0.9fr 1.3fr;
    gap: 24px;
    align-items: end;
    margin-top: 28px;
    padding: 26px;
}

.filter-controls {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr 0.8fr;
    gap: 14px;
}

.filter-controls label span {
    display: block;
    margin-bottom: 7px;
    color: var(--muted-strong);
    font-size: 13px;
    font-weight: 800;
}

.no-results {
    display: none;
    grid-column: 1 / -1;
    margin: 8px 0 0;
    color: #dc2626;
    font-weight: 700;
}

.no-results.is-visible {
    display: block;
}

.category-overview-card {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 22px;
    padding: 18px;
}

.category-cover {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    background: var(--surface-soft);
}

.category-cover img {
    width: 100%;
    height: 100%;
    min-height: 220px;
    object-fit: cover;
}

.category-cover span {
    position: absolute;
    left: 10px;
    bottom: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    color: #fff;
    background: rgba(0, 0, 0, 0.68);
    font-size: 12px;
    font-weight: 800;
}

.category-overview-card h2 {
    margin: 8px 0 10px;
}

.ranking-hero {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 28px;
    align-items: center;
}

.rank-panel {
    padding: 18px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(14px);
}

.rank-row {
    display: grid;
    grid-template-columns: 54px 1fr auto 80px;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

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

.rank-num {
    font-weight: 900;
    color: #bfdbfe;
}

.rank-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
}

.rank-meta {
    color: #dbeafe;
    font-size: 13px;
}

.rank-score {
    color: #fde68a;
    text-align: right;
    font-weight: 900;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
    color: var(--muted);
    font-size: 14px;
}

.breadcrumb a {
    color: var(--primary);
    font-weight: 700;
}

.detail-hero {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 34px;
    align-items: center;
    margin-top: 24px;
    padding: 34px;
    border-radius: 30px;
    color: #fff;
    background:
        radial-gradient(circle at 90% 10%, rgba(37, 99, 235, 0.35), transparent 32%),
        linear-gradient(135deg, #0f172a, #111827 48%, #1e3a8a);
    box-shadow: var(--shadow);
}

.detail-poster {
    overflow: hidden;
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
    background: var(--surface-soft);
}

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

.detail-info h1 {
    font-size: clamp(34px, 5vw, 62px);
}

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

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

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

.player-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.player-head span {
    color: var(--primary);
    font-weight: 900;
}

.player-box {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    background: #020617;
    aspect-ratio: 16 / 9;
}

.movie-player {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #020617;
}

.player-start {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 0;
    color: #fff;
    background: radial-gradient(circle at center, rgba(37, 99, 235, 0.35), rgba(2, 6, 23, 0.82));
    cursor: pointer;
}

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

.play-icon {
    width: 78px;
    height: 78px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-left: 4px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 16px 42px rgba(37, 99, 235, 0.45);
    font-size: 32px;
}

.detail-body {
    display: grid;
    grid-template-columns: 1fr 1fr 0.8fr;
    gap: 22px;
    margin-top: 34px;
}

.text-panel,
.info-panel {
    padding: 24px;
}

.text-panel p:last-child {
    font-size: 16px;
}

.info-panel dl {
    margin: 18px 0 0;
}

.info-panel div {
    display: grid;
    grid-template-columns: 74px 1fr;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

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

.info-panel dd {
    margin: 0;
}

.info-panel a {
    color: var(--primary);
    font-weight: 800;
}

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

.site-footer {
    margin-top: 72px;
    padding: 44px 0;
    background: #0f172a;
    color: #cbd5e1;
}

.footer-inner {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 40px;
}

.footer-brand {
    color: #fff;
    font-size: 22px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    justify-content: flex-end;
}

.footer-links a {
    color: #cbd5e1;
    font-weight: 700;
}

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

.is-filter-hidden {
    display: none !important;
}

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

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

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

@media (max-width: 820px) {
    .site-nav {
        height: auto;
        min-height: 64px;
        flex-wrap: wrap;
        padding: 12px 0;
    }

    .mobile-menu-button {
        display: block;
    }

    .nav-links {
        display: none;
        width: 100%;
        padding: 12px 0;
        flex-direction: column;
        align-items: flex-start;
        border-top: 1px solid var(--line);
    }

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

    .hero {
        min-height: 620px;
    }

    .hero h1 {
        font-size: 44px;
    }

    .home-search-form,
    .filter-controls,
    .detail-hero,
    .category-overview-card,
    .footer-inner {
        grid-template-columns: 1fr;
    }

    .home-search-form {
        display: grid;
    }

    .home-search-form button {
        min-height: 48px;
    }

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

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

    .detail-hero {
        padding: 24px;
    }

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

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

@media (max-width: 620px) {
    .movie-grid,
    .catalog-grid,
    .featured-grid,
    .compact-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .quick-search,
    .filter-panel,
    .page-hero,
    .player-section,
    .text-panel,
    .info-panel {
        padding: 20px;
        border-radius: 20px;
    }

    .page-hero {
        margin-top: 20px;
    }

    .rank-row {
        grid-template-columns: 42px 1fr 64px;
    }

    .rank-meta {
        display: none;
    }

    .card-body {
        padding: 12px;
    }

    .card-desc,
    .tag-list {
        display: none;
    }

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