/* ======================================
   充值面板 UI（基于 uView Modal 设计规范）
   BOX3 数字工坊 - 2026-08-23 重新设计版

   设计参考：ui-library/components/modal/uView-375e49a7
   规范来源：uView 官方设计系统

   规范数值：
   - 遮罩透明度: rgba(0,0,0,0.5)
   - 卡片圆角: 16rpx (8px)
   - 卡片内边距: 30rpx 32rpx (15px 16px)
   - 标题字号: 32rpx (16px) bold
   - 按钮高度: 80rpx (40px)
   - 按钮圆角: 8rpx (4px)
   - 按钮间距: 16rpx (8px)
   ====================================== */

/* 遮罩层 */
.recharge-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5); /* uView 规范：50% 透明度 */
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.recharge-overlay.active {
  display: flex;
  opacity: 1;
}

/* 卡片容器 */
.recharge-panel {
  position: relative;
  width: 90%;
  max-width: 400px;
  background: var(--surface-1, #161b22);
  border: 1px solid var(--border-default, #30363d);
  border-radius: 8px; /* uView 规范：16rpx = 8px */
  padding: 15px 16px; /* uView 规范：30rpx 32rpx */
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.recharge-overlay.active .recharge-panel {
  transform: scale(1);
}

/* 关闭按钮 */
.recharge-panel__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, #8b949e);
  transition: all 0.2s ease;
}

.recharge-panel__close:hover {
  background: var(--surface-2, #1c2128);
  color: var(--text-primary, #e6edf3);
}

.recharge-panel__close:active {
  transform: scale(0.9);
}

/* 标题 */
.recharge-panel__title {
  font-size: 16px; /* uView 规范：32rpx */
  font-weight: 700; /* uView 规范：bold */
  color: var(--text-primary, #e6edf3);
  margin: 0 0 8px 0;
  line-height: 1.4;
}

/* 副标题 */
.recharge-panel__subtitle {
  font-size: 14px; /* uView 规范：28rpx */
  color: var(--text-muted, #8b949e);
  margin: 0 0 20px 0;
  line-height: 1.5;
}

/* 当前积分卡片 */
.recharge-panel__current {
  background: var(--surface-2, #1c2128);
  border: 1px solid var(--border-default, #30363d);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.recharge-panel__current-label {
  font-size: 14px;
  color: var(--text-muted, #8b949e);
}

.recharge-panel__current-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent, #0ea5e9);
  font-variant-numeric: tabular-nums;
}

/* 充值选项容器 */
.recharge-panel__options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px; /* uView 规范：16rpx */
  margin-bottom: 20px;
}

/* 充值选项卡片 */
.recharge-option {
  position: relative;
  background: var(--surface-2, #1c2128);
  border: 2px solid var(--border-default, #30363d);
  border-radius: 8px;
  padding: 12px 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 80px;
  justify-content: center;
}

.recharge-option:hover {
  background: var(--surface-3, #2d333b);
  border-color: var(--accent, #0ea5e9);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

.recharge-option:active {
  transform: translateY(0) scale(0.97);
}

/* 选中状态 */
.recharge-option.selected {
  background: rgba(14, 165, 233, 0.1);
  border-color: var(--accent, #0ea5e9);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

/* 推荐标签 */
.recharge-option__badge {
  position: absolute;
  top: -6px;
  right: 6px;
  background: var(--accent, #0ea5e9);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 100px;
  line-height: 1.4;
}

/* 价格 */
.recharge-option__price {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary, #e6edf3);
  line-height: 1;
}

.recharge-option__price-unit {
  font-size: 14px;
  font-weight: 400;
}

/* 积分数量 */
.recharge-option__credits {
  font-size: 13px;
  color: var(--accent, #0ea5e9);
  font-weight: 600;
}

/* 额外说明 */
.recharge-option__extra {
  font-size: 11px;
  color: var(--text-muted, #8b949e);
  line-height: 1.3;
}

/* 充值按钮（uView 规范：80rpx 高度） */
.recharge-panel__submit {
  width: 100%;
  height: 40px; /* uView 规范：80rpx = 40px */
  background: var(--accent, #0ea5e9);
  color: white;
  border: none;
  border-radius: 4px; /* uView 规范：8rpx = 4px */
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 12px;
}

.recharge-panel__submit:hover {
  background: #0284c7;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.recharge-panel__submit:active {
  transform: scale(0.98);
}

.recharge-panel__submit:disabled {
  background: var(--surface-3, #2d333b);
  color: var(--text-muted, #8b949e);
  cursor: not-allowed;
  opacity: 0.5;
}

/* 免费提示 */
.recharge-panel__tip {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 4px;
  padding: 10px 12px;
  text-align: center;
  font-size: 12px;
  color: #22c55e;
  line-height: 1.5;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .recharge-panel {
    width: 95%;
    max-width: none;
  }

  .recharge-panel__options {
    gap: 6px;
  }

  .recharge-option {
    padding: 10px 6px;
    min-height: 72px;
  }

  .recharge-option__price {
    font-size: 18px;
  }
}

/* 小屏单列布局 */
@media (max-width: 400px) {
  .recharge-panel__options {
    grid-template-columns: 1fr;
  }

  .recharge-option {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
    min-height: auto;
    padding: 12px;
  }

  .recharge-option__badge {
    top: 8px;
    right: 8px;
  }
}

/* 无障碍支持 */
.recharge-panel:focus-within {
  outline: 2px solid var(--accent, #0ea5e9);
  outline-offset: 2px;
}
