:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #9333ea;
    --accent: #ec4899;
    --ink: #111827;
    --muted: #6b7280;
    --soft: #f8fafc;
    --line: #e5e7eb;
    --card: #ffffff;
    --shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.10), transparent 32rem),
        radial-gradient(circle at top right, rgba(236, 72, 153, 0.10), transparent 34rem),
        #f8fafc;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

body.menu-open {
    overflow: hidden;
}

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

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

button,
input {
    font: inherit;
}

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

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

.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 72px;
}

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

.brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    color: #ffffff;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
    box-shadow: 0 12px 28px rgba(79, 70, 229, 0.26);
}

.brand-text {
    font-size: 20px;
}

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

.nav-link,
.dropdown-trigger {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    color: #374151;
    border: 0;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active,
.dropdown-trigger:hover {
    color: var(--primary);
    background: #eff6ff;
}

.nav-dropdown {
    position: relative;
}

.dropdown-panel {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 6px;
    width: 300px;
    padding: 12px;
    border: 1px solid rgba(229, 231, 235, 0.92);
    border-radius: 20px;
    background: #ffffff;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-dropdown:hover .dropdown-panel,
.nav-dropdown:focus-within .dropdown-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.dropdown-panel a {
    padding: 10px 12px;
    color: #374151;
    border-radius: 14px;
}

.dropdown-panel a:hover {
    color: var(--primary);
    background: #eff6ff;
}

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

.header-search input {
    width: 210px;
    padding: 8px 12px;
    border: 0;
    outline: 0;
    background: transparent;
}

.header-search button {
    padding: 8px 14px;
    color: #ffffff;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    cursor: pointer;
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    margin-left: auto;
    border: 0;
    border-radius: 14px;
    background: #f3f4f6;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 5px auto;
    border-radius: 999px;
    background: #111827;
}

.mobile-panel {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px 16px 20px;
    border-top: 1px solid var(--line);
    background: #ffffff;
}

.mobile-panel a {
    padding: 12px;
    border-radius: 14px;
    background: #f8fafc;
}

.hero-section {
    position: relative;
    overflow: hidden;
    padding: 28px 0 44px;
}

.hero-shell {
    position: relative;
    min-height: 590px;
    overflow: hidden;
    border-radius: 36px;
    background: #111827;
    box-shadow: var(--shadow);
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) 360px;
    gap: 48px;
    align-items: center;
    padding: 68px;
    color: #ffffff;
    background:
        linear-gradient(120deg, rgba(15, 23, 42, 0.92) 0%, rgba(37, 99, 235, 0.74) 48%, rgba(147, 51, 234, 0.62) 100%),
        var(--hero-image) center / cover;
    opacity: 0;
    transform: scale(1.03);
    transition: opacity 0.65s ease, transform 0.65s ease;
}

.hero-slide.active {
    opacity: 1;
    transform: scale(1);
    z-index: 1;
}

.hero-copy {
    position: relative;
    z-index: 2;
    max-width: 720px;
}

.eyebrow,
.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: #60a5fa;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero-copy h1,
.detail-copy h1,
.page-hero h1 {
    margin: 0;
    font-size: clamp(34px, 6vw, 68px);
    line-height: 1.05;
    letter-spacing: -0.05em;
}

.hero-copy p,
.detail-copy p,
.page-hero p {
    max-width: 720px;
    margin: 20px 0 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 18px;
}

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

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

.hero-tags span,
.detail-meta span,
.tag-row span,
.detail-tags a,
.channel-links a,
.quick-links a {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    color: #1f2937;
    border-radius: 999px;
    background: #eef2ff;
    font-size: 13px;
    font-weight: 700;
}

.hero-tags span,
.detail-meta span {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(8px);
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border-radius: 999px;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn.primary {
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.28);
}

.btn.soft {
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.30);
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(10px);
}

.btn.ghost {
    color: var(--primary);
    background: #eff6ff;
}

.btn.small {
    min-height: 36px;
    padding: 0 14px;
    font-size: 13px;
}

.hero-poster {
    position: relative;
    z-index: 2;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 30px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.38);
}

.hero-dots {
    position: absolute;
    right: 44px;
    bottom: 34px;
    z-index: 3;
    display: flex;
    gap: 10px;
}

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

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

