/* ============================================
   天天三国 - 装备页面
   铸兵阁 · 锻造纹理 · 金属质感
   ============================================ */

/* ============================================
   页面头部 & 排序
   ============================================ */
.equip-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-sm);
}

.equip-sort {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.equip-sort-btn {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.625rem;
  font-size: 0.6875rem;
  color: var(--color-text-dim);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.equip-sort-btn:hover {
  border-color: var(--color-border-light);
  color: var(--color-text);
}

.equip-sort-btn.active {
  border-color: var(--color-gold-dark);
  color: var(--color-gold);
  background: rgba(218, 165, 32, 0.08);
}

.equip-tab-icon {
  width: 1.125rem;
  height: 1.125rem;
  display: inline-block;
  object-fit: contain;
  vertical-align: -0.18em;
  margin-right: 0.125rem;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.equip-count {
  font-size: 0.75rem;
  color: var(--color-text-dim);
}

/* ============================================
   装备网格
   ============================================ */
.equip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.625rem;
}

/* ============================================
   品质颜色系统 (6级)
   ============================================ */
/* 白 - 普通 */
.equip-card.quality-white { border-color: #9e9e9e; }
/* 绿 - 优秀 */
.equip-card.quality-green { border-color: #4caf50; box-shadow: 0 0 6px rgba(76, 175, 80, 0.25); }
/* 蓝 - 精良 */
.equip-card.quality-blue { border-color: #2196f3; box-shadow: 0 0 8px rgba(33, 150, 243, 0.3); }
/* 紫 - 史诗 */
.equip-card.quality-purple { border-color: #9c27b0; box-shadow: 0 0 10px rgba(156, 39, 176, 0.35); }
/* 金 - 传说 */
.equip-card.quality-gold {
  border-color: #ff9800;
  box-shadow: 0 0 12px rgba(255, 152, 0, 0.4);
  animation: glow 2.5s ease-in-out infinite;
}
/* 红 - 神话 */
.equip-card.quality-red {
  border-color: #f44336;
  box-shadow: 0 0 15px rgba(244, 67, 54, 0.5);
  animation: glowRed 2s ease-in-out infinite;
}

@keyframes glowRed {
  0%, 100% { box-shadow: 0 0 8px rgba(244, 67, 54, 0.4); }
  50% { box-shadow: 0 0 20px rgba(244, 67, 54, 0.7), 0 0 40px rgba(244, 67, 54, 0.3); }
}

/* 金品质旋转光效 */
.equip-card.quality-gold::after,
.equip-card.quality-red::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    from 0deg,
    transparent 0%,
    rgba(255, 152, 0, 0.08) 8%,
    transparent 16%
  );
  animation: spin 5s linear infinite;
  pointer-events: none;
}

.equip-card.quality-red::after {
  background: conic-gradient(
    from 0deg,
    transparent 0%,
    rgba(244, 67, 54, 0.1) 8%,
    transparent 16%
  );
}

/* 品质角标 */
.equip-card-quality {
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  font-size: 0.5625rem;
  font-weight: 700;
  padding: 0.0625rem 0.3125rem;
  border-radius: 0.1875rem;
  line-height: 1.4;
  z-index: 2;
  letter-spacing: 0.5px;
}

.quality-badge-white  { background: rgba(158, 158, 158, 0.85); color: #fff; }
.quality-badge-green  { background: rgba(76, 175, 80, 0.85); color: #fff; }
.quality-badge-blue   { background: rgba(33, 150, 243, 0.85); color: #fff; }
.quality-badge-purple { background: rgba(156, 39, 176, 0.85); color: #fff; }
.quality-badge-gold   { background: linear-gradient(135deg, #ff9800, #ffc107); color: #1a1a1a; }
.quality-badge-red    { background: linear-gradient(135deg, #f44336, #ff5722); color: #fff; }

/* 详情页品质标签 */
.equip-quality-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
}

.quality-tag-white  { background: rgba(158, 158, 158, 0.2); color: #9e9e9e; border: 1px solid #9e9e9e; }
.quality-tag-green  { background: rgba(76, 175, 80, 0.15); color: #4caf50; border: 1px solid #4caf50; }
.quality-tag-blue   { background: rgba(33, 150, 243, 0.15); color: #2196f3; border: 1px solid #2196f3; }
.quality-tag-purple { background: rgba(156, 39, 176, 0.15); color: #9c27b0; border: 1px solid #9c27b0; }
.quality-tag-gold   { background: rgba(255, 152, 0, 0.15); color: #ff9800; border: 1px solid #ff9800; }
.quality-tag-red    { background: rgba(244, 67, 54, 0.15); color: #f44336; border: 1px solid #f44336; }

/* 阶标签 */
.equip-tier-tag {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.0625rem 0.375rem;
  border-radius: 0.1875rem;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-dim);
  border: 1px solid var(--color-border);
}

/* 卡片阶显示 */
.equip-card-tier {
  font-size: 0.625rem;
  color: var(--color-text-dim);
  margin-bottom: 0.125rem;
}

/* ============================================
   装备卡牌
   ============================================ */
.equip-card {
  position: relative;
  background: var(--color-bg-card);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 0.625rem 0.5rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  overflow: hidden;
}

.equip-card:active {
  transform: scale(0.96);
}

/* 卡牌内部锻造纹理 */
.equip-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg, rgba(218, 165, 32, 0.04) 0%, transparent 40%),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 6px,
      rgba(255, 255, 255, 0.008) 6px,
      rgba(255, 255, 255, 0.008) 12px
    );
  pointer-events: none;
}

/* 类型图标 */
.equip-card-icon {
  width: 2.95rem;
  height: 2.95rem;
  margin: 0 auto 0.4375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
  position: relative;
  z-index: 1;
}

.equip-card-icon-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.equip-card-icon-fallback {
  font-size: 2.4rem;
  line-height: 1;
}

/* 装备名 */
.equip-card-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 0.1875rem;
  position: relative;
  z-index: 1;
}

/* 品质名称颜色 */
.equip-name-white  { color: #bdbdbd; }
.equip-name-green  { color: #4caf50; }
.equip-name-blue   { color: #42a5f5; }
.equip-name-purple { color: #ba68c8; }
.equip-name-gold   { color: #ffb74d; }
.equip-name-red    { color: #ef5350; }

/* 强化等级角标 */
.equip-card-level {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  background: linear-gradient(135deg, var(--color-gold-dark), var(--color-gold));
  color: #1a1a1a;
  font-size: 0.625rem;
  font-weight: 800;
  padding: 0.0625rem 0.3125rem;
  border-radius: 0.1875rem;
  line-height: 1.4;
  z-index: 2;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* 已装备标记 */
.equip-card-equipped {
  position: absolute;
  bottom: 0.25rem;
  right: 0.25rem;
  background: rgba(46, 204, 113, 0.85);
  color: #fff;
  font-size: 0.5625rem;
  font-weight: 700;
  padding: 0.0625rem 0.3125rem;
  border-radius: 0.1875rem;
  line-height: 1.4;
  z-index: 2;
  letter-spacing: 0.5px;
}

/* 卡牌底部属性摘要 */
.equip-card-stats {
  display: flex;
  justify-content: center;
  gap: 0.375rem;
  font-size: 0.625rem;
  color: var(--color-text-dim);
  position: relative;
  z-index: 1;
}

.equip-card-stats span {
  display: inline-flex;
  align-items: center;
  gap: 1px;
}

/* ============================================
   详情模态框 - 装备信息
   ============================================ */
.equip-detail {
  padding: 0 0.25rem;
}

.equip-detail-header {
  text-align: center;
  margin-bottom: var(--spacing-md);
}

.equip-detail-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto var(--spacing-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.equip-detail-icon-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.equip-empty-icon img {
  width: 3rem;
  height: 3rem;
  display: block;
  object-fit: contain;
  margin: 0 auto 0.375rem;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
}

.equip-detail-name {
  font-family: var(--font-display);
  font-size: 1.375rem;
  color: var(--color-text-bright);
  margin-bottom: 0.25rem;
}

.equip-detail-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  font-size: 0.75rem;
  color: var(--color-text-dim);
}

.equip-detail-set {
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-gold);
  margin-top: 0.375rem;
  font-style: italic;
}

/* 属性列表 */
.equip-stats-list {
  margin: var(--spacing-md) 0;
}

.equip-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.375rem 0;
  border-bottom: 1px solid rgba(74, 48, 48, 0.3);
  font-size: 0.8125rem;
}

.equip-stat-row:last-child {
  border-bottom: none;
}

.equip-stat-label {
  color: var(--color-text-dim);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.equip-stat-value {
  color: var(--color-text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.equip-stat-bonus {
  color: var(--color-success);
  font-size: 0.6875rem;
  margin-left: 0.25rem;
}

/* 属性条 */
.equip-stat-bar {
  flex: 1;
  max-width: 6.25rem;
  height: 0.25rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 0.125rem;
  margin: 0 0.5rem;
  overflow: hidden;
}

.equip-stat-bar-fill {
  height: 100%;
  border-radius: 0.125rem;
  transition: width 0.4s ease-out;
}

.equip-stat-bar-fill.stat-atk { background: linear-gradient(90deg, #e74c3c, #ff6b6b); }
.equip-stat-bar-fill.stat-def { background: linear-gradient(90deg, #3498db, #5dade2); }
.equip-stat-bar-fill.stat-hp  { background: linear-gradient(90deg, #2ecc71, #58d68d); }
.equip-stat-bar-fill.stat-spd { background: linear-gradient(90deg, #f39c12, #f7dc6f); }
.equip-stat-bar-fill.stat-int { background: linear-gradient(90deg, #9b59b6, #bb8fce); }

/* ============================================
   强化区域
   ============================================ */
.equip-enhance-section {
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-md);
  padding: var(--spacing-sm);
  margin: var(--spacing-sm) 0;
}

.equip-enhance-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-xs);
}

.equip-enhance-rate {
  font-size: 0.8125rem;
  color: var(--color-text-dim);
}

.rate-value {
  font-weight: 700;
}

.rate-high { color: #4caf50; }
.rate-mid  { color: #ff9800; }
.rate-low  { color: #f44336; }

.equip-enhance-cost {
  font-size: 0.75rem;
  color: var(--color-text-dim);
}

.equip-enhance-cost .currency-icon {
  font-size: 0.875rem;
}

.equip-enhance-cost .cost-amount {
  color: var(--color-gold);
  font-weight: 600;
}

/* 元宝保护 */
.equip-gem-protect {
  margin-top: var(--spacing-xs);
}

.gem-protect-label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  cursor: pointer;
  font-size: 0.75rem;
}

.gem-protect-checkbox {
  width: 1rem;
  height: 1rem;
  accent-color: #9c27b0;
  cursor: pointer;
}

.gem-protect-text {
  color: var(--color-text-dim);
}

/* 最高等级提示 */
.equip-max-level {
  text-align: center;
  color: var(--color-gold);
  font-size: 0.875rem;
  font-weight: 600;
  padding: var(--spacing-sm) 0;
}

/* 操作按钮区 */
.equip-actions {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
}

/* ============================================
   强化成功动画
   ============================================ */
@keyframes enhanceFlash {
  0% {
    box-shadow: 0 0 0 0 rgba(218, 165, 32, 0.8);
  }
  30% {
    box-shadow: 0 0 30px 10px rgba(218, 165, 32, 0.6);
  }
  60% {
    box-shadow: 0 0 60px 20px rgba(255, 215, 0, 0.3);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(218, 165, 32, 0);
  }
}

@keyframes enhancePulse {
  0% { transform: scale(1); }
  25% { transform: scale(1.06); }
  50% { transform: scale(0.98); }
  75% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.equip-enhance-flash {
  animation: enhanceFlash 0.8s ease-out, enhancePulse 0.6s ease-out;
}

/* ============================================
   武将选择子模态
   ============================================ */
.hero-select-list {
  max-height: 17.5rem;
  overflow-y: auto;
}

.hero-select-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 0.5rem var(--spacing-sm);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
  border-bottom: 1px solid rgba(74, 48, 48, 0.3);
}

.hero-select-item:last-child {
  border-bottom: none;
}

.hero-select-item:hover {
  background: var(--color-bg-hover);
}

.hero-select-item:active {
  background: rgba(218, 165, 32, 0.1);
}

.hero-select-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  background: var(--color-bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  border: 1px solid var(--color-border);
}

.hero-select-info {
  flex: 1;
  min-width: 0;
}

.hero-select-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-select-sub {
  font-size: 0.6875rem;
  color: var(--color-text-dim);
}

/* ============================================
   空状态
   ============================================ */
.equip-empty {
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-md);
}

.equip-empty-icon {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto var(--spacing-md);
  opacity: 0.4;
  filter: grayscale(0.5);
}

.equip-empty-icon img {
  width: 100%;
  height: 100%;
  display: block;
}

.equip-empty-text {
  font-size: 0.875rem;
  color: var(--color-text-dim);
  line-height: 1.6;
}

/* ============================================
   战斗掉落装备展示
   ============================================ */
.result-equip-drops {
  margin-top: var(--spacing-md);
}

.result-equip-title {
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-gold);
  margin-bottom: var(--spacing-sm);
}

.result-equip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6.25rem, 1fr));
  gap: 0.5rem;
}

.result-equip-item {
  background: var(--color-bg-card);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  text-align: center;
}

.result-equip-item.quality-white  { border-color: #9e9e9e; }
.result-equip-item.quality-green  { border-color: #4caf50; }
.result-equip-item.quality-blue   { border-color: #2196f3; }
.result-equip-item.quality-purple { border-color: #9c27b0; }
.result-equip-item.quality-gold   { border-color: #ff9800; }
.result-equip-item.quality-red    { border-color: #f44336; }

.result-equip-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.125rem;
}

.result-equip-quality {
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.0625rem 0.25rem;
  border-radius: 0.125rem;
  display: inline-block;
  margin-bottom: 0.125rem;
}

.result-equip-stats {
  font-size: 0.625rem;
  color: var(--color-text-dim);
}
.result-equip-desc {
  font-size: 0.625rem;
  color: var(--color-text-dim);
  font-style: italic;
  margin-top: 0.125rem;
}

/* ============================================
   交错入场动画
   ============================================ */
.equip-card {
  opacity: 0;
  animation: slideUp 0.35s ease-out forwards;
}

.equip-card:nth-child(1)  { animation-delay: 0.03s; }
.equip-card:nth-child(2)  { animation-delay: 0.06s; }
.equip-card:nth-child(3)  { animation-delay: 0.09s; }
.equip-card:nth-child(4)  { animation-delay: 0.12s; }
.equip-card:nth-child(5)  { animation-delay: 0.15s; }
.equip-card:nth-child(6)  { animation-delay: 0.18s; }
.equip-card:nth-child(7)  { animation-delay: 0.21s; }
.equip-card:nth-child(8)  { animation-delay: 0.24s; }
.equip-card:nth-child(9)  { animation-delay: 0.27s; }
.equip-card:nth-child(10) { animation-delay: 0.30s; }
.equip-card:nth-child(11) { animation-delay: 0.33s; }
.equip-card:nth-child(12) { animation-delay: 0.36s; }

/* ============================================
   响应式
   ============================================ */
@media (max-width: 340px) {
  .equip-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .equip-card {
    opacity: 1;
    animation: none;
  }
  .equip-enhance-flash {
    animation: none;
  }
}

/* ============================================
   移动端响应式 - 装备页
   ============================================ */
@media (max-width: 480px) {
  .equip-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.375rem;
  }

  .equip-card {
    padding: 0.5rem 0.375rem 0.375rem;
  }

  .equip-card-icon {
    width: 1.75rem;
    height: 1.75rem;
  }

  .equip-card-name {
    font-size: 0.6875rem;
  }

  .equip-card-stats {
    font-size: 0.5625rem;
    gap: 0.25rem;
  }

  .equip-toolbar {
    flex-wrap: wrap;
    gap: var(--spacing-xs);
  }

  .equip-sort-btn {
    min-height: 2.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.625rem;
  }

  /* Detail modal */
  .equip-detail-icon {
    width: 2.5rem;
    height: 2.5rem;
  }

  .equip-detail-name {
    font-size: 1.125rem;
  }

  .equip-stat-row {
    font-size: 0.75rem;
    padding: 0.3125rem 0;
  }

  .equip-actions .btn {
    min-height: 2.75rem;
  }
}

@media (max-width: 360px) {
  .equip-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.375rem;
  }
}

/* ============================================
   精炼系统
   ============================================ */
/* 精炼角标 */
.equip-card-refine {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  background: linear-gradient(135deg, #ff6b35, #ff4500);
  color: #fff;
  font-size: 0.5625rem;
  font-weight: 800;
  padding: 0.0625rem 0.3125rem;
  border-radius: 0.1875rem;
  line-height: 1.4;
  z-index: 3;
  box-shadow: 0 1px 3px rgba(255, 69, 0, 0.5);
}
/* 有强化等级时精炼角标位置调整 */
.equip-card-level + .equip-card-refine {
  top: 1.375rem;
}

/* 精炼光效 */
.equip-refined {
  position: relative;
}
.equip-refined::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-lg);
  pointer-events: none;
  z-index: 0;
}
.equip-refined-1::after, .equip-refined-2::after, .equip-refined-3::after {
  box-shadow: inset 0 0 8px rgba(255, 107, 53, 0.2);
}
.equip-refined-4::after, .equip-refined-5::after, .equip-refined-6::after {
  box-shadow: inset 0 0 12px rgba(255, 107, 53, 0.3);
}
.equip-refined-7::after, .equip-refined-8::after, .equip-refined-9::after {
  box-shadow: inset 0 0 16px rgba(255, 69, 0, 0.4);
  animation: refineGlow 2s ease-in-out infinite;
}
.equip-refined-10::after {
  box-shadow: inset 0 0 20px rgba(255, 69, 0, 0.5);
  animation: refineGlow 1.5s ease-in-out infinite;
}

@keyframes refineGlow {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* 精炼区域样式 */
.equip-refine-section {
  background: rgba(255, 69, 0, 0.08);
  border: 1px solid rgba(255, 107, 53, 0.25);
  border-radius: var(--radius-md);
  padding: var(--spacing-sm);
  margin: var(--spacing-sm) 0;
}

.equip-refine-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #ff6b35;
  margin-bottom: var(--spacing-xs);
}

.equip-refine-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-xs);
}

.equip-refine-rate {
  font-size: 0.8125rem;
  color: var(--color-text-dim);
}

.equip-refine-cost {
  font-size: 0.75rem;
  color: var(--color-text-dim);
}

.equip-refine-cost .cost-amount {
  color: var(--color-gold);
  font-weight: 600;
}

.equip-refine-fodder {
  font-size: 0.75rem;
  color: var(--color-text-dim);
}

/* 精炼按钮 */
.btn-refine {
  background: linear-gradient(135deg, #ff6b35, #ff4500) !important;
  border: none !important;
  color: #fff !important;
  font-weight: 700;
}
.btn-refine:hover {
  background: linear-gradient(135deg, #ff4500, #e03e00) !important;
}

/* 精炼成功动画 */
@keyframes refineFlash {
  0% { box-shadow: 0 0 0 0 rgba(255, 69, 0, 0.8); }
  30% { box-shadow: 0 0 30px 10px rgba(255, 69, 0, 0.6); }
  60% { box-shadow: 0 0 60px 20px rgba(255, 107, 53, 0.3); }
  100% { box-shadow: 0 0 0 0 rgba(255, 69, 0, 0); }
}
.equip-refine-flash {
  animation: refineFlash 0.8s ease-out, enhancePulse 0.6s ease-out;
}
