:root {
    --emerald: #10b981;
    --emerald-dark: #059669;
    --teal: #0f766e;
    --rose: #e11d48;
    --blue: #2563eb;
    --ink: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --paper: #ffffff;
    --soft: #f3f4f6;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--ink);
    background: #f9fafb;
}

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

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

button,
input,
select {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.9);
}

.header-inner {
    max-width: 1180px;
    height: 68px;
    margin: 0 auto;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand,
.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.04em;
    background: linear-gradient(90deg, var(--emerald-dark), var(--teal));
    -webkit-background-clip: text;
    color: transparent;
}

.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    background: linear-gradient(135deg, var(--emerald), var(--teal));
    box-shadow: 0 10px 24px rgba(16, 185, 129, 0.25);
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 34px;
    color: #374151;
    font-weight: 650;
}

.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-dark);
}

.menu-button {
    display: none;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: #f3f4f6;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.menu-button span {
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: #374151;
}

.mobile-nav {
    display: none;
    max-width: 1180px;
    margin: 0 auto;
    padding: 12px 22px 22px;
    border-top: 1px solid #f3f4f6;
}

.mobile-nav.open {
    display: grid;
    gap: 14px;
}

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

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1s ease;
}

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

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.48), rgba(0, 0, 0, 0.08));
}

.hero-content {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    z-index: 2;
}

.hero-copy {
    width: min(1180px, calc(100% - 44px));
    margin: 0 auto;
    max-width: 670px;
    color: #fff;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    color: #6ee7b7;
    font-weight: 800;
}

.hero h1 {
    margin: 0 0 18px;
    font-size: clamp(34px, 6vw, 58px);
    line-height: 1.08;
    letter-spacing: -0.05em;
}

.hero p {
    max-width: 620px;
    margin: 0 0 24px;
    color: #e5e7eb;
    font-size: 18px;
    line-height: 1.75;
}

.hero-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 30px;
    color: #d1d5db;
}

.hero-actions,
.section-title,
.page-title-row,
.category-grid,
.footer-links,
.detail-actions {
    display: flex;
    align-items: center;
}

.btn-primary,
.btn-ghost,
.hero-nav,
.filter-panel input,
.filter-panel select,
.play-overlay,
.pagination a,
.pagination span {
    transition: all 0.2s ease;
}

.btn-primary,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    padding: 13px 22px;
    font-weight: 800;
}

.btn-primary {
    background: var(--emerald);
    color: #fff;
    box-shadow: 0 16px 30px rgba(16, 185, 129, 0.26);
}

.btn-primary:hover {
    background: var(--emerald-dark);
    transform: translateY(-1px);
}

.btn-ghost {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(10px);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.14);
}

.hero-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.48);
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

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

.hero-prev {
    left: 24px;
}

.hero-next {
    right: 24px;
}

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

.hero-dots button {
    width: 10px;
    height: 10px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    cursor: pointer;
}

.hero-dots button.active {
    width: 34px;
    background: var(--emerald);
}

main,
.main-wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 54px 22px;
}

.stack {
    display: grid;
    gap: 64px;
}

