:root {
    --bg: #f9fafb;
    --panel: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --red: #dc2626;
    --red-dark: #b91c1c;
    --pink: #db2777;
    --blue: #2563eb;
    --purple: #7c3aed;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

img {
    display: block;
    width: 100%;
}

button,
input {
    font: inherit;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(14px);
}

.nav-wrap {
    max-width: 1280px;
    height: 68px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--red);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.brand-icon {
    filter: drop-shadow(0 8px 12px rgba(220, 38, 38, 0.25));
}

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

.nav-link,
.mobile-link {
    color: #374151;
    font-weight: 700;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active,
.mobile-link:hover,
.mobile-link.active {
    color: var(--red);
}

.menu-button {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: #fee2e2;
    cursor: pointer;
}

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

.mobile-nav {
    display: none;
    padding: 0 20px 16px;
    border-top: 1px solid var(--line);
}

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

.page-shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 20px 56px;
}

.hero-carousel {
    position: relative;
    min-height: 500px;
    overflow: hidden;
    border-radius: var(--radius);
    background: #111827;
    box-shadow: var(--shadow);
    margin-bottom: 34px;
}

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

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

.hero-slide img {
    height: 100%;
    object-fit: cover;
}

.hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.1));
}

.hero-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 48px;
    max-width: 860px;
    color: #ffffff;
}

.hero-tag,
.page-hero span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 12px;
    border-radius: 8px;
    background: var(--red);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
}

.hero-content h1 {
    margin: 16px 0 12px;
    font-size: clamp(32px, 5vw, 58px);
    line-height: 1.05;
}

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

.hero-meta,
.detail-topline,
.card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-meta span,
.detail-topline span,
.card-meta span {
    color: inherit;
    opacity: 0.86;
}

.hero-meta strong,
.detail-topline strong,
.card-meta strong {
    color: #facc15;
}

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

.primary-button,
.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border-radius: 12px;
    font-weight: 800;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.primary-button {
    background: var(--red);
    color: #ffffff;
}

.primary-button:hover {
    background: var(--red-dark);
    transform: translateY(-2px);
}

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

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

.hero-dots {
    position: absolute;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
}

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

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

.search-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 470px);
    align-items: center;
    gap: 20px;
    padding: 26px;
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
    margin-bottom: 34px;
}

.search-panel h2 {
    margin: 0 0 8px;
    font-size: 26px;
}

.search-panel p {
    margin: 0;
    color: var(--muted);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f9fafb;
}

.search-box input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 22px;
}

.section-head h2 {
    margin: 0 0 6px;
    font-size: 28px;
}

.section-head p {
    margin: 0;
    color: var(--muted);
}

.section-head a {
    color: var(--red);
    font-weight: 800;
}

section {
    margin-bottom: 42px;
}

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

.category-tile,
.category-card {
    display: block;
    padding: 22px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #ffffff, #fff1f2);
    box-shadow: 0 8px 26px rgba(15, 23, 42, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-tile:hover,
.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.category-tile span,
.category-card-title {
    display: block;
    margin-bottom: 8px;
    color: var(--red);
    font-size: 20px;
    font-weight: 900;
}

.category-tile p,
.category-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

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

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

.movie-card {
    overflow: hidden;
    border-radius: 16px;
    background: var(--panel);
    box-shadow: 0 8px 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);
}

.poster-link {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: linear-gradient(135deg, #111827, #450a0a);
}

.large-card .poster-link {
    aspect-ratio: 16 / 10;
}

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

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

.card-category,
.card-duration,
.rank-badge {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 8px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
}

.card-category {
    top: 10px;
    left: 10px;
    background: var(--red);
}

.card-duration {
    right: 10px;
    bottom: 10px;
    background: rgba(0, 0, 0, 0.72);
}

.rank-badge {
    top: 10px;
    right: 10px;
    min-width: 32px;
    background: #f59e0b;
}

.card-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 46px;
    background: rgba(0, 0, 0, 0.38);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.movie-card:hover .card-play {
    opacity: 1;
}

.card-body {
    padding: 14px;
}

.card-body h3 {
    margin: 0 0 9px;
    font-size: 16px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-body p {
    min-height: 42px;
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    justify-content: space-between;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}

.gradient-section {
    padding: 30px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--blue), var(--purple));
    color: #ffffff;
}

.gradient-section .section-head p,
.gradient-section .section-head a,
.gradient-section .card-body p,
.gradient-section .card-meta {
    color: rgba(255, 255, 255, 0.82);
}

.gradient-section .movie-card {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    box-shadow: none;
}

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

.rank-list,
.mini-card-list,
.side-card,
.detail-info,
.review-card,
.player-card {
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
}

.rank-list {
    overflow: hidden;
}

.rank-row {
    display: grid;
    grid-template-columns: 54px 1fr 54px;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
}

.rank-row:last-child {
    border-bottom: 0;
}

.rank-row span {
    color: var(--red);
    font-size: 20px;
    font-weight: 900;
}

.rank-row em {
    justify-self: end;
    color: #f59e0b;
    font-style: normal;
    font-weight: 900;
}

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

.mini-card,
.related-row {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.mini-card img,
.related-row img {
    width: 58px;
    height: 78px;
    border-radius: 10px;
    object-fit: cover;
    background: #111827;
}

.mini-card span,
.related-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
}

.mini-card em,
.related-row em {
    color: var(--muted);
    font-style: normal;
    font-size: 13px;
}

.page-hero {
    position: relative;
    overflow: hidden;
    min-height: 260px;
    padding: 42px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--red), var(--pink));
    color: #ffffff;
    box-shadow: var(--shadow);
}

