:root {
    --bg: #111820;
    --bg-soft: #171f28;
    --panel: #1a2430;
    --panel-2: #202b38;
    --line: #2c3947;
    --text: #f6f7fb;
    --muted: #9ca7b4;
    --primary: #f5871f;
    --primary-2: #ff9f45;
    --primary-dark: #cc6812;
    --shadow: 0 18px 45px rgba(0, 0, 0, .32);
    --radius: 18px;
}

* {
    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;
    background: radial-gradient(circle at 15% 0%, rgba(245, 135, 31, .16), transparent 32%), var(--bg);
    color: var(--text);
    line-height: 1.6;
}

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

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(17, 24, 32, .88);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    backdrop-filter: blur(18px);
}

.site-header__inner {
    width: min(1180px, calc(100% - 32px));
    min-height: 68px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.site-header__inner--sub {
    min-height: 42px;
    justify-content: flex-start;
    overflow-x: auto;
}

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

.site-logo__mark {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), #ffbe6f);
    color: #151515;
    font-size: 15px;
    box-shadow: 0 8px 22px rgba(245, 135, 31, .36);
}

.site-logo--footer {
    margin-bottom: 16px;
}

.site-nav,
.site-header__subnav,
.footer-links,
.mobile-nav {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-soft);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 26px;
    color: var(--muted);
    font-size: 15px;
    font-weight: 600;
}

.site-nav a,
.site-header__subnav a,
.mobile-nav a,
.footer-links a {
    transition: color .2s ease, background .2s ease, border-color .2s ease;
}

.site-nav a:hover,
.site-nav a.is-active,
.site-header__subnav a:hover,
.mobile-nav a:hover,
.mobile-nav a.is-active,
.footer-links a:hover {
    color: var(--primary-2);
}

.site-header__subnav {
    border-top: 1px solid rgba(255, 255, 255, .05);
}

.site-header__subnav a {
    color: #c8d1dc;
    font-size: 13px;
    padding: 7px 13px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 999px;
    background: rgba(255, 255, 255, .03);
    white-space: nowrap;
}

.mobile-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 12px;
    background: rgba(255, 255, 255, .04);
    color: var(--text);
}

.mobile-nav {
    display: none;
    padding: 14px 16px 18px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    background: var(--panel);
}

.mobile-nav a {
    display: block;
    padding: 10px 0;
    color: #d7dee8;
}

.hero {
    position: relative;
    height: clamp(560px, 72vh, 800px);
    overflow: hidden;
    background: var(--bg-soft);
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    opacity: 0;
    transform: scale(1.04);
    background-size: cover;
    background-position: center;
    transition: opacity .7s ease, transform 1.2s ease;
}

.hero-slide.is-active {
    opacity: 1;
    transform: scale(1);
}

.hero-slide__inner {
    position: relative;
    z-index: 2;
}

.hero-slide__content {
    max-width: 680px;
    padding: 36px 0;
}

.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-2);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.section-kicker::before {
    content: "";
    width: 24px;
    height: 3px;
    border-radius: 999px;
    background: var(--primary);
}

.hero h1,
.page-hero h1,
.detail-panel h1 {
    margin: 12px 0 18px;
    font-size: clamp(36px, 6vw, 70px);
    line-height: 1.08;
    letter-spacing: -.04em;
}

.hero p,
.page-hero p {
    max-width: 680px;
    margin: 0;
    color: #d7dde6;
    font-size: 18px;
}

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

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

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

.button--primary {
    background: linear-gradient(135deg, var(--primary), #ffaf5a);
    color: #151515;
    box-shadow: 0 12px 28px rgba(245, 135, 31, .28);
}

.button--ghost {
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .08);
}

.hero-controls {
    position: absolute;
    left: 50%;
    bottom: 34px;
    z-index: 3;
    width: min(1180px, calc(100% - 32px));
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 18px;
}

.hero-controls > button {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 50%;
    background: rgba(0, 0, 0, .28);
    color: var(--text);
    font-size: 30px;
    line-height: 1;
}

.hero-dots {
    display: flex;
    align-items: center;
    gap: 9px;
}

.hero-dot {
    width: 28px;
    height: 4px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .32);
}

.hero-dot.is-active {
    background: var(--primary);
}

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

.tag-row span,
.detail-tags a {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    color: #ffd2a3;
    background: rgba(245, 135, 31, .16);
    font-size: 12px;
    font-weight: 700;
}

