:root {
    --bg: #f9fafb;
    --text: #111827;
    --muted: #6b7280;
    --soft: #fff1f2;
    --line: #e5e7eb;
    --brand: #dc2626;
    --brand-dark: #b91c1c;
    --accent: #f97316;
    --gold: #f59e0b;
    --dark: #111827;
    --radius: 18px;
    --shadow: 0 16px 40px rgba(17, 24, 39, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

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

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

button,
input {
    font: inherit;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
    backdrop-filter: blur(16px);
}

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

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    color: white;
    box-shadow: 0 10px 22px rgba(220, 38, 38, 0.28);
}

.brand-text {
    font-size: 24px;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-left: auto;
}

.nav-link {
    color: #374151;
    font-weight: 700;
    transition: color 0.2s ease;
}

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

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

.top-search input,
.mobile-search input,
.search-panel input,
.toolbar input {
    border: 1px solid #d1d5db;
    border-radius: 999px;
    padding: 11px 16px;
    outline: none;
    background: white;
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.top-search input:focus,
.mobile-search input:focus,
.search-panel input:focus,
.toolbar input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}

.top-search button,
.mobile-search button,
.search-panel button {
    border: 0;
    border-radius: 999px;
    padding: 11px 18px;
    color: white;
    font-weight: 700;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    cursor: pointer;
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: #f3f4f6;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 4px auto;
    background: #374151;
}

.mobile-nav {
    display: none;
    padding: 14px 16px 18px;
    border-top: 1px solid var(--line);
    background: white;
}

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

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

.mobile-search input {
    min-width: 0;
    flex: 1;
}

.mobile-link {
    display: block;
    padding: 11px 0;
    color: #374151;
    font-weight: 700;
}

.hero {
    position: relative;
    min-height: 620px;
    overflow: hidden;
    color: white;
    background: #111827;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transform: scale(1.02);
    transition: opacity 0.7s ease, transform 1.1s ease;
}

.hero-slide.active {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.48;
}

.hero-shade {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 70% 35%, rgba(249, 115, 22, 0.24), transparent 38%),
        linear-gradient(90deg, rgba(17, 24, 39, 0.96), rgba(17, 24, 39, 0.72) 47%, rgba(17, 24, 39, 0.2));
}

.hero-content {
    position: relative;
    z-index: 2;
    min-height: 620px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    align-items: center;
    gap: 56px;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--brand);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero-copy h1 {
    max-width: 780px;
    margin: 0;
    font-size: clamp(42px, 8vw, 78px);
    line-height: 1.05;
    font-weight: 900;
    text-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.hero-line {
    max-width: 700px;
    margin: 22px 0;
    color: #f3f4f6;
    font-size: 20px;
}

.hero-tags,
.tag-row,
.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-tags span,
.tag-row span,
.detail-tags a {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: inherit;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 700;
}

.detail-tags a {
    background: #fee2e2;
    color: var(--brand-dark);
}

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

.primary-btn,
.ghost-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border-radius: 12px;
    padding: 0 24px;
    font-weight: 900;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-btn {
    color: white;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    box-shadow: 0 16px 30px rgba(220, 38, 38, 0.28);
}

.ghost-btn {
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.36);
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
}

.primary-btn:hover,
.ghost-btn:hover,
.movie-card:hover,
.category-card:hover {
    transform: translateY(-4px);
}

.hero-card {
    position: relative;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.42);
}

.hero-card img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

.hero-card span {
    position: absolute;
    right: 16px;
    top: 16px;
    border-radius: 999px;
    padding: 7px 12px;
    background: #fef3c7;
    color: #92400e;
    font-weight: 900;
}

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

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

.hero-dot.active {
    width: 34px;
    background: white;
}

.search-hero {
    position: relative;
    z-index: 4;
    margin-top: -36px;
}

.search-panel {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-radius: 24px;
    background: white;
    box-shadow: var(--shadow);
}

.search-panel input {
    flex: 1;
    min-width: 0;
}

.section {
    padding: 72px 0;
}

