.page-products {
  --tile-min-width: 170px;
  background: var(--bg-page);
  color: var(--text-dark);
}

.page-products .container {
  padding-left: 20px;
  padding-right: 20px;
  max-width: var(--container-max);
  margin: 0 auto;
}

/* ===== Hero ===== */
.products-hero {
  padding: var(--space-4) 0 0;
  background: var(--bg-page);
}

.products-hero-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-bottom: var(--space-5);
}

.products-hero-title {
  font-size: clamp(28px, 5vw, 46px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 900;
  color: var(--text-dark);
  margin: var(--space-2) 0;
}

.products-hero-lead {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-muted-a);
  margin: 0 0 var(--space-3);
}

.hero-num {
  color: var(--primary);
  font-weight: 900;
}

.products-hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.hero-link {
  display: inline-block;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  border: 2px solid var(--text-dark);
  color: var(--text-dark);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  transition: background var(--transition), transform var(--transition);
}

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

.products-hero-banner {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-section-dark);
  align-self: flex-start;
}

.hero-banner-img {
  display: block;
  width: 100%;
  height: auto;
}

/* ===== 分类与年份双栏布局 ===== */
.products-categories {
  padding: var(--space-5) 0;
  background: var(--bg-page);
}

.catalog-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  align-items: start;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 190px;
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: #fff;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition);
}

.tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
}

.tile::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -30px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.tile-tag {
  font-family: var(--font-label);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  position: relative;
  z-index: 1;
}

.tile-name {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.25;
  margin: 6px 0 4px;
  position: relative;
  z-index: 1;
}

.tile-meta {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  position: relative;
  z-index: 1;
}

.tile-count {
  font-size: 40px;
  font-family: var(--font-label);
  font-weight: 900;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: auto;
  position: relative;
  z-index: 1;
}

