:root {
    --bg: #0b1020;
    --bg-soft: #10192f;
    --card: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --line: rgba(148, 163, 184, 0.25);
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --red: #dc2626;
    --gold: #f59e0b;
    --shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: #f5f7fb;
}

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

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

button,
input,
select {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 80;
    color: #fff;
    background: linear-gradient(90deg, #2563eb, #1d4ed8 55%, #4338ca);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.25);
}

.header-inner {
    width: min(1200px, calc(100% - 32px));
    height: 64px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 26px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: max-content;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.logo-mark {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-grid;
    place-items: center;
    color: #1d4ed8;
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4), 0 10px 24px rgba(0, 0, 0, 0.15);
}

.logo-text {
    font-size: 20px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    font-size: 15px;
    font-weight: 600;
}

.main-nav a {
    opacity: 0.92;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.main-nav a:hover {
    color: #dbeafe;
    opacity: 1;
}

.header-search {
    margin-left: auto;
    width: min(360px, 32vw);
    position: relative;
}

.header-search input,
.local-search input,
.search-box input {
    width: 100%;
    border: 0;
    outline: none;
    border-radius: 999px;
}

.header-search input {
    padding: 10px 46px 10px 18px;
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px);
}

.header-search input::placeholder {
    color: #dbeafe;
}

.header-search button,
.mobile-toggle {
    border: 0;
    color: #fff;
    cursor: pointer;
}

.header-search button {
    position: absolute;
    right: 8px;
    top: 50%;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.16);
}

.mobile-toggle {
    display: none;
    margin-left: auto;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.14);
}

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

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

.mobile-nav a {
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
}

.hero {
    position: relative;
    height: 600px;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(180deg, #111827, #0b1020);
}

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

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

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: radial-gradient(circle at 25% 20%, #3b82f6, transparent 34%), linear-gradient(135deg, #111827, #1d4ed8);
}

.hero-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(5, 8, 18, 0.95) 0%, rgba(5, 8, 18, 0.58) 48%, rgba(5, 8, 18, 0.2) 100%);
}

.hero-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 0 0 74px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    color: #fff;
    background: #dc2626;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(220, 38, 38, 0.32);
}

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

.hero p {
    max-width: 720px;
    margin: 0 0 28px;
    color: #e5e7eb;
    font-size: 18px;
    line-height: 1.8;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 11px 20px;
    border-radius: 999px;
    border: 0;
    color: #fff;
    background: var(--blue);
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    background: var(--blue-dark);
    box-shadow: 0 12px 26px rgba(37, 99, 235, 0.25);
}

.btn.secondary {
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(6px);
}

.btn.light {
    color: #1d4ed8;
    background: #fff;
}

.hero-controls {
    position: absolute;
    right: max(24px, calc((100% - 1200px) / 2));
    bottom: 48px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

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

.section {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 56px 0;
}

.section.compact {
    padding: 32px 0;
}

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

.section-kicker {
    margin: 0 0 8px;
    color: var(--blue);
    font-weight: 800;
    letter-spacing: 0.08em;
}

.section-title {
    margin: 0;
    font-size: clamp(26px, 3vw, 40px);
    line-height: 1.15;
    font-weight: 900;
    color: #111827;
}

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

.grid {
    display: grid;
    gap: 22px;
}

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

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

.movie-card,
.category-card,
.rank-card,
.detail-panel,
.search-panel {
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 22px;
    background: #fff;
    box-shadow: var(--shadow);
}

.movie-card {
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 26px 55px rgba(15, 23, 42, 0.18);
}

.poster {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: radial-gradient(circle at 30% 20%, #60a5fa 0, transparent 32%), linear-gradient(135deg, #111827, #2563eb);
}

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

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

.poster::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 42%, rgba(0, 0, 0, 0.72));
}

.poster-label {
    position: absolute;
    left: 14px;
    bottom: 14px;
    z-index: 2;
    max-width: calc(100% - 28px);
    padding: 6px 10px;
    border-radius: 999px;
    color: #fff;
    background: rgba(37, 99, 235, 0.9);
    font-size: 12px;
    font-weight: 700;
}

.movie-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 18px;
}

.movie-title {
    margin: 0 0 9px;
    font-size: 18px;
    line-height: 1.35;
    font-weight: 900;
    color: #111827;
}

.movie-title a:hover {
    color: var(--blue);
}

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

.summary {
    margin: 12px 0 16px;
    color: #4b5563;
    line-height: 1.7;
    font-size: 14px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    color: #1d4ed8;
    background: #dbeafe;
    font-size: 12px;
    font-weight: 700;
}

