:root {
    --bg: #f8fafc;
    --panel: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --accent: #ef4444;
    --accent-2: #f97316;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

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

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

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.header-inner,
.quick-category-inner,
.footer-inner,
.content-section,
.detail-layout {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
}

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

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

.brand-icon,
.footer-logo span,
.section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-radius: 14px;
    box-shadow: 0 10px 20px rgba(239, 68, 68, 0.22);
}

.brand-icon {
    width: 42px;
    height: 42px;
    font-size: 18px;
}

.brand-text strong {
    display: block;
    font-size: 20px;
    line-height: 1.1;
}

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

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

.nav-link,
.mobile-link {
    border-radius: 999px;
    color: #334155;
    font-weight: 650;
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-link {
    padding: 10px 14px;
}

.nav-link:hover,
.nav-link.active,
.mobile-link:hover,
.mobile-link.active {
    color: var(--primary);
    background: #eff6ff;
}

.header-search,
.mobile-search {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-search input,
.mobile-search input,
.search-box-large input,
.search-box-large select,
.filter-toolbar input,
.filter-toolbar select {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: white;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search input {
    width: 220px;
    padding: 10px 14px;
}

.header-search button,
.mobile-search button {
    padding: 10px 14px;
    border: 0;
    border-radius: 999px;
    color: white;
    background: var(--primary);
}

input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.mobile-menu-button {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: #f1f5f9;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.mobile-menu-button span {
    display: block;
    width: 20px;
    height: 2px;
    background: #0f172a;
    border-radius: 999px;
}

.mobile-panel {
    display: none;
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 0 0 16px;
}

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

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

.mobile-link {
    display: block;
    padding: 12px 14px;
}

.mobile-search input {
    flex: 1;
    padding: 10px 14px;
}

.quick-category-bar {
    border-top: 1px solid rgba(226, 232, 240, 0.65);
    background: rgba(248, 250, 252, 0.9);
}

.quick-category-inner {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 8px 0;
}

.quick-category-inner a {
    flex: 0 0 auto;
    padding: 6px 12px;
    border-radius: 999px;
    color: #475569;
    background: white;
    border: 1px solid var(--line);
    font-size: 13px;
}

.hero-slider {
    position: relative;
    height: 560px;
    overflow: hidden;
    background: linear-gradient(110deg, #0f172a, #334155);
}

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

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

.hero-slide img,
.detail-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: radial-gradient(circle at top left, #475569, #0f172a);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.52), rgba(15, 23, 42, 0.1));
}

.hero-content {
    position: absolute;
    left: max(24px, calc((100vw - 1280px) / 2 + 24px));
    right: 24px;
    bottom: 76px;
    max-width: 820px;
    color: white;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    margin-bottom: 16px;
    border-radius: 999px;
    color: white;
    font-weight: 750;
    font-size: 14px;
    background: linear-gradient(90deg, #dc2626, #ec4899);
}

.hero-content h1,
.detail-hero-content h1,
.page-hero h1 {
    margin: 0;
    font-size: clamp(34px, 6vw, 62px);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.hero-content p,
.detail-hero-content p,
.page-hero p {
    max-width: 760px;
    margin: 18px 0 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: clamp(16px, 2vw, 20px);
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 24px 0;
    color: rgba(255, 255, 255, 0.9);
}

.hero-meta span {
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

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

.primary-button,
.ghost-button,
.section-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: 12px;
    font-weight: 750;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.primary-button {
    padding: 0 24px;
    color: white;
    background: var(--primary);
    box-shadow: 0 14px 26px rgba(37, 99, 235, 0.28);
}

.primary-button:hover {
    transform: translateY(-2px);
    background: var(--primary-dark);
}

.ghost-button {
    padding: 0 22px;
    color: white;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    color: white;
    font-size: 34px;
    line-height: 1;
    background: rgba(0, 0, 0, 0.45);
    transform: translateY(-50%);
}

.hero-prev {
    left: 24px;
}

.hero-next {
    right: 24px;
}

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

.hero-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    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: 34px;
    background: white;
}

.content-section {
    padding: 56px 0;
}

.content-section + .content-section {
    padding-top: 34px;
}

.soft-panel {
    width: min(1280px, calc(100% - 32px));
    padding: 42px;
    border-radius: 28px;
    margin-top: 22px;
}

.blue-panel {
    background: linear-gradient(135deg, #eff6ff, #ecfeff);
}

.amber-panel {
    background: linear-gradient(135deg, #fffbeb, #fff7ed);
}

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

.section-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.section-icon {
    width: 44px;
    height: 44px;
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(24px, 3vw, 32px);
    letter-spacing: -0.02em;
}

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

.section-more {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0 16px;
    color: var(--primary);
    background: #eff6ff;
}

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

.category-movie-grid {
    align-items: stretch;
}

.movie-card {
    min-width: 0;
    background: var(--panel);
    border: 1px solid rgba(226, 232, 240, 0.92);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.movie-card:hover {
    transform: translateY(-5px);
    border-color: rgba(37, 99, 235, 0.32);
    box-shadow: var(--shadow);
}

.movie-card a {
    display: block;
    height: 100%;
}

.poster-frame {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(135deg, #1e293b, #475569);
}

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

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

.poster-type,
.poster-year {
    position: absolute;
    top: 10px;
    padding: 4px 8px;
    border-radius: 999px;
    color: white;
    font-size: 12px;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.66);
}

.poster-type {
    left: 10px;
}

.poster-year {
    right: 10px;
}

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

.movie-card h3 {
    min-height: 48px;
    margin: 0;
    font-size: 18px;
    line-height: 1.35;
    letter-spacing: -0.01em;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

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

.movie-meta-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    color: #64748b;
    font-size: 13px;
}

.movie-meta-row span {
    max-width: 100%;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.tag-row span,
.detail-tags span {
    color: #1d4ed8;
    background: #eff6ff;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 12px;
}

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

.movie-card-list a {
    display: grid;
    grid-template-columns: 190px 1fr;
}

.movie-card-list .poster-frame {
    aspect-ratio: auto;
    height: 100%;
    min-height: 142px;
}

.movie-card-list .movie-card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.split-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 32px;
    align-items: start;
}

.ranking-panel,
.side-card,
.info-card,
.player-panel,
.filter-toolbar,
.search-box-large,
.responsive-table {
    background: white;
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.07);
}

.ranking-panel {
    position: sticky;
    top: 116px;
    padding: 24px;
}

.ranking-panel h2 {
    margin: 0 0 16px;
}

.ranking-panel ol {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 12px;
}

.ranking-panel li a {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 10px;
    align-items: center;
}

.ranking-panel li span,
.rank-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: white;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    font-weight: 800;
}

.ranking-panel small {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

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

.category-tile,
.category-overview-card a {
    display: block;
    min-height: 148px;
    padding: 22px;
    border-radius: 22px;
    color: white;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    box-shadow: 0 18px 32px rgba(37, 99, 235, 0.18);
    transition: transform 0.2s ease;
}

.category-tile:hover,
.category-overview-card a:hover {
    transform: translateY(-4px);
}

.category-tile strong,
.category-overview-card strong {
    display: block;
    margin-bottom: 8px;
    font-size: 20px;
}

.category-tile span,
.category-overview-card span {
    color: rgba(255, 255, 255, 0.86);
    font-size: 14px;
}

.category-overview-card a {
    position: relative;
    min-height: 240px;
    overflow: hidden;
    padding: 0;
}

.category-overview-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #1e293b;
}

.category-overview-card div {
    position: absolute;
    inset: auto 0 0;
    padding: 22px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.82), transparent);
}

.category-overview-card em {
    display: inline-flex;
    margin-top: 12px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    font-style: normal;
    font-size: 13px;
}

.page-hero {
    min-height: 300px;
    display: flex;
    align-items: center;
    color: white;
    background: linear-gradient(135deg, #1d4ed8, #06b6d4);
}

.page-hero > div {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 64px 0;
}

.page-hero span,
.breadcrumb {
    display: inline-flex;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.82);
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.category-hero {
    background: linear-gradient(135deg, #0f766e, #2563eb);
}

.ranking-hero {
    background: linear-gradient(135deg, #92400e, #dc2626);
}

.search-hero {
    background: linear-gradient(135deg, #4c1d95, #2563eb);
}

.filter-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 180px 180px auto;
    gap: 14px;
    align-items: end;
    padding: 18px;
    margin-bottom: 24px;
}

.filter-toolbar label,
.search-box-large label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.filter-toolbar input,
.filter-toolbar select,
.search-box-large input,
.search-box-large select {
    width: 100%;
    padding: 11px 14px;
}

.filter-count,
.search-status {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.table-section {
    padding-top: 0;
}

.responsive-table {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

th {
    color: #334155;
    background: #f8fafc;
}

td a {
    color: var(--primary);
    font-weight: 750;
}

.search-box-large {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 180px 180px;
    gap: 14px;
    padding: 18px;
    margin-bottom: 18px;
}

.detail-hero {
    position: relative;
    min-height: 520px;
    overflow: hidden;
    background: #0f172a;
}

.detail-hero > img {
    position: absolute;
    inset: 0;
}

.detail-hero-mask {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.58), rgba(15, 23, 42, 0.25));
}

.detail-hero-content {
    position: relative;
    z-index: 1;
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 100px 0 70px;
    color: white;
}

.detail-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    color: rgba(255, 255, 255, 0.78);
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 30px;
    align-items: start;
    padding: 42px 0 70px;
}

.detail-main,
.detail-sidebar {
    display: grid;
    gap: 22px;
}

.player-panel,
.info-card,
.side-card {
    padding: 22px;
}

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

.player-shell video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #020617;
}

.play-layer {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    color: white;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.42), rgba(2, 6, 23, 0.56));
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.play-layer.hidden {
    opacity: 0;
    visibility: hidden;
}

.play-layer span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    color: white;
    background: linear-gradient(135deg, var(--primary), #06b6d4);
    box-shadow: 0 20px 34px rgba(37, 99, 235, 0.36);
}

.play-layer strong {
    font-size: 22px;
}

.play-layer small,
.player-message {
    color: #cbd5e1;
}

.player-message {
    margin: 14px 0 0;
    font-size: 14px;
}

.info-card h2,
.side-card h2 {
    margin: 0 0 14px;
    font-size: 24px;
}

.info-card p,
.side-card p {
    color: #334155;
}

.lead-text {
    color: #1d4ed8 !important;
    font-weight: 750;
}

.review-card {
    background: linear-gradient(135deg, #eff6ff, #ecfeff);
}

.side-card {
    position: sticky;
    top: 116px;
}

.side-card + .side-card {
    position: static;
}

dl {
    display: grid;
    gap: 12px;
    margin: 0;
}

dl div {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 10px;
}

dt {
    color: var(--muted);
}

dd {
    margin: 0;
    font-weight: 750;
}

.compact-list .movie-card-list a {
    grid-template-columns: 118px 1fr;
}

.compact-list .movie-card-list .poster-frame {
    min-height: 92px;
}

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

.compact-list .movie-card h3 {
    min-height: auto;
    font-size: 15px;
}

.compact-list .movie-card p,
.compact-list .tag-row,
.compact-list .movie-meta-row span:nth-child(2) {
    display: none;
}

.site-footer {
    color: #cbd5e1;
    background: #0f172a;
    margin-top: 20px;
}

.footer-inner {
    padding: 48px 0;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 30px;
}

.footer-logo span {
    width: 44px;
    height: 44px;
}

.footer-brand strong {
    display: block;
    color: white;
    font-size: 20px;
}

.footer-brand p {
    margin: 4px 0 0;
    color: #94a3b8;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr;
    gap: 30px;
}

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

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

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

.copyright {
    margin: 32px 0 0;
    padding-top: 22px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    color: #94a3b8;
}

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

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

    .ranking-panel,
    .side-card {
        position: static;
    }
}

@media (max-width: 860px) {
    .desktop-nav,
    .header-search {
        display: none;
    }

    .mobile-menu-button {
        display: inline-flex;
        margin-left: auto;
    }

    .brand-text small {
        display: none;
    }

    .hero-slider {
        height: 520px;
    }

    .hero-content {
        left: 18px;
        bottom: 70px;
    }

    .hero-arrow {
        display: none;
    }

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

    .filter-toolbar,
    .search-box-large {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 620px) {
    .header-inner,
    .quick-category-inner,
    .footer-inner,
    .content-section,
    .detail-layout,
    .detail-hero-content,
    .page-hero > div {
        width: min(100% - 24px, 1280px);
    }

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

    .hero-slider {
        height: 500px;
    }

    .hero-content p {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        overflow: hidden;
    }

    .content-section {
        padding: 38px 0;
    }

    .soft-panel {
        padding: 28px 18px;
        border-radius: 22px;
    }

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

    .movie-grid,
    .category-grid,
    .category-overview-grid {
        grid-template-columns: 1fr;
    }

    .movie-card-list a,
    .compact-list .movie-card-list a {
        grid-template-columns: 128px 1fr;
    }

    .movie-card-list .poster-frame {
        min-height: 112px;
    }

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

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

    .detail-hero {
        min-height: 460px;
    }

    .detail-hero-content {
        padding: 72px 0 52px;
    }

    .player-panel,
    .info-card,
    .side-card {
        padding: 16px;
        border-radius: 18px;
    }

    dl div {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}
