:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-soft: #f1f5f9;
    --text: #101828;
    --muted: #667085;
    --line: #e5e7eb;
    --primary: #10b981;
    --primary-dark: #047857;
    --accent: #f59e0b;
    --shadow: 0 18px 45px rgba(16, 24, 40, 0.10);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --max: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 15% -10%, rgba(16, 185, 129, 0.18), transparent 34rem),
        radial-gradient(circle at 90% 0%, rgba(245, 158, 11, 0.12), transparent 30rem),
        var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    line-height: 1.65;
}

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

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

button,
input,
select {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid rgba(229, 231, 235, 0.92);
    backdrop-filter: blur(18px);
}

.nav-wrap {
    max-width: var(--max);
    height: 68px;
    margin: 0 auto;
    padding: 0 22px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    letter-spacing: -0.03em;
    white-space: nowrap;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), #059669 55%, #065f46);
    box-shadow: 0 12px 26px rgba(5, 150, 105, 0.32);
}

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

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

.desktop-nav a,
.mobile-panel a {
    padding: 9px 13px;
    border-radius: 999px;
    color: #344054;
    font-weight: 700;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.desktop-nav a:hover,
.mobile-panel a:hover {
    color: var(--primary-dark);
    background: rgba(16, 185, 129, 0.10);
    transform: translateY(-1px);
}

.nav-search {
    margin-left: auto;
    display: flex;
    align-items: center;
    width: min(360px, 32vw);
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.05);
}

.nav-search input {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: 0;
    padding: 8px 12px;
    color: var(--text);
    background: transparent;
}

.nav-search button,
.hero-search button,
.primary-button,
.ghost-button {
    border: 0;
    cursor: pointer;
    border-radius: 999px;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.nav-search button,
.hero-search button,
.primary-button {
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), #059669);
    box-shadow: 0 12px 26px rgba(5, 150, 105, 0.26);
}

.nav-search button {
    padding: 8px 16px;
}

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

.menu-button {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.menu-button span {
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: #111827;
}

.mobile-panel {
    display: none;
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 22px 18px;
    gap: 8px;
    flex-wrap: wrap;
}

.mobile-panel.is-open {
    display: flex;
}

.main-shell,
.page-shell {
    max-width: var(--max);
    margin: 0 auto;
    padding: 34px 22px 58px;
}

.hero {
    max-width: var(--max);
    margin: 28px auto 0;
    padding: 0 22px;
}

.hero-frame {
    position: relative;
    overflow: hidden;
    min-height: 520px;
    border-radius: var(--radius-xl);
    background: #0f172a;
    box-shadow: var(--shadow);
}

.hero-slide {
    display: none;
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.75fr);
    min-height: 520px;
    isolation: isolate;
}

.hero-slide.is-active {
    display: grid;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.06) contrast(1.02);
    opacity: 0.52;
}

.hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.72) 44%, rgba(15, 23, 42, 0.38)),
        radial-gradient(circle at 25% 25%, rgba(16, 185, 129, 0.45), transparent 28rem);
}

.hero-copy {
    padding: 64px 54px 52px;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
}

.kicker {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    color: #d1fae5;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(167, 243, 208, 0.30);
    font-weight: 800;
    font-size: 0.9rem;
}

.hero h1,
.page-hero h1,
.detail-title h1 {
    margin: 0;
    letter-spacing: -0.055em;
    line-height: 1.05;
}

.hero h1 {
    max-width: 760px;
    font-size: clamp(2.55rem, 7vw, 5.2rem);
}

.hero-copy p {
    max-width: 650px;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.08rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 4px;
}

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

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

.hero-search {
    display: flex;
    width: min(680px, 100%);
    margin-top: 10px;
    padding: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 22px 40px rgba(0, 0, 0, 0.18);
}

.hero-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    padding: 12px 18px;
    color: #111827;
}

.hero-search button {
    padding: 0 24px;
}

.hero-poster {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 54px 48px 54px 0;
}

.hero-poster-card {
    width: min(340px, 84%);
    overflow: hidden;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(12px);
    transform: rotate(2deg);
}

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

