:root {
    --red: #dc2626;
    --red-dark: #b91c1c;
    --red-soft: #fef2f2;
    --ink: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --bg: #f9fafb;
    --card: #ffffff;
    --shadow: 0 16px 40px rgba(15, 23, 42, 0.09);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

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

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: 60;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid rgba(229, 231, 235, 0.8);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(16px);
}

.header-main {
    display: flex;
    align-items: center;
    gap: 22px;
    min-height: 68px;
}

.site-logo,
.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--red);
    font-size: 22px;
    font-weight: 800;
    white-space: nowrap;
}

.logo-mark {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 12px;
    color: #ffffff;
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    box-shadow: 0 10px 24px rgba(220, 38, 38, 0.28);
    font-size: 14px;
}

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

.primary-nav a,
.mobile-panel nav a {
    color: #374151;
    font-weight: 600;
    transition: color 0.2s ease;
}

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

.search-form,
.mobile-search,
.search-hero-form {
    display: flex;
    align-items: center;
    background: #f3f4f6;
    border: 1px solid transparent;
    border-radius: 999px;
    overflow: hidden;
}

.search-form:focus-within,
.mobile-search:focus-within,
.search-hero-form:focus-within {
    border-color: rgba(220, 38, 38, 0.38);
    background: #ffffff;
}

.search-form input,
.mobile-search input,
.search-hero-form input {
    width: 220px;
    border: 0;
    outline: 0;
    background: transparent;
    padding: 10px 14px;
    color: #111827;
}

.search-form button,
.mobile-search button,
.search-hero-form button {
    border: 0;
    background: var(--red);
    color: #ffffff;
    padding: 10px 18px;
    font-weight: 700;
}

.mobile-toggle {
    display: none;
    border: 0;
    background: #f3f4f6;
    border-radius: 10px;
    padding: 8px 12px;
    color: #111827;
}

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

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

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

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

.category-strip {
    border-top: 1px solid rgba(229, 231, 235, 0.8);
    background: #ffffff;
}

.strip-scroll {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    padding: 9px 0;
}

.strip-scroll a {
    flex: 0 0 auto;
    color: #4b5563;
    font-size: 14px;
    transition: color 0.2s ease;
}

.strip-scroll a:hover {
    color: var(--red);
}

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

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

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

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.56), rgba(0, 0, 0, 0.08));
}

.hero-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    color: #ffffff;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: var(--red);
    color: #ffffff;
    padding: 6px 13px;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 10px 26px rgba(220, 38, 38, 0.36);
}

.hero-content h1 {
    width: min(720px, 100%);
    margin: 18px 0 14px;
    font-size: clamp(36px, 6vw, 64px);
    line-height: 1.05;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.hero-content p {
    width: min(680px, 100%);
    margin: 0;
    color: #e5e7eb;
    font-size: 18px;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 20px;
    color: #f3f4f6;
    font-size: 15px;
}

.hero-meta span {
    position: relative;
}

.hero-meta span:not(:last-child)::after {
    position: absolute;
    right: -10px;
    content: "";
    width: 4px;
    height: 4px;
    top: 50%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

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

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

.btn-primary {
    color: #ffffff;
    background: var(--red);
    box-shadow: 0 12px 28px rgba(220, 38, 38, 0.3);
}

.btn-primary:hover {
    background: var(--red-dark);
}

.btn-ghost {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(10px);
}

.hero-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.52);
    color: #ffffff;
    font-size: 36px;
    line-height: 1;
    transition: background 0.2s ease;
}

.hero-arrow:hover {
    background: rgba(220, 38, 38, 0.88);
}

.hero-prev {
    left: 22px;
}

.hero-next {
    right: 22px;
}

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

.hero-dots button {
    width: 11px;
    height: 11px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.56);
    transition: width 0.2s ease, background 0.2s ease;
}

.hero-dots button.active {
    width: 32px;
    border-radius: 999px;
    background: var(--red);
}

.section-wrap {
    padding: 46px 0;
}

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

.section-title span {
    display: block;
    color: var(--red);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.section-title h2 {
    margin: 3px 0 0;
    color: #111827;
    font-size: clamp(26px, 3vw, 36px);
    line-height: 1.15;
}

.section-title a {
    color: var(--red);
    font-weight: 800;
}

.home-rank-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
}

