:root {
    --primary: #0284c7;
    --primary-dark: #0369a1;
    --primary-soft: #e0f2fe;
    --secondary: #16a34a;
    --accent: #f97316;
    --ink: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --soft: #f9fafb;
    --surface: #ffffff;
    --dark: #111827;
    --radius: 16px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.10);
    --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.18);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

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

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

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid rgba(229, 231, 235, 0.9);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(16px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    gap: 24px;
}

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: var(--ink);
}

.brand-mark {
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: var(--primary);
    background: linear-gradient(135deg, var(--primary-soft), #ffffff);
    box-shadow: inset 0 0 0 1px rgba(2, 132, 199, 0.14);
}

.brand-mark svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.brand-text {
    font-size: 20px;
    letter-spacing: -0.02em;
}

.desktop-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 22px;
    flex: 1;
}

.nav-link,
.mobile-link {
    color: #374151;
    font-weight: 600;
    transition: color 0.2s ease, background 0.2s ease;
}

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

.menu-button {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: #f3f4f6;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
}

.menu-button span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: #374151;
}

.mobile-menu {
    display: none;
    border-top: 1px solid var(--line);
    background: #ffffff;
}

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

.mobile-menu-inner {
    display: grid;
    gap: 6px;
    padding: 12px 0 16px;
}

.mobile-link {
    display: block;
    padding: 10px 12px;
    border-radius: 12px;
}

.mobile-link:hover,
.mobile-link.is-active {
    background: var(--primary-soft);
}

.hero-shell {
    padding: 32px 0 28px;
}

.hero-carousel {
    position: relative;
    width: min(1280px, calc(100% - 32px));
    height: 70vh;
    min-height: 520px;
    max-height: 760px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 24px;
    background: #111827;
    box-shadow: var(--shadow-lg);
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(1.02);
    pointer-events: none;
    transition: opacity 0.5s ease, transform 0.6s ease;
}

.hero-slide.is-active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.hero-image {
    position: absolute;
    inset: 0;
    height: 100%;
    object-fit: cover;
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.96), rgba(0, 0, 0, 0.58), rgba(0, 0, 0, 0.04));
}

.hero-content {
    position: absolute;
    left: clamp(24px, 7vw, 88px);
    right: clamp(24px, 7vw, 88px);
    bottom: clamp(36px, 8vw, 90px);
    max-width: 760px;
    color: #ffffff;
}

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

.hero-badges span,
.detail-badges span,
.tag {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    background: rgba(2, 132, 199, 0.94);
}

.hero-badges span:nth-child(3) {
    background: rgba(249, 115, 22, 0.95);
}

.hero-content h1,
.hero-content h2 {
    margin: 0 0 18px;
    font-size: clamp(36px, 6vw, 64px);
    line-height: 1.06;
    letter-spacing: -0.04em;
}

.hero-content p {
    max-width: 680px;
    margin: 0 0 28px;
    color: rgba(255, 255, 255, 0.86);
    font-size: clamp(16px, 2vw, 20px);
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 22px;
    border-radius: 999px;
    font-weight: 800;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

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

.btn-primary {
    color: #ffffff;
    background: var(--primary);
    box-shadow: 0 12px 32px rgba(2, 132, 199, 0.30);
}

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

.btn-ghost {
    color: var(--primary-dark);
    background: var(--primary-soft);
}

.btn-glass {
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.42);
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(8px);
}

.hero-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.48);
    font-size: 34px;
    line-height: 1;
    transition: background 0.2s ease;
}

.hero-control:hover {
    background: rgba(0, 0, 0, 0.72);
}

.hero-control.prev {
    left: 18px;
}

.hero-control.next {
    right: 18px;
}

.hero-dots {
    position: absolute;
    right: 32px;
    bottom: 28px;
    display: flex;
    gap: 8px;
}

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

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

.section {
    padding: 42px 0;
}

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

.page-header {
    align-items: center;
    padding: 44px 0 24px;
}

.eyebrow {
    display: inline-flex;
    margin-bottom: 8px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 800;
}

.section-title,
.page-header h1 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(26px, 4vw, 40px);
    line-height: 1.18;
    letter-spacing: -0.03em;
}

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

.search-panel {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 14px;
    align-items: center;
    margin-bottom: 26px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.search-input-wrap {
    position: relative;
}

.search-input-wrap svg {
    position: absolute;
    left: 16px;
    top: 50%;
    width: 20px;
    height: 20px;
    transform: translateY(-50%);
    fill: none;
    stroke: #9ca3af;
    stroke-width: 2;
    stroke-linecap: round;
}

.search-panel input,
.search-panel select {
    width: 100%;
    height: 46px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink);
    background: #ffffff;
    outline: none;
}

.search-panel input {
    padding: 0 18px 0 46px;
}

.search-panel select {
    min-width: 150px;
    padding: 0 14px;
}

.search-panel input:focus,
.search-panel select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.12);
}

.filter-row {
    display: flex;
    gap: 10px;
}

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

.movie-card {
    display: block;
    overflow: hidden;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    transition: transform 0.24s ease, box-shadow 0.24s ease;
}

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

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

.card-poster img {
    height: 100%;
    object-fit: cover;
    transition: transform 0.34s ease;
}

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

