* {
    box-sizing: border-box;
}

:root {
    --red: #dc2626;
    --rose: #e11d48;
    --pink: #db2777;
    --dark: #111827;
    --muted: #6b7280;
    --soft: #f9fafb;
    --line: #e5e7eb;
    --card: #ffffff;
    --shadow: 0 18px 45px rgba(17, 24, 39, 0.12);
    --shadow-soft: 0 10px 26px rgba(17, 24, 39, 0.08);
    --radius: 22px;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--dark);
    background: linear-gradient(180deg, #f9fafb 0%, #ffffff 45%, #f9fafb 100%);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

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: linear-gradient(90deg, var(--red), var(--rose), var(--pink));
    box-shadow: 0 12px 30px rgba(220, 38, 38, 0.22);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 22px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    font-weight: 900;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

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

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

.main-nav a {
    padding: 9px 13px;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.88);
    font-weight: 700;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.top-search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 275px;
}

.top-search input,
.hero-search input,
.page-filter input,
.page-filter select {
    width: 100%;
    border: 0;
    outline: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    padding: 11px 16px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.top-search input::placeholder,
.hero-search input::placeholder {
    color: rgba(255, 255, 255, 0.75);
}

.top-search input:focus,
.hero-search input:focus {
    background: rgba(255, 255, 255, 0.26);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45);
}

.top-search button,
.hero-search button,
.primary-btn,
.secondary-btn,
.ghost-btn {
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.top-search button {
    padding: 10px 16px;
    color: var(--red);
    background: #ffffff;
}

.nav-toggle {
    display: none;
    margin-left: auto;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.18);
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 5px auto;
    background: #ffffff;
    border-radius: 999px;
}

.hero {
    position: relative;
    overflow: hidden;
    min-height: 720px;
    color: #ffffff;
    background: #15060a;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.7s ease;
}

.hero-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.hero-slide .hero-bg {
    position: absolute;
    inset: 0;
}

.hero-slide .hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.58;
    filter: saturate(1.05) contrast(1.08);
}

.hero-slide .hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 72% 28%, rgba(244, 63, 94, 0.42), transparent 30%),
        linear-gradient(90deg, rgba(17, 24, 39, 0.96), rgba(136, 19, 55, 0.82) 44%, rgba(17, 24, 39, 0.18)),
        linear-gradient(180deg, rgba(17, 24, 39, 0.15), rgba(17, 24, 39, 0.92));
}

.hero-inner {
    position: relative;
    z-index: 2;
    max-width: 1280px;
    min-height: 720px;
    margin: 0 auto;
    padding: 90px 24px 130px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 430px;
    gap: 50px;
    align-items: center;
}

.hero-kicker,
.section-kicker,
.detail-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #ffe4e6;
    font-weight: 800;
    font-size: 14px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.hero-title {
    margin: 18px 0 16px;
    max-width: 780px;
    font-size: clamp(42px, 6vw, 76px);
    line-height: 0.98;
    letter-spacing: -0.06em;
    font-weight: 950;
}

.hero-desc {
    max-width: 720px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 18px;
    line-height: 1.8;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 22px 0 28px;
}

.hero-meta span {
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.88);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 26px;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 22px;
}

.primary-btn {
    color: #ffffff;
    background: linear-gradient(90deg, var(--red), var(--rose));
    box-shadow: 0 16px 34px rgba(225, 29, 72, 0.32);
}

.secondary-btn {
    color: var(--red);
    background: #ffffff;
}

