:root {
  --brand: #6366f1;
  --brand-dark: #4f46e5;
  --bg-1: #6a82fb;
  --bg-2: #a78bfa;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --ok: #16a34a;
  --err: #dc2626;
  --alipay: #1677ff;
  --wxpay: #07c160;
  --qqpay: #12b7f5;
  --usdt: #26a17b;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.card {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(31, 41, 55, 0.25);
  padding: 32px 28px;
  animation: rise 0.5s ease;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- 项目头部 ---- */
.project {
  text-align: center;
  margin-bottom: 24px;
}
.logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--brand), var(--bg-2));
  color: #fff;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}
.project h1 {
  font-size: 22px;
  margin: 0 0 6px;
}
.project-desc {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}
.project-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--brand-dark);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.project-link:hover {
  text-decoration: underline;
}

/* ---- 区块 ---- */
.block {
  margin-bottom: 22px;
}
.block-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}
.muted {
  color: var(--muted);
  font-weight: 400;
}

/* ---- 金额预设 ---- */
.presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.preset {
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 14px 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}
.preset:hover {
  border-color: var(--brand);
}
.preset.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}
.preset .unit {
  font-size: 12px;
  opacity: 0.8;
  margin-right: 1px;
}

.custom-amount {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  transition: border-color 0.15s ease;
}
.custom-amount:focus-within {
  border-color: var(--brand);
}
.custom-amount .cur {
  font-size: 18px;
  font-weight: 600;
  color: var(--muted);
  margin-right: 6px;
}
.custom-amount input {
  flex: 1;
  border: none;
  outline: none;
  padding: 14px 0;
  font-size: 16px;
  background: transparent;
  color: var(--text);
}
/* 去掉数字输入框的上下箭头 */
.custom-amount input::-webkit-outer-spin-button,
.custom-amount input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.custom-amount input[type='number'] {
  -moz-appearance: textfield;
  appearance: textfield;
}
.hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  min-height: 16px;
}
.usdt-tip {
  margin-top: 12px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #0f7a5a;
  background: #e8f8f1;
  border: 1px solid #b6e9d5;
  border-radius: 10px;
}

/* ---- 支付渠道 ---- */
.channels {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.channel {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: #fff;
}
.channel:hover {
  border-color: var(--brand);
}
.channel.active {
  border-color: var(--brand);
  background: #f5f5ff;
}
.channel .chan-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  margin-right: 12px;
  flex-shrink: 0;
}
.chan-icon.alipay {
  background: var(--alipay);
}
.chan-icon.wxpay {
  background: var(--wxpay);
}
.chan-icon.qqpay {
  background: var(--qqpay);
}
.chan-icon.usdt {
  background: var(--usdt);
}
.channel .chan-name {
  font-size: 15px;
  font-weight: 500;
}
.channel .chan-check {
  margin-left: auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  position: relative;
  flex-shrink: 0;
}
.channel.active .chan-check {
  border-color: var(--brand);
  background: var(--brand);
}
.channel.active .chan-check::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2.5px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ---- 留言 ---- */
.message {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s ease;
}
.message:focus {
  border-color: var(--brand);
}

/* ---- 捐赠按钮 ---- */
.donate-btn {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 16px;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}
.donate-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(99, 102, 241, 0.5);
}
.donate-btn:active:not(:disabled) {
  transform: translateY(0);
}
.donate-btn:disabled {
  background: #c7c9d9;
  box-shadow: none;
  cursor: not-allowed;
}
.donate-btn.loading {
  opacity: 0.8;
  cursor: wait;
}

.error {
  color: var(--err);
  font-size: 13px;
  text-align: center;
  margin: 12px 0 0;
}
.footnote {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  margin: 18px 0 0;
}

/* ---- 感谢页 ---- */
.result {
  text-align: center;
}
.result .result-icon {
  font-size: 64px;
  margin-bottom: 8px;
  animation: pop 0.5s ease;
}
@keyframes pop {
  0% {
    transform: scale(0.4);
    opacity: 0;
  }
  60% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
.result h1 {
  font-size: 24px;
  margin: 8px 0;
}
.result .amount {
  font-size: 40px;
  font-weight: 800;
  color: var(--brand-dark);
  margin: 10px 0;
}
.result .status {
  font-size: 14px;
  color: var(--muted);
  margin: 6px 0 20px;
}
.result .status.ok {
  color: var(--ok);
  font-weight: 600;
}
.result .order-no {
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
  margin-bottom: 22px;
}
.btn-link {
  display: inline-block;
  text-decoration: none;
  border-radius: 12px;
  padding: 13px 28px;
  font-weight: 600;
  font-size: 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.15);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -3px;
  margin-right: 6px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 420px) {
  .card {
    padding: 26px 20px;
  }
  .presets {
    gap: 8px;
  }
  .preset {
    padding: 12px 2px;
    font-size: 15px;
  }
}