.section-soft {
    background: linear-gradient(180deg, #f9fafb, white);
}

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

.section-heading h2,
.rank-layout h2,
.page-hero h1 {
    margin: 0;
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.15;
}

.section-heading a {
    color: var(--brand);
    font-weight: 900;
}

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

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

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

.movie-card {
    overflow: hidden;
    border-radius: var(--radius);
    background: white;
    box-shadow: 0 8px 28px rgba(17, 24, 39, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
    box-shadow: 0 18px 45px rgba(17, 24, 39, 0.16);
}

.movie-poster {
    position: relative;
    display: block;
    overflow: hidden;
    background: #111827;
}

.movie-poster img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    transition: transform 0.35s ease;
}

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

.rating-badge,
.rank-badge {
    position: absolute;
    top: 12px;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 13px;
    font-weight: 900;
}

.rating-badge {
    right: 12px;
    background: #fef3c7;
    color: #92400e;
}

.rank-badge {
    left: 12px;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    color: white;
}

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

.movie-title {
    display: -webkit-box;
    overflow: hidden;
    color: #111827;
    font-size: 17px;
    font-weight: 900;
    line-height: 1.35;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.movie-title:hover {
    color: var(--brand);
}

.movie-meta {
    margin: 6px 0;
    color: var(--muted);
    font-size: 13px;
}

.movie-line {
    display: -webkit-box;
    overflow: hidden;
    min-height: 44px;
    margin: 0 0 12px;
    color: #4b5563;
    font-size: 14px;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.tag-row span {
    background: #f3f4f6;
    color: #4b5563;
}

.category-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 14px;
    margin-bottom: 26px;
}

.category-strip a,
.filter-buttons button {
    flex: 0 0 auto;
    border: 0;
    border-radius: 999px;
    padding: 10px 18px;
    color: #374151;
    background: white;
    box-shadow: 0 6px 18px rgba(17, 24, 39, 0.08);
    font-weight: 800;
    cursor: pointer;
}

.category-strip a:hover,
.filter-buttons button:hover,
.filter-buttons button.active {
    color: white;
    background: linear-gradient(135deg, var(--brand), var(--accent));
}

.rank-section {
    padding: 80px 0;
    color: white;
    background: radial-gradient(circle at 10% 20%, rgba(249, 115, 22, 0.22), transparent 30%), #111827;
}

.rank-layout {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 48px;
    align-items: start;
}

.rank-layout p {
    color: #d1d5db;
}

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

.rank-row {
    display: grid;
    grid-template-columns: 38px 64px 1fr 54px;
    gap: 14px;
    align-items: center;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    transition: background 0.2s ease;
}

.rank-row:hover {
    background: rgba(255, 255, 255, 0.16);
}

.rank-number {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    color: white;
    font-weight: 900;
}

.rank-row img {
    width: 64px;
    height: 82px;
    border-radius: 10px;
    object-fit: cover;
}

.rank-main strong,
.rank-main em {
    display: block;
}

.rank-main strong {
    font-size: 16px;
}

.rank-main em {
    color: #d1d5db;
    font-size: 13px;
    font-style: normal;
}

.rank-score {
    color: #fbbf24;
    font-weight: 900;
    text-align: right;
}

.dark-section {
    color: white;
    background: #111827;
}

.light-heading h2 {
    color: white;
}

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

.latest-grid .movie-card {
    background: #1f2937;
}

.latest-grid .movie-title {
    color: white;
}

.latest-grid .movie-line,
.latest-grid .movie-meta {
    color: #d1d5db;
}

.page-hero {
    padding: 60px 0 34px;
}

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

.page-hero p {
    max-width: 780px;
    color: #4b5563;
    font-size: 18px;
}

.small-hero p {
    margin-left: auto;
    margin-right: auto;
}

.crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    align-items: center;
    margin-bottom: 20px;
    color: #6b7280;
    font-size: 14px;
}

.crumbs a {
    color: var(--brand);
    font-weight: 800;
}

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

.category-card {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    min-height: 250px;
    background: #111827;
    box-shadow: var(--shadow);
    transition: transform 0.25s ease;
}

.category-card a,
.category-card img,
.category-overlay {
    position: absolute;
    inset: 0;
}

.category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
    transition: transform 0.35s ease;
}

.category-overlay {
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.2), rgba(17, 24, 39, 0.92));
}

