* {
    box-sizing: border-box;
}

:root {
    color-scheme: dark;
    --bg: #020617;
    --bg-soft: #0f172a;
    --bg-card: #1e293b;
    --bg-card-strong: #111827;
    --line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --muted-strong: #cbd5e1;
    --accent: #10b981;
    --accent-strong: #059669;
    --cyan: #22d3ee;
    --rose: #fb7185;
    --shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(180deg, #020617 0%, #0f172a 42%, #020617 100%);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

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

button,
input,
select {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.96));
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(18px);
}

.nav-shell {
    width: min(1280px, calc(100% - 32px));
    height: 68px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 22px;
}

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

.brand span,
.footer-brand span {
    font-size: 24px;
    background: linear-gradient(90deg, #34d399, #22d3ee);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    fill: none;
    stroke: #34d399;
    stroke-width: 3;
    stroke-linejoin: round;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 28px;
    margin-left: 12px;
}

.desktop-nav > a,
.nav-dropdown > button {
    color: #e2e8f0;
    border: 0;
    background: transparent;
    padding: 22px 0;
    cursor: pointer;
    transition: color 0.2s ease;
}

.desktop-nav > a:hover,
.desktop-nav > a.active,
.nav-dropdown:hover > button {
    color: #34d399;
}

.nav-dropdown {
    position: relative;
}

.dropdown-panel {
    position: absolute;
    top: calc(100% - 6px);
    left: -18px;
    width: 190px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.98);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
}

.nav-dropdown:hover .dropdown-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-panel a,
.mobile-panel a {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    color: #cbd5e1;
}

.dropdown-panel a:hover,
.mobile-panel a:hover {
    background: rgba(51, 65, 85, 0.86);
    color: #34d399;
}

.search-form {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 300px;
}

.search-form input {
    width: 100%;
    min-width: 0;
    border: 1px solid transparent;
    border-radius: 999px;
    background: rgba(51, 65, 85, 0.85);
    color: #fff;
    outline: none;
    padding: 10px 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-form input:focus {
    border-color: rgba(52, 211, 153, 0.65);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}

.search-form button,
.button-primary,
.button-light,
.filter-button {
    border: 0;
    cursor: pointer;
    white-space: nowrap;
}

.search-form button {
    border-radius: 999px;
    padding: 10px 16px;
    color: #fff;
    background: linear-gradient(135deg, #10b981, #0891b2);
}

.menu-button {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: rgba(51, 65, 85, 0.8);
    padding: 10px;
}

.menu-button span {
    display: block;
    height: 2px;
    margin: 5px 0;
    background: #e2e8f0;
    border-radius: 4px;
}

.mobile-panel {
    display: none;
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 0 0 18px;
    border-top: 1px solid var(--line);
}

.mobile-panel.is-open {
    display: block;
}

.mobile-search {
    margin: 16px 0;
    min-width: 0;
}

.hero {
    position: relative;
    height: 600px;
    overflow: hidden;
    background: #020617;
}

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

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

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.04);
    transition: transform 6s ease;
}

.hero-slide.is-active img {
    transform: scale(1.11);
}

.hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(2, 6, 23, 0.98), rgba(2, 6, 23, 0.82) 45%, rgba(2, 6, 23, 0.1));
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(1280px, calc(100% - 32px));
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
}

.hero-copy {
    width: min(680px, 100%);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    color: #34d399;
    font-weight: 700;
}

.eyebrow::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #34d399;
    box-shadow: 0 0 20px rgba(52, 211, 153, 0.72);
}

.hero h1 {
    margin: 0 0 22px;
    font-size: clamp(44px, 7vw, 72px);
    line-height: 0.96;
    letter-spacing: -0.05em;
}

.hero p {
    max-width: 640px;
    margin: 0 0 30px;
    color: #cbd5e1;
    font-size: 20px;
    line-height: 1.7;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
}

.hero-tags span,
.tag-row span,
.info-chip,
.solid-tags span {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    color: #cbd5e1;
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.hero-tags span {
    padding: 6px 12px;
}

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

.button-primary,
.button-light,
.button-ghost,
.text-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.button-primary {
    padding: 15px 26px;
    color: #fff;
    background: linear-gradient(135deg, #10b981, #0891b2);
    box-shadow: 0 16px 42px rgba(16, 185, 129, 0.26);
}

.button-light {
    padding: 14px 24px;
    color: #047857;
    background: #fff;
}

.button-ghost {
    padding: 13px 22px;
    color: #e2e8f0;
    border: 1px solid rgba(226, 232, 240, 0.2);
    background: rgba(15, 23, 42, 0.4);
}

.button-primary:hover,
.button-light:hover,
.button-ghost:hover,
.text-link:hover {
    transform: translateY(-2px) scale(1.02);
}

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

.hero-dot {
    width: 34px;
    height: 6px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.32);
    cursor: pointer;
}

.hero-dot.is-active {
    background: #34d399;
}

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

.section.compact {
    padding-top: 44px;
}

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

.section-heading h2,
.page-heading h1,
.detail-title h1 {
    margin: 0;
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1.12;
    letter-spacing: -0.035em;
}

.section-heading p,
.page-heading p {
    max-width: 720px;
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

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

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

.movie-card,
.wide-card,
.category-card,
.detail-panel,
.search-panel,
.rank-board {
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98));
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
}

