:root {
    --bg: #f8fafc;
    --panel: #ffffff;
    --ink: #0f172a;
    --muted: #64748b;
    --soft: #e2e8f0;
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --brand-soft: #dbeafe;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

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

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

button,
input,
select {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.86);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.header-inner {
    width: min(1180px, calc(100% - 32px));
    height: 68px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

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

.brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #0f172a);
    box-shadow: 0 12px 25px rgba(37, 99, 235, 0.32);
}

.brand-text {
    font-size: 1.18rem;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    font-weight: 650;
    color: #334155;
    white-space: nowrap;
}

.main-nav a {
    transition: color 0.2s ease;
}

.main-nav a:hover {
    color: var(--brand);
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: #eef2ff;
    cursor: pointer;
}

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

.mobile-nav {
    display: none;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 14px;
    padding: 12px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid var(--soft);
    box-shadow: var(--shadow);
}

.mobile-nav a {
    display: block;
    padding: 11px 12px;
    border-radius: 12px;
    font-weight: 650;
}

.mobile-nav a:hover {
    background: var(--brand-soft);
    color: var(--brand-dark);
}

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

.hero-carousel {
    position: relative;
    height: 560px;
    overflow: hidden;
    background: linear-gradient(135deg, #172554, #020617 70%);
}

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

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

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

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.94) 0%, rgba(2, 6, 23, 0.68) 46%, rgba(2, 6, 23, 0.16) 100%),
        linear-gradient(0deg, rgba(2, 6, 23, 0.94) 0%, rgba(2, 6, 23, 0.08) 70%);
}

.hero-content {
    position: relative;
    width: min(1180px, calc(100% - 32px));
    height: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    color: #ffffff;
    max-width: 1180px;
}

.hero-kicker,
.eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 7px 12px;
    border-radius: 999px;
    color: #1d4ed8;
    background: #dbeafe;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.hero-kicker {
    color: #bfdbfe;
    background: rgba(37, 99, 235, 0.22);
    border: 1px solid rgba(191, 219, 254, 0.28);
}

.hero-content h1 {
    max-width: 700px;
    margin: 20px 0 14px;
    font-size: clamp(2.4rem, 6vw, 5.2rem);
    line-height: 1;
    letter-spacing: -0.06em;
}

.hero-content p {
    max-width: 680px;
    margin: 0;
    color: #cbd5e1;
    font-size: 1.05rem;
}

.hero-tags,
.detail-meta,
.movie-meta,
.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

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

.hero-tags span,
.detail-meta span,
.tag-row span {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #f8fafc;
    font-size: 0.84rem;
    font-weight: 700;
}

.detail-meta span,
.tag-row span {
    color: #334155;
    background: #eff6ff;
}

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

.primary-button,
.ghost-button,
.reset-button,
.mini-search button,
.player-start {
    border: 0;
    border-radius: 999px;
    padding: 12px 20px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-button,
.mini-search button,
.player-start {
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.32);
}

.primary-button:hover,
.mini-search button:hover,
.player-start:hover,
.reset-button:hover {
    transform: translateY(-2px);
}

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

.hero-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    color: #ffffff;
    background: rgba(15, 23, 42, 0.6);
    font-size: 2rem;
    cursor: pointer;
}

.hero-prev {
    left: 22px;
}

.hero-next {
    right: 22px;
}

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

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

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

