* {
    box-sizing: border-box;
}

:root {
    --bg: #f9fafb;
    --surface: #ffffff;
    --surface-soft: #fff7ed;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --primary: #dc2626;
    --primary-dark: #b91c1c;
    --accent: #f97316;
    --accent-soft: #fed7aa;
    --shadow: 0 16px 45px rgba(15, 23, 42, 0.12);
    --radius: 18px;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

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

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

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.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.96);
    border-bottom: 1px solid rgba(229, 231, 235, 0.9);
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(18px);
}

.header-inner {
    display: flex;
    align-items: center;
    min-height: 72px;
    gap: 24px;
}

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    color: #ffffff;
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(135deg, #ef4444, #f97316);
    box-shadow: 0 10px 25px rgba(220, 38, 38, 0.28);
}

.brand-text {
    display: grid;
    gap: 1px;
}

.brand-text strong {
    font-size: 20px;
    letter-spacing: 0.01em;
}

.brand-text small {
    color: var(--muted);
    font-size: 12px;
}

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

.nav-link,
.mobile-link {
    padding: 10px 14px;
    border-radius: 999px;
    color: #374151;
    font-weight: 650;
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active,
.mobile-link:hover,
.mobile-link.is-active {
    color: var(--primary);
    background: #fef2f2;
}

.header-search,
.mobile-search,
.inline-search,
.hero-search {
    display: flex;
    align-items: center;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 999px;
}

.header-search input,
.mobile-search input,
.inline-search input,
.hero-search input {
    min-width: 0;
    border: 0;
    outline: 0;
    padding: 11px 16px;
    background: transparent;
    color: var(--text);
}

.header-search input {
    width: 230px;
}

.header-search button,
.mobile-search button,
.inline-search button,
.hero-search button {
    border: 0;
    color: #ffffff;
    font-weight: 700;
    padding: 11px 18px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
}

.menu-button {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    background: transparent;
    margin-left: auto;
}

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

.mobile-panel {
    display: none;
    border-top: 1px solid var(--border);
    padding: 16px;
    background: #ffffff;
}

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

.mobile-panel nav {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.hero-section {
    position: relative;
    overflow: hidden;
    color: #ffffff;
    background: radial-gradient(circle at top right, rgba(253, 186, 116, 0.5), transparent 28%), linear-gradient(135deg, #dc2626 0%, #f97316 52%, #facc15 100%);
}

.hero-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(127, 29, 29, 0.28), rgba(127, 29, 29, 0.04));
}

.hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.98fr);
    gap: 56px;
    align-items: center;
    min-height: 560px;
    padding: 72px 0;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    color: #fff7ed;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hero-copy h1,
.page-hero h1 {
    margin: 0;
    font-size: clamp(36px, 5vw, 58px);
    line-height: 1.12;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.hero-copy p,
.page-hero p {
    max-width: 680px;
    margin: 20px 0 0;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    max-width: 560px;
    margin: 34px 0;
}

.hero-stats span {
    display: grid;
    gap: 2px;
    padding: 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.hero-stats strong {
    font-size: 34px;
    line-height: 1;
}

.hero-stats em {
    font-style: normal;
    color: #ffedd5;
    font-size: 14px;
}

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

.primary-button,
.ghost-button,
.text-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 24px;
    border-radius: 999px;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-button {
    color: var(--primary);
    background: #ffffff;
    box-shadow: 0 16px 32px rgba(127, 29, 29, 0.18);
}

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

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

.hero-carousel {
    position: relative;
}

.hero-slide {
    display: none;
}

.hero-slide.is-active {
    display: block;
    animation: fadeIn 0.5s ease both;
}

.hero-poster {
    position: relative;
    display: block;
    min-height: 420px;
    overflow: hidden;
    border-radius: 26px;
    box-shadow: 0 24px 70px rgba(127, 29, 29, 0.38);
}

.hero-poster img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.hero-poster:hover img {
    transform: scale(1.06);
}

.hero-poster-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.08) 58%);
}

.hero-poster-text {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    gap: 8px;
    padding: 28px;
}

.hero-poster-text strong {
    font-size: 28px;
    font-weight: 900;
}

