* {
    box-sizing: border-box;
}

:root {
    --bg: #f8fafc;
    --text: #0f172a;
    --muted: #64748b;
    --deep: #020617;
    --panel: #ffffff;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --accent: #f97316;
    --line: #e2e8f0;
    --shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 44%, #eef4ff 100%);
}

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

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    color: #ffffff;
    background: linear-gradient(90deg, #0f172a 0%, #1e293b 52%, #0f172a 100%);
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.25);
}

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

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

.brand {
    font-size: 22px;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #60a5fa);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    padding: 9px 14px;
    border-radius: 999px;
    color: #dbeafe;
    font-weight: 600;
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #ffffff;
    background: rgba(59, 130, 246, 0.28);
}

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

.mobile-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 5px auto;
    border-radius: 4px;
    background: #ffffff;
}

.mobile-nav {
    display: none;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 12px 0 18px;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
}

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

.mobile-link {
    padding: 10px 12px;
    border-radius: 12px;
    color: #dbeafe;
    background: rgba(255, 255, 255, 0.05);
}

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

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

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

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

.hero-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.36) 46%, rgba(2, 6, 23, 0.14));
}

.hero-content {
    position: absolute;
    left: 50%;
    bottom: 68px;
    z-index: 2;
    width: min(1180px, calc(100% - 32px));
    transform: translateX(-50%);
    color: #ffffff;
}

.hero-badge,
.section-badge,
.detail-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    color: #ffffff;
    background: #2563eb;
    font-size: 14px;
    font-weight: 700;
}

.hero h1,
.hero h2 {
    max-width: 860px;
    margin: 18px 0 18px;
    font-size: clamp(38px, 6vw, 72px);
    line-height: 1.04;
    letter-spacing: -0.04em;
}

.hero p {
    max-width: 720px;
    margin: 0 0 28px;
    color: #e2e8f0;
    font-size: clamp(17px, 2.4vw, 22px);
    line-height: 1.7;
}

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

.btn-primary,
.btn-secondary,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 12px;
    border: 0;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
    color: #ffffff;
    background: #2563eb;
    box-shadow: 0 16px 28px rgba(37, 99, 235, 0.28);
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}

.btn-secondary,
.btn-ghost {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover,
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.24);
    transform: translateY(-2px);
}

.hero-arrow,
.hero-dot {
    position: absolute;
    z-index: 3;
    border: 0;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.46);
    cursor: pointer;
}

.hero-arrow {
    top: 50%;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    transform: translateY(-50%);
    font-size: 24px;
}

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

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

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

.hero-dot {
    position: static;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    padding: 0;
    background: rgba(255, 255, 255, 0.5);
    transition: width 0.2s ease, background 0.2s ease;
}

.hero-dot.active {
    width: 34px;
    background: #ffffff;
}

.page-hero {
    padding: 76px 0 42px;
    color: #ffffff;
    background: radial-gradient(circle at 20% 0%, rgba(37, 99, 235, 0.45), transparent 34%), linear-gradient(135deg, #0f172a, #1e293b 56%, #020617);
}

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

.page-hero h1 {
    margin: 14px 0 12px;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.08;
}

.page-hero p {
    max-width: 820px;
    margin: 0;
    color: #cbd5e1;
    font-size: 18px;
    line-height: 1.75;
}

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

.main-layout {
    padding: 56px 0 72px;
}

.section-block {
    margin-bottom: 56px;
}

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

.section-head h2 {
    margin: 0;
    font-size: clamp(26px, 4vw, 36px);
    letter-spacing: -0.02em;
}

.section-head p {
    max-width: 680px;
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

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

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

.movie-card,
.horizontal-card,
.rank-item,
.category-card,
.detail-panel {
    background: var(--panel);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 22px;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.movie-card a,
.horizontal-card a,
.rank-item a,
.category-card a {
    display: block;
    height: 100%;
}

.poster-frame {
    position: relative;
    aspect-ratio: 2 / 3;
    margin: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #0f172a, #1e293b);
}

.movie-card.large .poster-frame,
.feature-card .poster-frame {
    aspect-ratio: 16 / 9;
}

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

.movie-card:hover .poster-frame img,
.horizontal-card:hover img,
.rank-item:hover img,
.category-card:hover {
    transform: scale(1.06);
}

.poster-frame::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 45%;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.78), transparent);
}

.poster-year,
.poster-type {
    position: absolute;
    z-index: 2;
    top: 12px;
    padding: 5px 9px;
    border-radius: 999px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    backdrop-filter: blur(8px);
}

.poster-year {
    left: 12px;
    background: rgba(37, 99, 235, 0.86);
}

.poster-type {
    right: 12px;
    background: rgba(15, 23, 42, 0.7);
}

.card-body {
    padding: 16px;
}

.meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
}

