:root {
    --primary-50: #f0f9ff;
    --primary-100: #e0f2fe;
    --primary-600: #0284c7;
    --primary-700: #0369a1;
    --secondary-50: #f8fafc;
    --secondary-100: #f1f5f9;
    --secondary-200: #e2e8f0;
    --secondary-500: #64748b;
    --secondary-600: #475569;
    --secondary-700: #334155;
    --secondary-800: #1e293b;
    --secondary-900: #0f172a;
    --accent-50: #fffbeb;
    --accent-400: #fbbf24;
    --accent-500: #f59e0b;
    --accent-600: #d97706;
    --white: #ffffff;
    --black: #000000;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--secondary-50);
    color: var(--secondary-900);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.5;
}

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

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

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.container-custom {
    width: 100%;
    max-width: 80rem;
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgb(255 255 255 / 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
}

.nav-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 4.25rem;
}

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    color: var(--secondary-900);
}

.brand {
    font-size: 1.25rem;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    color: var(--white);
    background: linear-gradient(135deg, var(--primary-600), var(--accent-500));
    box-shadow: var(--shadow-md);
}

.desktop-nav {
    display: none;
    align-items: center;
    gap: 1.35rem;
}

.nav-link {
    color: var(--secondary-700);
    font-weight: 600;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link-active {
    color: var(--primary-600);
}

.mobile-toggle {
    display: inline-flex;
    flex-direction: column;
    gap: 0.3rem;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    background: transparent;
}

.mobile-toggle span {
    display: block;
    width: 1.35rem;
    height: 2px;
    background: var(--secondary-700);
    border-radius: 999px;
}

.mobile-nav {
    display: none;
    border-top: 1px solid var(--secondary-200);
    padding: 0.75rem 1rem 1rem;
    background: var(--white);
}

.mobile-nav.is-open {
    display: grid;
    gap: 0.25rem;
}

.mobile-link {
    padding: 0.75rem 0;
    color: var(--secondary-700);
    font-weight: 600;
}

.hero {
    position: relative;
    height: 500px;
    overflow: hidden;
    background: var(--secondary-900);
}

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

.hero-slide.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

.hero-image {
    position: absolute;
    inset: 0;
}

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

.hero-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgb(0 0 0 / 0.82), rgb(0 0 0 / 0.52), rgb(0 0 0 / 0.2));
}

.hero-content-wrap {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.hero-content {
    max-width: 42rem;
    color: var(--white);
    animation: slideUp 0.5s ease-out;
}

.hero-kicker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1.25rem;
    color: rgb(255 255 255 / 0.85);
    font-size: 0.9rem;
}

.hero-kicker strong {
    display: inline-flex;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: var(--primary-600);
    color: var(--white);
}

.hero h1 {
    margin: 0 0 1rem;
    font-size: clamp(2.4rem, 6vw, 4rem);
    line-height: 1.08;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.hero p {
    margin: 0;
    max-width: 40rem;
    color: rgb(255 255 255 / 0.9);
    font-size: 1.05rem;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-primary,
.btn-secondary,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border-radius: 0.65rem;
    padding: 0.75rem 1.35rem;
    border: 0;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn-primary {
    color: var(--white);
    background: var(--primary-600);
    box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
    background: var(--primary-700);
    transform: translateY(-1px);
    box-shadow: var(--shadow-xl);
}

.btn-secondary {
    color: var(--secondary-900);
    background: var(--white);
    box-shadow: var(--shadow-md);
}

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

.btn-ghost {
    color: var(--primary-700);
    background: var(--primary-50);
}

.btn-ghost:hover {
    background: var(--primary-100);
}

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 4;
    transform: translateY(-50%);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    border: 0;
    color: var(--white);
    background: rgb(0 0 0 / 0.32);
    transition: background 0.2s ease;
}

.hero-arrow:hover {
    background: rgb(0 0 0 / 0.55);
}

.hero-prev {
    left: 1rem;
}

.hero-next {
    right: 1rem;
}

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

.hero-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    border: 0;
    background: rgb(255 255 255 / 0.55);
    transition: width 0.3s ease, background 0.3s ease;
}

.hero-dot.active {
    width: 2rem;
    background: var(--white);
}

.section-block {
    padding: 2rem 0;
}

