:root {
    --bg: #f7f8fb;
    --surface: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --soft: #f3f4f6;
    --red: #dc2626;
    --pink: #db2777;
    --shadow: 0 20px 55px rgba(15, 23, 42, 0.12);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #f9fafb 0%, #eef2f7 100%);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.65;
}

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

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid rgba(229, 231, 235, 0.9);
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(14px);
}

.header-inner {
    max-width: 1280px;
    height: 68px;
    margin: 0 auto;
    padding: 0 22px;
    display: flex;
    align-items: center;
    gap: 22px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: max-content;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #ffffff;
    font-weight: 900;
    font-size: 20px;
    background: linear-gradient(135deg, var(--red), var(--pink));
    box-shadow: 0 12px 30px rgba(220, 38, 38, 0.28);
    transition: transform 0.25s ease;
}

.brand:hover .brand-mark {
    transform: scale(1.08) rotate(-3deg);
}

.brand-text strong {
    display: block;
    font-size: 20px;
    line-height: 1.1;
}

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

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

.desktop-nav a,
.mobile-nav a {
    color: #374151;
    font-weight: 650;
    transition: color 0.2s ease;
}

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

.header-search {
    width: 275px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 4px 4px 14px;
    background: #ffffff;
}

.header-search input {
    width: 100%;
    border: 0;
    outline: 0;
    font-size: 14px;
    background: transparent;
}

.header-search button,
.primary-button,
.ghost-button,
.section-link {
    border: 0;
    cursor: pointer;
    border-radius: 999px;
    font-weight: 800;
    white-space: nowrap;
}

.header-search button,
.primary-button {
    color: #ffffff;
    background: linear-gradient(135deg, var(--red), var(--pink));
    box-shadow: 0 14px 30px rgba(220, 38, 38, 0.25);
}

.header-search button {
    padding: 8px 14px;
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    font-size: 22px;
}

.mobile-nav {
    display: none;
    padding: 14px 22px 20px;
    border-top: 1px solid var(--line);
    background: #ffffff;
}

.mobile-nav.open {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.hero-carousel {
    position: relative;
    height: 70vh;
    min-height: 560px;
    overflow: hidden;
    background: #111827;
}

.hero-track,
.hero-slide,
.hero-bg,
.hero-bg img {
    position: absolute;
    inset: 0;
}

.hero-slide {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.7s ease;
}

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

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

.hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.84)),
        linear-gradient(90deg, rgba(0, 0, 0, 0.76), rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.64));
}

.hero-copy {
    position: relative;
    z-index: 2;
    max-width: 1280px;
    height: 100%;
    margin: 0 auto;
    padding: 0 22px 78px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    color: #ffffff;
}

.hero-copy h1 {
    max-width: 780px;
    margin: 12px 0;
    font-size: clamp(42px, 6vw, 82px);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

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

.hero-kicker,
.detail-meta,
.movie-meta,
.hero-tags,
.detail-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
}

.hero-kicker span,
.hero-tags span,
.detail-tags span {
    border-radius: 999px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    backdrop-filter: blur(8px);
}

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

.primary-button,
.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 22px;
}

.ghost-button {
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
}

.hero-control {
    position: absolute;
    top: 50%;
    z-index: 5;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
    font-size: 42px;
    line-height: 0;
    cursor: pointer;
    transform: translateY(-50%);
    backdrop-filter: blur(10px);
}

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

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

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

.hero-dots button {
    width: 34px;
    height: 5px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
}

.hero-dots button.active {
    background: #ffffff;
}

.quick-panel,
.content-section,
.detail-hero,
.player-section,
.detail-text,
.site-footer {
    max-width: 1280px;
    margin: 0 auto;
    padding-left: 22px;
    padding-right: 22px;
}

.quick-panel {
    margin-top: -46px;
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-top: 24px;
    padding-bottom: 24px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.quick-copy h2,
.section-head h2,
.page-hero h1,
.detail-info h1,
.detail-text h2 {
    margin: 0;
    letter-spacing: -0.025em;
}

.quick-copy p,
.section-head p,
.page-hero p,
.detail-text p,
.card-body p,
.rank-body p,
.site-footer p {
    color: var(--muted);
}

.quick-copy p {
    margin: 4px 0 0;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.quick-actions a,
.section-link {
    padding: 10px 16px;
    color: var(--red);
    background: #fff1f2;
}

.content-section {
    padding-top: 66px;
}

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

.section-head h2 {
    font-size: clamp(26px, 4vw, 42px);
}

.section-head p {
    margin: 6px 0 0;
}

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

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

.movie-card {
    overflow: hidden;
    border: 1px solid rgba(229, 231, 235, 0.88);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.08);
    transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 55px rgba(15, 23, 42, 0.14);
}

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

.poster-link img,
.rank-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.32s ease;
}

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

.poster-badge {
    position: absolute;
    left: 12px;
    top: 12px;
    border-radius: 999px;
    padding: 5px 10px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--red), var(--pink));
}

.card-body,
.rank-body {
    padding: 16px;
}

.card-title,
.rank-title {
    display: -webkit-box;
    overflow: hidden;
    min-height: 48px;
    color: #111827;
    font-size: 17px;
    font-weight: 850;
    line-height: 1.35;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-title:hover,
.rank-title:hover {
    color: var(--red);
}

.card-body p,
.rank-body p {
    display: -webkit-box;
    overflow: hidden;
    min-height: 45px;
    margin: 8px 0 12px;
    font-size: 14px;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.movie-meta span,
.detail-meta span {
    border-radius: 8px;
    padding: 4px 8px;
    color: #4b5563;
    background: var(--soft);
    font-size: 12px;
    font-weight: 750;
}

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

.category-card {
    position: relative;
    min-height: 170px;
    overflow: hidden;
    border-radius: 20px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    color: #ffffff;
    background: #111827;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
}

.category-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.58;
    transition: transform 0.28s ease;
}

.category-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.82));
}

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