.hero-poster-text em {
    max-width: 580px;
    color: #e5e7eb;
    font-style: normal;
}

.hero-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}

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

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

.section {
    padding: 56px 0 0;
}

.section:last-of-type {
    padding-bottom: 64px;
}

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

.section-heading span {
    display: block;
    margin-bottom: 4px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(26px, 3.4vw, 34px);
    line-height: 1.2;
}

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

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

.movie-card {
    overflow: hidden;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.movie-cover {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #111827;
}

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

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

.movie-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0;
    background: rgba(0, 0, 0, 0.34);
    transition: opacity 0.2s ease;
}

.movie-card:hover .movie-cover::after {
    opacity: 1;
}

.cover-badge,
.cover-play {
    position: absolute;
    z-index: 2;
}

.cover-badge {
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 8px;
    color: #ffffff;
    background: var(--primary);
    font-size: 12px;
    font-weight: 800;
}

.cover-play {
    left: 50%;
    top: 50%;
    display: grid;
    width: 50px;
    height: 50px;
    place-items: center;
    color: var(--primary);
    background: rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.movie-info {
    padding: 16px;
}

.movie-info h2,
.rank-info h2 {
    margin: 0 0 8px;
    font-size: 17px;
    line-height: 1.35;
}

.movie-info h2 a:hover,
.rank-info h2 a:hover,
.detail-card h1 a:hover {
    color: var(--primary);
}

.movie-info p,
.rank-info p {
    display: -webkit-box;
    min-height: 44px;
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 14px;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.movie-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 13px;
    color: #6b7280;
    font-size: 13px;
}

.movie-meta span {
    padding: 3px 9px;
    border-radius: 99px;
    background: #f3f4f6;
}

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

.category-card {
    position: relative;
    display: grid;
    align-content: end;
    min-height: 220px;
    overflow: hidden;
    padding: 22px;
    border-radius: 22px;
    color: #ffffff;
    box-shadow: var(--shadow);
}

.category-card img,
.category-card span {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.category-card img {
    object-fit: cover;
    transition: transform 0.35s ease;
}

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

.category-card span {
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.1));
}

.category-card strong,
.category-card em {
    position: relative;
    z-index: 1;
}

.category-card strong {
    font-size: 24px;
    font-weight: 900;
}

