:root {
    color-scheme: dark;
    --bg: #020617;
    --panel: #0f172a;
    --panel-soft: rgba(15, 23, 42, 0.72);
    --panel-strong: rgba(15, 23, 42, 0.94);
    --line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --accent: #f59e0b;
    --accent-2: #fbbf24;
    --danger: #ef4444;
    --radius: 22px;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(245, 158, 11, 0.20), transparent 28rem),
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.18), transparent 30rem),
        linear-gradient(180deg, #020617 0%, #0f172a 46%, #020617 100%);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body.no-scroll {
    overflow: hidden;
}

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

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

button,
input {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--line);
    background: rgba(2, 6, 23, 0.82);
    backdrop-filter: blur(18px);
}

.header-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0.9rem 1.5rem;
    display: grid;
    grid-template-columns: auto 1fr minmax(18rem, 26rem);
    gap: 1.4rem;
    align-items: center;
}

.site-logo,
.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: #fff;
}

.logo-mark {
    width: 2.2rem;
    height: 2.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), #ef4444);
    color: #111827;
    box-shadow: 0 12px 32px rgba(245, 158, 11, 0.28);
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.nav-link {
    padding: 0.65rem 1rem;
    border-radius: 999px;
    color: var(--soft);
    transition: 0.25s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #fff;
    background: rgba(245, 158, 11, 0.16);
}

.header-search input,
.site-search {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.8rem 1.1rem;
    color: #fff;
    background: rgba(15, 23, 42, 0.84);
    outline: none;
    transition: 0.25s ease;
}

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

.menu-toggle {
    display: none;
    width: 2.6rem;
    height: 2.6rem;
    border: 1px solid var(--line);
    border-radius: 0.85rem;
    background: rgba(15, 23, 42, 0.88);
    color: #fff;
}

.menu-toggle span {
    display: block;
    width: 1.2rem;
    height: 2px;
    margin: 0.28rem auto;
    border-radius: 999px;
    background: currentColor;
}

.hero {
    position: relative;
    min-height: clamp(34rem, 78vh, 48rem);
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

.hero-slider,
.hero-slide {
    position: absolute;
    inset: 0;
}

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

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

.hero-bg {
    position: absolute;
    inset: 0;
    height: 100%;
    object-fit: cover;
    filter: blur(1px) saturate(1.12);
    transform: scale(1.06);
    opacity: 0.44;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.95) 0%, rgba(2, 6, 23, 0.70) 46%, rgba(2, 6, 23, 0.34) 100%),
        linear-gradient(180deg, rgba(2, 6, 23, 0.30) 0%, #020617 100%);
}

.hero-content {
    position: relative;
    max-width: 1440px;
    height: 100%;
    margin: 0 auto;
    padding: 5.5rem 1.5rem 7rem;
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(18rem, 0.64fr);
    gap: clamp(2rem, 5vw, 5rem);
    align-items: center;
}

.hero-copy {
    max-width: 52rem;
}

.eyebrow,
.section-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border: 1px solid rgba(245, 158, 11, 0.36);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    color: var(--accent-2);
    background: rgba(245, 158, 11, 0.10);
    font-size: 0.85rem;
    font-weight: 700;
}

.hero h1,
.page-hero h1,
.detail-info h1 {
    margin: 1rem 0 1rem;
    font-size: clamp(2.5rem, 7vw, 6rem);
    line-height: 0.95;
    letter-spacing: -0.07em;
}

.hero p,
.page-hero p,
.detail-one-line {
    color: var(--soft);
    font-size: clamp(1rem, 2vw, 1.25rem);
    line-height: 1.8;
}

.hero-tags,
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 1.5rem 0;
}

.hero-tags span,
.detail-meta span {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.45rem 0.8rem;
    color: #fff;
    background: rgba(15, 23, 42, 0.72);
}

.hero-actions,
.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 1.5rem;
}

.primary-btn,
.secondary-btn,
.section-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.9rem;
    border: 0;
    border-radius: 999px;
    padding: 0.78rem 1.25rem;
    cursor: pointer;
    transition: 0.25s ease;
    font-weight: 800;
}

.primary-btn {
    color: #111827;
    background: linear-gradient(135deg, var(--accent-2), var(--accent));
    box-shadow: 0 14px 32px rgba(245, 158, 11, 0.24);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 42px rgba(245, 158, 11, 0.34);
}

.secondary-btn,
.section-link {
    border: 1px solid var(--line);
    color: #fff;
    background: rgba(15, 23, 42, 0.70);
}

.secondary-btn:hover,
.section-link:hover {
    border-color: rgba(245, 158, 11, 0.55);
    color: var(--accent-2);
}

.hero-poster,
.page-hero-poster {
    position: relative;
    width: min(23rem, 100%);
    justify-self: end;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 2rem;
    padding: 0.55rem;
    background: rgba(15, 23, 42, 0.62);
    box-shadow: var(--shadow);
    transform: rotate(2deg);
    transition: 0.35s ease;
}

