:root {
    --bg: #0f172a;
    --bg-deep: #020617;
    --panel: rgba(30, 41, 59, 0.58);
    --panel-strong: #1e293b;
    --line: #334155;
    --text: #f8fafc;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --amber: #fbbf24;
    --amber-strong: #f59e0b;
    --danger: #ef4444;
    --radius: 18px;
    --shadow: 0 18px 60px rgba(2, 6, 23, 0.38);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: radial-gradient(circle at 30% 0%, rgba(251, 191, 36, 0.12), transparent 28%), var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.65;
}

body.menu-open {
    overflow: hidden;
}

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

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

button,
input {
    font: inherit;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(51, 65, 85, 0.75);
}

.nav-wrap {
    max-width: 1280px;
    height: 64px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 22px;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.brand-mark {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: #111827;
    background: linear-gradient(135deg, var(--amber), #fde68a);
    box-shadow: 0 10px 25px rgba(251, 191, 36, 0.28);
    font-size: 15px;
}

.desktop-nav {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 22px;
    overflow: hidden;
}

.desktop-nav a {
    color: #cbd5e1;
    font-size: 15px;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.desktop-nav a:hover,
.mobile-panel a:hover,
.footer-links a:hover {
    color: #ffffff;
}

.nav-search {
    position: relative;
    width: 260px;
    flex: 0 0 auto;
}

.nav-search input,
.mobile-search input,
.search-hero input {
    width: 100%;
    border: 1px solid #334155;
    outline: none;
    background: #1e293b;
    color: #ffffff;
    border-radius: 12px;
    padding: 10px 42px 10px 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nav-search input:focus,
.mobile-search input:focus,
.search-hero input:focus {
    border-color: var(--amber);
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.12);
}

.nav-search button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.nav-search button:hover {
    color: #ffffff;
}

.menu-toggle {
    display: none;
    border: 0;
    background: transparent;
    color: #ffffff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.mobile-panel {
    display: none;
    padding: 18px 24px 24px;
    border-top: 1px solid #1f2937;
    background: rgba(15, 23, 42, 0.98);
}

.mobile-panel a {
    display: block;
    padding: 9px 0;
    color: #cbd5e1;
}

.mobile-search {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.mobile-search input {
    padding-right: 14px;
}

.mobile-search button,
.search-hero button,
.primary-btn,
.secondary-btn {
    border: 0;
    border-radius: 12px;
    background: var(--amber);
    color: #111827;
    font-weight: 800;
    padding: 10px 18px;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.mobile-search button:hover,
.search-hero button:hover,
.primary-btn:hover {
    background: #fcd34d;
    transform: translateY(-1px);
}

main {
    min-height: calc(100vh - 320px);
}

.hero {
    position: relative;
    height: 600px;
    margin-top: 64px;
    overflow: hidden;
    background: #020617;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.7s ease, visibility 0.7s ease;
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
    transition: transform 7s ease;
}

.hero-slide.active img {
    transform: scale(1.08);
}

.hero-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, #0f172a 2%, rgba(15, 23, 42, 0.76) 43%, rgba(15, 23, 42, 0.18) 100%);
}

.hero-content {
    position: absolute;
    left: max(24px, calc((100vw - 1280px) / 2 + 24px));
    right: 24px;
    bottom: 54px;
    z-index: 2;
    max-width: 820px;
}

.hero-kicker,
.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(251, 191, 36, 0.35);
    background: rgba(251, 191, 36, 0.14);
    color: var(--amber);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 700;
}

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

.hero p {
    max-width: 760px;
    margin: 0 0 26px;
    color: #d1d5db;
    font-size: 18px;
}

.hero-actions,
.section-head,
.detail-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.primary-btn,
.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 44px;
}

.secondary-btn {
    border: 1px solid #475569;
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.65);
}

.secondary-btn:hover {
    background: #1e293b;
    transform: translateY(-1px);
}

.hero-dots {
    position: absolute;
    z-index: 3;
    right: max(24px, calc((100vw - 1280px) / 2 + 24px));
    bottom: 62px;
    display: flex;
    gap: 8px;
}

.hero-dots button {
    width: 32px;
    height: 4px;
    border: 0;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.38);
    cursor: pointer;
}

.hero-dots button.active {
    background: var(--amber);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 48px 24px;
}

.page-head {
    padding-top: 112px;
    padding-bottom: 28px;
}

