:root {
    color-scheme: dark;
    --bg: #020617;
    --panel: rgba(15, 23, 42, 0.86);
    --panel-strong: #0f172a;
    --panel-soft: rgba(30, 41, 59, 0.72);
    --line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --accent: #10b981;
    --accent-2: #38bdf8;
    --accent-3: #a855f7;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 18% 8%, rgba(16, 185, 129, 0.18), transparent 28rem),
        radial-gradient(circle at 84% 0%, rgba(56, 189, 248, 0.12), transparent 24rem),
        linear-gradient(180deg, #020617 0%, #0f172a 46%, #020617 100%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

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

button,
input,
select {
    font: inherit;
}

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

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

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    letter-spacing: -0.04em;
    white-space: nowrap;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #00140d;
    box-shadow: 0 16px 36px rgba(16, 185, 129, 0.32);
}

.brand-text {
    font-size: 1.24rem;
}

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

.nav-link {
    padding: 9px 14px;
    border-radius: 999px;
    color: var(--soft);
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #fff;
    background: rgba(16, 185, 129, 0.15);
}

.header-search {
    width: min(310px, 28vw);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.82);
}

.header-search input,
.search-panel input,
.filter-bar input,
.filter-bar select {
    min-width: 0;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
}

.header-search input {
    flex: 1;
    padding: 8px 10px;
}

.header-search button,
.search-panel button,
.hero-button,
.text-button,
.play-overlay button {
    border: 0;
    cursor: pointer;
    color: #04130f;
    font-weight: 800;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 16px 34px rgba(16, 185, 129, 0.24);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.header-search button {
    padding: 8px 14px;
}

.header-search button:hover,
.search-panel button:hover,
.hero-button:hover,
.text-button:hover,
.play-overlay button:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 42px rgba(56, 189, 248, 0.26);
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.72);
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 5px auto;
    background: var(--text);
    border-radius: 4px;
}

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

.hero {
    position: relative;
    min-height: 620px;
    margin: 30px auto 46px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 34px;
    background: rgba(15, 23, 42, 0.72);
    box-shadow: var(--shadow);
}

.hero-slide {
    display: none;
    min-height: 620px;
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    gap: 42px;
    padding: clamp(26px, 4vw, 62px);
}

.hero-slide.is-active {
    display: grid;
}

.hero-media {
    position: relative;
    min-height: 460px;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(56, 189, 248, 0.12));
}

.hero-media img {
    width: 100%;
    height: 100%;
    min-height: 460px;
    object-fit: cover;
    transform: scale(1.02);
}

.hero-media::after,
.poster-frame::after,
.detail-poster::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 38%, rgba(0, 0, 0, 0.76));
    pointer-events: none;
}

.hero-kicker,
.section-kicker {
    color: var(--accent);
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero h1 {
    max-width: 760px;
    margin: 14px 0 18px;
    font-size: clamp(2.45rem, 5.2vw, 5.25rem);
    line-height: 0.98;
    letter-spacing: -0.08em;
}

.hero p {
    max-width: 710px;
    color: var(--soft);
    font-size: clamp(1rem, 1.6vw, 1.24rem);
    line-height: 1.9;
}

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

.hero-button,
.text-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 22px;
}

.hero-button.secondary,
.text-button.secondary {
    color: var(--text);
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid var(--line);
    box-shadow: none;
}

.hero-meta,
.detail-meta,
.card-meta,
.breadcrumb,
.rank-info em {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--muted);
}

.hero-meta span,
.detail-meta span,
.card-tags span,
.category-chip-row a {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.62);
    color: var(--soft);
    font-size: 0.86rem;
}

.category-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.category-chip-row a:hover {
    color: #fff;
    border-color: rgba(16, 185, 129, 0.55);
    background: rgba(16, 185, 129, 0.18);
}

.hero-controls {
    position: absolute;
    right: 28px;
    bottom: 28px;
    display: flex;
    gap: 8px;
}

.hero-dot {
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: 999px;
    background: rgba(203, 213, 225, 0.42);
    cursor: pointer;
}

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

.search-panel,
.filter-bar,
.section-panel,
.detail-panel,
.player-shell,
.category-summary,
.rank-board {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: 0 20px 58px rgba(0, 0, 0, 0.22);
}


.section-panel {
    margin: 28px 0;
    padding: clamp(20px, 3vw, 30px);
}

.search-panel {
    margin: -18px 0 44px;
    padding: clamp(18px, 3vw, 28px);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
}

.search-panel input {
    width: 100%;
    min-height: 54px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.48);
}

.search-panel button {
    min-width: 120px;
    padding: 0 22px;
}

.section {
    margin: 54px 0;
}

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

.section-title h2,
.page-title h1,
.detail-title h1 {
    margin: 6px 0 0;
    font-size: clamp(1.85rem, 3vw, 3.1rem);
    line-height: 1.08;
    letter-spacing: -0.06em;
}

.section-title p,
.page-title p,
.category-summary p,
.detail-title p {
    max-width: 760px;
    color: var(--muted);
    line-height: 1.9;
}

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

.movie-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.74);
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.24);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 24px 70px rgba(16, 185, 129, 0.12);
}

