* {
    box-sizing: border-box;
}

:root {
    --rose-50: #fff1f2;
    --rose-100: #ffe4e6;
    --rose-500: #f43f5e;
    --rose-600: #e11d48;
    --pink-600: #db2777;
    --blue-100: #dbeafe;
    --blue-700: #1d4ed8;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 10px 25px rgba(15, 23, 42, 0.12);
    --shadow-xl: 0 24px 60px rgba(15, 23, 42, 0.18);
    --radius: 18px;
    --max: 1280px;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--gray-900);
    background: linear-gradient(180deg, var(--gray-50) 0%, #ffffff 100%);
}

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

img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: linear-gradient(135deg, #111827, #3f3f46);
}

button,
input,
select {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(229, 231, 235, 0.9);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-sm);
}

.header-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 28px;
}

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

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: linear-gradient(135deg, var(--rose-500), var(--pink-600));
    box-shadow: 0 12px 30px rgba(244, 63, 94, 0.28);
}

.brand-text {
    font-size: 21px;
    background: linear-gradient(90deg, var(--rose-500), var(--pink-600));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    font-size: 15px;
    color: var(--gray-700);
}

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

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

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

.top-search input,
.mobile-search input,
.filter-input,
.search-hero input {
    border: 1px solid var(--gray-300);
    outline: 0;
    border-radius: 999px;
    background: #ffffff;
    color: var(--gray-900);
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.top-search input {
    width: 220px;
    padding: 9px 14px;
}

.top-search button,
.mobile-search button,
.search-hero button,
.primary-button,
.ghost-button,
.filter-button,
.hero-button,
.player-button {
    border: 0;
    cursor: pointer;
    border-radius: 999px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.top-search button,
.mobile-search button,
.search-hero button,
.primary-button,
.hero-button {
    color: #ffffff;
    background: linear-gradient(90deg, var(--rose-500), var(--pink-600));
    box-shadow: 0 12px 30px rgba(244, 63, 94, 0.25);
}

.top-search button {
    padding: 9px 16px;
}

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

.mobile-menu-button {
    display: none;
    border: 0;
    background: transparent;
    color: var(--gray-800);
    font-size: 26px;
    cursor: pointer;
}

.mobile-menu {
    display: none;
    border-top: 1px solid var(--gray-200);
    padding: 16px 24px 22px;
    background: #ffffff;
}

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

.mobile-menu nav {
    max-width: var(--max);
    margin: 14px auto 0;
    display: grid;
    gap: 10px;
}

.mobile-menu a {
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--gray-700);
}

.mobile-menu a:hover {
    background: var(--rose-50);
}

.mobile-search {
    max-width: var(--max);
    margin: 0 auto;
}

.mobile-search input {
    flex: 1;
    padding: 11px 14px;
}

.mobile-search button {
    padding: 11px 18px;
}

.hero {
    position: relative;
    height: 600px;
    overflow: hidden;
    color: #ffffff;
    background: #000000;
}

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

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

.hero-slide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.86) 0%, rgba(0, 0, 0, 0.54) 48%, rgba(0, 0, 0, 0.08) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: var(--max);
    margin: 0 auto;
    height: 100%;
    padding: 0 24px;
    display: flex;
    align-items: center;
}

.hero-copy {
    max-width: 680px;
}

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

.hero-tags span,
.detail-tags span,
.tag-row span,
.region-pill,
.play-chip,
.rank-badge,
.type-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    white-space: nowrap;
}

.hero-tags span {
    padding: 7px 12px;
    background: rgba(244, 63, 94, 0.78);
    backdrop-filter: blur(8px);
    font-size: 14px;
    font-weight: 700;
}

.hero h1,
.hero h2 {
    margin: 18px 0 16px;
    font-size: clamp(38px, 7vw, 64px);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

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

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 30px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 700;
}

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

.hero-button,
.primary-button {
    padding: 13px 24px;
    font-weight: 800;
}

.ghost-button {
    padding: 12px 22px;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
}

.hero-button:hover,
.primary-button:hover,
.top-search button:hover,
.mobile-search button:hover,
.search-hero button:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 38px rgba(244, 63, 94, 0.32);
}

.ghost-button:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.22);
}

.hero-control {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.48);
    cursor: pointer;
    transform: translateY(-50%);
    transition: background 0.2s ease;
}

.hero-control:hover {
    background: rgba(0, 0, 0, 0.72);
}

.hero-control.prev {
    left: 20px;
}

.hero-control.next {
    right: 20px;
}

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

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

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

.page-shell,
.home-content {
    max-width: var(--max);
    margin: 0 auto;
    padding: 54px 24px;
}

.home-content {
    display: grid;
    gap: 64px;
}

.content-section {
    display: grid;
    gap: 24px;
}

.section-heading,
.filter-bar,
.detail-heading,
.category-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 18px;
}

.section-heading h2,
.page-title h1,
.detail-copy h1,
.search-hero h1 {
    margin: 0;
    color: var(--gray-900);
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.2;
    letter-spacing: -0.03em;
}

