/* 天琪科技 — 结账 / 支付页（全宽布局） */
:root {
  --pay-primary: #1172ff;
  --pay-primary-dark: #0d5cd9;
  --pay-accent: #e64500;
  --pay-bg: #eef2f7;
  --pay-panel: #fff;
  --pay-order: #f4f7fb;
  --pay-text: #1a2233;
  --pay-muted: #6b7280;
  --pay-border: #dde3ed;
  --pay-radius: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.pay-page {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", sans-serif;
  background: var(--pay-bg);
  color: var(--pay-text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── 顶栏（已移除，保留样式避免旧缓存残留） ── */
.pay-header {
  display: none !important;
}

.pay-header__inner,
.pay-topbar__inner {
  width: 100%;
  padding: 0 clamp(20px, 3vw, 48px);
}

.pay-header__inner {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pay-header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--pay-text);
  font-size: 17px;
  font-weight: 600;
}

.pay-header__logo img {
  height: 34px;
}

.pay-header__meta {
  display: flex;
  align-items: center;
  gap: 20px;
}

.pay-secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #0f7a4a;
  background: #ecfdf3;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  padding: 5px 12px;
}

.pay-header__back {
  color: var(--pay-primary);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
}

.pay-header__back:hover {
  text-decoration: underline;
}

/* ── 流程条（全宽） ── */
.pay-topbar {
  background: #fff;
  border-bottom: 1px solid var(--pay-border);
}

.pay-topbar__inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding-top: 14px;
  padding-bottom: 14px;
}

.pay-topbar__title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.pay-topbar__back {
  margin-left: auto;
  font-size: 14px;
  color: var(--pay-muted);
  text-decoration: none;
  white-space: nowrap;
}

.pay-topbar__back:hover {
  color: var(--pay-text);
  text-decoration: underline;
}

.pay-steps {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0;
  font-size: 14px;
  color: var(--pay-muted);
}

.pay-steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  padding-right: 40px;
}

.pay-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 16px;
  height: 1px;
  background: #c5cdd8;
  transform: translateY(-50%);
}

.pay-steps li span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid #c5cdd8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  background: #fff;
  flex-shrink: 0;
}

.pay-steps li.active {
  color: var(--pay-primary);
  font-weight: 600;
}

.pay-steps li.active span {
  background: var(--pay-primary);
  border-color: var(--pay-primary);
  color: #fff;
}

.pay-steps li.done {
  color: #0f7a4a;
}

.pay-steps li.done span {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
}

/* ── 主区域：全宽双栏 ── */
.pay-checkout {
  display: grid;
  grid-template-columns: minmax(360px, 42%) 1fr;
  min-height: calc(100vh - 132px);
  width: 100%;
}

.pay-order {
  background: var(--pay-order);
  border-right: 1px solid var(--pay-border);
  padding: clamp(24px, 3vw, 40px) clamp(20px, 4vw, 56px);
}

.pay-panel {
  background: var(--pay-panel);
  padding: clamp(24px, 3vw, 40px) clamp(20px, 4vw, 56px);
}

.pay-order__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.pay-order__head h2,
.pay-panel h2 {
  font-size: 18px;
  font-weight: 600;
}

.pay-order__meta {
  display: flex;
  gap: 20px;
  font-size: 13px;
}

.pay-order__meta dt {
  color: var(--pay-muted);
  margin-bottom: 2px;
}

.pay-order__meta dd {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pay-order__product {
  background: #fff;
  border: 1px solid var(--pay-border);
  border-radius: var(--pay-radius);
  padding: 20px 22px;
  margin-bottom: 20px;
}

.pay-product-label {
  font-size: 12px;
  color: var(--pay-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.pay-product-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--pay-text);
  line-height: 1.45;
  margin-bottom: 10px;
}

.pay-product-desc {
  font-size: 14px;
  color: var(--pay-muted);
}

.pay-price-type {
  display: inline-block;
  margin-top: 12px;
  font-size: 12px;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 4px 10px;
}

.pay-features {
  list-style: none;
  margin-bottom: 24px;
}

.pay-features li {
  font-size: 14px;
  padding: 7px 0 7px 22px;
  position: relative;
  color: #374151;
  border-bottom: 1px dashed #e2e8f0;
}

.pay-features li:last-child {
  border-bottom: none;
}

.pay-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #10b981;
  font-weight: bold;
}