main {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.intro-strip {
    margin: -34px auto 34px;
    position: relative;
    z-index: 5;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px;
    align-items: center;
    padding: 20px;
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: var(--shadow);
}

.intro-strip strong {
    display: block;
    font-size: 1.08rem;
}

.intro-strip span {
    color: var(--muted);
}

.mini-search {
    display: flex;
    gap: 10px;
}

.mini-search input {
    min-width: min(48vw, 340px);
    border: 1px solid var(--soft);
    border-radius: 999px;
    padding: 12px 16px;
    outline: none;
}

.content-section {
    padding: 36px 0;
}

.alt-section {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    padding-left: max(16px, calc((100vw - 1180px) / 2));
    padding-right: max(16px, calc((100vw - 1180px) / 2));
    background: #eef2ff;
}

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

.section-heading h2 {
    margin: 8px 0 0;
    font-size: clamp(1.65rem, 3vw, 2.4rem);
    letter-spacing: -0.04em;
}

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

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

.category-card,
.category-summary {
    position: relative;
    min-height: 170px;
    overflow: hidden;
    border-radius: var(--radius);
    background: #0f172a;
    box-shadow: var(--shadow);
}

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

.category-card span {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.86), rgba(2, 6, 23, 0.16));
}

.category-card strong,
.category-card em {
    position: absolute;
    left: 18px;
    color: #ffffff;
}

.category-card strong {
    bottom: 48px;
    font-size: 1.4rem;
}

.category-card em {
    bottom: 20px;
    color: #cbd5e1;
    font-style: normal;
}

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

.category-summary {
    min-height: 0;
    padding: 22px;
    color: #ffffff;
    background: linear-gradient(135deg, #1e3a8a, #0f172a);
}

.category-summary strong {
    display: block;
    font-size: 1.32rem;
}

.category-summary span {
    display: inline-flex;
    margin: 12px 0;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.13);
    color: #bfdbfe;
    font-weight: 800;
}

.category-summary p {
    margin: 0;
    color: #cbd5e1;
}

.filter-panel {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) repeat(3, minmax(130px, 180px)) auto auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 22px;
    padding: 16px;
    border: 1px solid var(--soft);
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.filter-panel label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.filter-panel input,
.filter-panel select {
    width: 100%;
    border: 1px solid var(--soft);
    border-radius: 14px;
    padding: 11px 12px;
    color: var(--ink);
    background: #f8fafc;
    outline: none;
}

.filter-panel input:focus,
.filter-panel select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.reset-button {
    color: var(--brand-dark);
    background: var(--brand-soft);
}

.filter-count {
    color: var(--muted);
    font-weight: 800;
    white-space: nowrap;
}

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

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

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

.movie-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 22px 45px rgba(15, 23, 42, 0.16);
}

.poster-link {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(135deg, #dbeafe, #e2e8f0);
}

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

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

.poster-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.55), transparent 70%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.movie-card:hover .poster-shade {
    opacity: 1;
}

.duration-badge,
.rank-badge {
    position: absolute;
    z-index: 2;
    padding: 5px 8px;
    border-radius: 10px;
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 850;
    background: rgba(15, 23, 42, 0.82);
}

.duration-badge {
    right: 10px;
    bottom: 10px;
}

