:root {
    --bg: #020617;
    --panel: rgba(15, 23, 42, 0.74);
    --panel-strong: rgba(15, 23, 42, 0.94);
    --border: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --emerald: #10b981;
    --emerald-bright: #34d399;
    --teal: #14b8a6;
    --shadow: 0 24px 70px rgba(2, 6, 23, 0.45);
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 10%, rgba(16, 185, 129, 0.16), transparent 32rem),
        radial-gradient(circle at 85% 0%, rgba(20, 184, 166, 0.18), transparent 28rem),
        linear-gradient(180deg, #020617 0%, #0f172a 42%, #020617 100%);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}

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

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

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(15, 23, 42, 0.94);
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    backdrop-filter: blur(18px);
}

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

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #ffffff;
    font-weight: 900;
    background: linear-gradient(135deg, var(--emerald), var(--teal));
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.34);
    transition: transform 0.28s ease;
}

.brand:hover .brand-mark {
    transform: scale(1.08) rotate(-3deg);
}

.brand-text {
    display: grid;
    line-height: 1.16;
}

.brand-text strong {
    font-size: 20px;
    letter-spacing: 0.02em;
    background: linear-gradient(90deg, var(--emerald-bright), #5eead4);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-text small {
    color: #64748b;
    font-size: 12px;
    margin-top: 3px;
}

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

.desktop-nav a,
.mobile-nav a {
    padding: 10px 14px;
    border-radius: 12px;
    color: #cbd5e1;
    font-size: 15px;
    transition: color 0.22s ease, background 0.22s ease, transform 0.22s ease;
}

.desktop-nav a:hover,
.mobile-nav a:hover,
.desktop-nav a.active,
.mobile-nav a.active {
    color: var(--emerald-bright);
    background: rgba(16, 185, 129, 0.12);
}

.desktop-nav a:hover {
    transform: translateY(-1px);
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    color: #e2e8f0;
    background: rgba(30, 41, 59, 0.88);
    font-size: 22px;
}

.mobile-nav {
    display: none;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 12px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.98);
}

.mobile-nav.open {
    display: grid;
    gap: 4px;
}

main {
    overflow: hidden;
}

.hero-section {
    position: relative;
    min-height: 760px;
    padding-top: 68px;
    background: #020617;
}

.hero-carousel {
    position: relative;
    min-height: 760px;
}

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

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

.hero-slide img {
    width: 100%;
    height: 100%;
    min-height: 760px;
    object-fit: cover;
    transform: scale(1.04);
    filter: saturate(1.08) contrast(1.06);
}

.hero-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.72) 42%, rgba(2, 6, 23, 0.28)),
        linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.24) 42%, rgba(2, 6, 23, 0.52) 100%);
}

.hero-content {
    position: absolute;
    left: max(24px, calc((100vw - 1180px) / 2));
    bottom: 148px;
    width: min(640px, calc(100% - 48px));
}

.hero-label,
.eyebrow,
.page-hero p,
.section-title span {
    color: var(--emerald-bright);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-content h1 {
    margin: 16px 0 18px;
    font-size: clamp(38px, 7vw, 72px);
    line-height: 1.04;
    letter-spacing: -0.04em;
}

.hero-content p {
    margin: 0 0 22px;
    max-width: 58ch;
    color: #dbeafe;
    font-size: 18px;
    line-height: 1.78;
}

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

.hero-tags span,
.tag-row span,
.detail-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 11px;
    border: 1px solid rgba(52, 211, 153, 0.24);
    border-radius: 999px;
    color: #a7f3d0;
    background: rgba(16, 185, 129, 0.14);
    font-size: 13px;
}

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

.primary-btn,
.ghost-btn,
.search-panel button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 22px;
    border: 0;
    border-radius: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.primary-btn,
.search-panel button {
    color: #ffffff;
    background: linear-gradient(135deg, var(--emerald), var(--teal));
    box-shadow: 0 16px 38px rgba(16, 185, 129, 0.28);
}

.ghost-btn {
    color: #e2e8f0;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(12px);
}

.primary-btn:hover,
.ghost-btn:hover,
.search-panel button:hover {
    transform: translateY(-2px) scale(1.02);
}

.hero-controls {
    position: absolute;
    left: max(24px, calc((100vw - 1180px) / 2));
    bottom: 104px;
    display: flex;
    gap: 10px;
}

