:root {
    --bg: #020617;
    --bg-soft: #0f172a;
    --panel: rgba(30, 41, 59, 0.62);
    --panel-strong: rgba(30, 41, 59, 0.88);
    --border: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --muted-2: #64748b;
    --accent: #f59e0b;
    --accent-strong: #d97706;
    --radius: 16px;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, #020617 0%, #0f172a 42%, #020617 100%);
    min-height: 100vh;
}

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

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

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(90deg, #0f172a 0%, #1e293b 52%, #0f172a 100%);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
}

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

.logo,
.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #ffffff;
    white-space: nowrap;
}

.logo:hover {
    color: var(--accent);
}

.logo-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    background: var(--accent);
    color: #111827;
    font-size: 14px;
    box-shadow: 0 12px 28px rgba(245, 158, 11, 0.28);
}

.desktop-nav {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 18px;
    color: #cbd5e1;
}

.desktop-nav a,
.mobile-panel a {
    font-size: 15px;
    transition: color 0.2s ease;
}

.desktop-nav a:hover,
.desktop-nav a.active,
.mobile-panel a:hover,
.mobile-panel a.active {
    color: var(--accent);
}

.nav-categories {
    display: flex;
    gap: 14px;
    padding-left: 14px;
    border-left: 1px solid var(--border);
}

.search-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-form input,
.filter-toolbar input,
.filter-toolbar select {
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.92);
    color: #ffffff;
    border-radius: 12px;
    padding: 10px 13px;
    outline: none;
    min-width: 210px;
}

.search-form input:focus,
.filter-toolbar input:focus,
.filter-toolbar select:focus {
    border-color: rgba(245, 158, 11, 0.8);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.14);
}

.search-form button,
.primary-button {
    border: 0;
    border-radius: 12px;
    padding: 10px 16px;
    background: var(--accent);
    color: #111827;
    font-weight: 800;
    transition: transform 0.2s ease, background 0.2s ease;
}

.search-form button:hover,
.primary-button:hover {
    background: #fbbf24;
    transform: translateY(-1px);
}

.mobile-menu-button {
    display: none;
    margin-left: auto;
    border: 0;
    background: transparent;
    color: #ffffff;
    font-size: 28px;
}

.mobile-panel {
    display: none;
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 14px 0 18px;
    border-top: 1px solid var(--border);
}

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

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

.search-panel {
    position: fixed;
    inset: 72px 20px auto auto;
    width: min(560px, calc(100% - 40px));
    max-height: calc(100vh - 96px);
    overflow: auto;
    z-index: 60;
    display: none;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
}

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

.search-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.search-panel-head h2 {
    margin: 0;
    font-size: 18px;
}

.search-close {
    border: 0;
    background: rgba(148, 163, 184, 0.12);
    color: #ffffff;
    border-radius: 10px;
    padding: 6px 10px;
}

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

.search-result {
    display: grid;
    grid-template-columns: 86px 1fr;
    gap: 12px;
    padding: 10px;
    border-radius: 14px;
    background: rgba(30, 41, 59, 0.72);
}

.search-result img {
    width: 86px;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 10px;
}

.search-result h3,
.search-result p {
    margin: 0;
}

.search-result h3 {
    font-size: 15px;
    margin-bottom: 6px;
}

.search-result p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

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

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

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

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

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, #020617 0%, rgba(15, 23, 42, 0.72) 48%, rgba(2, 6, 23, 0.2) 100%);
}

.hero-content {
    position: absolute;
    left: max(24px, calc((100% - 1280px) / 2 + 24px));
    right: 24px;
    bottom: 82px;
    max-width: 760px;
}

.hero-label,
.eyebrow {
    display: inline-flex;
    align-items: center;
    color: var(--accent);
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 13px;
    margin-bottom: 12px;
}

.hero-content h1,
.hero-content h2 {
    margin: 0 0 16px;
    font-size: clamp(34px, 5vw, 64px);
    line-height: 1.08;
    max-width: 820px;
}

.hero-content p {
    margin: 0 0 22px;
    color: #cbd5e1;
    font-size: clamp(16px, 2vw, 20px);
    line-height: 1.7;
    max-width: 720px;
}

.hero-meta,
.card-meta,
.detail-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-meta {
    margin-bottom: 24px;
}

.hero-meta span,
.detail-meta span {
    border-radius: 999px;
    padding: 7px 13px;
    background: rgba(245, 158, 11, 0.16);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.22);
}

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