.hero-poster:hover,
.page-hero-poster:hover {
    transform: rotate(0deg) translateY(-0.4rem);
}

.hero-poster img,
.page-hero-poster img {
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 1.55rem;
}

.hero-bottom {
    position: absolute;
    left: 50%;
    bottom: 1.4rem;
    z-index: 5;
    width: min(1440px, calc(100% - 3rem));
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.hero-dots,
.hero-category-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.hero-dot {
    width: 2.1rem;
    height: 0.45rem;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.26);
    cursor: pointer;
}

.hero-dot.active {
    width: 3.5rem;
    background: var(--accent);
}

.hero-category-links a {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.55rem 0.85rem;
    color: #fff;
    background: rgba(15, 23, 42, 0.76);
}

.content-section {
    max-width: 1440px;
    margin: 0 auto;
    padding: clamp(2.5rem, 5vw, 4.5rem) 1.5rem;
}

.search-panel {
    margin-top: -3.4rem;
    position: relative;
    z-index: 8;
}

.search-panel-inner,
.page-hero,
.detail-hero,
.detail-content,
.category-card,
.movie-card {
    border: 1px solid var(--line);
    background: var(--panel-soft);
    backdrop-filter: blur(18px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
}

.search-panel-inner {
    border-radius: var(--radius);
    padding: clamp(1.4rem, 3vw, 2.2rem);
    display: grid;
    grid-template-columns: 0.8fr 1fr;
    gap: 1.2rem;
    align-items: center;
}

.search-panel-inner h2 {
    margin: 0;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.search-panel-inner p {
    margin: 0.6rem 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.wide-search {
    min-height: 3.2rem;
}

.filter-bar {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.filter-chip {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.62rem 0.95rem;
    color: var(--soft);
    background: rgba(15, 23, 42, 0.72);
    cursor: pointer;
    transition: 0.22s ease;
}

.filter-chip:hover,
.filter-chip.active {
    border-color: rgba(245, 158, 11, 0.58);
    color: #111827;
    background: var(--accent-2);
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.4rem;
}

.section-heading h2 {
    margin: 0.7rem 0 0;
    font-size: clamp(1.8rem, 3vw, 3rem);
    letter-spacing: -0.05em;
}

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

.category-card {
    border-radius: var(--radius);
    overflow: hidden;
    transition: 0.25s ease;
}

.category-card:hover,
.movie-card:hover {
    transform: translateY(-0.35rem);
    border-color: rgba(245, 158, 11, 0.48);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.category-card-main {
    display: block;
    padding: 1.4rem;
}

.category-icon {
    width: 2.4rem;
    height: 2.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.85rem;
    color: #111827;
    background: var(--accent-2);
}

.category-card h2 {
    margin: 0.95rem 0 0.55rem;
    font-size: 1.35rem;
}

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

.category-samples {
    border-top: 1px solid var(--line);
    padding: 1rem 1.4rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.category-samples a {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-radius: 999px;
    padding: 0.45rem 0.7rem;
    color: var(--soft);
    background: rgba(15, 23, 42, 0.72);
}

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

.movie-card {
    position: relative;
    overflow: hidden;
    border-radius: 1.25rem;
    transition: 0.25s ease;
}

.movie-card.is-hidden {
    display: none;
}

.poster-link {
    position: relative;
    display: block;
    overflow: hidden;
    background: #111827;
}

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

.movie-card:hover .poster-link img {
    transform: scale(1.06);
    opacity: 0.86;
}

.poster-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(2, 6, 23, 0.92) 100%);
}

.play-chip,
.rank-badge {
    position: absolute;
    z-index: 2;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 900;
}

.play-chip {
    right: 0.7rem;
    bottom: 0.7rem;
    padding: 0.42rem 0.7rem;
    color: #111827;
    background: var(--accent-2);
}

.rank-badge {
    top: 0.65rem;
    left: 0.65rem;
    min-width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #111827;
    background: linear-gradient(135deg, var(--accent-2), var(--accent));
    box-shadow: 0 10px 22px rgba(245, 158, 11, 0.26);
}

.card-body {
    padding: 0.95rem;
}

.meta-line {
    display: flex;
    gap: 0.35rem;
    color: var(--muted);
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meta-line span:not(:last-child)::after {
    content: "·";
    margin-left: 0.35rem;
    color: rgba(148, 163, 184, 0.54);
}

.card-body h3 {
    margin: 0.55rem 0 0.5rem;
    font-size: 1.02rem;
    line-height: 1.3;
}

.card-body h3 a:hover {
    color: var(--accent-2);
}

.card-body p {
    min-height: 3.6em;
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.8rem;
}

.tag {
    border: 1px solid rgba(245, 158, 11, 0.20);
    border-radius: 999px;
    padding: 0.25rem 0.5rem;
    color: var(--accent-2);
    background: rgba(245, 158, 11, 0.09);
    font-size: 0.76rem;
}

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

.compact-card {
    display: grid;
    grid-template-columns: 6.2rem 1fr;
}

.compact-card .poster-link img {
    height: 100%;
}

.compact-card .card-body p {
    -webkit-line-clamp: 3;
}

.sub-page {
    padding-top: 1rem;
}

.page-hero {
    max-width: 1440px;
    margin: 1.4rem auto 0;
    border-radius: 2rem;
    padding: clamp(2rem, 5vw, 4rem);
}

.small-hero {
    min-height: 20rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background:
        radial-gradient(circle at right, rgba(245, 158, 11, 0.18), transparent 30rem),
        rgba(15, 23, 42, 0.72);
}

.category-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(14rem, 20rem);
    gap: 2rem;
    align-items: center;
}

.compact-actions {
    margin-top: 1rem;
}

.toolbar-line {
    display: grid;
    grid-template-columns: minmax(16rem, 1fr) auto;
    gap: 1rem;
    align-items: start;
    margin-bottom: 1.3rem;
}

.toolbar-line .filter-bar {
    grid-column: auto;
    justify-content: flex-end;
}

.detail-page {
    max-width: 1440px;
    margin: 0 auto;
    padding: 1.4rem 1.5rem 0;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    color: var(--muted);
    padding: 1rem 0;
}

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

.detail-hero {
    border-radius: 2rem;
    padding: clamp(1rem, 2.5vw, 1.6rem);
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(20rem, 0.8fr);
    gap: 1.6rem;
    align-items: stretch;
}

.player-card {
    min-width: 0;
}

.video-shell {
    position: relative;
    overflow: hidden;
    border-radius: 1.5rem;
    background: #000;
    aspect-ratio: 16 / 9;
}

.video-shell video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: pointer;
    z-index: 1;
}

.player-button {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    color: #111827;
    background: radial-gradient(circle, rgba(2, 6, 23, 0.08), rgba(2, 6, 23, 0.52));
    cursor: pointer;
}

.player-button span {
    width: 5.5rem;
    height: 5.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding-left: 0.35rem;
    font-size: 2rem;
    background: linear-gradient(135deg, var(--accent-2), var(--accent));
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.48);
}

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

.detail-info {
    padding: clamp(1rem, 2.5vw, 1.6rem);
}

.detail-info h1 {
    font-size: clamp(2rem, 4.6vw, 4rem);
}

.detail-content {
    border-radius: 2rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.34fr);
    gap: 1.4rem;
}

.detail-text,
.detail-side {
    padding: clamp(1rem, 2.5vw, 1.6rem);
}

.detail-text h2,
.detail-side h2 {
    margin: 0 0 0.9rem;
    font-size: 1.35rem;
}

.detail-text p {
    margin: 0 0 1.4rem;
    color: var(--soft);
    line-height: 2;
}

.detail-side dl {
    margin: 0;
}

.detail-side div {
    display: grid;
    grid-template-columns: 4rem 1fr;
    gap: 1rem;
    border-bottom: 1px solid var(--line);
    padding: 0.8rem 0;
}

.detail-side dt {
    color: var(--muted);
}

.detail-side dd {
    margin: 0;
    color: #fff;
}

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

.footer-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: flex;
    justify-content: space-between;
    gap: 2rem;
}

