:root {
    --bg: #f3f4f6;
    --surface: #ffffff;
    --ink: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --emerald: #10b981;
    --emerald-dark: #047857;
    --teal: #0f766e;
    --cyan: #0891b2;
    --amber: #d97706;
    --rose: #e11d48;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
    --soft-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    color: var(--ink);
    background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 45%, #eef2f7 100%);
    line-height: 1.6;
}

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

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

button,
input,
select {
    font: inherit;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    color: #ffffff;
    background: linear-gradient(90deg, #065f46 0%, #0f766e 52%, #155e75 100%);
    box-shadow: 0 10px 30px rgba(6, 78, 59, 0.26);
}

.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    gap: 22px;
}

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

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: #ffffff;
    background: rgba(16, 185, 129, 0.92);
    border-radius: 14px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-text strong {
    font-size: 22px;
    letter-spacing: 0.02em;
}

.brand-text small {
    margin-top: 5px;
    color: #d1fae5;
    font-size: 12px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-link {
    padding: 8px 0;
    color: rgba(255, 255, 255, 0.92);
    font-weight: 600;
    transition: color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #a7f3d0;
    transform: translateY(-1px);
}

.mobile-toggle {
    display: none;
    color: #ffffff;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
}

.mobile-menu {
    display: none;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 0 0 16px;
}

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

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

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

.hero-bg,
.hero-bg img,
.hero-mask {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero-bg img {
    object-fit: cover;
    filter: saturate(1.08) contrast(1.04);
    transform: scale(1.02);
}

.hero-mask {
    background:
        radial-gradient(circle at 72% 25%, rgba(20, 184, 166, 0.2), transparent 32%),
        linear-gradient(90deg, rgba(0, 0, 0, 0.86) 0%, rgba(0, 0, 0, 0.64) 50%, rgba(0, 0, 0, 0.16) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    min-height: 600px;
    flex-direction: column;
    justify-content: center;
    max-width: 1180px;
    color: #ffffff;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: 16px;
    padding: 6px 16px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    background: linear-gradient(90deg, var(--emerald), var(--cyan));
    border-radius: 999px;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.25);
}

.hero h1 {
    max-width: 760px;
    margin: 0 0 18px;
    font-size: clamp(36px, 6vw, 64px);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.hero-text {
    max-width: 720px;
    margin: 0 0 24px;
    color: #e5e7eb;
    font-size: clamp(18px, 2.1vw, 23px);
}

.hero-tags,
.tag-list,
.detail-tags,
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-tags span,
.tag-list span,
.detail-tags span {
    display: inline-flex;
    align-items: center;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

.hero-tags span {
    color: #ecfeff;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
}

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

.primary-btn,
.ghost-btn,
.flat-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 24px;
    font-weight: 800;
    border-radius: 999px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-btn {
    color: #ffffff;
    background: linear-gradient(90deg, var(--emerald), var(--emerald-dark));
    box-shadow: 0 14px 30px rgba(16, 185, 129, 0.3);
}

.primary-btn:hover,
.ghost-btn:hover,
.flat-btn:hover {
    transform: translateY(-2px);
}

.ghost-btn {
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.34);
    background: rgba(255, 255, 255, 0.11);
    backdrop-filter: blur(12px);
}

.flat-btn {
    color: var(--emerald-dark);
    background: #d1fae5;
}

.hero-dots {
    position: absolute;
    z-index: 4;
    right: calc((100% - min(1180px, calc(100% - 32px))) / 2);
    bottom: 34px;
    display: flex;
    gap: 10px;
}

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

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

.stats-strip {
    background: #ffffff;
    box-shadow: var(--soft-shadow);
}

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

.stat-card {
    padding: 28px 20px;
    text-align: center;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #ecfdf5, #f0fdfa);
}

.stat-card:nth-child(2) {
    background: linear-gradient(135deg, #eff6ff, #ecfeff);
}

.stat-card:nth-child(3) {
    background: linear-gradient(135deg, #fffbeb, #fff7ed);
}

.stat-card:nth-child(4) {
    background: linear-gradient(135deg, #fff1f2, #fdf2f8);
}

.stat-card strong {
    display: block;
    color: var(--emerald-dark);
    font-size: 34px;
    line-height: 1;
}

.stat-card span {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-weight: 700;
}

.section {
    padding: 58px 0;
}

.section.alt {
    background: #ffffff;
}

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

.section-head h1,
.section-head h2 {
    margin: 0 0 8px;
    font-size: clamp(26px, 4vw, 38px);
    line-height: 1.16;
}

.section-head p,
.lead {
    margin: 0;
    color: var(--muted);
}

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

.movie-card {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: var(--radius);
    box-shadow: var(--soft-shadow);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(16, 185, 129, 0.35);
    box-shadow: var(--shadow);
}

.poster {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #111827;
}

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

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

.badge {
    position: absolute;
    top: 12px;
    left: 12px;
    max-width: calc(100% - 24px);
    padding: 5px 10px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    background: rgba(16, 185, 129, 0.92);
    border-radius: 999px;
    backdrop-filter: blur(8px);
}

.movie-info {
    padding: 16px;
}

.movie-info h2,
.movie-info h3 {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 1.28;
}

.movie-info h2 a:hover,
.movie-info h3 a:hover {
    color: var(--emerald-dark);
}

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

.movie-line {
    display: -webkit-box;
    min-height: 44px;
    margin: 0 0 12px;
    overflow: hidden;
    color: #374151;
    font-size: 14px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.tag-list span,
.detail-tags span {
    color: #047857;
    background: #ecfdf5;
}

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

.category-tile {
    min-height: 180px;
    padding: 24px;
    color: #ffffff;
    border-radius: 24px;
    background: linear-gradient(135deg, #065f46, #0f766e 55%, #0891b2);
    box-shadow: var(--soft-shadow);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.category-tile:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.category-tile h2 {
    margin: 0 0 10px;
    font-size: 22px;
}

.category-tile p {
    margin: 0;
    color: #d1fae5;
    font-size: 14px;
}

.category-tile strong {
    display: block;
    margin-top: 24px;
    font-size: 28px;
}

.search-panel {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(120px, 180px));
    gap: 14px;
    margin: 24px 0 30px;
    padding: 18px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--soft-shadow);
}

.search-panel input,
.search-panel select {
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    color: var(--ink);
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: #ffffff;
    outline: none;
}

.search-panel input:focus,
.search-panel select:focus {
    border-color: var(--emerald);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.no-results {
    display: none;
    padding: 40px;
    text-align: center;
    color: var(--muted);
    background: #ffffff;
    border-radius: var(--radius);
}

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

.rank-item {
    display: grid;
    grid-template-columns: 56px 86px 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 14px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--soft-shadow);
}

.rank-num {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    color: #ffffff;
    font-weight: 900;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--emerald), var(--cyan));
}

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

.rank-item h2 {
    margin: 0 0 6px;
    font-size: 20px;
}

.rank-item p {
    margin: 0;
    color: var(--muted);
}

.detail-hero {
    position: relative;
    overflow: hidden;
    color: #ffffff;
    background: #020617;
}

.detail-backdrop {
    position: absolute;
    inset: 0;
    opacity: 0.28;
}

.detail-backdrop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(6px) saturate(1.2);
    transform: scale(1.06);
}

.detail-hero::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.86), rgba(5, 46, 22, 0.68), rgba(8, 47, 73, 0.4));
}

.detail-hero-inner {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 34px;
    padding: 54px 0;
}

.detail-poster img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 24px;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.32);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    color: #d1fae5;
    font-size: 14px;
}