.page-head h1,
.search-hero h1 {
    margin: 0 0 12px;
    font-size: clamp(30px, 4vw, 46px);
    letter-spacing: -0.03em;
}

.page-head p,
.search-hero p {
    max-width: 780px;
    color: var(--muted);
    margin: 0;
}

.section-block {
    margin: 0 0 64px;
}

.section-head {
    justify-content: space-between;
    margin-bottom: 22px;
}

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

.section-link {
    color: var(--amber);
    font-weight: 700;
    white-space: nowrap;
}

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

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

.movie-card {
    display: block;
    min-width: 0;
}

.poster-frame {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 14px;
    background: #111827;
    margin-bottom: 12px;
    box-shadow: 0 12px 35px rgba(2, 6, 23, 0.25);
}

.poster-frame img,
.wide-card-poster img,
.mini-card img,
.rank-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.poster-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.18), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.poster-copy {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    color: #ffffff;
    font-size: 14px;
    line-height: 1.45;
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.year-badge,
.rank-num {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 28px;
    border-radius: 9px;
    background: rgba(0, 0, 0, 0.72);
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
}

.movie-card strong {
    display: block;
    color: #ffffff;
    font-size: 16px;
    line-height: 1.35;
    margin-bottom: 4px;
    transition: color 0.2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.movie-card span:last-child {
    display: block;
    color: var(--muted);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-card:hover img,
.wide-card:hover img,
.mini-card:hover img,
.rank-item:hover img {
    transform: scale(1.1);
}

.movie-card:hover .poster-shade,
.movie-card:hover .poster-copy {
    opacity: 1;
}

.movie-card:hover .poster-copy {
    transform: translateY(0);
}

.movie-card:hover strong,
.wide-card:hover strong,
.rank-item:hover strong,
.mini-card:hover span {
    color: var(--amber);
}

.scroll-row {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    padding: 2px 2px 18px;
    scrollbar-width: thin;
    scrollbar-color: #475569 transparent;
}

.scroll-row .movie-card {
    flex: 0 0 280px;
}

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

.wide-card {
    display: flex;
    overflow: hidden;
    border-radius: 18px;
    background: var(--panel);
    border: 1px solid rgba(51, 65, 85, 0.6);
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.wide-card:hover {
    background: var(--panel-strong);
    border-color: rgba(251, 191, 36, 0.26);
    transform: translateY(-2px);
}

.wide-card-poster {
    position: relative;
    flex: 0 0 180px;
    min-height: 210px;
    overflow: hidden;
    background: #111827;
}

.video-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(251, 191, 36, 0.92);
    color: #111827;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.wide-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.wide-card strong {
    color: #ffffff;
    font-size: 20px;
    line-height: 1.3;
    transition: color 0.2s ease;
}

.muted-line,
.summary-line,
.tag-line {
    color: var(--muted);
    font-size: 14px;
}

.summary-line {
    color: #cbd5e1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tag-line {
    color: #64748b;
}

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

.category-tile {
    min-height: 190px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 22px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.82));
    border: 1px solid rgba(51, 65, 85, 0.65);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-tile:hover {
    transform: translateY(-3px);
    border-color: rgba(251, 191, 36, 0.42);
}

.category-tile strong {
    font-size: 22px;
    color: #ffffff;
}

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

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

.category-preview {
    margin-top: 44px;
}

.category-preview h2 {
    margin: 0 0 18px;
}

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

.mini-card {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 14px;
    background: #111827;
}

.mini-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.78), transparent 62%);
}

.mini-card span {
    position: absolute;
    z-index: 1;
    left: 12px;
    right: 12px;
    bottom: 12px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

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

.rank-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 110px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(30, 41, 59, 0.58);
    border: 1px solid rgba(51, 65, 85, 0.55);
    overflow: hidden;
    transition: transform 0.2s ease, background 0.2s ease;
}

.rank-item:hover {
    transform: translateY(-2px);
    background: #1e293b;
}

.rank-item img {
    width: 70px;
    height: 86px;
    border-radius: 10px;
    flex: 0 0 auto;
}

.rank-num {
    position: static;
    min-width: 42px;
    color: #111827;
    background: var(--amber);
}

