/* ============================================================
   打赏页 / 感谢页样式（依赖 app.css 的设计变量与顶部栏）
   ============================================================ */
.pay-main { padding: 150px 0 92px; min-height: calc(100vh - 300px); }
.pay-wrap { width: min(560px, 100%); margin: 0 auto; }
.pay-head { margin-bottom: 26px; text-align: center; }
.pay-head h1 { margin: 0 0 14px; font-size: clamp(30px, 5vw, 42px); font-weight: 780; letter-spacing: -0.045em; line-height: 1.2; }
.pay-lead { color: var(--text-secondary); font-size: 15px; line-height: 1.9; }

.pay-card { padding: 26px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); box-shadow: var(--shadow-card); }
.pay-block { margin-bottom: 22px; }
.pay-label { display: block; margin-bottom: 10px; color: var(--text-secondary); font-size: 13px; font-weight: 700; }

/* 金额 */
.amounts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.amount-btn {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 650;
  transition: transform 160ms var(--ease), border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}
.amount-btn:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.amount-btn.is-active { border-color: var(--brand); background: var(--brand); color: var(--white); box-shadow: 0 4px 12px rgba(17, 24, 39, 0.14); }

.amount-custom {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  margin-top: 10px;
  padding: 0 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--surface-muted);
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease;
}
.amount-custom:hover { border-color: var(--text); background: var(--white); }
.amount-custom.is-active { border-style: solid; border-color: var(--brand); background: var(--white); }
.amount-custom .cur { color: var(--text-muted); font-family: var(--mono); font-size: 15px; }
.amount-custom .val { flex: 1; min-width: 0; font-family: var(--mono); font-size: 15px; font-weight: 650; color: var(--text); }
.amount-custom .val.is-empty { font-family: inherit; font-weight: 400; color: var(--text-muted); }
.amount-custom .edit { flex: none; color: var(--accent); font-size: 13px; font-weight: 650; }

/* 支付方式 */
.methods { display: grid; gap: 10px; }
.method {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  text-align: left;
  transition: transform 160ms var(--ease), border-color 160ms ease, box-shadow 160ms ease;
}
.method:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.method img { width: 36px; height: 36px; flex: none; border-radius: 9px; object-fit: contain; }
.method-text { flex: 1; min-width: 0; }
.method-text b { display: block; font-size: 15px; font-weight: 650; color: var(--text); line-height: 1.4; }
.method-text small { display: block; color: var(--text-muted); font-size: 12px; line-height: 1.4; }
.method-check { position: relative; width: 20px; height: 20px; flex: none; border: 2px solid var(--line-strong); border-radius: 50%; background: var(--white); }
.method.is-active { border-color: var(--brand); box-shadow: 0 6px 18px rgba(17, 24, 39, 0.08); }
.method.is-active .method-check { border-color: var(--brand); background: var(--brand); }
.method.is-active .method-check::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--white); }

/* 提交 */
.pay-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 11px;
  background: var(--brand);
  color: var(--white);
  font-size: 16px;
  font-weight: 650;
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.12);
  transition: transform 160ms var(--ease), background 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}
.pay-submit:hover { background: var(--brand-hover); transform: translateY(-1px); box-shadow: 0 7px 18px rgba(17, 24, 39, 0.16); }
.pay-submit:disabled { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- 数字键盘（自定义金额） ---------- */
.keypad { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-end; justify-content: center; }
.keypad[hidden] { display: none !important; }
.keypad-mask { position: absolute; inset: 0; background: rgba(17, 24, 39, 0.35); }
.keypad-panel {
  position: relative;
  width: min(480px, 100%);
  padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  border-radius: 20px 20px 0 0;
  background: var(--white);
  box-shadow: 0 -10px 40px rgba(17, 24, 39, 0.18);
  animation: keypadUp .22s var(--ease);
}
@keyframes keypadUp { from { transform: translateY(14px); opacity: .6; } to { transform: none; opacity: 1; } }
.keypad-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.keypad-title { color: var(--text-muted); font-size: 13px; font-weight: 650; }
.keypad-close { width: 34px; height: 34px; border: 0; border-radius: 9px; background: var(--surface-muted); color: var(--text-secondary); font-size: 17px; line-height: 1; }
.keypad-display { display: flex; align-items: baseline; justify-content: center; gap: 4px; padding: 8px 0 14px; }
.keypad-cur { color: var(--text-muted); font-size: 18px; }
.keypad-value { color: var(--text); font-family: var(--mono); font-size: 38px; font-weight: 750; letter-spacing: -0.02em; }
.keypad-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad-grid button {
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--text);
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 650;
  transition: background 150ms ease, transform 150ms ease, color 150ms ease;
}
.keypad-grid button:hover { background: var(--surface-muted); }
.keypad-grid button:active { transform: scale(.97); }
.keypad-grid .keypad-back { font-family: inherit; font-size: 18px; }
.keypad-grid .keypad-done { border-color: var(--brand); background: var(--brand); color: var(--white); font-family: inherit; font-size: 16px; }
.keypad-grid .keypad-done:hover { background: var(--brand-hover); }

