:root {
    --bg: #f8fafc;
    --panel: #ffffff;
    --text: #1f2937;
    --muted: #64748b;
    --line: #e5e7eb;
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --accent: #0f766e;
    --gold: #f59e0b;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

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

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

button,
input {
    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);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(16px);
}

.site-nav {
    min-height: 68px;
    display: flex;
    align-items: center;
    gap: 22px;
}

.logo,
.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
}

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

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

.nav-link {
    position: relative;
    color: #475569;
    font-weight: 650;
    transition: color 0.25s ease;
}

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

.nav-link.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -10px;
    height: 3px;
    border-radius: 999px;
    background: var(--primary);
}

.header-search {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-search input,
.local-filter input,
.search-page-form input,
.hero-search input {
    border: 1px solid #dbe3ef;
    border-radius: 999px;
    background: #fff;
    color: #0f172a;
    outline: 0;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.header-search input {
    width: 220px;
    padding: 10px 15px;
}

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

.header-search button,
.search-page-form button,
.hero-search button {
    border: 0;
    border-radius: 999px;
    padding: 10px 18px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.25s ease, background 0.25s ease;
}

.header-search button:hover,
.search-page-form button:hover,
.hero-search button:hover,
.primary-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.mobile-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: #eef2ff;
    cursor: pointer;
}

.mobile-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 4px auto;
    background: #1e293b;
    border-radius: 999px;
}

.quick-cats {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 12px;
}

.quick-cats a {
    flex: 0 0 auto;
    padding: 5px 13px;
    border-radius: 999px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 13px;
    font-weight: 700;
}

.hero {
    position: relative;
    height: 580px;
    overflow: hidden;
    background: #0f172a;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

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

.hero-content {
    color: #fff;
    padding-top: 54px;
}

.hero-kicker,
.page-kicker,
.detail-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.16);
    color: #dbeafe;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.hero h1 {
    max-width: 820px;
    margin: 18px 0 18px;
    font-size: clamp(40px, 6vw, 72px);
    line-height: 1.05;
    font-weight: 900;
    text-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

.hero-subtitle {
    max-width: 760px;
    margin: 0 0 22px;
    color: #e2e8f0;
    font-size: clamp(17px, 2vw, 23px);
}

.hero-tags,
.detail-tags,
.movie-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-tags span,
.detail-tags span,
.movie-tags span {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.movie-tags span {
    background: #eff6ff;
    color: #2563eb;
}

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

.primary-btn,
.glass-btn,
.text-link,
.rank-more,
.section-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 800;
}

.primary-btn {
    padding: 12px 24px;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 16px 28px rgba(37, 99, 235, 0.28);
    transition: transform 0.25s ease, background 0.25s ease;
}

.glass-btn {
    padding: 12px 24px;
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
}

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

.hero-dots button {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
}

.hero-dots button.active {
    width: 32px;
    background: #fff;
}

.hero-search {
    position: absolute;
    left: 50%;
    bottom: 22px;
    z-index: 4;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    padding: 12px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.hero-search input {
    width: min(620px, 62vw);
    padding: 14px 18px;
}

.page-section {
    padding: 58px 0;
}

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

.section-head h2 {
    margin: 0;
    color: #111827;
    font-size: clamp(26px, 3vw, 36px);
    line-height: 1.2;
    font-weight: 900;
}

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

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

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

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

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

.movie-card {
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.movie-cover {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: linear-gradient(135deg, #1e3a8a, #0f766e);
}

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

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

.cover-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0), rgba(15, 23, 42, 0.72));
}

.movie-year {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.78);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.movie-play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%) scale(0.85);
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.92);
    color: #fff;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

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

.movie-info {
    padding: 16px;
}

.movie-title {
    display: block;
    overflow: hidden;
    color: #111827;
    font-size: 18px;
    font-weight: 850;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.movie-desc {
    min-height: 48px;
    margin: 8px 0 12px;
    color: #64748b;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.movie-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    color: #64748b;
    font-size: 12px;
}

.movie-meta span {
    padding: 3px 8px;
    border-radius: 999px;
    background: #f1f5f9;
}

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

.category-tile {
    min-height: 178px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 10px;
    padding: 22px;
    border-radius: 24px;
    color: #fff;
    background-size: cover;
    background-position: center;
    box-shadow: var(--shadow);
    transition: transform 0.25s ease;
}

.category-tile:hover {
    transform: translateY(-4px);
}

.category-tile span {
    font-size: 24px;
    font-weight: 900;
}

.category-tile small {
    color: rgba(255, 255, 255, 0.86);
}

.split-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 34px;
    align-items: start;
}

.rank-card {
    padding: 24px;
    border-radius: 24px;
    background: #fff;
    box-shadow: var(--shadow);
}

.rank-card h2 {
    margin: 0 0 18px;
    font-size: 24px;
    font-weight: 900;
}

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

.rank-item {
    display: grid;
    grid-template-columns: 32px 56px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 16px;
    background: #f8fafc;
    transition: background 0.25s ease, transform 0.25s ease;
}

.rank-item:hover {
    transform: translateX(3px);
    background: #eff6ff;
}

.rank-number {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-weight: 900;
}

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

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

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

.rank-text small {
    color: #64748b;
}

.rank-more {
    margin-top: 18px;
}