.category-card em {
    display: -webkit-box;
    margin-top: 8px;
    overflow: hidden;
    color: #e5e7eb;
    font-style: normal;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

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

.rank-card {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    overflow: hidden;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.rank-cover {
    position: relative;
    min-height: 132px;
    overflow: hidden;
}

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

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

.rank-cover span {
    position: absolute;
    top: 10px;
    left: 10px;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: #ffffff;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    font-weight: 900;
}

.rank-info {
    padding: 16px;
}

.page-main {
    padding-bottom: 70px;
}

.page-hero {
    margin-top: 34px;
    padding: 42px;
    color: #ffffff;
    border-radius: 28px;
    background: radial-gradient(circle at top right, rgba(253, 186, 116, 0.48), transparent 28%), linear-gradient(135deg, #991b1b, #dc2626 48%, #f97316);
    box-shadow: var(--shadow);
}

.page-hero.small-hero h1,
.page-hero.category-hero h1 {
    font-size: clamp(34px, 4vw, 48px);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    color: rgba(255, 255, 255, 0.84);
    font-weight: 700;
}

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

.filter-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 28px auto;
    padding: 18px;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

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

.filter-btn {
    border: 0;
    padding: 9px 16px;
    border-radius: 999px;
    color: #374151;
    background: #f3f4f6;
    font-weight: 800;
}

.filter-btn.is-active,
.filter-btn:hover {
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-top: 28px;
}

.category-overview-card {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 22px;
    padding: 18px;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.category-covers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    overflow: hidden;
    min-height: 142px;
    border-radius: 16px;
    background: #111827;
}

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

.category-overview-card h2 {
    margin: 2px 0 8px;
    font-size: 24px;
}

.category-overview-card p {
    margin: 0 0 18px;
    color: var(--muted);
}

.text-button {
    min-height: 38px;
    padding: 0 18px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
}

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

.detail-primary .breadcrumb {
    color: #6b7280;
}

.detail-primary .breadcrumb a:hover {
    color: var(--primary);
}

.player-card,
.detail-card,
.side-card,
.search-panel {
    overflow: hidden;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.player-box {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000000;
}

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

.player-overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: grid;
    place-items: center;
    border: 0;
    color: #ffffff;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.48), rgba(0, 0, 0, 0.16));
}

.player-overlay.is-hidden {
    display: none;
}

.play-button {
    display: grid;
    width: 78px;
    height: 78px;
    place-items: center;
    padding-left: 5px;
    color: var(--primary);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
    font-size: 31px;
}

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

.detail-card h1 {
    margin: 0 0 14px;
    font-size: clamp(28px, 3.6vw, 42px);
    line-height: 1.2;
}

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

.detail-meta span,
.tag-cloud span {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    color: #7f1d1d;
    background: #ffedd5;
    font-weight: 750;
    font-size: 13px;
}

.lead-text {
    margin: 0 0 22px;
    color: #374151;
    font-size: 20px;
    font-weight: 750;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 26px;
}

.detail-card h2,
.side-card h2 {
    margin: 28px 0 12px;
    font-size: 22px;
}

.side-card h2 {
    margin-top: 0;
}

.detail-card p {
    color: #374151;
    text-align: justify;
    margin: 0 0 12px;
}

.detail-side {
    min-width: 0;
}

.side-card {
    position: sticky;
    top: 98px;
    padding: 18px;
}

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

.compact-card {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    border-radius: 14px;
    box-shadow: none;
    border: 1px solid var(--border);
}

.compact-card .movie-cover {
    aspect-ratio: 16 / 11;
}

.compact-card .movie-info {
    padding: 12px;
}

.compact-card .movie-info h2 {
    font-size: 14px;
}

.compact-card .movie-info p {
    min-height: auto;
    font-size: 12px;
}

.compact-card .movie-meta {
    display: none;
}

.hero-search {
    width: min(760px, 100%);
    margin-top: 24px;
}

.hero-search input {
    flex: 1;
    min-height: 54px;
}

.search-panel {
    margin-top: 28px;
    padding: 28px;
}

.site-footer {
    margin-top: 36px;
    padding: 42px 0;
    color: #d1d5db;
    background: #111827;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 32px;
}

.footer-brand {
    color: #ffffff;
    margin-bottom: 14px;
}

.site-footer p {
    max-width: 560px;
    margin: 0;
    color: #9ca3af;
}

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

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

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

    .hero-grid {
        min-height: auto;
    }

    .detail-side .side-card {
        position: static;
    }

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

    .overview-grid,
    .rank-grid,
    .rank-list {
        grid-template-columns: 1fr;
    }
}

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

    .menu-button {
        display: block;
    }

    .brand-text small {
        display: none;
    }

    .hero-section {
        border-radius: 0;
    }

    .hero-grid {
        gap: 34px;
        padding: 52px 0;
    }

    .hero-copy h1,
    .page-hero h1 {
        font-size: 34px;
    }

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

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

    .hero-poster,
    .hero-poster img {
        min-height: 330px;
        height: 330px;
    }

    .section-heading,
    .filter-panel {
        align-items: stretch;
        flex-direction: column;
    }

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

    .rank-card,
    .category-overview-card {
        grid-template-columns: 1fr;
    }

    .rank-cover {
        min-height: 190px;
    }

    .category-covers {
        min-height: 170px;
    }

    .page-hero {
        padding: 28px;
        border-radius: 22px;
    }

    .detail-card {
        padding: 22px;
    }

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

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

    .header-inner {
        min-height: 64px;
        gap: 10px;
    }

    .brand-mark {
        width: 38px;
        height: 38px;
    }

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

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

    .compact-card {
        grid-template-columns: 112px minmax(0, 1fr);
    }

    .hero-actions,
    .primary-button,
    .ghost-button {
        width: 100%;
    }

    .hero-search,
    .inline-search,
    .mobile-search {
        border-radius: 18px;
        flex-direction: column;
        align-items: stretch;
    }

    .hero-search input,
    .inline-search input,
    .mobile-search input,
    .hero-search button,
    .inline-search button,
    .mobile-search button {
        width: 100%;
    }
}
