:root {
    color-scheme: dark;
    --page: #020617;
    --panel: #0f172a;
    --panel-soft: #111827;
    --line: #1e293b;
    --text: #ffffff;
    --muted: #94a3b8;
    --dim: #64748b;
    --brand: #2563eb;
    --brand-bright: #3b82f6;
    --cyan: #22d3ee;
    --danger: #ef4444;
    --shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100%;
    background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 34rem), var(--page);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

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

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

button,
input {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(30, 41, 59, 0.92);
    box-shadow: 0 16px 35px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(16px);
}

.nav-inner {
    width: min(1180px, calc(100% - 32px));
    height: 68px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
}

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

.logo-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand), var(--cyan));
    color: #ffffff;
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.38);
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    color: #cbd5e1;
    font-size: 15px;
}

.desktop-nav a,
.mobile-nav a {
    transition: color 180ms ease, background 180ms ease;
}

.desktop-nav a:hover,
.desktop-nav a.active,
.mobile-nav a:hover,
.mobile-nav a.active {
    color: #ffffff;
}

.header-search {
    position: relative;
    width: 260px;
    flex: 0 0 auto;
}

.header-search input,
.search-hero input {
    width: 100%;
    border: 1px solid transparent;
    outline: none;
    color: #ffffff;
    background: #1e293b;
    border-radius: 12px;
    padding: 11px 44px 11px 14px;
}

.header-search input:focus,
.search-hero input:focus {
    border-color: var(--brand-bright);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.28);
}

.header-search button,
.search-hero button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    border-radius: 10px;
    padding: 8px 10px;
    color: #dbeafe;
    background: var(--brand);
    cursor: pointer;
}

.mobile-toggle {
    display: none;
    border: 0;
    background: transparent;
    color: #e2e8f0;
    font-size: 28px;
    cursor: pointer;
}

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

.mobile-nav a {
    display: block;
    padding: 12px 0;
    color: #cbd5e1;
    border-top: 1px solid rgba(51, 65, 85, 0.65);
}

.mobile-nav .header-search {
    width: 100%;
    margin-top: 10px;
}

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

.page-section {
    padding: 54px 0;
}

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

.section-title {
    margin: 0;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.1;
}

.section-kicker {
    margin: 0 0 9px;
    color: var(--brand-bright);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.section-desc {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.8;
}

.text-link {
    color: #bfdbfe;
    font-weight: 700;
}

.text-link:hover {
    color: #ffffff;
}

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

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    background-position: center;
    background-size: cover;
    transition: opacity 700ms ease, transform 700ms ease;
    transform: scale(1.02);
}

.hero-slide.active {
    opacity: 1;
    transform: scale(1);
}

.hero-slide::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.96), rgba(0, 0, 0, 0.74) 45%, rgba(0, 0, 0, 0.16));
}

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

.hero-copy {
    max-width: 680px;
    padding: 72px 0;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 7px 12px;
    border-radius: 999px;
    color: #ffffff;
    background: var(--brand);
    font-size: 14px;
    font-weight: 700;
}

.hero-title {
    margin: 0 0 16px;
    font-size: clamp(42px, 7vw, 72px);
    line-height: 1.02;
    font-weight: 900;
    letter-spacing: -0.05em;
}

.hero-subtitle {
    max-width: 620px;
    margin: 0 0 12px;
    color: #e2e8f0;
    font-size: 20px;
    line-height: 1.65;
}

.hero-summary {
    max-width: 650px;
    margin: 0 0 28px;
    color: var(--muted);
    line-height: 1.8;
}

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

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 12px;
    padding: 13px 22px;
    cursor: pointer;
    color: #ffffff;
    background: #1e293b;
    font-weight: 800;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
    transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.button:hover {
    transform: translateY(-2px);
    background: #334155;
}

.button.primary {
    background: var(--brand);
}

.button.primary:hover {
    background: #1d4ed8;
    box-shadow: 0 18px 36px rgba(37, 99, 235, 0.35);
}

.hero-arrow {
    position: absolute;
    z-index: 4;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    font-size: 28px;
    transition: background 180ms ease, transform 180ms ease;
}