.movie-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(52, 211, 153, 0.36);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.36);
}

.poster-link {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #0f172a;
}

.compact-card .poster-link {
    aspect-ratio: 2 / 3;
}

.poster-link img,
.wide-cover img,
.category-strip img,
.detail-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.movie-card:hover .poster-link img,
.wide-card:hover .wide-cover img,
.category-card:hover .category-strip img {
    transform: scale(1.1);
}

.card-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 20%, rgba(0, 0, 0, 0.82));
    opacity: 0;
    transition: opacity 0.25s ease;
}

.movie-card:hover .card-gradient {
    opacity: 1;
}

.play-mark {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 58px;
    height: 58px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.94);
    transform: translate(-50%, -50%) scale(0.88);
    opacity: 0;
    transition: all 0.25s ease;
    box-shadow: 0 20px 50px rgba(16, 185, 129, 0.34);
}

.play-mark::after {
    content: "";
    position: absolute;
    left: 22px;
    top: 17px;
    width: 0;
    height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-left: 18px solid #fff;
}

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

.pill,
.rank-badge {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.top-left {
    left: 12px;
    top: 12px;
    padding: 6px 10px;
    color: #fff;
    background: rgba(16, 185, 129, 0.94);
}

.rank-badge {
    right: 12px;
    top: 12px;
    padding: 6px 10px;
    color: #0f172a;
    background: #fde047;
}

.card-body {
    padding: 18px;
}

.card-body h2 {
    margin: 0 0 10px;
    min-height: 56px;
    font-size: 19px;
    line-height: 1.45;
}

.compact-card .card-body h2 {
    min-height: auto;
    font-size: 16px;
}

.card-body h2 a:hover,
.wide-content h2 a:hover,
.detail-links a:hover {
    color: #34d399;
}

.card-body p,
.wide-content p,
.detail-panel p,
.article-text {
    color: var(--muted-strong);
    line-height: 1.75;
}

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

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: #94a3b8;
    font-size: 13px;
}

.meta-row span:not(:last-child)::after {
    content: "·";
    margin-left: 8px;
    color: rgba(148, 163, 184, 0.55);
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.tag-row span {
    padding: 5px 9px;
    font-size: 12px;
}

.wide-list {
    display: grid;
    gap: 22px;
}

.wide-card {
    display: grid;
    grid-template-columns: 320px 1fr;
}

.wide-cover {
    position: relative;
    min-height: 210px;
    overflow: hidden;
}

.wide-content {
    padding: 26px;
}

.wide-content h2 {
    margin: 0 0 12px;
    font-size: 28px;
}

.text-link {
    margin-top: 20px;
    padding: 10px 18px;
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.26);
    background: rgba(16, 185, 129, 0.08);
}

.category-band {
    background: linear-gradient(90deg, rgba(30, 41, 59, 0.86), rgba(15, 23, 42, 0.96));
}

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

.category-card {
    display: block;
    position: relative;
    min-height: 220px;
    padding: 22px;
    isolation: isolate;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.category-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 24px 62px rgba(0, 0, 0, 0.36);
}

.category-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background: linear-gradient(135deg, var(--from), var(--to));
}

.category-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.04), rgba(2, 6, 23, 0.42));
}

.category-card h2 {
    margin: 0 0 10px;
    font-size: 26px;
}

.category-card p {
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.65;
}

.category-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 28px;
}

.category-strip span {
    display: block;
    aspect-ratio: 16 / 10;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
}

.cta-panel {
    border-radius: 28px;
    padding: clamp(34px, 6vw, 64px);
    text-align: center;
    background: linear-gradient(135deg, #059669, #0891b2);
    box-shadow: 0 24px 64px rgba(8, 145, 178, 0.28);
}

.cta-panel h2 {
    margin: 0 0 12px;
    font-size: clamp(30px, 5vw, 48px);
}

.cta-panel p {
    margin: 0 0 28px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 18px;
}

.breadcrumb {
    width: min(1280px, calc(100% - 32px));
    margin: 32px auto 0;
    color: #94a3b8;
    font-size: 14px;
}

.breadcrumb a:hover {
    color: #34d399;
}

.detail-layout {
    width: min(1280px, calc(100% - 32px));
    margin: 26px auto 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
}

.player-card,
.detail-side,
.detail-panel {
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.88);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.video-shell {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
}

.video-shell video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

.player-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    gap: 14px;
    color: #fff;
    border: 0;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.12), rgba(2, 6, 23, 0.78));
    text-align: center;
    cursor: pointer;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.player-ring {
    position: relative;
    width: 86px;
    height: 86px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.96);
    box-shadow: 0 22px 56px rgba(16, 185, 129, 0.38);
}

