:root {
    --bg: #f8fafc;
    --panel: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --line: rgba(148, 163, 184, 0.28);
    --brand: #2563eb;
    --brand-deep: #1d4ed8;
    --accent: #db2777;
    --warm: #f59e0b;
    --shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
    --soft-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
    --radius: 24px;
    --small-radius: 16px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 32rem), var(--bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    line-height: 1.6;
}

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

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

button,
input,
select {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(226, 232, 240, 0.82);
    background: rgba(255, 255, 255, 0.84);
    backdrop-filter: blur(18px);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

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

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

.logo-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 14px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
}

.logo-text {
    font-size: 1.05rem;
    white-space: nowrap;
}

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

.desktop-nav a,
.mobile-nav a {
    padding: 10px 14px;
    border-radius: 999px;
    color: #334155;
    font-weight: 650;
}

.desktop-nav a:hover,
.mobile-nav a:hover {
    color: var(--brand);
    background: rgba(37, 99, 235, 0.08);
}

.header-search {
    margin-left: auto;
    display: flex;
    align-items: center;
    width: min(420px, 34vw);
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    overflow: hidden;
}

.header-search input,
.mobile-nav input,
.wide-search input,
.filter-panel input,
.filter-panel select {
    width: 100%;
    border: 0;
    outline: none;
    color: var(--text);
    background: transparent;
}

.header-search input {
    padding: 11px 14px 11px 18px;
}

.header-search button,
.mobile-nav button,
.wide-search button {
    border: 0;
    color: #ffffff;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    font-weight: 750;
    cursor: pointer;
}

.header-search button {
    align-self: stretch;
    padding: 0 18px;
}

.menu-toggle {
    display: none;
    border: 0;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(37, 99, 235, 0.08);
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 4px auto;
    background: #1f2937;
    border-radius: 2px;
}

.mobile-nav {
    display: none;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 22px 18px;
}

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

.mobile-nav form {
    display: flex;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #ffffff;
}

.mobile-nav input {
    padding: 12px 14px;
}

.mobile-nav button {
    padding: 0 18px;
}

.hero-carousel {
    position: relative;
    min-height: 74vh;
    overflow: hidden;
    color: #ffffff;
    background: linear-gradient(135deg, #172554, #581c87 48%, #831843);
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: grid;
    opacity: 0;
    pointer-events: none;
    transition: opacity 700ms ease;
}

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

.hero-bg,
.detail-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.1) contrast(1.02);
}

.hero-shade,
.detail-shade {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 22% 20%, rgba(59, 130, 246, 0.58), transparent 28rem),
        linear-gradient(90deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.52), rgba(15, 23, 42, 0.18)),
        rgba(15, 23, 42, 0.34);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 92px 22px 84px;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.44fr);
    align-items: center;
    gap: 42px;
}

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

.hero-kicker,
.section-heading span,
.page-hero span {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.hero-copy h1 {
    margin: 18px 0 14px;
    font-size: clamp(2.7rem, 6vw, 5.8rem);
    line-height: 0.95;
    letter-spacing: -0.055em;
}

.hero-copy p {
    max-width: 680px;
    margin: 0 0 24px;
    color: rgba(255, 255, 255, 0.9);
    font-size: clamp(1.05rem, 2.2vw, 1.35rem);
}

.hero-tags,
.detail-tags,
.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-tags span,
.detail-tags span,
.card-tags span {
    padding: 6px 10px;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    font-size: 0.82rem;
    font-weight: 700;
}

.card-tags span {
    color: var(--brand-deep);
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.1);
}

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

.primary-button,
.ghost-button,
.plain-button,
.hero-side-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 20px;
    border-radius: 999px;
    font-weight: 800;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.primary-button {
    color: #ffffff;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    box-shadow: 0 18px 30px rgba(37, 99, 235, 0.25);
}

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

.plain-button {
    color: #ffffff;
    background: rgba(15, 23, 42, 0.34);
}

.primary-button:hover,
.ghost-button:hover,
.plain-button:hover,
.hero-side-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.22);
}

