/* ============================================================
   宝可梦抽卡收集系统 — 样式和动画
   ============================================================ */

.pokemon-page {
  padding: 0 0 2rem;
}

.section-heading {
  font-size: 1.15rem;
  margin: 0 0 0.75rem;
}

.pokedex-count-inline {
  font-size: 0.8rem;
  font-weight: 400;
  color: #aaa;
}

/* ============================================================
   ★ 展示卡片（宝可梦页 + 首页共用）
   ============================================================ */

.showcase-section { margin-bottom: 1.5rem; }

.showcase-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.showcase-card {
  position: relative;
  background: white;
  border-radius: 20px;
  width: 200px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.04);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.showcase-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 12px 36px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.06);
}

.showcase-card-bg {
  position: absolute; inset: 0; opacity: 0.12; z-index: 0;
}

.showcase-card[data-type="fire"] .showcase-card-bg { background: linear-gradient(180deg, #f08030 0%, transparent 60%); }
.showcase-card[data-type="water"] .showcase-card-bg { background: linear-gradient(180deg, #6890f0 0%, transparent 60%); }
.showcase-card[data-type="grass"] .showcase-card-bg { background: linear-gradient(180deg, #78c850 0%, transparent 60%); }
.showcase-card[data-type="electric"] .showcase-card-bg { background: linear-gradient(180deg, #f8d030 0%, transparent 60%); }
.showcase-card[data-type="psychic"] .showcase-card-bg { background: linear-gradient(180deg, #f85888 0%, transparent 60%); }
.showcase-card[data-type="ice"] .showcase-card-bg { background: linear-gradient(180deg, #98d8d8 0%, transparent 60%); }
.showcase-card[data-type="dragon"] .showcase-card-bg { background: linear-gradient(180deg, #7038f8 0%, transparent 60%); }
.showcase-card[data-type="ghost"] .showcase-card-bg { background: linear-gradient(180deg, #705898 0%, transparent 60%); }
.showcase-card[data-type="fairy"] .showcase-card-bg { background: linear-gradient(180deg, #ee99ac 0%, transparent 60%); }
.showcase-card[data-type="fighting"] .showcase-card-bg { background: linear-gradient(180deg, #c03028 0%, transparent 60%); }
.showcase-card[data-type="poison"] .showcase-card-bg { background: linear-gradient(180deg, #a040a0 0%, transparent 60%); }
.showcase-card[data-type="bug"] .showcase-card-bg { background: linear-gradient(180deg, #a8b820 0%, transparent 60%); }
.showcase-card[data-type="rock"] .showcase-card-bg { background: linear-gradient(180deg, #b8a038 0%, transparent 60%); }
.showcase-card[data-type="ground"] .showcase-card-bg { background: linear-gradient(180deg, #e0c068 0%, transparent 60%); }
.showcase-card[data-type="flying"] .showcase-card-bg { background: linear-gradient(180deg, #a890f0 0%, transparent 60%); }
.showcase-card[data-type="normal"] .showcase-card-bg { background: linear-gradient(180deg, #a8a878 0%, transparent 60%); }
.showcase-card[data-type="steel"] .showcase-card-bg { background: linear-gradient(180deg, #b8b8d0 0%, transparent 60%); }
.showcase-card[data-type="dark"] .showcase-card-bg { background: linear-gradient(180deg, #705848 0%, transparent 60%); }

.showcase-card-rarity {
  position: absolute; inset: -2px; border-radius: 22px; z-index: 0; opacity: 0;
}
.showcase-card-rarity.mid {
  opacity: 1; border: 2px solid rgba(171,71,188,0.4); box-shadow: 0 0 12px rgba(171,71,188,0.15);
}
.showcase-card-rarity.rare {
  opacity: 1; border: 2px solid rgba(255,193,7,0.6); box-shadow: 0 0 20px rgba(255,193,7,0.2);
  animation: rareGlow 2s ease-in-out infinite;
}
@keyframes rareGlow {
  0%, 100% { box-shadow: 0 0 12px rgba(255,193,7,0.15); }
  50% { box-shadow: 0 0 24px rgba(255,193,7,0.35); }
}

.showcase-top {
  display: flex; justify-content: space-between;
  padding: 0.55rem 0.75rem 0; position: relative; z-index: 1;
}
.showcase-number { font-size: 0.7rem; font-weight: 700; color: #bbb; }
.showcase-genus { font-size: 0.65rem; color: #bbb; }

.showcase-artwork {
  width: 120px; height: 120px; object-fit: contain;
  margin: 0 auto; display: block; position: relative; z-index: 1;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.12));
  animation: showcaseFloat 3.5s ease-in-out infinite;
}
@keyframes showcaseFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.showcase-info {
  padding: 0 0.75rem 0.6rem; text-align: center; position: relative; z-index: 1;
}
.showcase-name { font-size: 1.05rem; font-weight: 700; margin: 0 0 0.2rem; color: #333; }
.showcase-types { margin-bottom: 0.25rem; }
.showcase-types .type-badge { font-size: 0.65rem; padding: 0.1rem 0.5rem; }

.showcase-body {
  font-size: 0.65rem; color: #aaa;
  display: flex; gap: 0.6rem; justify-content: center; margin-bottom: 0.25rem;
}

.showcase-stats {
  display: flex; justify-content: center; gap: 0.35rem; margin-top: 0.15rem;
}

.showcase-town-status {
  font-size: 0.6rem; color: #888; text-align: center;
  padding: 0.2rem 0.5rem; background: #f8f8f8; border-top: 1px solid #eee;
  border-radius: 0 0 12px 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.showcase-stat { display: flex; flex-direction: column; align-items: center; }
.showcase-stat-label { font-size: 0.55rem; font-weight: 700; color: #bbb; }
.showcase-stat-value { font-size: 0.8rem; font-weight: 700; color: #555; }

/* ============================================================
   世代选择器
   ============================================================ */

.gen-selector {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.gen-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.4rem 0.7rem;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background: white;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  min-width: 60px;
}

.gen-btn:hover { border-color: #90caf9; }
.gen-btn.active { border-color: #2196f3; background: #e3f2fd; }
.gen-btn.gen-complete { border-color: #c8e6c9; background: #f1f8e9; }
.gen-btn.gen-complete.active { border-color: #4caf50; background: #e8f5e9; }

.gen-btn-name { font-size: 0.75rem; font-weight: 700; color: #555; }
.gen-btn-progress { font-size: 0.6rem; color: #aaa; }
.gen-btn.active .gen-btn-name { color: #1976d2; }
.gen-btn.gen-complete .gen-btn-name { color: #388e3c; }

/* ============================================================
   抽卡区域
   ============================================================ */

.draw-section { margin-bottom: 1.5rem; }
   抽卡区域（续）
   ============================================================ */

.draw-header {
  text-align: center;
  margin-bottom: 1rem;
}

.draw-row {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.draw-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.draw-progress {
  max-width: 350px;
  margin: 0 auto;
}

.draw-progress-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: #666;
}

.draw-progress-bar {
  height: 12px;
  background: #e8e8e8;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 0.3rem;
}

.draw-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #e53935, #ff5722, #ff9800, #ffc107);
  border-radius: 6px;
  transition: width 0.6s ease;
  position: relative;
}

.draw-progress-fill::after {
  content: '';
  position: absolute;
  top: 2px; left: 4px; right: 4px; height: 4px;
  background: rgba(255,255,255,0.35);
  border-radius: 4px;
}

/* ============================================================
   抽卡区域 — 3D 翻转卡片
   ============================================================ */

.draw-area {
  margin-bottom: 1.5rem;
}

.draw-card-wrapper {
  perspective: 1000px;
  width: 220px;
  height: 300px;
}

.draw-card {
  width: 100%;
  height: 100%;
  position: relative;
}

.draw-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.draw-card-inner.flipped {
  transform: rotateY(180deg);
}

.draw-card-back,
.draw-card-front {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 16px;
  overflow: hidden;
}

/* --- 卡片背面 --- */
.draw-card-back {
  background: linear-gradient(135deg, #1a237e, #283593, #3949ab);
  border: 3px solid #5c6bc0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(26, 35, 126, 0.3);
}

.card-back-design {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-back-circle {
  position: absolute;
  width: 160px;
  height: 160px;
  border: 4px solid rgba(255,255,255,0.15);
  border-radius: 50%;
}

.card-back-pokeball {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(180deg, #e53935 50%, white 50%);
  border: 4px solid #333;
  box-shadow: 0 0 20px rgba(229,57,53,0.3);
  overflow: hidden;
}

/* 中间横线 */
.card-back-pokeball::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 5px;
  background: #333;
  transform: translateY(-50%);
  z-index: 1;
}

/* 中心按钮 */
.card-back-pokeball::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  border: 5px solid #333;
  z-index: 2;
  box-shadow: 0 0 6px rgba(0,0,0,0.15);
}

.card-back-text {
  position: absolute;
  bottom: 20px;
  font-size: 2rem;
  color: rgba(255,255,255,0.4);
  font-weight: 700;
  animation: cardPulse 2s ease-in-out infinite;
}

@keyframes cardPulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.1); }
}

/* --- 卡片正面 --- */
.draw-card-front {
  transform: rotateY(180deg);
  background: white;
  border: 3px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  gap: 0.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  position: relative;
}

.card-rarity-glow {
  position: absolute;
  inset: -4px;
  border-radius: 20px;
  opacity: 0;
  z-index: -1;
  transition: opacity 0.5s;
}

.card-rarity-glow.normal { background: linear-gradient(135deg, #42a5f5, #90caf9); opacity: 0.5; }
.card-rarity-glow.mid { background: linear-gradient(135deg, #ab47bc, #ce93d8, #7b1fa2); opacity: 0.6; animation: rarityPulse 2s ease-in-out infinite; }
.card-rarity-glow.rare { background: linear-gradient(135deg, #ffd700, #ffab00, #ff6f00, #ffd700); opacity: 0.7; animation: rarityPulse 1.5s ease-in-out infinite; }

@keyframes rarityPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

.drawn-sprite {
  width: 120px;
  height: 120px;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
  animation: spriteEntrance 0.6s ease-out;
}

@keyframes spriteEntrance {
  0% { transform: scale(0) rotate(-30deg); opacity: 0; }
  60% { transform: scale(1.2) rotate(5deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); }
}

.drawn-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: #333;
}

.drawn-card-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 0.4rem 0.6rem;
  display: flex;
  justify-content: space-between;
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 13px 13px 0 0;
  opacity: 0.9;
}

.drawn-card-footer {
  display: flex;
  gap: 0.8rem;
  font-size: 0.7rem;
  color: #888;
}

.drawn-stat { font-weight: 600; }

.drawn-types {
  display: flex;
  gap: 0.3rem;
}

.drawn-rarity {
  font-size: 0.8rem;
  margin-top: 0.2rem;
}

/* ============================================================
   抽卡按钮
   ============================================================ */

.draw-btn {
  background: linear-gradient(135deg, #e53935, #ff5722);
  color: white;
  border: none;
  padding: 0.9rem 2.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  font-family: inherit;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 5px 0 #b71c1c, 0 8px 24px rgba(229,57,53,0.3);
  transition: all 0.15s ease;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.draw-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.draw-btn:hover:not(:disabled)::before { left: 100%; }

.draw-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #b71c1c, 0 12px 30px rgba(229,57,53,0.4);
}

.draw-btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #b71c1c, 0 4px 12px rgba(229,57,53,0.3);
}

.draw-btn:disabled {
  background: linear-gradient(135deg, #bdbdbd, #9e9e9e);
  box-shadow: 0 4px 0 #757575;
  cursor: not-allowed;
}

.draw-btn-free {
  background: linear-gradient(135deg, #43a047, #66bb6a) !important;
  box-shadow: 0 5px 0 #2e7d32, 0 8px 24px rgba(67,160,71,0.3) !important;
  animation: freeGlow 2s ease-in-out infinite;
}

@keyframes freeGlow {
  0%, 100% { box-shadow: 0 5px 0 #2e7d32, 0 8px 20px rgba(67,160,71,0.2); }
  50% { box-shadow: 0 5px 0 #2e7d32, 0 8px 30px rgba(67,160,71,0.4); }
}

.draw-btn.drawing {
  animation: btnShake 0.5s ease-in-out;
}

@keyframes btnShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px) rotate(-2deg); }
  40% { transform: translateX(8px) rotate(2deg); }
  60% { transform: translateX(-5px) rotate(-1deg); }
  80% { transform: translateX(5px) rotate(1deg); }
}

/* ============================================================
   信息栏
   ============================================================ */

.draw-info {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: #666;
}

.draw-info-item strong {
  color: #ff9800;
}

/* ============================================================
   已全部收集
   ============================================================ */

.draw-complete {
  text-align: center;
  padding: 3rem 1rem;
}

.draw-complete-icon {
  font-size: 4rem;
  animation: trophyBounce 2s ease-in-out infinite;
}

@keyframes trophyBounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-15px) rotate(-5deg); }
  75% { transform: translateY(-10px) rotate(5deg); }
}

.draw-complete h2 { margin: 0.5rem 0; color: #ff9800; }
.draw-complete p { color: #888; }

/* ============================================================
   最近获得
   ============================================================ */

.draw-recent { margin-top: 1.5rem; }
.draw-recent h2 { font-size: 1.1rem; margin: 0 0 0.75rem; }

.draw-recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
  gap: 0.6rem;
}

.draw-recent-card {
  position: relative;
  background: white;
  border-radius: 12px;
  padding: 0.5rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: transform 0.2s;
}

.draw-recent-card:hover { transform: translateY(-3px); }

.draw-recent-sprite {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
}

.draw-recent-name {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: #444;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.draw-recent-number {
  display: block;
  font-size: 0.6rem;
  color: #aaa;
}

/* ============================================================
   BST战斗力 + 收藏标记（最近获得 & 图鉴通用）
   ============================================================ */

.entry-bst {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  color: #e65100;
  margin-top: 1px;
  letter-spacing: 0.02em;
}

.entry-fav-badge {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 0.7rem;
  color: #ffc107;
  filter: drop-shadow(0 0 2px rgba(255,193,7,0.6));
  z-index: 2;
  line-height: 1;
}

.pokedex-entry.is-fav {
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1), 0 0 0 2px rgba(255, 193, 7, 0.4);
}

/* ============================================================
   闪光粒子
   ============================================================ */

.draw-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1001;
}

.draw-particle {
  position: absolute;
  font-size: 1.5rem;
  animation: particleFly 1.2s ease-out forwards;
  pointer-events: none;
}

@keyframes particleFly {
  0% { opacity: 1; transform: translate(0, 0) scale(0.5) rotate(0deg); }
  50% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0) rotate(360deg); }
}

/* ============================================================
   全屏闪光效果
   ============================================================ */

.draw-flash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
}

.draw-flash.normal { background: radial-gradient(circle, rgba(66,165,245,0.6) 0%, transparent 70%); }
.draw-flash.mid { background: radial-gradient(circle, rgba(171,71,188,0.6) 0%, transparent 70%); }
.draw-flash.rare { background: radial-gradient(circle, rgba(255,215,0,0.7) 0%, transparent 70%); }

.draw-flash { animation: flashBurst 0.8s ease-out forwards; }

@keyframes flashBurst {
  0% { opacity: 0; }
  20% { opacity: 1; }
  100% { opacity: 0; }
}

/* ============================================================
   Type Badges
   ============================================================ */

.type-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  color: white;
  font-size: 0.72rem;
  font-weight: 600;
}

.type-normal   { background: #a8a878; }
.type-fire     { background: #f08030; }
.type-water    { background: #6890f0; }
.type-grass    { background: #78c850; }
.type-electric { background: #f8d030; color: #333; }
.type-ice      { background: #98d8d8; color: #333; }
.type-fighting { background: #c03028; }
.type-poison   { background: #a040a0; }
.type-ground   { background: #e0c068; color: #333; }
.type-flying   { background: #a890f0; }
.type-psychic  { background: #f85888; }
.type-bug      { background: #a8b820; }
.type-rock     { background: #b8a038; }
.type-ghost    { background: #705898; }
.type-dragon   { background: #7038f8; }
.type-dark     { background: #705848; }
.type-steel    { background: #b8b8d0; color: #333; }
.type-fairy    { background: #ee99ac; }

/* ============================================================
   图鉴页
   ============================================================ */

.pokedex-page { padding: 1rem 0; }

.pokedex-section { margin-top: 1rem; }

/* 世代标签页 */
.pokedex-tabs {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  border-bottom: 2px solid #eee;
  padding-bottom: 0.5rem;
}

.pokedex-tab {
  padding: 0.4rem 0.8rem;
  border: none;
  border-radius: 8px 8px 0 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: #999;
  transition: all 0.2s;
  white-space: nowrap;
}

.pokedex-tab:hover { color: #555; background: #f5f5f5; }
.pokedex-tab.active { color: #e53935; background: #fef2f2; border-bottom: 2px solid #e53935; margin-bottom: -2px; }

.tab-count { font-size: 0.65rem; font-weight: 400; color: #bbb; margin-left: 0.2rem; }
.pokedex-tab.active .tab-count { color: #ef9a9a; }

.pokedex-header { text-align: center; margin-bottom: 1.5rem; }
.pokedex-header h1 { margin: 0 0 0.75rem; }

.pokedex-progress { max-width: 300px; margin: 0 auto; }
.pokedex-count { font-size: 0.9rem; font-weight: 600; color: #666; }

.pokedex-progress-bar { height: 10px; background: #e0e0e0; border-radius: 5px; overflow: hidden; margin-top: 0.3rem; }
.pokedex-progress-fill { height: 100%; background: linear-gradient(90deg, #e53935, #ff5722, #ff9800); border-radius: 5px; transition: width 0.5s; }

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

.pokedex-entry {
  position: relative;
  text-align: center;
  padding: 0.4rem;
  border-radius: 10px;
  transition: all 0.2s;
  font-size: 0.7rem;
}

.pokedex-entry.discovered {
  background: white;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

.pokedex-entry.discovered:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  z-index: 1;
}

.pokedex-entry.undiscovered { background: #f0f0f0; }

.pokedex-entry img {
  width: 48px; height: 48px;
  image-rendering: pixelated;
  display: block; margin: 0 auto;
}

.pokedex-silhouette { width: 48px; height: 48px; margin: 0 auto; position: relative; }

.silhouette-img {
  width: 48px; height: 48px;
  image-rendering: pixelated;
  filter: brightness(0) opacity(0.2);
}

.pokedex-number { display: block; font-size: 0.6rem; color: #aaa; font-weight: 600; }
.pokedex-name { display: block; font-size: 0.62rem; font-weight: 600; color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pokedex-entry.undiscovered .pokedex-name { color: #ccc; }

/* 图鉴详情卡片弹窗 */
.pokedex-modal {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center; justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.25s;
  backdrop-filter: blur(4px);
}
.pokedex-modal.open { display: flex; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- 精美卡片 --- */
.pokemon-card-detail {
  background: #fff;
  border-radius: 24px;
  max-width: 380px;
  width: 92%;
  overflow: hidden;
  position: relative;
  animation: cardDetailPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow:
    0 20px 60px rgba(0,0,0,0.25),
    0 0 0 1px rgba(255,255,255,0.1);
}

.pokemon-card-detail.loading {
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pokemon-card-detail.loading::after {
  content: '加载中...';
  color: #aaa;
  font-size: 1rem;
}

@keyframes cardDetailPop {
  from { transform: scale(0.85) translateY(30px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.card-detail-close {
  position: absolute; top: 8px; right: 12px;
  background: rgba(255,255,255,0.7); border: none;
  font-size: 1.5rem; cursor: pointer; color: #fff; line-height: 1;
  z-index: 10;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  transition: background 0.2s;
}
.card-detail-close:hover { background: rgba(255,255,255,0.9); color: #333; }

/* 卡片头部 — 类型渐变色 */
.card-detail-header {
  padding: 0.8rem 1.2rem 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
  font-weight: 600;
  background: linear-gradient(135deg, #a8a878, #c8c888);
}

.card-detail-number { font-size: 1.1rem; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.card-detail-genus { font-size: 0.8rem; opacity: 0.9; }

/* 精灵图展示区 */
.card-detail-artwork-area {
  display: flex;
  justify-content: center;
  padding: 0.5rem 1rem;
  background: linear-gradient(180deg, rgba(0,0,0,0.03) 0%, transparent 100%);
}

.card-detail-artwork {
  width: 180px;
  height: 180px;
  object-fit: contain;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,0.15));
  animation: artworkFloat 3s ease-in-out infinite;
}

@keyframes artworkFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* 名字行 */
.card-detail-name-row {
  text-align: center;
  padding: 0 1.2rem;
}

.card-detail-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  color: #222;
}

.card-detail-name-en {
  font-size: 0.8rem;
  color: #aaa;
  font-weight: 400;
}

/* 属性标签 */
.card-detail-types {
  text-align: center;
  padding: 0.4rem 0;
}

.card-detail-types .type-badge {
  font-size: 0.8rem;
  padding: 0.2rem 0.8rem;
  border-radius: 12px;
  margin: 0 0.15rem;
}

/* 身体数据 */
.card-detail-body-info {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  padding: 0.6rem 1rem;
  margin: 0 1.2rem;
  border-top: 1px solid #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
}

.card-body-item { text-align: center; }
.card-body-label { display: block; font-size: 0.7rem; color: #aaa; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.card-body-value { display: block; font-size: 1.05rem; font-weight: 700; color: #333; margin-top: 0.1rem; }
.card-bst-value { color: #e53935; font-size: 1.15rem; }

/* 能力值 */
.card-detail-stats {
  padding: 0.6rem 1.2rem 0.3rem;
}

.card-detail-stats h3 {
  font-size: 0.8rem;
  color: #888;
  margin: 0 0 0.5rem;
  text-align: center;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.card-stats-grid {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.card-stat-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-stat-label {
  width: 36px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #888;
  text-align: right;
  flex-shrink: 0;
}

.card-stat-bar-bg {
  flex: 1;
  height: 8px;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
}

.card-stat-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.card-stat-bar-fill::after {
  content: '';
  position: absolute;
  top: 1px; left: 2px; right: 2px; height: 3px;
  background: rgba(255,255,255,0.35);
  border-radius: 3px;
}

.card-stat-value {
  width: 28px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #555;
  text-align: right;
  flex-shrink: 0;
}

/* 描述 */
.card-detail-desc {
  font-size: 0.82rem;
  color: #777;
  line-height: 1.6;
  padding: 0.5rem 1.2rem 1.2rem;
  margin: 0;
  text-align: center;
  font-style: italic;
}

/* 收藏按钮 */
.card-detail-fav-area {
  padding: 0 1.2rem 1.2rem;
  text-align: center;
}

.card-detail-fav-btn {
  background: #f5f5f5;
  border: 2px solid #e0e0e0;
  padding: 0.5rem 1.5rem;
  border-radius: 50px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  color: #888;
  transition: all 0.25s ease;
}

.card-detail-fav-btn:hover {
  border-color: #ffc107;
  color: #f59e0b;
  background: #fffbeb;
}

.card-detail-fav-btn.is-fav {
  background: linear-gradient(135deg, #fff8e1, #ffecb3);
  border-color: #ffc107;
  color: #f59e0b;
}

/* ============================================================
   首页：训练师面板（左右布局·浅色）
   ============================================================ */

.trainer-hero {
  background: #fff;
  border-radius: 20px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.trainer-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(227,242,253,0.5), rgba(243,229,245,0.4), rgba(232,245,233,0.3));
  pointer-events: none;
  z-index: 0;
}

.trainer-hero > * {
  position: relative;
  z-index: 1;
}

/* 左右分栏 */
.trainer-body {
  display: flex;
  gap: 1.5rem;
  align-items: stretch;
}

.trainer-info {
  flex: 0 0 280px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}

.trainer-team {
  flex: 1;
  min-width: 0;
}

/* 队伍卡片始终一行，不换行（首页 + 宝可梦页） */
.trainer-team .showcase-row,
.showcase-section .showcase-row {
  flex-wrap: nowrap;
  gap: 0.6rem;
}

.trainer-team .showcase-card,
.showcase-section .showcase-card {
  flex: 0 1 200px;
  min-width: 0;
}

/* 等级头部 */
.trainer-header {
  margin-bottom: 0;
}

.trainer-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #333;
  margin-bottom: 0.4rem;
}

.trainer-exp {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.trainer-exp-bar {
  height: 10px;
  background: #e8eaf6;
  border-radius: 5px;
  overflow: hidden;
}

.trainer-exp-fill {
  height: 100%;
  background: linear-gradient(90deg, #66bb6a, #42a5f5, #ab47bc);
  border-radius: 5px;
  transition: width 0.6s ease;
}

.trainer-exp-text {
  font-size: 0.75rem;
  color: #999;
}

/* 统计 2×2 */
.trainer-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.trainer-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f5f7fa;
  border-radius: 14px;
  padding: 0.7rem 0.4rem;
}

.trainer-stat-item .trainer-stat-icon {
  font-size: 1.2rem;
  line-height: 1.2;
}

.trainer-stat-item .trainer-stat-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: #333;
  line-height: 1.3;
}

.trainer-stat-item .trainer-stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #999;
}

/* 队伍标题 */
.team-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #888;
  margin-bottom: 0.5rem;
}

/* 响应式：小屏上下堆叠 */
@media (max-width: 768px) {
  .trainer-body {
    flex-direction: column;
  }
  .trainer-info {
    flex: none;
    width: 100%;
  }
  .trainer-hero {
    padding: 1.2rem;
    border-radius: 16px;
  }
  .trainer-title {
    font-size: 1.2rem;
  }
  .trainer-stat-item .trainer-stat-value {
    font-size: 1.1rem;
  }
  /* 队伍卡片：不换行，均分宽度 */
  .trainer-team .showcase-row,
  .showcase-section .showcase-row {
    flex-wrap: nowrap;
    gap: 0.5rem;
  }
  .trainer-team .showcase-card,
  .showcase-section .showcase-card {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
  }
  /* 隐藏次要信息 */
  .trainer-team .showcase-body,
  .showcase-section .showcase-body { display: none; }
  .trainer-team .showcase-stats,
  .showcase-section .showcase-stats { display: none; }
  .trainer-team .showcase-genus,
  .showcase-section .showcase-genus { display: none; }
  .trainer-team .showcase-artwork,
  .showcase-section .showcase-artwork { width: 64px; height: 64px; }
  .trainer-team .showcase-info,
  .showcase-section .showcase-info { padding: 4px 6px 8px; }
  .trainer-team .showcase-name,
  .showcase-section .showcase-name { font-size: 0.75rem; }
  .trainer-team .showcase-number,
  .showcase-section .showcase-number { font-size: 0.6rem; }
  .trainer-team .type-badge,
  .showcase-section .type-badge { font-size: 0.55rem; padding: 1px 5px; }
  .trainer-team .showcase-card,
  .showcase-section .showcase-card { border-radius: 14px; }
}

@media (max-width: 480px) {
  .trainer-team .showcase-row,
  .showcase-section .showcase-row { gap: 0.3rem; }
  .trainer-team .showcase-artwork,
  .showcase-section .showcase-artwork { width: 48px; height: 48px; }
  .trainer-team .showcase-name,
  .showcase-section .showcase-name { font-size: 0.65rem; }
  .trainer-team .showcase-top,
  .showcase-section .showcase-top { display: none; }
  .trainer-team .showcase-types,
  .showcase-section .showcase-types { display: none; }
  .trainer-team .showcase-card,
  .showcase-section .showcase-card { border-radius: 10px; }
}

/* idle动画 */
.pet-anim-idle { animation: petIdle 3s ease-in-out infinite; }

@keyframes petIdle {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-10px) scale(1.03); }
}

/* ============================================================
   动态更新动画
   ============================================================ */

/* 弹入动画 — 新卡片出现 */
.anim-pop-in {
  animation: animPopIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes animPopIn {
  0% { opacity: 0; transform: scale(0.3) translateY(20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* 点亮动画 — 图鉴格子从灰变亮 */
.anim-light-up {
  animation: animLightUp 0.8s ease-out both;
}

@keyframes animLightUp {
  0% { opacity: 0; transform: scale(0.5); box-shadow: 0 0 0 rgba(255,193,7,0); }
  50% { opacity: 1; transform: scale(1.15); box-shadow: 0 0 20px rgba(255,193,7,0.6); }
  100% { opacity: 1; transform: scale(1); box-shadow: 0 1px 5px rgba(0,0,0,0.1); }
}

/* 淡出缩小 — 取消携带时移除 */
.anim-fade-out {
  animation: animFadeOut 0.4s ease-in both;
  pointer-events: none;
}

@keyframes animFadeOut {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.5) translateY(10px); }
}

/* ============================================================
   管理员面板
   ============================================================ */

.pet-admin-page { padding: 0; }

/* ============================================================
   Toast
   ============================================================ */

.pet-toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  padding: 0.8rem 1.6rem; border-radius: 12px; z-index: 1001;
  font-weight: 600; font-size: 0.95rem;
  animation: toastSlide 3.5s ease-in-out forwards;
  color: white; box-shadow: 0 6px 16px rgba(0,0,0,0.2);
  max-width: 90%; text-align: center;
}

@keyframes toastSlide {
  0% { transform: translateX(-50%) translateY(-20px); opacity: 0; }
  10% { transform: translateX(-50%) translateY(0); opacity: 1; }
  80% { transform: translateX(-50%) translateY(0); opacity: 1; }
  100% { transform: translateX(-50%) translateY(-20px); opacity: 0; }
}

/* ============================================================
   响应式
   ============================================================ */

@media (max-width: 480px) {
  .draw-card-wrapper { width: 180px; height: 250px; }
  .drawn-sprite { width: 90px; height: 90px; }
  .draw-btn { padding: 0.7rem 2rem; font-size: 1rem; }
  .draw-info { flex-direction: column; gap: 0.5rem; align-items: center; }
  .pokedex-grid { grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 0.3rem; }
  .pokedex-entry img, .silhouette-img { width: 36px; height: 36px; }
}

/* ============================================================
   地区成就系统
   ============================================================ */

.region-achievements {
  margin-bottom: 2rem;
}

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

.achievement-card {
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border: 2px solid transparent;
  transition: all 0.3s;
}

.achievement-card.complete {
  border-color: #ffd54f;
  background: linear-gradient(135deg, #fffde7, #fff8e1);
  box-shadow: 0 2px 12px rgba(255,193,7,0.2);
}

.achievement-card.claimed {
  border-color: #c8e6c9;
  background: linear-gradient(135deg, #f1f8e9, #e8f5e9);
}

.achievement-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.achievement-region {
  font-weight: 700;
  font-size: 15px;
}

.achievement-count {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.achievement-bar {
  height: 8px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.achievement-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #42a5f5, #66bb6a);
  transition: width 0.5s ease;
}

.achievement-card.complete .achievement-bar-fill {
  background: linear-gradient(90deg, #ffd54f, #ffb300);
}

.achievement-reward {
  font-size: 12px;
  color: #6d4c41;
  font-weight: 600;
  margin-bottom: 6px;
  background: #fff3e0;
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-block;
}

.achievement-status {
  text-align: center;
  margin-top: 4px;
}

.achievement-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 8px;
}

.achievement-badge.progress {
  background: #e3f2fd;
  color: #1565c0;
}

.achievement-badge.done {
  background: #e8f5e9;
  color: #2e7d32;
}

.achievement-claim-btn {
  background: linear-gradient(135deg, #ffd54f, #ffb300);
  border: none;
  padding: 8px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  color: #5d4037;
  transition: all 0.2s;
  animation: achievementPulse 1.5s ease-in-out infinite;
}

.achievement-claim-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(255,179,0,0.4);
}

@keyframes achievementPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,179,0,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(255,179,0,0); }
}

/* admin achievements page */
.achievement-progress-bar {
  width: 80px;
  height: 8px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
}

.achievement-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #42a5f5, #66bb6a);
  border-radius: 4px;
}

.achievement-complete {
  background: #fffde7;
}

@media (max-width: 480px) {
  .achievement-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
  }
  .achievement-card { padding: 10px; }
  .achievement-region { font-size: 13px; }
}
