:root {
    --bg: #020617;
    --panel: rgba(15, 23, 42, 0.72);
    --panel-strong: rgba(15, 23, 42, 0.92);
    --line: rgba(148, 163, 184, 0.16);
    --text: #f8fafc;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --accent: #eab308;
    --accent-2: #2563eb;
    --danger: #f87171;
    --radius-xl: 24px;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at 18% 5%, rgba(37, 99, 235, 0.26), transparent 28rem),
        radial-gradient(circle at 82% 18%, rgba(234, 179, 8, 0.16), transparent 22rem),
        linear-gradient(180deg, #0f172a 0%, #020617 54%, #020617 100%);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

img {
    max-width: 100%;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(30, 58, 138, 0.92), rgba(15, 23, 42, 0.96));
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
}

.nav-wrap {
    width: min(1280px, calc(100% - 32px));
    min-height: 68px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    font-weight: 900;
    letter-spacing: 0.02em;
    text-decoration: none;
    white-space: nowrap;
}

.logo-mark {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #facc15, #d97706);
    color: #111827;
    box-shadow: 0 12px 30px rgba(234, 179, 8, 0.32);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link {
    padding: 10px 14px;
    color: #dbeafe;
    border-radius: 999px;
    text-decoration: none;
    transition: 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #111827;
    background: var(--accent);
}

.nav-search {
    display: flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    overflow: hidden;
    background: rgba(2, 6, 23, 0.36);
}

.nav-search input,
.local-search,
#global-search-input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    color: var(--text);
    background: rgba(15, 23, 42, 0.8);
}

.nav-search input {
    width: 230px;
    padding: 10px 14px;
}

.nav-search button {
    padding: 10px 16px;
    color: #111827;
    background: var(--accent);
    font-weight: 700;
}

.mobile-menu-btn {
    display: none;
    color: #ffffff;
    font-size: 26px;
}

.hero-wrap {
    position: relative;
    height: min(72vh, 680px);
    min-height: 520px;
    overflow: hidden;
    background: #020617;
}

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

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

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: linear-gradient(135deg, #1e3a8a, #020617 68%, #78350f);
    transform: scale(1.04);
}

.hero-slide.active .hero-img {
    animation: slowZoom 8s linear both;
}

@keyframes slowZoom {
    from { transform: scale(1.02); }
    to { transform: scale(1.08); }
}

.hero-shade,
.detail-bg::after {
    position: absolute;
    inset: 0;
    content: "";
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.9) 0%, rgba(2, 6, 23, 0.62) 46%, rgba(2, 6, 23, 0.2) 100%),
        linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.2) 52%, rgba(2, 6, 23, 0.62) 100%);
}

.hero-content {
    position: absolute;
    left: max(24px, calc((100vw - 1280px) / 2 + 24px));
    bottom: 88px;
    max-width: 780px;
}

.hero-kicker,
.page-hero span {
    display: inline-flex;
    margin-bottom: 18px;
    padding: 7px 14px;
    border-radius: 999px;
    color: #111827;
    background: var(--accent);
    font-size: 14px;
    font-weight: 800;
}

.hero-content h1,
.page-hero h1,
.detail-info h1 {
    margin: 0 0 18px;
    font-size: clamp(34px, 5vw, 70px);
    line-height: 1.02;
    font-weight: 950;
    letter-spacing: -0.05em;
    text-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

.hero-content p,
.page-hero p,
.detail-info .one-line {
    max-width: 760px;
    margin: 0 0 28px;
    color: #e2e8f0;
    font-size: clamp(16px, 2vw, 22px);
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.primary-btn,
.ghost-btn,
.section-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 12px 22px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 850;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-btn {
    color: #111827;
    background: linear-gradient(135deg, #facc15, #d97706);
    box-shadow: 0 18px 45px rgba(234, 179, 8, 0.26);
}

.primary-btn:hover,
.ghost-btn:hover,
.section-more:hover {
    transform: translateY(-2px);
}

.primary-btn.small {
    min-height: 38px;
    padding: 8px 16px;
}

.ghost-btn,
.section-more {
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(12px);
}

.hero-arrow {
    position: absolute;
    top: 50%;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.46);
    font-size: 36px;
    transform: translateY(-50%);
}

.hero-arrow.prev { left: 20px; }
.hero-arrow.next { right: 20px; }

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

.hero-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.48);
    transition: 0.25s ease;
}

