* {
    box-sizing: border-box;
}

:root {
    color-scheme: light;
    --emerald: #059669;
    --emerald-dark: #047857;
    --emerald-soft: #ecfdf5;
    --amber: #f59e0b;
    --rose: #e11d48;
    --ink: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --paper: #ffffff;
    --soft: #f9fafb;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
    --shadow-sm: 0 10px 24px rgba(15, 23, 42, 0.08);
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    color: var(--ink);
    background: linear-gradient(180deg, #f9fafb 0%, #ffffff 42%);
}

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

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

button,
input,
select {
    font: inherit;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 800;
    color: var(--ink);
}

.brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    color: white;
    background: linear-gradient(135deg, var(--emerald), #10b981);
    box-shadow: 0 10px 22px rgba(5, 150, 105, 0.28);
    font-size: 14px;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 28px;
    color: #374151;
    font-size: 14px;
    font-weight: 700;
}

.desktop-nav a,
.mobile-nav a {
    transition: color 0.2s ease;
}

.desktop-nav a:hover,
.desktop-nav a.active,
.mobile-nav a:hover,
.mobile-nav a.active {
    color: var(--emerald);
}

.mobile-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: var(--soft);
    color: var(--ink);
    cursor: pointer;
    font-size: 24px;
}

.mobile-nav {
    display: none;
    flex-direction: column;
    gap: 16px;
    padding: 18px 24px 22px;
    border-top: 1px solid var(--line);
    font-weight: 700;
    background: white;
}

.hero-slider {
    position: relative;
    height: 68vh;
    min-height: 520px;
    overflow: hidden;
    background: #111827;
}

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

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

.hero-slide > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.45;
    transform: scale(1.02);
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.56) 46%, rgba(0, 0, 0, 0.08) 100%);
}

.hero-content {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding-bottom: 78px;
}

.hero-text {
    max-width: 720px;
    color: white;
}

.hero-tags,
.hero-meta,
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.hero-tags span:first-child,
.eyebrow {
    display: inline-flex;
    align-items: center;
    color: var(--emerald);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero-tags span {
    padding: 7px 12px;
    border-radius: 999px;
    color: white;
    background: rgba(5, 150, 105, 0.92);
    font-size: 13px;
    font-weight: 800;
}

.hero-tags span + span {
    background: rgba(245, 158, 11, 0.9);
}

.hero-text h1 {
    margin: 20px 0 18px;
    font-size: clamp(34px, 6vw, 62px);
    line-height: 1.08;
    font-weight: 900;
}

.hero-text p {
    margin: 0 0 24px;
    max-width: 680px;
    color: #e5e7eb;
    font-size: 18px;
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-meta {
    margin-bottom: 28px;
    color: #d1d5db;
    font-weight: 700;
}

.hero-meta span + span::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 4px;
    margin-right: 12px;
    border-radius: 999px;
    background: #9ca3af;
    vertical-align: middle;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 12px;
    font-weight: 900;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn.primary {
    color: white;
    background: var(--emerald);
    box-shadow: 0 14px 26px rgba(5, 150, 105, 0.25);
}

.btn.primary:hover {
    background: var(--emerald-dark);
}

.btn.ghost {
    color: white;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(12px);
}

.btn.small {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 14px;
}

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 4;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 999px;
    color: white;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    cursor: pointer;
    font-size: 34px;
    line-height: 1;
    transition: background 0.2s ease;
}

.hero-arrow:hover {
    background: rgba(0, 0, 0, 0.72);
}

.hero-arrow.prev {
    left: 24px;
}

.hero-arrow.next {
    right: 24px;
}

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

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

.hero-dot.is-active {
    width: 34px;
    background: #10b981;
}

.section-block,
.search-panel,
.filter-strip {
    padding: 56px 0;
}

.search-panel {
    margin-top: 24px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: white;
    box-shadow: var(--shadow-sm);
}

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

.section-head.compact {
    align-items: center;
    margin-bottom: 18px;
}

.section-head h2 {
    margin: 6px 0 0;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.2;
}

.section-head a {
    color: var(--emerald);
    font-weight: 900;
}

.search-box {
    display: grid;
    grid-template-columns: 1fr 170px;
    gap: 14px;
}

.search-box input,
.search-box select,
.grid-filter {
    width: 100%;
    height: 48px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0 16px;
    color: var(--ink);
    background: #f9fafb;
    outline: none;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.search-box input:focus,
.search-box select:focus,
.grid-filter:focus {
    border-color: rgba(5, 150, 105, 0.5);
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.1);
}

.search-results {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.search-item {
    display: block;
    padding: 14px;
    border-radius: 14px;
    background: var(--emerald-soft);
    transition: transform 0.2s ease;
}

.search-item:hover {
    transform: translateY(-2px);
}

.search-item strong,
.search-item span {
    display: block;
}

.search-item span {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
}

.empty-result {
    margin: 0;
    color: var(--muted);
}

.movie-grid {
    display: grid;
    gap: 20px;
}

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

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

.movie-card {
    display: block;
    min-width: 0;
    overflow: hidden;
    border-radius: 18px;
    color: inherit;
    background: white;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

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

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

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

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

.poster-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, 0.72) 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.movie-card:hover .poster-shade {
    opacity: 1;
}

.card-play {
    position: absolute;
    left: 50%;
    top: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 999px;
    color: white;
    background: rgba(5, 150, 105, 0.92);
    transform: translate(-50%, -50%) scale(0.86);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

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

.card-year {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 5px 8px;
    border-radius: 8px;
    color: white;
    background: rgba(0, 0, 0, 0.68);
    font-size: 12px;
    font-weight: 800;
}

.card-body {
    display: block;
    padding: 15px;
}

.card-body h2,
.card-body h3 {
    margin: 0 0 8px;
    overflow: hidden;
    color: var(--ink);
    font-size: 16px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.movie-card:hover .card-body h2,
.movie-card:hover .card-body h3 {
    color: var(--emerald);
}

.card-desc {
    display: -webkit-box;
    min-height: 42px;
    overflow: hidden;
    color: #4b5563;
    font-size: 13px;
    line-height: 1.6;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
    color: #6b7280;
    font-size: 12px;
    font-weight: 700;
}

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

.category-card {
    position: relative;
    min-height: 230px;
    overflow: hidden;
    border-radius: 22px;
    background: #111827;
    box-shadow: var(--shadow-sm);
}

.category-card img {
    width: 100%;
    height: 100%;
    min-height: 230px;
    object-fit: cover;
    opacity: 0.64;
    transition: transform 0.45s ease;
}

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

.category-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.86) 100%);
}

.category-content {
    position: absolute;
    inset-inline: 22px;
    bottom: 22px;
    color: white;
}

.category-content strong,
.category-content em {
    display: block;
}

.category-content strong {
    margin-bottom: 8px;
    font-size: 22px;
    font-style: normal;
    font-weight: 900;
}

.category-content em {
    color: #d1d5db;
    font-size: 14px;
    font-style: normal;
    line-height: 1.6;
}

.split-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 28px;
    align-items: start;
}

