:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --ink: #111827;
    --muted: #6b7280;
    --soft: #ecfdf5;
    --line: #e5e7eb;
    --brand: #10b981;
    --brand-dark: #059669;
    --brand-light: #d1fae5;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.10);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
}

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

img, video {
    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.94);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.9);
}

.nav-wrap {
    width: min(1240px, calc(100% - 28px));
    margin: 0 auto;
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 18px;
}

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

.logo-mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--brand), #34d399);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.30);
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
}

.desktop-nav::-webkit-scrollbar {
    display: none;
}

.desktop-nav a,
.mobile-panel nav a {
    color: #4b5563;
    font-weight: 600;
    border-radius: 999px;
    padding: 10px 14px;
    transition: all 0.2s ease;
}

.desktop-nav a:hover,
.desktop-nav a.is-active,
.mobile-panel nav a:hover {
    color: var(--brand-dark);
    background: var(--soft);
}

.search-shell {
    position: relative;
}

.nav-search {
    width: 310px;
    flex: 0 0 auto;
}

.search-shell form {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.05);
}

.search-shell input {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: 0;
    padding: 8px 10px 8px 14px;
    color: var(--ink);
    background: transparent;
}

.search-shell button {
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    background: var(--brand);
    padding: 8px 14px;
    font-weight: 700;
    cursor: pointer;
}

.search-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 80;
    display: none;
    padding: 8px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.search-results.is-open {
    display: block;
}

.search-result-item {
    display: block;
    padding: 10px 12px;
    border-radius: 12px;
}

.search-result-item:hover {
    background: var(--soft);
}

.search-result-item strong {
    display: block;
    color: var(--ink);
    line-height: 1.3;
}

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

.mobile-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 14px;
    background: var(--soft);
    color: var(--brand-dark);
    font-size: 22px;
}

.mobile-panel {
    display: none;
    width: min(1240px, calc(100% - 28px));
    margin: 0 auto 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 12px 25px rgba(15, 23, 42, 0.08);
}

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

.mobile-panel nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.hero {
    position: relative;
    min-height: 660px;
    overflow: hidden;
    color: #ffffff;
    background: #0f172a;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.7s ease;
    background-image: linear-gradient(90deg, rgba(2, 6, 23, 0.92) 0%, rgba(2, 6, 23, 0.74) 44%, rgba(2, 6, 23, 0.25) 100%), var(--hero-image);
    background-position: center;
    background-size: cover;
}

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

.hero-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 18% 22%, rgba(16, 185, 129, 0.36), transparent 34%), linear-gradient(0deg, rgba(15, 23, 42, 0.88), transparent 42%);
}

.hero-inner {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(260px, 0.72fr);
    gap: 48px;
    align-items: center;
    min-height: 660px;
    padding: 92px 0 64px;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #bbf7d0;
    background: rgba(16, 185, 129, 0.18);
    border: 1px solid rgba(187, 247, 208, 0.28);
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 800;
}

.hero h1 {
    max-width: 760px;
    margin: 22px 0 18px;
    font-size: clamp(38px, 5vw, 72px);
    line-height: 1.05;
    letter-spacing: -0.055em;
}

.hero p {
    max-width: 720px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 18px;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 22px 0;
}

.hero-tags span,
.tag-list span {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #ffffff;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 700;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 28px 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 999px;
    padding: 12px 20px;
    font-weight: 800;
    border: 1px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

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

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

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

.btn-ghost {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.22);
}

.hero-card {
    justify-self: end;
    width: min(390px, 100%);
    overflow: hidden;
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.13);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(18px);
}

.hero-card img {
    width: 100%;
    height: 430px;
    object-fit: cover;
}

.hero-card-body {
    padding: 20px;
}

.hero-card-body strong {
    display: block;
    font-size: 22px;
    line-height: 1.25;
}

.hero-card-body span {
    display: block;
    color: rgba(255, 255, 255, 0.74);
    margin-top: 8px;
}

.hero-search {
    max-width: 620px;
    margin-top: 24px;
}

.hero-search .search-shell form {
    border-color: rgba(255, 255, 255, 0.20);
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(18px);
}

.hero-search input {
    color: #ffffff;
}

.hero-search input::placeholder {
    color: rgba(255, 255, 255, 0.72);
}

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

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

.hero-dots button.is-active {
    background: var(--brand);
}

.section {
    padding: 58px 0;
}

.section-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
}

.section-title span {
    color: var(--brand-dark);
    font-weight: 800;
    letter-spacing: 0.08em;
    font-size: 13px;
}

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

.section-title p,
.page-title p {
    margin: 10px 0 0;
    max-width: 760px;
    color: var(--muted);
}

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

.movie-card {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 5px 18px rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(229, 231, 235, 0.75);
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

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

.movie-poster {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    margin: 0;
    background: #111827;
}

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

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

.movie-poster::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 42%, rgba(0, 0, 0, 0.62));
}

.movie-year,
.rank-badge {
    position: absolute;
    z-index: 2;
    top: 12px;
    right: 12px;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.68);
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 800;
}

.rank-badge {
    left: 12px;
    right: auto;
    background: var(--brand);
}