.hero-poster-caption {
    padding: 16px 18px 18px;
    color: #ffffff;
}

.hero-poster-caption strong {
    display: block;
    font-size: 1.15rem;
    line-height: 1.3;
}

.hero-poster-caption span {
    display: block;
    margin-top: 5px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.92rem;
}

.hero-controls {
    position: absolute;
    left: 54px;
    bottom: 38px;
    z-index: 3;
    display: flex;
    gap: 8px;
}

.hero-dot {
    width: 36px;
    height: 6px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.32);
    cursor: pointer;
}

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

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

.section-head h2,
.page-hero h1,
.detail-title h1 {
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 950;
}

.section-head h2,
.section-head p,
.page-hero h1,
.page-hero p,
.detail-title h1,
.detail-title p {
    margin: 0;
}

.section-head p,
.page-hero p,
.detail-title p {
    color: var(--muted);
}

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

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

.movie-card {
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid rgba(229, 231, 235, 0.95);
    box-shadow: 0 8px 30px rgba(16, 24, 40, 0.06);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.movie-card:hover {
    transform: translateY(-7px);
    border-color: rgba(16, 185, 129, 0.45);
    box-shadow: var(--shadow);
}

.poster-link {
    position: relative;
    display: block;
    overflow: hidden;
    background: linear-gradient(135deg, #e5e7eb, #f8fafc);
}

.poster-link img {
    width: 100%;
    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 9px;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(15, 23, 42, 0.74);
    backdrop-filter: blur(10px);
    font-size: 0.82rem;
    font-weight: 900;
}

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

.movie-meta-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--primary-dark);
    font-size: 0.82rem;
    font-weight: 900;
}

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

.movie-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.94rem;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 13px;
}

.tag-row span,
.meta-pill,
.breadcrumb a,
.breadcrumb span {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 2px 9px;
    border-radius: 999px;
    color: #475467;
    background: var(--surface-soft);
    font-size: 0.8rem;
    font-weight: 800;
}

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

.category-card {
    padding: 22px;
    min-height: 168px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: var(--radius-lg);
    color: #ffffff;
    background:
        linear-gradient(135deg, rgba(16, 185, 129, 0.95), rgba(4, 120, 87, 0.95)),
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.34), transparent 12rem);
    box-shadow: 0 18px 38px rgba(5, 150, 105, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card:nth-child(2n) {
    background: linear-gradient(135deg, #0f172a, #1f2937);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.20);
}

.category-card:nth-child(3n) {
    background: linear-gradient(135deg, #f59e0b, #b45309);
    box-shadow: 0 18px 38px rgba(245, 158, 11, 0.20);
}

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

.category-card strong {
    font-size: 1.25rem;
}

.category-card span {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.92rem;
}

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

.ranking-item {
    min-width: 0;
    display: grid;
    grid-template-columns: auto 58px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid var(--line);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ranking-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 30px rgba(16, 24, 40, 0.09);
}

.rank-number {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #ffffff;
    background: #0f172a;
    font-weight: 950;
}

.ranking-item:nth-child(-n+3) .rank-number {
    background: linear-gradient(135deg, var(--accent), #ef4444);
}

.ranking-item img {
    width: 58px;
    height: 78px;
    object-fit: cover;
    border-radius: 12px;
    background: var(--surface-soft);
}

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

.rank-copy strong,
.rank-copy em {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-copy strong {
    font-size: 0.98rem;
}

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

.page-hero {
    padding: 48px;
    border-radius: var(--radius-xl);
    color: #ffffff;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(4, 120, 87, 0.86)),
        radial-gradient(circle at 80% 10%, rgba(245, 158, 11, 0.35), transparent 20rem);
    box-shadow: var(--shadow);
}

.page-hero p {
    max-width: 760px;
    margin-top: 14px;
    color: rgba(255, 255, 255, 0.78);
}

.toolbar {
    margin: 28px 0 20px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
}

.toolbar input,
.toolbar select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    outline: 0;
    background: #ffffff;
    padding: 13px 15px;
    color: var(--text);
    box-shadow: 0 10px 22px rgba(16, 24, 40, 0.04);
}

.toolbar select {
    min-width: 160px;
}

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

.empty-state.is-visible {
    display: block;
}

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

.detail-hero {
    display: grid;
    grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
    gap: 34px;
    align-items: stretch;
    padding: 32px;
    border-radius: var(--radius-xl);
    background: #ffffff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.detail-cover {
    overflow: hidden;
    border-radius: 24px;
    background: var(--surface-soft);
}

.detail-cover img {
    width: 100%;
    height: 100%;
    min-height: 450px;
    object-fit: cover;
}

.detail-title {
    display: flex;
    flex-direction: column;
    gap: 16px;
    justify-content: center;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

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

.detail-actions .ghost-button {
    color: #064e3b;
    background: rgba(16, 185, 129, 0.10);
    border-color: rgba(16, 185, 129, 0.24);
}

.content-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    margin-top: 30px;
}

.content-card,
.side-card,
.player-section {
    border-radius: var(--radius-lg);
    background: #ffffff;
    border: 1px solid var(--line);
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.05);
}

.content-card,
.side-card {
    padding: 24px;
}

.content-card h2,
.side-card h2,
.player-section h2 {
    margin: 0 0 14px;
    font-size: 1.35rem;
}

.content-card p {
    margin: 0 0 18px;
    color: #344054;
}

.player-section {
    margin-top: 30px;
    padding: 24px;
}

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

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

.video-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    color: #ffffff;
    border: 0;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.28), rgba(15, 23, 42, 0.76)),
        radial-gradient(circle at center, rgba(16, 185, 129, 0.26), transparent 22rem);
    cursor: pointer;
}