.ghost-btn {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.top-search button:hover,
.hero-search button:hover {
    transform: translateY(-2px);
}

.hero-search {
    display: flex;
    gap: 10px;
    max-width: 620px;
    padding: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(18px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.hero-search button {
    padding: 11px 20px;
    color: #ffffff;
    background: linear-gradient(90deg, var(--red), var(--rose));
}

.hero-panel {
    align-self: stretch;
    display: flex;
    align-items: center;
}

.hero-feature-card {
    width: 100%;
    padding: 18px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(18px);
}

.hero-feature-card .poster-wrap {
    display: block;
    position: relative;
    overflow: hidden;
    height: 520px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--red), var(--pink));
}

.poster-wrap {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #991b1b, #be123c 45%, #831843);
}

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

.poster-wrap:hover .poster-img,
.movie-card:hover .poster-img {
    transform: scale(1.06);
}

.poster-fallback-title {
    display: none;
    position: absolute;
    inset: auto 16px 18px 16px;
    z-index: 2;
    color: #ffffff;
    font-weight: 900;
    font-size: 20px;
    text-shadow: 0 3px 15px rgba(0, 0, 0, 0.4);
}

.poster-wrap.no-image .poster-fallback-title {
    display: block;
}

.hero-feature-card .feature-info {
    padding: 18px 6px 4px;
}

.hero-feature-card h3 {
    margin: 0 0 8px;
    font-size: 24px;
}

.hero-feature-card p {
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.7;
}

.hero-thumbs {
    position: absolute;
    z-index: 4;
    left: 50%;
    bottom: 32px;
    width: min(1232px, calc(100% - 48px));
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
}

.hero-thumb {
    border: 0;
    border-radius: 18px;
    overflow: hidden;
    padding: 0;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
    opacity: 0.72;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.hero-thumb.active,
.hero-thumb:hover {
    opacity: 1;
    transform: translateY(-3px);
}

.hero-thumb img {
    width: 100%;
    height: 76px;
    object-fit: cover;
}

.main-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 64px 24px;
}

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

.section-title {
    margin: 10px 0 0;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.1;
    letter-spacing: -0.04em;
    font-weight: 950;
}

.section-desc {
    margin: 12px 0 0;
    max-width: 760px;
    color: var(--muted);
    line-height: 1.8;
}

.gradient-section {
    margin: 72px 0;
    padding: 54px;
    border-radius: 34px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--red), var(--rose), var(--pink));
    box-shadow: var(--shadow);
}

.grid {
    display: grid;
    gap: 24px;
}

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

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

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

.movie-card,
.category-card,
.info-card,
.compact-card,
.player-card,
.detail-card {
    background: #ffffff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover,
.category-card:hover,
.compact-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow);
}

.movie-card .poster-wrap {
    display: block;
    aspect-ratio: 2 / 3;
}

.type-badge,
.rank-num {
    position: absolute;
    z-index: 3;
    top: 12px;
    border-radius: 999px;
    font-weight: 900;
    font-size: 12px;
}

.type-badge {
    right: 12px;
    padding: 6px 10px;
    color: #ffffff;
    background: var(--red);
}

.rank-num {
    left: 12px;
    min-width: 40px;
    padding: 7px 10px;
    color: var(--red);
    background: #ffffff;
    text-align: center;
}

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

.movie-title {
    display: -webkit-box;
    min-height: 52px;
    overflow: hidden;
    color: #111827;
    font-size: 18px;
    line-height: 1.45;
    font-weight: 900;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

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

.movie-line {
    display: -webkit-box;
    min-height: 48px;
    margin: 9px 0 12px;
    overflow: hidden;
    color: var(--muted);
    line-height: 1.65;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.movie-meta,
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}

.movie-meta span,
.detail-meta span {
    padding: 5px 9px;
    border-radius: 999px;
    background: #f3f4f6;
}

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

.tag-row span {
    padding: 5px 8px;
    border-radius: 999px;
    color: #be123c;
    background: #ffe4e6;
    font-size: 12px;
    font-weight: 700;
}

.category-card {
    position: relative;
    min-height: 220px;
    padding: 26px;
    color: #ffffff;
    background: linear-gradient(135deg, #dc2626, #e11d48 52%, #db2777);
}

.category-card:nth-child(even) {
    background: linear-gradient(135deg, #be123c, #9f1239 55%, #831843);
}

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

.category-card p {
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
    line-height: 1.7;
}

.category-card span {
    position: absolute;
    right: 24px;
    bottom: 22px;
    font-weight: 900;
}

.page-hero {
    color: #ffffff;
    background:
        radial-gradient(circle at 80% 0%, rgba(244, 63, 94, 0.55), transparent 28%),
        linear-gradient(110deg, #991b1b, #e11d48 50%, #db2777);
}

.page-hero-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 76px 24px;
}

.page-hero h1 {
    margin: 14px 0 12px;
    max-width: 900px;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.05;
    letter-spacing: -0.05em;
    font-weight: 950;
}

.page-hero p {
    max-width: 780px;
    margin: 0;
    color: rgba(255, 255, 255, 0.84);
    font-size: 18px;
    line-height: 1.8;
}

.page-filter {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px 190px;
    gap: 12px;
    margin: -32px auto 42px;
    padding: 18px;
    max-width: 1280px;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.page-filter input,
.page-filter select {
    color: #111827;
    background: #f3f4f6;
    box-shadow: none;
}

.page-filter input::placeholder {
    color: #9ca3af;
}

.list-empty {
    display: none;
    padding: 30px;
    border-radius: 20px;
    color: var(--muted);
    background: #ffffff;
    box-shadow: var(--shadow-soft);
}

.compact-list {
    display: grid;
    gap: 16px;
}

.compact-card {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 14px;
    padding: 12px;
}

.compact-poster {
    display: block;
    height: 126px;
    border-radius: 16px;
}

.compact-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.compact-title {
    color: #111827;
    font-weight: 900;
    line-height: 1.45;
}

.compact-body p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.detail-hero {
    color: #ffffff;
    background:
        radial-gradient(circle at 75% 16%, rgba(244, 63, 94, 0.44), transparent 30%),
        linear-gradient(115deg, #111827, #7f1d1d 48%, #881337);
}

.detail-hero-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 56px 24px 40px;
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 34px;
    align-items: end;
}

.detail-cover {
    border-radius: 26px;
    aspect-ratio: 2 / 3;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
    color: rgba(255, 255, 255, 0.74);
    font-size: 14px;
}

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

.detail-hero h1 {
    margin: 16px 0;
    font-size: clamp(36px, 5vw, 64px);
    line-height: 1.04;
    letter-spacing: -0.05em;
    font-weight: 950;
}

.detail-hero p {
    max-width: 880px;
    margin: 0 0 18px;
    color: rgba(255, 255, 255, 0.84);
    font-size: 17px;
    line-height: 1.8;
}

.detail-layout {
    max-width: 1280px;
    margin: 0 auto;
    padding: 44px 24px 74px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
}

.player-card {
    padding: 18px;
}

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

.player-frame video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #050505;
}

.player-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    border: 0;
    color: #ffffff;
    background: radial-gradient(circle at center, rgba(225, 29, 72, 0.22), rgba(0, 0, 0, 0.28));
    cursor: pointer;
}

.player-overlay span {
    display: grid;
    place-items: center;
    width: 86px;
    height: 86px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--red), var(--rose));
    box-shadow: 0 18px 45px rgba(225, 29, 72, 0.36);
    font-size: 30px;
    transform: translateX(3px);
}