.hero-poster {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.42);
    transform: rotate(2deg);
}

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

.hero-controls {
    position: absolute;
    z-index: 5;
    left: 50%;
    bottom: 30px;
    display: flex;
    gap: 9px;
    transform: translateX(-50%);
}

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

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

.section-block {
    max-width: 1280px;
    margin: 0 auto;
    padding: 52px 22px;
}

.quick-search-block {
    margin-top: -44px;
    position: relative;
    z-index: 6;
    padding-top: 0;
}

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

.section-heading.compact {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
}

.section-heading h2,
.page-hero h1,
.detail-info h1 {
    margin: 8px 0 0;
    font-size: clamp(1.8rem, 3vw, 3rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
}

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

.wide-search {
    display: flex;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.wide-search input {
    padding: 18px 22px;
    font-size: 1.02rem;
}

.wide-search button {
    padding: 0 28px;
    white-space: nowrap;
}

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

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

.category-card {
    position: relative;
    min-height: 210px;
    overflow: hidden;
    border-radius: var(--radius);
    background: #111827;
    color: #ffffff;
    box-shadow: var(--soft-shadow);
}

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

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

.category-card span {
    display: block;
    padding: 92px 18px 8px;
    font-size: 1.22rem;
    font-weight: 850;
}

.category-card p {
    margin: 0;
    padding: 0 18px 20px;
    color: rgba(255, 255, 255, 0.84);
    font-size: 0.92rem;
}

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

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

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

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

.movie-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.92);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.movie-card:hover {
    transform: translateY(-4px);
    border-color: rgba(37, 99, 235, 0.28);
    box-shadow: var(--soft-shadow);
}

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

.poster-link img {
    aspect-ratio: 3 / 4.08;
    object-fit: cover;
    transition: transform 300ms ease;
}

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

.poster-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 5px 9px;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(10px);
    font-size: 0.78rem;
    font-weight: 800;
}

.card-body {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-title {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.32;
}

.card-title a:hover,
.ranking-card h2 a:hover {
    color: var(--brand-deep);
}

.card-desc {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta,
.detail-meta,
.ranking-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    color: #64748b;
    font-size: 0.86rem;
}

.rank-panel {
    position: sticky;
    top: 86px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--soft-shadow);
    padding: 20px;
}

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

.rank-row {
    display: grid;
    grid-template-columns: 38px 58px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.88);
}

.rank-row:hover {
    background: rgba(37, 99, 235, 0.08);
}

.rank-num {
    color: var(--brand-deep);
    font-weight: 900;
}

.rank-row img {
    width: 58px;
    height: 76px;
    border-radius: 12px;
    object-fit: cover;
}

.rank-info {
    min-width: 0;
}

.rank-info strong,
.rank-info em {
    display: block;
}

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

.rank-info em {
    color: var(--muted);
    font-size: 0.82rem;
    font-style: normal;
}

.rank-heat {
    color: var(--accent);
    font-weight: 900;
}

.page-hero,
.detail-hero {
    position: relative;
    overflow: hidden;
    color: #ffffff;
    background: linear-gradient(135deg, #172554, #581c87 50%, #831843);
}

.page-hero {
    max-width: 1280px;
    margin: 28px auto 0;
    padding: 56px 42px;
    border-radius: 34px;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: end;
    box-shadow: var(--shadow);
}

.page-hero p {
    max-width: 760px;
    margin: 12px 0 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: 1.05rem;
}

.hero-side-link {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.filter-panel {
    max-width: 1280px;
    margin: 24px auto 0;
    padding: 0 22px;
}

.filter-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.7fr 0.7fr;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--soft-shadow);
}

.filter-grid label {
    display: grid;
    gap: 8px;
    color: #475569;
    font-weight: 750;
}

.filter-grid input,
.filter-grid select {
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8fafc;
}

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

.ranking-card {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 18px;
    padding: 16px;
    border: 1px solid rgba(226, 232, 240, 0.92);
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.05);
}

.ranking-poster {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
}

.ranking-poster img {
    height: 148px;
    object-fit: cover;
}

