/* 游戏化元素 - 综合样式定义 */
:root {
  /* 稀有度颜色 */
  --rarity-legendary: #FFD700;
  --rarity-epic: #9B59B6;
  --rarity-rare: #3498DB;
  --rarity-uncommon: #2ECC71;
  --rarity-common: #95A5A6;
  
  /* 发光效果 */
  --glow-legendary: rgba(255, 215, 0, 0.5);
  --glow-epic: rgba(155, 89, 182, 0.5);
  --glow-rare: rgba(52, 152, 219, 0.5);
  --glow-uncommon: rgba(46, 204, 113, 0.5);
  --glow-common: rgba(149, 165, 166, 0.5);
}

/*------------------------------
  头像框系统
-------------------------------*/
.avatar-frame {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: visible;
}

.avatar-frame.legendary {
  --frame-color: var(--rarity-legendary);
  --glow-color: var(--glow-legendary);
}

.avatar-frame.epic {
  --frame-color: var(--rarity-epic);
  --glow-color: var(--glow-epic);
}

.avatar-frame.rare {
  --frame-color: var(--rarity-rare);
  --glow-color: var(--glow-rare);
}

.avatar-frame.uncommon {
  --frame-color: var(--rarity-uncommon);
  --glow-color: var(--glow-uncommon);
}

.avatar-frame.common {
  --frame-color: var(--rarity-common);
  --glow-color: var(--glow-common);
}

.frame-decoration {
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border-radius: 50%;
  border: 3px solid var(--frame-color);
  box-shadow: 0 0 10px var(--glow-color);
  z-index: 1;
}

.avatar-frame .user-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  z-index: 2;
  border: 2px solid white;
}

.avatar-frame.animated .frame-decoration {
  animation: rotate-frame 10s linear infinite;
}

@keyframes rotate-frame {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/*------------------------------
  成就徽章样式
-------------------------------*/
.achievement-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  position: relative;
  color: white;
}

