:root {
    --primary: #1e3a8a;
    --primary-light: #2563eb;
    --primary-soft: #dbeafe;
    --accent: #f97316;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --surface-blue: #eff6ff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
    --radius: 22px;
    --container: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

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

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

button,
input {
    font: inherit;
}

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

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

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

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

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

.brand-name {
    font-size: 20px;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    padding: 10px 12px;
    border-radius: 999px;
    color: #334155;
    font-size: 15px;
    transition: color 0.2s ease, background 0.2s ease;
}

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

.header-search,
.mobile-search,
.search-panel {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #ffffff;
    overflow: hidden;
}

.header-search {
    width: 310px;
}

.header-search input,
.mobile-search input,
.search-panel input {
    width: 100%;
    min-width: 0;
    padding: 11px 15px;
    border: 0;
    outline: none;
    color: var(--text);
    background: transparent;
}

.header-search button,
.mobile-search button,
.search-panel button {
    align-self: stretch;
    padding: 0 17px;
    border: 0;
    background: var(--primary);
    color: #ffffff;
    cursor: pointer;
    transition: background 0.2s ease;
}

.header-search button:hover,
.mobile-search button:hover,
.search-panel button:hover {
    background: var(--primary-light);
}

.menu-button {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #ffffff;
    cursor: pointer;
}

.menu-button span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    background: var(--text);
    border-radius: 999px;
}

.mobile-panel {
    display: none;
    padding: 0 16px 18px;
    border-top: 1px solid var(--border);
    background: #ffffff;
}

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

.mobile-search {
    margin: 14px auto;
    max-width: 520px;
}

.mobile-nav-link {
    display: block;
    padding: 12px 6px;
    border-radius: 12px;
    color: #334155;
}

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

.hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 24px;
    width: min(1320px, calc(100% - 32px));
    margin: 24px auto 0;
}

.hero-stage {
    position: relative;
    min-height: 560px;
    overflow: hidden;
    border-radius: 32px;
    background: #0f172a;
    box-shadow: var(--shadow);
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding: 56px;
    opacity: 0;
    pointer-events: none;
    background-image: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.58), rgba(15, 23, 42, 0.18)), var(--hero-image);
    background-size: cover;
    background-position: center;
    transform: scale(1.03);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.hero-shade {
    position: absolute;
    inset: auto 0 0;
    height: 45%;
    background: linear-gradient(0deg, rgba(15, 23, 42, 0.86), rgba(15, 23, 42, 0));
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 680px;
    color: #ffffff;
}

.eyebrow,
.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--primary-light);
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hero-content h1 {
    margin: 0 0 16px;
    font-size: clamp(42px, 6vw, 76px);
    line-height: 0.96;
    letter-spacing: -0.05em;
}

.hero-content p {
    max-width: 620px;
    margin: 0 0 22px;
    color: #dbeafe;
    font-size: 19px;
}

.hero-tags,
.tag-row,
.category-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.hero-tags span,
.tag-row span {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
}

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

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

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

.primary-button {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.32);
}

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

.ghost-button {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.26);
}

.hero-dots {
    position: absolute;
    right: 34px;
    bottom: 30px;
    z-index: 2;
    display: flex;
    gap: 9px;
}

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

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