.tag-row--hero {
    margin-top: 18px;
}

.home-search-panel,
.filter-panel,
.rank-entry,
.category-overview-card,
.category-strip,
.detail-panel,
.side-card,
.player-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .028));
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.home-search-panel {
    position: relative;
    z-index: 4;
    margin-top: -48px;
    padding: 24px;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 20px;
    align-items: center;
}

.home-search-panel h2,
.section-head h2,
.rank-entry h2,
.category-strip h2,
.category-overview-card h2,
.side-card h2 {
    margin: 6px 0 0;
    color: var(--text);
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.2;
}

.home-search {
    display: flex;
    gap: 12px;
}

.home-search input,
.filter-panel input,
.filter-panel select {
    min-height: 46px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 12px;
    outline: none;
    background: rgba(0, 0, 0, .2);
    color: var(--text);
    padding: 0 14px;
}

.home-search button {
    min-width: 96px;
    border: 0;
    border-radius: 12px;
    background: var(--primary);
    color: #151515;
    font-weight: 800;
}

.section-block {
    margin-top: 68px;
}

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

.section-head a {
    color: var(--primary-2);
    font-weight: 800;
    white-space: nowrap;
}

.section-head p,
.category-overview-card p,
.rank-entry p,
.side-card p,
.site-footer p {
    color: var(--muted);
}

.section-head--compact {
    align-items: flex-start;
    margin-bottom: 18px;
}

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

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

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

.movie-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 16px;
    background: var(--panel);
    transition: transform .22s ease, border-color .22s ease, background .22s ease;
}

.movie-card:hover {
    transform: translateY(-5px) scale(1.01);
    border-color: rgba(245, 135, 31, .42);
    background: var(--panel-2);
}

.movie-card--wide {
    display: grid;
    grid-template-columns: 170px 1fr;
}

.movie-card__poster {
    position: relative;
    aspect-ratio: 3 / 4;
    background-color: #24303e;
    background-size: cover;
    background-position: center;
}

.movie-card--wide .movie-card__poster {
    min-height: 240px;
    aspect-ratio: auto;
}

.movie-card__year,
.movie-card__region {
    position: absolute;
    z-index: 2;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
}

.movie-card__year {
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, .58);
}

.movie-card__region {
    left: 10px;
    bottom: 10px;
    color: #151515;
    background: rgba(245, 135, 31, .92);
}

.movie-card__body {
    padding: 16px;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
}

.movie-card h3,
.rank-row h3 {
    margin: 0;
    color: var(--text);
    font-size: 17px;
    line-height: 1.35;
}

.movie-card p,
.rank-row p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.movie-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: #c7d0db;
    font-size: 12px;
}

.movie-card__category {
    margin-top: auto;
    color: var(--primary-2);
    font-size: 13px;
    font-weight: 800;
}

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

.category-tile {
    min-height: 150px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(245, 135, 31, .14), rgba(255, 255, 255, .04));
    transition: transform .22s ease, border-color .22s ease;
}

.category-tile:hover {
    transform: translateY(-4px);
    border-color: rgba(245, 135, 31, .42);
}

.category-tile strong {
    display: block;
    margin-bottom: 10px;
    font-size: 20px;
}

.category-tile span {
    color: var(--muted);
    font-size: 13px;
}