.footer-inner p {
    max-width: 38rem;
    color: var(--muted);
    line-height: 1.8;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

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

.footer-bottom {
    border-top: 1px solid var(--line);
    padding: 1rem 1.5rem;
    text-align: center;
    color: var(--muted);
}

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

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

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

@media (max-width: 900px) {
    .header-inner {
        grid-template-columns: auto auto;
    }

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

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

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

    .nav-links.is-open {
        flex-direction: column;
        align-items: stretch;
    }

    .hero {
        min-height: 44rem;
    }

    .hero-content,
    .category-hero,
    .detail-hero,
    .detail-content,
    .search-panel-inner,
    .toolbar-line {
        grid-template-columns: 1fr;
    }

    .hero-content {
        padding-top: 4rem;
        padding-bottom: 9rem;
    }

    .hero-poster,
    .page-hero-poster {
        justify-self: start;
        width: min(16rem, 70vw);
    }

    .hero-bottom {
        align-items: flex-start;
        flex-direction: column;
    }

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

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

    .toolbar-line .filter-bar {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .header-inner,
    .content-section,
    .detail-page {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .hero h1,
    .page-hero h1,
    .detail-info h1 {
        letter-spacing: -0.05em;
    }

    .hero-actions,
    .detail-actions {
        flex-direction: column;
    }

    .primary-btn,
    .secondary-btn {
        width: 100%;
    }

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

    .compact-card {
        grid-template-columns: 1fr;
    }

    .card-body {
        padding: 0.8rem;
    }

    .detail-side div {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .footer-inner {
        flex-direction: column;
    }

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