.meta-line span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.movie-card h3,
.horizontal-card h3,
.rank-item h3,
.category-card h3 {
    margin: 9px 0 8px;
    font-size: 18px;
    line-height: 1.35;
}

.movie-card p,
.horizontal-card p,
.rank-item p,
.category-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.62;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 14px;
}

.tag-row span {
    padding: 4px 8px;
    border-radius: 999px;
    color: #1d4ed8;
    background: #dbeafe;
    font-size: 12px;
    font-weight: 700;
}

.scroll-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(270px, 360px);
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 12px;
    scroll-snap-type: x proximity;
}

.horizontal-card a {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 14px;
    padding: 12px;
}

.horizontal-card img {
    width: 120px;
    height: 86px;
    object-fit: cover;
    border-radius: 16px;
    background: #0f172a;
    transition: transform 0.35s ease;
}

.horizontal-card span,
.rank-item small {
    color: var(--muted);
    font-size: 13px;
}

.feature-strip {
    padding: 32px;
    border-radius: 28px;
    background: linear-gradient(90deg, #f1f5f9, #dbeafe);
}

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

.category-card {
    min-height: 190px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.category-card a {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 22px;
}

.category-card:hover {
    box-shadow: var(--shadow);
}

.category-card p {
    margin: 10px 0 18px;
}

.category-card span {
    color: #2563eb;
    font-weight: 800;
}

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

.rank-item a {
    display: grid;
    grid-template-columns: 54px 96px 1fr;
    gap: 16px;
    align-items: center;
    padding: 12px;
}

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

.rank-item img {
    width: 96px;
    height: 72px;
    object-fit: cover;
    border-radius: 14px;
    background: #0f172a;
    transition: transform 0.35s ease;
}

.filter-panel {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 12px;
    padding: 18px;
    margin-bottom: 28px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

.filter-panel input,
.filter-panel select {
    width: 100%;
    min-height: 46px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 0 14px;
    color: var(--text);
    background: #ffffff;
    font: inherit;
}

.empty-result {
    display: none;
    padding: 28px;
    border-radius: 22px;
    color: var(--muted);
    background: #ffffff;
    text-align: center;
}

.empty-result.show {
    display: block;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    color: #cbd5e1;
}

.breadcrumb a {
    color: #ffffff;
    font-weight: 700;
}

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

.player-card {
    overflow: hidden;
    border-radius: 28px;
    background: #020617;
    box-shadow: var(--shadow);
}

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

.movie-player-video {
    width: 100%;
    height: 100%;
    display: block;
    background: #020617;
}

.player-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: grid;
    place-items: center;
    border: 0;
    padding: 0;
    color: #ffffff;
    background: rgba(2, 6, 23, 0.35);
    cursor: pointer;
}

.player-overlay[hidden] {
    display: none;
}

.player-overlay img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.55;
}

.player-start {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 88px;
    height: 88px;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    background: #2563eb;
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.45);
    font-size: 34px;
    cursor: pointer;
}

.detail-panel {
    padding: 26px;
    margin-top: 24px;
}

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

.detail-panel p {
    color: #334155;
    line-height: 1.9;
}

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

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

.info-grid span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 13px;
}

.info-grid strong {
    display: block;
    line-height: 1.4;
}

.sidebar {
    display: grid;
    gap: 18px;
}

.sidebar-card {
    padding: 20px;
    border-radius: 24px;
    background: #ffffff;
    border: 1px solid var(--line);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

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

.mini-list a {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    align-items: center;
}

.mini-list img {
    width: 72px;
    height: 54px;
    object-fit: cover;
    border-radius: 12px;
    background: #0f172a;
}

.mini-list h3 {
    margin: 0 0 5px;
    font-size: 15px;
}

.mini-list span {
    color: var(--muted);
    font-size: 12px;
}

.site-footer {
    color: #cbd5e1;
    background: #0f172a;
}

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

.footer-brand {
    color: #ffffff;
    font-size: 22px;
}

.footer-about p,
.site-footer li {
    color: #94a3b8;
    line-height: 1.75;
}

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

.site-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

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

.footer-bottom {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 20px 0 28px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    color: #64748b;
    text-align: center;
}

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

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

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

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

    .mobile-toggle {
        display: block;
    }

    .hero {
        height: 74vh;
        min-height: 560px;
    }

    .hero-content {
        bottom: 72px;
    }

    .hero-arrow {
        display: none;
    }

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

    .section-head {
        display: block;
    }

    .feature-strip {
        padding: 20px;
    }

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

    .rank-item a {
        grid-template-columns: 42px 78px 1fr;
        gap: 10px;
    }

    .rank-number {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }

    .rank-item img {
        width: 78px;
        height: 58px;
    }

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

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

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

    .brand {
        font-size: 18px;
    }

    .horizontal-card a {
        grid-template-columns: 96px 1fr;
    }

    .horizontal-card img {
        width: 96px;
        height: 72px;
    }
}