.page-hero {
    position: relative;
    padding: 82px 0;
    color: #fff;
    background: radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.55), transparent 35%), linear-gradient(135deg, #0f172a, #1d4ed8 55%, #0f766e);
    overflow: hidden;
}

.slim-hero {
    padding: 74px 0;
}

.page-hero h1 {
    margin: 16px 0 12px;
    font-size: clamp(36px, 5vw, 58px);
    line-height: 1.08;
    font-weight: 900;
}

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

.local-filter {
    margin-top: 26px;
}

.local-filter input {
    width: min(560px, 100%);
    padding: 14px 18px;
}

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

.category-card {
    overflow: hidden;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.category-card-covers {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: 150px;
    overflow: hidden;
    background: linear-gradient(135deg, #1e3a8a, #0f766e);
}

.category-card-covers img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-card-body {
    padding: 20px;
}

.category-card-body h2 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 900;
}

.category-card-body p {
    min-height: 78px;
    margin: 0 0 16px;
    color: #64748b;
}

.search-page-form {
    display: flex;
    gap: 12px;
    width: min(760px, 100%);
    margin-top: 28px;
}

.search-page-form input {
    flex: 1;
    padding: 15px 18px;
}

.empty-state {
    display: none;
    padding: 42px;
    border-radius: 24px;
    background: #fff;
    color: #64748b;
    text-align: center;
    box-shadow: var(--shadow);
}

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

.movie-list {
    display: grid;
    gap: 18px;
}

.movie-card-horizontal {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
}

.movie-card-horizontal .movie-cover {
    aspect-ratio: auto;
    height: 100%;
    min-height: 220px;
}

.sticky-rank {
    position: sticky;
    top: 112px;
}

.detail-hero {
    position: relative;
    min-height: 620px;
    padding: 54px 0 72px;
    color: #fff;
    overflow: hidden;
    background: #0f172a;
}

.detail-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: saturate(1.15);
}

.detail-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.28), #0f172a 96%);
}

.detail-wrap {
    position: relative;
    z-index: 2;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    color: #cbd5e1;
    font-size: 14px;
}

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

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
    gap: 34px;
    align-items: center;
}

.player-panel {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 26px;
    background: #000;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.36);
    aspect-ratio: 16 / 9;
}

.movie-player {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
    object-fit: contain;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: rgba(15, 23, 42, 0.24);
    color: #fff;
    cursor: pointer;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 4;
}

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

.player-overlay span {
    width: 86px;
    height: 86px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.92);
    box-shadow: 0 20px 44px rgba(37, 99, 235, 0.32);
    font-size: 30px;
}

.detail-info h1 {
    margin: 18px 0 14px;
    font-size: clamp(34px, 5vw, 62px);
    line-height: 1.08;
    font-weight: 900;
}

.detail-one-line {
    margin: 0 0 18px;
    color: #e2e8f0;
    font-size: 18px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.detail-meta span {
    padding: 6px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 750;
}

.detail-info .primary-btn {
    margin-top: 24px;
}

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

.content-card {
    padding: 28px;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.content-card h2 {
    margin: 0 0 14px;
    font-size: 26px;
    font-weight: 900;
}

.content-card p {
    margin: 0;
    color: #475569;
    font-size: 17px;
}

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

.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 0.8fr;
    gap: 34px;
    padding: 46px 0;
}

.footer-logo {
    color: #fff;
}

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

.footer-grid p {
    max-width: 450px;
    margin: 14px 0 0;
    color: #94a3b8;
}

.footer-links {
    display: grid;
    gap: 8px;
}

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

.footer-bottom {
    padding: 18px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    color: #94a3b8;
    text-align: center;
}

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

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

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

    .sticky-rank {
        position: static;
    }
}

@media (max-width: 860px) {
    .site-nav {
        flex-wrap: wrap;
        padding: 12px 0;
    }

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

    .nav-links {
        order: 4;
        width: 100%;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 10px 0;
        border-top: 1px solid #e2e8f0;
    }

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

    .nav-link {
        padding: 12px 0;
    }

    .nav-link.active::after {
        display: none;
    }

    .header-search {
        order: 5;
        width: 100%;
    }

    .header-search input {
        width: 100%;
        flex: 1;
    }

    .hero {
        height: 650px;
    }

    .hero-search {
        flex-direction: column;
        border-radius: 22px;
    }

    .hero-search input {
        width: min(680px, 78vw);
    }

    .movie-grid,
    .catalog-grid,
    .compact-grid,
    .featured-grid,
    .category-grid,
    .category-overview-grid,
    .detail-content,
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

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

    .logo {
        font-size: 18px;
    }

    .quick-cats {
        padding-bottom: 10px;
    }

    .hero {
        height: 680px;
    }

    .hero-content {
        padding-top: 22px;
    }

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

    .movie-grid,
    .catalog-grid,
    .compact-grid,
    .featured-grid,
    .category-grid,
    .category-overview-grid,
    .detail-content,
    .footer-grid {
        grid-template-columns: 1fr;
    }

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

    .movie-card-horizontal .movie-cover {
        min-height: 0;
        aspect-ratio: 3 / 4;
    }

    .detail-hero {
        padding-top: 32px;
    }

    .page-section {
        padding: 42px 0;
    }
}