.section-soft {
    padding: 3rem 0;
    background: linear-gradient(135deg, var(--primary-50), var(--accent-50));
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.section-head h2,
.category-title h1,
.detail-title h1,
.plain-page-title h1 {
    margin: 0;
    color: var(--secondary-900);
    font-size: clamp(1.6rem, 4vw, 2.15rem);
    line-height: 1.2;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.section-head p,
.category-title p,
.plain-page-title p {
    margin: 0.45rem 0 0;
    color: var(--secondary-600);
}

.horizontal-shell {
    position: relative;
}

.horizontal-row {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.horizontal-row::-webkit-scrollbar {
    display: none;
}

.horizontal-item {
    flex: 0 0 200px;
}

.rail-actions {
    display: flex;
    gap: 0.5rem;
}

.rail-control {
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 999px;
    border: 0;
    background: var(--white);
    color: var(--secondary-700);
    box-shadow: var(--shadow-sm);
}

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

.movie-card {
    display: block;
    min-width: 0;
    height: 100%;
    overflow: hidden;
    border-radius: 0.85rem;
    background: var(--white);
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.movie-thumb {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: var(--secondary-200);
}

.movie-thumb-wide {
    width: 8rem;
    height: 5rem;
    aspect-ratio: auto;
    flex: 0 0 auto;
}

.movie-thumb-large {
    aspect-ratio: 16 / 9;
}

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

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

.play-hover {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 2.2rem;
    background: rgb(0 0 0 / 0.42);
    opacity: 0;
    transition: opacity 0.25s ease;
}

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

.play-hover-large {
    font-size: 4rem;
}

.rating-badge {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.4rem;
    color: var(--white);
    background: rgb(0 0 0 / 0.72);
    font-size: 0.75rem;
    font-weight: 800;
}

.movie-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgb(0 0 0 / 0.78), rgb(0 0 0 / 0.1), transparent);
}

.large-info {
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    color: var(--white);
}

.large-info strong {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 1.2rem;
}

.movie-card-body {
    display: grid;
    gap: 0.35rem;
    padding: 0.95rem;
}

.movie-card-body strong {
    display: -webkit-box;
    min-height: 2.85em;
    overflow: hidden;
    color: var(--secondary-900);
    font-size: 0.98rem;
    line-height: 1.42;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.movie-card:hover .movie-card-body strong {
    color: var(--primary-600);
}

.movie-card-body span,
.movie-card-body small {
    overflow: hidden;
    color: var(--secondary-500);
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.movie-card-body em {
    justify-self: start;
    padding: 0.22rem 0.5rem;
    border-radius: 999px;
    color: var(--primary-700);
    background: var(--primary-50);
    font-size: 0.75rem;
    font-style: normal;
    font-weight: 700;
}

.movie-card-horizontal {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.movie-card-horizontal .movie-card-body {
    padding: 0.65rem 0.85rem 0.65rem 0;
}

.movie-card-horizontal .movie-card-body strong {
    min-height: auto;
    -webkit-line-clamp: 1;
}

.category-tabs,
.filter-tabs {
    display: flex;
    gap: 0.65rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    padding-bottom: 0.4rem;
    scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar,
.filter-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab,
.filter-button {
    flex: 0 0 auto;
    border: 0;
    border-radius: 0.65rem;
    padding: 0.65rem 1.15rem;
    color: var(--secondary-700);
    background: var(--secondary-100);
    font-weight: 800;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.category-tab.active,
.filter-button.active {
    color: var(--white);
    background: var(--primary-600);
    box-shadow: var(--shadow-md);
}

.category-panel {
    display: none;
}

.category-panel.active {
    display: block;
}

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

.category-card {
    display: block;
    padding: 1.3rem;
    border-radius: 1rem;
    background: var(--white);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.category-card h2,
.category-card h3 {
    margin: 0 0 0.45rem;
    color: var(--secondary-900);
}

.category-card p {
    margin: 0 0 1rem;
    color: var(--secondary-600);
}

.rank-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.rank-list {
    display: grid;
    gap: 0.75rem;
}

.rank-item {
    display: grid;
    grid-template-columns: 3rem minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border-radius: 0.85rem;
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.rank-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 999px;
    color: var(--white);
    background: var(--secondary-900);
    font-weight: 900;
}

.rank-item:nth-child(1) .rank-number,
.rank-item:nth-child(2) .rank-number,
.rank-item:nth-child(3) .rank-number {
    background: linear-gradient(135deg, var(--primary-600), var(--accent-500));
}

.rank-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    color: var(--secondary-500);
    font-size: 0.9rem;
}

.rank-info strong {
    width: 100%;
    color: var(--secondary-900);
    font-size: 1.05rem;
}

.search-panel {
    padding: 1rem;
    border-radius: 1rem;
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.search-input {
    width: 100%;
    min-height: 3rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--secondary-200);
    border-radius: 0.75rem;
    outline: 0;
    color: var(--secondary-900);
    background: var(--secondary-50);
}

.search-input:focus {
    border-color: var(--primary-600);
    box-shadow: 0 0 0 3px rgb(2 132 199 / 0.16);
}

.empty-search {
    display: none;
    margin: 2rem 0 0;
    color: var(--secondary-600);
    text-align: center;
}

.empty-search.visible {
    display: block;
}

.page-hero {
    padding: 3.4rem 0 2.4rem;
    background: linear-gradient(135deg, var(--secondary-900), var(--primary-700));
    color: var(--white);
}

.page-hero p,
.page-hero a {
    color: rgb(255 255 255 / 0.86);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
    color: var(--secondary-500);
    font-size: 0.9rem;
}

.detail-shell {
    padding: 2rem 0;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.player-card,
.detail-card,
.side-card {
    overflow: hidden;
    border-radius: 1rem;
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.player-box {
    position: relative;
    overflow: hidden;
    background: var(--black);
}

.player-box video {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--black);
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    color: var(--white);
    background: radial-gradient(circle, rgb(0 0 0 / 0.1), rgb(0 0 0 / 0.55));
    z-index: 2;
}

.player-overlay.is-hidden {
    display: none;
}

.player-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 5rem;
    height: 5rem;
    border-radius: 999px;
    background: rgb(2 132 199 / 0.92);
    box-shadow: var(--shadow-xl);
    font-size: 2rem;
    transform: translateZ(0);
}

.detail-card {
    padding: 1.4rem;
}

.detail-title h1 {
    margin-bottom: 1rem;
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem 1rem;
    margin: 1rem 0 1.4rem;
    color: var(--secondary-600);
}

.meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: var(--secondary-100);
    font-size: 0.9rem;
}

.one-line {
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 0.85rem;
    color: var(--primary-700);
    background: var(--primary-50);
    font-weight: 700;
}

.detail-text h2 {
    margin: 1.25rem 0 0.55rem;
    color: var(--secondary-900);
    font-size: 1.25rem;
}

.detail-text p {
    margin: 0;
    color: var(--secondary-700);
    line-height: 1.9;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tag-row a,
.tag-row span {
    display: inline-flex;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    color: var(--primary-700);
    background: var(--primary-50);
    font-size: 0.82rem;
    font-weight: 700;
}

.side-card {
    padding: 1rem;
}

.side-card h2 {
    margin: 0 0 1rem;
    font-size: 1.15rem;
}

.side-list {
    display: grid;
    gap: 0.75rem;
}

.related-section {
    padding: 1rem 0 2rem;
}

.pagination-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.25rem;
}

.pagination-strip a {
    padding: 0.55rem 0.8rem;
    border-radius: 0.6rem;
    background: var(--white);
    color: var(--secondary-700);
    box-shadow: var(--shadow-sm);
    font-weight: 700;
}

.pagination-strip a:hover {
    color: var(--primary-600);
}

.site-footer {
    margin-top: 3rem;
    padding: 3rem 0;
    color: var(--secondary-300);
    background: var(--secondary-900);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.site-footer h2 {
    margin: 0 0 1rem;
    color: var(--white);
    font-size: 1rem;
}

.site-footer p,
.site-footer li {
    color: var(--secondary-500);
    font-size: 0.95rem;
}

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

.site-footer a:hover {
    color: var(--accent-400);
}

.footer-brand {
    margin-bottom: 1rem;
    color: var(--white);
    font-size: 1.15rem;
}

.hidden-by-filter {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 640px) {
    .container-custom {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

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

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

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

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

@media (min-width: 1024px) {
    .container-custom {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    .desktop-nav {
        display: flex;
    }

    .mobile-toggle,
    .mobile-nav {
        display: none !important;
    }

    .hero {
        height: 600px;
    }

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

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

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

    .detail-grid {
        grid-template-columns: minmax(0, 2fr) 22rem;
    }

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

@media (min-width: 1280px) {
    .movie-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .hero-arrow {
        display: none;
    }

    .hero {
        height: 540px;
    }

    .hero-content {
        padding-top: 2rem;
    }

    .hero h1 {
        font-size: 2.35rem;
    }

    .hero p {
        font-size: 0.96rem;
    }

    .detail-card {
        padding: 1rem;
    }
}
