:root {
    --night-950: #0b1f33;
    --night-900: #102a43;
    --night-850: #193452;
    --night-800: #243b53;
    --night-700: #334e68;
    --night-600: #486581;
    --text-main: #f3f4f6;
    --text-muted: #cbd5e1;
    --text-soft: #94a3b8;
    --amber: #f59e0b;
    --amber-soft: #fbbf24;
    --border: rgba(148, 163, 184, 0.18);
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

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

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

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 90;
    background: rgba(36, 59, 83, 0.95);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(18px);
}

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

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    color: #111827;
    background: var(--amber);
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.28);
}

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

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-left: auto;
}

.nav-link,
.mobile-link {
    color: #d1d5db;
    transition: color 0.2s ease;
}

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

.header-search,
.mobile-search {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-search input,
.mobile-search input,
.quick-search input,
.filter-panel input,
.filter-panel select {
    border: 1px solid transparent;
    outline: none;
    color: var(--text-main);
    background: var(--night-700);
    border-radius: 12px;
    padding: 10px 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.header-search input {
    width: 240px;
}

.header-search input:focus,
.mobile-search input:focus,
.quick-search input:focus,
.filter-panel input:focus,
.filter-panel select:focus {
    border-color: rgba(245, 158, 11, 0.65);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.13);
    background: var(--night-800);
}

.header-search button,
.mobile-search button,
.quick-search button {
    border: 0;
    color: #111827;
    background: var(--amber);
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 700;
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: var(--night-700);
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 0 11px;
}

.menu-toggle span {
    height: 2px;
    background: var(--text-main);
    border-radius: 99px;
}

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

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

.mobile-nav {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
}

.hero {
    position: relative;
    height: 70vh;
    min-height: 560px;
    overflow: hidden;
    background: var(--night-950);
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

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

.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.04);
    filter: saturate(1.05);
}

.hero-shade {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 78% 35%, rgba(245, 158, 11, 0.18), transparent 28%),
        linear-gradient(90deg, rgba(16, 42, 67, 0.96), rgba(16, 42, 67, 0.74) 42%, rgba(16, 42, 67, 0.25)),
        linear-gradient(0deg, rgba(16, 42, 67, 0.98), rgba(16, 42, 67, 0.2));
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(1280px, calc(100% - 32px));
    height: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: center;
    gap: 56px;
}

.hero-copy {
    max-width: 720px;
    animation: fadeIn 0.6s ease both;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--amber-soft);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 13px;
}

.hero h2,
.page-hero h1,
.detail-info h1 {
    margin: 0;
    font-weight: 900;
    line-height: 1.05;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.42);
}

.hero h2 {
    font-size: clamp(42px, 6vw, 76px);
}

.hero-desc {
    max-width: 680px;
    margin: 22px 0 0;
    color: #e5e7eb;
    font-size: clamp(17px, 2vw, 21px);
}

.hero-tags,
.tag-row,
.genre-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

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

.hero-tags span,
.tag-row span,
.tag-row a,
.genre-links a {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    color: #fde68a;
    background: rgba(245, 158, 11, 0.16);
    border: 1px solid rgba(245, 158, 11, 0.32);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 13px;
}

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

.btn-primary,
.btn-secondary,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: 14px;
    padding: 10px 20px;
    font-weight: 800;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
    color: #111827;
    background: var(--amber);
    box-shadow: 0 0 22px rgba(245, 158, 11, 0.26);
}

.btn-secondary {
    color: var(--text-main);
    background: var(--night-700);
}

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

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

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

.hero-poster::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: inherit;
    pointer-events: none;
}

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

.hero-dots {
    position: absolute;
    z-index: 5;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 9px;
}

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

.hero-dot.active {
    width: 36px;
    background: var(--amber);
}

.quick-search,
.section-wrap,
.page-main,
.site-footer,
.filter-panel,
.category-overview,
.ranking-list,
.breadcrumb,
.detail-hero,
.player-section,
.detail-content {
    width: min(1280px, calc(100% - 32px));
    margin-left: auto;
    margin-right: auto;
}

.quick-search {
    margin-top: -34px;
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 520px);
    gap: 24px;
    align-items: center;
    background: rgba(36, 59, 83, 0.92);
    border: 1px solid var(--border);
    border-radius: 26px;
    padding: 24px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.quick-search h2,
.side-panel h2,
.site-footer h2 {
    margin: 0 0 6px;
}

