:root {
    --slate-950: #020617;
    --slate-900: #0f172a;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --red-600: #dc2626;
    --red-500: #ef4444;
    --red-400: #f87171;
    --amber-400: #f59e0b;
    --surface: #ffffff;
    --soft: #fff7f7;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e5e7eb;
    --shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    background: linear-gradient(135deg, #f8fafc 0%, #fff1f2 45%, #ffffff 100%);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.65;
}

body.menu-open {
    overflow: hidden;
}

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

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

button,
input,
select {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(90deg, var(--slate-900), var(--slate-800));
    color: #ffffff;
    box-shadow: 0 16px 38px rgba(2, 6, 23, 0.25);
}

.header-inner,
.category-nav,
.mobile-panel,
.footer-grid,
.copyright,
main {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

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

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

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--red-500), var(--red-400));
    color: #ffffff;
    font-size: 15px;
    box-shadow: 0 12px 28px rgba(239, 68, 68, 0.35);
}

.brand-name {
    font-size: 26px;
    letter-spacing: -0.03em;
    background: linear-gradient(90deg, #fecaca, #ffffff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

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

.nav-link,
.category-link {
    border-radius: 12px;
    color: #dbeafe;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.nav-link {
    padding: 9px 14px;
    font-size: 15px;
}

.nav-link:hover,
.nav-link.active,
.category-link:hover {
    background: var(--red-500);
    color: #ffffff;
    transform: translateY(-1px);
}

.category-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 0 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
}

.category-link {
    padding: 6px 12px;
    font-size: 14px;
    color: #cbd5e1;
}

.menu-button {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
}

.menu-button span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 4px auto;
    background: #ffffff;
    border-radius: 99px;
}

.mobile-panel {
    display: none;
    padding: 0 0 18px;
}

.mobile-panel.open {
    display: grid;
    gap: 10px;
}

.mobile-panel .nav-link,
.mobile-category-list .category-link {
    display: block;
}

.mobile-category-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
}

main {
    padding-bottom: 64px;
}

.hero {
    position: relative;
    min-height: 620px;
    margin: 28px auto 38px;
    overflow: hidden;
    border-radius: 32px;
    background: var(--slate-900);
    color: #ffffff;
    box-shadow: var(--shadow);
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) 380px;
    gap: 42px;
    align-items: center;
    padding: 64px;
    opacity: 0;
    pointer-events: none;
    transform: scale(1.02);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

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

.hero-backdrop,
.detail-backdrop {
    position: absolute;
    inset: 0;
    background-position: center;
    background-size: cover;
}

.hero-backdrop::after,
.detail-backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(248, 113, 113, 0.25), transparent 38%), linear-gradient(180deg, transparent, rgba(2, 6, 23, 0.82));
}

.hero-content,
.hero-poster,
.detail-info,
.detail-poster {
    position: relative;
    z-index: 2;
}

.hero-kicker,
.page-hero span,
.section-heading span {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.16);
    color: #fecaca;
    font-weight: 700;
    letter-spacing: 0.05em;
}

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

.hero p {
    max-width: 720px;
    margin: 0;
    color: #e2e8f0;
    font-size: 20px;
}

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

.hero-tags {
    margin-top: 24px;
}

.hero-tags span,
.detail-meta span,
.detail-tags span,
.tag-row span {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    padding: 6px 11px;
    font-size: 13px;
    font-weight: 700;
}

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

.primary-button,
.ghost-button,
.filter-form button,
.home-search-form button,
.text-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border: 0;
    border-radius: 14px;
    padding: 0 22px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.primary-button,
.filter-form button,
.home-search-form button,
.text-button {
    background: linear-gradient(135deg, var(--red-500), var(--red-600));
    color: #ffffff;
    box-shadow: 0 12px 26px rgba(220, 38, 38, 0.3);
}

.ghost-button {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    backdrop-filter: blur(12px);
}

.primary-button:hover,
.ghost-button:hover,
.filter-form button:hover,
.home-search-form button:hover,
.text-button:hover {
    transform: translateY(-2px);
}

.hero-poster {
    display: block;
    overflow: hidden;
    border-radius: 26px;
    box-shadow: 0 35px 80px rgba(0, 0, 0, 0.45);
    aspect-ratio: 2 / 3;
}

.hero-poster img,
.detail-poster img,
.poster-link img,
.mini-card img,
.overview-cover img {
    height: 100%;
    object-fit: cover;
}

.hero-controls {
    position: absolute;
    left: 64px;
    right: 64px;
    bottom: 32px;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
}

.hero-controls button {
    pointer-events: auto;
    border: 0;
    color: #ffffff;
    cursor: pointer;
}

.hero-controls > button {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 28px;
}

.hero-dots {
    display: flex;
    gap: 8px;
}

.hero-dot {
    width: 11px;
    height: 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
}

.hero-dot.active {
    width: 34px;
    background: var(--red-500);
}

.home-search,
.filter-panel,
.section-block,
.page-hero,
.detail-layout,
.player-section,
.overview-grid,
.breadcrumb {
    margin: 0 auto 32px;
}

