:root {
    --rose: #f43f5e;
    --pink: #ec4899;
    --orange: #f97316;
    --amber: #f59e0b;
    --emerald: #10b981;
    --text: #1f2937;
    --muted: #6b7280;
    --soft: #fff7f7;
    --line: #f3d4dc;
    --dark: #111827;
    --shadow: 0 20px 55px rgba(244, 63, 94, 0.18);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text);
    background: linear-gradient(180deg, #fff7f7 0%, #fff 36%, #fff8f1 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(244, 63, 94, 0.12);
}

.header-inner {
    width: min(1180px, calc(100% - 32px));
    min-height: 72px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 26px;
}

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -0.04em;
    background: linear-gradient(90deg, var(--rose), var(--orange));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    white-space: nowrap;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--rose), var(--orange));
    position: relative;
    box-shadow: 0 12px 28px rgba(244, 63, 94, 0.35);
    flex: 0 0 auto;
}

.brand-mark::after {
    content: "";
    position: absolute;
    left: 13px;
    top: 9px;
    border-left: 11px solid #fff;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 15px;
    font-weight: 700;
    color: #374151;
    flex: 1;
}

.main-nav a,
.mobile-menu a {
    transition: color 0.2s ease, transform 0.2s ease;
}

.main-nav a:hover,
.mobile-menu a:hover {
    color: var(--rose);
}

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

.header-search input,
.mobile-search input,
.hero-search input,
.search-panel input,
.category-filter input,
.search-page-input {
    width: 100%;
    border: 1px solid #f5c4d0;
    border-radius: 999px;
    padding: 12px 16px;
    outline: none;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search input {
    width: 240px;
    padding: 10px 14px;
}

.header-search input:focus,
.mobile-search input:focus,
.hero-search input:focus,
.search-panel input:focus,
.category-filter input:focus,
.search-page-input:focus {
    border-color: var(--rose);
    box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.12);
}

button,
.btn,
.header-search button,
.mobile-search button,
.hero-search button,
.search-panel button {
    border: 0;
    border-radius: 999px;
    padding: 11px 18px;
    background: linear-gradient(90deg, var(--rose), var(--orange));
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(244, 63, 94, 0.24);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover,
.btn:hover,
.header-search button:hover,
.mobile-search button:hover,
.hero-search button:hover,
.search-panel button:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(244, 63, 94, 0.32);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.92);
    color: var(--rose);
    box-shadow: 0 12px 28px rgba(255, 255, 255, 0.25);
}

.menu-button {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 25px rgba(17, 24, 39, 0.08);
}

.menu-button span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 4px auto;
    background: var(--text);
    border-radius: 8px;
}

.mobile-menu {
    display: none;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 18px;
    padding: 16px;
    border-radius: 22px;
    background: #fff;
    box-shadow: var(--shadow);
    gap: 14px;
    flex-direction: column;
}

.mobile-menu.is-open {
    display: flex;
}

.hero {
    position: relative;
    height: min(680px, calc(100vh - 72px));
    min-height: 560px;
    overflow: hidden;
    background: #111827;
}

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

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

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

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.05);
    filter: saturate(1.05);
}

.hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(17, 24, 39, 0.88), rgba(244, 63, 94, 0.74), rgba(249, 115, 22, 0.46));
}

.hero-content {
    position: relative;
    width: min(1180px, calc(100% - 32px));
    height: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.1fr 0.7fr;
    align-items: center;
    gap: 46px;
    color: #fff;
}

.hero-copy h1 {
    margin: 0 0 18px;
    font-size: clamp(42px, 7vw, 76px);
    line-height: 0.96;
    letter-spacing: -0.07em;
}

.hero-copy p {
    margin: 0 0 26px;
    max-width: 720px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 20px;
    line-height: 1.75;
}

