:root {
    color-scheme: dark;
    --bg: #020617;
    --bg-soft: #0f172a;
    --bg-card: rgba(15, 23, 42, 0.82);
    --border: rgba(59, 130, 246, 0.24);
    --border-strong: rgba(34, 211, 238, 0.35);
    --text: #f8fafc;
    --muted: #94a3b8;
    --muted-2: #64748b;
    --cyan: #22d3ee;
    --blue: #3b82f6;
    --amber: #f59e0b;
    --pink: #ec4899;
    --radius: 24px;
    --shadow: 0 24px 70px rgba(2, 6, 23, 0.45);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(34, 211, 238, 0.18), transparent 34rem),
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.2), transparent 32rem),
        linear-gradient(180deg, #020617 0%, #08111f 42%, #020617 100%);
}

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

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

button,
input {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(59, 130, 246, 0.22);
    background: rgba(2, 6, 23, 0.78);
    backdrop-filter: blur(18px);
}

.nav-shell {
    display: flex;
    align-items: center;
    gap: 24px;
    width: min(1240px, calc(100% - 32px));
    min-height: 74px;
    margin: 0 auto;
}

.logo,
.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: linear-gradient(90deg, #60a5fa, #67e8f9, #38bdf8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.logo {
    font-size: 22px;
    white-space: nowrap;
}

.logo-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    color: #ffffff;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb, #22d3ee);
    box-shadow: 0 12px 30px rgba(34, 211, 238, 0.28);
}

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

.desktop-nav a,
.nav-dropdown > button,
.mobile-panel a {
    color: #cbd5e1;
    transition: color 0.2s ease, transform 0.2s ease;
}

.desktop-nav a:hover,
.desktop-nav a.active,
.nav-dropdown > button:hover,
.mobile-panel a:hover,
.mobile-panel a.active {
    color: var(--cyan);
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown > button {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.dropdown-panel {
    position: absolute;
    top: 34px;
    left: -18px;
    display: grid;
    min-width: 180px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.96);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: 0.2s ease;
}

.dropdown-panel a {
    padding: 10px 12px;
    border-radius: 12px;
}

.dropdown-panel a:hover {
    background: rgba(37, 99, 235, 0.22);
}

.nav-dropdown:hover .dropdown-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.top-search,
.mobile-search,
.search-panel {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-search input,
.mobile-search input,
.search-panel input {
    width: 220px;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    outline: none;
    background: rgba(15, 23, 42, 0.62);
    transition: 0.2s ease;
}

.top-search input:focus,
.mobile-search input:focus,
.search-panel input:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
}

.top-search button,
.mobile-search button,
.search-panel button,
.primary-btn,
.secondary-btn,
.hero-arrow,
.hero-dots button,
.play-cta,
.load-more-btn {
    border: 0;
    cursor: pointer;
}

.top-search button,
.mobile-search button,
.search-panel button,
.primary-btn,
.play-cta,
.load-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    color: #ffffff;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb, #0891b2);
    box-shadow: 0 15px 34px rgba(37, 99, 235, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.top-search button:hover,
.mobile-search button:hover,
.search-panel button:hover,
.primary-btn:hover,
.play-cta:hover,
.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 44px rgba(34, 211, 238, 0.3);
}

.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 18px;
    color: #dbeafe;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.62);
    transition: 0.2s ease;
}

.secondary-btn:hover {
    color: #ffffff;
    border-color: var(--cyan);
    transform: translateY(-2px);
}

.menu-toggle {
    display: none;
    margin-left: auto;
    padding: 9px 12px;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.72);
}

.mobile-panel {
    display: none;
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.92);
}

.mobile-panel.open {
    display: grid;
    gap: 14px;
}

.page-main {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 42px 0 72px;
}

.hero {
    position: relative;
    min-height: 640px;
    overflow: hidden;
    border-bottom: 1px solid rgba(59, 130, 246, 0.18);
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: grid;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.7s ease, visibility 0.7s ease;
}

.hero-slide.is-active {
    opacity: 1;
    visibility: visible;
}

.hero-slide::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(90deg, rgba(2, 6, 23, 0.95) 0%, rgba(2, 6, 23, 0.78) 42%, rgba(2, 6, 23, 0.36) 78%),
        var(--hero-image);
    background-size: cover;
    background-position: center;
    transform: scale(1.03);
}

