:root {
  --bg: #f3f6f4;
  --ink: #143028;
  --muted: #5f746a;
  --line: rgba(20, 48, 40, 0.1);
  --accent: #0ea57a;
  --accent-2: #17c3a2;
  --panel: rgba(255, 255, 255, 0.92);
  --shadow: 0 10px 28px rgba(20, 48, 40, 0.08);
  --radius: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  min-height: 100%;
  font-family: "PingFang SC", "Noto Sans SC", -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(23, 195, 162, 0.18), transparent 55%),
    radial-gradient(ellipse 70% 40% at 100% 0%, rgba(14, 165, 122, 0.12), transparent 50%),
    linear-gradient(180deg, #eaf3ef 0%, var(--bg) 45%, #eef2f0 100%);
}

.wrap {
  padding: 16px 16px 32px;
  max-width: 480px;
  margin: 0 auto;
}

.hero { margin: 8px 0 18px; }
.brand {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.sub {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 14px;
}

.section-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 10px;
}

.search-row { display: flex; gap: 8px; }
.search-row input {
  flex: 1;
  height: 42px;
  border: 1.5px solid rgba(14, 165, 122, 0.28);
  border-radius: 999px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  outline: none;
  font-size: 14px;
  min-width: 0;
}
.search-row button,
.search-row .input-clear {
  position: static;
  min-width: 72px;
  height: 42px;
  border: none;
  border-radius: 999px;
  padding: 0 16px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  line-height: 42px;
}

.account-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1.5px dashed rgba(20, 48, 40, 0.18);
  background: rgba(255, 255, 255, 0.7);
}
#user-result-card.is-selected {
  border-style: solid;
  border-color: rgba(14, 165, 122, 0.55);
  background: linear-gradient(180deg, rgba(14, 165, 122, 0.1), rgba(255, 255, 255, 0.95));
}
.account-status {
  display: none;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
#user-result-card.is-selected .account-status { display: flex; }
.account-status-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}
.account-badge {
  display: none;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  padding: 3px 10px;
  border-radius: 999px;
}
#user-result-card.is-selected .account-badge { display: inline-flex; }
.account-main {
  display: flex;
  align-items: center;
  gap: 12px;
}
#user-result-card:not(.is-selected) .account-main { justify-content: center; }
.user-id-left { display: none; flex-shrink: 0; }
#user-result-card.is-selected .user-id-left { display: block; }
.user-id-left img,
#user-img-head {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(14, 165, 122, 0.35);
  background: #e8efea;
  display: block;
}
.account-meta { flex: 1; min-width: 0; }
#user-result-card:not(.is-selected) .account-meta { text-align: center; }
.account-id {
  font-size: 16px;
  font-weight: 700;
}
.account-id.user-id-height {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.4;
  height: auto;
  padding: 10px 0;
}
.account-name {
  margin-top: 2px;
  font-size: 13px;
  color: #2f5a4c;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-hint {
  margin-top: 4px;
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}
.account-check {
  display: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  position: relative;
  flex-shrink: 0;
}
#user-result-card.is-selected .account-check { display: block; }
.account-check::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 4px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.pkg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.pkg-item {
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 14px 8px;
  text-align: center;
}
.pkg-item.active {
  border-color: rgba(14, 165, 122, 0.7);
  background: rgba(14, 165, 122, 0.08);
}
.pkg-money { font-size: 16px; font-weight: 700; }
.pkg-diamond { font-size: 12px; color: var(--muted); margin-top: 6px; }

.custom-amount {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.custom-amount-row {
  display: flex;
  align-items: center;
  height: 44px;
  border: 1.5px solid rgba(14, 165, 122, 0.28);
  border-radius: 12px;
  background: #fff;
  padding: 0 12px;
  gap: 6px;
}
.custom-amount-row.is-active {
  border-color: rgba(14, 165, 122, 0.7);
  background: rgba(14, 165, 122, 0.06);
}
.custom-amount-prefix {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}
.custom-amount-row input {
  flex: 1;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  color: var(--ink);
  min-width: 0;
}
.custom-amount-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.custom-amount-hint.is-error { color: #c0392b; }

#pay-btn {
  width: 100%;
  height: 46px;
  margin-top: 14px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}
#pay-btn:disabled { opacity: 0.45; }

.tip {
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.55;
}
.tip a { color: var(--accent); }

.loading {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 30, 25, 0.35);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.loading.show, .loading[style*="block"] { display: flex !important; }
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(14, 165, 122, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.mark-content {
  position: fixed;
  inset: 0;
  background: rgba(15, 30, 25, 0.45);
  z-index: 50;
  display: none;
}

.modal-card-content {
  position: fixed;
  left: 24px;
  right: 24px;
  top: 18vh;
  z-index: 120;
  background: #fff;
  border-radius: 18px;
  padding: 18px 16px;
  display: none;
  box-shadow: var(--shadow);
  max-width: 440px;
  margin: 0 auto;
}
.modal-zhang-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}
.modal-tips-text {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.5;
}
.modal-user-list { max-height: 46vh; overflow-y: auto; }
.modal-user-list-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.modal-user-list-item.is-active {
  border-color: rgba(14, 165, 122, 0.65);
  background: rgba(14, 165, 122, 0.08);
}
.modal-user-id {
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 0;
}
.modal-user-img-head {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  margin-right: 10px;
  object-fit: cover;
}
.right-modal-btn {
  width: 18px;
  height: 18px;
  border: 1.5px solid rgba(20, 48, 40, 0.25);
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}
.modal-user-list-item.is-active .right-modal-btn {
  border-color: var(--accent);
  background: var(--accent);
}
.modal-user-list-item.is-active .right-modal-btn::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.open_web {
  width: 100%;
  height: 100%;
  z-index: 200;
  position: fixed;
  background: rgba(15, 30, 25, 0.72);
  display: none;
}
.open_web.active { display: block; }
.open_web img {
  float: right;
  margin: 20px 24px 0 0;
  width: 110px;
  height: 92px;
}
.open_web p {
  clear: both;
  float: right;
  margin: 12px 24px 0 0;
  color: #fff;
  font-size: 16px;
  line-height: 1.6;
  text-align: right;
}

.result-wrap {
  text-align: center;
  padding-top: 72px;
}
.result-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}
.result-btn {
  flex: 1;
  height: 44px;
  border: none;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
}
.result-btn.primary {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff;
}
.result-btn.ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}