.hero-dot.active {
    width: 34px;
    background: var(--accent);
}

.quick-panel,
.search-panel,
.content-section,
.page-main,
.rank-board,
.detail-content-grid,
.player-section {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
}

.quick-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 28px;
    padding: 22px 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.88), rgba(30, 58, 138, 0.42));
    box-shadow: var(--shadow);
}

.quick-panel strong {
    display: block;
    margin-bottom: 4px;
    font-size: 22px;
}

.quick-panel span,
.search-title p,
.section-head p,
.category-main p,
.rank-info em,
.footer-inner span {
    color: var(--muted);
}

.search-panel,
.search-page-box {
    display: grid;
    grid-template-columns: 1fr minmax(260px, 420px);
    gap: 24px;
    align-items: end;
    margin-top: 48px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: rgba(15, 23, 42, 0.56);
}

.search-title h2,
.section-head h2 {
    margin: 0 0 6px;
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 900;
    letter-spacing: -0.03em;
}

.local-search,
#global-search-input {
    min-height: 52px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
}

.content-section {
    margin-top: 72px;
}

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

.section-head.slim {
    align-items: center;
    margin-bottom: 16px;
}

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

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

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

.movie-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.58);
    box-shadow: 0 14px 50px rgba(0, 0, 0, 0.22);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-7px);
    border-color: rgba(234, 179, 8, 0.45);
    box-shadow: 0 24px 70px rgba(234, 179, 8, 0.14);
}

.poster-box {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(135deg, #172554, #020617 70%, #713f12);
}

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

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

.play-float {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 58px;
    height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #111827;
    background: rgba(250, 204, 21, 0.92);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.82);
    transition: 0.25s ease;
}

.movie-card:hover .play-float {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.rank-badge {
    position: absolute;
    left: 10px;
    top: 10px;
    z-index: 2;
    padding: 5px 9px;
    border-radius: 999px;
    color: #111827;
    background: var(--accent);
    font-size: 12px;
    font-weight: 900;
}

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

.movie-title {
    display: block;
    margin-bottom: 8px;
    color: #ffffff;
    font-size: 17px;
    font-weight: 850;
    line-height: 1.35;
    text-decoration: none;
}

.movie-card:hover .movie-title {
    color: var(--accent);
}

.movie-desc {
    display: -webkit-box;
    min-height: 46px;
    margin: 0 0 12px;
    overflow: hidden;
    color: #cbd5e1;
    font-size: 14px;
    line-height: 1.6;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.movie-meta,
.info-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}

.movie-meta span,
.info-list span {
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(30, 41, 59, 0.72);
}

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

.tag-row span {
    padding: 5px 9px;
    border: 1px solid rgba(234, 179, 8, 0.2);
    border-radius: 999px;
    color: #fde68a;
    background: rgba(234, 179, 8, 0.08);
    font-size: 12px;
}

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

.rank-panel {
    position: sticky;
    top: 92px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: rgba(15, 23, 42, 0.72);
}

.rank-panel.large {
    position: sticky;
}

.rank-row {
    display: grid;
    grid-template-columns: 40px 72px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: 14px;
    color: #ffffff;
    text-decoration: none;
    transition: 0.2s ease;
}

.rank-row:hover {
    background: rgba(51, 65, 85, 0.62);
}

.rank-num {
    color: var(--accent);
    font-weight: 950;
}

.rank-row img {
    width: 72px;
    height: 48px;
    object-fit: cover;
    border-radius: 10px;
    background: #172554;
}

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

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

.rank-info em {
    margin-top: 2px;
    font-style: normal;
    font-size: 12px;
}

.rank-score {
    color: #fde68a;
    font-weight: 900;
}

.page-main {
    padding: 46px 0 80px;
}

.page-main.narrow {
    max-width: 960px;
}

.page-hero {
    min-height: 300px;
    padding: 44px;
    border: 1px solid var(--line);
    border-radius: 30px;
    background:
        linear-gradient(135deg, rgba(30, 58, 138, 0.62), rgba(15, 23, 42, 0.86)),
        radial-gradient(circle at 80% 10%, rgba(234, 179, 8, 0.18), transparent 18rem);
    box-shadow: var(--shadow);
}

.small-hero {
    min-height: 240px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-top: 32px;
}

.category-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.58);
}

