:root {
    color-scheme: dark;
    --bg: #0c0a09;
    --panel: #1c1917;
    --panel-soft: #292524;
    --panel-strong: #44403c;
    --text: #f5f5f4;
    --muted: #a8a29e;
    --subtle: #78716c;
    --accent: #d97706;
    --accent-light: #f59e0b;
    --accent-soft: rgba(217, 119, 6, 0.18);
    --line: rgba(120, 113, 108, 0.32);
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

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;
}

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

img {
    max-width: 100%;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(28, 25, 23, 0.9);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
}

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

.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.site-logo-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    color: #ffffff;
    font-size: 14px;
    box-shadow: 0 10px 24px rgba(217, 119, 6, 0.32);
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 22px;
    color: #d6d3d1;
    font-weight: 600;
}

.nav-link {
    padding: 22px 0;
    transition: color 0.2s ease;
}

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

.nav-toggle {
    display: none;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    background: var(--panel-soft);
    padding: 8px 12px;
}

.page-main {
    min-height: 72vh;
}

.hero-section {
    position: relative;
    overflow: hidden;
    padding: 76px 0 64px;
    background:
        radial-gradient(circle at 10% 0%, rgba(245, 158, 11, 0.18), transparent 34%),
        linear-gradient(180deg, #1c1917 0%, #0c0a09 100%);
}

.hero-inner {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1.05fr);
    gap: 42px;
    align-items: center;
}

.hero-copy {
    text-align: left;
}

