* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --theme: #e11d48;
  --theme-dark: #be123c;
  --theme-light: #fb7185;
  --accent-red: #e11d48;
  --accent-gold: #f59e0b;
  --accent-green: #14b8a6;
  --bg: #0a1016;
  --bg-elevated: #101820;
  --card: #151e28;
  --card-hover: #1c2834;
  --text: #f4efe6;
  --text-secondary: #c9c2b6;
  --text-muted: #8b95a1;
  --border: rgba(244, 239, 230, 0.08);
  --radius-xl: 6px;
  --radius-lg: 6px;
  --radius-md: 4px;
  --header-h: 64px;
  --wrap: min(94%, 1280px);
  --ink: #071018;
}

body {
  font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: var(--wrap);
  margin: 0 auto;
}

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

button {
  border: none;
  background: 0;
  color: inherit;
  cursor: pointer;
}

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

/* ── 顶栏 ── */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 999;
  height: var(--header-h);
  padding-top: env(safe-area-inset-top, 0);
  background: var(--ink);
  border-bottom: 2px solid var(--theme);
}

.header .wrap.nav {
  height: 100%;
  display: flex;
  align-items: stretch;
  gap: 18px;
}

.logo {
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.04em;
  flex-shrink: 0;
  line-height: 1;
}

.logo::before {
  content: '影';
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--theme);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  border-radius: 3px;
  letter-spacing: 0;
}

.menu {
  display: flex;
  align-items: stretch;
  gap: 0;
  list-style: none;
  flex: 1;
  min-width: 0;
}

.menu li {
  display: flex;
}

.menu a {
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0 14px;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}

.menu a:hover {
  color: var(--text);
  background: transparent;
}

.menu a.active {
  color: #fff;
  background: transparent;
  border-bottom-color: #fff;
}

.search-box {
  width: 240px;
  flex-shrink: 0;
  align-self: center;
}

.search-input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 34px;
  border-radius: 4px;
  border: 1px solid rgba(244, 239, 230, 0.12);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238b95a1' viewBox='0 0 16 16'%3E%3Cpath d='M11.7 10.3h-.8l-.3-.3a6 6 0 1 0-.7.7l.3.3v.8l4.6 4.6 1.4-1.4-4.6-4.6zm-5.5 0a4.2 4.2 0 1 1 0-8.4 4.2 4.2 0 0 1 0 8.4z'/%3E%3C/svg%3E")
    11px 50% / 14px no-repeat,
    #0e161e;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--theme);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.user {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  overflow: hidden;
  border: 2px solid var(--theme);
  flex-shrink: 0;
  align-self: center;
}

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

.burger {
  display: none;
  font-size: 20px;
  color: var(--text);
  padding: 8px;
  align-self: center;
}

/* ── 页面顶部间距 ── */
.page-top {
  padding-top: calc(var(--header-h) + 20px);
}

.path {
  padding: 0 0 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.path a {
  color: var(--text-muted);
  transition: color 0.2s;
}

.path a:hover {
  color: var(--theme-light);
}

/* ── Hero ── */
.slider {
  position: relative;
  height: clamp(300px, 38vw, 440px);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 28px;
  background: var(--card);
}

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

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

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

.slide-mask {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 16, 24, 0.88) 0%, rgba(7, 16, 24, 0.42) 48%, transparent 78%),
    linear-gradient(0deg, rgba(7, 16, 24, 0.82) 0%, transparent 52%);
  display: flex;
  align-items: flex-end;
  padding: 32px 36px 28px;
}

.slide-meta {
  max-width: 560px;
}

.slide-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--theme);
  border: none;
  padding: 3px 8px;
  border-radius: 3px;
  margin-bottom: 12px;
}

.slide-title {
  font-size: clamp(24px, 3.4vw, 36px);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 10px;
}

.slide-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.slide-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  background: var(--theme);
  color: #fff;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  transition: background 0.2s;
}

.slide-btn:hover {
  background: var(--theme-dark);
}

.slide-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background: rgba(7, 16, 24, 0.62);
  border: 1px solid rgba(244, 239, 230, 0.14);
  color: #fff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
}

.slider:hover .slide-arrow {
  opacity: 1;
}

.slide-arrow:hover {
  background: var(--theme);
  border-color: var(--theme);
}

.arrow-l { left: 16px; }
.arrow-r { right: 16px; }

.slide-dots {
  position: absolute;
  bottom: 16px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 3;
}

.slide-dot {
  width: 16px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.35);
  padding: 0;
  margin: 0;
  transition: width 0.2s, background 0.2s;
}

.slide-dot.active {
  width: 28px;
  background: var(--theme);
}