.movie-play {
    position: absolute;
    z-index: 3;
    left: 50%;
    top: 50%;
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(16, 185, 129, 0.92);
    transform: translate(-50%, -50%) scale(0.86);
    opacity: 0;
    transition: all 0.22s ease;
}

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

.movie-info {
    padding: 18px;
}

.movie-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 10px;
}

.movie-meta span {
    background: var(--soft);
    border-radius: 999px;
    padding: 5px 9px;
}

.movie-info h3 {
    margin: 0;
    color: var(--ink);
    font-size: 18px;
    line-height: 1.35;
    min-height: 48px;
}

.movie-info p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.category-card {
    display: block;
    min-height: 210px;
    padding: 28px;
    border-radius: 28px;
    color: #ffffff;
    background: linear-gradient(135deg, #047857, #10b981 55%, #34d399);
    box-shadow: 0 18px 35px rgba(16, 185, 129, 0.25);
    transition: transform 0.22s ease;
}

.category-card:nth-child(2n) {
    background: linear-gradient(135deg, #0f172a, #0f766e 55%, #14b8a6);
}

.category-card:hover {
    transform: translateY(-5px);
}

.category-card strong {
    display: block;
    font-size: 28px;
    margin-bottom: 12px;
}

.category-card p {
    color: rgba(255, 255, 255, 0.82);
    margin: 0;
}

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

.rank-item {
    display: grid;
    grid-template-columns: 58px 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid var(--line);
    transition: all 0.2s ease;
}

.rank-item:hover {
    border-color: rgba(16, 185, 129, 0.35);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.rank-num {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: var(--soft);
    color: var(--brand-dark);
    font-weight: 900;
}

.rank-item h3 {
    margin: 0 0 4px;
    font-size: 17px;
}

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

.rank-go {
    color: var(--brand-dark);
    font-weight: 900;
}

.page-hero {
    padding: 62px 0 40px;
    background: linear-gradient(135deg, #ecfdf5, #ffffff 56%, #f0fdfa);
    border-bottom: 1px solid var(--line);
}

.page-title h1 {
    margin-top: 0;
}

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 18px;
}

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

.filter-bar {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 12px;
    padding: 18px;
    border-radius: 24px;
    border: 1px solid var(--line);
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
    margin-bottom: 26px;
}

.filter-bar input,
.filter-bar select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    outline: 0;
    padding: 12px 14px;
    color: var(--ink);
    background: #ffffff;
}

.filter-empty {
    display: none;
    padding: 26px;
    border-radius: 22px;
    background: #ffffff;
    color: var(--muted);
    border: 1px solid var(--line);
}

.filter-empty.is-open {
    display: block;
}

.player-section {
    background: #000000;
}

.player-wrap {
    width: min(1240px, 100%);
    margin: 0 auto;
}

.player-shell {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000000;
    overflow: hidden;
}

.player-shell video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000000;
}

.player-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    border: 0;
    color: #ffffff;
    background: radial-gradient(circle at center, rgba(16, 185, 129, 0.22), rgba(0, 0, 0, 0.54) 60%);
    cursor: pointer;
}

.player-overlay span {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    border-radius: 999px;
    background: var(--brand);
    padding: 15px 24px;
    font-size: 18px;
    font-weight: 900;
    box-shadow: 0 20px 40px rgba(16, 185, 129, 0.35);
}

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

.player-message {
    position: absolute;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    z-index: 4;
    display: none;
    border-radius: 999px;
    padding: 10px 16px;
    color: #ffffff;
    background: rgba(220, 38, 38, 0.88);
}

.player-message.is-open {
    display: block;
}

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

.detail-poster {
    position: sticky;
    top: 92px;
    overflow: hidden;
    border-radius: 28px;
    background: #111827;
    box-shadow: var(--shadow);
}

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

.detail-content {
    border-radius: 28px;
    background: #ffffff;
    border: 1px solid var(--line);
    padding: 30px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.detail-title h1 {
    margin-top: 0;
}

.detail-submeta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--muted);
    margin: 16px 0 20px;
}

.detail-submeta span {
    border-radius: 999px;
    background: #f3f4f6;
    padding: 8px 12px;
    font-weight: 700;
}

.detail-content h2 {
    margin: 28px 0 10px;
    font-size: 24px;
}

.detail-content p {
    color: #374151;
    margin: 0 0 12px;
}

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

.tag-list span {
    color: var(--brand-dark);
    background: var(--soft);
    border-color: transparent;
}

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

body.no-scroll {
    overflow: hidden;
}

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

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

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

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

    .mobile-toggle {
        display: grid;
        place-items: center;
        margin-left: auto;
    }

    .hero,
    .hero-inner {
        min-height: auto;
    }

    .hero-inner {
        grid-template-columns: 1fr;
        padding: 74px 0 86px;
    }

    .hero-card {
        justify-self: start;
    }

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

    .detail-poster {
        position: relative;
        top: auto;
        max-width: 360px;
    }
}

@media (max-width: 680px) {
    .site-logo span:last-child {
        max-width: 190px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

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

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

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

    .section {
        padding: 42px 0;
    }

    .section-header {
        display: block;
    }

    .btn {
        width: 100%;
    }

    .hero-actions .btn {
        width: auto;
    }

    .detail-content {
        padding: 22px;
    }
}