.hero-arrow:hover {
    background: rgba(15, 23, 42, 0.85);
}

.hero-prev {
    left: 22px;
}

.hero-next {
    right: 22px;
}

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

.hero-dot {
    width: 18px;
    height: 5px;
    border: 0;
    border-radius: 999px;
    background: #475569;
    cursor: pointer;
    transition: width 180ms ease, background 180ms ease;
}

.hero-dot.active {
    width: 36px;
    background: var(--brand-bright);
}

.category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.category-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 45px;
    padding: 12px 18px;
    border-radius: 12px;
    background: #1e293b;
    color: #ffffff;
    font-weight: 700;
    transition: background 180ms ease, transform 180ms ease;
}

.category-chip:hover {
    background: var(--brand);
    transform: translateY(-2px);
}

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

.movie-card {
    min-width: 0;
}

.poster-box {
    position: relative;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 14px;
    background: #1e293b;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.24);
}

.poster-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 300ms ease, filter 300ms ease;
}

.movie-card:hover .poster-box img {
    transform: scale(1.1);
    filter: brightness(0.76);
}

.card-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    opacity: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.15));
    transition: opacity 220ms ease;
}

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

.play-mark {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 999px;
    background: var(--brand);
    color: #ffffff;
    font-size: 24px;
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.42);
}

.card-badge,
.card-year {
    position: absolute;
    top: 10px;
    z-index: 2;
    border-radius: 8px;
    padding: 5px 8px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
}

.card-badge {
    left: 10px;
    background: var(--brand);
}

.card-year {
    right: 10px;
    background: rgba(0, 0, 0, 0.62);
}

.card-title {
    margin: 12px 0 6px;
    color: #ffffff;
    font-size: 15px;
    line-height: 1.42;
    font-weight: 800;
    transition: color 180ms ease;
}

.movie-card:hover .card-title {
    color: #60a5fa;
}