.player-ring::after {
    content: "";
    position: absolute;
    left: 34px;
    top: 27px;
    width: 0;
    height: 0;
    border-top: 16px solid transparent;
    border-bottom: 16px solid transparent;
    border-left: 24px solid #fff;
}

.player-overlay strong {
    max-width: min(560px, calc(100% - 40px));
    font-size: 24px;
}

.player-info {
    padding: 26px;
}

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

.info-line {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0 20px;
}

.info-chip {
    padding: 7px 12px;
}

.detail-panel {
    margin-top: 24px;
    padding: 26px;
}

.detail-panel h2,
.detail-side h2,
.search-panel h2,
.rank-board h2 {
    margin: 0 0 16px;
    font-size: 24px;
}

.detail-side {
    padding: 22px;
}

.detail-poster {
    aspect-ratio: 2 / 3;
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 20px;
}

.detail-links {
    display: grid;
    gap: 14px;
}

.side-card {
    display: grid;
    grid-template-columns: 82px 1fr;
    gap: 12px;
    align-items: center;
}

.side-card img {
    width: 82px;
    height: 104px;
    border-radius: 12px;
    object-fit: cover;
}

.side-card strong {
    display: block;
    margin-bottom: 6px;
    line-height: 1.4;
}

.side-card span {
    color: #94a3b8;
    font-size: 13px;
}

.relation-section {
    width: min(1280px, calc(100% - 32px));
    margin: 48px auto 0;
}

.search-panel {
    padding: 24px;
    margin-bottom: 28px;
}

.search-controls {
    display: grid;
    grid-template-columns: 1fr 180px 180px 140px;
    gap: 12px;
}

.search-controls input,
.search-controls select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    color: #fff;
    background: rgba(15, 23, 42, 0.92);
    outline: none;
}

.filter-button {
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, #10b981, #0891b2);
}

.result-status {
    margin-top: 16px;
    color: #94a3b8;
}

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

.rank-board {
    padding: 22px;
}

.rank-line {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.rank-line:last-child {
    border-bottom: 0;
}

.rank-line span {
    color: #fbbf24;
    font-weight: 900;
}

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

.rank-line em {
    color: #94a3b8;
    font-style: normal;
    font-size: 13px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 32px;
}

.pagination a,
.pagination span {
    min-width: 42px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    text-align: center;
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.78);
}

.pagination a:hover,
.pagination span.current {
    border-color: rgba(52, 211, 153, 0.45);
    color: #34d399;
}

.site-footer {
    margin-top: 80px;
    background: linear-gradient(180deg, #0f172a, #020617);
    border-top: 1px solid var(--line);
}

.footer-grid {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 32px;
}

.footer-brand span {
    font-size: 21px;
}

.site-footer p {
    margin: 14px 0 0;
    color: #94a3b8;
    line-height: 1.7;
}

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

.footer-links {
    display: grid;
    gap: 10px;
}

.footer-links a {
    color: #94a3b8;
}

.footer-links a:hover {
    color: #34d399;
}

.footer-bottom {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 22px 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--line);
    color: #94a3b8;
}

.footer-bottom button {
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    color: #cbd5e1;
    background: rgba(30, 41, 59, 0.96);
    cursor: pointer;
}

@media (max-width: 1120px) {
    .desktop-nav {
        gap: 16px;
    }

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

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

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

    .detail-side {
        display: grid;
        grid-template-columns: 260px 1fr;
        gap: 24px;
    }
}

@media (max-width: 860px) {
    .desktop-nav,
    .nav-shell > .search-form {
        display: none;
    }

    .menu-button {
        display: block;
        margin-left: auto;
    }

    .hero {
        height: 560px;
    }

    .hero-shade {
        background: linear-gradient(180deg, rgba(2, 6, 23, 0.7), rgba(2, 6, 23, 0.96));
    }

    .section-heading,
    .page-heading {
        display: block;
    }

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

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

    .wide-cover {
        min-height: auto;
        aspect-ratio: 16 / 9;
    }

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

    .detail-side {
        display: block;
    }
}

@media (max-width: 560px) {
    .nav-shell {
        width: min(100% - 22px, 1280px);
    }

    .brand span {
        font-size: 20px;
    }

    .hero {
        height: 540px;
    }

    .hero p {
        font-size: 17px;
    }

    .hero-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .button-primary,
    .button-light,
    .button-ghost {
        width: 100%;
    }

    .movie-grid,
    .recommend-grid,
    .category-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .card-body h2 {
        min-height: auto;
    }

    .detail-layout,
    .breadcrumb,
    .relation-section,
    .section {
        width: min(100% - 22px, 1280px);
    }

    .footer-bottom {
        display: grid;
        gap: 14px;
    }
}
