/* ========================================
   Wallet CSS - 钱包页面
   微信支付 + 支付宝钱包结合风格
   精致 · 简洁 · 现代 · 原生移动端 UI 感
   ========================================

   CSS 变量（钱包专用）：
   --wallet-bg           页面背景
   --wallet-card-bg      卡片背景
   --wallet-primary      主操作色
   --wallet-primary-dark 主色深色（按下态）
   --wallet-text         主文字色
   --wallet-subtext      副文字色
   --wallet-radius       通用圆角
   --wallet-shadow       通用阴影

   z-index 层级规划：
   - 钱包页面容器: var(--z-drawer) = 40
   - 充值弹窗遮罩: 45（drawer 层内）
   - 成功弹窗遮罩: 46
   - Toast: 48
   ======================================== */

/* ---- 钱包专属 CSS 变量 ---- */
.wallet-screen {
  --wallet-bg: #f5f6f8;
  --wallet-card-bg: #ffffff;
  --wallet-primary: #1aad19;
  --wallet-primary-dark: #129611;
  --wallet-primary-light: rgba(26, 173, 25, 0.08);
  --wallet-text: #1a1a1a;
  --wallet-subtext: #888888;
  --wallet-hint: #b0b0b0;
  --wallet-radius: 14px;
  --wallet-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  --wallet-divider: rgba(0, 0, 0, 0.04);
}

/* ================================================
   1. 全屏容器
   ================================================ */
.wallet-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--wallet-bg);
  z-index: var(--z-drawer);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.wallet-screen.is-active {
  display: flex;
}

/* ================================================
   2. 可滚动内容区
   ================================================ */
.wallet-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 32px;
}

/* ================================================
   3. 顶部标题栏
   ================================================ */
.wallet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-area-top, 0px) + 8px) 16px 12px;
  background: var(--wallet-card-bg);
  position: sticky;
  top: 0;
  z-index: 5;
}

.wallet-header__back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--wallet-text);
  transition: background-color 0.15s ease;
  flex-shrink: 0;
}

.wallet-header__back:active {
  background: rgba(0, 0, 0, 0.04);
}

.wallet-header__back svg {
  width: 22px;
  height: 22px;
}

.wallet-header__title {
  font-size: 17px;
  font-weight: 600;
  color: var(--wallet-text);
  text-align: center;
  flex: 1;
}

.wallet-header__placeholder {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

/* ================================================
   4. 余额卡片
   ================================================ */
.wallet-balance-card {
  padding: 16px 16px 0;
}

.wallet-balance-card__inner {
  background: var(--wallet-card-bg);
  border-radius: 16px;
  padding: 24px 22px 20px;
  box-shadow: var(--wallet-shadow);
  position: relative;
  overflow: hidden;
}

/* 卡片右上角装饰渐变圆 */
.wallet-balance-card__inner::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(26, 173, 25, 0.06), rgba(26, 173, 25, 0.02));
  pointer-events: none;
}

.wallet-balance-card__inner::after {
  content: '';
  position: absolute;
  bottom: -20px;
  right: 40px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(26, 173, 25, 0.03);
  pointer-events: none;
}

.wallet-balance-card__label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--wallet-subtext);
  margin-bottom: 12px;
}

.wallet-balance-card__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.wallet-balance-card__eye {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--wallet-hint);
  margin-left: auto;
  transition: color 0.15s ease;
}

.wallet-balance-card__eye:active {
  color: var(--wallet-subtext);
}

.wallet-balance-card__eye svg {
  width: 18px;
  height: 18px;
}

.wallet-balance-card__amount {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.wallet-balance-card__currency {
  font-size: 22px;
  font-weight: 600;
  color: var(--wallet-text);
  line-height: 1;
}

.wallet-balance-card__number {
  font-size: 38px;
  font-weight: 700;
  color: var(--wallet-text);
  line-height: 1;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}

/* 隐藏金额时的星号样式 */
.wallet-balance-card__number--hidden {
  font-size: 30px;
  letter-spacing: 3px;
}

.wallet-balance-card__desc {
  font-size: 12px;
  color: var(--wallet-hint);
  position: relative;
  z-index: 1;
}

/* ================================================
   5. 主操作按钮区
   ================================================ */
.wallet-actions {
  display: flex;
  gap: 12px;
  padding: 16px 16px 0;
}

.wallet-actions__btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 0;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.wallet-actions__btn:active {
  transform: scale(0.97);
}

.wallet-actions__btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* 充值（主操作） */
.wallet-actions__btn--primary {
  background: var(--wallet-primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(26, 173, 25, 0.25);
}

.wallet-actions__btn--primary:active {
  background: var(--wallet-primary-dark);
}

/* 提现（次操作） */
.wallet-actions__btn--secondary {
  background: var(--wallet-card-bg);
  color: var(--wallet-text);
  box-shadow: var(--wallet-shadow);
}

.wallet-actions__btn--secondary:active {
  background: #f7f7f7;
}

/* ================================================
   6. 功能入口网格
   ================================================ */
.wallet-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 20px 16px 0;
  background: transparent;
}

.wallet-grid__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 0;
  cursor: pointer;
  border-radius: 12px;
  transition: background-color 0.15s ease;
}