.detail-copy h1 {
    margin: 0 0 14px;
    font-size: clamp(34px, 5vw, 56px);
    line-height: 1.1;
}

.detail-copy .summary-line {
    max-width: 820px;
    margin: 0 0 22px;
    color: #e5e7eb;
    font-size: 19px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.detail-meta span {
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
}

.player-section {
    padding: 36px 0 0;
    background: #0b1220;
}

.player-shell {
    position: relative;
    overflow: hidden;
    background: #000000;
    border-radius: 24px;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
}

.player-shell video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000000;
    cursor: pointer;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 0;
    color: #ffffff;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.55));
    cursor: pointer;
}

.player-overlay span {
    display: grid;
    width: 86px;
    height: 86px;
    place-items: center;
    padding-left: 5px;
    font-size: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--emerald), var(--cyan));
    box-shadow: 0 18px 50px rgba(16, 185, 129, 0.4);
}

.player-shell.is-playing .player-overlay {
    display: none;
}

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

.detail-panel,
.side-panel {
    padding: 26px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--soft-shadow);
}

.detail-panel h2,
.side-panel h2 {
    margin: 0 0 14px;
    font-size: 22px;
}

.detail-panel p {
    margin: 0 0 18px;
    color: #374151;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 16px 0 24px;
}

.info-grid div {
    padding: 14px;
    background: #f9fafb;
    border-radius: 14px;
}

.info-grid span {
    color: var(--muted);
}

.compact-list {
    display: grid;
    gap: 14px;
}

.compact-card {
    display: grid;
    grid-template-columns: 76px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: 14px;
    transition: background 0.2s ease;
}

.compact-card:hover {
    background: #f3f4f6;
}

.compact-card img {
    width: 76px;
    height: 98px;
    object-fit: cover;
    border-radius: 12px;
}

.compact-card strong,
.compact-card small {
    display: block;
}

.compact-card small {
    margin-top: 5px;
    color: var(--muted);
}

.pagination-links {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 28px;
}

.pagination-links a {
    flex: 1;
    padding: 16px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--soft-shadow);
}

.site-footer {
    margin-top: 36px;
    color: #d1d5db;
    background: #111827;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 32px;
    padding: 48px 0;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    font-size: 20px;
}

.footer-brand span {
    color: #34d399;
}

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

.site-footer p {
    color: #9ca3af;
}

.site-footer ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-footer li + li {
    margin-top: 9px;
}

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

.footer-bottom {
    padding: 18px;
    text-align: center;
    color: #9ca3af;
    border-top: 1px solid #1f2937;
}

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

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

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

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

    .mobile-toggle {
        display: block;
    }

    .mobile-menu.open {
        display: grid;
        gap: 6px;
    }

    .mobile-menu .nav-link {
        padding: 10px 12px;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.08);
    }

    .hero,
    .hero-content {
        min-height: 560px;
    }

    .stats-grid,
    .footer-grid,
    .detail-hero-inner {
        grid-template-columns: 1fr;
    }

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

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

    .rank-item {
        grid-template-columns: 46px 72px 1fr;
    }

    .rank-item .primary-btn {
        grid-column: 2 / -1;
        min-height: 42px;
    }
}

@media (max-width: 620px) {
    .container {
        width: min(100% - 24px, 1180px);
    }

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

    .brand-text small {
        display: none;
    }

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

    .movie-info {
        padding: 12px;
    }

    .movie-info h2,
    .movie-info h3 {
        font-size: 16px;
    }

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

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

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

    .hero-dots {
        right: 16px;
        bottom: 18px;
    }

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