.ranking-poster span {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    padding: 4px 8px;
    border-radius: 999px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    font-weight: 900;
}

.ranking-card h2 {
    margin: 8px 0;
    font-size: 1.18rem;
}

.ranking-card p {
    color: var(--muted);
    margin: 0 0 12px;
}

.detail-hero {
    min-height: 540px;
}

.detail-wrap {
    position: relative;
    z-index: 2;
    max-width: 1280px;
    margin: 0 auto;
    padding: 70px 22px;
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    gap: 40px;
    align-items: end;
}

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

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

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.92rem;
}

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

.detail-info h1 {
    font-size: clamp(2.4rem, 5vw, 5rem);
}

.detail-one-line {
    max-width: 800px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 1.12rem;
}

.detail-meta {
    margin: 18px 0 26px;
    color: rgba(255, 255, 255, 0.82);
}

.player-section,
.detail-section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 42px 22px 0;
}

.video-shell {
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    background: #020617;
    box-shadow: var(--shadow);
}

.video-shell video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #020617;
    cursor: pointer;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    justify-content: center;
    border: 0;
    color: #ffffff;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.08), rgba(15, 23, 42, 0.54));
    cursor: pointer;
}

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

.play-icon {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    position: relative;
}

.play-icon::after {
    content: "";
    position: absolute;
    left: 31px;
    top: 22px;
    border-top: 16px solid transparent;
    border-bottom: 16px solid transparent;
    border-left: 22px solid var(--brand-deep);
}

.player-overlay strong {
    font-size: 1.08rem;
}

.player-message {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 16px;
    margin: 0;
    color: #ffffff;
    text-align: center;
    font-weight: 700;
    pointer-events: none;
}

.detail-section h2 {
    margin: 0 0 14px;
    font-size: 1.6rem;
}

.detail-section p {
    margin: 0;
    color: #334155;
    font-size: 1.02rem;
}

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

.search-page {
    max-width: 980px;
}

.search-results {
    display: grid;
    gap: 14px;
    margin-top: 26px;
}

.search-result-card {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 16px;
    padding: 14px;
    border: 1px solid rgba(226, 232, 240, 0.92);
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.04);
}

.search-result-card img {
    height: 118px;
    object-fit: cover;
    border-radius: 16px;
}

.search-result-card h2 {
    margin: 0 0 8px;
    font-size: 1.18rem;
}

.search-result-card p {
    margin: 0 0 10px;
    color: var(--muted);
}

.site-footer {
    margin-top: 46px;
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    background: #ffffff;
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 30px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    color: #64748b;
}

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

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

@media (max-width: 1120px) {
    .desktop-nav,
    .header-search {
        display: none;
    }

    .menu-toggle {
        display: block;
        margin-left: auto;
    }

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

    .hero-poster,
    .detail-poster {
        max-width: 320px;
    }

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

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

    .rank-panel {
        position: static;
    }
}

@media (max-width: 780px) {
    .header-inner {
        padding-inline: 16px;
    }

    .hero-carousel {
        min-height: 760px;
    }

    .hero-content {
        padding: 62px 18px 84px;
    }

    .hero-copy h1,
    .detail-info h1 {
        font-size: 2.45rem;
    }

    .hero-actions,
    .footer-inner,
    .section-heading,
    .page-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .section-block,
    .player-section,
    .detail-section {
        padding-inline: 16px;
    }

    .category-grid,
    .category-grid.large,
    .movie-grid,
    .related-grid,
    .ranking-grid,
    .filter-grid {
        grid-template-columns: 1fr;
    }

    .page-hero {
        margin-inline: 16px;
        padding: 36px 22px;
        border-radius: 28px;
    }

    .ranking-card,
    .search-result-card {
        grid-template-columns: 92px minmax(0, 1fr);
    }

    .detail-wrap {
        padding-top: 42px;
    }

    .detail-poster {
        max-width: 240px;
    }

    .wide-search {
        flex-direction: column;
        border-radius: 22px;
    }

    .wide-search button {
        min-height: 48px;
    }
}
