/*
 * Copyright (c) 2026 爱玩机的发烧友. All rights reserved.
 * 未经授权，禁止复制、修改或分发。
 *
 * 角色卡广场页面样式（复用 /card/card.css 的主题令牌）
 */

/* ── 顶部导航（列表页改为吸顶） ───────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 10px 16px;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.back-btn,
.brand {
  text-decoration: none;
}

/* ── 页面骨架 ─────────────────────────────────────────────── */

.cards-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 30px 20px 64px;
}

.cards-hero {
  padding: 18px 0 4px;
  text-align: center;
}

.eyebrow {
  margin: 0;
  color: var(--brand-light);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.cards-hero h1 {
  margin: 10px 0 0;
  font-size: clamp(26px, 5vw, 38px);
  font-weight: 800;
  letter-spacing: 0.5px;
}

.hero-desc {
  margin: 10px 0 0;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.7;
}

/* ── 搜索 ─────────────────────────────────────────────────── */

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 560px;
  height: 48px;
  margin: 24px auto 0;
  padding: 0 14px;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 24px var(--shadow-color);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.search-box:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(12, 119, 231, 0.14), 0 8px 24px var(--shadow-color);
}

.search-box svg {
  flex: 0 0 auto;
}

.search-box input {
  flex: 1;
  min-width: 0;
  padding: 0;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  background: transparent;
  border: 0;
  outline: 0;
}

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

.search-box input::-webkit-search-cancel-button {
  display: none;
}

.search-clear {
  flex: 0 0 auto;
  padding: 4px 10px;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 11px;
  background: var(--surface-inset);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.search-clear[hidden] {
  display: none;
}

/* ── 列表 ─────────────────────────────────────────────────── */

.cards-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 26px 0 14px;
  color: var(--text-2);
  font-size: 12.5px;
}

.sort-note {
  color: var(--text-3);
  font-size: 11.5px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}

.list-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 8px 22px var(--shadow-color);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.list-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: 0 16px 36px var(--shadow-color);
}

.list-cover {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: var(--work-bg);
}

.list-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.list-card:hover .list-cover img {
  transform: scale(1.03);
}

.cover-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--placeholder-text);
  font-size: 42px;
  font-weight: 700;
  background: var(--placeholder-gradient);
}

.list-like {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 3px 8px;
  color: #fff;
  font-size: 11px;
  background: rgba(5, 8, 14, 0.55);
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.list-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 11px 12px 13px;
}

.list-name {
  margin: 0;
  overflow: hidden;
  font-size: 14.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-author {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
  color: var(--text-2);
  font-size: 11.5px;
}

.list-author img {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  object-fit: cover;
  background: var(--avatar-bg);
  border: 1px solid var(--avatar-border);
  border-radius: 50%;
}

.list-author span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-desc {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.list-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.list-tag {
  padding: 2px 7px;
  color: var(--chip-color);
  font-size: 10.5px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  border-radius: 999px;
}

/* ── 骨架 / 空态 / 加载更多 ───────────────────────────────── */

.skeleton-card {
  pointer-events: none;
}

.skeleton-cover {
  aspect-ratio: 3 / 4;
  background: linear-gradient(110deg, var(--skeleton-a) 8%, var(--skeleton-b) 18%, var(--skeleton-a) 33%);
  background-size: 220% 100%;
  animation: shimmer 1.2s linear infinite;
}

.skeleton-body {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px;
}

.skeleton-bar {
  height: 10px;
  background: linear-gradient(110deg, var(--skeleton-a) 8%, var(--skeleton-b) 18%, var(--skeleton-a) 33%);
  background-size: 220% 100%;
  border-radius: 6px;
  animation: shimmer 1.2s linear infinite;
}

.skeleton-bar.w45 { width: 45%; }
.skeleton-bar.w70 { width: 70%; }
.skeleton-bar.w85 { width: 85%; }

.empty {
  margin-top: 4px;
}

.empty-title {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

.empty-desc {
  margin: 8px 0 0;
  font-size: 12.5px;
  line-height: 1.7;
}

.empty-retry {
  margin-top: 16px;
  padding: 10px 20px;
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  background: linear-gradient(135deg, #1683ff, #0b66d6);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}

.cards-actions {
  display: flex;
  justify-content: center;
  margin-top: 26px;
}

.load-more {
  min-width: 170px;
  height: 44px;
  padding: 0 26px;
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(135deg, #1683ff, #0b66d6);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 8px 22px var(--start-shadow);
  cursor: pointer;
  transition: transform 0.16s ease, filter 0.16s ease;
}

.load-more:hover {
  filter: brightness(1.04);
}

.load-more:active {
  transform: scale(0.99);
}

.load-more[hidden] {
  display: none;
}

.load-more:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ── 页脚 ─────────────────────────────────────────────────── */

.cards-footer {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: 44px;
  color: var(--text-3);
  font-size: 12px;
}

.cards-footer a {
  color: var(--text-2);
  text-decoration: none;
}

.cards-footer a:hover {
  color: var(--brand-light);
}

/* ── 响应式 ───────────────────────────────────────────────── */

@media (max-width: 640px) {
  .cards-page {
    padding: 22px 16px 52px;
  }

  .cards-meta {
    margin-top: 20px;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .list-body {
    padding: 10px 10px 12px;
  }

  .sort-note {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .list-card,
  .list-cover img,
  .skeleton-cover,
  .skeleton-bar {
    transition: none;
    animation: none;
  }
}
