/* ==========================================================================
   catalog.css — 内容消费三页：作品库 / 排行榜 / 作品详情
   组件级断点紧跟各自的组件定义，别搬到 layout.css 去（会被后加载的同名规则盖掉）
   ========================================================================== */

/* ── 作品库 ────────────────────────────────────────────────────────────── */
.works {
  padding-block: 28px 0;
}

.works .grid {
  gap: 40px 28px;
}

.works__empty {
  padding-block: 60px;
  text-align: center;
  font-size: var(--f-sm);
  color: var(--text-muted);
}

.works__more {
  display: flex;
  justify-content: center;
  padding-block: 50px 56px;
}

/* ── 排行榜 ────────────────────────────────────────────────────────────── */
.seg {
  display: inline-flex;
  gap: var(--sp-1);
  padding: 5px;
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}

.seg__btn {
  padding: 8px 20px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  color: var(--text-body);
  transition: background-color 0.16s var(--ease), color 0.16s var(--ease);
}

.seg__btn[aria-pressed='true'] {
  background: var(--text);
  font-weight: 500;
  color: #fff;
}

.rank-top {
  padding-block: 44px 0;
}

.rank-top__item {
  display: flex;
  flex-direction: column;
  gap: var(--r-md);
}

.rank-top__cover {
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--brand-surface);
  aspect-ratio: 5 / 4;
}

.rank-top__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rank-top__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

.rank-top__name {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.rank-top__no {
  font-family: var(--font-num);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 1px;
  color: var(--brand-ink);
}

.rank-top__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.rank-top__pct {
  font-family: var(--font-num);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.5px;
  color: var(--text-large);
}

.rank-top__meta {
  font-size: var(--f-xs);
  color: var(--text-muted);
}

.rank-list {
  padding-block: 46px 56px;
}

.rank-list__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-bottom: 6px;
  font-size: var(--f-xs);
  color: var(--text-muted);
}

.rank-row {
  display: grid;
  grid-template-columns: 36px 52px minmax(0, 1fr) 200px 56px;
  align-items: center;
  gap: 18px;
  padding-block: 14px;
}

.rank-row__no {
  font-family: var(--font-num);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 1px;
  color: var(--text-large);
}

.rank-row__thumb {
  overflow: hidden;
  width: 52px;
  height: 70px;
  border-radius: var(--r-xs);
  background: var(--brand-surface);
}

.rank-row__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rank-row__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.rank-row__title {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
}

.rank-row__meta {
  font-size: var(--f-2xs);
  color: var(--text-muted);
}

.rank-row__heat {
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--line);
}

.rank-row__fill {
  display: block;
  width: var(--heat, 10%);
  height: 100%;
  border-radius: 3px;
  background: var(--brand);
}

.rank-row__pct {
  font-family: var(--font-num);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-align: right;
  color: var(--text-body);
}

@media (max-width: 860px) {
  .rank-top {
    grid-template-columns: 1fr;
  }

  .rank-row {
    grid-template-columns: 28px 44px minmax(0, 1fr) 56px;
    gap: var(--sp-3);
  }

  .rank-row__thumb {
    width: 44px;
    height: 60px;
  }

  .rank-row__heat {
    display: none;
  }
}

/* ── 作品详情 ──────────────────────────────────────────────────────────── */
.detail-hero {
  background: var(--brand-tint);
}

.detail-hero__inner {
  display: flex;
  align-items: flex-start;
  gap: 44px;
  padding-block: 44px 46px;
}

.detail-hero__cover {
  flex: 0 0 300px;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--brand-surface);
  box-shadow: var(--shadow-cover);
  aspect-ratio: 5 / 7;
}

.detail-hero__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-hero__info {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: var(--sp-5);
  min-width: 0;
}

.detail-hero__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--r-md);
}

.detail-hero__title {
  font-size: var(--f-h2);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -1px;
  color: var(--text);
}

.status {
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px #efdde3;
  font-size: var(--f-2xs);
  font-weight: 500;
  color: var(--brand-ink);
}

.detail-hero__meta {
  font-size: 13.5px;
  color: var(--text-body);
}

.detail-hero__desc {
  font-size: 14.5px;
  line-height: 2;
  color: var(--text-body);
}

.detail-hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-8);
}

.detail-hero__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
}

@media (max-width: 900px) {
  .detail-hero__inner {
    flex-direction: column;
    gap: var(--sp-7);
  }

  .detail-hero__cover {
    flex: none;
    width: 200px;
  }

  .detail-hero__stats {
    gap: var(--sp-7);
  }
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-bottom: var(--sp-3);
}

.section-head__title {
  font-size: var(--f-h4);
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text);
}

.section-head__note {
  font-size: var(--f-xs);
  color: var(--text-muted);
}

.link-more {
  font-size: var(--f-sm);
  font-weight: 500;
  color: var(--brand-ink);
}

.chapters {
  padding-block: 46px 0;
}

.chapters__list {
  display: flex;
  flex-direction: column;
  gap: var(--r-sm);
}

.chapter {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  width: 100%;
  padding: 13px 18px;
  border-radius: var(--r-sm);
  background: var(--surface-soft);
  text-align: left;
  transition: background-color 0.16s var(--ease);
}

.chapter:hover {
  background: var(--brand-surface);
}

.chapter[aria-current='true'] {
  background: var(--brand-surface);
  box-shadow: inset 0 0 0 1px #f0c9d4;
}

.chapter__no {
  flex: 0 0 78px;
  font-size: var(--f-xs);
  font-weight: 500;
  color: var(--text-muted);
}

.chapter__name {
  flex: 1 1 auto;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text);
}

.chapter__date {
  flex: 0 0 auto;
  font-size: var(--f-xs);
  color: var(--text-muted);
}

@media (max-width: 560px) {
  .chapter {
    flex-wrap: wrap;
    gap: var(--sp-1) var(--sp-3);
  }

  .chapter__no {
    flex: 0 0 auto;
  }

  .chapter__name {
    flex: 1 1 100%;
    order: 3;
  }
}

.related {
  padding-block: 44px 56px;
}

.related__item {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.related__cover {
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--brand-surface);
  aspect-ratio: 1 / 1;
}

.related__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related__title {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text);
}

/* 作品库收尾说明（原「加载更多」按钮位置） */
.works__tail {
  font-size: var(--f-sm);
  color: var(--text-muted);
}