.quick-search p {
    margin: 0;
    color: var(--text-muted);
}

.quick-search form {
    display: flex;
    gap: 10px;
}

.quick-search input {
    flex: 1;
}

.section-wrap {
    padding-top: 76px;
}

.no-top {
    padding-top: 28px;
}

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

.section-head h2 {
    margin: 0;
    font-size: clamp(26px, 3vw, 40px);
    line-height: 1.15;
}

.section-head a {
    color: var(--amber-soft);
    font-weight: 800;
}

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

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

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

.movie-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(36, 59, 83, 0.72);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.12);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(245, 158, 11, 0.42);
    box-shadow: 0 18px 54px rgba(0, 0, 0, 0.25);
}

.poster-link {
    position: relative;
    display: block;
    overflow: hidden;
    background: var(--night-800);
}

.poster-link img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.poster-badge,
.poster-play {
    position: absolute;
    z-index: 2;
    display: inline-grid;
    place-items: center;
}

.poster-badge {
    top: 10px;
    left: 10px;
    min-width: 48px;
    min-height: 28px;
    border-radius: 999px;
    color: #111827;
    background: rgba(245, 158, 11, 0.92);
    font-size: 13px;
    font-weight: 900;
}

.poster-play {
    right: 12px;
    bottom: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #111827;
    background: rgba(245, 158, 11, 0.92);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.movie-card:hover .poster-play {
    opacity: 1;
    transform: translateY(0);
}

.card-body {
    padding: 16px;
}

.card-body h2 {
    margin: 0 0 7px;
    font-size: 17px;
    line-height: 1.35;
}

.card-body h2 a:hover {
    color: var(--amber-soft);
}

.card-meta,
.card-genre,
.card-desc,
.small-card p,
.rank-item p,
.detail-one-line,
.detail-meta,
.site-footer p,
.page-hero p {
    color: var(--text-muted);
}

.card-meta,
.card-genre,
.card-desc {
    margin: 0 0 8px;
    font-size: 13px;
}

.card-desc {
    color: var(--text-soft);
}

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

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

.category-tile,
.category-card-large a {
    display: block;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(36, 59, 83, 0.88), rgba(51, 78, 104, 0.58));
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.category-tile:hover,
.category-card-large a:hover {
    transform: translateY(-5px);
    border-color: rgba(245, 158, 11, 0.42);
}

.category-tile img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    opacity: 0.74;
}

.category-tile span {
    display: block;
    padding: 14px 16px 4px;
    font-size: 18px;
    font-weight: 900;
}

.category-tile p {
    margin: 0;
    padding: 0 16px 18px;
    color: var(--text-soft);
    font-size: 13px;
}

.split-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 34px;
    align-items: start;
}

.compact-head {
    margin-bottom: 18px;
}

.rank-preview,
.ranking-list {
    display: grid;
    gap: 14px;
}

.rank-item {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: rgba(36, 59, 83, 0.72);
    padding: 12px;
}

.rank-cover {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
}