.ranking-card,
.related-panel,
.poster-panel,
.detail-content,
.player-card,
.overview-card {
    border-radius: 20px;
    background: white;
    box-shadow: var(--shadow-sm);
}

.ranking-card {
    position: sticky;
    top: 86px;
    padding: 22px;
}

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

.media-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 14px;
    transition: background 0.2s ease;
}

.media-row:hover {
    background: #f3f4f6;
}

.media-row img {
    width: 64px;
    height: 86px;
    flex: 0 0 auto;
    border-radius: 10px;
    object-fit: cover;
    background: #e5e7eb;
}

.media-row strong,
.media-row em {
    display: block;
}

.media-row strong {
    display: -webkit-box;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.35;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.media-row em {
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

.rank-num {
    width: 30px;
    color: var(--emerald);
    font-weight: 900;
}

.page-shell {
    min-height: 70vh;
}

.page-hero {
    padding: 74px 0;
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
}

.page-hero.emerald {
    color: white;
    background: linear-gradient(135deg, var(--emerald) 0%, #064e3b 100%);
}

.page-hero h1 {
    margin: 10px 0 14px;
    font-size: clamp(32px, 5vw, 52px);
    line-height: 1.1;
}

.page-hero p {
    max-width: 760px;
    margin: 0;
    color: #4b5563;
    font-size: 18px;
    line-height: 1.8;
}

.page-hero.emerald p,
.eyebrow.light {
    color: #d1fae5;
}

.filter-strip {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding-bottom: 0;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-chips span,
.filter-chips a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: white;
    color: var(--emerald);
    border: 1px solid rgba(5, 150, 105, 0.18);
    font-weight: 800;
}

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

.overview-card {
    overflow: hidden;
}

.overview-posters {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    background: #e5e7eb;
}

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

.overview-body {
    padding: 24px;
}

.overview-body h2 {
    margin: 0 0 10px;
    font-size: 24px;
}

.overview-body p {
    margin: 0 0 18px;
    color: var(--muted);
    line-height: 1.7;
}

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

.rank-card {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 22px;
    padding: 18px;
    border-radius: 20px;
    background: white;
    box-shadow: var(--shadow-sm);
}

.rank-poster {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    background: #e5e7eb;
}

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

.rank-poster span {
    position: absolute;
    left: 12px;
    top: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    color: white;
    background: var(--emerald);
    font-weight: 900;
}

.rank-card h2 {
    margin: 6px 0 10px;
    font-size: 24px;
}

.rank-card p {
    margin: 0 0 16px;
    color: #4b5563;
    line-height: 1.8;
}

.rank-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.rank-meta span {
    padding: 7px 10px;
    border-radius: 999px;
    background: var(--emerald-soft);
    color: var(--emerald-dark);
    font-size: 13px;
    font-weight: 800;
}

.detail-shell {
    padding: 26px 0 64px;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 14px;
}

.breadcrumbs a {
    color: var(--emerald);
    font-weight: 800;
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 28px;
    align-items: start;
}

.player-card {
    overflow: hidden;
    padding: 0;
    background: #000;
}

.video-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 20px;
    background: #000;
}

.video-player video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: pointer;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    color: white;
    background: rgba(0, 0, 0, 0.34);
    cursor: pointer;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.player-overlay span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 82px;
    height: 82px;
    border-radius: 999px;
    background: rgba(5, 150, 105, 0.94);
    box-shadow: 0 20px 45px rgba(5, 150, 105, 0.35);
    font-size: 28px;
}

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

.player-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.85), transparent);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.video-player:hover .player-controls,
.video-player:focus-within .player-controls {
    opacity: 1;
}

