.collection-hero {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 14px;
  min-height: 0;
  background:
    radial-gradient(circle at 12% 0%, rgba(140, 164, 255, 0.2), transparent 45%),
    linear-gradient(160deg, rgba(11, 16, 34, 0.88), rgba(7, 10, 20, 0.82));
}

.collection-tools {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px;
  display: grid;
  gap: 10px;
}

.collection-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.collection-tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.collection-tag-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: all 0.2s ease;
}

.collection-tag-btn.is-active {
  color: #eef1ff;
  border-color: rgba(140, 164, 255, 0.62);
  background: rgba(140, 164, 255, 0.22);
}

.collection-filter-summary {
  font-size: 12px;
}

#collectionCards.collection-cards,
#draftCards.collection-cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
}

.role-card-floating {
  border-radius: 14px;
  padding: 8px;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.01)),
    radial-gradient(circle at 90% 0%, rgba(140, 164, 255, 0.22), transparent 45%),
    rgba(8, 11, 23, 0.9);
}

.card-portrait-floating {
  border-radius: 10px;
  aspect-ratio: 3 / 4;
}

.collection-card-body {
  display: grid;
  gap: 6px;
}

.role-card-floating h4 {
  font-size: 14px;
  line-height: 1.3;
}

.collection-card-meta {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.collection-card-excerpt {
  font-size: 12px;
  line-height: 1.45;
  color: #c8d4ff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.collection-inline-tag {
  font-size: 11px;
  line-height: 1;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 4px 8px;
  color: #d8e1ff;
  background: rgba(255, 255, 255, 0.04);
}

.collection-hl {
  border-radius: 4px;
  padding: 0 2px;
  color: #0c1222;
  background: linear-gradient(110deg, #8ca4ff, #9e86ff);
}

body[data-theme="guofeng"] .collection-hero {
  background:
    radial-gradient(circle at 12% 0%, rgba(210, 163, 111, 0.16), transparent 45%),
    linear-gradient(160deg, rgba(39, 28, 22, 0.9), rgba(28, 21, 18, 0.84));
}

body[data-theme="guofeng"] .collection-tag-btn.is-active {
  border-color: rgba(210, 163, 111, 0.62);
  background: rgba(210, 163, 111, 0.24);
  color: #fff3e2;
}

body[data-theme="guofeng"] .collection-hl {
  color: #26180d;
  background: linear-gradient(110deg, #d2a36f, #be8450);
}

body[data-light-mode="on"] .collection-hero {
  background:
    radial-gradient(circle at 12% 0%, rgba(106, 128, 230, 0.2), transparent 45%),
    linear-gradient(160deg, rgba(246, 249, 255, 0.95), rgba(235, 241, 255, 0.88));
}

body[data-light-mode="on"] .collection-tools {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(106, 128, 230, 0.2);
}

body[data-light-mode="on"] .role-card-floating {
  border-color: rgba(106, 128, 230, 0.22);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.9), rgba(240, 245, 255, 0.86)),
    radial-gradient(circle at 90% 0%, rgba(140, 164, 255, 0.22), transparent 45%);
}

body[data-light-mode="on"] .collection-card-excerpt {
  color: #4a5f97;
}

body[data-light-mode="on"] .collection-inline-tag {
  color: #435581;
  border-color: rgba(106, 128, 230, 0.25);
  background: rgba(106, 128, 230, 0.08);
}

body[data-light-mode="on"] .collection-tag-btn.is-active {
  color: #f6f8ff;
}

body[data-theme="guofeng"][data-light-mode="on"] .collection-hero {
  background:
    radial-gradient(circle at 12% 0%, rgba(210, 163, 111, 0.18), transparent 45%),
    linear-gradient(160deg, rgba(255, 248, 240, 0.96), rgba(247, 236, 224, 0.9));
}

body[data-theme="guofeng"][data-light-mode="on"] .collection-tools,
body[data-theme="guofeng"][data-light-mode="on"] .role-card-floating {
  border-color: rgba(173, 122, 79, 0.24);
}

body[data-theme="guofeng"][data-light-mode="on"] .collection-inline-tag {
  color: #7a4f2f;
  border-color: rgba(173, 122, 79, 0.3);
  background: rgba(173, 122, 79, 0.08);
}

@media (max-width: 1180px) {
  #collectionCards.collection-cards,
  #draftCards.collection-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  #collectionCards.collection-cards,
  #draftCards.collection-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .collection-tools {
    padding: 8px;
  }

  .role-card-floating {
    padding: 7px;
  }
}

@media (max-width: 680px) {
  #collectionCards.collection-cards,
  #draftCards.collection-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .collection-search-row {
    grid-template-columns: 1fr;
  }
}