/* ===========================================================
   H5 收款页样式（参考目标站点视觉：蓝色渐变卡片 + 白色圆角卡片）
   =========================================================== */
/* 上一笔订单提示条 */
.order-banner {
  display: none; align-items: center; gap: 8px;
  background: #ecfdf5; border: 1px solid #a7f3d0; color: #047857;
  border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; font-size: 13px;
}
.order-banner.show { display: flex; }
.order-banner .ob-text { flex: 1; line-height: 1.4; }
.order-banner .ob-btn {
  border: 0; background: #10b981; color: #fff; border-radius: 6px;
  padding: 6px 12px; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.order-banner .ob-close { color: #94a3b8; cursor: pointer; font-size: 18px; line-height: 1; padding: 0 2px; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  color: #1e293b;
  background: linear-gradient(180deg, #eff6ff, #f8fafc);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img { display: block; }
input, textarea { font-family: inherit; }

.page { min-height: 100vh; padding: 12px 12px 0; }

/* 机构卡片 */
.institution-card {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-radius: 12px;
  padding: 20px 16px;
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(37, 99, 235, .3);
}
.institution-header { display: flex; align-items: center; }
.logo-wrapper {
  width: 48px; height: 48px; border-radius: 50%; overflow: hidden;
  background: rgba(255, 255, 255, .2);
  display: flex; align-items: center; justify-content: center;
  margin-right: 12px; flex: 0 0 auto; font-size: 22px;
}
.logo-wrapper img { width: 100%; height: 100%; object-fit: cover; }
.institution-info { display: flex; flex-direction: column; min-width: 0; }
.institution-name { font-size: 18px; font-weight: 600; color: #fff; }
.institution-tag {
  font-size: 11px; color: #dbeafe; background: rgba(255, 255, 255, .15);
  padding: 2px 8px; border-radius: 6px; align-self: flex-start; margin-top: 4px;
}
.institution-notice {
  margin-top: 14px; font-size: 12px; color: rgba(255, 255, 255, .85);
  background: rgba(255, 255, 255, .12); border-radius: 8px; padding: 8px 10px; line-height: 1.5;
}

/* 卡片通用 */
.card { background: #fff; border-radius: 12px; box-shadow: 0 2px 10px rgba(0, 0, 0, .06); }
.section { margin-bottom: 12px; }
.section-title { display: flex; align-items: center; margin: 0 0 10px 2px; }
.section-title .title-line {
  width: 3px; height: 16px; border-radius: 2px;
  background: linear-gradient(180deg, #2563eb, #3b82f6); margin-right: 8px;
}
.section-title .title-text { font-size: 16px; font-weight: 600; color: #1e293b; }

/* 金额卡片 */
.amount-card { padding: 20px 16px 16px; }
.amount-label { font-size: 14px; color: #6b7280; display: block; margin-bottom: 12px; }
.amount-input-wrapper {
  display: flex; align-items: baseline;
  padding-bottom: 16px; border-bottom: 1px solid #e5e7eb;
}
.amount-input-wrapper .currency { font-size: 24px; font-weight: 600; color: #1e293b; margin-right: 8px; }
.amount-input {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
  font-size: 36px; font-weight: 700; color: #1e293b; height: 50px; line-height: 50px; padding: 0;
}
.amount-input::placeholder { color: #d1d5db; font-weight: 700; }
.amount-hint { font-size: 12px; color: #ef4444; margin-top: 8px; display: none; }
.amount-hint.show { display: block; }

.quick-amount { margin-top: 14px; }
.quick-label { font-size: 12px; color: #9ca3af; display: block; margin-bottom: 8px; }
.quick-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-tag {
  font-size: 14px; color: #2563eb; background: #eff6ff;
  padding: 8px 16px; border-radius: 6px; border: 1px solid transparent;
  transition: all .2s; cursor: pointer;
}
.quick-tag.active { background: #2563eb; color: #fff; border-color: #2563eb; }

.remark-section { margin-top: 16px; padding-top: 16px; border-top: 1px solid #e5e7eb; }
.remark-label { font-size: 13px; color: #374151; font-weight: 500; display: block; margin-bottom: 8px; }
.remark-textarea {
  width: 100%; min-height: 44px; max-height: 100px; resize: none;
  background: #f9fafb; border: 0; outline: none; border-radius: 8px;
  padding: 10px 12px; font-size: 14px; color: #1e293b;
}
.remark-textarea::placeholder { color: #9ca3af; }

/* 收费项目（多选） */
.title-extra {
  margin-left: 6px; font-size: 11px; color: #2563eb; background: #eff6ff;
  border-radius: 999px; padding: 2px 8px; font-weight: 400;
}
.fee-card { padding: 4px 14px; }
.fee-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 0; border-bottom: 1px solid #f3f4f6; cursor: pointer;
}
.fee-item:last-child { border-bottom: 0; }
.fee-left { display: flex; align-items: center; min-width: 0; }
.fee-info { display: flex; flex-direction: column; min-width: 0; }
.fee-name { font-size: 15px; color: #1e293b; }
.fee-item.active .fee-name { color: #2563eb; font-weight: 600; }
.fee-desc { font-size: 12px; color: #9ca3af; margin-top: 2px; }
.fee-price { font-size: 14px; font-weight: 600; color: #ef4444; margin-left: 10px; flex: 0 0 auto; }
.fee-price.custom { color: #94a3b8; font-weight: 400; font-size: 12px; }
.fee-summary {
  margin-top: 8px; font-size: 12px; color: #2563eb; background: #eff6ff;
  border-radius: 8px; padding: 9px 12px; line-height: 1.6;
}
.amount-sub { font-size: 12px; color: #2563eb; margin-top: 8px; display: none; }
.amount-sub.show { display: block; }
.radio-dot {
  width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #d1d5db;
  flex: 0 0 auto; position: relative; transition: all .15s;
}
.payment-item.active .radio-dot {
  border-color: #2563eb; background: #2563eb;
}
.payment-item.active .radio-dot::after {
  content: ''; position: absolute; left: 6px; top: 2.5px;
  width: 5px; height: 9px; border: 2px solid #fff; border-top: 0; border-left: 0;
  transform: rotate(45deg);
}
/* 多选勾选框 */
.check-box {
  width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid #d1d5db;
  flex: 0 0 auto; position: relative; transition: all .15s; margin-right: 10px;
}
.fee-item.active .check-box { border-color: #2563eb; background: #2563eb; }
.fee-item.active .check-box::after {
  content: ''; position: absolute; left: 6px; top: 2px;
  width: 5px; height: 10px; border: 2px solid #fff; border-top: 0; border-left: 0;
  transform: rotate(45deg);
}

/* 优惠券 */
.coupon-card { padding: 4px 14px; }
.coupon-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid #f3f4f6;
}
.coupon-item:last-child { border-bottom: 0; }
.coupon-name { font-size: 14px; color: #1e293b; }
.coupon-desc { font-size: 12px; color: #9ca3af; margin-top: 2px; }
.coupon-amount { font-size: 15px; font-weight: 700; color: #ef4444; }

/* 支付方式 */
.payment-card { padding: 4px 14px; }
.payment-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid #f3f4f6; cursor: pointer;
}
.payment-item:last-child { border-bottom: 0; }
.payment-left { display: flex; align-items: center; }
.payment-icon { width: 32px; height: 32px; margin-right: 12px; }
.payment-icon img { width: 32px; height: 32px; }
.payment-info { display: flex; flex-direction: column; }
.payment-name { font-size: 15px; color: #1e293b; }
.payment-desc { font-size: 12px; color: #f59e0b; margin-top: 2px; }

/* 安全提示 */
.security-tips {
  display: flex; align-items: center; justify-content: center;
  padding: 14px 0 100px; font-size: 12px; color: #10b981;
}
.security-tips svg { margin-right: 5px; }

/* 底部支付栏 */
.pay-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 -2px 16px rgba(15, 23, 42, .08);
  backdrop-filter: blur(8px);
}
.pay-info { display: flex; flex-direction: column; }
.pay-label { font-size: 12px; color: #6b7280; }
.pay-amount { font-size: 22px; font-weight: 700; color: #ef4444; line-height: 1.2; }
.pay-amount .symbol { font-size: 14px; font-weight: 600; margin-right: 2px; }
.pay-btn {
  border: 0; border-radius: 24px; min-width: 140px;
  padding: 13px 28px; font-size: 16px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 4px 12px rgba(37, 99, 235, .35);
  cursor: pointer; transition: all .2s;
}
.pay-btn.disabled { background: #e2e8f0; color: #94a3b8; box-shadow: none; cursor: not-allowed; }
.pay-btn:active:not(.disabled) { transform: scale(.98); }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .55); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff; border-radius: 14px; padding: 22px 20px; width: 100%; max-width: 320px;
  text-align: center; animation: pop .2s ease-out;
}
@keyframes pop { from { transform: scale(.92); opacity: 0 } to { transform: scale(1); opacity: 1 } }
.modal h3 { margin: 0 0 6px; font-size: 17px; }
.modal .modal-sub { font-size: 13px; color: #64748b; margin-bottom: 14px; }
.modal .modal-amount { font-size: 26px; font-weight: 700; color: #ef4444; margin-bottom: 14px; }
.qr-box { display: flex; align-items: center; justify-content: center; padding: 12px; background: #f8fafc; border-radius: 10px; }
.qr-box img, .qr-box canvas { display: block; }
.modal-tip { font-size: 12px; color: #94a3b8; margin-top: 12px; line-height: 1.6; }
.modal-btn {
  margin-top: 16px; width: 100%; border: 0; border-radius: 10px; padding: 12px;
  font-size: 15px; font-weight: 600; color: #fff; background: #2563eb; cursor: pointer;
}
.modal-btn.ghost { background: #eff6ff; color: #2563eb; margin-top: 8px; }
.modal-btn.success { background: #10b981; }
.modal-btn:disabled { opacity: .6; cursor: not-allowed; }

/* loading */
.loading-mask {
  position: fixed; inset: 0; background: rgba(255, 255, 255, .6); z-index: 200;
  display: none; align-items: center; justify-content: center; flex-direction: column;
}
.loading-mask.show { display: flex; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid #dbeafe; border-top-color: #2563eb; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }
.loading-text { margin-top: 12px; font-size: 14px; color: #475569; }

/* toast */
.toast {
  position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%);
  background: rgba(15, 23, 42, .86); color: #fff; font-size: 14px;
  padding: 12px 20px; border-radius: 10px; z-index: 300; max-width: 76%;
  text-align: center; line-height: 1.5; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.toast.show { opacity: 1; }

/* 支付成功页 */
.success-wrap {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 32px 24px;
}
.success-icon {
  width: 80px; height: 80px; border-radius: 50%; background: #ecfdf5;
  display: flex; align-items: center; justify-content: center; margin-bottom: 20px;
}
.success-title { font-size: 22px; font-weight: 700; color: #0f172a; margin-bottom: 8px; }
.success-sub { font-size: 13px; color: #64748b; margin-bottom: 24px; text-align: center; }
.success-card { background: #fff; border-radius: 14px; padding: 20px; width: 100%; max-width: 340px; box-shadow: 0 4px 20px rgba(15, 23, 42, .08); }
.success-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; font-size: 14px; }
.success-row + .success-row { border-top: 1px solid #f1f5f9; }
.success-row .k { color: #64748b; }
.success-row .v { color: #1e293b; font-weight: 500; word-break: break-all; text-align: right; }
.success-row .v.amount { color: #ef4444; font-size: 20px; font-weight: 700; }
.success-btn {
  margin-top: 28px; border: 0; border-radius: 24px; padding: 13px 48px;
  font-size: 16px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, #2563eb, #1d4ed8); cursor: pointer;
}
