:root {
    --bg: #0f172a;
    --bg-soft: #111827;
    --panel: #1e293b;
    --panel-light: #273449;
    --line: #334155;
    --text: #f8fafc;
    --muted: #94a3b8;
    --accent: #f59e0b;
    --accent-soft: #fbbf24;
    --shadow: 0 22px 70px rgba(0, 0, 0, 0.35);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

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

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

button,
input {
    font: inherit;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.96));
    backdrop-filter: blur(16px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
}

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

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.brand-mark {
    width: 36px;
    height: 36px;
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
    background: var(--accent);
    color: #111827;
    font-size: 15px;
    font-weight: 900;
    box-shadow: 0 12px 30px rgba(245, 158, 11, 0.35);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.brand-text strong {
    font-size: 24px;
    letter-spacing: -0.03em;
}

.brand-text small {
    color: var(--muted);
    font-size: 12px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 24px;
    min-width: 0;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.nav-link {
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 650;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent);
}

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

.search-form input {
    width: 210px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.8);
    color: var(--text);
    padding: 10px 12px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-form input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.search-form button,
.primary-btn,
.ghost-btn,
.section-more {
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.search-form button,
.primary-btn {
    background: var(--accent);
    color: #0f172a;
    padding: 10px 16px;
    box-shadow: 0 12px 34px rgba(245, 158, 11, 0.28);
}

.primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 20px;
}

.search-form button:hover,
.primary-btn:hover {
    background: var(--accent-soft);
    transform: translateY(-1px);
    box-shadow: 0 16px 40px rgba(245, 158, 11, 0.36);
}

.ghost-btn,
.section-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: var(--accent);
    padding: 12px 18px;
    background: rgba(15, 23, 42, 0.64);
}

.ghost-btn:hover,
.section-more:hover {
    background: rgba(245, 158, 11, 0.14);
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.8);
    padding: 10px;
}

.menu-toggle span {
    display: block;
    height: 2px;
    margin: 5px 0;
    background: var(--text);
    border-radius: 99px;
}

.hero {
    position: relative;
    height: clamp(430px, 64vh, 650px);
    overflow: hidden;
    background: #020617;
}

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

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

.hero-slide img,
.detail-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, #0f172a 4%, rgba(15, 23, 42, 0.65) 48%, rgba(15, 23, 42, 0.15) 100%), linear-gradient(90deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.18));
}

.hero-content {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding-bottom: 74px;
    max-width: 1180px;
}

.pill {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    border-radius: 999px;
    background: var(--accent);
    color: #0f172a;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 900;
    margin-bottom: 16px;
}

.hero h1,
.sub-hero h1,
.detail-copy h1 {
    max-width: 850px;
    margin: 0 0 16px;
    font-size: clamp(34px, 5vw, 62px);
    line-height: 1.06;
    letter-spacing: -0.045em;
}

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

.hero-meta,
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 26px;
}

.hero-meta span,
.detail-meta span,
.detail-meta a {
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.22);
    padding: 6px 10px;
    font-size: 13px;
}

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

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

.hero-control:hover {
    background: rgba(0, 0, 0, 0.74);
    transform: translateY(-50%) scale(1.04);
}

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

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

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

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

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

.page-section {
    padding: 58px 0 0;
}

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

.section-heading h2 {
    margin: 0 0 6px;
    font-size: clamp(24px, 3vw, 36px);
    line-height: 1.15;
    letter-spacing: -0.035em;
}

.section-heading p {
    margin: 0;
    color: var(--muted);
}

.small-heading h2 {
    font-size: 24px;
}

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

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

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

.movie-card {
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
    transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease, background 0.24s ease;
}

.movie-card:hover {
    transform: translateY(-4px);
    border-color: rgba(245, 158, 11, 0.5);
    background: var(--panel-light);
    box-shadow: 0 22px 54px rgba(245, 158, 11, 0.12);
}

.card-cover {
    position: relative;
    display: block;
    height: 230px;
    overflow: hidden;
    background: #020617;
}

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

.movie-card:hover .card-cover img,
.podium-card:hover img {
    transform: scale(1.08);
}

.year-badge {
    position: absolute;
    right: 12px;
    bottom: 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    padding: 5px 8px;
    font-size: 12px;
    font-weight: 800;
}

.card-body {
    padding: 16px;
}

.card-body h2 {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 1.3;
}

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

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

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

.tag-row span,
.meta-row span,
.detail-tags span {
    border-radius: 999px;
    background: #334155;
    color: #cbd5e1;
    padding: 5px 9px;
    font-size: 12px;
}

.tag-row span:first-child {
    color: var(--accent);
}

.list-card {
    display: grid;
    grid-template-columns: 180px 1fr;
}

.list-card .card-cover {
    height: 150px;
}

.list-card .card-body p {
    min-height: 0;
}

.large-card .card-cover {
    height: 430px;
}

.featured-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
    gap: 22px;
    align-items: stretch;
}

.side-list {
    display: grid;
    gap: 16px;
}

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

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

.category-tile {
    min-height: 130px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    border: 1px solid rgba(245, 158, 11, 0.18);
    border-radius: var(--radius);
    background: radial-gradient(circle at top right, rgba(245, 158, 11, 0.18), transparent 38%), linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
    padding: 18px;
    box-shadow: var(--shadow);
    transition: transform 0.24s ease, border-color 0.24s ease;
}

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

.category-tile span {
    font-size: 20px;
    font-weight: 900;
}

.category-tile small {
    margin-top: 6px;
    color: var(--muted);
}

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