.quick-search-panel {
    margin-top: -24px;
    margin-bottom: 42px;
    padding: 18px;
    border: 1px solid rgba(229, 231, 235, 0.86);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(16px);
}

.quick-search-panel form,
.page-search {
    display: flex;
    gap: 12px;
}

.quick-search-panel input,
.page-search input {
    flex: 1;
    min-width: 0;
    padding: 15px 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    outline: 0;
    background: #ffffff;
}

.quick-links {
    margin-top: 14px;
}

.section-block,
.category-strip {
    margin-top: 54px;
}

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

.section-head h2 {
    margin: 0;
    font-size: clamp(24px, 3vw, 36px);
    letter-spacing: -0.04em;
}

.more-link {
    color: var(--primary);
    font-weight: 800;
}

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

.category-tile {
    position: relative;
    min-height: 138px;
    overflow: hidden;
    padding: 18px;
    color: #ffffff;
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.92), rgba(147, 51, 234, 0.84)),
        var(--tile-image) center / cover;
    box-shadow: 0 14px 36px rgba(37, 99, 235, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 58px rgba(37, 99, 235, 0.24);
}

.category-tile span,
.category-tile em {
    display: block;
    color: rgba(255, 255, 255, 0.78);
    font-style: normal;
    font-size: 13px;
    font-weight: 700;
}

.category-tile strong {
    display: block;
    margin: 12px 0 10px;
    font-size: 22px;
}

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

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

.movie-card {
    overflow: hidden;
    border: 1px solid rgba(229, 231, 235, 0.86);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.poster-wrap {
    position: relative;
    display: block;
    overflow: hidden;
    background: linear-gradient(135deg, #1e293b, #4f46e5, #db2777);
}

.movie-card .poster-wrap {
    aspect-ratio: 2 / 2.9;
}

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

.poster-fallback .poster-img {
    opacity: 0;
}

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

.poster-gradient {
    position: absolute;
    inset: auto 0 0;
    height: 44%;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.68));
}

.poster-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 5px 10px;
    color: #ffffff;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.68);
    font-size: 12px;
    font-weight: 800;
    backdrop-filter: blur(8px);
}

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

.movie-card-body h2,
.rank-info h2,
.content-card h2 {
    margin: 8px 0 8px;
    line-height: 1.3;
}