.category-card div {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 24px;
    color: white;
}

.category-card h2 {
    margin: 0 0 8px;
    font-size: 24px;
}

.category-card p,
.category-card em {
    display: block;
    margin: 0;
    color: #e5e7eb;
    font-style: normal;
}

.toolbar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 28px;
}

.toolbar input {
    width: 100%;
}

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

.empty-state {
    display: none;
    padding: 28px;
    border-radius: 18px;
    background: white;
    color: #6b7280;
    text-align: center;
}

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

.detail-wrap {
    padding: 36px 0 0;
}

.player-card {
    position: relative;
    overflow: hidden;
    border-radius: 26px;
    background: black;
    box-shadow: var(--shadow);
}

.movie-video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: black;
}

.player-start {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0.5));
    color: white;
    cursor: pointer;
    transition: opacity 0.25s ease;
}

.player-start span {
    display: grid;
    place-items: center;
    width: 86px;
    height: 86px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.36);
    font-size: 34px;
    transform: translateX(3px);
}

.player-card.is-playing .player-start {
    opacity: 0;
    pointer-events: none;
}

.player-title {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: white;
    pointer-events: none;
}

.player-title strong {
    font-size: 20px;
}

.player-title span {
    color: #e5e7eb;
}

.detail-main {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 34px;
    margin-top: 34px;
    align-items: start;
}

.detail-poster {
    position: sticky;
    top: 90px;
}

.detail-poster img {
    width: 100%;
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.wide-btn {
    width: 100%;
    margin-top: 16px;
}

.detail-copy {
    padding: 28px;
    border-radius: 26px;
    background: white;
    box-shadow: 0 8px 28px rgba(17, 24, 39, 0.08);
}

.detail-copy h1 {
    margin: 0 0 12px;
    font-size: clamp(32px, 4vw, 52px);
    line-height: 1.12;
}

.detail-line {
    margin: 0 0 22px;
    color: #4b5563;
    font-size: 18px;
}

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

.detail-meta div {
    padding: 14px;
    border-radius: 16px;
    background: #f9fafb;
}

.detail-meta dt {
    color: #6b7280;
    font-size: 13px;
}

.detail-meta dd {
    margin: 4px 0 0;
    font-size: 18px;
    font-weight: 900;
}

.text-panel {
    margin-top: 26px;
}

.text-panel h2 {
    margin: 0 0 10px;
    font-size: 24px;
}

.text-panel p {
    margin: 0;
    color: #374151;
    font-size: 17px;
}

.site-footer {
    color: white;
    background: #111827;
}

.footer-inner {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0;
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: 32px;
}

.footer-logo .brand-text {
    color: white;
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
}

.footer-brand p,
.footer-group p,
.footer-group a,
.footer-bottom {
    color: #d1d5db;
}

.footer-group h2 {
    margin: 0 0 12px;
    font-size: 18px;
}

.footer-group a {
    display: block;
    margin: 8px 0;
}

.footer-group a:hover {
    color: white;
}

.footer-bottom {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 22px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

@media (max-width: 1040px) {
    .main-nav,
    .top-search {
        display: none;
    }

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

    .hero-content,
    .rank-layout,
    .detail-main,
    .footer-inner {
        grid-template-columns: 1fr;
    }

    .hero-card,
    .detail-poster {
        display: none;
    }

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

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

@media (max-width: 640px) {
    .header-inner {
        height: 62px;
    }

    .brand-text {
        font-size: 20px;
    }

    .hero,
    .hero-content {
        min-height: 560px;
    }

    .hero-copy h1 {
        font-size: 40px;
    }

    .hero-line {
        font-size: 17px;
    }

    .search-panel,
    .section-heading,
    .footer-bottom,
    .player-title {
        flex-direction: column;
        align-items: stretch;
    }

    .section {
        padding: 48px 0;
    }

    .movie-grid,
    .feature-grid,
    .latest-grid,
    .category-grid,
    .compact-grid {
        grid-template-columns: 1fr;
    }

    .rank-row {
        grid-template-columns: 32px 56px 1fr;
    }

    .rank-score {
        display: none;
    }

    .detail-copy {
        padding: 20px;
    }

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