.player-controls button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    color: white;
    background: rgba(255, 255, 255, 0.18);
    cursor: pointer;
}

.player-controls button:last-child {
    margin-left: auto;
}

.detail-content {
    margin-top: 22px;
    padding: 28px;
}

.detail-content h1 {
    margin: 0 0 18px;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.15;
}

.detail-meta,
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.detail-meta {
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--line);
}

.detail-meta span,
.tag-list span {
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--emerald-dark);
    background: var(--emerald-soft);
    font-size: 13px;
    font-weight: 800;
}

.detail-content section + section {
    margin-top: 28px;
}

.detail-content h2,
.related-panel h2 {
    margin: 0 0 12px;
    font-size: 20px;
}

.detail-content p {
    margin: 0;
    color: #374151;
    font-size: 16px;
    line-height: 1.9;
}

.detail-content p + p {
    margin-top: 14px;
}

.lead-text {
    font-weight: 800;
}

.review-box {
    padding: 20px;
    border-radius: 16px;
    background: #f9fafb;
}

.detail-side {
    position: sticky;
    top: 86px;
    display: grid;
    gap: 20px;
}

.poster-panel,
.related-panel {
    padding: 20px;
}

.poster-panel img {
    width: 100%;
    border-radius: 16px;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    margin-bottom: 16px;
    background: #e5e7eb;
}

.poster-panel .btn {
    width: 100%;
}

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

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) 1fr 1fr;
    gap: 32px;
    padding: 44px 0;
}

.footer-brand {
    color: white;
    margin-bottom: 16px;
}

.site-footer p {
    margin: 0;
    color: #9ca3af;
    line-height: 1.8;
}

.site-footer h2 {
    margin: 0 0 16px;
    color: white;
    font-size: 16px;
}

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

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

.footer-bottom {
    padding: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #9ca3af;
    text-align: center;
    font-size: 14px;
}

[hidden] {
    display: none !important;
}

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

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

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

    .ranking-card,
    .detail-side {
        position: static;
    }
}

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

    .mobile-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-nav.is-open {
        display: flex;
    }

    .hero-slider {
        height: 72vh;
        min-height: 520px;
    }

    .hero-content {
        padding-bottom: 70px;
    }

    .hero-arrow {
        display: none;
    }

    .hero-text p {
        font-size: 15px;
        -webkit-line-clamp: 3;
    }

    .search-box,
    .filter-strip,
    .footer-grid,
    .rank-card {
        grid-template-columns: 1fr;
    }

    .search-results,
    .overview-grid {
        grid-template-columns: 1fr;
    }

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

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

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

    .card-body {
        padding: 12px;
    }

    .card-desc {
        min-height: 38px;
        font-size: 12px;
    }

    .detail-content,
    .poster-panel,
    .related-panel,
    .search-panel {
        padding: 18px;
        border-radius: 18px;
    }

    .player-overlay span {
        width: 64px;
        height: 64px;
    }
}
