:root {
    --bg: #080b16;
    --bg-soft: #101827;
    --panel: rgba(17, 24, 39, 0.86);
    --panel-strong: rgba(10, 15, 28, 0.96);
    --line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #9ca3af;
    --muted-strong: #cbd5e1;
    --primary: #ef4444;
    --primary-soft: rgba(239, 68, 68, 0.18);
    --accent: #f59e0b;
    --accent-soft: rgba(245, 158, 11, 0.18);
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --header-height: 72px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 10%, rgba(239, 68, 68, 0.18), transparent 34rem),
        radial-gradient(circle at 90% 18%, rgba(245, 158, 11, 0.14), transparent 28rem),
        linear-gradient(180deg, #070a14 0%, #0b1020 42%, #070a14 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

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

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

button,
input {
    font: inherit;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 80;
    background: rgba(8, 11, 22, 0.88);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
}

.header-inner {
    max-width: 1280px;
    height: var(--header-height);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: inline-grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 14px 34px rgba(239, 68, 68, 0.28);
}

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

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

.nav-link {
    padding: 10px 16px;
    color: var(--muted-strong);
    border-radius: 999px;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
}

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

.mobile-nav {
    display: none;
    padding: 0 24px 18px;
    border-top: 1px solid var(--line);
}

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

.mobile-nav-link {
    padding: 12px 14px;
    color: var(--muted-strong);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
}

.hero {
    position: relative;
    min-height: 72vh;
    margin-top: var(--header-height);
    overflow: hidden;
    background: #0b1020;
}

.hero-track,
.hero-slide,
.hero-image,
.hero-shade {
    position: absolute;
    inset: 0;
}

.hero-slide {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.55s ease, visibility 0.55s ease;
}

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

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.04);
    filter: saturate(1.05) contrast(1.05);
}

.hero-shade {
    background:
        linear-gradient(90deg, rgba(5, 8, 16, 0.95) 0%, rgba(5, 8, 16, 0.72) 42%, rgba(5, 8, 16, 0.18) 100%),
        linear-gradient(0deg, #080b16 0%, rgba(8, 11, 22, 0.12) 48%, rgba(8, 11, 22, 0.68) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 760px;
    min-height: 72vh;
    padding: 88px 24px 90px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-kicker,
.section-kicker {
    margin: 0 0 12px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

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

.hero-text {
    max-width: 680px;
    margin: 22px 0 0;
    color: var(--muted-strong);
    font-size: 18px;
}

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

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

.hero-tags span,
.detail-tags span,
.card-tags span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 22px;
    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: #fff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 20px 42px rgba(239, 68, 68, 0.28);
}

.btn-soft {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.hero-control {
    position: absolute;
    top: 50%;
    z-index: 5;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    color: #fff;
    background: rgba(8, 11, 22, 0.52);
    cursor: pointer;
    transform: translateY(-50%);
    backdrop-filter: blur(10px);
}

.hero-prev {
    left: 24px;
}

.hero-next {
    right: 24px;
}

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

.hero-dot {
    width: 10px;
    height: 10px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.34);
    cursor: pointer;
    transition: width 0.2s ease, background 0.2s ease;
}

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

.page-main {
    padding-top: var(--header-height);
}

.content-section {
    max-width: 1280px;
    margin: 0 auto;
    padding: 72px 24px;
}

.search-home {
    padding-top: 44px;
}

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

.section-heading h2,
.page-hero h1,
.detail-info h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(30px, 4vw, 54px);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.section-heading p,
.page-hero p,
.detail-line,
.story-block p {
    color: var(--muted-strong);
}

.section-heading p {
    max-width: 760px;
    margin: 10px 0 0;
}

.section-link {
    flex: 0 0 auto;
    color: var(--accent);
    font-weight: 800;
}

.search-panel {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.search-label {
    display: block;
    margin-bottom: 10px;
    color: var(--muted-strong);
    font-weight: 800;
}

.search-row {
    display: flex;
    gap: 12px;
}

.search-input {
    width: 100%;
    min-height: 50px;
    padding: 0 16px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    outline: none;
    background: rgba(255, 255, 255, 0.06);
}

.search-input:focus {
    border-color: rgba(245, 158, 11, 0.75);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.12);
}

.search-clear {
    min-width: 88px;
    color: #fff;
    border: 0;
    border-radius: 14px;
    background: var(--primary);
    cursor: pointer;
}

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

.movie-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(17, 24, 39, 0.82);
    box-shadow: 0 16px 44px 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(-6px);
    border-color: rgba(245, 158, 11, 0.48);
    box-shadow: 0 22px 58px rgba(0, 0, 0, 0.34);
}

.card-cover {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(135deg, #172033, #0f172a);
}

.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

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

.cover-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.72));
}

.card-badge,
.card-play {
    position: absolute;
    z-index: 2;
}

.card-badge {
    top: 12px;
    right: 12px;
    padding: 5px 9px;
    color: #fff;
    font-size: 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.62);
}

.card-play {
    left: 14px;
    bottom: 14px;
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    color: #fff;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
}

.card-body {
    padding: 16px;
}