.movie-card-body h2 {
    display: -webkit-box;
    min-height: 48px;
    overflow: hidden;
    font-size: 18px;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.movie-card-body h2 a:hover,
.rank-info h2 a:hover {
    color: var(--primary);
}

.movie-card-body p,
.rank-info p,
.content-card p {
    margin: 0;
    color: var(--muted);
}

.movie-card-body p {
    display: -webkit-box;
    min-height: 70px;
    overflow: hidden;
    font-size: 14px;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.movie-meta-line {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.tag-row {
    margin-top: 12px;
}

.tag-row span {
    color: #475569;
    background: #f1f5f9;
    font-size: 12px;
}

.page-main {
    padding: 36px 0 68px;
}

.page-hero {
    overflow: hidden;
    margin-bottom: 34px;
    padding: clamp(28px, 6vw, 56px);
    color: #ffffff;
    border-radius: 32px;
    background:
        radial-gradient(circle at 18% 15%, rgba(255, 255, 255, 0.22), transparent 22rem),
        linear-gradient(135deg, #111827, #1d4ed8 48%, #9333ea);
    box-shadow: var(--shadow);
}

.page-hero.slim p,
.page-hero.category-hero p,
.page-hero.rank-hero p {
    color: rgba(255, 255, 255, 0.82);
}

.page-search {
    margin-top: 24px;
    max-width: 720px;
}

.channel-links {
    margin-top: 22px;
}

.channel-links a {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
}

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

.rank-row {
    display: grid;
    grid-template-columns: 74px 84px minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 14px;
    border: 1px solid rgba(229, 231, 235, 0.90);
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.rank-row.top {
    border-color: rgba(37, 99, 235, 0.28);
    background: linear-gradient(135deg, #ffffff, #eff6ff);
}

.rank-index {
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    color: #ffffff;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    font-weight: 900;
}

.rank-cover {
    width: 84px;
    aspect-ratio: 2 / 3;
    border-radius: 16px;
}

.rank-info h2 {
    margin-top: 0;
    font-size: 20px;
}

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

.detail-hero {
    position: relative;
    overflow: hidden;
    color: #ffffff;
    background:
        linear-gradient(120deg, rgba(15, 23, 42, 0.94), rgba(30, 64, 175, 0.84), rgba(147, 51, 234, 0.68)),
        var(--hero-image) center / cover;
}

.detail-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 70% 20%, rgba(255, 255, 255, 0.18), transparent 28rem);
}

.detail-hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 44px;
    align-items: center;
    min-height: 520px;
    padding: 52px 0;
}

.detail-poster {
    aspect-ratio: 2 / 3;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 28px;
    box-shadow: 0 28px 72px rgba(0, 0, 0, 0.36);
}

.detail-copy h1 {
    font-size: clamp(34px, 5vw, 62px);
}

.detail-copy p {
    color: rgba(255, 255, 255, 0.84);
}

.detail-meta {
    margin-top: 22px;
}

.player-section {
    margin-top: -56px;
    position: relative;
    z-index: 2;
}

.player-shell {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 30px;
    background: #020617;
    box-shadow: var(--shadow);
}

.movie-player {
    width: 100%;
    height: 100%;
    background: #020617;
}

.player-play {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 0;
    color: #ffffff;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.22), rgba(2, 6, 23, 0.36));
    cursor: pointer;
}

.player-play span {
    display: grid;
    width: 92px;
    height: 92px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 20px 44px rgba(37, 99, 235, 0.35);
    font-weight: 900;
}

.player-shell.playing .player-play {
    opacity: 0;
    pointer-events: none;
}

.source-line {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 14px;
}

.detail-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 22px;
    margin-top: 38px;
}

.content-card {
    padding: 24px;
    border: 1px solid rgba(229, 231, 235, 0.88);
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.06);
}

.detail-tags-card {
    grid-column: 1 / -1;
}

.detail-tags a {
    color: var(--primary);
    background: #eff6ff;
}

.empty-state {
    display: none;
    padding: 24px;
    text-align: center;
    color: var(--muted);
}

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

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

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 48px;
}

.footer-brand .brand-text {
    color: #ffffff;
}

.site-footer p {
    max-width: 460px;
    color: #94a3b8;
}

.site-footer h2 {
    margin-top: 0;
    color: #ffffff;
}

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

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

.footer-links a:hover {
    background: rgba(255, 255, 255, 0.16);
}

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

    .menu-toggle {
        display: block;
    }

    body.menu-open .mobile-panel {
        display: grid;
    }

    .hero-slide {
        grid-template-columns: 1fr;
        gap: 28px;
        padding: 48px;
    }

    .hero-poster {
        display: none;
    }

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

    .detail-hero-grid {
        grid-template-columns: 210px minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    .container {
        width: min(100% - 24px, 1180px);
    }

    .header-inner {
        min-height: 64px;
    }

    .brand-text {
        font-size: 18px;
    }

    .hero-shell {
        min-height: 620px;
        border-radius: 28px;
    }

    .hero-slide {
        padding: 34px 24px;
    }

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

    .hero-dots {
        right: 24px;
        bottom: 24px;
    }

    .quick-search-panel form,
    .page-search {
        flex-direction: column;
    }

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

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

    .rank-row {
        grid-template-columns: 54px 70px minmax(0, 1fr);
    }

    .rank-row .btn {
        display: none;
    }

    .detail-hero-grid {
        grid-template-columns: 1fr;
        min-height: 0;
        padding: 34px 0 86px;
    }

    .detail-poster {
        width: 180px;
    }

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

    .player-section {
        margin-top: -42px;
    }
}

@media (max-width: 480px) {
    .category-grid,
    .movie-grid,
    .compact-grid {
        grid-template-columns: 1fr;
    }

    .movie-card {
        display: grid;
        grid-template-columns: 118px minmax(0, 1fr);
    }

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

    .movie-card-body h2 {
        min-height: auto;
    }

    .movie-card-body p {
        min-height: auto;
        -webkit-line-clamp: 2;
    }
}