.compact-grid .card-cover {
    height: 200px;
}

.rank-panel,
.content-panel,
.player-card {
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: var(--radius);
    background: rgba(30, 41, 59, 0.76);
    box-shadow: var(--shadow);
}

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

.rank-list {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.rank-list a {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    border-radius: 12px;
    padding: 10px;
    transition: background 0.2s ease;
}

.rank-list a:hover {
    background: rgba(245, 158, 11, 0.1);
}

.rank-list strong {
    color: var(--accent);
}

.rank-list span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.horizontal-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(230px, 280px);
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 12px;
    scroll-snap-type: x proximity;
}

.horizontal-row .movie-card {
    scroll-snap-align: start;
}

.sub-hero {
    padding: 72px 0 52px;
    background: radial-gradient(circle at 18% 20%, rgba(245, 158, 11, 0.18), transparent 32%), linear-gradient(135deg, #0f172a, #111827 52%, #0f172a);
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.sub-hero h1 {
    margin-bottom: 14px;
}

.sub-hero p {
    margin-bottom: 0;
}

.list-tools {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 22px;
}

.inline-search input {
    width: min(420px, 60vw);
}

.empty-state {
    display: none;
    margin-top: 26px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    color: var(--muted);
    padding: 34px;
    text-align: center;
}

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

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

.podium-card {
    position: relative;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid rgba(245, 158, 11, 0.28);
    padding: 24px;
    box-shadow: var(--shadow);
}

.podium-card img {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.55s ease;
}

.podium-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(0deg, rgba(15, 23, 42, 0.94), rgba(15, 23, 42, 0.2));
}

.podium-card strong,
.podium-card span,
.podium-card small {
    position: relative;
    z-index: 2;
}

.podium-card strong {
    color: var(--accent);
    margin-bottom: 8px;
}

.podium-card span {
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 8px;
}

.podium-card small {
    color: #cbd5e1;
}

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

.detail-hero {
    position: relative;
    min-height: 640px;
    overflow: hidden;
    background: #020617;
}

.detail-bg {
    filter: blur(4px) saturate(0.9);
    transform: scale(1.04);
}

.detail-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, #0f172a 8%, rgba(15, 23, 42, 0.76) 55%, rgba(15, 23, 42, 0.58)), linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.46));
}

.detail-hero-content {
    position: relative;
    padding: 38px 0 60px;
}

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

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

.detail-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 42px;
    align-items: end;
}

.detail-poster {
    width: 100%;
    height: 460px;
    border-radius: 22px;
    object-fit: cover;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.detail-copy h1 {
    margin-bottom: 16px;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 26px;
}

.player-card {
    overflow: hidden;
    margin-top: -128px;
    position: relative;
    z-index: 5;
}

.video-wrap {
    position: relative;
    background: #000;
    aspect-ratio: 16 / 9;
}

.video-wrap video {
    width: 100%;
    height: 100%;
    background: #000;
}

.play-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 0;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.62));
    color: #fff;
    cursor: pointer;
    z-index: 2;
}

.play-overlay span {
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--accent);
    color: #0f172a;
    font-size: 32px;
    box-shadow: 0 18px 44px rgba(245, 158, 11, 0.38);
}

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

.player-title {
    padding: 22px;
}

.player-title h2 {
    margin: 0 0 6px;
}

.player-title p {
    margin: 0;
    color: var(--muted);
}

.content-panel {
    margin-top: 28px;
    padding: 30px;
}

.content-panel h2 {
    margin: 0 0 14px;
    color: var(--accent);
    font-size: 24px;
}

.content-panel h2:not(:first-child) {
    margin-top: 28px;
}

.content-panel p {
    margin: 0;
    color: #dbe5f2;
    font-size: 16px;
}

.pager-row {
    display: flex;
    gap: 14px;
    justify-content: center;
    margin-top: 28px;
}

.site-footer {
    margin-top: 72px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    background: #0b1220;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 34px;
    padding: 46px 0;
}

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

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

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

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

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

.footer-bottom {
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    color: #64748b;
    padding: 18px;
    text-align: center;
    font-size: 13px;
}

@media (max-width: 1100px) {
    .header-inner {
        align-items: flex-start;
        flex-direction: column;
        padding: 14px 0;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

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

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

    .split-section,
    .featured-layout {
        grid-template-columns: 1fr;
    }

    .rank-panel {
        position: static;
    }
}

@media (max-width: 820px) {
    .menu-toggle {
        display: block;
        position: absolute;
        right: 16px;
        top: 17px;
    }

    .header-inner {
        align-items: stretch;
    }

    .header-actions {
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .header-actions.open {
        display: flex;
    }

    .main-nav {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .nav-link {
        border-radius: 10px;
        background: rgba(30, 41, 59, 0.78);
        padding: 10px 12px;
    }

    .search-form input {
        width: 100%;
    }

    .hero-control {
        display: none;
    }

    .four-col,
    .three-col,
    .list-grid,
    .podium-grid,
    .category-grid,
    .category-grid-large,
    .footer-grid,
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .detail-poster {
        width: min(340px, 100%);
        height: 460px;
    }

    .player-card {
        margin-top: -80px;
    }

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

    .list-card .card-cover {
        height: 220px;
    }

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

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

    .brand-text strong {
        font-size: 21px;
    }

    .hero {
        height: 560px;
    }

    .hero-content {
        padding-bottom: 62px;
    }

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

    .card-cover,
    .large-card .card-cover {
        height: 245px;
    }

    .inline-search {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .inline-search input {
        width: 100%;
    }
}