.hero-slide::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 42%;
    background: linear-gradient(180deg, transparent, #020617);
}

.hero-content {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 42px;
    align-items: center;
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding-top: 40px;
}

.hero-kicker,
.section-kicker,
.breadcrumb {
    color: var(--cyan);
    font-weight: 700;
    letter-spacing: 0.08em;
}

.hero h1 {
    max-width: 820px;
    margin: 16px 0;
    font-size: clamp(38px, 7vw, 76px);
    line-height: 1.02;
    letter-spacing: -0.05em;
}

.hero h1 span {
    display: block;
    background: linear-gradient(90deg, #ffffff, #67e8f9, #60a5fa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-copy {
    max-width: 680px;
    margin: 0 0 26px;
    color: #cbd5e1;
    font-size: 18px;
    line-height: 1.8;
}

.hero-actions,
.detail-actions,
.category-links,
.section-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 32px;
    max-width: 620px;
}

.hero-stat {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.56);
    backdrop-filter: blur(14px);
}

.hero-stat strong {
    display: block;
    font-size: 24px;
    color: #ffffff;
}

.hero-stat span {
    color: var(--muted);
    font-size: 13px;
}

.hero-focus {
    padding: 14px;
    border: 1px solid rgba(34, 211, 238, 0.28);
    border-radius: 30px;
    background: rgba(15, 23, 42, 0.48);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    transform: rotate(2deg);
}

.hero-focus img {
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.25), rgba(34, 211, 238, 0.1));
}

.hero-focus-info {
    padding: 16px 6px 4px;
}

.hero-focus-info strong {
    display: block;
    font-size: 20px;
}

.hero-focus-info span {
    color: var(--muted);
}

.hero-controls {
    position: absolute;
    z-index: 4;
    right: calc((100% - min(1240px, calc(100% - 32px))) / 2);
    bottom: 48px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.hero-arrow {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    color: #ffffff;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.74);
}

.hero-dots {
    display: flex;
    gap: 8px;
}

.hero-dots button {
    width: 11px;
    height: 11px;
    padding: 0;
    border-radius: 50%;
    background: rgba(203, 213, 225, 0.38);
}

.hero-dots button.is-active {
    width: 30px;
    border-radius: 999px;
    background: var(--cyan);
}

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

.section-head h2,
.page-title h1,
.detail-info h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.16;
    letter-spacing: -0.03em;
}

.section-head p,
.page-title p,
.category-intro,
.detail-info p,
.text-block p {
    color: var(--muted);
    line-height: 1.85;
}

.grid {
    display: grid;
    gap: 22px;
}

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

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

.movie-card,
.category-card,
.rank-list,
.text-block,
.detail-hero,
.player-section,
.related-box,
.search-box {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    box-shadow: 0 18px 54px rgba(2, 6, 23, 0.22);
}

.movie-card {
    overflow: hidden;
    transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.movie-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-6px);
    box-shadow: 0 24px 70px rgba(8, 145, 178, 0.22);
}

.poster-link {
    position: relative;
    display: block;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(15, 23, 42, 0.8));
}

.poster-link img {
    aspect-ratio: 2 / 3;
    object-fit: cover;
    transition: transform 0.35s ease, filter 0.35s ease;
}

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

.poster-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 10px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.95), rgba(236, 72, 153, 0.82));
    box-shadow: 0 10px 26px rgba(236, 72, 153, 0.2);
}

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

.movie-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted-2);
    font-size: 12px;
}

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

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

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

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-row span,
.detail-tag,
.category-chip {
    padding: 6px 10px;
    color: #bae6fd;
    font-size: 12px;
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.09);
}

.category-card {
    display: grid;
    gap: 12px;
    min-height: 210px;
    padding: 22px;
    background:
        linear-gradient(145deg, rgba(37, 99, 235, 0.22), rgba(8, 145, 178, 0.08)),
        rgba(15, 23, 42, 0.86);
    transition: 0.24s ease;
}

.category-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-6px);
}

.category-icon {
    font-size: 34px;
}

.category-card h3 {
    margin: 0;
    font-size: 20px;
}

.category-card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

.rank-list {
    padding: 16px;
}

.rank-item {
    display: grid;
    grid-template-columns: 64px 76px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 14px;
    border-radius: 20px;
    transition: 0.2s ease;
}