.hero-rail {
    padding: 22px;
    border-radius: 30px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.hero-rail h2 {
    margin: 0 0 18px;
    font-size: 22px;
}

.hero-rail-card {
    display: grid;
    grid-template-columns: 72px 1fr;
    align-items: center;
    gap: 14px;
    padding: 11px;
    margin-bottom: 13px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #ffffff;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.hero-rail-card:hover {
    transform: translateX(-3px);
    border-color: #bfdbfe;
}

.hero-rail-card img {
    width: 72px;
    height: 96px;
    object-fit: cover;
    border-radius: 14px;
    background: linear-gradient(135deg, #dbeafe, #eff6ff);
}

.hero-rail-card span {
    font-weight: 800;
}

.section {
    padding: 58px 0;
}

.section-soft {
    background: linear-gradient(180deg, #ffffff, var(--surface-blue));
}

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

.section-heading h2,
.page-hero h1,
.detail-info h1 {
    margin: 0;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.section-heading a {
    color: var(--primary);
    font-weight: 800;
}

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

.category-card {
    display: grid;
    min-height: 164px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
    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 span {
    color: var(--primary);
    font-weight: 900;
    font-size: 22px;
}

.category-card strong {
    margin: 12px 0;
    color: #334155;
    font-size: 15px;
}

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

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

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

.movie-card {
    position: relative;
    min-width: 0;
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.movie-card-link {
    display: block;
    height: 100%;
}

.poster {
    position: relative;
    aspect-ratio: 2 / 3;
    background: radial-gradient(circle at top, #bfdbfe, #1e3a8a);
    overflow: hidden;
}

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

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

.rank-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    display: inline-grid;
    min-width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.8);
    color: #ffffff;
    font-weight: 900;
}

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

.movie-card-body h3 {
    display: -webkit-box;
    min-height: 48px;
    margin: 6px 0 8px;
    overflow: hidden;
    font-size: 17px;
    line-height: 1.4;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.movie-card-body p {
    display: -webkit-box;
    min-height: 44px;
    margin: 0 0 12px;
    overflow: hidden;
    color: var(--muted);
    font-size: 14px;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

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

.movie-card-compact .movie-card-body h3 {
    font-size: 16px;
}

.ranking-grid,
.ranking-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.wide-card {
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.wide-card a {
    display: grid;
    grid-template-columns: auto 86px 1fr;
    align-items: center;
    gap: 15px;
    min-height: 122px;
    padding: 13px;
}

.wide-card img {
    width: 86px;
    height: 112px;
    object-fit: cover;
    border-radius: 14px;
    background: linear-gradient(135deg, #dbeafe, #1e3a8a);
}

.wide-card h3 {
    margin: 6px 0 8px;
    font-size: 18px;
}

.wide-card p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 14px;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.wide-rank {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 14px;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 900;
}

.page-hero,
.detail-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #0f172a, #1e3a8a);
    color: #ffffff;
}

.page-hero {
    padding: 74px 0;
}

.page-hero p {
    max-width: 720px;
    color: #dbeafe;
    font-size: 18px;
}

.compact-hero {
    padding: 62px 0 44px;
}

.ranking-hero {
    background: radial-gradient(circle at top left, #2563eb, #0f172a 58%);
}

.category-chip-row {
    margin-top: 24px;
}

.category-chip {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-weight: 800;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

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

.detail-hero {
    background-image: linear-gradient(90deg, rgba(15, 23, 42, 0.98), rgba(30, 58, 138, 0.82), rgba(15, 23, 42, 0.48)), var(--detail-image);
    background-size: cover;
    background-position: center;
}

.detail-backdrop {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 0%, rgba(37, 99, 235, 0.28), rgba(15, 23, 42, 0));
}

.detail-layout {
    position: relative;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 36px;
    align-items: end;
    padding: 70px 0;
}

.detail-poster img {
    width: 260px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border: 6px solid rgba(255, 255, 255, 0.22);
    border-radius: 28px;
    background: linear-gradient(135deg, #dbeafe, #1e3a8a);
    box-shadow: var(--shadow);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    color: #bfdbfe;
    font-weight: 800;
}

.detail-info h1 {
    max-width: 860px;
    color: #ffffff;
}

.detail-one-line {
    max-width: 820px;
    margin: 18px 0;
    color: #dbeafe;
    font-size: 20px;
}

.detail-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.detail-facts span {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.13);
    color: #ffffff;
    font-weight: 800;
}

.detail-tags {
    margin-bottom: 22px;
}

.detail-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    align-items: start;
}

.main-column,
.side-column {
    display: grid;
    gap: 22px;
}

.player-card,
.content-card,
.side-card {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.player-frame {
    overflow: hidden;
    border-radius: 20px;
    background: #020617;
}

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

.player-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
}

.player-actions span {
    color: var(--muted);
    font-weight: 800;
}

.content-card h2,
.side-card h2 {
    margin: 0 0 14px;
    font-size: 24px;
}

.content-card p {
    margin: 0 0 14px;
    color: #334155;
    font-size: 17px;
}

.content-card p:last-child {
    margin-bottom: 0;
}

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

.info-list div {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 10px;
}

.info-list dt {
    color: var(--muted);
    font-weight: 800;
}

.info-list dd {
    margin: 0;
    color: var(--text);
}

.side-links {
    display: grid;
    gap: 10px;
}

.side-links a {
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--surface-blue);
    color: var(--primary);
    font-weight: 800;
}

.search-panel {
    max-width: 760px;
    margin-top: 24px;
    border-color: rgba(255, 255, 255, 0.3);
}

.search-panel input {
    color: #ffffff;
}

.search-panel input::placeholder {
    color: #bfdbfe;
}

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

.empty-state {
    grid-column: 1 / -1;
    padding: 34px;
    border-radius: 24px;
    background: #ffffff;
    color: var(--muted);
    text-align: center;
}

.site-footer {
    padding: 42px 0;
    background: #0f172a;
    color: #cbd5e1;
}

.footer-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

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

.site-footer p {
    max-width: 650px;
    margin: 10px 0 0;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.footer-links a {
    color: #dbeafe;
    font-weight: 800;
}

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

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

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

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

    .hero-rail h2 {
        grid-column: 1 / -1;
    }
}

@media (max-width: 920px) {
    .nav-links,
    .header-search {
        display: none;
    }

    .menu-button {
        display: block;
    }

    .hero-slide {
        padding: 34px;
    }

    .hero-stage {
        min-height: 520px;
    }

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

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

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

    .detail-layout {
        align-items: start;
    }

    .detail-poster img {
        width: 220px;
    }

    .footer-grid {
        align-items: flex-start;
        flex-direction: column;
    }
}

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

    .brand-name {
        font-size: 18px;
    }

    .hero-stage {
        min-height: 610px;
        border-radius: 24px;
    }

    .hero-slide {
        align-items: flex-end;
        padding: 28px 22px 62px;
        background-image: linear-gradient(0deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.55)), var(--hero-image);
    }

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

    .hero-rail {
        display: block;
    }

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

    .section {
        padding: 42px 0;
    }

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

    .wide-card a {
        grid-template-columns: auto 74px 1fr;
    }

    .wide-card img {
        width: 74px;
        height: 98px;
    }

    .wide-rank {
        width: 32px;
        height: 32px;
    }

    .detail-layout {
        padding: 44px 0;
    }

    .detail-poster img {
        width: 180px;
    }

    .player-card,
    .content-card,
    .side-card {
        padding: 16px;
        border-radius: 18px;
    }
}

@media (max-width: 460px) {
    .category-grid,
    .movie-grid,
    .dense-grid,
    .search-results {
        grid-template-columns: 1fr;
    }

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

    .movie-card-body h3 {
        min-height: auto;
    }

    .wide-card a {
        grid-template-columns: 66px 1fr;
    }

    .wide-rank {
        display: none;
    }
}