.home-search,
.filter-panel,
.section-block,
.page-hero,
.detail-layout,
.player-section {
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow);
}

.home-search {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 24px;
    align-items: center;
    padding: 28px;
}

.home-search h2,
.section-heading h2,
.page-hero h1,
.detail-content h2,
.detail-side h2 {
    margin: 0;
    letter-spacing: -0.03em;
}

.home-search p,
.page-hero p,
.detail-content p,
.detail-side dd,
.movie-card-body p,
.overview-card p,
.site-footer p {
    color: var(--muted);
}

.home-search-form,
.filter-form {
    display: grid;
    gap: 12px;
}

.home-search-form {
    grid-template-columns: 1fr auto;
}

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

.home-search-form input:focus,
.filter-form input:focus,
.filter-form select:focus {
    border-color: var(--red-400);
    box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.16);
}

.section-block {
    padding: 32px;
}

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

.section-heading span {
    color: var(--red-600);
    background: #fee2e2;
    font-size: 12px;
}

.section-heading h2 {
    margin-top: 8px;
    font-size: clamp(26px, 3vw, 36px);
}

.section-heading > a {
    color: var(--red-600);
    font-weight: 800;
}

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

.category-card {
    min-height: 150px;
    border: 1px solid rgba(239, 68, 68, 0.16);
    border-radius: 20px;
    padding: 22px;
    background: linear-gradient(135deg, #ffffff, #fff1f2);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.category-card:hover,
.movie-card:hover,
.overview-card:hover,
.mini-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 22px 40px rgba(15, 23, 42, 0.14);
}

.category-card span {
    display: block;
    margin-bottom: 12px;
    color: var(--red-600);
    font-size: 24px;
    font-weight: 900;
}

.category-card strong {
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

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

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

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

.poster-link {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 2 / 3;
    background: var(--slate-900);
}

.poster-link img {
    transition: transform 0.45s ease;
}

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

.poster-gradient {
    position: absolute;
    inset: auto 0 0;
    height: 40%;
    background: linear-gradient(180deg, transparent, rgba(2, 6, 23, 0.72));
}

.rank-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    display: grid;
    place-items: center;
    min-width: 30px;
    height: 30px;
    border-radius: 999px;
    background: var(--red-500);
    color: #ffffff;
    font-weight: 900;
    box-shadow: 0 10px 20px rgba(220, 38, 38, 0.35);
}

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

.movie-title {
    display: -webkit-box;
    overflow: hidden;
    min-height: 48px;
    color: var(--text);
    font-size: 17px;
    font-weight: 900;
    line-height: 1.38;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

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

.movie-card-body p {
    display: -webkit-box;
    overflow: hidden;
    min-height: 45px;
    margin: 8px 0 12px;
    font-size: 14px;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.movie-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.tag-row {
    margin-top: 10px;
}

.tag-row span {
    background: #f1f5f9;
    color: var(--slate-700);
}

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

.ranking-band {
    margin: 0 auto 32px;
    border-radius: 28px;
    padding: 32px;
    background: linear-gradient(135deg, var(--slate-800), var(--slate-950));
    color: #ffffff;
    box-shadow: var(--shadow);
}

.section-heading.light span {
    background: rgba(239, 68, 68, 0.2);
    color: #fecaca;
}

.section-heading.light h2,
.section-heading.light a {
    color: #ffffff;
}

.mini-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 14px;
}

.mini-card {
    position: relative;
    overflow: hidden;
    min-height: 212px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.mini-card img {
    aspect-ratio: 2 / 3;
    opacity: 0.82;
}

.mini-card span {
    position: absolute;
    top: 8px;
    left: 8px;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: var(--red-500);
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
}

.mini-card strong,
.mini-card em {
    display: block;
    padding: 0 10px;
}

.mini-card strong {
    margin-top: 8px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 13px;
}

.mini-card em {
    color: #cbd5e1;
    font-size: 12px;
    font-style: normal;
}

.page-hero {
    position: relative;
    overflow: hidden;
    padding: 46px;
    background: linear-gradient(135deg, var(--slate-900), var(--slate-800));
    color: #ffffff;
}

.page-hero.slim {
    padding: 38px 46px;
}

.page-hero h1 {
    max-width: 860px;
    margin-top: 14px;
    font-size: clamp(34px, 5vw, 56px);
    line-height: 1.05;
}

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

.filter-panel {
    padding: 22px;
}

.filter-form {
    grid-template-columns: 1.4fr repeat(3, 0.72fr) auto;
    align-items: end;
}

.filter-form label span {
    display: block;
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.overview-grid {
    display: grid;
    gap: 18px;
}

.overview-card {
    display: grid;
    grid-template-columns: 270px 1fr;
    gap: 24px;
    align-items: center;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: var(--shadow);
    padding: 22px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.overview-cover {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    overflow: hidden;
    border-radius: 18px;
    background: var(--slate-900);
}

.overview-cover img {
    aspect-ratio: 2 / 3;
}

.overview-card h2 {
    margin: 0 0 10px;
    font-size: 28px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 22px 0 0;
    color: var(--muted);
    font-weight: 700;
}

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

.detail-hero {
    position: relative;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 34px;
    align-items: center;
    min-height: 500px;
    margin: 24px auto 32px;
    overflow: hidden;
    border-radius: 30px;
    padding: 48px;
    background: var(--slate-900);
    color: #ffffff;
    box-shadow: var(--shadow);
}

.detail-poster {
    overflow: hidden;
    border-radius: 24px;
    aspect-ratio: 2 / 3;
    box-shadow: 0 30px 65px rgba(0, 0, 0, 0.45);
}

.detail-info h1 {
    margin: 18px 0 14px;
    font-size: clamp(36px, 5vw, 64px);
    line-height: 1.05;
    letter-spacing: -0.05em;
}

.detail-info p {
    max-width: 760px;
    margin: 0 0 22px;
    color: #e2e8f0;
    font-size: 20px;
}

.detail-meta span,
.detail-tags span {
    background: rgba(255, 255, 255, 0.13);
}

.detail-tags {
    margin-top: 12px;
}

.player-section {
    padding: 22px;
}

.player-shell {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    background: #000000;
    aspect-ratio: 16 / 9;
}

.movie-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    cursor: pointer;
}

.player-cover {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    gap: 12px;
    border: 0;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.18), rgba(2, 6, 23, 0.78));
    color: #ffffff;
    cursor: pointer;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.play-icon {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--red-500), var(--red-600));
    box-shadow: 0 18px 42px rgba(220, 38, 38, 0.38);
    font-size: 30px;
}

.player-cover strong {
    font-size: clamp(22px, 4vw, 38px);
    letter-spacing: -0.03em;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    padding: 32px;
}

.detail-content h2,
.detail-side h2 {
    margin-bottom: 12px;
    font-size: 26px;
}

.detail-content p {
    margin: 0 0 24px;
    font-size: 17px;
}

.detail-side {
    border-radius: 20px;
    background: #f8fafc;
    padding: 22px;
}

.detail-side dl {
    display: grid;
    grid-template-columns: 70px 1fr;
    gap: 10px 12px;
    margin: 0;
}

.detail-side dt {
    color: var(--muted);
    font-weight: 800;
}

.detail-side dd {
    margin: 0;
    font-weight: 700;
}

.empty-state {
    margin: 24px 0 0;
    border-radius: 16px;
    background: #fff1f2;
    color: var(--red-600);
    padding: 20px;
    text-align: center;
    font-weight: 800;
}

.site-footer {
    background: var(--slate-950);
    color: #cbd5e1;
}

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

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

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

.site-footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-footer li {
    margin: 8px 0;
}

.site-footer a:hover {
    color: var(--red-400);
}

.copyright {
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    padding: 18px 0 28px;
    color: #94a3b8;
    font-size: 14px;
}

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

    .menu-button {
        display: block;
    }

    .hero-slide,
    .detail-hero {
        grid-template-columns: 1fr 280px;
        padding: 44px;
    }

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

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

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

    .filter-form {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 760px) {
    .header-inner,
    .mobile-panel,
    .footer-grid,
    .copyright,
    main {
        width: min(100% - 24px, 1180px);
    }

    .brand-name {
        font-size: 21px;
    }

    .hero {
        min-height: 720px;
        border-radius: 24px;
    }

    .hero-slide {
        grid-template-columns: 1fr;
        align-content: center;
        gap: 22px;
        padding: 32px 22px 86px;
    }

    .hero-poster {
        width: min(240px, 72vw);
        margin: 0 auto;
        order: -1;
    }

    .hero p,
    .detail-info p,
    .page-hero p {
        font-size: 16px;
    }

    .hero-actions,
    .home-search-form {
        grid-template-columns: 1fr;
    }

    .hero-controls {
        left: 22px;
        right: 22px;
        bottom: 22px;
    }

    .home-search,
    .overview-card,
    .detail-layout,
    .detail-hero {
        grid-template-columns: 1fr;
    }

    .home-search,
    .section-block,
    .page-hero,
    .filter-panel,
    .detail-layout,
    .player-section,
    .ranking-band {
        padding: 22px;
        border-radius: 20px;
    }

    .category-grid,
    .movie-grid,
    .compact-grid,
    .mini-grid,
    .footer-grid,
    .filter-form {
        grid-template-columns: 1fr 1fr;
    }

    .detail-hero {
        padding: 28px 22px;
        min-height: auto;
    }

    .detail-poster {
        width: min(260px, 70vw);
        margin: 0 auto;
    }

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

    .overview-cover {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 520px) {
    .movie-grid,
    .compact-grid,
    .mini-grid,
    .category-grid,
    .filter-form,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: 760px;
    }

    .mobile-category-list {
        grid-template-columns: 1fr;
    }

    .player-shell {
        border-radius: 16px;
    }
}
