:root {
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --blue-soft: #dbeafe;
    --green: #16a34a;
    --text: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --panel: #ffffff;
    --page: #f8fafc;
    --dark: #0f172a;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.10);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

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

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

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

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 6px 22px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(16px);
}

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

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

.brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    color: #ffffff;
    background: linear-gradient(135deg, var(--blue), #60a5fa);
    border-radius: 12px;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.28);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    color: #374151;
    font-weight: 650;
    white-space: nowrap;
}

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

.main-nav a:hover {
    color: var(--blue);
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: #eff6ff;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 5px auto;
    background: var(--blue);
    border-radius: 99px;
}

.hero {
    position: relative;
    overflow: hidden;
    color: #ffffff;
    background: radial-gradient(circle at 20% 20%, rgba(96, 165, 250, 0.56), transparent 35%), linear-gradient(135deg, #0f172a, #1e3a8a 46%, #2563eb);
}

.hero-bg {
    position: absolute;
    inset: 0;
    opacity: 0.42;
    background-image: radial-gradient(circle at 85% 20%, rgba(255,255,255,0.32), transparent 24%), radial-gradient(circle at 20% 90%, rgba(16,185,129,0.32), transparent 26%);
}

.hero-inner {
    position: relative;
    min-height: 540px;
    padding: 64px 0 52px;
}

.hero-slider {
    position: relative;
    min-height: 420px;
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) 430px;
    align-items: center;
    gap: 42px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(18px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

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

.eyebrow,
.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    color: var(--blue);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero .eyebrow,
.detail-hero .eyebrow,
.page-hero .eyebrow {
    color: #bfdbfe;
}

.hero h1,
.page-hero h1,
.detail-copy h1 {
    margin: 0 0 18px;
    font-size: clamp(34px, 5vw, 62px);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.hero p,
.page-hero p,
.detail-copy p {
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: 18px;
    max-width: 720px;
}

.hero-tags,
.tag-row,
.tag-cloud {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-tags {
    margin: 24px 0;
}

.hero-tags span,
.tag-row span,
.tag-cloud span {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.hero-tags span {
    padding: 7px 12px;
    color: #dbeafe;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

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

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

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

.btn-primary {
    color: #ffffff;
    background: var(--blue);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.28);
}

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

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

.page-hero .btn-ghost,
.category-hero .btn-ghost,
.ranking-hero .btn-ghost {
    color: var(--blue);
    background: #eff6ff;
    border-color: #bfdbfe;
}

.hero-poster {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 5;
    border-radius: 28px;
    background: linear-gradient(135deg, #1e3a8a, #60a5fa);
    box-shadow: 0 26px 60px rgba(15, 23, 42, 0.36);
}

.hero-poster img,
.poster-link img,
.detail-cover img,
.mini-movie img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-controls {
    position: absolute;
    left: 0;
    bottom: 42px;
    display: flex;
    gap: 10px;
}

.hero-dot {
    width: 36px;
    height: 6px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.32);
    cursor: pointer;
}

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

.search-hero {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr minmax(320px, 420px);
    align-items: center;
    gap: 24px;
    margin-top: -46px;
    padding: 26px;
    background: #ffffff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.search-hero h2,
.search-hero p {
    margin: 0;
}

.search-hero h2 {
    font-size: 26px;
}

.search-hero p {
    margin-top: 6px;
    color: var(--muted);
}

.quick-search,
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.quick-search input:focus,
.filter-bar input:focus,
.filter-bar select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.quick-search button {
    min-height: 46px;
    padding: 0 18px;
    border: 0;
    border-radius: 12px;
    color: #ffffff;
    background: var(--blue);
    font-weight: 800;
    cursor: pointer;
}

.section-block {
    padding: 48px 0;
}

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

.section-heading h2 {
    margin: 0;
    font-size: clamp(24px, 3vw, 34px);
    letter-spacing: -0.03em;
}

.section-heading a,
.text-link {
    color: var(--blue);
    font-weight: 800;
}

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

.category-card,
.category-overview-card,
.content-card,
.rank-panel {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--radius);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.category-card {
    padding: 22px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.category-card:hover {
    transform: translateY(-4px);
    border-color: #bfdbfe;
    box-shadow: var(--shadow);
}

.category-card h3,
.category-overview-card h2,
.content-card h2,
.rank-panel h2 {
    margin: 0 0 10px;
}

.category-card p,
.category-overview-card p,
.content-card p {
    margin: 0;
    color: var(--muted);
}

.category-samples {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 18px 0;
    color: #374151;
    font-size: 14px;
}

.category-samples a:hover {
    color: var(--blue);
}

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

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

.movie-card {
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: var(--radius);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
    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;
    aspect-ratio: 4 / 5;
    background: linear-gradient(135deg, #dbeafe, #e0f2fe);
}

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

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

.year-badge,
.rank-badge {
    position: absolute;
    z-index: 2;
    top: 12px;
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(8px);
}

.year-badge {
    left: 12px;
}

.rank-badge {
    right: 12px;
    background: var(--blue);
}

.movie-card-body {
    padding: 18px;
}

.movie-meta {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
}

.movie-card h3 {
    margin: 0 0 10px;
    font-size: 18px;
    line-height: 1.35;
}

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

.movie-card p {
    min-height: 58px;
    margin: 0 0 14px;
    color: #4b5563;
    font-size: 14px;
}

.tag-row span,
.tag-cloud span {
    padding: 6px 10px;
    color: var(--blue-dark);
    background: #eff6ff;
}

.home-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
}

.rank-panel {
    position: sticky;
    top: 92px;
    align-self: start;
    padding: 24px;
}

.rank-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rank-line {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: 14px;
    background: #f8fafc;
}

.rank-line:hover {
    color: var(--blue);
    background: #eff6ff;
}

.rank-line span {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    color: #ffffff;
    background: var(--blue);
    border-radius: 10px;
    font-weight: 800;
}

.rank-line strong,
.rank-line em {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-line em {
    grid-column: 2;
    margin-top: -8px;
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

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

.page-hero {
    margin-top: 34px;
    padding: 46px;
    color: #ffffff;
    background: linear-gradient(135deg, #0f172a, #1d4ed8);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.slim-hero,
.category-hero,
.ranking-hero {
    color: var(--text);
    background: #ffffff;
}

.slim-hero p,
.category-hero p,
.ranking-hero p {
    color: var(--muted);
}

.category-overview-card {
    padding: 24px;
}

.category-overview-top {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.category-overview-top > span {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    color: #ffffff;
    background: var(--blue);
    border-radius: 16px;
    font-size: 22px;
    font-weight: 900;
}

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

.mini-movie {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: 14px;
    background: #f8fafc;
}

.mini-movie:hover {
    background: #eff6ff;
}

.mini-movie img {
    aspect-ratio: 4 / 5;
    border-radius: 10px;
    background: #dbeafe;
}

.mini-movie strong,
.mini-movie em {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-movie em {
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

.filter-bar {
    margin-bottom: 24px;
    padding: 18px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.filter-bar select {
    max-width: 180px;
}

.wide-filter input {
    flex: 1.4;
}

.empty-state {
    display: none;
    margin: 26px 0 0;
    padding: 24px;
    text-align: center;
    color: var(--muted);
    background: #ffffff;
    border-radius: var(--radius);
}

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

.related-categories h2 {
    margin-top: 0;
}

.related-categories div {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.related-categories a {
    padding: 10px 14px;
    color: var(--blue);
    background: #eff6ff;
    border-radius: 999px;
    font-weight: 800;
}

.rank-table {
    padding-top: 12px;
}

.rank-table h2 {
    margin: 0 0 18px;
}

.rank-table-row {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) minmax(220px, 0.7fr);
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    margin-bottom: 10px;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--line);
}

.rank-table-row:hover {
    border-color: #bfdbfe;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.rank-table-row span {
    color: var(--blue);
    font-weight: 900;
}

.rank-table-row em {
    color: var(--muted);
    font-style: normal;
}

.detail-main {
    background: #f8fafc;
}

.detail-hero {
    position: relative;
    overflow: hidden;
    color: #ffffff;
}

.detail-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: saturate(1.1);
}

.detail-hero-inner {
    position: relative;
    padding: 34px 0 56px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 28px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 14px;
}

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

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

.detail-cover {
    overflow: hidden;
    aspect-ratio: 4 / 5;
    border-radius: 26px;
    background: #1e3a8a;
    box-shadow: 0 28px 58px rgba(0, 0, 0, 0.32);
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.detail-meta span {
    padding: 8px 12px;
    color: #dbeafe;
    background: rgba(255, 255, 255, 0.13);
    border-radius: 999px;
}

.player-section {
    padding-bottom: 30px;
}

.player-box {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #020617;
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.movie-player {
    width: 100%;
    height: 100%;
    display: block;
    background: #020617;
}

.play-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 0;
    color: #ffffff;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.26), rgba(15, 23, 42, 0.72));
    cursor: pointer;
}

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

.play-overlay span {
    display: grid;
    place-items: center;
    width: 86px;
    height: 86px;
    padding-left: 6px;
    color: #ffffff;
    background: var(--blue);
    border-radius: 999px;
    font-size: 34px;
    box-shadow: 0 18px 42px rgba(37, 99, 235, 0.42);
}

.detail-content {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 22px;
}

.content-card {
    padding: 26px;
}

.content-card:first-child {
    grid-row: span 2;
}

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

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 34px;
    padding: 42px 0 30px;
}

.footer-brand {
    color: #ffffff;
}

.site-footer p {
    color: #94a3b8;
}

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

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

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

.footer-bottom {
    padding: 18px 0;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    color: #94a3b8;
    font-size: 14px;
}

@media (max-width: 1100px) {
    .main-nav {
        gap: 14px;
        font-size: 14px;
    }

    .hero-slide {
        grid-template-columns: 1fr 330px;
    }

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

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

    .rank-panel {
        position: static;
    }
}

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

    .main-nav {
        position: absolute;
        top: 68px;
        left: 16px;
        right: 16px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 12px;
        background: #ffffff;
        border: 1px solid var(--line);
        border-radius: 18px;
        box-shadow: var(--shadow);
    }

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

    .main-nav a {
        padding: 12px 14px;
        border-radius: 12px;
    }

    .main-nav a:hover {
        background: #eff6ff;
    }

    .hero-inner {
        min-height: 680px;
        padding-top: 44px;
    }

    .hero-slider {
        min-height: 570px;
    }

    .hero-slide {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .hero-poster {
        max-width: 320px;
        margin: 0 auto;
    }

    .hero-controls {
        bottom: 26px;
    }

    .search-hero,
    .detail-grid,
    .detail-content,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .quick-search,
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar select {
        max-width: none;
    }

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

    .detail-cover {
        max-width: 280px;
    }

    .rank-table-row {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .rank-table-row em {
        grid-column: 2;
    }
}

@media (max-width: 540px) {
    .container {
        width: min(100% - 24px, 1180px);
    }

    .brand {
        font-size: 19px;
    }

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

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

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero h1,
    .page-hero h1,
    .detail-copy h1 {
        font-size: 34px;
    }

    .hero p,
    .page-hero p,
    .detail-copy p {
        font-size: 16px;
    }

    .player-box {
        border-radius: 18px;
    }
}