.hero-tags,
.tag-row,
.detail-tags,
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.hero-tags span,
.tag-row span,
.detail-tags span {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

.tag-row span {
    background: #fff1f4;
    color: var(--rose);
}

.detail-tags span {
    background: #fff1f4;
    color: var(--rose);
}

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

.hero-search {
    max-width: 620px;
    padding: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(16px);
}

.hero-search input {
    border-color: transparent;
}

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

.hero-poster-card {
    width: min(360px, 100%);
    overflow: hidden;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(16px);
}

.hero-poster-card img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.hero-poster-info {
    padding: 20px;
}

.hero-poster-info strong {
    display: block;
    font-size: 24px;
    margin-bottom: 8px;
}

.hero-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    width: 48px;
    height: 48px;
    padding: 0;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(12px);
}

.hero-prev {
    left: 28px;
}

.hero-next {
    right: 28px;
}

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

.hero-dot {
    width: 12px;
    height: 12px;
    padding: 0;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.38);
}

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

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

.section {
    padding: 58px 0;
}

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

.section-heading h2,
.page-hero h1,
.detail-title,
.search-title {
    margin: 0;
    color: #1f2937;
    font-size: clamp(28px, 4vw, 46px);
    line-height: 1.08;
    letter-spacing: -0.05em;
}

.section-heading p,
.page-hero p,
.search-copy,
.category-desc {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.section-more {
    color: var(--rose);
    font-weight: 900;
}

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

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

.movie-card {
    display: block;
    overflow: hidden;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 35px rgba(17, 24, 39, 0.08);
    border: 1px solid rgba(244, 63, 94, 0.08);
    transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.movie-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 26px 60px rgba(244, 63, 94, 0.18);
}

.poster-wrap {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #fecdd3, #fed7aa);
}

.poster-wrap img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    transition: transform 0.32s ease;
}

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

.poster-badge,
.poster-time,
.rank-number {
    position: absolute;
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    background: rgba(17, 24, 39, 0.68);
    backdrop-filter: blur(10px);
}

.poster-badge {
    left: 10px;
    top: 10px;
    padding: 6px 10px;
}

.poster-time {
    right: 10px;
    bottom: 10px;
    padding: 5px 9px;
}

.rank-number {
    left: 10px;
    bottom: 10px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--amber), var(--orange));
}

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

.movie-card h3 {
    margin: 0 0 9px;
    color: #111827;
    font-size: 18px;
    line-height: 1.25;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

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

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: #9ca3af;
    font-size: 13px;
    font-weight: 700;
}

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

.category-card {
    position: relative;
    overflow: hidden;
    min-height: 180px;
    border-radius: 26px;
    padding: 24px;
    color: #fff;
    background: linear-gradient(135deg, var(--rose), var(--orange));
    box-shadow: var(--shadow);
}

.category-card:nth-child(3n + 2) {
    background: linear-gradient(135deg, #fb7185, #f59e0b);
}

.category-card:nth-child(3n) {
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
}

.category-card h3 {
    position: relative;
    z-index: 2;
    margin: 0 0 10px;
    font-size: 24px;
}

.category-card p {
    position: relative;
    z-index: 2;
    margin: 0 0 18px;
    color: rgba(255, 255, 255, 0.86);
    line-height: 1.7;
}

.category-card span {
    position: relative;
    z-index: 2;
    font-weight: 900;
}

.category-card::after {
    content: "";
    position: absolute;
    width: 170px;
    height: 170px;
    right: -50px;
    bottom: -50px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
}

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

.rank-item {
    display: grid;
    grid-template-columns: 58px 92px 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 14px;
    border-radius: 22px;
    background: #fff;
    border: 1px solid rgba(244, 63, 94, 0.08);
    box-shadow: 0 10px 28px rgba(17, 24, 39, 0.06);
}

.rank-index {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    font-weight: 900;
    background: linear-gradient(135deg, var(--amber), var(--orange));
}

.rank-item img {
    width: 92px;
    height: 68px;
    border-radius: 14px;
    object-fit: cover;
}

.rank-item h3 {
    margin: 0 0 6px;
    font-size: 18px;
}

.rank-item p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.page-hero {
    padding: 58px 0 34px;
    background: radial-gradient(circle at top left, rgba(244, 63, 94, 0.15), transparent 38%), radial-gradient(circle at top right, rgba(249, 115, 22, 0.12), transparent 34%);
}

.breadcrumb {
    margin-bottom: 16px;
    color: #fff;
    font-size: 14px;
}

.breadcrumb a {
    color: rgba(255, 255, 255, 0.82);
}

.detail-hero {
    padding: 22px 0;
    background: linear-gradient(90deg, #111827, #1f2937);
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 0.8fr);
    gap: 28px;
    padding: 32px 0 58px;
}

.player-card,
.detail-card,
.side-card,
.search-card {
    border-radius: 26px;
    background: #fff;
    box-shadow: 0 16px 45px rgba(17, 24, 39, 0.08);
    border: 1px solid rgba(244, 63, 94, 0.08);
    overflow: hidden;
}

.player-box {
    position: relative;
    background: #000;
}

.player-box video {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.play-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.16), rgba(17, 24, 39, 0.58));
    box-shadow: none;
}

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

