*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #ffffff;
  color: #1a1a1a;
}

.topup-body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 24px 16px 100px;
}

.topup-wrapper {
  width: min(420px, 100%);
}

.topup-card__header {
  text-align: center;
  margin: 12px 0 18px;
}

.topup-card__header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: #111;
}

.form-block {
  background: #f7f7f8;
  border-radius: 18px;
  padding: 15px 18px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.form-block--column {
  align-items: flex-start;
  gap: 6px;
}

.form-block--row {
  flex-direction: row;
  margin-top: 16px;
}

.form-block__label {
  font-size: 14px;
  color: #333;
  font-weight: 600;
}

.form-block__input {
  border: none;
  background: none;
  font-size: 15px;
  color: #222;
  flex: 1;
  padding: 2px 0;
}

.form-block__input::placeholder {
  color: #bcbcbc;
}

.form-block__input:focus {
  outline: none;
}

.form-block__input--align-right {
  text-align: right;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  margin: 20px 0 12px;
  color: #3a3a3a;
}

.section-title--space {
  margin-top: 24px;
}

.amount-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.amount-item {
  border-radius: 16px;
  background: #f5f5f7;
  padding: 14px 10px;
  text-align: center;
  border: 2px solid transparent;
  color: #1f1f1f;
  font-weight: 600;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.amount-item strong {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: inherit;
}

.amount-item span {
  display: block;
  font-size: 12px;
  color: #9a9a9a;
  margin-top: 4px;
  font-weight: 500;
}

.amount-item--active {
  border-color: #ff4d4f;
  background: rgba(255, 77, 79, 0.12);
  color: #ff4d4f;
}

.channel-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
  margin-bottom: 28px;
}


.channel-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border-radius: 18px;
  padding: 12px 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease;
}

.channel-item__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: cover;
  background: #f0f0f0;
}

.channel-item__icon--placeholder {
  background: linear-gradient(135deg, #d8d8d8, #f0f0f0);
}

.channel-item__info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.channel-item__name {
  font-size: 15px;
  font-weight: 600;
  color: #181818;
  flex: 1;
  text-align:left;
}

.channel-item__remark {
  font-size: 12px;
  color: #8a8a8a;
}

.channel-item__indicator {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #3b3b3b;
  color: #3b3b3b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  position: relative;
}

.channel-item__indicator::after {
  content: "";
  position: absolute;
  display: none;
}

.channel-item--active {
  background: #f4f4f5;
}

.channel-item--active .channel-item__indicator {
  background: #3b3b3b;
  border-color: #3b3b3b;
  color: #ffffff;
}

.channel-item--active .channel-item__indicator::after {
  display: block;
  width: 8px;
  height: 12px;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: rotate(45deg);
  top: 0px;
  left: 4px;
}

.retry-button {
  width: 100%;
  border: none;
  background: #ffe5e5;
  color: #c93d3d;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  margin-top: 12px;
}

.hidden {
  display: none !important;
}

.topup-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  background: #ffffff;
  box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.08);
}
.topup-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 1px;
  background: #f0f0f0;
}

.submit-btn {
  width: 100%;
  border: none;
  border-radius: 26px;
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(135deg, #ff5858, #ff7b3d);
  cursor: pointer;
}

.submit-btn:active {
  transform: translateY(1px);
}

.submit-btn:disabled {
  background: #d3d3d3;
  cursor: not-allowed;
}

.retry-placeholder {
  text-align: center;
  font-size: 14px;
  color: #999;
  padding: 12px;
}

.retry-placeholder--error {
  color: #d14343;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.78);
  color: white;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.toast--visible {
  opacity: 1;
}

img {
  vertical-align: middle;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 0 24px;
}

.overlay__card {
  width: min(360px, 100%);
  background: #ffffff;
  border-radius: 20px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.18);
}

.overlay__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
}

.overlay__subtitle {
  margin: 12px 0 24px;
  font-size: 15px;
  color: #555;
}

.overlay__link {
  display: inline-block;
  font-size: 14px;
  color: #1f6feb;
  text-decoration: none;
  margin-bottom: 18px;
}

.overlay__link:hover {
  text-decoration: underline;
}

.overlay__actions {
  display: flex;
  gap: 12px;
}

.overlay__btn {
  flex: 1;
  padding: 12px 0;
  border-radius: 26px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
}

.overlay__btn--ghost {
  background: #f2f2f2;
  color: #555;
}

.overlay__btn--primary {
  background: linear-gradient(135deg, #ff5858, #ff7b3d);
  color: #ffffff;
}

@media (max-width: 430px) {
  .amount-grid {
    gap: 10px;
  }

  .channel-item {
    padding: 12px;
  }
}