.video-overlay span {
    width: 78px;
    height: 78px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #064e3b;
    background: #ffffff;
    font-size: 1.65rem;
    box-shadow: 0 22px 45px rgba(0, 0, 0, 0.28);
}

.video-overlay strong {
    font-size: 1.1rem;
    letter-spacing: 0.08em;
}

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

.video-overlay.is-loading span {
    animation: pulsePlay 1s ease-in-out infinite;
}

@keyframes pulsePlay {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.08);
    }
}

.side-list {
    display: grid;
    gap: 13px;
}

.side-link {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.side-link img {
    width: 64px;
    height: 86px;
    object-fit: cover;
    border-radius: 12px;
    background: var(--surface-soft);
}

.side-link strong,
.side-link span {
    display: block;
}

.side-link strong {
    line-height: 1.35;
}

.side-link span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.84rem;
}

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

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

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

.site-footer {
    margin-top: 30px;
    padding: 42px 22px;
    color: #cbd5e1;
    background: #0f172a;
}

.footer-inner {
    max-width: var(--max);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 30px;
}

.footer-inner strong {
    color: #ffffff;
    font-size: 1.15rem;
}

.footer-inner p {
    max-width: 560px;
    margin: 8px 0 0;
    color: #94a3b8;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    align-content: flex-start;
}

.footer-links a {
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

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

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

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

    .content-layout {
        grid-template-columns: 1fr;
    }
}

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

    .menu-button {
        display: flex;
        margin-left: auto;
    }

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

    .hero-copy {
        padding: 46px 30px 24px;
    }

    .hero-poster {
        padding: 0 30px 76px;
    }

    .hero-controls {
        left: 30px;
        bottom: 30px;
    }

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

    .detail-cover img {
        min-height: 0;
    }

    .footer-inner {
        flex-direction: column;
    }

    .footer-links {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .nav-wrap,
    .hero,
    .main-shell,
    .page-shell {
        padding-left: 15px;
        padding-right: 15px;
    }

    .hero-frame,
    .page-hero,
    .detail-hero {
        border-radius: 22px;
    }

    .hero h1 {
        font-size: 2.45rem;
    }

    .hero-search,
    .toolbar {
        grid-template-columns: 1fr;
        border-radius: 18px;
    }

    .hero-search {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-search button {
        min-height: 44px;
    }

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

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

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

    .page-hero,
    .detail-hero,
    .player-section,
    .content-card,
    .side-card {
        padding: 20px;
    }
}
