* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: #111827;
    background: #f9fafb;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

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

img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(16px);
}

.site-nav {
    max-width: 1280px;
    height: 64px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

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

.brand-mark {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
    font-size: 16px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 22px;
    color: #4b5563;
    font-size: 14px;
    font-weight: 600;
}

.nav-link {
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
    color: #0891b2;
}

.menu-toggle {
    display: none;
    border: 0;
    background: #f3f4f6;
    color: #374151;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 22px;
    cursor: pointer;
}

.hero-carousel {
    position: relative;
    height: 620px;
    overflow: hidden;
    color: #ffffff;
    background: #111827;
}

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

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

.hero-slide img {
    position: absolute;
    inset: 0;
}

.hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.56), rgba(0, 0, 0, 0.08));
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 1280px;
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.hero-kicker {
    display: inline-flex;
    margin-bottom: 18px;
    padding: 6px 14px;
    border-radius: 999px;
    background: #2563eb;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
}

.hero-content h1 {
    max-width: 780px;
    margin: 0 0 18px;
    font-size: clamp(36px, 6vw, 64px);
    line-height: 1.05;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.hero-content p {
    max-width: 720px;
    margin: 0 0 20px;
    color: #e5e7eb;
    font-size: 19px;
}

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

.hero-tags,
.detail-tags,
.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-tags span,
.detail-tags span,
.tag-row span {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    font-size: 12px;
    font-weight: 700;
}

.hero-tags span {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.hero-actions {
    margin-top: 28px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.btn-primary,
.btn-ghost,
.home-search-form button,
.section-more,
.category-body span,
.watch-anchor {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 22px;
    border-radius: 12px;
    font-weight: 800;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary,
.home-search-form button,
.section-more,
.category-body span {
    color: #ffffff;
    background: #2563eb;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
}

.btn-primary:hover,
.home-search-form button:hover,
.section-more:hover,
.category-card:hover .category-body span {
    background: #1d4ed8;
    transform: translateY(-2px);
}

.btn-ghost {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
}

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

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 4;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 50%;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.48);
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
    transition: background 0.2s ease;
}

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

.hero-prev {
    left: 24px;
}

.hero-next {
    right: 24px;
}

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

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

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

.home-search {
    max-width: 1180px;
    margin: -42px auto 0;
    padding: 0 24px;
    position: relative;
    z-index: 6;
}

.home-search-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 16px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
}

.home-search-form input,
.filter-panel input,
.filter-panel select {
    width: 100%;
    min-height: 48px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 0 16px;
    outline: none;
    color: #111827;
    background: #ffffff;
    font: inherit;
}

.home-search-form input:focus,
.filter-panel input:focus,
.filter-panel select:focus {
    border-color: #06b6d4;
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.12);
}

.category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.category-chips a {
    padding: 8px 14px;
    border-radius: 999px;
    color: #374151;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.content-section,
.page-shell,
.detail-shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 58px 24px 0;
}

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

.section-head h2,
.page-hero h1,
.detail-info h1 {
    margin: 0;
    color: #111827;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.15;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.section-head p,
.page-hero p {
    margin: 8px 0 0;
    color: #6b7280;
}

.section-head.simple {
    align-items: center;
}

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

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

.movie-card {
    overflow: hidden;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.14);
}

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

.poster-link img {
    transition: transform 0.35s ease;
}

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

.play-dot {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: #2563eb;
    border-radius: 50%;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.4);
}

.rank-badge,
.rank-num {
    position: absolute;
    left: 12px;
    top: 12px;
    z-index: 2;
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: linear-gradient(135deg, #f97316, #ef4444);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 900;
}

.movie-info {
    padding: 16px;
}

.movie-title {
    display: block;
    color: #111827;
    font-size: 17px;
    font-weight: 900;
    line-height: 1.35;
}

.movie-title:hover,
.rank-title:hover {
    color: #2563eb;
}

.movie-meta,
.movie-desc {
    margin: 7px 0 0;
    color: #6b7280;
    font-size: 13px;
}

.movie-desc {
    min-height: 42px;
}

.tag-row {
    margin-top: 12px;
}

.ranking-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 32px;
    align-items: start;
}