.card-title {
    display: -webkit-box;
    min-height: 48px;
    overflow: hidden;
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.35;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

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

.card-meta {
    margin: 8px 0;
    color: var(--muted);
    font-size: 13px;
}

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

.card-tags span {
    min-height: 24px;
    padding: 3px 8px;
    color: var(--muted-strong);
    font-size: 12px;
}

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

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

.category-card {
    position: relative;
    min-height: 240px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: #111827;
    box-shadow: var(--shadow);
}

.category-card img,
.category-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.category-card img {
    object-fit: cover;
    transition: transform 0.35s ease;
}

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

.category-overlay {
    background: linear-gradient(180deg, rgba(8, 11, 22, 0.12), rgba(8, 11, 22, 0.92));
}

.category-name,
.category-desc {
    position: absolute;
    left: 22px;
    right: 22px;
    z-index: 2;
}

.category-name {
    bottom: 70px;
    font-size: 26px;
    font-weight: 900;
}

.category-desc {
    bottom: 24px;
    color: var(--muted-strong);
    font-size: 14px;
}

.page-hero {
    max-width: 1280px;
    margin: 0 auto;
    padding: 88px 24px 34px;
}

.compact-hero > div {
    padding: 44px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background:
        radial-gradient(circle at top right, rgba(239, 68, 68, 0.22), transparent 28rem),
        var(--panel);
    box-shadow: var(--shadow);
}

.breadcrumb {
    max-width: 1280px;
    margin: 0 auto;
    padding: 30px 24px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--muted);
    font-size: 14px;
}

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

.detail-hero {
    max-width: 1280px;
    margin: 0 auto;
    padding: 36px 24px 52px;
    display: grid;
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
    gap: 34px;
    align-items: center;
}

.detail-poster {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    background: #111827;
}

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

.detail-info {
    padding: 40px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background:
        linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(245, 158, 11, 0.08)),
        var(--panel);
    box-shadow: var(--shadow);
}

.detail-line {
    margin: 18px 0 0;
    font-size: 18px;
}

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

.detail-meta span {
    padding: 6px 11px;
    border-radius: 999px;
    color: var(--muted-strong);
    background: rgba(255, 255, 255, 0.07);
}

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

.player-section {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px 42px;
}

.player-shell {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: #000;
    box-shadow: var(--shadow);
}

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

.player-cover {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #fff;
    border: 0;
    background:
        radial-gradient(circle, rgba(239, 68, 68, 0.28), transparent 34%),
        rgba(0, 0, 0, 0.48);
    cursor: pointer;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.player-cover-icon {
    width: 76px;
    height: 76px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 20px 48px rgba(239, 68, 68, 0.34);
}

.player-cover-title {
    max-width: 80%;
    font-size: clamp(24px, 4vw, 44px);
    font-weight: 900;
    text-align: center;
}

.player-cover-text {
    color: var(--muted-strong);
}

.detail-copy {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    padding-top: 24px;
}

.story-block {
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
}

.story-block h2 {
    margin: 0 0 12px;
    color: #fff;
}

.story-block p {
    margin: 0;
}

.related-section {
    padding-top: 34px;
}

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

.ranking-list.large {
    gap: 14px;
}

.ranking-row {
    display: grid;
    grid-template-columns: 70px minmax(180px, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.ranking-row:hover {
    transform: translateX(4px);
    border-color: rgba(245, 158, 11, 0.5);
}

.rank-num {
    color: var(--accent);
    font-size: 24px;
    font-weight: 900;
}

.rank-title {
    color: #fff;
    font-weight: 800;
}

.rank-desc {
    display: none;
    color: var(--muted-strong);
    font-size: 14px;
}

.ranking-list.large .ranking-row {
    grid-template-columns: 70px minmax(160px, 0.9fr) minmax(260px, 1.4fr) auto;
}

.ranking-list.large .rank-desc {
    display: block;
}

.rank-meta {
    color: var(--muted);
    font-size: 14px;
    text-align: right;
}

.no-results {
    display: none;
    margin: 24px 0 0;
    padding: 18px;
    color: var(--muted-strong);
    text-align: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel);
}

.no-results.is-visible {
    display: block;
}

.site-footer {
    border-top: 1px solid var(--line);
    background: rgba(8, 11, 22, 0.92);
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.footer-brand p {
    max-width: 620px;
    margin: 14px 0 0;
    color: var(--muted);
}

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

.footer-links a {
    color: var(--muted-strong);
}

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

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

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

    .ranking-list.large .ranking-row {
        grid-template-columns: 60px minmax(160px, 1fr) auto;
    }

    .ranking-list.large .rank-desc {
        display: none;
    }
}

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

    .nav-toggle {
        display: block;
    }

    .hero-control {
        display: none;
    }

    .hero-content {
        padding: 72px 24px 84px;
    }

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

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

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

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

    .detail-info {
        padding: 28px;
    }

    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .ranking-row,
    .ranking-list.large .ranking-row {
        grid-template-columns: 48px 1fr;
    }

    .rank-meta {
        grid-column: 2;
        text-align: left;
    }
}

@media (max-width: 560px) {
    :root {
        --header-height: 64px;
    }

    .header-inner {
        height: var(--header-height);
        padding: 0 16px;
    }

    .brand-icon {
        width: 34px;
        height: 34px;
        border-radius: 12px;
    }

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

    .content-section,
    .page-hero,
    .detail-hero,
    .player-section,
    .breadcrumb {
        padding-left: 16px;
        padding-right: 16px;
    }

    .content-section {
        padding-top: 46px;
        padding-bottom: 46px;
    }

    .compact-hero > div {
        padding: 28px;
    }

    .hero {
        min-height: 76vh;
    }

    .hero-content {
        min-height: 76vh;
    }

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

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

    .search-clear {
        min-height: 46px;
    }

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

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

    .player-cover-icon {
        width: 58px;
        height: 58px;
    }
}