.achievement-badge.legendary {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.achievement-badge.epic {
  background: linear-gradient(135deg, #9B59B6, #8E44AD);
  box-shadow: 0 0 10px rgba(155, 89, 182, 0.5);
}

.achievement-badge.rare {
  background: linear-gradient(135deg, #3498DB, #2980B9);
  box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

.achievement-badge.uncommon {
  background: linear-gradient(135deg, #2ECC71, #27AE60);
  box-shadow: 0 0 10px rgba(46, 204, 113, 0.5);
}

.achievement-badge.common {
  background: linear-gradient(135deg, #95A5A6, #7F8C8D);
  box-shadow: 0 0 10px rgba(149, 165, 166, 0.5);
}

/*------------------------------
  解锁动画效果
-------------------------------*/
.unlock-animation {
  position: relative;
}

.sparkles {
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  background-image: radial-gradient(circle, white 1px, transparent 1px);
  background-size: 10px 10px;
  opacity: 0;
  animation: sparkle 2s ease-out infinite;
}

@keyframes sparkle {
  0% { opacity: 0; transform: scale(0.8); }
  50% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.2); }
}

.achievement-unlocked {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  padding: 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, #4F46E5, #A78BFA);
  color: white;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 100;
  opacity: 0;
  animation: unlockPopup 3s ease-in-out forwards;
}

@keyframes unlockPopup {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  30% { transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
}

.unlock-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: white;
  margin: 0 auto 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: #4F46E5;
  position: relative;
}

.unlock-icon::after {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border-radius: 50%;
  background: transparent;
  border: 2px dashed white;
  animation: rotate 10s linear infinite;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/*------------------------------
  任务卡片样式
-------------------------------*/
.task-card {
  border-radius: 12px;
  overflow: hidden;
  background-color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  position: relative;
  transition: all 0.3s ease;
}

.task-card:hover, .task-card.hovering {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-banner {
  height: 5px;
}

.card-content {
  padding: 16px;
}

.task-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background-color: #f3f4f6;
  color: #4F46E5;
  position: relative;
}

.level-indicator {
  position: absolute;
  bottom: -5px;
  right: -5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: #FFC107;
  color: white;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  border: 2px solid white;
}

.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.status-badge.completed {
  background-color: rgba(16, 185, 129, 0.1);
  color: #10B981;
}

.status-badge.in-progress {
  background-color: rgba(79, 70, 229, 0.1);
  color: #4F46E5;
}

.status-badge.locked {
  background-color: rgba(156, 163, 175, 0.1);
  color: #6B7280;
}

/*------------------------------
  挑战阶段路径
-------------------------------*/
.challenge-stages {
  position: relative;
  padding: 10px 0;
}

.stage-path {
  display: flex;
  align-items: center;
  position: relative;
}

.stage-path::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  height: 2px;
  background-color: #e5e7eb;
  z-index: 1;
}

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
  z-index: 2;
}

.stage-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 5px;
  font-weight: bold;
  background-color: white;
  border: 2px solid #e5e7eb;
}

.stage.completed .stage-icon {
  background-color: #10B981;
  color: white;
  border-color: #10B981;
}

.stage.current .stage-icon {
  background-color: white;
  color: #4F46E5;
  border-color: #4F46E5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.stage-name {
  font-size: 10px;
  color: #6B7280;
}

.stage.completed .stage-name {
  color: #10B981;
}

.stage.current .stage-name {
  color: #4F46E5;
  font-weight: bold;
}

/*------------------------------
  成就路径样式
-------------------------------*/
.achievement-path {
  display: flex;
  flex-direction: column;
}

.path-step {
  display: flex;
  align-items: flex-start;
  position: relative;
  padding-left: 30px;
  margin-bottom: 16px;
}

.path-step::before {
  content: '';
  position: absolute;
  top: 0;
  left: 14px;
  width: 2px;
  height: 100%;
  background-color: #e5e7eb;
}

.path-step:last-child::before {
  display: none;
}

.step-indicator {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background-color: white;
  border: 2px solid #e5e7eb;
  margin-right: 12px;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.step-indicator.completed {
  background-color: #10B981;
  color: white;
  border-color: #10B981;
}

.step-indicator.current {
  background-color: white;
  color: #4F46E5;
  border-color: #4F46E5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

/*------------------------------
  地图标记样式
-------------------------------*/
.map-marker {
  position: absolute;
  width: 32px;
  height: 32px;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 30;
}

.map-marker.achievement {
  background-color: rgba(79, 70, 229, 0.9);
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.3);
  animation: pulse 2s infinite;
}

.map-marker.locked {
  background-color: rgba(156, 163, 175, 0.9);
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-marker.completed {
  background-color: rgba(16, 185, 129, 0.9);
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-marker.nearby {
  animation: pulseFast 1s infinite;
}

@keyframes pulseFast {
  0% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.7);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(79, 70, 229, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
  }
}

/*------------------------------
  好友排行榜样式
-------------------------------*/
.rank-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

.rank-badge.gold {
  background-color: var(--rarity-legendary);
  color: #7D6608;
  box-shadow: 0 0 5px var(--glow-legendary);
}

.rank-badge.silver {
  background-color: #C0C0C0;
  color: #5D5D5D;
  box-shadow: 0 0 5px rgba(192, 192, 192, 0.5);
}

.rank-badge.bronze {
  background-color: #CD7F32;
  color: #5D3A17;
  box-shadow: 0 0 5px rgba(205, 127, 50, 0.5);
}

.rank-badge.self {
  background-color: #4F46E5;
  color: white;
  box-shadow: 0 0 5px rgba(79, 70, 229, 0.5);
}

/*------------------------------
  稀有度标记
-------------------------------*/
.rarity-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 10px;
  font-size: 10px;
  margin-top: 5px;
}

.rarity-badge.legendary {
  background-color: rgba(255, 215, 0, 0.2);
  color: #B7950B;
  border: 1px solid rgba(255, 215, 0, 0.5);
}

.rarity-badge.epic {
  background-color: rgba(155, 89, 182, 0.2);
  color: #8E44AD;
  border: 1px solid rgba(155, 89, 182, 0.5);
}

.rarity-badge.rare {
  background-color: rgba(52, 152, 219, 0.2);
  color: #2980B9;
  border: 1px solid rgba(52, 152, 219, 0.5);
}

.rarity-badge.uncommon {
  background-color: rgba(46, 204, 113, 0.2);
  color: #27AE60;
  border: 1px solid rgba(46, 204, 113, 0.5);
}

.rarity-badge.common {
  background-color: rgba(149, 165, 166, 0.2);
  color: #7F8C8D;
  border: 1px solid rgba(149, 165, 166, 0.5);
}

/*------------------------------
  成就分类标签
-------------------------------*/
.achievement-category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.category-tag {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  background-color: #F3F4F6;
  color: #6B7280;
}

.category-tag.adventure {
  background-color: #DCFCE7;
  color: #166534;
}

.category-tag.art {
  background-color: #FEF3C7;
  color: #92400E;
}

.category-tag.skill {
  background-color: #E0F2FE;
  color: #075985;
}

.category-tag.social {
  background-color: #FCE7F3;
  color: #831843;
}

/*------------------------------
  好友比较进度条
-------------------------------*/
.comparison-progress {
  height: 20px;
  background-color: #F3F4F6;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  margin: 5px 0;
}

.your-progress {
  position: absolute;
  height: 100%;
  left: 0;
  top: 0;
  background-color: #4F46E5;
  border-radius: 10px;
  text-align: right;
  color: white;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 5px;
}

.friend-progress {
  position: absolute;
  height: 100%;
  right: 0;
  top: 0;
  background-color: #EC4899;
  border-radius: 10px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 5px;
  color: white;
}

/*------------------------------
  组合挑战样式
-------------------------------*/
.challenge-card {
  overflow: hidden;
}

.challenge-banner {
  height: 100px;
  background: linear-gradient(135deg, #4F46E5, #EC4899);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  padding: 16px;
  display: flex;
  align-items: flex-end;
}

.challenge-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.2;
}

.banner-content {
  position: relative;
  z-index: 2;
  color: white;
}

.join-challenge-btn {
  width: 100%;
  padding: 10px;
  background-color: #4F46E5;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/*------------------------------
  地图探索区域
-------------------------------*/
.collection-progress-map {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.progress-region {
  position: absolute;
  border: 2px dashed rgba(79, 70, 229, 0.5);
  border-radius: 8px;
  overflow: hidden;
}

.region-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(79, 70, 229, 0.2);
}

.region-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #4F46E5;
  font-weight: bold;
  font-size: 12px;
  text-shadow: 0 0 2px white;
}

/*------------------------------
  页面过渡动画
-------------------------------*/
.page-transition-enter {
  opacity: 0;
  transform: translateY(10px);
}

.page-transition-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 300ms, transform 300ms;
}

.page-transition-exit {
  opacity: 1;
  transform: translateY(0);
}

.page-transition-exit-active {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 300ms, transform 300ms;
}

/*------------------------------
  用户资料浮动卡片
-------------------------------*/
.user-profile-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  width: 90%;
  max-width: 360px;
  background-color: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.modal-header {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-body {
  padding: 16px;
  max-height: 60vh;
  overflow-y: auto;
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #6B7280;
}

/*------------------------------
  特殊徽章展示
-------------------------------*/
.special-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.special-badge {
  position: relative;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #4338CA, #6366F1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.special-badge.legendary {
  background: linear-gradient(135deg, #F59E0B, #FBBF24);
}

.special-badge.epic {
  background: linear-gradient(135deg, #9333EA, #C026D3);
}

.special-badge.rare {
  background: linear-gradient(135deg, #2563EB, #3B82F6);
}

.special-badge-name {
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  background-color: white;
  color: #1F2937;
  padding: 2px 4px;
  border-radius: 4px;
  white-space: nowrap;
  font-weight: 600;
} 