/* ==========================================================================
   Trip2China — 支付相关样式 (pay.css)
   --------------------------------------------------------------------------
   覆盖三部分:
     1. 结算区按钮的 loading / 禁用态（与 tour.css 的 .btn 配合）
     2. 就地表单错误 / 提示文案（pay.js 动态插入的 .pay-msg）
     3. 订单状态页的整页样式（pay-result.html；pay-cancel.html 只做转发，不依赖本文件）

   颜色沿用站点设计令牌: 主色 #000 / 强调色 #c49b63 / 成功绿 #0A7D33
   ========================================================================== */

/* ---------------------------------------------------------------- 1. 按钮态 */

/* 结算区主按钮（原 .btn.stripe）在加载中：
   - 保持原有宽度，避免文字变成"正在前往支付…"时布局跳动
   - 降低不透明度 + 禁用指针 */
.btn.is-busy,
.btn[aria-busy="true"] {
  opacity: .72;
  cursor: progress;
  pointer-events: none;
}

.btn.is-busy::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 8px;
  vertical-align: -1px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: pay-spin .7s linear infinite;
}

@keyframes pay-spin {
  to { transform: rotate(360deg); }
}

/* 尊重"减少动效"偏好 */
@media (prefers-reduced-motion: reduce) {
  .btn.is-busy::after { animation-duration: 2s; }
}

/* ---------------------------------------------------------------- 2. 提示文案 */

.pay-msg {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.55;
}

.pay-msg-error {
  background: #FDF2F2;
  border: 1px solid #F3C9C9;
  color: #A31717;
}

/* 中性提示（非错误）：例如"支付页已在新标签打开"
   用绿色系 —— 传达"操作成功、只是换了地方"而不是出问题 */
.pay-msg-info {
  background: #F1F8F3;
  border: 1px solid #C9E5D2;
  color: #0A7D33;
}

/* ---------------------------------------------------------------- 3. 结果页 / 取消页 */

.pay-page {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: #F7F7F7;
  color: #222;
  font-family: Arial, Helvetica, "Helvetica Neue", "Microsoft YaHei", sans-serif;
  display: flex;
  flex-direction: column;
}

.pay-page__main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.pay-card {
  width: 100%;
  max-width: 560px;
  background: #fff;
  border: 1px solid #EDEEF0;
  border-radius: 16px;
  padding: 40px 44px 36px;
  box-shadow: 0 5px 24px rgba(51, 51, 51, .06);
}

.pay-card--narrow { max-width: 480px; text-align: center; }

/* 状态图标 */
.pay-state { text-align: center; padding: 2px 0 4px; }

.pay-state__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: #C9CDD4;
}
.pay-state__icon.is-success { background: #0A7D33; }
.pay-state__icon.is-pending { background: #B98900; }
.pay-state__icon.is-danger  { background: #B5001A; }
.pay-state__icon.is-info    { background: #2563EB; }

.pay-state__title {
  margin: 0 0 8px;
  font-size: 26px;
  line-height: 1.25;
  font-weight: 700;
  color: #000;
}

.pay-state__desc {
  margin: 0;
  min-height: 22px;
  font-size: 14px;
  line-height: 1.6;
  color: #8A8A8A;
}

/* 订单明细 */
.pay-detail {
  margin: 26px 0 4px;
  border-top: 1px solid #EDEEF0;
}

.pay-detail > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid #F4F4F5;
  font-size: 14px;
}

.pay-detail dt { color: #8A8A8A; flex: 0 0 auto; }
.pay-detail dd { margin: 0; text-align: right; word-break: break-all; color: #222; }
.pay-detail dd.is-strong { font-weight: 700; color: #000; }

/* 操作按钮 */
.pay-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.pay-btn {
  flex: 1;
  min-width: 160px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 22px;
  border: 1px solid #000;
  border-radius: 4px;
  background: #000;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.pay-btn:hover { background: #c49b63; border-color: #c49b63; color: #fff; }
.pay-btn--ghost { background: #fff; color: #000; border-color: #EDEEF0; }
.pay-btn--ghost:hover { background: #c49b63; border-color: #c49b63; color: #fff; }
.pay-btn:disabled { opacity: .6; cursor: not-allowed; }

/* 手动输入订单号 */
.pay-manual input {
  width: 100%;
  margin: 12px 0;
  padding: 11px 12px;
  font-size: 14px;
  border: 1px solid #EDEEF0;
  border-radius: 8px;
}
.pay-manual input:focus { outline: 2px solid #c49b63; outline-offset: -1px; border-color: #c49b63; }

/* 说明块 */
.pay-tip {
  margin-top: 22px;
  padding: 14px 16px;
  background: #F9F9F9;
  border-radius: 8px;
  color: #8A8A8A;
  font-size: 12.5px;
  line-height: 1.7;
}
.pay-tip code {
  background: #EFEFEF;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}

[hidden] { display: none !important; }

/* 移动端 */
@media (max-width: 640px) {
  .pay-card { padding: 30px 22px 28px; border-radius: 12px; }
  .pay-state__title { font-size: 22px; }
  .pay-actions { flex-direction: column; }
  .pay-btn { width: 100%; }
}
