:root {
    color-scheme: light;
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-soft: #f1f5f9;
    --text: #111827;
    --muted: #64748b;
    --line: #e5e7eb;
    --primary: #dc2626;
    --primary-dark: #b91c1c;
    --accent: #f97316;
    --shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: var(--bg);
    font-family: Inter, 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 {
    display: block;
    width: 100%;
    height: auto;
}

button,
input,
select {
    font: inherit;
}

.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.92);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

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

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

.logo-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(220, 38, 38, 0.28);
}

.logo-text {
    font-size: 1.35rem;
}

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

.nav-link {
    padding: 10px 15px;
    color: #475569;
    border-radius: 999px;
    font-weight: 700;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

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

.nav-link:hover {
    transform: translateY(-1px);
}

.menu-button {
    display: none;
    width: 44px;
    height: 44px;
    border: 0;
    background: #fff1f2;
    border-radius: 14px;
    cursor: pointer;
}

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

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

.hero {
    position: relative;
    min-height: 680px;
    overflow: hidden;
    color: #ffffff;
    background: #0f172a;
}

.hero-shell {
    position: relative;
    min-height: 680px;
}

.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-backdrop {
    position: absolute;
    inset: 0;
}

.hero-backdrop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(12px) saturate(1.2);
    transform: scale(1.08);
    opacity: 0.44;
}

.hero-backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 25% 18%, rgba(248, 113, 113, 0.44), transparent 30%),
        linear-gradient(90deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.70) 52%, rgba(15, 23, 42, 0.28));
}

.hero-content {
    position: relative;
    width: min(1180px, calc(100% - 32px));
    min-height: 680px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) 360px;
    align-items: center;
    gap: 58px;
    padding: 72px 0;
}

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

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero .eyebrow,
.detail-hero .eyebrow {
    color: #fecaca;
}

.hero h1 {
    margin: 18px 0 18px;
    font-size: clamp(2.6rem, 7vw, 5.7rem);
    line-height: 0.98;
    letter-spacing: -0.07em;
}

.hero p {
    margin: 0;
    max-width: 660px;
    color: rgba(255, 255, 255, 0.84);
    font-size: 1.12rem;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-row span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    color: #991b1b;
    background: #fee2e2;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 800;
}

.hero-tags,
.detail-tags {
    margin-top: 22px;
}

.hero-tags span,
.detail-tags span {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.primary-button,
.ghost-button,
.home-search button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 20px;
    border-radius: 999px;
    font-weight: 900;
    border: 0;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-button,
.home-search button {
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 16px 34px rgba(220, 38, 38, 0.35);
}

.ghost-button {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.ghost-button.dark {
    color: var(--primary);
    background: #fff1f2;
    border-color: #fecdd3;
}

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

.hero-poster {
    position: relative;
    display: block;
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 0 40px 90px rgba(0, 0, 0, 0.4);
    transform: rotate(2deg);
}

.hero-poster img {
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

.hero-poster::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: inherit;
}

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

.hero-dot {
    width: 11px;
    height: 11px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.36);
    cursor: pointer;
}

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

.section-block {
    padding: 58px 0;
}

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

.section-heading.plain {
    margin-bottom: 18px;
}

.section-heading h2,
.search-panel h2,
.page-hero h1,
.detail-info h1,
.detail-content h2,
.detail-side h2 {
    margin: 6px 0 0;
    line-height: 1.12;
    letter-spacing: -0.04em;
}

.section-heading h2,
.search-panel h2 {
    font-size: clamp(1.7rem, 3vw, 2.5rem);
}

.section-more,
.text-link {
    color: var(--primary);
    font-weight: 900;
}

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

.category-chip,
.category-card-large,
.search-panel,
.detail-content,
.detail-side,
.player-card {
    background: var(--surface);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--radius);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
}

.category-chip {
    display: block;
    padding: 18px;
    min-height: 132px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.category-chip strong {
    display: block;
    margin-bottom: 10px;
    font-size: 1.05rem;
}

.category-chip span {
    color: var(--muted);
    font-size: 0.92rem;
}

.category-chip:hover,
.movie-card:hover,
.compact-card:hover,
.rank-row:hover,
.category-card-large:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: #fecaca;
}

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

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

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

.movie-card {
    min-width: 0;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--radius);
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.poster-link {
    position: relative;
    display: block;
    overflow: hidden;
    background: #e2e8f0;
}

.poster-link img {
    aspect-ratio: 2 / 3;
    object-fit: cover;
    transition: transform 0.35s ease;
}

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

.poster-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    color: #ffffff;
    background: rgba(15, 23, 42, 0.76);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 900;
}

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

.movie-card-meta,
.mini-meta,
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.movie-card h3,
.compact-card h3,
.rank-info h2 {
    margin: 8px 0 8px;
    line-height: 1.25;
}

.movie-card h3 {
    font-size: 1.08rem;
}

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

.movie-card p,
.compact-card p,
.rank-info p,
.category-card-large p,
.search-panel p,
.page-hero p,
.detail-content p,
.site-footer p {
    color: var(--muted);
}

.movie-card p {
    display: -webkit-box;
    min-height: 48px;
    margin: 0 0 12px;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 0.92rem;
}

.split-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) 360px;
    gap: 26px;
    align-items: start;
}

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