.category-card span,
.category-card strong {
    position: relative;
    z-index: 2;
}

.category-card span {
    font-size: 22px;
    font-weight: 900;
}

.category-card strong {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 13px;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

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

.mini-rank {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
    background: #ffffff;
}

.mini-rank span {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    color: #ffffff;
    font-weight: 900;
    background: linear-gradient(135deg, var(--red), var(--pink));
}

.mini-rank strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-rank em {
    color: var(--muted);
    font-style: normal;
    font-size: 13px;
}

.page-main,
.detail-main {
    padding-bottom: 72px;
}

.page-hero {
    position: relative;
    overflow: hidden;
    margin: 28px auto 0;
    max-width: 1280px;
    min-height: 300px;
    border-radius: 28px;
    padding: 54px 36px;
    display: flex;
    align-items: flex-end;
    color: #ffffff;
    background: linear-gradient(135deg, #111827, #831843);
    box-shadow: var(--shadow);
}

.category-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--category-image);
    background-size: cover;
    background-position: center;
    opacity: 0.36;
}

.category-hero::after,
.rank-hero::after,
.compact-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.16));
}

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

.eyebrow {
    margin: 0 0 8px;
    color: #fecdd3;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.page-hero h1 {
    font-size: clamp(40px, 6vw, 70px);
    line-height: 1.05;
}

.page-hero p {
    max-width: 680px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 18px;
}

.small-actions {
    margin-top: 18px;
}

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

.ranking-list > .rank-number {
    display: none;
}

.ranking-list .rank-card {
    display: grid;
    grid-template-columns: 118px 1fr;
    min-height: 160px;
}

.ranking-list .rank-poster {
    aspect-ratio: auto;
}

.detail-hero {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 34px;
    padding-top: 42px;
    padding-bottom: 34px;
}

.detail-poster {
    overflow: hidden;
    border-radius: 26px;
    background: #111827;
    box-shadow: var(--shadow);
}

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

.detail-info {
    align-self: center;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
}

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

.detail-info h1 {
    margin-top: 12px;
    font-size: clamp(38px, 5vw, 66px);
    line-height: 1.08;
}

.lead {
    max-width: 830px;
    margin: 16px 0;
    color: #374151;
    font-size: 19px;
}

.detail-tags {
    margin: 18px 0 24px;
}

.detail-tags span {
    color: var(--red);
    background: #fff1f2;
}

.player-section {
    padding-top: 34px;
}

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

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

.play-cover {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 14px;
    border: 0;
    color: #ffffff;
    cursor: pointer;
    background: radial-gradient(circle, rgba(219, 39, 119, 0.45), rgba(0, 0, 0, 0.58));
}

.play-cover.hidden {
    display: none;
}

.play-icon {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    padding-left: 5px;
    color: #ffffff;
    font-size: 34px;
    background: linear-gradient(135deg, var(--red), var(--pink));
    box-shadow: 0 18px 40px rgba(220, 38, 38, 0.38);
}

.play-cover strong {
    font-size: 18px;
}

.detail-text {
    padding-top: 40px;
}

.detail-text h2 {
    margin-top: 26px;
    font-size: 28px;
}

.detail-text p {
    margin: 10px 0 0;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #ffffff;
}

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

.site-footer {
    margin-top: 70px;
    padding-top: 30px;
    padding-bottom: 36px;
    border-top: 1px solid var(--line);
}

.footer-inner {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 24px;
}

.footer-links {
    display: flex;
    gap: 16px;
}

.footer-links a:hover {
    color: var(--red);
}

.copyright {
    margin: 0;
}

body.has-query .movie-card.is-hidden,
body.has-query .rank-card.is-hidden,
body.has-query .rank-number.is-hidden {
    display: none;
}

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

    .menu-toggle {
        display: block;
    }

    .header-search {
        margin-left: auto;
    }

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

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

@media (max-width: 820px) {
    .header-inner {
        height: auto;
        min-height: 64px;
        flex-wrap: wrap;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .brand-text small {
        display: none;
    }

    .header-search {
        order: 3;
        width: 100%;
    }

    .hero-carousel {
        height: 76vh;
        min-height: 560px;
    }

    .hero-copy {
        padding-bottom: 84px;
    }

    .hero-control {
        display: none;
    }

    .quick-panel,
    .section-head,
    .footer-inner {
        display: block;
    }

    .quick-actions {
        margin-top: 16px;
    }

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

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

    .mini-rank {
        grid-template-columns: 48px 1fr;
    }

    .mini-rank em {
        grid-column: 2;
    }

    .page-hero {
        margin-left: 16px;
        margin-right: 16px;
        padding: 38px 24px;
    }

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

    .detail-poster {
        max-width: 360px;
        margin: 0 auto;
    }

    .ranking-list .rank-card {
        grid-template-columns: 92px 1fr;
    }
}

@media (max-width: 520px) {
    .brand-text strong {
        font-size: 17px;
    }

    .hero-copy h1,
    .page-hero h1,
    .detail-info h1 {
        font-size: 38px;
    }

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

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

    .card-title {
        min-height: auto;
    }

    .content-section,
    .quick-panel,
    .detail-hero,
    .player-section,
    .detail-text,
    .site-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .quick-panel {
        border-radius: 18px;
    }
}