.pay-summary {
  background: #fff;
  border: 1px solid var(--pay-border);
  border-radius: var(--pay-radius);
  overflow: hidden;
  margin-bottom: 20px;
}

.pay-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  font-size: 14px;
  border-bottom: 1px solid #edf1f6;
}

.pay-summary__row--total {
  background: linear-gradient(180deg, #fafcff 0%, #f3f7fd 100%);
  padding: 18px 20px;
  border-bottom: none;
}

.pay-summary__pending {
  color: var(--pay-muted);
}

.pay-price-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--pay-accent);
}

.pay-price-value small {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--pay-muted);
  margin-top: 2px;
  text-align: right;
}

.pay-trust {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pay-trust li {
  font-size: 12px;
  color: #4b5563;
  background: #fff;
  border: 1px solid var(--pay-border);
  border-radius: 6px;
  padding: 6px 10px;
}

/* ── 右侧表单 ── */
.pay-panel__hint {
  font-size: 14px;
  color: var(--pay-muted);
  margin: 8px 0 24px;
}

.pay-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 20px;
  margin-bottom: 28px;
}

.field--full {
  grid-column: 1 / -1;
}

.pay-form label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #374151;
}

.pay-form label .req {
  color: #ef4444;
  margin-left: 2px;
}

.pay-form input,
.pay-form textarea {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--pay-border);
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
  background: #fafbfc;
}

.pay-form input[readonly] {
  background: #f0f3f8;
  color: #4b5563;
  cursor: default;
}

.pay-form textarea {
  height: 88px;
  padding: 12px 14px;
  resize: vertical;
}

.pay-form input:focus,
.pay-form textarea:focus {
  outline: none;
  border-color: var(--pay-primary);
  box-shadow: 0 0 0 3px rgba(17, 114, 255, 0.1);
  background: #fff;
}

.pay-form input.error {
  border-color: #ef4444;
  background: #fff5f5;
}

/* ── 微信支付 ── */
.pay-methods-block h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
}

.pay-wechat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  margin-bottom: 28px;
  background: linear-gradient(135deg, #f6fffa 0%, #f0fdf4 100%);
  border: 2px solid #86efac;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(7, 193, 96, 0.1);
  position: relative;
  overflow: hidden;
}

.pay-wechat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #07c160;
}

.pay-wechat-card__icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  background: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  box-shadow: 0 2px 8px rgba(7, 193, 96, 0.12);
}

.pay-wechat-card__icon .pay-wechat-logo {
  display: block;
  height: 40px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.pay-wechat-card__body {
  flex: 1;
  min-width: 0;
}

.pay-wechat-card__title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: #14532d;
  margin-bottom: 4px;
}

.pay-wechat-card__desc {
  display: block;
  font-size: 13px;
  color: #4b7c5f;
  line-height: 1.5;
}

.pay-wechat-card__badge {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: #07c160;
  background: #fff;
  border: 1px solid #86efac;
  border-radius: 999px;
  padding: 6px 14px;
  white-space: nowrap;
}

/* ── 提交栏 ── */
.pay-submit-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  padding: 20px 24px;
  background: #f8fafc;
  border: 1px solid var(--pay-border);
  border-radius: var(--pay-radius);
  margin-bottom: 12px;
}

.pay-submit-bar__amount {
  text-align: right;
}

.pay-submit-bar__amount span {
  display: block;
  font-size: 13px;
  color: var(--pay-muted);
  margin-bottom: 2px;
}

.pay-submit-bar__amount strong {
  font-size: 28px;
  color: var(--pay-accent);
  font-weight: 700;
}