.hero-dot {
    width: 36px;
    height: 6px;
    border: 0;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.35);
    cursor: pointer;
    transition: width 0.25s ease, background 0.25s ease;
}

.hero-dot.active {
    width: 62px;
    background: linear-gradient(90deg, var(--emerald), var(--teal));
}

.search-panel {
    display: flex;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
}

.hero-search {
    position: absolute;
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%);
    width: min(760px, calc(100% - 32px));
}

.search-panel input {
    width: 100%;
    min-height: 46px;
    border: 0;
    outline: 0;
    border-radius: 12px;
    padding: 0 16px;
    color: #f8fafc;
    background: rgba(2, 6, 23, 0.74);
}

.search-panel input::placeholder {
    color: #64748b;
}

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

.section-rise {
    margin-top: -8px;
}

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

.section-title h2 {
    margin: 4px 0 0;
    font-size: clamp(26px, 4vw, 38px);
    line-height: 1.12;
}

.section-title a {
    color: var(--emerald-bright);
    font-weight: 700;
}

.compact-title {
    align-items: center;
    margin-bottom: 20px;
}

.compact-title h2 {
    font-size: 26px;
}

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

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

.movie-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.72);
    box-shadow: 0 18px 52px rgba(2, 6, 23, 0.26);
    transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(52, 211, 153, 0.38);
    box-shadow: 0 28px 70px rgba(2, 6, 23, 0.42);
}

.movie-cover {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.98);
}

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

.movie-card:hover .movie-cover img {
    transform: scale(1.06);
    opacity: 0.88;
}

.movie-play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #ffffff;
    background: rgba(16, 185, 129, 0.88);
    transform: translate(-50%, -50%) scale(0.78);
    opacity: 0;
    transition: opacity 0.28s ease, transform 0.28s ease;
}

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

.rank-index {
    position: absolute;
    left: 12px;
    top: 12px;
    z-index: 2;
    min-width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--emerald), var(--teal));
    box-shadow: 0 10px 24px rgba(16, 185, 129, 0.32);
}

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

.movie-meta {
    color: var(--emerald-bright);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
}

.movie-card h3 {
    margin: 0 0 10px;
    color: #f8fafc;
    font-size: 17px;
    line-height: 1.42;
}

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

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

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

.movie-card-compact h3 {
    font-size: 15px;
}

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

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

.category-card {
    position: relative;
    min-height: 160px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.72);
    box-shadow: 0 18px 52px rgba(2, 6, 23, 0.28);
}

.category-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.34;
    transition: transform 0.32s ease, opacity 0.32s ease;
}

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

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

.category-card span,
.category-card strong,
.category-card p {
    position: relative;
    z-index: 1;
}

.category-card span {
    color: var(--emerald-bright);
    font-size: 13px;
    font-weight: 800;
}

.category-card strong {
    margin-top: 5px;
    font-size: 20px;
}

.category-card p {
    color: #cbd5e1;
    line-height: 1.68;
}

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

.category-card.large {
    min-height: 260px;
}

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

.ranking-panel,
.prose-card,
.player-section,
.detail-hero,
.page-hero {
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 26px;
    background: rgba(15, 23, 42, 0.72);
    box-shadow: var(--shadow);
}

.ranking-panel {
    padding: 22px;
}

.ranking-list {
    display: grid;
    gap: 12px;
}

.ranking-item {
    display: grid;
    grid-template-columns: 38px 54px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: 16px;
    background: rgba(2, 6, 23, 0.38);
    transition: background 0.25s ease, transform 0.25s ease;
}

.ranking-item:hover {
    background: rgba(16, 185, 129, 0.12);
    transform: translateX(3px);
}

.ranking-number {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #a7f3d0;
    background: rgba(16, 185, 129, 0.14);
    font-weight: 900;
}

.ranking-item img {
    width: 54px;
    height: 74px;
    border-radius: 12px;
    object-fit: cover;
}

.ranking-content {
    min-width: 0;
    display: grid;
    gap: 6px;
}

.ranking-content strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-content em {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-main {
    padding-top: 96px;
}

.page-hero {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 54px;
    background:
        radial-gradient(circle at 16% 20%, rgba(16, 185, 129, 0.22), transparent 20rem),
        linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(2, 6, 23, 0.86));
}

.small-hero h1 {
    margin: 8px 0 14px;
    font-size: clamp(34px, 6vw, 56px);
}