.eyebrow {
    margin: 0 0 14px;
    color: var(--accent-light);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero-copy h1,
.page-hero h1 {
    margin: 0;
    color: var(--text);
    font-size: clamp(36px, 5vw, 64px);
    line-height: 1.05;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.hero-description,
.page-hero p {
    margin: 20px 0 0;
    color: #d6d3d1;
    font-size: 18px;
    line-height: 1.8;
}

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

.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 24px;
    border-radius: 12px;
    font-weight: 800;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.primary-button {
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    color: #ffffff;
    box-shadow: 0 14px 30px rgba(217, 119, 6, 0.26);
}

.secondary-button {
    color: #f5f5f4;
    border: 1px solid var(--line);
    background: rgba(68, 64, 60, 0.45);
}

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

.hero-search {
    margin-top: 24px;
}

.search-input {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--text);
    background: rgba(41, 37, 36, 0.82);
    outline: none;
    padding: 0 18px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.search-input:focus {
    border-color: rgba(245, 158, 11, 0.72);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.12);
}

.hero-category-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.hero-category-links a {
    color: #e7e5e4;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(68, 64, 60, 0.4);
    padding: 8px 14px;
    font-size: 14px;
}

.hero-category-links a:hover {
    color: var(--accent-light);
    border-color: rgba(245, 158, 11, 0.55);
}

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

.hero-glow {
    position: absolute;
    border-radius: 999px;
    filter: blur(28px);
    opacity: 0.34;
}

.hero-glow-one {
    right: 8%;
    top: 12%;
    width: 260px;
    height: 260px;
    background: var(--accent);
}

.hero-glow-two {
    left: 0;
    bottom: -80px;
    width: 360px;
    height: 360px;
    background: #1d4ed8;
}

.page-hero {
    background:
        radial-gradient(circle at 88% 12%, rgba(245, 158, 11, 0.18), transparent 30%),
        linear-gradient(180deg, #1c1917, #0c0a09);
    border-bottom: 1px solid var(--line);
}

.compact-hero {
    padding: 54px 0 46px;
}

.page-stack {
    padding: 56px 0 72px;
    display: grid;
    gap: 56px;
}

.content-section,
.ranking-panel,
.search-panel,
.side-card,
.detail-content {
    position: relative;
}

.dark-panel,
.ranking-panel,
.search-panel,
.side-card,
.detail-content {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(28, 25, 23, 0.86);
    box-shadow: var(--shadow);
}

.dark-panel,
.ranking-panel {
    padding: 28px;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.section-heading h2 {
    margin: 0;
    color: var(--text);
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 900;
    letter-spacing: -0.03em;
}

.section-icon {
    font-size: 28px;
}

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

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

.movie-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(28, 25, 23, 0.78);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
    transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.movie-card:hover {
    transform: translateY(-4px);
    border-color: rgba(245, 158, 11, 0.56);
    background: rgba(41, 37, 36, 0.92);
}

.movie-poster {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: #1c1917;
}

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

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

.poster-year,
.poster-type,
.rank-badge {
    position: absolute;
    z-index: 2;
    border-radius: 999px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    padding: 7px 9px;
    backdrop-filter: blur(10px);
}

.poster-year {
    right: 9px;
    bottom: 9px;
    background: rgba(12, 10, 9, 0.72);
}

.poster-type {
    left: 9px;
    bottom: 9px;
    background: rgba(217, 119, 6, 0.9);
}

.rank-badge {
    left: 9px;
    top: 9px;
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
}

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

.movie-card h3 {
    margin: 0;
    color: var(--text);
    font-size: 16px;
    line-height: 1.35;
    font-weight: 850;
}

.movie-card h3 a:hover {
    color: var(--accent-light);
}

.movie-card-meta {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.movie-card-line {
    display: -webkit-box;
    min-height: 40px;
    margin: 8px 0 0;
    overflow: hidden;
    color: #d6d3d1;
    font-size: 13px;
    line-height: 1.55;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.tag-row span {
    border-radius: 8px;
    background: rgba(68, 64, 60, 0.78);
    color: #d6d3d1;
    font-size: 12px;
    padding: 5px 8px;
}

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

.compact-card .movie-card-line,
.compact-card .tag-row {
    display: none;
}

.search-panel {
    padding: 22px;
}

.search-label {
    display: block;
    margin-bottom: 12px;
    color: var(--accent-light);
    font-weight: 800;
}

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

.category-tile {
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background:
        radial-gradient(circle at 100% 0%, rgba(245, 158, 11, 0.24), transparent 44%),
        rgba(41, 37, 36, 0.72);
    padding: 20px;
    transition: transform 0.22s ease, border-color 0.22s ease;
}

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

.category-tile span {
    color: var(--text);
    font-size: 22px;
    font-weight: 900;
}

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

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

.ranking-row {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(41, 37, 36, 0.58);
    padding: 14px 16px;
}

.ranking-row:hover {
    border-color: rgba(245, 158, 11, 0.55);
}

.ranking-number {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent-light);
    font-weight: 900;
}

.ranking-title {
    overflow: hidden;
    color: var(--text);
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-meta {
    color: var(--muted);
    font-size: 14px;
}

.detail-layout {
    padding: 34px 0 72px;
}

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

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

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

.detail-main {
    display: grid;
    gap: 24px;
}

.player-shell {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(245, 158, 11, 0.22);
    border-radius: 22px;
    background: #000000;
    box-shadow: var(--shadow);
}

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

.player-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 0;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.72));
    color: #ffffff;
    transition: opacity 0.2s ease;
}

.player-overlay.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.play-circle {
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    box-shadow: 0 20px 60px rgba(217, 119, 6, 0.42);
    font-size: 34px;
    text-indent: 5px;
}

.detail-content {
    padding: 28px;
}

.detail-content h1 {
    margin: 0 0 18px;
    color: var(--text);
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.12;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.detail-content h2,
.side-card h2 {
    margin: 28px 0 12px;
    color: var(--text);
    font-size: 22px;
    font-weight: 900;
}

.detail-content p {
    margin: 0;
    color: #d6d3d1;
    font-size: 16px;
    line-height: 1.9;
}

.detail-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.detail-meta-row span {
    border-radius: 999px;
    background: var(--accent-soft);
    color: #fbbf24;
    font-weight: 800;
    padding: 8px 12px;
}

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

.detail-side {
    position: sticky;
    top: 90px;
    display: grid;
    gap: 18px;
}

.detail-poster {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.side-card {
    padding: 22px;
}

.side-card h2 {
    margin-top: 0;
}

.side-card dl {
    display: grid;
    gap: 12px;
    margin: 0;
}

.side-card dt {
    color: var(--subtle);
    font-size: 13px;
    font-weight: 800;
}

.side-card dd {
    margin: -8px 0 0;
    color: #e7e5e4;
    line-height: 1.65;
}

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

.related-section {
    margin-top: 50px;
}

.site-footer {
    border-top: 1px solid var(--line);
    background: #1c1917;
    color: var(--muted);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 0;
}

.site-footer strong {
    color: var(--text);
}

.site-footer p {
    margin: 6px 0 0;
}

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

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

[data-card].is-hidden {
    display: none;
}

@media (max-width: 1080px) {
    .hero-inner {
        grid-template-columns: 1fr;
    }

    .hero-copy {
        text-align: center;
    }

    .hero-actions,
    .hero-category-links {
        justify-content: center;
    }

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

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

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

    .detail-side {
        position: static;
        grid-template-columns: 220px minmax(0, 1fr);
    }
}

@media (max-width: 820px) {
    .nav-toggle {
        display: inline-flex;
    }

    .main-nav {
        position: absolute;
        left: 16px;
        right: 16px;
        top: 64px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        border: 1px solid var(--line);
        border-radius: 18px;
        background: rgba(28, 25, 23, 0.98);
        padding: 10px;
        box-shadow: var(--shadow);
    }

    .main-nav.is-open {
        display: flex;
    }

    .nav-link {
        padding: 12px 14px;
        border-radius: 12px;
    }

    .nav-link:hover,
    .nav-link.active {
        background: rgba(68, 64, 60, 0.55);
    }

    .hero-section {
        padding-top: 48px;
    }

    .hero-featured-grid,
    .movie-grid,
    .all-movie-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .ranking-row {
        grid-template-columns: 44px minmax(0, 1fr);
    }

    .ranking-meta {
        grid-column: 2;
    }

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

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

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

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

    .site-logo {
        font-size: 18px;
    }

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

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

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

    .movie-grid,
    .all-movie-grid,
    .hero-featured-grid,
    .category-grid {
        gap: 12px;
    }

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

    .movie-card h3 {
        font-size: 15px;
    }

    .dark-panel,
    .ranking-panel,
    .detail-content,
    .search-panel {
        border-radius: 18px;
        padding: 18px;
    }

    .play-circle {
        width: 68px;
        height: 68px;
        font-size: 28px;
    }
}