.primary-button,
.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
}

.ghost-button {
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 12px;
    padding: 10px 18px;
    color: #ffffff;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
}

.ghost-button:hover {
    border-color: rgba(245, 158, 11, 0.7);
    color: var(--accent);
}

.hero-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.54);
    color: #ffffff;
    font-size: 34px;
    line-height: 1;
    transition: background 0.2s ease;
}

.hero-control:hover {
    background: rgba(0, 0, 0, 0.78);
}

.hero-control.prev {
    left: 20px;
}

.hero-control.next {
    right: 20px;
}

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

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

.hero-dot.is-active {
    width: 34px;
    background: var(--accent);
}

.section {
    padding: 56px 0;
}

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

.section-heading h2,
.page-hero h1,
.content-card h2 {
    margin: 0;
}

.section-heading h2 {
    font-size: clamp(24px, 3vw, 34px);
}

.section-heading a {
    color: var(--accent);
    font-weight: 700;
}

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

.movie-grid {
    display: grid;
    gap: 20px;
}

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

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

.movie-card,
.category-card,
.category-overview-card,
.content-card,
.ranking-item,
.player-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.14);
}

.movie-card {
    transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-4px);
    background: rgba(51, 65, 85, 0.68);
    border-color: rgba(245, 158, 11, 0.24);
}

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

.poster-wrap {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #0f172a;
}

.movie-card-compact .poster-wrap {
    aspect-ratio: 16 / 9;
}

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

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

.poster-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0;
    background: rgba(0, 0, 0, 0.46);
    transition: opacity 0.25s ease;
}

.movie-card:hover .poster-wrap::after {
    opacity: 1;
}

.duration,
.score,
.play-mark {
    position: absolute;
    z-index: 2;
}

.duration {
    right: 10px;
    top: 10px;
    background: rgba(0, 0, 0, 0.72);
    color: #ffffff;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 12px;
}

.score {
    left: 10px;
    bottom: 10px;
    background: rgba(0, 0, 0, 0.72);
    color: #fbbf24;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 12px;
}

.play-mark {
    left: 50%;
    top: 50%;
    width: 48px;
    height: 48px;
    transform: translate(-50%, -50%) scale(0.8);
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.92);
    color: #111827;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.movie-card:hover .play-mark {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

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

.movie-card-body h3 {
    margin: 0 0 8px;
    font-size: 16px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.movie-card:hover h3,
.ranking-link:hover h3 {
    color: var(--accent);
}

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

.card-meta {
    color: var(--muted-2);
    font-size: 12px;
    margin-bottom: 10px;
}

.card-meta span:not(:last-child)::after {
    content: "·";
    margin-left: 10px;
    color: rgba(148, 163, 184, 0.38);
}

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

.tag-row span {
    display: inline-flex;
    border-radius: 999px;
    padding: 4px 9px;
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.12);
    font-size: 12px;
}

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

.category-card {
    display: block;
    padding: 24px;
    min-height: 154px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.78), rgba(15, 23, 42, 0.9));
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.category-card:hover {
    transform: translateY(-4px);
    border-color: rgba(245, 158, 11, 0.35);
}

.category-card span,
.category-overview-link h2 {
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
}

.category-card p,
.category-overview-link p {
    color: var(--muted);
    line-height: 1.7;
}

.two-column-section {
    display: grid;
    grid-template-columns: 1fr 390px;
    gap: 28px;
    align-items: start;
}

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

.ranking-item {
    transition: background 0.2s ease, transform 0.2s ease;
}

.ranking-item:hover {
    background: rgba(51, 65, 85, 0.68);
    transform: translateY(-2px);
}

.ranking-link {
    display: grid;
    grid-template-columns: 54px 92px 1fr;
    gap: 14px;
    align-items: center;
    padding: 12px;
}

.rank-no {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    font-weight: 900;
}

.ranking-link img {
    width: 92px;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 12px;
}

.ranking-link h3 {
    margin: 0 0 8px;
    font-size: 17px;
}

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

.small-ranking .ranking-link {
    grid-template-columns: 44px 72px 1fr;
    gap: 10px;
}

.small-ranking .ranking-link img {
    width: 72px;
}

.page-hero {
    padding: 52px 0 18px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    color: var(--muted);
    font-size: 14px;
}

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

.page-hero h1 {
    font-size: clamp(32px, 5vw, 52px);
    margin-bottom: 14px;
}

