:root {
    --bg: #f7fafc;
    --surface: #ffffff;
    --surface-soft: #f1f5f9;
    --text: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --accent: #14b8a6;
    --gold: #facc15;
    --danger: #ef4444;
    --shadow: 0 18px 55px rgba(15, 23, 42, 0.14);
    --radius: 20px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

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

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

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    backdrop-filter: blur(18px);
}

.header-inner {
    width: min(1220px, calc(100% - 32px));
    height: 72px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 13px;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.35);
}

.brand-text {
    font-size: 22px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-link {
    padding: 8px 13px;
    border-radius: 999px;
    color: #334155;
    font-size: 14px;
    font-weight: 700;
    transition: 0.2s ease;
}

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

.mobile-menu-button {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 13px;
    background: var(--surface-soft);
    color: var(--text);
    font-size: 22px;
}

.mobile-nav {
    display: none;
    padding: 0 16px 16px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
}

.hero-carousel {
    position: relative;
    min-height: 640px;
    overflow: hidden;
    background: linear-gradient(120deg, #2563eb, #14b8a6);
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
    align-items: center;
    gap: 42px;
    width: min(1220px, calc(100% - 32px));
    margin: 0 auto;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.7s ease;
}

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

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.24;
    filter: saturate(1.15);
}

.hero-carousel::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(circle at 20% 30%, rgba(250, 204, 21, 0.24), transparent 26%),
        linear-gradient(90deg, rgba(15, 23, 42, 0.68), rgba(15, 23, 42, 0.18));
}

.hero-content,
.hero-poster {
    position: relative;
    z-index: 2;
}

.hero-content {
    max-width: 720px;
    color: #ffffff;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    margin-bottom: 18px;
    color: #fef9c3;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    backdrop-filter: blur(12px);
    font-weight: 800;
}

.hero-content h1 {
    margin: 0 0 12px;
    font-size: clamp(38px, 6vw, 68px);
    line-height: 1.05;
    letter-spacing: -0.07em;
}

.hero-content h2 {
    margin: 0 0 18px;
    font-size: clamp(26px, 3.5vw, 42px);
}

.hero-content p {
    max-width: 650px;
    margin: 0 0 22px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 18px;
}

.hero-tags,
.detail-meta,
.card-meta,
.category-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-tags span,
.detail-meta span,
.category-stats span {
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
    font-weight: 700;
}

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

.primary-button,
.ghost-button,
.text-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 22px;
    border-radius: 999px;
    font-weight: 900;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-button {
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 15px 35px rgba(37, 99, 235, 0.35);
}

.ghost-button {
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.38);
    background: rgba(255, 255, 255, 0.13);
    backdrop-filter: blur(12px);
}

.text-button {
    min-height: 38px;
    padding: 0 16px;
    color: var(--primary);
    background: #eff6ff;
}

.primary-button:hover,
.ghost-button:hover,
.text-button:hover {
    transform: translateY(-2px);
}

.hero-poster {
    display: block;
    border-radius: 32px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transform: rotate(2deg);
}

.hero-poster img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
}

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

.hero-dots button {
    width: 34px;
    height: 8px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.42);
    cursor: pointer;
}

.hero-dots button.active {
    background: #ffffff;
}

.search-panel {
    margin-top: 36px;
    margin-bottom: 26px;
}

.search-card {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1.1fr);
    gap: 22px;
    align-items: center;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 15px 45px rgba(15, 23, 42, 0.08);
}

.search-card h2 {
    margin: 0 0 6px;
    font-size: 24px;
}

.search-card p,
.section-head p,
.page-hero p,
.category-hero-content p,
.footer-inner p {
    margin: 0;
    color: var(--muted);
}

.search-controls {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr 0.8fr;
    gap: 12px;
}

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

.result-count {
    color: var(--muted);
    font-weight: 700;
}

.content-section {
    margin-top: 54px;
}

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

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

.section-more {
    color: var(--primary);
    font-weight: 900;
}

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

.category-tile {
    position: relative;
    min-height: 210px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    border-radius: var(--radius);
    color: #ffffff;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.16);
}

.category-tile img,
.category-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.category-tile img {
    object-fit: cover;
    transition: transform 0.35s ease;
}

.category-overlay {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.05), rgba(15, 23, 42, 0.78));
}

.category-tile strong,
.category-tile small,
.category-tile p {
    position: relative;
    z-index: 1;
}

.category-tile strong {
    font-size: 23px;
}

.category-tile small,
.category-tile p {
    color: rgba(255, 255, 255, 0.82);
}

.category-tile p {
    margin: 8px 0 0;
    font-size: 13px;
}

.category-tile:hover img {
    transform: scale(1.08);
}

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

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

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

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

.movie-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.07);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.poster-link {
    position: relative;
    display: block;
    overflow: hidden;
    background: #dbeafe;
}

.poster-link img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transition: transform 0.35s ease;
}

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

.play-mask {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #ffffff;
    font-size: 44px;
    background: rgba(15, 23, 42, 0.18);
    opacity: 0;
    transition: opacity 0.2s ease;
}

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

.card-type,
.rank-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 9px;
    border-radius: 999px;
    color: #ffffff;
    background: var(--primary);
    font-size: 12px;
    font-weight: 900;
}

.rank-badge {
    left: auto;
    right: 10px;
    background: var(--danger);
}

.card-body {
    padding: 14px;
}