.rank-item:hover {
    background: rgba(30, 41, 59, 0.76);
}

.rank-index {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    font-weight: 900;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.rank-item:nth-child(n+4) .rank-index {
    background: rgba(30, 41, 59, 0.98);
    color: #93c5fd;
}

.rank-item img {
    width: 76px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.9);
}

.rank-info strong {
    display: block;
    margin-bottom: 6px;
    font-size: 18px;
}

.rank-info span,
.rank-score {
    color: var(--muted);
    font-size: 14px;
}

.page-title {
    margin-bottom: 28px;
}

.category-links {
    margin-top: 18px;
}

.category-chip:hover {
    color: #ffffff;
    border-color: var(--cyan);
}

.detail-hero {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    gap: 34px;
    padding: 28px;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 20%, rgba(34, 211, 238, 0.18), transparent 30rem),
        rgba(15, 23, 42, 0.86);
}

.detail-poster img {
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.9);
    box-shadow: 0 22px 55px rgba(2, 6, 23, 0.45);
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
    color: #cbd5e1;
}

.detail-meta span {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.56);
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0 26px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
    font-size: 14px;
}

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

.player-section,
.text-block,
.related-box,
.search-box {
    margin-top: 30px;
    padding: 24px;
}

.player-section h2,
.text-block h2,
.related-box h2,
.search-box h2 {
    margin: 0 0 18px;
    font-size: 26px;
}

.player-shell {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    background: #000000;
}

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

.player-cover {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    gap: 12px;
    width: 100%;
    height: 100%;
    color: #ffffff;
    border: 0;
    background:
        linear-gradient(180deg, rgba(2, 6, 23, 0.34), rgba(2, 6, 23, 0.72));
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.player-shell.is-playing .player-cover {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.play-round {
    display: grid;
    place-items: center;
    width: 88px;
    height: 88px;
    padding-left: 5px;
    font-size: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #22d3ee);
    box-shadow: 0 22px 54px rgba(34, 211, 238, 0.32);
}

.player-cover strong {
    font-size: 24px;
}

.text-block p {
    margin: 0 0 16px;
    font-size: 16px;
}

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

.mini-card {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.54);
}

.mini-card img {
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.9);
}

.mini-card strong {
    display: block;
    overflow: hidden;
    font-size: 14px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

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

.search-panel {
    align-items: stretch;
    margin-top: 18px;
}

.search-panel input {
    width: min(620px, 100%);
}

.no-results {
    display: none;
    padding: 26px;
    color: var(--muted);
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.68);
}

.no-results.show {
    display: block;
}

.site-footer {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 36px 0 46px;
    color: var(--muted);
    border-top: 1px solid rgba(59, 130, 246, 0.18);
}

.footer-logo {
    font-size: 22px;
}

.site-footer p {
    max-width: 760px;
    line-height: 1.8;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin-top: 18px;
}

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

.copyright {
    margin-top: 22px;
    font-size: 13px;
}

.hidden-card {
    display: none;
}

@media (max-width: 1120px) {
    .top-search {
        display: none;
    }

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

    .hero-focus {
        display: none;
    }

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

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

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

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

    .menu-toggle {
        display: inline-flex;
    }

    .nav-shell {
        min-height: 66px;
    }

    .hero {
        min-height: 620px;
    }

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

    .hero-controls {
        right: 16px;
        bottom: 26px;
    }

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

    .section-head {
        display: grid;
    }

    .rank-item {
        grid-template-columns: 42px 58px minmax(0, 1fr);
    }

    .rank-score {
        display: none;
    }

    .rank-item img {
        width: 58px;
    }

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

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

@media (max-width: 540px) {
    .page-main {
        width: min(100% - 24px, 1240px);
        padding-top: 28px;
    }

    .logo {
        font-size: 18px;
    }

    .logo-mark {
        width: 34px;
        height: 34px;
    }

    .hero h1 {
        font-size: 42px;
    }

    .hero-copy {
        font-size: 16px;
    }

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

    .detail-hero,
    .player-section,
    .text-block,
    .related-box,
    .search-box {
        padding: 18px;
    }

    .search-panel,
    .mobile-search {
        display: grid;
    }

    .mobile-search input,
    .search-panel input {
        width: 100%;
    }
}