.rank-badge {
    top: 10px;
    left: 10px;
    min-width: 30px;
    text-align: center;
    background: linear-gradient(135deg, #f97316, #dc2626);
}

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

.movie-card h3 {
    margin: 0 0 8px;
    font-size: 1.03rem;
    line-height: 1.35;
}

.movie-card h3 a:hover {
    color: var(--brand);
}

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

.movie-meta {
    justify-content: space-between;
    margin-bottom: 10px;
    color: #475569;
    font-size: 0.83rem;
    font-weight: 750;
}

.tag-row span {
    padding: 4px 8px;
    color: #1d4ed8;
    background: #dbeafe;
    font-size: 0.76rem;
}

.movie-card.compact {
    display: grid;
    grid-template-columns: 42% 1fr;
}

.movie-card.compact .poster-link {
    height: 100%;
    aspect-ratio: auto;
}

.movie-card.compact p,
.movie-card.compact .tag-row {
    display: none;
}

.sub-hero,
.detail-hero {
    margin-top: 28px;
    padding: clamp(32px, 6vw, 72px);
    border-radius: 30px;
    color: #ffffff;
    background:
        radial-gradient(circle at 90% 10%, rgba(59, 130, 246, 0.42), transparent 34%),
        linear-gradient(135deg, #1e3a8a, #020617);
    box-shadow: var(--shadow);
}

.sub-hero h1,
.detail-info h1 {
    margin: 14px 0 12px;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.05;
    letter-spacing: -0.055em;
}

.sub-hero p,
.detail-info .lead {
    max-width: 760px;
    margin: 0;
    color: #cbd5e1;
    font-size: 1.04rem;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    align-items: center;
    margin: 22px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

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

.detail-hero {
    display: grid;
    grid-template-columns: minmax(220px, 360px) 1fr;
    gap: clamp(24px, 5vw, 58px);
    align-items: center;
    overflow: hidden;
}

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

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

.detail-meta {
    margin: 18px 0 14px;
}

.detail-tags {
    margin-bottom: 26px;
}

.watch-section {
    padding: 34px 0 0;
}

.player-frame {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    background: #020617;
    box-shadow: var(--shadow);
}

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

.player-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    color: #ffffff;
    background: radial-gradient(circle, rgba(15, 23, 42, 0.42), rgba(2, 6, 23, 0.86));
    text-align: center;
    transition: opacity 0.25s ease;
}

.player-overlay p {
    margin: 0;
    color: #cbd5e1;
}

.player-frame.is-playing .player-overlay {
    opacity: 0;
    pointer-events: none;
}

.player-status {
    position: absolute;
    left: 16px;
    bottom: 12px;
    margin: 0;
    padding: 5px 10px;
    border-radius: 999px;
    color: #dbeafe;
    background: rgba(15, 23, 42, 0.72);
    font-size: 0.8rem;
}

.detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.text-card {
    padding: 24px;
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.text-card h2 {
    margin: 0 0 12px;
    font-size: 1.32rem;
}

.text-card p {
    margin: 0;
    color: #334155;
}

.site-footer {
    margin-top: 48px;
    padding: 46px 0 26px;
    color: #cbd5e1;
    background: #0f172a;
}

.footer-grid {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 28px;
}

.site-footer h2 {
    margin: 0 0 12px;
    color: #ffffff;
    font-size: 1rem;
}

.site-footer p {
    margin: 0;
}

.site-footer a {
    display: block;
    margin: 8px 0;
}

.site-footer a:hover {
    color: #ffffff;
}

.footer-bottom {
    width: min(1180px, calc(100% - 32px));
    margin: 30px auto 0;
    padding-top: 22px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    color: #94a3b8;
    text-align: center;
}

.is-hidden {
    display: none !important;
}

@media (max-width: 1040px) {
    .main-nav {
        gap: 14px;
        font-size: 0.92rem;
    }

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

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

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

    .nav-toggle {
        display: block;
    }

    .hero-carousel {
        height: 620px;
    }

    .hero-overlay {
        background: linear-gradient(0deg, rgba(2, 6, 23, 0.94) 0%, rgba(2, 6, 23, 0.52) 100%);
    }

    .hero-content {
        justify-content: flex-end;
        padding-bottom: 84px;
    }

    .hero-control {
        display: none;
    }

    .intro-strip,
    .detail-hero,
    .detail-content,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .intro-strip {
        margin-top: -24px;
    }

    .mini-search {
        width: 100%;
    }

    .mini-search input {
        min-width: 0;
        flex: 1;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .filter-panel {
        grid-template-columns: 1fr;
    }

    .movie-card.compact {
        display: block;
    }

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

@media (max-width: 520px) {
    .header-inner,
    main,
    .hero-content,
    .footer-grid,
    .footer-bottom,
    .mobile-nav {
        width: min(100% - 22px, 1180px);
    }

    .brand-text {
        font-size: 1.02rem;
    }

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

    .hero-content h1 {
        font-size: 2.75rem;
    }

    .sub-hero,
    .detail-hero {
        border-radius: 22px;
        padding: 28px 18px;
    }

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