.card-text {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.line-clamp-1,
.line-clamp-2,
.line-clamp-3 {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
}

.line-clamp-1 {
    -webkit-line-clamp: 1;
}

.line-clamp-2 {
    -webkit-line-clamp: 2;
}

.line-clamp-3 {
    -webkit-line-clamp: 3;
}

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

.category-panel {
    display: block;
    min-height: 230px;
    padding: 24px;
    border: 1px solid rgba(51, 65, 85, 0.92);
    border-radius: 20px;
    background: linear-gradient(145deg, #0f172a, #111827);
    box-shadow: var(--shadow);
    transition: transform 200ms ease, border-color 200ms ease, background 200ms ease;
}

.category-panel:hover {
    transform: translateY(-4px);
    border-color: rgba(59, 130, 246, 0.8);
    background: linear-gradient(145deg, #111827, #1e293b);
}

.category-panel h2,
.category-panel h3 {
    margin: 16px 0 8px;
    font-size: 24px;
}

.category-panel p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.preview-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.preview-row img {
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 10px;
    object-fit: cover;
    background: #1e293b;
}

.rank-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.rank-item {
    display: grid;
    grid-template-columns: 70px 70px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border-radius: 16px;
    background: #0f172a;
    border: 1px solid rgba(30, 41, 59, 0.86);
    transition: background 180ms ease, transform 180ms ease;
}

.rank-item:hover {
    background: #1e293b;
    transform: translateX(4px);
}

.rank-number {
    color: #60a5fa;
    font-size: 26px;
    font-weight: 900;
    text-align: center;
}

.rank-poster {
    width: 58px;
    aspect-ratio: 2 / 3;
    border-radius: 10px;
    object-fit: cover;
    background: #1e293b;
}

.rank-title {
    margin: 0 0 6px;
    color: #ffffff;
    font-size: 18px;
    font-weight: 800;
}

.rank-meta,
.rank-desc {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.search-hero {
    position: relative;
    max-width: 780px;
    margin: 0 auto 34px;
}

.search-page .movie-card.is-hidden {
    display: none;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 0.85fr);
    gap: 28px;
    padding: 38px 0 54px;
}

.content-card,
.info-card {
    border-radius: 20px;
    background: #0f172a;
    border: 1px solid rgba(30, 41, 59, 0.9);
    box-shadow: var(--shadow);
}

.content-card {
    padding: 26px;
}

.info-card {
    padding: 22px;
}

.player-card {
    overflow: hidden;
    border-radius: 20px;
    background: #000000;
    border: 1px solid rgba(30, 41, 59, 0.9);
    box-shadow: var(--shadow);
    margin-bottom: 22px;
}

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

.movie-player {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #000000;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 0;
    color: #ffffff;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.2));
    cursor: pointer;
    z-index: 3;
    transition: opacity 200ms ease, visibility 200ms ease;
}

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

.player-overlay .play-mark {
    width: 82px;
    height: 82px;
    font-size: 36px;
}

.player-error {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 4;
    display: none;
    width: min(420px, calc(100% - 40px));
    transform: translate(-50%, -50%);
    padding: 18px;
    border-radius: 14px;
    color: #fecaca;
    background: rgba(127, 29, 29, 0.88);
    text-align: center;
}

.player-error.is-visible {
    display: block;
}

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

.breadcrumb a:hover {
    color: #ffffff;
}

.detail-title {
    margin: 0 0 16px;
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.15;
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 22px;
}

.meta-pill,
.tag-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 7px 12px;
    color: #dbeafe;
    background: #1e293b;
    font-size: 13px;
    font-weight: 700;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin: 20px 0 26px;
}

.tag-pill {
    color: #cbd5e1;
    background: #111827;
    border: 1px solid #263244;
}

.detail-block {
    margin-top: 24px;
}

.detail-block h2 {
    margin: 0 0 10px;
    font-size: 22px;
}

.detail-block p {
    margin: 0;
    color: #cbd5e1;
    line-height: 1.9;
}

.info-card img {
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 16px;
    object-fit: cover;
    background: #1e293b;
    margin-bottom: 18px;
}

.info-list {
    display: grid;
    gap: 13px;
    margin: 0;
}

.info-list div {
    display: grid;
    gap: 5px;
}

.info-list dt {
    color: var(--muted);
    font-size: 13px;
}

.info-list dd {
    margin: 0;
    color: #ffffff;
    font-weight: 700;
}

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

.feature-card {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 16px;
    padding: 14px;
    border-radius: 18px;
    background: #0f172a;
    border: 1px solid #1e293b;
    transition: transform 180ms ease, background 180ms ease;
}

.feature-card:hover {
    transform: translateY(-3px);
    background: #1e293b;
}

.feature-card img {
    width: 130px;
    aspect-ratio: 16 / 10;
    border-radius: 14px;
    object-fit: cover;
    background: #1e293b;
}

.feature-card h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.feature-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
    font-size: 14px;
}

.site-footer {
    border-top: 1px solid rgba(30, 41, 59, 0.9);
    background: #0f172a;
    margin-top: 42px;
}

.footer-inner {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 38px 0;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 28px;
}

.footer-inner p {
    color: var(--muted);
    line-height: 1.8;
}

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

.footer-links a {
    color: var(--muted);
}

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

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

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

@media (max-width: 880px) {
    .desktop-nav,
    .nav-inner > .header-search {
        display: none;
    }

    .mobile-toggle {
        display: block;
    }

    body.mobile-nav-open .mobile-nav {
        display: block;
    }

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

    .hero-arrow {
        display: none;
    }

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

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

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

@media (max-width: 640px) {
    .nav-inner {
        width: min(100% - 24px, 1180px);
    }

    .container,
    .hero-content,
    .footer-inner,
    .mobile-nav {
        width: min(100% - 24px, 1180px);
    }

    .logo {
        font-size: 20px;
    }

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

    .hero-copy {
        padding: 52px 0;
    }

    .hero-title {
        font-size: 42px;
    }

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

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

    .button {
        width: 100%;
    }

    .section-head {
        display: block;
    }

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

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

    .feature-card {
        grid-template-columns: 110px minmax(0, 1fr);
    }

    .feature-card img {
        width: 110px;
    }

    .rank-item {
        grid-template-columns: 46px 56px minmax(0, 1fr);
    }

    .rank-desc {
        display: none;
    }

    .rank-item .button {
        display: none;
    }
}