.section-heading p,
.page-title p,
.category-banner p,
.search-hero p {
    margin: 8px 0 0;
    color: var(--gray-600);
    line-height: 1.8;
}

.section-link {
    color: var(--rose-600);
    font-weight: 800;
}

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

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

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

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

.movie-card {
    overflow: hidden;
    border: 1px solid rgba(229, 231, 235, 0.8);
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-5px);
    border-color: rgba(244, 63, 94, 0.25);
    box-shadow: var(--shadow-md);
}

.poster-link,
.compact-cover,
.horizontal-cover,
.large-cover {
    position: relative;
    display: block;
    overflow: hidden;
}

.poster-link {
    height: 260px;
}

.poster-link img,
.compact-cover img,
.horizontal-cover img,
.large-cover img {
    transition: transform 0.45s ease;
}

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

.poster-link::after,
.large-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.62));
    transition: opacity 0.25s ease;
}

.movie-card:hover .poster-link::after,
.movie-card:hover .large-cover::after {
    opacity: 1;
}

.region-pill {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    padding: 6px 10px;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.68);
    backdrop-filter: blur(8px);
    font-size: 12px;
    font-weight: 700;
}

.play-chip {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 2;
    width: 40px;
    height: 40px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--rose-500), var(--pink-600));
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.card-body,
.compact-info,
.horizontal-info {
    padding: 16px;
}

.card-title,
.compact-info a,
.horizontal-info a {
    display: block;
    color: var(--gray-900);
    font-weight: 800;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.card-title {
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.movie-card:hover .card-title,
.movie-card:hover .compact-info a,
.movie-card:hover .horizontal-info a {
    color: var(--rose-600);
}

.card-body p,
.horizontal-info p,
.large-content p,
.compact-info p {
    margin: 0;
    color: var(--gray-600);
    font-size: 14px;
    line-height: 1.65;
}

.card-body p,
.horizontal-info p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    color: var(--gray-500);
    font-size: 12px;
}

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

.tag-row span,
.detail-tags span {
    padding: 5px 9px;
    color: var(--gray-700);
    background: var(--gray-100);
    font-size: 12px;
}

.tag-row.light span {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
}

.movie-card-horizontal {
    display: flex;
    min-height: 150px;
}

.horizontal-cover {
    width: 210px;
    min-height: 150px;
    flex-shrink: 0;
}

.horizontal-info {
    flex: 1;
    min-width: 0;
}

.rank-badge {
    position: absolute;
    left: 12px;
    top: 12px;
    z-index: 2;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--rose-500), var(--pink-600));
    font-weight: 900;
}

.movie-card-large {
    height: 380px;
}

.large-cover {
    height: 100%;
    color: #ffffff;
}

.large-content {
    position: absolute;
    z-index: 2;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 26px;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.78));
}

.large-content h3 {
    margin: 12px 0 10px;
    font-size: 28px;
    line-height: 1.2;
}

.movie-card-compact .compact-cover {
    height: 142px;
}

.compact-cover span {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 8px;
    border-radius: 10px;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.66);
    font-size: 12px;
}

.compact-info a {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.compact-info p {
    margin-top: 6px;
    color: var(--gray-500);
    font-size: 12px;
}

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

.category-tile,
.category-card,
.info-panel,
.detail-panel,
.search-panel {
    border: 1px solid rgba(229, 231, 235, 0.86);
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.category-tile {
    padding: 24px;
    overflow: hidden;
    position: relative;
}

.category-tile::before {
    content: "";
    position: absolute;
    top: -60px;
    right: -70px;
    width: 150px;
    height: 150px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(244, 63, 94, 0.2), transparent 68%);
}

.category-tile h3 {
    margin: 0 0 10px;
    font-size: 22px;
}

.category-tile p {
    margin: 0 0 18px;
    color: var(--gray-600);
    line-height: 1.7;
}

.category-tile span {
    color: var(--rose-600);
    font-weight: 800;
}

.page-title,
.category-banner,
.search-hero {
    border-radius: 30px;
    padding: 46px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--rose-500), var(--pink-600));
    box-shadow: var(--shadow-md);
}

.page-title h1,
.category-banner h1,
.search-hero h1,
.page-title p,
.category-banner p,
.search-hero p {
    color: #ffffff;
}

.category-overview {
    display: grid;
    gap: 28px;
    margin-top: 34px;
}

.category-card {
    padding: 24px;
}

.category-card-head h2 {
    margin: 0;
    font-size: 26px;
}

.category-card-head p {
    margin: 8px 0 0;
    color: var(--gray-600);
}

.category-card .movie-grid {
    margin-top: 20px;
}