/* ── 类型标签 ── */
.tag-scroll {
  margin-bottom: 28px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tag-scroll::-webkit-scrollbar {
  display: none;
}

.tag-group {
  display: flex;
  gap: 8px;
  min-width: max-content;
}

.tag {
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  white-space: nowrap;
  transition: all 0.2s;
}

.tag:hover {
  color: #fff;
  border-color: var(--theme);
  background: rgba(225, 29, 72, 0.14);
}

/* ── 区块标题 ── */
.block {
  margin-bottom: 40px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
  min-height: 28px;
}

.block-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  padding-left: 0;
  border-left: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.block-title::before {
  content: '';
  width: 3px;
  height: 16px;
  background: var(--theme);
  border-radius: 1px;
  flex-shrink: 0;
}

.section-more {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 0.2s;
}

.section-more:hover {
  color: var(--theme-light);
}

/* ── 网格 ── */
.grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

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

.home-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}

/* ── 海报卡：图下文 ── */
.poster-card {
  display: block;
  border-radius: 6px;
  overflow: hidden;
  background: transparent;
  transition: transform 0.2s ease;
}

.poster-card:hover {
  transform: translateY(-3px);
}

.poster-img {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #1a2430;
  border-radius: 6px;
}

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

.poster-card:hover .poster-img > img {
  transform: scale(1.04);
}

.poster-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.55) 0%, transparent 46%);
  opacity: 0;
  transition: opacity 0.25s;
}

.poster-card:hover .poster-shade {
  opacity: 1;
}

.play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--theme);
  color: #fff;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 2;
}

.poster-card:hover .play-icon {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.badge-score,
.badge-new,
.badge-soon {
  position: absolute;
  top: 8px;
  z-index: 3;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 3px;
  color: #fff;
}

.badge-score {
  left: 8px;
  background: var(--theme);
}

.badge-new {
  right: 8px;
  background: #9f1239;
}

.badge-soon {
  right: 8px;
  background: var(--accent-green);
  color: #04201c;
}

.card-body {
  position: static;
  padding: 10px 2px 0;
  background: none;
}

.card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.vintage-card {
  outline: none;
}

.vintage-card .poster-img::after {
  content: '经典';
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 3px;
  background: var(--accent-gold);
  color: #1a1204;
  z-index: 3;
}

.vintage-card .badge-score {
  top: 8px;
  left: auto;
  right: 8px;
}

/* ── 排行榜 ── */
.rank-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rank-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
}

.rank-li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 4px;
  border-bottom: none;
  transition: background 0.2s;
}

.rank-li:hover {
  background: rgba(255, 255, 255, 0.04);
}

.rank-badge {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
  background: var(--bg-elevated);
  color: var(--text-muted);
}

.rank-1,
.rank-2,
.rank-3 {
  background: var(--theme);
  color: #fff;
}

.rank-2 { background: #c2410c; }
.rank-3 { background: #b45309; }

.rank-thumb {
  width: 40px;
  height: 56px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: #1a2430;
}

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

.rank-li h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-heat {
  font-size: 12px;
  color: var(--theme-light);
  font-weight: 700;
  flex-shrink: 0;
}

/* ── 简介 ── */
.intro {
  padding: 20px 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--theme);
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-secondary);
}

/* ── 页脚 ── */
.footer {
  margin-top: 12px;
  padding: 36px 0 max(24px, env(safe-area-inset-bottom));
  background: var(--ink);
  border-top: 1px solid var(--border);
}

.foot-wrap {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 24px;
}

.foot-col h4 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 14px;
}

.foot-link {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
  transition: color 0.2s;
}

.foot-link:hover {
  color: var(--theme-light);
  padding-left: 0;
}

.copy {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

/* ── 响应式 ── */
@media (max-width: 1100px) {
  .home-split {
    grid-template-columns: 1fr;
  }

  .grid-5 {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  :root { --header-h: 56px; }

  .menu, .search-box, .user { display: none; }
  .burger { display: block; }
  .logo { font-size: 17px; }
  .logo::before { width: 24px; height: 24px; font-size: 12px; }

  .slider { height: 260px; border-radius: 6px; margin-bottom: 20px; }
  .slide-mask { padding: 18px; }
  .slide-arrow { display: none; }
  .slide-dots { right: 50%; transform: translateX(50%); }

  .grid-5, .grid-4 { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .card-body { padding: 8px 0 0; }
  .card-name { font-size: 13px; }

  .foot-wrap { grid-template-columns: 1fr; gap: 22px; }
  .block { margin-bottom: 28px; }
}

@media (max-width: 480px) {
  .grid-5, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .rank-thumb { width: 36px; height: 50px; }
}