.player-frame.started .player-overlay {
    display: none;
}

.detail-card {
    padding: 26px;
    margin-top: 22px;
}

.detail-card h2,
.sidebar h2 {
    margin: 0 0 16px;
    font-size: 24px;
    font-weight: 950;
}

.detail-card p {
    margin: 0 0 16px;
    color: #374151;
    line-height: 1.95;
}

.sidebar {
    display: grid;
    gap: 22px;
    align-content: start;
}

.sidebar-panel {
    padding: 20px;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: var(--shadow-soft);
}

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

.site-footer {
    color: #ffffff;
    background: #111827;
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 38px 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
}

.footer-brand {
    font-size: 20px;
    font-weight: 950;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-left: auto;
}

.footer-links a {
    color: #d1d5db;
}

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

.footer-inner p {
    width: 100%;
    margin: 0;
    color: #9ca3af;
}

@media (max-width: 1100px) {
    .hero-inner,
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .hero-panel {
        display: none;
    }

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

@media (max-width: 900px) {
    .header-inner {
        flex-wrap: wrap;
    }

    .nav-toggle {
        display: block;
    }

    .main-nav,
    .top-search {
        display: none;
        width: 100%;
    }

    .main-nav.open,
    .top-search.open {
        display: flex;
    }

    .main-nav {
        flex-direction: column;
        align-items: stretch;
        margin-left: 0;
    }

    .main-nav a {
        border-radius: 14px;
    }

    .top-search {
        min-width: 0;
    }

    .hero,
    .hero-inner {
        min-height: 650px;
    }

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

    .hero-thumb:nth-child(n+4) {
        display: none;
    }

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

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

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

    .detail-cover {
        width: 180px;
    }
}

@media (max-width: 620px) {
    .header-inner,
    .main-wrap,
    .page-hero-inner,
    .detail-layout,
    .detail-hero-inner {
        padding-left: 16px;
        padding-right: 16px;
    }

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

    .hero-inner {
        padding: 76px 16px 120px;
    }

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

    .hero-search input,
    .hero-search button {
        border-radius: 18px;
    }

    .hero-thumbs {
        bottom: 20px;
        width: calc(100% - 32px);
        gap: 8px;
    }

    .hero-thumb img {
        height: 58px;
    }

    .section-head {
        display: block;
    }

    .gradient-section {
        padding: 28px;
        border-radius: 26px;
    }

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

    .movie-card .poster-wrap {
        aspect-ratio: 16 / 10;
    }

    .detail-cover {
        width: 150px;
    }

    .player-card,
    .detail-card,
    .sidebar-panel {
        padding: 14px;
        border-radius: 20px;
    }
}