.page-hero p:last-child {
    max-width: 760px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.8;
}

.filter-toolbar {
    display: flex;
    gap: 14px;
    padding-top: 20px;
    padding-bottom: 10px;
}

.filter-toolbar input {
    flex: 1;
}

.category-overview-grid {
    display: grid;
    gap: 24px;
}

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

.category-overview-link {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.category-overview-link > span {
    color: var(--accent);
    font-weight: 800;
}

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

.detail-page {
    padding: 34px 0 16px;
}

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

.player-card {
    padding: 0;
    background: #000000;
}

.player-shell {
    position: relative;
    background: #000000;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.movie-video {
    width: 100%;
    height: 100%;
    background: #000000;
    object-fit: contain;
}

.play-overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: grid;
    place-items: center;
    gap: 12px;
    border: 0;
    color: #ffffff;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.18) 0%, rgba(0, 0, 0, 0.58) 100%);
}

.play-overlay span {
    width: 78px;
    height: 78px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--accent);
    color: #111827;
    font-size: 30px;
    box-shadow: 0 18px 42px rgba(245, 158, 11, 0.28);
}

.play-overlay strong {
    font-size: 18px;
    letter-spacing: 0.04em;
}

.player-shell.is-playing .play-overlay {
    display: none;
}

.detail-info {
    padding-top: 24px;
}

.detail-info h1 {
    margin: 0 0 14px;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.18;
}

.lead-text {
    margin: 0 0 18px;
    color: #cbd5e1;
    font-size: 18px;
    line-height: 1.75;
}

.detail-meta {
    margin-bottom: 18px;
}

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

.content-card {
    padding: 22px;
    margin-bottom: 18px;
}

.content-card h2 {
    font-size: 22px;
    margin-bottom: 12px;
}

.content-card p {
    color: #cbd5e1;
    line-height: 1.9;
    margin: 0 0 12px;
}

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

.detail-side {
    position: sticky;
    top: 88px;
}

.side-poster {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    margin-bottom: 18px;
}

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

.side-meta dl {
    display: grid;
    grid-template-columns: 70px 1fr;
    gap: 10px 14px;
    margin: 0;
}

.side-meta dt {
    color: var(--muted-2);
}

.side-meta dd {
    margin: 0;
    color: #e2e8f0;
}

.side-meta a {
    color: var(--accent);
}

.site-footer {
    margin-top: 56px;
    background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
    border-top: 1px solid var(--border);
    color: #cbd5e1;
}

.footer-inner {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 44px 0;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 34px;
}

.footer-inner p {
    color: var(--muted);
    line-height: 1.7;
}

.footer-inner h2 {
    font-size: 18px;
    margin: 0 0 14px;
}

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

.footer-inner a:hover {
    color: var(--accent);
}

.footer-bottom {
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    padding: 18px;
    text-align: center;
    color: var(--muted-2);
    font-size: 14px;
}

.is-hidden {
    display: none !important;
}

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

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

    .two-column-section,
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .detail-side {
        position: static;
        display: grid;
        grid-template-columns: 240px 1fr;
        gap: 18px;
    }
}

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

    .mobile-menu-button {
        display: block;
    }

    .hero-slider {
        height: 540px;
    }

    .hero-content {
        left: 24px;
        bottom: 70px;
    }

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

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

    .footer-inner {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .shell,
    .header-inner,
    .mobile-panel,
    .footer-inner {
        width: min(100% - 24px, 1280px);
    }

    .hero-slider {
        height: 500px;
    }

    .hero-control {
        display: none;
    }

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

    .hero-meta span,
    .detail-meta span {
        padding: 6px 10px;
        font-size: 13px;
    }

    .section {
        padding: 38px 0;
    }

    .section-heading,
    .category-overview-link {
        align-items: start;
        flex-direction: column;
    }

    .poster-grid,
    .compact-grid,
    .category-grid,
    .mini-card-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

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

    .filter-toolbar {
        flex-direction: column;
    }

    .filter-toolbar input,
    .filter-toolbar select,
    .search-form input {
        width: 100%;
        min-width: 0;
    }

    .ranking-link {
        grid-template-columns: 42px 76px 1fr;
        gap: 10px;
    }

    .ranking-link img {
        width: 76px;
    }

    .detail-side {
        display: block;
    }

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

    .search-panel {
        inset: 72px 12px auto 12px;
        width: auto;
    }
}