.play-overlay span {
    width: 74px;
    height: 74px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--rose), var(--orange));
    color: #fff;
    font-size: 34px;
    box-shadow: 0 20px 45px rgba(244, 63, 94, 0.38);
}

.player-error {
    display: none;
    position: absolute;
    inset: 0;
    place-items: center;
    text-align: center;
    color: #fff;
    background: rgba(17, 24, 39, 0.82);
    padding: 24px;
}

.player-error.is-visible {
    display: grid;
}

.player-info,
.detail-card,
.side-card {
    padding: 24px;
}

.detail-title {
    margin-bottom: 12px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 16px 0;
    color: var(--muted);
    font-weight: 800;
}

.detail-card h2,
.side-card h2 {
    margin: 0 0 14px;
    font-size: 24px;
}

.detail-card p {
    margin: 0 0 18px;
    color: #4b5563;
    font-size: 16px;
    line-height: 1.92;
}

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

.side-list {
    display: grid;
    gap: 14px;
}

.side-list a {
    display: grid;
    grid-template-columns: 76px 1fr;
    gap: 12px;
    align-items: center;
}

.side-list img {
    width: 76px;
    height: 58px;
    border-radius: 12px;
    object-fit: cover;
}

.side-list strong {
    display: block;
    margin-bottom: 4px;
    line-height: 1.35;
}

.side-list span {
    color: var(--muted);
    font-size: 13px;
}

.category-toolbar,
.search-toolbar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: center;
    margin: 28px 0;
}

.category-filter {
    width: min(520px, 100%);
}

.search-results {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
    min-height: 240px;
}

.empty-state {
    grid-column: 1 / -1;
    padding: 42px;
    border-radius: 24px;
    background: #fff;
    text-align: center;
    color: var(--muted);
}

.site-footer {
    margin-top: 44px;
    background: linear-gradient(90deg, #111827, #1f2937);
    color: #fff;
}

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

.footer-grid p,
.footer-grid a,
.footer-bottom {
    color: rgba(255, 255, 255, 0.68);
    line-height: 1.8;
}

.footer-grid h3 {
    margin: 0 0 14px;
    font-size: 18px;
}

.footer-grid ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

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

.footer-bottom {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    text-align: center;
}

@media (max-width: 1080px) {
    .main-nav,
    .header-search {
        display: none;
    }

    .menu-button {
        display: block;
        margin-left: auto;
    }

    .hero-content,
    .detail-layout,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .hero-panel {
        display: none;
    }

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

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

@media (max-width: 720px) {
    .header-inner {
        min-height: 64px;
    }

    .brand {
        font-size: 20px;
    }

    .hero {
        min-height: 640px;
    }

    .hero-content {
        align-items: end;
        padding-bottom: 86px;
    }

    .hero-search,
    .category-toolbar,
    .search-toolbar,
    .rank-item {
        grid-template-columns: 1fr;
        display: grid;
    }

    .hero-control {
        display: none;
    }

    .movie-grid,
    .movie-grid.compact,
    .search-results,
    .category-grid,
    .related-grid {
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

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

    .movie-card p {
        min-height: auto;
        -webkit-line-clamp: 2;
    }

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

    .rank-item img {
        width: 100%;
        height: 160px;
    }
}

@media (max-width: 460px) {
    .movie-grid,
    .movie-grid.compact,
    .search-results,
    .category-grid,
    .related-grid {
        grid-template-columns: 1fr;
    }
}