.ranking-panel {
    position: sticky;
    top: 86px;
    padding: 22px;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

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

.rank-item {
    position: relative;
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 14px;
    align-items: center;
    padding: 10px;
    border-radius: 16px;
    background: #f9fafb;
}

.rank-num {
    position: static;
    grid-row: span 1;
}

.rank-cover {
    width: 72px;
    height: 94px;
    overflow: hidden;
    border-radius: 12px;
    background: #111827;
}

.rank-title {
    color: #111827;
    font-weight: 900;
}

.rank-item p {
    margin: 4px 0 0;
    color: #6b7280;
    font-size: 13px;
}

.page-hero {
    padding: 56px 42px;
    border-radius: 28px;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #0f766e);
    box-shadow: 0 18px 42px rgba(37, 99, 235, 0.22);
}

.page-hero h1,
.page-hero p {
    color: #ffffff;
}

.page-hero p {
    max-width: 780px;
    font-size: 18px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.category-card {
    overflow: hidden;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.category-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 42px rgba(15, 23, 42, 0.12);
}

.category-covers {
    height: 190px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
    background: #111827;
}

.category-body {
    padding: 22px;
}

.category-body h2 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 900;
}

.category-body p {
    min-height: 52px;
    margin: 0 0 18px;
    color: #6b7280;
}

.filter-panel {
    margin: 30px 0;
    padding: 18px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.search-box span {
    display: block;
    margin-bottom: 6px;
    color: #374151;
    font-weight: 800;
}

.filter-selects {
    display: flex;
    align-items: end;
    gap: 10px;
}

.filter-selects select {
    min-width: 140px;
}

.movie-card.is-hidden,
.rank-item.is-hidden {
    display: none;
}

.detail-shell {
    padding-top: 34px;
}

.detail-hero {
    padding: 24px;
    border-radius: 28px;
    background: linear-gradient(135deg, #0f172a, #1e3a8a);
    color: #ffffff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.2);
}

.breadcrumb {
    margin: 0 0 18px;
    color: #cbd5e1;
    font-size: 14px;
}

.breadcrumb a:hover {
    color: #67e8f9;
}

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

.player-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    background: #000000;
    aspect-ratio: 16 / 9;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.34);
}

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

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

.player-overlay span {
    width: 86px;
    height: 86px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #2563eb;
    font-size: 34px;
    box-shadow: 0 16px 34px rgba(37, 99, 235, 0.5);
}

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

.detail-info h1 {
    color: #ffffff;
}

.detail-one-line {
    margin: 16px 0;
    color: #e5e7eb;
    font-size: 18px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.detail-meta span {
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
}

.detail-tags span {
    background: rgba(255, 255, 255, 0.12);
    color: #bfdbfe;
}

.watch-anchor {
    margin-top: 26px;
}

.detail-content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-top: 28px;
}

.story-card {
    padding: 28px;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.story-card h2 {
    margin: 0 0 14px;
    font-size: 24px;
    font-weight: 900;
}

.story-card p {
    margin: 0;
    color: #4b5563;
    font-size: 16px;
}

.related-section {
    padding-left: 0;
    padding-right: 0;
}

.ranking-grid .movie-card:nth-child(-n + 3) {
    box-shadow: 0 16px 38px rgba(239, 68, 68, 0.16);
}

.rank-page-list {
    margin-top: 28px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 44px 24px;
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: 38px;
}

.footer-logo {
    color: #ffffff;
}

.footer-brand p {
    max-width: 560px;
    color: #9ca3af;
}

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

.footer-links h2 {
    margin: 0 0 6px;
    color: #ffffff;
    font-size: 16px;
}

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

.copyright {
    max-width: 1280px;
    margin: 0 auto;
    padding: 18px 24px 28px;
    border-top: 1px solid #1f2937;
    color: #9ca3af;
    font-size: 14px;
}

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

    .ranking-layout,
    .detail-layout,
    .detail-content,
    .footer-inner {
        grid-template-columns: 1fr;
    }

    .ranking-panel {
        position: static;
    }

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

@media (max-width: 820px) {
    .site-nav {
        height: auto;
        min-height: 64px;
        flex-wrap: wrap;
        padding: 10px 16px;
    }

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

    .nav-links {
        width: 100%;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 8px 0 4px;
    }

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

    .nav-link {
        padding: 10px 12px;
        border-radius: 10px;
    }

    .nav-link:hover,
    .nav-link.is-active {
        background: #ecfeff;
    }

    .hero-carousel {
        height: 540px;
    }

    .hero-content {
        padding: 0 18px 36px;
    }

    .hero-content p {
        font-size: 16px;
    }

    .hero-arrow {
        display: none;
    }

    .home-search-form,
    .filter-panel,
    .filter-selects {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

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

    .content-section,
    .page-shell,
    .detail-shell {
        padding-left: 16px;
        padding-right: 16px;
    }

    .page-hero {
        padding: 34px 22px;
        border-radius: 22px;
    }
}

@media (max-width: 560px) {
    .brand {
        font-size: 18px;
    }

    .hero-carousel {
        height: 500px;
    }

    .hero-tags {
        display: none;
    }

    .hero-actions {
        gap: 10px;
    }

    .btn-primary,
    .btn-ghost,
    .home-search-form button,
    .section-more,
    .category-body span {
        width: 100%;
    }

    .section-head {
        display: block;
    }

    .section-more {
        margin-top: 14px;
    }

    .movie-grid,
    .compact-grid,
    .category-grid,
    .rank-page-list {
        grid-template-columns: 1fr;
    }

    .rank-item {
        grid-template-columns: 64px 1fr;
    }

    .detail-hero {
        padding: 14px;
    }

    .player-overlay span {
        width: 70px;
        height: 70px;
        font-size: 28px;
    }
}