.card-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.00) 55%);
    opacity: 0;
    transition: opacity 0.24s ease;
}

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

.score,
.card-category {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 8px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
}

.score {
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.70);
    backdrop-filter: blur(6px);
}

.card-category {
    left: 10px;
    bottom: 10px;
    background: var(--primary);
}

.card-body {
    display: grid;
    gap: 6px;
    padding: 14px;
}

.card-body strong {
    display: -webkit-box;
    min-height: 44px;
    overflow: hidden;
    color: var(--ink);
    font-size: 16px;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    transition: color 0.2s ease;
}

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

.card-meta,
.card-text {
    color: var(--muted);
    font-size: 13px;
}

.card-text {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

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

.category-card {
    display: grid;
    gap: 10px;
    min-height: 168px;
    padding: 22px;
    border-radius: 20px;
    color: var(--ink);
    background: linear-gradient(135deg, #ffffff, var(--primary-soft));
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.category-card strong {
    font-size: 22px;
}

.category-card span {
    color: var(--muted);
    font-size: 14px;
}

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

.ranking-panel,
.side-panel {
    overflow: hidden;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.ranking-panel .mini-card,
.side-panel .mini-card {
    border-bottom: 1px solid var(--line);
}

.ranking-panel .mini-card:last-child,
.side-panel .mini-card:last-child {
    border-bottom: 0;
}

.mini-card {
    display: grid;
    grid-template-columns: auto 58px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 12px;
    transition: background 0.2s ease;
}

.mini-card:hover {
    background: #f8fafc;
}

.mini-card img {
    width: 58px;
    height: 78px;
    border-radius: 10px;
    object-fit: cover;
    background: #e5e7eb;
}

.mini-card strong {
    display: -webkit-box;
    overflow: hidden;
    color: var(--ink);
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.mini-card em {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
}

.rank-num {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #ffffff;
    background: var(--accent);
    font-weight: 900;
}

.detail-hero {
    padding: 34px 0 26px;
}

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

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

.detail-head {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 28px;
    align-items: center;
    padding: 24px;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.detail-poster {
    border-radius: 18px;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #e5e7eb;
}

.detail-poster img {
    height: 100%;
    object-fit: cover;
}

.detail-info h1 {
    margin: 0 0 12px;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.12;
    letter-spacing: -0.03em;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 14px 0 18px;
    color: var(--muted);
}

.detail-meta span {
    padding: 6px 10px;
    border-radius: 999px;
    background: #f3f4f6;
}

.detail-info p {
    color: #374151;
    font-size: 17px;
}

.player-section {
    padding: 20px 0 44px;
}

.player-frame {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    background: #050505;
    box-shadow: var(--shadow-lg);
}

.player-frame video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #050505;
}

.play-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 0;
    color: #ffffff;
    background: radial-gradient(circle at center, rgba(2, 132, 199, 0.22), rgba(0, 0, 0, 0.58));
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.play-icon {
    display: grid;
    width: 86px;
    height: 86px;
    place-items: center;
    border-radius: 999px;
    background: var(--primary);
    box-shadow: 0 18px 46px rgba(2, 132, 199, 0.40);
    font-size: 34px;
    line-height: 1;
    transform: translateZ(0);
    transition: transform 0.2s ease, background 0.2s ease;
}

.play-overlay:hover .play-icon {
    transform: scale(1.06);
    background: var(--primary-dark);
}

.content-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 28px;
    align-items: start;
    padding-bottom: 54px;
}

.article-box,
.related-box {
    border-radius: 20px;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.article-box {
    padding: 28px;
}

.article-box h2,
.related-box h2,
.side-panel h2 {
    margin: 0 0 16px;
    font-size: 22px;
}

.article-box p {
    margin: 0 0 18px;
    color: #374151;
    font-size: 16px;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.tag {
    color: var(--primary-dark);
    background: var(--primary-soft);
}

.related-box,
.side-panel {
    padding: 18px;
}

.related-grid {
    display: grid;
    gap: 10px;
}

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

.empty-message.is-visible {
    display: block;
}

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

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 34px;
    padding: 48px 0;
}

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

.footer-about p,
.site-footer a,
.site-footer li {
    color: #9ca3af;
}

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

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

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

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

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

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

    .menu-button {
        display: inline-flex;
    }

    .hero-carousel {
        height: 62vh;
        min-height: 480px;
        border-radius: 20px;
    }

    .hero-control {
        display: none;
    }

    .hero-dots {
        left: 24px;
        right: auto;
    }

    .section-header,
    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .filter-row {
        flex-wrap: wrap;
    }

    .filter-row select {
        flex: 1 1 160px;
    }

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

    .detail-poster {
        width: min(260px, 70vw);
    }
}

@media (max-width: 680px) {
    .container,
    .hero-carousel {
        width: min(100% - 24px, 1280px);
    }

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

    .card-body {
        padding: 12px;
    }

    .card-body strong {
        font-size: 14px;
    }

    .hero-content {
        left: 22px;
        right: 22px;
        bottom: 56px;
    }

    .hero-actions .btn,
    .detail-actions .btn {
        width: 100%;
    }

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

    .article-box {
        padding: 20px;
    }
}