.movie-grid,
.wide-card-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 22px;
}

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

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

.movie-card {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    background: var(--card);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

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

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

.movie-card:hover .movie-poster img {
    transform: scale(1.045);
    opacity: 0.9;
}

.movie-badge,
.movie-score,
.rank-badge {
    position: absolute;
    z-index: 2;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 800;
}

.movie-badge {
    left: 10px;
    top: 10px;
    color: #ffffff;
    background: rgba(220, 38, 38, 0.92);
}

.movie-score {
    right: 10px;
    top: 10px;
    color: #111827;
    background: rgba(255, 255, 255, 0.92);
}

.rank-badge {
    left: 10px;
    bottom: 10px;
    color: #ffffff;
    background: rgba(17, 24, 39, 0.72);
}

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

.movie-card-body h3 {
    margin: 0;
    min-height: 48px;
    font-size: 16px;
    line-height: 1.45;
}

.movie-card-body h3 a:hover {
    color: var(--red);
}

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

.movie-desc {
    display: -webkit-box;
    min-height: 42px;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.movie-tags,
.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 12px;
}

.movie-tags span,
.detail-tags span {
    border-radius: 999px;
    background: var(--red-soft);
    color: var(--red);
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 700;
}

.rank-panel,
.side-card,
.detail-main,
.category-overview-card,
.filter-panel,
.ranking-focus {
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

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

.rank-panel h2,
.side-card h2 {
    margin: 0 0 16px;
    font-size: 20px;
}

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

.rank-row {
    display: grid;
    grid-template-columns: 34px 72px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    border-radius: 14px;
    padding: 8px;
    transition: background 0.2s ease;
}

.rank-row:hover {
    background: #f9fafb;
}

.rank-row img {
    width: 72px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    background: #111827;
}

.rank-num {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 10px;
    background: var(--red);
    color: #ffffff;
    font-size: 13px;
    font-weight: 900;
}

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

.rank-info strong,
.related-row strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #111827;
    font-size: 14px;
}

.rank-info em,
.related-row em {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

.rank-score {
    color: #d97706;
    font-weight: 900;
}

.feature-band {
    border-radius: 28px;
    background: linear-gradient(135deg, #fff1f2, #eff6ff);
    padding: 34px;
}

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

.category-tile,
.category-overview-main {
    display: grid;
    min-height: 136px;
    border-radius: 18px;
    background: linear-gradient(135deg, #ffffff, #fff1f2);
    border: 1px solid rgba(220, 38, 38, 0.12);
    padding: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-tile:hover,
.category-overview-main:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.category-tile strong,
.category-overview-main h2 {
    margin: 0;
    color: #111827;
    font-size: 20px;
}

.category-tile span,
.category-overview-main p {
    color: var(--muted);
    font-size: 14px;
}

.page-hero {
    color: #ffffff;
    padding: 64px 0;
}

.page-hero-red {
    background: linear-gradient(135deg, #dc2626, #991b1b);
}

.page-hero-dark {
    background: radial-gradient(circle at 20% 20%, #7f1d1d, #111827 60%);
}

.page-hero span {
    display: inline-block;
    margin-bottom: 8px;
    color: #fecaca;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.page-hero h1 {
    margin: 0;
    font-size: clamp(34px, 5vw, 52px);
    line-height: 1.1;
}

.page-hero p {
    max-width: 760px;
    margin: 12px 0 0;
    color: #fee2e2;
    font-size: 18px;
}

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

.category-overview-card {
    overflow: hidden;
}

.category-sample-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 20px 20px;
}

.category-sample-links a {
    border-radius: 999px;
    background: #f3f4f6;
    color: #374151;
    padding: 6px 12px;
    font-size: 13px;
}

.filter-panel {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 14px;
    margin-bottom: 24px;
    padding: 18px;
}

.filter-panel label {
    display: grid;
    gap: 6px;
    color: #4b5563;
    font-size: 13px;
    font-weight: 800;
}

.filter-panel input,
.filter-panel select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    outline: 0;
    background: #ffffff;
    padding: 11px 12px;
    color: #111827;
}

.filter-panel input:focus,
.filter-panel select:focus {
    border-color: rgba(220, 38, 38, 0.45);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}

.ranking-focus {
    padding: 20px;
}

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

.search-hero-form {
    width: min(620px, 100%);
    margin-top: 26px;
    background: rgba(255, 255, 255, 0.95);
}

.search-hero-form input {
    flex: 1;
    width: auto;
}

.search-hero-form button {
    padding-inline: 24px;
}

.player-shell {
    background: #050505;
    padding: 22px 0;
}

.player-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    background: #000000;
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.38);
}

.movie-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000000;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    gap: 12px;
    border: 0;
    color: #ffffff;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.64), rgba(0, 0, 0, 0.18));
    text-align: center;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.play-circle {
    display: grid;
    width: 76px;
    height: 76px;
    place-items: center;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 16px 36px rgba(220, 38, 38, 0.36);
    font-size: 30px;
}

.player-overlay strong {
    font-size: clamp(22px, 4vw, 36px);
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 350px;
    gap: 28px;
    padding: 34px 0;
}

.detail-main {
    padding: 28px;
}

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

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

.detail-main h1 {
    margin: 0;
    font-size: clamp(30px, 5vw, 46px);
    line-height: 1.16;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.detail-meta span {
    border-radius: 999px;
    background: #f3f4f6;
    color: #374151;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 800;
}

.detail-lead {
    margin: 22px 0 0;
    color: #374151;
    font-size: 18px;
}

.detail-section {
    margin-top: 28px;
    border-top: 1px solid var(--line);
    padding-top: 24px;
}

.detail-section h2 {
    margin: 0 0 10px;
    font-size: 22px;
}

.detail-section p {
    margin: 0;
    color: #374151;
    font-size: 16px;
}

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

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

.detail-info-grid strong {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.detail-info-grid span {
    display: block;
    margin-top: 4px;
    font-weight: 800;
}

.detail-side {
    align-self: start;
    position: sticky;
    top: 110px;
}

.side-card {
    padding: 18px;
}

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

.related-row {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    border-radius: 14px;
    padding: 8px;
    transition: background 0.2s ease;
}

.related-row:hover {
    background: #f9fafb;
}

.related-row img {
    width: 96px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
    background: #111827;
}

.site-footer {
    margin-top: 36px;
    background: #111827;
    color: #d1d5db;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr 1fr;
    gap: 40px;
    padding: 44px 0;
}

.footer-logo {
    color: #ffffff;
}

.footer-grid p {
    max-width: 480px;
    color: #9ca3af;
}

.footer-grid h2 {
    margin: 0 0 12px;
    color: #ffffff;
    font-size: 18px;
}

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

.footer-links a {
    color: #d1d5db;
}

.footer-links a:hover {
    color: #ffffff;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 18px 0;
    color: #9ca3af;
    text-align: center;
}

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

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

    .home-rank-layout,
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .rank-panel,
    .detail-side {
        position: static;
    }

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

@media (max-width: 820px) {
    .primary-nav,
    .search-form {
        display: none;
    }

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

    .hero-slider {
        height: 560px;
    }

    .hero-content {
        padding-right: 24px;
    }

    .hero-arrow {
        display: none;
    }

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

    .category-tile-grid,
    .category-overview-grid,
    .rank-list-large {
        grid-template-columns: 1fr;
    }

    .filter-panel {
        grid-template-columns: 1fr 1fr;
    }

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

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 26px;
    }
}

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

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

    .category-strip {
        display: none;
    }

    .hero-slider {
        height: 520px;
    }

    .hero-content h1 {
        font-size: 34px;
    }

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

    .movie-grid,
    .wide-card-grid,
    .grid-compact {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

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

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

    .movie-desc,
    .movie-tags {
        display: none;
    }

    .rank-row {
        grid-template-columns: 30px 60px minmax(0, 1fr) auto;
    }

    .rank-row img {
        width: 60px;
        height: 42px;
    }

    .filter-panel {
        grid-template-columns: 1fr;
    }

    .detail-main {
        padding: 20px;
    }

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

    .play-circle {
        width: 62px;
        height: 62px;
        font-size: 24px;
    }
}