/* ---------- 感谢页 ---------- */
.thanks-main { padding: 150px 0 92px; }
.thanks-wrap { width: min(600px, 100%); margin: 0 auto; }
.thanks-card { padding: 38px 28px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); box-shadow: var(--shadow-card); text-align: center; }
.thanks-badge { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 16px; padding: 6px 13px; border-radius: 99px; background: #fef3c7; color: #a16207; font-size: 12px; font-weight: 700; }
.thanks-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.thanks-badge.ok { background: #dcfce7; color: #15803d; }
.thanks-title { font-size: clamp(26px, 4vw, 34px); font-weight: 760; letter-spacing: -0.03em; }
.thanks-sub { margin-top: 12px; color: var(--text-secondary); font-size: 15px; line-height: 1.85; }
.thanks-list { display: grid; gap: 0; margin: 24px 0 4px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); text-align: left; }
.thanks-list > div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.thanks-list > div:last-child { border-bottom: 0; }
.thanks-list dt { flex: none; color: var(--text-muted); font-size: 13px; }
.thanks-list dd { margin: 0; color: var(--text); font-family: var(--mono); font-size: 13.5px; font-weight: 650; text-align: right; word-break: break-all; }
.thanks-actions { display: flex; justify-content: center; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.thanks-local { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); text-align: left; }
.thanks-local-title { margin-bottom: 8px; color: var(--text-muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.thanks-local-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; color: var(--text-secondary); font-size: 12.5px; }
.thanks-local-item b { font-family: var(--mono); color: var(--text); font-weight: 650; }

@media (max-width: 640px) {
  .pay-main { padding: 120px 0 72px; }
  .pay-card { padding: 20px; }
  .amounts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .thanks-main { padding: 118px 0 72px; }
  .thanks-card { padding: 28px 18px; }
}

/* ---------- 输入行（邮箱 / 留言，与整体交互统一） ---------- */
.pay-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.pay-field:hover { border-color: var(--line-strong); }
.pay-field:focus-within {
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}
.pay-field-icon { flex: none; display: inline-flex; color: var(--text-muted); transition: color 160ms ease; }
.pay-field:focus-within .pay-field-icon { color: var(--text-secondary); }
.pay-input {
  flex: 1;
  min-width: 0;
  height: 48px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  outline: none;
}
.pay-input::placeholder { color: var(--text-muted); }
.pay-field-count { flex: none; color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.pay-field-check {
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #dcfce7;
  color: #15803d;
  animation: fieldCheckIn 180ms var(--ease);
}
.pay-field-check[hidden] { display: none !important; }
@keyframes fieldCheckIn {
  from { opacity: 0; transform: scale(.6); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 640px) {
  .pay-input { font-size: 16px; } /* 防止 iOS 聚焦输入框时自动放大页面 */
}

/* ============ 自定义金额：电脑端 = 内嵌输入框（无弹层） ============ */
.amount-custom.is-desktop {
  display: none;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.amount-custom.is-desktop .cur { color: var(--text-secondary); font-weight: 650; }
.amount-custom.is-desktop .custom-input {
  flex: 1;
  min-width: 0;
  height: 48px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  outline: none;
}
.amount-custom.is-desktop .custom-input::placeholder { color: var(--text-muted); }
@media (min-width: 641px) {
  #customBtn { display: none; }
  .amount-custom.is-desktop { display: flex; }
  .amount-custom.is-desktop:focus-within {
    border-color: var(--text);
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
  }
  .keypad { display: none !important; }
}

/* ============================================================
   固定金额链接（/pay/50）：金额展示与锁定
   ============================================================ */
.is-hidden { display: none !important; }

.amount-fixed {
  padding: 18px 18px 14px;
  border: 1px solid #e9e6dd;
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfaf6, #ffffff);
}
.amount-fixed-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.amount-fixed-num { font-size: 42px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.amount-fixed-num i { margin-right: 2px; font-size: 22px; font-style: normal; font-weight: 700; }
.amount-fixed-badge {
  padding: 3px 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: #2b5bd7;
  font-size: 11.5px;
  font-weight: 600;
}
.amount-fixed-note { margin: 8px 0 6px; color: #8a8578; font-size: 12.5px; }
.amount-fixed-link {
  display: inline-block;
  margin-top: 2px;
  color: #6f6b60;
  font-size: 12.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.amount-fixed-link:hover { color: #111827; }

@media (max-width: 640px) {
  .amount-fixed-num { font-size: 34px; }
  .amount-fixed { padding: 15px 15px 12px; }
}
