:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #334965;
  background-color: #d9e9f8;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  margin: 0;
  padding: clamp(12px, 4vw, 32px) 16px;
  background:
    linear-gradient(157deg, transparent 29%, #ffffff42 29.2%, #ffffff42 29.6%, transparent 29.8%),
    linear-gradient(25deg, #bcdfee7a 18%, transparent 18.2%),
    radial-gradient(ellipse at 98% 54%, #b2c7ef 0%, transparent 60%),
    linear-gradient(145deg, #9dbced 0%, #e1eafa 47%, #b5d9eb 100%);
}

.card {
  width: min(100%, 440px);
  margin-inline: auto;
  padding: clamp(23px, 7vw, 32px) clamp(15px, 5.7vw, 27px) 18px;
  border: 2px solid #fffffff2;
  border-radius: 28px;
  background: #f6f9fdeF;
  text-align: center;
}

.instructions {
  margin: 0 0 22px;
  color: #4d607e;
  font-size: 1rem;
  line-height: 1.55;
}

.tabs,
.qr {
  width: min(100%, 296px);
  margin-inline: auto;
}

.tabs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 16px;
  background: #e9eef5;
}

.tabs::before {
  position: absolute;
  inset: 4px auto 4px 4px;
  width: calc((100% - 12px) / 2);
  border-radius: 12px;
  background: white;
  box-shadow: 0 2px 8px #20335410;
  transition: transform 200ms ease-out;
  pointer-events: none;
  content: "";
}

.tabs[data-active="alipay-tab"]::before {
  transform: translateX(calc(100% + 4px));
}

.tabs button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(5px, 2vw, 10px);
  min-width: 0;
  min-height: 43px;
  padding: 6px 3px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #50617b;
  font: inherit;
  font-size: clamp(.875rem, 4vw, 1rem);
  white-space: nowrap;
  cursor: pointer;
}

.tabs button[aria-selected="true"] {
  color: #293e5b;
}

.brand {
  display: inline-block;
  flex: 0 0 auto;
  width: clamp(20px, 6vw, 25px);
  aspect-ratio: 1;
  background: center / contain no-repeat;
}
.brand.wechat { background-image: url("assets/wechat-icon.png"); }
.brand.alipay {
  background-image: url("assets/alipay-icon.png");
  border-radius: 5px;
}

.qr { margin-block: 18px 20px; }
.qr img {
  display: block;
  width: 100%;
  height: auto;
}

.qr.is-entering img {
  animation: qr-enter 200ms ease-out both;
}

@keyframes qr-enter {
  from { opacity: .3; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .tabs::before { transition: none; }
  .qr.is-entering img { animation: none; }
}

.save {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 49px;
  padding: 10px 14px;
  border-radius: 14px;
  background: linear-gradient(108deg, #315fd5, #4d76b8);
  box-shadow: 0 8px 23px #376bd42b;
  color: white;
  text-decoration: none;
  font-weight: 600;
}
.save:hover { filter: brightness(1.05); }

.save-icon {
  position: relative;
  width: 16px;
  height: 7px;
  margin-top: 8px;
  border: 1.5px solid currentColor;
  border-top: 0;
  border-radius: 0 0 2px 2px;
}
.save-icon::before,
.save-icon::after {
  position: absolute;
  left: 50%;
  content: "";
}
.save-icon::before {
  top: -10px;
  height: 10px;
  border-left: 1.5px solid currentColor;
  transform: translateX(-50%);
}
.save-icon::after {
  top: -6px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateX(-50%) rotate(45deg);
}

.save-hint,
.notice {
  color: #4d607e;
  font-size: .875rem;
  line-height: 1.55;
}
.save-hint { margin: 12px 0 0; }
.notice {
  margin: 18px 0 0;
  padding-top: 17px;
  border-top: 1px solid #cdd8e8;
}

:focus-visible {
  outline: 2px solid #245acb;
  outline-offset: 3px;
}