.small-hero span {
    display: block;
    max-width: 780px;
    color: #cbd5e1;
    font-size: 17px;
    line-height: 1.76;
}

.list-search {
    margin-bottom: 28px;
}

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

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
    color: #94a3b8;
    font-size: 14px;
}

.breadcrumb a:hover {
    color: var(--emerald-bright);
}

.detail-hero {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 34px;
    padding: 28px;
    background:
        radial-gradient(circle at 0 0, rgba(16, 185, 129, 0.18), transparent 24rem),
        rgba(15, 23, 42, 0.78);
}

.detail-cover {
    overflow: hidden;
    border-radius: 24px;
    box-shadow: 0 24px 58px rgba(0, 0, 0, 0.38);
}

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

.detail-info {
    align-self: center;
}

.detail-info h1 {
    margin: 10px 0 18px;
    font-size: clamp(32px, 5vw, 56px);
    line-height: 1.12;
}

.detail-one-line {
    margin: 0 0 18px;
    color: #dbeafe;
    font-size: 18px;
    line-height: 1.76;
}

.detail-meta {
    margin-bottom: 18px;
}

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

.player-section {
    padding: 26px;
}

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

.site-video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000000;
    object-fit: contain;
}

.video-start {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 0;
    color: #ffffff;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.56), rgba(2, 6, 23, 0.12));
    cursor: pointer;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.video-start span {
    width: 84px;
    height: 84px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 34px;
    background: linear-gradient(135deg, var(--emerald), var(--teal));
    box-shadow: 0 18px 46px rgba(16, 185, 129, 0.38);
}

.video-shell.is-playing .video-start,
.video-shell.is-ready .video-start {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.prose-card {
    padding: 32px;
}

.prose-card h2 {
    margin: 0 0 14px;
    color: #f8fafc;
}

.prose-card h2:not(:first-child) {
    margin-top: 32px;
}

.prose-card p {
    margin: 0;
    color: #cbd5e1;
    font-size: 17px;
    line-height: 1.9;
}

.ranking-page-layout {
    grid-template-columns: 390px minmax(0, 1fr);
}

.sticky-panel {
    position: sticky;
    top: 92px;
    max-height: calc(100vh - 116px);
    overflow: auto;
}

.site-footer {
    margin-top: 86px;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.58);
}

.footer-wrap {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 46px 0;
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) 1fr 1fr;
    gap: 40px;
}

.footer-brand p,
.site-footer a,
.copyright {
    color: var(--muted);
}

.footer-brand p {
    max-width: 560px;
    line-height: 1.8;
}

.brand.compact .brand-mark {
    width: 38px;
    height: 38px;
}

.site-footer h2 {
    margin: 0 0 16px;
    font-size: 16px;
}

.site-footer ul {
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
    list-style: none;
}

.site-footer a:hover {
    color: var(--emerald-bright);
}

.copyright {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0 28px;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    text-align: center;
    font-size: 14px;
}

.movie-card.hidden-by-search,
.ranking-item.hidden-by-search {
    display: none;
}

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

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

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

    .sticky-panel {
        position: static;
        max-height: none;
    }
}

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

    .menu-toggle {
        display: block;
    }

    .hero-section,
    .hero-carousel,
    .hero-slide img {
        min-height: 680px;
    }

    .hero-content {
        bottom: 166px;
    }

    .hero-search {
        bottom: 34px;
    }

    .hero-controls {
        bottom: 118px;
    }

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

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

    .detail-cover {
        max-width: 360px;
    }

    .footer-wrap {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .nav-wrap {
        width: min(100% - 24px, 1180px);
    }

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

    .hero-content {
        left: 16px;
        width: calc(100% - 32px);
    }

    .hero-content p {
        font-size: 16px;
    }

    .hero-controls {
        left: 16px;
    }

    .search-panel {
        flex-direction: column;
    }

    .content-section,
    .page-hero,
    .detail-main,
    .footer-wrap,
    .copyright {
        width: calc(100% - 24px);
    }

    .page-hero,
    .detail-hero,
    .prose-card,
    .player-section,
    .ranking-panel {
        padding: 20px;
        border-radius: 22px;
    }

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

    .movie-card {
        border-radius: 20px;
    }

    .ranking-item {
        grid-template-columns: 34px 48px minmax(0, 1fr);
    }

    .ranking-item img {
        width: 48px;
        height: 66px;
    }
}