.rank-entry {
    padding: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.rank-list {
    display: grid;
    gap: 12px;
}

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

.rank-row {
    display: grid;
    grid-template-columns: 54px 70px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 16px;
    background: var(--panel);
    transition: transform .22s ease, border-color .22s ease, background .22s ease;
}

.rank-row:hover {
    transform: translateX(4px);
    border-color: rgba(245, 135, 31, .42);
    background: var(--panel-2);
}

.rank-row__num {
    color: var(--primary-2);
    font-size: 24px;
    font-weight: 900;
    text-align: center;
}

.rank-row__thumb {
    width: 70px;
    height: 92px;
    border-radius: 12px;
    background-color: #24303e;
    background-size: cover;
    background-position: center;
}

.rank-row__content {
    min-width: 0;
}

.rank-row__score {
    display: grid;
    justify-items: center;
    color: var(--primary-2);
}

.rank-row__score strong {
    font-size: 26px;
    line-height: 1;
}

.rank-row__score span {
    color: var(--muted);
    font-size: 12px;
}

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

.page-hero {
    padding: 78px 0 58px;
    background: radial-gradient(circle at 20% 0, rgba(245, 135, 31, .18), transparent 34%), linear-gradient(135deg, #121922, #1a2430);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.page-hero--small h1,
.page-hero--category h1 {
    font-size: clamp(34px, 5vw, 56px);
}

.filter-panel {
    margin-top: 28px;
    margin-bottom: 30px;
    padding: 18px;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 12px;
}

.filter-panel--search {
    grid-template-columns: 1.7fr repeat(4, minmax(130px, 1fr));
}

.content-stack,
.categories-stack {
    display: grid;
    gap: 28px;
    padding-bottom: 30px;
}

.category-overview-card,
.category-strip {
    padding: 24px;
}

.year-section h2 {
    margin: 0 0 16px;
    color: var(--primary-2);
    font-size: 28px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 24px 0 10px;
    color: var(--muted);
    font-size: 14px;
}

.breadcrumb a {
    color: var(--primary-2);
}

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

.detail-main {
    min-width: 0;
}

.player-card {
    padding: 10px;
    margin-bottom: 22px;
}

.player-shell {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 14px;
    background: #000;
}

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

.player-center-button {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 3;
    width: 76px;
    height: 76px;
    border: 0;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: rgba(245, 135, 31, .92);
    color: #151515;
    font-size: 30px;
    font-weight: 900;
    box-shadow: 0 18px 38px rgba(0, 0, 0, .34);
}

.player-shell.is-playing .player-center-button {
    opacity: 0;
    pointer-events: none;
}

.player-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    gap: 12px;
    align-items: center;
    padding: 18px;
    background: linear-gradient(0deg, rgba(0, 0, 0, .85), transparent);
}

.player-controls button {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 12px;
    background: rgba(255, 255, 255, .1);
    color: var(--text);
}

.player-controls input {
    accent-color: var(--primary);
}

.player-controls span {
    color: var(--text);
    font-size: 13px;
    white-space: nowrap;
}

.detail-panel {
    padding: 26px;
}

.detail-panel h1 {
    font-size: clamp(32px, 4vw, 48px);
}

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

.detail-panel p {
    color: #cbd4df;
    font-size: 16px;
}

.lead-text {
    color: #f1c08a !important;
    font-size: 18px !important;
}

.detail-meta,
.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.detail-meta span {
    padding: 6px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .07);
    color: #dce4ee;
    font-size: 14px;
}

.detail-tags a:hover {
    color: #151515;
    background: var(--primary);
}

.detail-side {
    display: grid;
    align-content: start;
    gap: 18px;
}

.side-poster {
    min-height: 430px;
    border-radius: var(--radius);
    background-color: #24303e;
    background-size: cover;
    background-position: center;
    box-shadow: var(--shadow);
}

.side-card {
    padding: 22px;
}

.site-footer {
    margin-top: 72px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    background: #10161d;
}

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

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

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

.footer-links a {
    color: var(--muted);
    font-size: 14px;
}

.footer-bottom {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, .06);
    color: var(--muted);
    text-align: center;
    font-size: 13px;
}

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

@media (max-width: 1100px) {
    .card-grid,
    .card-grid--compact {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

    .filter-panel,
    .filter-panel--search,
    .detail-layout,
    .footer-grid,
    .home-search-panel {
        grid-template-columns: 1fr;
    }

    .rank-list--preview,
    .wide-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .site-nav,
    .site-header__subnav {
        display: none;
    }

    .mobile-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

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

    .hero {
        height: 660px;
    }

    .hero h1 {
        font-size: 42px;
    }

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

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

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

    .movie-card--wide .movie-card__poster {
        min-height: 0;
        aspect-ratio: 3 / 4;
    }

    .section-head,
    .rank-entry {
        align-items: flex-start;
        flex-direction: column;
    }

    .rank-row {
        grid-template-columns: 42px 58px 1fr;
    }

    .rank-row__score {
        display: none;
    }

    .player-controls {
        grid-template-columns: auto 1fr auto;
    }

    .player-controls [data-player-time],
    .player-controls [data-player-mute] {
        display: none;
    }

    .side-poster {
        min-height: 360px;
    }
}

@media (max-width: 520px) {
    .container,
    .site-header__inner,
    .hero-controls {
        width: min(100% - 22px, 1180px);
    }

    .card-grid,
    .card-grid--compact,
    .category-grid {
        grid-template-columns: 1fr;
    }

    .home-search {
        flex-direction: column;
    }

    .player-center-button {
        width: 62px;
        height: 62px;
    }
}