.page-hero img {
    position: absolute;
    inset: 0;
    height: 100%;
    object-fit: cover;
    opacity: 0.32;
}

.page-hero > div {
    position: relative;
    z-index: 2;
    max-width: 760px;
}

.page-hero h1 {
    margin: 16px 0 12px;
    font-size: clamp(30px, 5vw, 48px);
}

.page-hero p {
    margin: 0 0 22px;
    color: rgba(255, 255, 255, 0.86);
    line-height: 1.8;
}

.small-hero {
    background: linear-gradient(135deg, #dc2626, #be185d);
}

.ranking-hero {
    background: linear-gradient(135deg, #f59e0b, #dc2626);
}

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

.category-samples {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.category-samples a {
    padding: 6px 10px;
    border-radius: 999px;
    background: #fee2e2;
    color: var(--red);
    font-size: 13px;
    font-weight: 800;
}

.empty-state {
    display: none;
    padding: 32px;
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--muted);
    text-align: center;
}

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

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    color: var(--muted);
    margin-bottom: 18px;
}

.breadcrumb a {
    color: var(--red);
    font-weight: 800;
}

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

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

.player-card {
    overflow: hidden;
    background: #000000;
    margin-bottom: 22px;
}

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

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

.play-layer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: rgba(0, 0, 0, 0.34);
    color: #ffffff;
    cursor: pointer;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.play-layer span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 82px;
    height: 82px;
    border-radius: 50%;
    background: var(--red);
    font-size: 34px;
    box-shadow: 0 18px 45px rgba(220, 38, 38, 0.38);
}

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

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

.detail-topline {
    color: var(--muted);
    margin-bottom: 12px;
}

.detail-topline span:first-child {
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--red);
    color: #ffffff;
    opacity: 1;
    font-weight: 800;
}

.detail-info h1 {
    margin: 0 0 14px;
    font-size: clamp(28px, 4vw, 42px);
}

.lead-text {
    margin: 0 0 18px;
    color: #374151;
    font-size: 18px;
    line-height: 1.8;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tag-list span {
    padding: 7px 12px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #374151;
    font-size: 13px;
    font-weight: 700;
}

.meta-table {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 24px;
}

.meta-table div {
    padding: 12px;
    border-radius: 12px;
    background: #f9fafb;
}

.meta-table dt {
    color: var(--muted);
    font-size: 12px;
}

.meta-table dd {
    margin: 4px 0 0;
    font-weight: 800;
}

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

.detail-info p,
.review-card p {
    color: #374151;
    line-height: 1.9;
}

.detail-side {
    position: sticky;
    top: 92px;
    display: grid;
    gap: 20px;
}

.poster-card img {
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 14px;
    background: #111827;
    margin-bottom: 16px;
}

.full-button {
    width: 100%;
}

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

.more-section {
    margin-top: 34px;
}

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

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

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 34px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.footer p {
    margin: 10px 0 0;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.7;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: rgba(255, 255, 255, 0.82);
}

@media (max-width: 1100px) {
    .movie-grid,
    .compact-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

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

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

    .detail-side {
        position: static;
    }
}

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

    .menu-button {
        display: block;
    }

    .page-shell {
        padding: 20px 14px 42px;
    }

    .hero-carousel {
        min-height: 470px;
        border-radius: 16px;
    }

    .hero-content {
        padding: 28px 20px 54px;
    }

    .hero-content p {
        font-size: 15px;
    }

    .search-panel,
    .section-head,
    .footer-inner {
        grid-template-columns: 1fr;
        display: grid;
        align-items: stretch;
    }

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

    .category-grid,
    .big-category-grid,
    .mini-card-list {
        grid-template-columns: 1fr;
    }

    .page-hero {
        padding: 30px 22px;
    }

    .meta-table {
        grid-template-columns: 1fr;
    }

    .card-body h3 {
        font-size: 15px;
    }

    .card-body p {
        min-height: 38px;
    }
}