.tile-unit {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.tile-light {
  color: var(--text-dark);
}

.tile-light .tile-tag {
  color: rgba(26, 26, 26, 0.6);
}

.tile-light .tile-meta {
  color: rgba(26, 26, 26, 0.6);
}

.tile-light .tile-unit {
  color: rgba(26, 26, 26, 0.6);
}

.tile-mystery { background: linear-gradient(145deg, #34495E, #2C3E50); }
.tile-literary { background: linear-gradient(145deg, #FFB347, #FF8C00); }
.tile-doc { background: linear-gradient(145deg, #2E5D3C, #1F3D2B); }
.tile-drama { background: linear-gradient(145deg, #FF8C00, #E2680A); }
.tile-comedy { background: linear-gradient(145deg, #FFE066, #FFD700); }
.tile-action { background: linear-gradient(145deg, #FF7A59, #FF6347); }
.tile-sci-fi { background: linear-gradient(145deg, #7B68EE, #5C48C8); }
.tile-anime { background: linear-gradient(145deg, #FF9ADD, #FF69B4); }
.tile-history { background: linear-gradient(145deg, #8B5E3C, #6B4423); }
.tile-crime { background: linear-gradient(145deg, #3B5B8C, #2C3E50); }
.tile-love { background: linear-gradient(145deg, #FF5FA2, #FF1493); }
.tile-horror { background: linear-gradient(145deg, #222831, #111827); }
.tile-war { background: linear-gradient(145deg, #8B0000, #5C1A1A); }
.tile-fantasy { background: linear-gradient(145deg, #53DCD3, #00CED1); }
.tile-music { background: linear-gradient(145deg, #A78BFA, #7B68EE); }
.tile-wuxia { background: linear-gradient(145deg, #5B2C9E, #4B0082); }
.tile-family { background: linear-gradient(145deg, #5EEAD4, #20B2AA); }
.tile-adventure { background: linear-gradient(145deg, #FF8C42, #D97706); }

/* ===== 年份索引条 ===== */
.year-panel {
  background: var(--bg-section-dark);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.year-header .section-title {
  color: #fff;
}

.year-stat {
  display: inline-block;
  margin-top: 6px;
  color: var(--accent);
  font-family: var(--font-label);
  font-weight: 900;
  font-size: 16px;
}

.year-rail {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-4) 0;
}

.year-pill {
  display: inline-block;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-light);
  color: #fff;
  font-weight: 900;
  font-size: 15px;
  text-decoration: none;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.year-pill:hover {
  background: var(--accent);
  color: var(--text-dark);
  border-color: var(--accent);
}

.region-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.region-label {
  font-family: var(--font-label);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--text-muted-b);
}

.tag-light {
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.tag-light:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== 热门榜单 ===== */
.products-rankings {
  padding: var(--space-5) 0;
  background: #fff;
}

.section-header-toolbar {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.section-texts .section-title {
  margin-bottom: 4px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.toolbar-label {
  font-family: var(--font-label);
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted-a);
}

.toolbar-group {
  display: inline-flex;
  background: var(--bg-card-alt);
  border-radius: var(--radius-pill);
  padding: 4px;
  gap: 2px;
}

.toolbar-btn {
  border: 0;
  background: transparent;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted-a);
  cursor: pointer;
}

.toolbar-btn[aria-pressed="true"] {
  background: var(--primary);
  color: #fff;
}

.rank-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.rank-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

.rank-index {
  font-family: var(--font-label);
  font-size: 14px;
  font-weight: 900;
  color: var(--text-muted-a);
  min-width: 24px;
}

.rank-cover-wrap {
  width: 48px;
  height: 72px;
  flex: 0 0 auto;
  border-radius: var(--radius-xs);
  overflow: hidden;
  background: var(--bg-card-alt);
}

.rank-cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rank-cover-plain {
  display: block;
  width: 100%;
  height: 100%;
}

.rank-cover-purple { background: linear-gradient(145deg, #7B68EE, #5C48C8); }
.rank-cover-amber { background: linear-gradient(145deg, #FFB347, #FF8C00); }
.rank-cover-red { background: linear-gradient(145deg, #FF6347, #D9382B); }
.rank-cover-slate { background: linear-gradient(145deg, #64748B, #475569); }
.rank-cover-pink { background: linear-gradient(145deg, #FF69B4, #FF1493); }
.rank-cover-ink { background: linear-gradient(145deg, #334155, #111827); }
.rank-cover-teal { background: linear-gradient(145deg, #20B2AA, #008B8B); }
.rank-cover-navy { background: linear-gradient(145deg, #34495E, #2C3E50); }

.rank-main {
  flex: 1 1 220px;
  min-width: 180px;
}

.rank-title {
  font-weight: 900;
  font-size: 16px;
  margin-bottom: 4px;
}

.rank-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rank-side {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.rank-year {
  font-family: var(--font-label);
  font-size: 13px;
  color: var(--text-muted-a);
  background: var(--bg-card-alt);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
}

.rank-meter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 100%;
}

.metric-label {
  font-family: var(--font-label);
  font-size: 12px;
  color: var(--text-muted-a);
}

.metric-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-card-alt);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.metric-fill {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-pill);
}

.metric-fill-green {
  background: var(--status-updating);
}

.badge-4k {
  background: var(--status-new);
  color: #fff;
}

.badge-1080 {
  background: var(--status-complete);
  color: #fff;
}

.badge-720 {
  background: var(--cache);
  color: #fff;
}

.badge-bd {
  background: var(--tag-purple);
  color: #fff;
}

/* ===== 标签云 ===== */
.products-tags {
  padding: var(--space-5) 0;
  background: var(--bg-section-green);
}

.products-tags .section-title {
  color: #fff;
}

.section-subtitle-light {
  color: var(--text-muted-b);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: var(--space-4);
}

.cloud-tag {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  font-weight: 900;
  color: var(--text-dark);
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition);
}

.cloud-tag:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

.cloud-s1 { font-size: 14px; padding: 6px 14px; }
.cloud-s2 { font-size: 16px; padding: 8px 16px; }
.cloud-s3 { font-size: 20px; padding: 10px 18px; }
.cloud-s4 { font-size: 26px; padding: 12px 24px; }

.cloud-c1 { background: #FFD700; }
.cloud-c2 { background: #E6D73D; }
.cloud-c3 { background: #B5D94A; }
.cloud-c4 { background: #7ED9A0; }
.cloud-c5 { background: #45CDA8; }
.cloud-c6 { background: #00CED1; }

/* ===== 清晰度与字幕对照 ===== */
.products-quality {
  padding: var(--space-5) 0;
  background: var(--bg-page);
}

.quality-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.table-scroll {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

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

.quality-table th {
  background: var(--bg-section-dark);
  color: #fff;
  text-align: left;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 900;
}

.quality-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.quality-table tr:last-child td {
  border-bottom: none;
}

.quality-pill {
  display: inline-block;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-weight: 900;
  color: #fff;
  font-size: 14px;
  min-width: 76px;
  text-align: center;
}

.q720 { background: var(--cache); }
.q1080 { background: var(--status-complete); }
.q4k { background: var(--status-new); }
.qbd { background: var(--tag-purple); }

.plat-cell .plat-chip {
  margin-right: 6px;
}

.plat-table-last-row .plat-chip {
  margin-bottom: 2px;
}

.plat-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  color: var(--text-dark);
  font-size: 13px;
  font-weight: 700;
}

/* ===== 桌面端增强 ===== */
@media (min-width: 640px) {
  .tile-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 900px) {
  .products-hero-inner {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }

  .products-hero-copy {
    flex: 1 1 640px;
  }

  .products-hero-banner {
    flex: 0 0 480px;
  }

  .catalog-layout {
    grid-template-columns: 1fr 340px;
  }

  .year-panel {
    position: sticky;
    top: calc(var(--header-top-h) + var(--header-nav-h) + 16px);
  }

  .section-header-toolbar {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }

  .rank-row {
    flex-wrap: nowrap;
  }

  .rank-meter {
    flex: 0 0 140px;
  }

  .rank-index {
    min-width: 32px;
  }
}

@media (min-width: 1100px) {
  .catalog-layout {
    grid-template-columns: 1fr 360px;
  }

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