.compact-card {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 14px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.compact-poster {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
}

.compact-poster img {
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

.rank-number {
    position: absolute;
    left: 8px;
    top: 8px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    color: #ffffff;
    background: var(--primary);
    border-radius: 10px;
    font-size: 0.76rem;
    font-weight: 900;
}

.compact-card h3 {
    font-size: 1rem;
}

.compact-card p {
    display: -webkit-box;
    margin: 0 0 10px;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 0.9rem;
}

.search-panel {
    padding: 26px;
    position: sticky;
    top: 96px;
}

.home-search,
.filter-bar {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}

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

.home-search input:focus,
.filter-bar input:focus,
.filter-bar select:focus {
    border-color: #fca5a5;
    box-shadow: 0 0 0 4px #fee2e2;
}

.panel-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.panel-links a {
    color: var(--primary);
    font-weight: 800;
}

.sub-page {
    min-height: 70vh;
}

.page-hero {
    padding: 76px 0 58px;
    color: #ffffff;
    background:
        radial-gradient(circle at 20% 15%, rgba(248, 113, 113, 0.52), transparent 32%),
        linear-gradient(135deg, #111827, #7f1d1d 62%, #111827);
}

.category-hero {
    background:
        radial-gradient(circle at 20% 10%, rgba(251, 146, 60, 0.48), transparent 32%),
        linear-gradient(135deg, #111827, #991b1b);
}

.ranking-hero {
    background:
        radial-gradient(circle at 22% 16%, rgba(250, 204, 21, 0.42), transparent 31%),
        linear-gradient(135deg, #111827, #7f1d1d 65%, #0f172a);
}

.search-hero {
    background:
        radial-gradient(circle at 24% 16%, rgba(96, 165, 250, 0.38), transparent 31%),
        linear-gradient(135deg, #0f172a, #7f1d1d 70%);
}

.page-hero h1 {
    font-size: clamp(2.4rem, 6vw, 4.6rem);
}

.page-hero p {
    max-width: 740px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.05rem;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 800;
}

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

.breadcrumb span::before,
.breadcrumb a + a::before,
.breadcrumb a + span::before {
    content: "/";
    margin-right: 8px;
    color: currentColor;
    opacity: 0.5;
}

.breadcrumb.light {
    color: rgba(255, 255, 255, 0.75);
}

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

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

.category-card-large {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 0.72fr);
    gap: 16px;
    padding: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.category-card-main h2 {
    margin: 8px 0 10px;
    font-size: 1.8rem;
}

.category-samples {
    display: grid;
    gap: 10px;
    align-content: start;
}

.category-samples a {
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 12px;
    color: #334155;
    font-weight: 800;
}

.category-samples a:hover {
    color: var(--primary);
    background: #fff1f2;
}

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

.rank-row {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 18px;
    padding: 14px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 22px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.rank-cover {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
}

.rank-cover img {
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

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

.rank-info h2 {
    font-size: 1.35rem;
}

.empty-state {
    display: none;
    padding: 38px;
    color: var(--muted);
    text-align: center;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.empty-state.show {
    display: block;
}

.detail-hero {
    position: relative;
    overflow: hidden;
    color: #ffffff;
    background: #0f172a;
}

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

.detail-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(14px) saturate(1.15);
    transform: scale(1.08);
    opacity: 0.35;
}

.detail-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.75));
}

.detail-hero-inner {
    position: relative;
    padding: 54px 0 60px;
}

.detail-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 34px;
    align-items: center;
}

.detail-poster {
    overflow: hidden;
    border-radius: 28px;
    box-shadow: 0 34px 70px rgba(0, 0, 0, 0.42);
}

.detail-poster img {
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

.detail-info h1 {
    margin-top: 14px;
    font-size: clamp(2.3rem, 6vw, 4.8rem);
}

.detail-one-line {
    max-width: 780px;
    color: rgba(255, 255, 255, 0.84);
    font-size: 1.15rem;
}

.detail-meta {
    color: rgba(255, 255, 255, 0.74);
    margin-top: 18px;
}

.player-card {
    padding: 16px;
}

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

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

.video-start {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    color: #ffffff;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.18), rgba(15, 23, 42, 0.74));
    border: 0;
    cursor: pointer;
}

.video-box.is-playing .video-start {
    display: none;
}

.play-icon {
    width: 74px;
    height: 74px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    box-shadow: 0 20px 46px rgba(220, 38, 38, 0.36);
}

.play-icon::before {
    content: "";
    width: 0;
    height: 0;
    margin-left: 5px;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
    border-left: 22px solid #ffffff;
}

.detail-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
    padding-bottom: 18px;
}

.detail-content,
.detail-side {
    padding: 26px;
}

.detail-content h2,
.detail-side h2 {
    font-size: 1.6rem;
}

.detail-content p {
    font-size: 1.02rem;
}

dl {
    margin: 18px 0 22px;
}

dl div {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

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

dd {
    margin: 0;
    font-weight: 800;
}

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

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
}

.footer-logo {
    font-size: 1.4rem;
}

.site-footer p {
    max-width: 720px;
    color: rgba(255, 255, 255, 0.68);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-weight: 800;
}

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

@media (max-width: 1120px) {
    .featured-grid,
    .movie-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

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

    .menu-button {
        display: block;
    }

    .mobile-nav.open {
        display: grid;
        gap: 6px;
    }

    .hero,
    .hero-shell,
    .hero-content {
        min-height: 760px;
    }

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

    .hero-poster {
        width: min(320px, 80vw);
        margin: 0 auto;
    }

    .search-panel {
        position: static;
    }

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

    .detail-poster {
        width: min(260px, 74vw);
    }
}

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

    .hero,
    .hero-shell,
    .hero-content {
        min-height: 700px;
    }

    .hero-content {
        gap: 26px;
        padding: 46px 0 70px;
    }

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

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

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

    .movie-card p {
        min-height: 0;
        font-size: 0.86rem;
    }

    .rank-row {
        grid-template-columns: 82px minmax(0, 1fr);
    }

    .detail-hero-inner {
        padding-top: 34px;
    }

    .player-card,
    .detail-content,
    .detail-side {
        padding: 12px;
    }

    .category-chip {
        min-height: 118px;
        padding: 14px;
    }
}