.card-title {
    display: -webkit-box;
    min-height: 48px;
    overflow: hidden;
    color: var(--text);
    font-size: 16px;
    font-weight: 900;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.card-meta {
    margin: 8px 0;
    color: var(--muted);
    font-size: 12px;
}

.card-meta span:not(:last-child)::after {
    content: "·";
    margin-left: 8px;
    color: #cbd5e1;
}

.card-desc {
    display: -webkit-box;
    min-height: 42px;
    margin: 0 0 10px;
    overflow: hidden;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.card-tags,
.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.card-tags span,
.detail-tags span {
    padding: 4px 8px;
    border-radius: 999px;
    color: var(--primary);
    background: #eff6ff;
    font-size: 12px;
    font-weight: 800;
}

.split-layout {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 34px;
}

.ranking-list {
    display: grid;
    gap: 10px;
}

.ranking-list a {
    display: grid;
    grid-template-columns: 38px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #ffffff;
}

.ranking-list span {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    color: #ffffff;
    background: linear-gradient(135deg, var(--danger), #f97316);
    border-radius: 10px;
    font-weight: 900;
}

.ranking-list strong {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ranking-list em {
    color: var(--muted);
    font-style: normal;
    font-size: 13px;
}

.page-main {
    padding-top: 34px;
}

.page-hero,
.category-hero,
.detail-hero {
    position: relative;
    overflow: hidden;
    border-radius: 0 0 34px 34px;
}

.page-hero {
    padding: 54px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: var(--shadow);
}

.page-hero h1 {
    margin: 0 0 10px;
    font-size: clamp(34px, 5vw, 56px);
}

.category-overview-grid {
    display: grid;
    gap: 22px;
    margin-top: 34px;
}

.category-overview-card {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 24px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.thumb-collage {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    overflow: hidden;
    border-radius: 16px;
}

.thumb-collage img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.category-overview-card h2 {
    margin: 0 0 8px;
}

.category-overview-card p {
    color: var(--muted);
}

.category-hero {
    min-height: 360px;
    color: #ffffff;
    background: #0f172a;
}

.category-hero-bg,
.detail-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.32;
}

.category-hero::after,
.detail-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.88), rgba(15, 23, 42, 0.3));
}

.category-hero-content {
    position: relative;
    z-index: 1;
    padding: 80px 0;
}

.category-hero-content span,
.detail-category {
    display: inline-flex;
    margin-bottom: 12px;
    padding: 7px 12px;
    border-radius: 999px;
    color: #fef9c3;
    background: rgba(255, 255, 255, 0.14);
    font-weight: 900;
}

.category-hero-content h1 {
    margin: 0 0 12px;
    font-size: clamp(38px, 6vw, 62px);
}

.detail-hero {
    min-height: 520px;
    color: #ffffff;
    background: #0f172a;
}

.detail-hero-inner {
    position: relative;
    z-index: 1;
    padding: 36px 0 70px;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 26px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 14px;
}

.breadcrumbs a:hover {
    color: #ffffff;
}

.detail-layout {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    gap: 36px;
    align-items: center;
}

.detail-poster {
    overflow: hidden;
    border-radius: 26px;
    box-shadow: var(--shadow);
}

.detail-poster img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
}

.detail-info h1 {
    margin: 0 0 16px;
    font-size: clamp(36px, 6vw, 68px);
    line-height: 1.05;
}

.detail-one-line {
    max-width: 780px;
    margin: 0 0 22px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 18px;
}

.detail-tags {
    margin: 20px 0 26px;
}

.player-section {
    margin-top: -46px;
    position: relative;
    z-index: 5;
}

.video-shell {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 28px;
    background: #020617;
    box-shadow: var(--shadow);
}

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

.big-play {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 0;
    color: #ffffff;
    background: rgba(2, 6, 23, 0.35);
    cursor: pointer;
}

.big-play span {
    width: 78px;
    height: 78px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(12px);
    font-size: 34px;
}

.big-play strong {
    font-size: 18px;
}

.big-play.is-hidden {
    display: none;
}

.player-message {
    position: absolute;
    left: 18px;
    bottom: 18px;
    color: #ffffff;
    background: rgba(15, 23, 42, 0.72);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 13px;
}

.player-message:empty {
    display: none;
}

.detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 36px;
}

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

.story-card h2 {
    margin: 0 0 12px;
}

.story-card p {
    margin: 0;
    color: #334155;
}

.empty-state {
    padding: 40px;
    text-align: center;
    color: var(--muted);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    background: #ffffff;
}

.site-footer {
    margin-top: 70px;
    padding: 44px 0;
    color: #cbd5e1;
    background: #0f172a;
}

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

.footer-logo {
    color: #ffffff;
    font-size: 24px;
    font-weight: 900;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.footer-links a {
    padding: 8px 12px;
    border-radius: 999px;
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.08);
}

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

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

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

    .hero-poster {
        display: none;
    }
}

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

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

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

    .hero-carousel {
        min-height: 620px;
    }

    .search-card,
    .search-controls,
    .split-layout,
    .detail-content,
    .footer-inner,
    .category-overview-card {
        grid-template-columns: 1fr;
    }

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

    .page-hero {
        padding: 34px 24px;
    }

    .detail-layout {
        gap: 22px;
    }

    .detail-poster {
        max-width: 260px;
    }

    .footer-links {
        justify-content: flex-start;
    }
}

@media (max-width: 560px) {
    .wrap,
    .header-inner,
    .footer-inner {
        width: min(100% - 22px, 1220px);
    }

    .hero-content h1 {
        font-size: 38px;
    }

    .hero-content p,
    .detail-one-line {
        font-size: 16px;
    }

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

    .card-title {
        min-height: auto;
    }

    .category-hero-content,
    .detail-hero-inner {
        padding-top: 42px;
    }
}