.rank-cover img {
    width: 86px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

.rank-cover span {
    position: absolute;
    left: 6px;
    top: 6px;
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 28px;
    border-radius: 10px;
    color: #111827;
    background: var(--amber);
    font-weight: 900;
}

.rank-item h2 {
    margin: 0 0 5px;
    font-size: 19px;
}

.rank-item h2 a:hover {
    color: var(--amber-soft);
}

.rank-item p {
    margin: 4px 0 0;
    font-size: 14px;
}

.side-panel {
    position: sticky;
    top: 96px;
    border: 1px solid var(--border);
    border-radius: 26px;
    background: rgba(36, 59, 83, 0.74);
    padding: 22px;
}

.small-card-list {
    display: grid;
    gap: 14px;
}

.small-card a {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.small-card img {
    width: 56px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 12px;
}

.small-card span {
    font-weight: 800;
}

.small-card p {
    margin: 3px 0 0 68px;
    font-size: 13px;
}

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

.page-hero {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: clamp(32px, 6vw, 72px);
    background:
        radial-gradient(circle at 80% 20%, rgba(245, 158, 11, 0.22), transparent 28%),
        linear-gradient(135deg, #102a43, #243b53 60%, #334e68);
    box-shadow: var(--shadow);
}

.page-hero h1 {
    max-width: 820px;
    font-size: clamp(38px, 6vw, 68px);
}

.page-hero p {
    max-width: 760px;
    margin: 18px 0 0;
    font-size: 18px;
}

.filter-panel {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 160px 190px 150px 160px;
    gap: 12px;
    margin-top: 28px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(36, 59, 83, 0.76);
}

.filter-panel select {
    appearance: none;
}

.empty-state {
    display: none;
    margin: 36px 0 0;
    text-align: center;
    color: var(--text-muted);
}

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

.category-overview {
    margin-top: 28px;
}

.category-card-large a {
    height: 100%;
}

.category-collage {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px;
    background: var(--night-950);
}

.category-collage img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    opacity: 0.82;
}

.category-card-large div:last-child {
    padding: 18px;
}

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

.category-card-large p {
    margin: 0 0 12px;
    color: var(--text-muted);
    font-size: 14px;
}

.category-card-large span {
    color: var(--amber-soft);
    font-weight: 800;
}

.inner-section {
    padding-top: 58px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    color: var(--text-soft);
    font-size: 14px;
}

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

.detail-main {
    padding-top: 28px;
}

.detail-hero {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 34px;
    align-items: center;
    margin-top: 22px;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 30px;
    background:
        radial-gradient(circle at 90% 12%, rgba(245, 158, 11, 0.18), transparent 26%),
        rgba(36, 59, 83, 0.78);
}

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

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

.detail-info h1 {
    font-size: clamp(38px, 5vw, 64px);
}

.detail-one-line {
    margin: 18px 0 0;
    font-size: 20px;
}

.detail-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 26px 0;
}

.detail-meta div {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(16, 42, 67, 0.5);
    padding: 14px;
}

.detail-meta dt {
    color: var(--text-soft);
    font-size: 13px;
}

.detail-meta dd {
    margin: 5px 0 0;
    color: var(--text-main);
    font-weight: 800;
}

.player-section {
    margin-top: 28px;
}

.player-shell {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 30px;
    background: #000;
    box-shadow: var(--shadow);
}

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

.player-start {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 0;
    color: #111827;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.56));
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.player-start span {
    display: inline-grid;
    place-items: center;
    width: 86px;
    height: 86px;
    border-radius: 50%;
    background: var(--amber);
    box-shadow: 0 0 45px rgba(245, 158, 11, 0.34);
    font-size: 34px;
    transform: translateX(3px);
}

.player-shell.playing .player-start {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.detail-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    margin-top: 28px;
}

.detail-content article {
    border: 1px solid var(--border);
    border-radius: 24px;
    background: rgba(36, 59, 83, 0.7);
    padding: 24px;
}

.detail-content h2 {
    margin: 0 0 12px;
    font-size: 24px;
}

.detail-content p {
    margin: 0;
    color: #dbeafe;
    font-size: 17px;
}

.genre-links {
    margin-top: 4px;
}

.related-section {
    padding-top: 54px;
}

.site-footer {
    margin-top: 82px;
    padding: 42px 0 28px;
    border-top: 1px solid var(--border);
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) 1fr 1fr;
    gap: 34px;
}

.footer-main p {
    max-width: 560px;
}

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

.site-footer a:hover {
    color: var(--amber-soft);
}

.footer-bottom {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

    .menu-toggle {
        display: flex;
        margin-left: auto;
    }

    .hero-content {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }

    .hero-poster {
        display: none;
    }

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

    .side-panel {
        position: static;
    }

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

@media (max-width: 760px) {
    .header-inner {
        width: min(100% - 24px, 1280px);
        height: 64px;
    }

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

    .hero {
        min-height: 620px;
    }

    .hero-content {
        width: min(100% - 28px, 1280px);
    }

    .quick-search,
    .quick-search form,
    .section-head {
        display: block;
    }

    .quick-search form {
        margin-top: 16px;
    }

    .quick-search input,
    .quick-search button {
        width: 100%;
    }

    .quick-search button {
        margin-top: 10px;
    }

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

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

    .detail-hero {
        padding: 18px;
    }

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

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

    .rank-item {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .rank-cover img {
        width: 72px;
    }
}

@media (max-width: 480px) {
    .movie-grid,
    .library-grid,
    .compact-grid,
    .category-grid,
    .category-overview {
        grid-template-columns: 1fr;
    }

    .hero-actions,
    .slim-actions {
        display: grid;
    }

    .btn-primary,
    .btn-secondary,
    .btn-ghost {
        width: 100%;
    }
}
