/* Shared "我的余额" floating glass card.
   Web frosted-glass approximation aligned with the Radix translucent panel token. */

/* The sticky navigation already uses backdrop-filter. While the balance panel is
   open, remove that ancestor backdrop root so the nested panel can sample and
   blur the actual page content behind it. */
.glass-strong:has(.balance-dropdown.show) {
  background: rgba(17, 17, 19, 0.82) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.balance-dropdown {
  width: min(380px, calc(100vw - 32px)) !important;
  margin-top: 12px !important;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(84, 114, 228, 0.045), transparent 54%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.008) 48%),
    rgba(24, 25, 27, 0.58) !important;
  border: 1px solid rgba(176, 180, 186, 0.12) !important;
  border-radius: var(--radius-6) !important;
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.24),
    0 0 0 1px rgba(255, 255, 255, 0.02),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -18px 36px rgba(0, 0, 0, 0.10) !important;
  backdrop-filter: blur(14px) saturate(108%) brightness(0.82);
  -webkit-backdrop-filter: blur(14px) saturate(108%) brightness(0.82);
}

.balance-dropdown::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,.04), transparent 30% 72%, rgba(84,114,228,.025));
  opacity: .48;
}

.balance-dropdown > div {
  position: relative;
  z-index: 1;
}

.balance-dropdown > div:first-child {
  min-height: 72px;
  padding: 16px !important;
  background: rgba(255, 255, 255, 0.010);
  border-bottom-color: rgba(255, 255, 255, 0.055) !important;
}

.balance-dropdown > div:first-child > div:first-child {
  color: var(--slate-12) !important;
  font-size: var(--font-size-3) !important;
  line-height: var(--line-height-3) !important;
  font-weight: var(--font-weight-bold) !important;
  letter-spacing: var(--letter-spacing-3);
}

.balance-dropdown > div:first-child > div:last-child {
  gap: 8px !important;
}

.balance-dropdown .dropdown-ghost,
.balance-dropdown .dropdown-recharge {
  min-height: 32px;
  white-space: nowrap;
  border-radius: var(--radius-3);
}

.balance-dropdown .dropdown-ghost {
  padding: 6px 10px;
  border-color: rgba(176, 180, 186, 0.16) !important;
  background: rgba(255, 255, 255, 0.012);
  color: var(--slate-11) !important;
}

.balance-dropdown .dropdown-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(158, 177, 255, 0.30) !important;
  color: var(--slate-12) !important;
}

.balance-dropdown .dropdown-recharge {
  padding: 6px 12px;
  background: var(--indigo-9);
  box-shadow: 0 8px 20px -12px rgba(62, 99, 221, 0.85), inset 0 1px 0 rgba(255,255,255,.22);
}

.balance-dropdown .dropdown-recharge:hover {
  filter: brightness(1.08);
  box-shadow: 0 10px 24px -12px rgba(84, 114, 228, 0.9), inset 0 1px 0 rgba(255,255,255,.25);
}

.balance-dropdown > div:nth-child(2) {
  padding: 20px 16px !important;
  background: rgba(17, 17, 19, 0.04);
  border-bottom-color: rgba(255, 255, 255, 0.055) !important;
}

.balance-dropdown > div:nth-child(2) > div:first-child {
  color: var(--slate-10) !important;
  font-size: var(--font-size-1) !important;
  line-height: var(--line-height-1) !important;
  letter-spacing: .06em;
}

.balance-dropdown > div:nth-child(2) > div:last-child {
  margin-top: 8px !important;
  color: var(--slate-12) !important;
  font-size: var(--font-size-4) !important;
  line-height: var(--line-height-4) !important;
  font-weight: var(--font-weight-bold) !important;
  letter-spacing: var(--letter-spacing-4);
  font-variant-numeric: tabular-nums;
}

.balance-dropdown > div:last-child {
  gap: 1px !important;
  background: rgba(255, 255, 255, 0.035) !important;
}

.balance-dropdown > div:last-child > div {
  min-height: 84px;
  padding: 16px !important;
  background: rgba(255, 255, 255, 0.010) !important;
  transition: background .18s ease;
}

.balance-dropdown > div:last-child > div:hover {
  background: rgba(62, 99, 221, 0.05) !important;
}

.balance-dropdown > div:last-child > div > div:first-child {
  color: var(--slate-10) !important;
  font-size: var(--font-size-1) !important;
  line-height: var(--line-height-1) !important;
}

.balance-dropdown > div:last-child > div > div:last-child {
  margin-top: 8px !important;
  color: var(--slate-12) !important;
  font-size: var(--font-size-3) !important;
  line-height: var(--line-height-3) !important;
  font-weight: var(--font-weight-bold) !important;
  font-variant-numeric: tabular-nums;
}

#balanceBtn {
  border-color: rgba(158, 177, 255, 0.16) !important;
  background: rgba(255, 255, 255, 0.035) !important;
}

#balanceBtn:hover,
#balanceBtn:focus-visible {
  background: rgba(62, 99, 221, 0.10) !important;
  border-color: rgba(158, 177, 255, 0.36) !important;
}

#balanceBtn:focus-visible {
  outline: 2px solid var(--focus-8);
  outline-offset: 2px;
}

@media (max-width: 520px) {
  .balance-dropdown > div:first-child {
    align-items: flex-start;
    flex-direction: column;
  }

  .balance-dropdown > div:first-child > div:last-child {
    width: 100%;
  }

  .balance-dropdown .dropdown-ghost,
  .balance-dropdown .dropdown-recharge {
    flex: 1;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .balance-dropdown,
  .balance-dropdown > div:last-child > div,
  .balance-dropdown .dropdown-ghost,
  .balance-dropdown .dropdown-recharge {
    transition: none !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .balance-dropdown {
    background: rgba(24, 25, 27, 0.94) !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@supports not ((backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))) {
  .balance-dropdown {
    background: rgba(24, 25, 27, 0.82) !important;
  }
}