.wallet-grid__item:active {
  background: rgba(0, 0, 0, 0.03);
}

.wallet-grid__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--wallet-card-bg);
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.wallet-grid__icon svg {
  width: 22px;
  height: 22px;
}

.wallet-grid__label {
  font-size: 12px;
  color: var(--wallet-text);
  font-weight: 500;
}

/* ================================================
   7. 近期交易记录
   ================================================ */
.wallet-recent {
  margin: 20px 16px 0;
  background: var(--wallet-card-bg);
  border-radius: 14px;
  box-shadow: var(--wallet-shadow);
  overflow: hidden;
}

.wallet-recent__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
}

.wallet-recent__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--wallet-text);
}

.wallet-recent__more {
  font-size: 12px;
  color: var(--wallet-subtext);
  cursor: pointer;
}

.wallet-recent__more:active {
  color: var(--wallet-text);
}

.wallet-recent__list {
  padding: 0 18px;
}

.wallet-recent__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--wallet-divider);
}

.wallet-recent__item:first-child {
  border-top: none;
}

.wallet-recent__item-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wallet-recent__item-icon svg {
  width: 18px;
  height: 18px;
}

.wallet-recent__item-icon--in {
  background: rgba(26, 173, 25, 0.08);
  color: #1aad19;
}

.wallet-recent__item-icon--out {
  background: rgba(255, 107, 53, 0.08);
  color: #ff6b35;
}

.wallet-recent__item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.wallet-recent__item-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--wallet-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wallet-recent__item-time {
  font-size: 11px;
  color: var(--wallet-hint);
}

.wallet-recent__item-amount {
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.wallet-recent__item-amount--in {
  color: #1aad19;
}

.wallet-recent__item-amount--out {
  color: var(--danger-color, #f44336);
}

/* 空交易列表 */
.wallet-recent__empty {
  text-align: center;
  padding: 32px 16px;
  color: #999;
  font-size: 13px;
}

/* 列表底部安全间距 */
.wallet-recent__list::after {
  content: '';
  display: block;
  height: 4px;
}

/* ================================================
   8. 充值弹窗（底部弹出 Action Sheet）
   ================================================ */
.wallet-recharge-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 45;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.wallet-recharge-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.wallet-recharge-sheet {
  width: 100%;
  background: var(--wallet-card-bg);
  border-radius: 20px 20px 0 0;
  max-height: 85%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

.wallet-recharge-overlay.is-visible .wallet-recharge-sheet {
  transform: translateY(0);
}

/* 弹窗拖拽指示条 */
.wallet-recharge-sheet::before {
  content: '';
  display: block;
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: #ddd;
  margin: 10px auto 0;
}

/* 弹窗标题栏 */
.wallet-recharge-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  position: sticky;
  top: 0;
  background: var(--wallet-card-bg);
  z-index: 2;
}

.wallet-recharge-sheet__title {
  font-size: 17px;
  font-weight: 600;
  color: var(--wallet-text);
}

.wallet-recharge-sheet__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  background: #f2f2f2;
  border: none;
  cursor: pointer;
  color: #999;
  transition: background-color 0.15s ease;
}

.wallet-recharge-sheet__close:active {
  background: #e5e5e5;
}

.wallet-recharge-sheet__close svg {
  width: 16px;
  height: 16px;
}

/* ================================================
   9. 银行选项列表
   ================================================ */
.wallet-bank-list {
  padding: 0 16px;
}

.wallet-bank-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 14px;
  margin-bottom: 8px;
  border-radius: 14px;
  border: 1.5px solid var(--wallet-divider);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.15s ease, box-shadow 0.2s ease;
  position: relative;
}

.wallet-bank-option:active {
  background: #fafafa;
}

/* 选中态 */
.wallet-bank-option.is-selected {
  border-color: var(--wallet-primary);
  background: var(--wallet-primary-light);
  box-shadow: 0 0 0 1px var(--wallet-primary);
}

/* 禁用态 */
.wallet-bank-option--disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.wallet-bank-option--disabled:active {
  background: transparent;
}

/* 单选按钮 */
.wallet-bank-option__radio {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  border: 2px solid #d0d0d0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.2s ease;
}

.wallet-bank-option.is-selected .wallet-bank-option__radio {
  border-color: var(--wallet-primary);
}

.wallet-bank-option__radio-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: transparent;
  transition: background-color 0.2s ease, transform 0.2s ease;
  transform: scale(0);
}

.wallet-bank-option.is-selected .wallet-bank-option__radio-dot {
  background: var(--wallet-primary);
  transform: scale(1);
}

