/* 升级/降级页面 - V21 CSS变量体系 */
@import "../../styles/global.css";

.xx-upgrade-page {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-lg);
}

/* 套餐卡片 */
.xx-upgrade-plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

@media (max-width: 768px) {
  .xx-upgrade-plans {
    grid-template-columns: 1fr;
  }
}

.xx-upgrade-card {
  background: var(--bg-elevated);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  cursor: pointer;
  transition: var(--transition-base);
  position: relative;
}

.xx-upgrade-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 8px 30px
    color-mix(in srgb, var(--primary-color) 10%, transparent);
}

.xx-upgrade-card.selected {
  border-color: var(--primary-color);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--primary-color) 12%, transparent),
    0 8px 30px color-mix(in srgb, var(--primary-color) 10%, transparent);
}

.xx-upgrade-card.current {
  border-color: var(--secondary-color);
}

.xx-current-badge {
  position: absolute;
  top: -10px;
  right: var(--space-md);
  background: var(--secondary-color);
  color: var(--text-inverse);
  padding: 3px 12px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
}

.xx-upgrade-card h3 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-extrabold);
  color: var(--text-primary);
  margin: 0 0 var(--space-md);
}

.xx-price {
  margin-bottom: var(--space-sm);
}

/* ── BillingCycleSwitch 组件 ──────────────────────── */
.xx-billing-cycle-switch {
  display: inline-flex;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.xx-billing-cycle-btn {
  padding: 6px 14px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  border: none;
  background: var(--bg-primary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
}

.xx-billing-cycle-btn:first-child {
  border-right: 1px solid var(--border-color);
}

.xx-billing-cycle-btn.active {
  background: var(--primary-color);
  color: var(--text-inverse);
}

.xx-save {
  display: inline-block;
  margin-left: var(--space-xs);
  font-size: var(--font-size-xs);
  color: var(--secondary-color);
  font-weight: var(--font-weight-semibold);
}

.xx-billing-cycle-btn.active .xx-save {
  color: var(--text-inverse);
  opacity: 0.85;
}

/* 操作区 */
.xx-upgrade-actions {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.xx-auto-renew-section {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-secondary);
  font-size: var(--font-size-base);
}

.xx-cancel-btn {
  margin-top: var(--space-sm);
}

/* ── Spinner 组件 ───────────────────────────────── */
.xx-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-2xl) 0;
}

.xx-spinner-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary-color);
  animation: xx-spinner-bounce 1.2s ease-in-out infinite;
}

.xx-spinner-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.xx-spinner-dot:nth-child(3) {
  animation-delay: 0.3s;
}

.xx-spinner--small .xx-spinner-dot {
  width: 6px;
  height: 6px;
}

@keyframes xx-spinner-bounce {
  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

@media (max-width: 480px) {
  .xx-upgrade-page {
    padding: var(--space-md);
  }

  .xx-upgrade-actions {
    flex-direction: column;
  }

  .xx-upgrade-actions button {
    width: 100%;
  }
}