.category-card {
    position: relative;
    min-height: 180px;
    padding: 24px;
    color: #fff;
    background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.25), transparent 24%), linear-gradient(135deg, #2563eb, #4338ca);
}

.category-card:nth-child(2n) {
    background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.25), transparent 24%), linear-gradient(135deg, #7c3aed, #2563eb);
}

.category-card:nth-child(3n) {
    background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.25), transparent 24%), linear-gradient(135deg, #0f172a, #2563eb);
}

.category-card h2,
.category-card h3 {
    margin: 0 0 12px;
    font-size: 24px;
    font-weight: 900;
}

.category-card p {
    margin: 0 0 20px;
    color: #e5e7eb;
    line-height: 1.7;
}

.rank-layout {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr;
    gap: 24px;
}

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

.rank-item {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid rgba(226, 232, 240, 0.92);
    border-radius: 16px;
    background: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rank-item:hover {
    transform: translateX(4px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

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

.rank-info h3 {
    margin: 0 0 5px;
    font-size: 16px;
    font-weight: 900;
}

.rank-info p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.page-hero {
    color: #fff;
    background: radial-gradient(circle at 15% 10%, rgba(96, 165, 250, 0.45), transparent 30%), linear-gradient(135deg, #111827, #1d4ed8 60%, #4338ca);
}

.page-hero .section {
    padding: 64px 0;
}

.page-hero h1 {
    max-width: 900px;
    margin: 0;
    font-size: clamp(32px, 4vw, 54px);
    line-height: 1.1;
    font-weight: 900;
}

.page-hero p {
    max-width: 760px;
    margin: 16px 0 0;
    color: #e5e7eb;
    line-height: 1.8;
}

.local-search,
.search-box {
    margin-top: 24px;
    padding: 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
}

.local-search input,
.search-box input {
    min-height: 48px;
    padding: 0 20px;
    color: #111827;
    background: #fff;
}

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

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    color: #dbeafe;
    font-size: 14px;
}

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

.video-player {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    background: #020617;
    box-shadow: 0 28px 60px rgba(2, 6, 23, 0.3);
    cursor: pointer;
}

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

.player-cover {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.1), rgba(2, 6, 23, 0.82));
}

.player-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
}

.play-button {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 4;
    width: 82px;
    height: 82px;
    border: 0;
    border-radius: 50%;
    color: #1d4ed8;
    background: rgba(255, 255, 255, 0.96);
    font-size: 30px;
    font-weight: 900;
    transform: translate(-50%, -50%);
    cursor: pointer;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
    transition: transform 0.2s ease, background 0.2s ease;
}

.play-button:hover {
    transform: translate(-50%, -50%) scale(1.06);
    background: #fff;
}

.video-player.is-playing .player-cover,
.video-player.is-playing .play-button {
    display: none;
}

.player-state {
    min-height: 24px;
    margin-top: 12px;
    color: #4b5563;
}

.detail-panel {
    padding: 26px;
}

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

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

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

.info-row {
    display: grid;
    grid-template-columns: 76px 1fr;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
}

.info-row dt {
    color: var(--muted);
    font-weight: 700;
}

.info-row dd {
    margin: 0;
    color: #111827;
}

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

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

.footer-inner h2,
.footer-inner h3 {
    margin: 0 0 14px;
    color: #fff;
    font-size: 18px;
    font-weight: 900;
}

.footer-inner p,
.footer-inner a {
    color: #9ca3af;
    line-height: 1.8;
}

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

.footer-bottom {
    border-top: 1px solid rgba(75, 85, 99, 0.5);
    padding: 18px 0;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
}

.hidden-card {
    display: none !important;
}

.empty-result {
    display: none;
    padding: 24px;
    border-radius: 18px;
    color: #4b5563;
    background: #fff;
    box-shadow: var(--shadow);
}

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

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

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

@media (max-width: 760px) {
    .header-inner {
        height: 60px;
        gap: 12px;
    }

    .main-nav,
    .header-search {
        display: none;
    }

    .mobile-toggle {
        display: inline-grid;
        place-items: center;
    }

    .hero {
        height: 560px;
    }

    .hero-content {
        padding-bottom: 78px;
    }

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

    .hero-controls {
        left: 16px;
        right: auto;
        bottom: 36px;
    }

    .section-header {
        display: block;
    }

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

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

    .rank-item .btn {
        grid-column: 1 / -1;
    }

    .detail-panel {
        padding: 20px;
    }
}