.rank-info {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.rank-info strong {
    color: #ffffff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.rank-info small {
    color: var(--muted);
}

.breadcrumb {
    color: #94a3b8;
    font-size: 14px;
    margin-bottom: 22px;
}

.breadcrumb a {
    color: #cbd5e1;
}

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

.player-shell {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: #000000;
    box-shadow: var(--shadow);
    margin-bottom: 28px;
}

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

.player-cover {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: radial-gradient(circle at center, rgba(251, 191, 36, 0.16), rgba(0, 0, 0, 0.42)), rgba(0, 0, 0, 0.15);
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.player-cover-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.player-start {
    width: 88px;
    height: 88px;
    border: 0;
    border-radius: 50%;
    background: var(--amber);
    color: #111827;
    font-size: 34px;
    cursor: pointer;
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.45);
    transition: transform 0.2s ease, background 0.2s ease;
}

.player-start:hover {
    transform: scale(1.07);
    background: #fcd34d;
}

.detail-panel {
    border-radius: 20px;
    background: rgba(30, 41, 59, 0.58);
    border: 1px solid rgba(51, 65, 85, 0.6);
    padding: 28px;
    margin-bottom: 42px;
}

.detail-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.detail-title h1 {
    margin: 0 0 12px;
    font-size: clamp(28px, 4vw, 44px);
    letter-spacing: -0.03em;
}

.meta-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 14px;
}

.copy-block {
    border-top: 1px solid rgba(51, 65, 85, 0.78);
    padding-top: 20px;
    margin-top: 20px;
}

.copy-block h2 {
    margin: 0 0 10px;
    font-size: 20px;
}

.copy-block p {
    margin: 0;
    color: #cbd5e1;
}

.tag-wrap {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tag-wrap span {
    display: inline-flex;
    align-items: center;
    padding: 6px 11px;
    border-radius: 10px;
    background: #334155;
    color: #cbd5e1;
    font-size: 13px;
}

.search-hero {
    padding-top: 118px;
    padding-bottom: 28px;
}

.search-hero form {
    display: flex;
    gap: 12px;
    max-width: 760px;
    margin-top: 24px;
}

.search-hero input {
    padding: 14px 16px;
}

.empty-state {
    display: none;
    padding: 48px;
    text-align: center;
    border: 1px solid rgba(51, 65, 85, 0.6);
    border-radius: 18px;
    color: var(--muted);
    background: rgba(30, 41, 59, 0.45);
}

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

.site-footer {
    margin-top: 72px;
    border-top: 1px solid rgba(51, 65, 85, 0.75);
    background: rgba(15, 23, 42, 0.82);
}

.footer-grid {
    max-width: 1280px;
    margin: 0 auto;
    padding: 46px 24px;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 42px;
}

.footer-brand {
    margin-bottom: 14px;
}

.site-footer p,
.site-footer a,
.copyright {
    color: var(--muted);
    font-size: 14px;
}

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

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

.copyright {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px 24px 30px;
    border-top: 1px solid rgba(51, 65, 85, 0.5);
    text-align: center;
}

@media (max-width: 1120px) {
    .desktop-nav {
        gap: 14px;
    }

    .nav-search {
        width: 220px;
    }

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

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

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

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

    .hero {
        height: 530px;
    }

    .hero-content {
        bottom: 42px;
    }

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

    .featured-grid,
    .rank-list,
    .footer-grid {
        grid-template-columns: 1fr;
    }

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

    .detail-title {
        display: block;
    }

    .search-hero form {
        display: block;
    }

    .search-hero button {
        width: 100%;
        margin-top: 12px;
    }
}

@media (max-width: 560px) {
    .nav-wrap {
        padding: 0 16px;
    }

    .brand {
        font-size: 19px;
    }

    .brand-mark {
        width: 30px;
        height: 30px;
    }

    .container {
        padding: 36px 16px;
    }

    .page-head,
    .search-hero {
        padding-top: 96px;
    }

    .hero {
        height: 510px;
    }

    .hero-content {
        left: 16px;
        right: 16px;
    }

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

    .wide-card {
        display: block;
    }

    .wide-card-poster {
        min-height: 210px;
        aspect-ratio: 16 / 9;
    }

    .scroll-row .movie-card {
        flex-basis: 210px;
    }

    .rank-item {
        align-items: flex-start;
    }

    .rank-item img {
        width: 62px;
        height: 78px;
    }

    .detail-panel {
        padding: 20px;
    }

    .player-start {
        width: 70px;
        height: 70px;
        font-size: 28px;
    }
}