/* 银行图标 */
.wallet-bank-option__icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.wallet-bank-option__icon svg {
  width: 34px;
  height: 34px;
}

.wallet-bank-option__icon--cat {
  background: #FFF8E1;
}

.wallet-bank-option__icon--dog {
  background: #E8F4FD;
}

/* 银行信息 */
.wallet-bank-option__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.wallet-bank-option__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--wallet-text);
}

.wallet-bank-option__desc {
  font-size: 12px;
  color: var(--wallet-subtext);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 推荐/即将上线 徽标 */
.wallet-bank-option__badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--wallet-primary-light);
  color: var(--wallet-primary);
  flex-shrink: 0;
  white-space: nowrap;
}

.wallet-bank-option__badge--coming {
  background: rgba(150, 150, 150, 0.1);
  color: #999;
}

/* ================================================
   10. 金额输入区域
   ================================================ */
.wallet-amount-section {
  padding: 0 16px;
  display: none;
  animation: walletFadeInUp 0.3s ease;
}

.wallet-amount-section.is-visible {
  display: block;
}

@keyframes walletFadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wallet-amount-section__divider {
  height: 1px;
  background: var(--wallet-divider);
  margin: 8px 0 16px;
}

.wallet-amount-section__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--wallet-subtext);
  margin-bottom: 10px;
}

.wallet-amount-input-wrapper {
  display: flex;
  align-items: center;
  background: #f7f7f8;
  border-radius: 12px;
  padding: 0 16px;
  border: 1.5px solid transparent;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.wallet-amount-input-wrapper:focus-within {
  border-color: var(--wallet-primary);
  background: #fff;
}

.wallet-amount-input__prefix {
  font-size: 22px;
  font-weight: 600;
  color: var(--wallet-text);
  margin-right: 4px;
  line-height: 1;
}

.wallet-amount-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 28px;
  font-weight: 700;
  color: var(--wallet-text);
  padding: 14px 0;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  min-width: 0;
}

.wallet-amount-input::placeholder {
  font-size: 16px;
  font-weight: 400;
  color: #ccc;
}

/* 快捷金额按钮 */
.wallet-amount-presets {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.wallet-amount-presets__btn {
  flex: 1;
  padding: 10px 0;
  border-radius: 10px;
  border: 1px solid var(--wallet-divider);
  background: var(--wallet-card-bg);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--wallet-text);
  font-family: inherit;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.wallet-amount-presets__btn:active {
  background: #f2f2f2;
}

.wallet-amount-presets__btn.is-active {
  border-color: var(--wallet-primary);
  background: var(--wallet-primary-light);
  color: var(--wallet-primary);
  font-weight: 600;
}

/* ================================================
   11. 弹窗底部确认按钮
   ================================================ */
.wallet-recharge-sheet__footer {
  padding: 16px 16px calc(16px + var(--safe-area-bottom, 0px));
  position: sticky;
  bottom: 0;
  background: var(--wallet-card-bg);
}

.wallet-recharge-sheet__confirm {
  width: 100%;
  padding: 14px 0;
  border-radius: 12px;
  border: none;
  background: var(--wallet-primary);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
  box-shadow: 0 4px 14px rgba(26, 173, 25, 0.25);
}

.wallet-recharge-sheet__confirm:active {
  opacity: 0.85;
  transform: scale(0.98);
}

/* ================================================
   12. 成功提示弹窗
   ================================================ */
.wallet-success-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 46;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.wallet-success-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.wallet-success-dialog {
  width: calc(100% - 80px);
  max-width: 280px;
  background: var(--wallet-card-bg);
  border-radius: 20px;
  padding: 32px 24px 24px;
  text-align: center;
  transform: scale(0.85);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.wallet-success-overlay.is-visible .wallet-success-dialog {
  transform: scale(1);
}

.wallet-success-dialog__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: rgba(76, 175, 80, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.wallet-success-dialog__icon svg {
  width: 28px;
  height: 28px;
}

.wallet-success-dialog__text {
  font-size: 17px;
  font-weight: 600;
  color: var(--wallet-text);
  margin-bottom: 6px;
}

.wallet-success-dialog__amount {
  font-size: 28px;
  font-weight: 700;
  color: var(--wallet-primary);
  margin-bottom: 24px;
  font-variant-numeric: tabular-nums;
}

.wallet-success-dialog__btn {
  width: 100%;
  padding: 12px 0;
  border-radius: 12px;
  border: none;
  background: var(--wallet-primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.wallet-success-dialog__btn:active {
  opacity: 0.85;
}

/* ================================================
   13. Toast 提示
   ================================================ */
.wallet-toast {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 13px;
  font-family: var(--font-family);
  color: #fff;
  background: rgba(0, 0, 0, 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 48;
  max-width: 220px;
  text-align: center;
  white-space: nowrap;
}

.wallet-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
