/**
 * Part 4: 宝可梦卡牌图鉴 (Pokédex) Stylesheet
 */
.pokedex-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 1. 顶部 Header Banner */
.pokedex-header-banner {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.banner-title-group h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-gold);
  margin-bottom: 4px;
}

.banner-title-group p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* 道具图鉴 Section Block */
.pokedex-section-block {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-block-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.section-block-title h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-cyan);
}

.block-subnote {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* 1. 训练家角色 Grid */
.trainer-boards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.trainer-board-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.3s ease;
}

.trainer-board-card:hover {
  border-color: var(--accent-gold);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.15);
}

.trainer-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.trainer-icon {
  font-size: 1.8rem;
}

.trainer-meta h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

.trainer-player-tag {
  font-size: 0.72rem;
  color: var(--accent-gold);
  font-weight: 700;
}

.trainer-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  flex: 1;
}

.trainer-card-footer {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.feature-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* 2. 精灵球筹码 Grid */
.pokeball-tokens-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.pokeball-item-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.3s ease;
}

.pokeball-item-card:hover {
  transform: translateY(-2px);
}

.ball-fire:hover { border-color: #EF4444; box-shadow: 0 4px 14px rgba(239, 68, 68, 0.2); }
.ball-water:hover { border-color: #3B82F6; box-shadow: 0 4px 14px rgba(59, 130, 246, 0.2); }
.ball-grass:hover { border-color: #64748B; box-shadow: 0 4px 14px rgba(100, 116, 139, 0.2); }
.ball-electric:hover { border-color: #F59E0B; box-shadow: 0 4px 14px rgba(245, 158, 11, 0.2); }
.ball-psychic:hover { border-color: #EC4899; box-shadow: 0 4px 14px rgba(236, 72, 153, 0.2); }
.ball-wild:hover { border-color: #A855F7; box-shadow: 0 4px 14px rgba(168, 85, 247, 0.25); }

.ball-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ball-icon {
  font-size: 1.8rem;
}

.ball-title-box h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

.ball-color-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.ball-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  flex: 1;
}

.ball-count-bar {
  font-size: 0.76rem;
  color: var(--text-main);
  background: rgba(30, 41, 59, 0.6);
  padding: 4px 8px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-pill {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.78rem;
  color: var(--text-main);
}

.stat-pill .stat-num {
  font-weight: 800;
  color: var(--accent-cyan);
  margin-right: 4px;
}

.stat-pill.rare-pill {
  border-color: rgba(244, 114, 182, 0.5);
  background: rgba(244, 114, 182, 0.1);
}

.stat-pill.leg-pill {
  border-color: rgba(192, 132, 252, 0.5);
  background: rgba(192, 132, 252, 0.1);
}

/* 2. 筛选工具栏 */
.pokedex-toolbar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-group,
.type-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-group-second {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.btn-filter,
.btn-type-filter {
  padding: 5px 11px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-filter:hover,
.btn-type-filter:hover {
  background: rgba(59, 130, 246, 0.15);
  color: var(--text-main);
  border-color: var(--accent-cyan);
}

.btn-filter.active,
.btn-type-filter.active {
  background: var(--accent-cyan);
  color: #0F172A;
  border-color: var(--accent-cyan);
  font-weight: 800;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

.search-box-wrapper {
  flex: 1;
  min-width: 220px;
  max-width: 380px;
}

.pokedex-search-input {
  width: 100%;
  padding: 7px 12px;
  background: rgba(15, 23, 42, 0.9);
  border: 1.5px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-main);
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.pokedex-search-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.25);
}

/* 3. 卡牌展示网格 */
.pokedex-grid-container {
  min-height: 400px;
}

.pokedex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.dex-card {
  background: #1E293B;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.25 ease;
  position: relative;
  min-height: 155px;
}

.dex-card:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
  border-color: var(--accent-gold);
}

.dex-card.card-lvl-1 { border-color: #22C55E; }
.dex-card.card-lvl-2 { border-color: #F97316; }
.dex-card.card-lvl-3 { border-color: #0284C7; }
.dex-card.card-rare { border-color: #EC4899; background: linear-gradient(135deg, rgba(236,72,153,0.15), rgba(15,23,42,0.9)); }
.dex-card.card-leg { border-color: #A855F7; background: linear-gradient(135deg, rgba(168,85,247,0.2), rgba(15,23,42,0.9)); }

.dex-card-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dex-level-tag {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
}

.dex-pts {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--accent-gold);
}

.dex-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 4px 0;
}

.dex-avatar {
  font-size: 1.8rem;
  line-height: 1;
}

.dex-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2px;
  text-align: center;
}

.dex-number {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.dex-bonus-pill {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 4px;
  padding: 1px 4px;
  text-align: center;
  margin: 2px 0;
}

.dex-cost-row {
  display: flex;
  justify-content: center;
  gap: 3px;
  flex-wrap: wrap;
  margin-top: auto;
}

.cost-badge {
  font-size: 0.72rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
}

.cost-fire { background: var(--c-fire) !important; }
.cost-water { background: var(--c-water) !important; }
.cost-grass { background: #334155 !important; border: 1px solid #64748B !important; }
.cost-electric { background: var(--c-electric) !important; }
.cost-psychic { background: var(--c-psychic) !important; }
.cost-wild { background: #A855F7 !important; border: 1px solid #C084FC !important; }

.empty-pokedex-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: 12px;
  text-align: center;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 8px;
}

.empty-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.btn-reset-filter {
  padding: 7px 16px;
  background: var(--accent-cyan);
  color: #0F172A;
  font-weight: 700;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}

/* 4. Modal 详情浮窗 */
.dex-modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

.dex-modal-content {
  background: #0F172A;
  border: 2px solid var(--accent-gold);
  border-radius: 14px;
  padding: 24px;
  max-width: 540px;
  width: 100%;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.9), 0 0 25px rgba(245, 158, 11, 0.3);
}

.btn-close-modal {
  position: absolute;
  top: 14px; right: 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 50%;
  width: 28px; height: 28px;
  cursor: pointer;
  font-size: 0.9rem;
}

.dex-detail-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.dex-detail-card-preview {
  width: 150px;
  height: 190px;
  border-radius: 10px;
  border: 2px solid var(--border-color);
  background: #1E293B;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.dex-detail-card-preview.card-lvl-1 { border-color: #22C55E; }
.dex-detail-card-preview.card-lvl-2 { border-color: #F97316; }
.dex-detail-card-preview.card-lvl-3 { border-color: #0284C7; }
.dex-detail-card-preview.card-rare { border-color: #EC4899; }
.dex-detail-card-preview.card-leg { border-color: #A855F7; }

.preview-top {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 700;
}

.preview-pts { color: var(--accent-gold); }
.preview-tag { color: var(--text-muted); }
.preview-avatar { font-size: 2.8rem; margin: 4px 0; }
.preview-name { font-size: 0.9rem; font-weight: 800; color: var(--text-main); }
.preview-num { font-size: 0.7rem; color: var(--text-muted); }
.preview-cost { display: flex; gap: 3px; margin-top: 4px; }

.dex-detail-info {
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dex-detail-info h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent-gold);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 6px;
}

.info-section {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.info-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.info-value {
  font-size: 0.8rem;
  color: var(--text-main);
  line-height: 1.4;
}

.info-cost-flex {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.detail-cost-chip {
  font-size: 0.75rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  padding: 3px 8px;
  border-radius: 4px;
}