.pay-submit {
  min-width: 200px;
  height: 50px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(180deg, #ff7a1a 0%, #e64500 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(230, 69, 0, 0.28);
}

.pay-submit:hover {
  filter: brightness(1.05);
  box-shadow: 0 6px 20px rgba(230, 69, 0, 0.35);
}

.pay-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  filter: none;
}

.pay-agree {
  font-size: 12px;
  color: var(--pay-muted);
  text-align: right;
}

/* ── 成功态 ── */
.pay-form-wrap.hidden {
  display: none;
}

.pay-success {
  display: none;
  text-align: center;
  padding: 60px 20px;
  max-width: 520px;
  margin: 0 auto;
}

.pay-success.show {
  display: block;
}

.pay-success__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, #10b981, #059669);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: #fff;
}

.pay-success h2 {
  font-size: 22px;
  margin-bottom: 12px;
}

.pay-success p {
  color: var(--pay-muted);
  font-size: 15px;
  margin-bottom: 12px;
}

.pay-success__order {
  font-size: 14px;
  color: #374151;
  margin-bottom: 8px !important;
}

.pay-success__amount {
  font-size: 15px;
  color: var(--pay-accent);
  font-weight: 600;
  margin-bottom: 28px !important;
}

.pay-success .btn-back {
  display: inline-block;
  padding: 12px 36px;
  background: var(--pay-primary);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-size: 15px;
}

/* ── 页脚 ── */
.pay-footer {
  background: #fff;
  border-top: 1px solid var(--pay-border);
  padding: 18px clamp(20px, 3vw, 48px);
  text-align: center;
  font-size: 13px;
  color: var(--pay-muted);
}

.pay-footer a {
  color: var(--pay-primary);
  text-decoration: none;
}

/* ── Toast ── */
.pay-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1a2233;
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  transition: all 0.3s;
  z-index: 200;
  pointer-events: none;
}

.pay-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── 微信支付二维码弹窗 ── */
.pay-qr-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 20px;
}

.pay-qr-modal[hidden] {
  display: none;
}

.pay-qr-modal__box {
  background: #fff;
  border-radius: 14px;
  padding: 28px 32px 24px;
  width: min(100%, 360px);
  text-align: center;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.pay-qr-modal__close {
  position: absolute;
  right: 12px;
  top: 10px;
  border: none;
  background: none;
  font-size: 24px;
  color: #9ca3af;
  cursor: pointer;
  line-height: 1;
}

.pay-qr-modal__box h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.pay-qr-modal__amount {
  font-size: 28px;
  font-weight: 700;
  color: #e64500;
  margin-bottom: 16px;
}

.pay-qr-modal__canvas-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

#payQrCanvas {
  width: 220px;
  height: 220px;
  background: #fff;
}

#payQrCanvas img,
#payQrCanvas canvas,
#payQrCanvas table {
  display: block;
  margin: 0 auto;
}

.pay-qr-modal__hint {
  font-size: 14px;
  color: #374151;
  margin-bottom: 8px;
}

.pay-qr-modal__order {
  font-size: 12px;
  color: #6b7280;
  word-break: break-all;
}

.pay-qr-modal__status {
  font-size: 13px;
  color: #07c160;
  margin-top: 10px;
  font-weight: 600;
}

/* ── 响应式 ── */
@media (max-width: 960px) {
  .pay-checkout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .pay-order {
    border-right: none;
    border-bottom: 1px solid var(--pay-border);
  }

  .pay-form__grid {
    grid-template-columns: 1fr;
  }

  .pay-wechat-card {
    flex-wrap: wrap;
    gap: 12px;
  }

  .pay-wechat-card__badge {
    width: 100%;
    text-align: center;
  }

  .pay-submit-bar {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .pay-submit-bar__amount {
    text-align: center;
  }

  .pay-submit {
    width: 100%;
  }

  .pay-agree {
    text-align: center;
  }

  .pay-steps li {
    padding-right: 28px;
    font-size: 13px;
  }

  .pay-header__meta .pay-secure-badge {
    display: none;
  }
}