.poster-frame {
    position: relative;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.18), rgba(56, 189, 248, 0.12));
}

.poster-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

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

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

.poster-badge {
    top: 12px;
    right: 12px;
    padding: 5px 9px;
    border-radius: 999px;
    color: #fff;
    background: rgba(2, 6, 23, 0.76);
    font-size: 0.78rem;
    backdrop-filter: blur(8px);
}

.poster-play {
    left: 50%;
    top: 50%;
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #04130f;
    background: rgba(16, 185, 129, 0.92);
    transform: translate(-50%, -50%) scale(0.86);
    opacity: 0;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

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

.card-body {
    padding: 15px;
}

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

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

.card-meta {
    margin: 8px 0;
    font-size: 0.84rem;
}

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

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.card-tags span {
    min-height: 24px;
    font-size: 0.78rem;
}

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

.category-card {
    min-height: 210px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid var(--line);
    border-radius: 24px;
    background:
        linear-gradient(140deg, rgba(16, 185, 129, 0.14), rgba(56, 189, 248, 0.06)),
        rgba(15, 23, 42, 0.78);
    transition: transform 0.22s ease, border-color 0.22s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: rgba(16, 185, 129, 0.46);
}

.category-card h3 {
    margin: 0 0 10px;
    font-size: 1.3rem;
    font-weight: 900;
}

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

.page-title {
    padding: 44px 0 24px;
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    gap: 12px;
    margin: 10px 0 28px;
    padding: 14px;
}

.filter-bar input,
.filter-bar select {
    width: 100%;
    min-height: 48px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(2, 6, 23, 0.45);
}

.rank-layout {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 28px;
}

.rank-board {
    padding: 18px;
}

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

.rank-item {
    display: grid;
    grid-template-columns: 48px 54px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.38);
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.rank-item:hover {
    transform: translateX(4px);
    border-color: rgba(16, 185, 129, 0.45);
}

.rank-num {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    color: #04130f;
    font-weight: 900;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

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

.rank-info {
    min-width: 0;
}

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

.rank-info em {
    margin-top: 4px;
    font-style: normal;
    font-size: 0.86rem;
}

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

.breadcrumb {
    padding: 28px 0 10px;
    font-size: 0.92rem;
}

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

.detail-hero {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    gap: 34px;
    align-items: end;
    margin: 20px 0 34px;
}

.detail-poster {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    box-shadow: var(--shadow);
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.18), rgba(56, 189, 248, 0.1));
}

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

.detail-title h1 {
    margin-bottom: 18px;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.detail-tags span {
    padding: 7px 12px;
    border-radius: 999px;
    color: var(--soft);
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.22);
}

.player-shell {
    margin: 24px 0 34px;
    padding: clamp(14px, 2vw, 22px);
}

.video-box {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    background: #000;
    aspect-ratio: 16 / 9;
}

.video-box video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
    cursor: pointer;
}

.play-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at center, rgba(16, 185, 129, 0.17), rgba(2, 6, 23, 0.82));
    cursor: pointer;
}

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

.play-overlay button {
    min-width: 164px;
    min-height: 56px;
    font-size: 1.05rem;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 28px;
    margin-bottom: 52px;
}

.detail-panel {
    padding: clamp(22px, 3vw, 34px);
}

.detail-panel h2 {
    margin: 0 0 14px;
    font-size: 1.55rem;
    font-weight: 900;
}

.detail-panel p {
    color: var(--soft);
    line-height: 1.95;
}

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

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

.footer-inner {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    color: var(--muted);
}

.footer-inner p {
    max-width: 620px;
    line-height: 1.75;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

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

.copyright {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 16px 0 28px;
    color: var(--muted);
    border-top: 1px solid var(--line);
}

.empty-state {
    display: none;
    padding: 48px;
    text-align: center;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.72);
}

.empty-state.is-visible {
    display: block;
}

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

    .hero-slide,
    .rank-layout,
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .hero-media {
        order: -1;
    }
}

@media (max-width: 860px) {
    .header-inner {
        min-height: 66px;
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 0;
    }

    .nav-toggle {
        display: block;
        margin-left: auto;
    }

    .main-nav {
        display: none;
        width: 100%;
        order: 4;
        margin: 0;
        padding: 10px;
        border: 1px solid var(--line);
        border-radius: 18px;
        background: rgba(15, 23, 42, 0.94);
    }

    .main-nav.is-open {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .header-search {
        width: 100%;
        order: 5;
    }

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

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

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

@media (max-width: 640px) {
    main,
    .header-inner,
    .footer-inner,
    .copyright {
        width: min(100% - 22px, 1240px);
    }

    .hero {
        min-height: auto;
        border-radius: 24px;
    }

    .hero-slide {
        min-height: auto;
        padding: 20px;
    }

    .hero-media,
    .hero-media img {
        min-height: 300px;
    }

    .hero-controls {
        position: static;
        padding: 0 20px 20px;
    }

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

    .card-body {
        padding: 12px;
    }

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

    .section-head,
    .footer-inner {
        display: block;
    }

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

    .rank-score {
        display: none;
    }
}