.section-title {
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.section-title h2,
.page-heading h1,
.detail-main h1 {
    margin: 0;
    color: #111827;
    letter-spacing: -0.04em;
}

.section-title h2 {
    font-size: clamp(25px, 3vw, 34px);
}

.section-title p,
.page-heading p,
.category-card p,
.card-body p,
.detail-summary,
.detail-copy p,
.site-footer p {
    color: var(--muted);
    line-height: 1.72;
}

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

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

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

.movie-card {
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(229, 231, 235, 0.68);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.poster-link {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: linear-gradient(135deg, #022c22, #0f766e);
}

.movie-card:not(.compact) .poster-link {
    aspect-ratio: 16 / 10;
}

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

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

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

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

.year-badge,
.rank-num {
    position: absolute;
    top: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    backdrop-filter: blur(10px);
}

.year-badge {
    right: 12px;
    padding: 5px 8px;
    background: rgba(0, 0, 0, 0.58);
}

.rank-num {
    left: 12px;
    min-width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #f97316, #e11d48);
}

.card-body {
    padding: 15px;
}

.card-body h3 {
    margin: 0 0 8px;
    font-size: 17px;
    line-height: 1.35;
}

.card-body h3 a:hover {
    color: var(--emerald-dark);
}

.card-body p {
    min-height: 46px;
    margin: 0 0 12px;
    font-size: 14px;
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #6b7280;
    font-size: 12px;
}

.card-meta a {
    color: var(--emerald-dark);
    font-weight: 800;
}

.soft-section {
    border-radius: var(--radius);
    padding: 34px;
    background: linear-gradient(135deg, #ecfdf5, #f0fdfa);
}

.category-block {
    display: grid;
    gap: 34px;
}

.category-block h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    font-size: 20px;
}

.category-block h3::before {
    content: "";
    width: 5px;
    height: 26px;
    border-radius: 999px;
    background: var(--emerald);
}

.latest-section,
.panel,
.detail-card,
.search-shell {
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(229, 231, 235, 0.8);
}

.latest-section,
.search-shell {
    padding: 34px;
}

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

.category-card {
    position: relative;
    overflow: hidden;
    min-height: 210px;
    padding: 24px;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(229, 231, 235, 0.78);
}

.category-card::before {
    content: "";
    position: absolute;
    width: 120px;
    height: 120px;
    right: -30px;
    top: -30px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(20, 184, 166, 0.04));
}

.category-card h2 {
    position: relative;
    margin: 0 0 10px;
    font-size: 22px;
}

.category-card p {
    position: relative;
    margin: 0 0 20px;
    font-size: 14px;
}

.category-card strong {
    color: var(--emerald-dark);
}

.page-heading {
    margin-bottom: 30px;
}

.page-heading h1 {
    margin-bottom: 12px;
    font-size: clamp(32px, 4vw, 46px);
}

.filter-panel {
    display: grid;
    grid-template-columns: 1fr 180px 160px;
    gap: 16px;
    margin: 26px 0 32px;
    padding: 18px;
    border: 1px solid #d1fae5;
    border-radius: 20px;
    background: linear-gradient(135deg, #ffffff, #ecfdf5);
}

.filter-panel label {
    display: grid;
    gap: 8px;
    color: #374151;
    font-size: 13px;
    font-weight: 800;
}

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

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

.pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 36px;
}

.pagination a,
.pagination span {
    min-width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: #374151;
    font-weight: 800;
}

.pagination a:hover,
.pagination .current {
    border-color: var(--emerald);
    background: var(--emerald);
    color: #fff;
}

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

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

.rank-row {
    display: grid;
    grid-template-columns: 44px 58px 1fr;
    grid-template-rows: auto auto;
    gap: 4px 14px;
    align-items: center;
    padding: 12px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--line);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rank-row:hover {
    transform: translateX(4px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.rank-row span {
    grid-row: 1 / 3;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #10b981, #0f766e);
    color: #fff;
    font-weight: 900;
}

.rank-row img {
    grid-row: 1 / 3;
    width: 58px;
    height: 74px;
    border-radius: 12px;
    object-fit: cover;
}

.rank-row strong {
    align-self: end;
}

.rank-row em {
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
}

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

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

.detail-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
    gap: 28px;
    align-items: start;
}

.player-box {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    background: #020617;
    box-shadow: var(--shadow);
    aspect-ratio: 16 / 9;
}

.player-box video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    background: #020617;
}

.play-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    border: 0;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.18), rgba(2, 6, 23, 0.48));
}

.play-overlay span {
    width: 82px;
    height: 82px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    background: linear-gradient(135deg, var(--emerald), var(--teal));
    box-shadow: 0 18px 40px rgba(16, 185, 129, 0.28);
}

.play-overlay:hover span {
    transform: scale(1.06);
}

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

.detail-card {
    padding: 26px;
}

.detail-card img {
    width: 100%;
    border-radius: 18px;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #022c22, #0f766e);
}

.detail-main h1 {
    font-size: clamp(32px, 5vw, 48px);
    line-height: 1.1;
    margin-bottom: 16px;
}

.detail-summary {
    margin: 0 0 24px;
    font-size: 17px;
}

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

.meta-grid div {
    padding: 13px;
    border-radius: 14px;
    background: #f9fafb;
    color: #4b5563;
    font-size: 14px;
}

.meta-grid strong {
    display: block;
    margin-bottom: 4px;
    color: #111827;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.tag {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-size: 12px;
    font-weight: 800;
}

.detail-copy {
    display: grid;
    gap: 22px;
    margin-top: 34px;
}

.detail-copy section {
    padding: 28px;
    border-radius: 22px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.detail-copy h2 {
    margin: 0 0 12px;
    font-size: 24px;
}

.detail-copy p {
    margin: 0;
    font-size: 16px;
}

.related-section {
    margin-top: 52px;
}

.no-results {
    display: none;
    margin: 30px 0 0;
    padding: 24px;
    text-align: center;
    border-radius: 18px;
    background: #fff;
    color: var(--muted);
    border: 1px solid var(--line);
}

.no-results.show {
    display: block;
}

.site-footer {
    margin-top: 28px;
    color: #d1d5db;
    background: linear-gradient(135deg, #111827, #1f2937 55%, #111827);
}

.footer-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 46px 22px;
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 32px;
}

.footer-logo {
    margin-bottom: 12px;
}

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

.site-footer p {
    margin: 0;
    color: #d1d5db;
}

.footer-links {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-links a {
    color: #d1d5db;
    font-size: 14px;
}

.footer-links a:hover {
    color: #6ee7b7;
}

.copyright {
    max-width: 1180px;
    margin: 0 auto;
    padding: 20px 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #9ca3af;
    font-size: 14px;
}

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

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

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

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

    .menu-button {
        display: inline-flex;
    }

    .hero {
        height: 540px;
    }

    .hero-copy {
        width: calc(100% - 36px);
    }

    .hero-nav {
        display: none;
    }

    main,
    .main-wrap {
        padding: 36px 16px;
    }

    .stack {
        gap: 44px;
    }

    .section-title {
        display: grid;
        align-items: start;
    }

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

    .soft-section,
    .latest-section,
    .search-shell {
        padding: 22px;
        border-radius: 18px;
    }

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

    .detail-card,
    .detail-copy section {
        padding: 20px;
    }

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

    .footer-inner {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 460px) {
    .movie-grid,
    .movie-grid.large,
    .movie-grid.search-grid,
    .category-grid {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 34px;
    }

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