.category-main {
    color: #ffffff;
    text-decoration: none;
}

.category-main span {
    display: inline-flex;
    margin-bottom: 14px;
    color: var(--accent);
    font-weight: 850;
}

.category-main h2 {
    margin: 0 0 10px;
    font-size: 28px;
    font-weight: 950;
}

.category-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-links a {
    overflow: hidden;
    padding: 9px 11px;
    border-radius: 12px;
    color: #dbeafe;
    background: rgba(30, 41, 59, 0.52);
    text-decoration: none;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.category-links a:hover {
    color: #111827;
    background: var(--accent);
}

.search-page-box {
    grid-template-columns: 1fr;
    margin-top: 30px;
}

.search-count {
    color: var(--muted);
}

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

.detail-hero {
    position: relative;
    overflow: hidden;
    min-height: 620px;
    padding: 70px 0 50px;
}

.detail-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.detail-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(12px);
    transform: scale(1.08);
    opacity: 0.45;
}

.detail-layout {
    position: relative;
    z-index: 2;
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 46px;
    align-items: center;
}

.detail-poster {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 28px;
    box-shadow: var(--shadow);
    background: linear-gradient(135deg, #172554, #020617);
}

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

.crumb {
    display: inline-flex;
    margin-bottom: 18px;
    color: var(--accent);
    font-weight: 850;
    text-decoration: none;
}

.detail-tags {
    margin: 20px 0 26px;
}

.player-section {
    margin-top: -46px;
    position: relative;
    z-index: 4;
}

.player-shell {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 28px;
    background: #000000;
    box-shadow: var(--shadow);
}

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

.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #ffffff;
    background: radial-gradient(circle, rgba(2, 6, 23, 0.18), rgba(2, 6, 23, 0.74));
}

.player-overlay span {
    width: 82px;
    height: 82px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #111827;
    background: var(--accent);
    font-size: 34px;
    box-shadow: 0 18px 50px rgba(234, 179, 8, 0.32);
}

.player-overlay.is-hidden {
    display: none;
}

.player-message {
    position: absolute;
    left: 16px;
    bottom: 16px;
    color: var(--danger);
    font-weight: 700;
}

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

.detail-text-card,
.guide-card {
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.62);
}

.detail-text-card h2,
.guide-card h2 {
    margin: 0 0 14px;
    color: #ffffff;
    font-size: 24px;
    font-weight: 900;
}

.detail-text-card p,
.guide-card p {
    margin: 0 0 24px;
    color: #dbeafe;
    line-height: 1.9;
}

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

.site-footer {
    margin-top: 80px;
    border-top: 1px solid var(--line);
    background: rgba(2, 6, 23, 0.62);
}

.footer-inner {
    width: min(1280px, calc(100% - 32px));
    min-height: 92px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

[data-search-item].is-hidden {
    display: none;
}

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

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

    .rank-panel {
        position: static;
    }

    .detail-layout {
        grid-template-columns: 260px 1fr;
    }
}

@media (max-width: 860px) {
    .nav-wrap {
        grid-template-columns: auto auto;
    }

    .mobile-menu-btn {
        display: block;
        justify-self: end;
    }

    .nav-links,
    .nav-search {
        display: none;
        grid-column: 1 / -1;
    }

    .nav-links.is-open,
    .nav-search.is-open {
        display: flex;
    }

    .nav-links.is-open {
        flex-wrap: wrap;
    }

    .nav-search.is-open input {
        width: 100%;
    }

    .hero-wrap {
        min-height: 560px;
    }

    .hero-content {
        left: 24px;
        right: 24px;
        bottom: 82px;
    }

    .hero-arrow {
        display: none;
    }

    .quick-panel,
    .search-panel,
    .section-head,
    .footer-inner {
        flex-direction: column;
        align-items: stretch;
    }

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

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

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

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

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

    .page-hero,
    .quick-panel,
    .search-panel,
    .detail-text-card,
    .guide-card {
        padding: 22px;
        border-radius: 20px;
    }

    .rank-row {
        grid-template-columns: 34px 58px 1fr;
    }

    .rank-score {
        display: none;
    }
}