.filter-panel {
    display: grid;
    gap: 16px;
    margin: 28px 0;
    padding: 18px;
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.filter-input {
    width: min(100%, 420px);
    padding: 12px 16px;
}

.filter-button {
    padding: 9px 14px;
    color: var(--gray-700);
    background: var(--gray-100);
}

.filter-button.is-active,
.filter-button:hover {
    color: #ffffff;
    background: var(--rose-500);
}

.empty-state {
    display: none;
    padding: 54px;
    text-align: center;
    color: var(--gray-600);
    border-radius: var(--radius);
    background: #ffffff;
}

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

.ranking-list {
    display: grid;
    gap: 16px;
    margin-top: 30px;
}

.search-hero {
    display: grid;
    gap: 22px;
}

.search-hero form {
    display: flex;
    gap: 12px;
    max-width: 760px;
}

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

.search-hero button {
    padding: 15px 28px;
    font-weight: 800;
}

.search-status {
    margin: 28px 0 18px;
    color: var(--gray-600);
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 30px;
    align-items: start;
}

.breadcrumb {
    margin-bottom: 22px;
    color: var(--gray-500);
    font-size: 14px;
}

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

.player-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    background: #000000;
    box-shadow: var(--shadow-xl);
    aspect-ratio: 16 / 9;
}

.player-wrap video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000000;
}

.player-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.24), rgba(0, 0, 0, 0.62));
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.player-button {
    width: 86px;
    height: 86px;
    color: #ffffff;
    font-size: 34px;
    background: linear-gradient(135deg, var(--rose-500), var(--pink-600));
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.38);
}

.player-button:hover {
    transform: scale(1.06);
}

.player-error {
    display: none;
    position: absolute;
    left: 18px;
    bottom: 18px;
    z-index: 4;
    padding: 10px 14px;
    border-radius: 12px;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.7);
}

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

.detail-panel,
.info-panel {
    padding: 26px;
}

.detail-copy {
    display: grid;
    gap: 24px;
    margin-top: 24px;
}

.detail-copy h1 {
    font-size: clamp(32px, 4vw, 48px);
}

.detail-section h2,
.info-panel h2 {
    margin: 0 0 12px;
    font-size: 22px;
}

.detail-section p,
.info-panel p {
    margin: 0;
    color: var(--gray-700);
    line-height: 1.9;
}

.meta-row {
    gap: 10px;
}

.type-pill {
    padding: 7px 11px;
    color: var(--rose-700, #be123c);
    background: var(--rose-100);
    font-weight: 800;
    font-size: 13px;
}

.sidebar-poster {
    overflow: hidden;
    height: 440px;
    border-radius: 20px;
    background: var(--gray-900);
}

.info-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
    font-size: 14px;
}

.info-list div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-100);
}

.info-list span:first-child {
    color: var(--gray-500);
}

.info-list span:last-child {
    color: var(--gray-900);
    font-weight: 800;
    text-align: right;
}

.related-section {
    margin-top: 46px;
}

.site-footer {
    margin-top: 60px;
    color: var(--gray-300);
    background: #111827;
}

.footer-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 44px 24px;
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: 34px;
}

.footer-brand p {
    max-width: 430px;
    color: var(--gray-400);
    line-height: 1.8;
}

.footer-links {
    display: grid;
    gap: 10px;
    align-content: start;
}

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

.footer-links a {
    color: var(--gray-400);
    font-size: 14px;
}

.footer-bottom {
    max-width: var(--max);
    margin: 0 auto;
    padding: 18px 24px 28px;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    color: var(--gray-500);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 14px;
}

@media (max-width: 1180px) {
    .main-nav {
        display: none;
    }

    .mobile-menu-button {
        display: inline-flex;
    }

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

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

    .sidebar-poster {
        height: 520px;
    }
}

@media (max-width: 820px) {
    .top-search {
        display: none;
    }

    .header-inner {
        padding: 12px 18px;
    }

    .hero {
        height: 560px;
    }

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

    .hero-control {
        display: none;
    }

    .home-content,
    .page-shell {
        padding: 36px 18px;
    }

    .movie-grid,
    .movie-grid.six,
    .movie-grid.compact,
    .category-tiles,
    .horizontal-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .poster-link {
        height: 220px;
    }

    .movie-card-horizontal {
        display: block;
    }

    .horizontal-cover {
        width: 100%;
        height: 210px;
    }

    .page-title,
    .category-banner,
    .search-hero {
        padding: 34px 24px;
        border-radius: 24px;
    }

    .search-hero form,
    .section-heading,
    .filter-bar,
    .category-card-head {
        align-items: stretch;
        flex-direction: column;
    }

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

    .footer-bottom {
        flex-direction: column;
    }
}

@media (max-width: 540px) {
    .brand-text {
        font-size: 18px;
    }

    .hero {
        height: 520px;
    }

    .hero h1,
    .hero h2 {
        font-size: 36px;
    }

    .hero p {
        font-size: 16px;
    }

    .movie-grid,
    .movie-grid.six,
    .movie-grid.compact,
    .category-tiles,
    .horizontal-list {
        grid-template-columns: 1fr;
    }

    .poster-link {
        height: 260px;
    }

    .sidebar-poster {
        height: 420px;
    }
}
