/* 支付页样式（沿用主站设计语言） */

.payment-page {
  padding: 120px 24px 80px;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.payment-page::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--primary-glow), transparent 70%);
  filter: blur(80px);
  z-index: -1;
}

.payment-container {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

/* 步骤指示器 */
.payment-steps {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 40px;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}

.step span {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.step p {
  font-size: 0.85rem;
}

.step.active span {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: #000;
  box-shadow: 0 0 16px var(--primary-glow);
}

.step.active p {
  color: var(--text-heading);
  font-weight: 600;
}

.step.done span {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
}

.step.done p {
  color: var(--text-main);
}

.step-line {
  width: 80px;
  height: 2px;
  background-color: var(--border-color);
  margin-bottom: 28px;
}

.step-line.done {
  background-color: var(--accent-color);
}

.payment-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 8px;
}

.payment-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 48px;
}

/* 主体网格 */
.payment-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 28px;
  align-items: start;
}

/* 订单卡片 */
.order-card,
.pay-card,
.amount-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 28px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
  font-size: 1.15rem;
}

.order-no {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: 'Consolas', monospace;
}

.order-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
}

.order-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 16px;
  padding: 16px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: border-color var(--transition-fast);
}

.order-item:hover {
  border-color: var(--primary-color);
}

.item-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, rgba(88,166,255,0.15), rgba(46,160,67,0.1));
  border: 1px solid var(--border-color);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
}

.item-info h4 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.item-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.item-tag {
  display: inline-block;
  padding: 2px 10px;
  font-size: 0.75rem;
  background-color: rgba(46,160,67,0.15);
  border: 1px solid rgba(46,160,67,0.4);
  color: var(--accent-color);
  border-radius: 12px;
}

.item-meta {
  text-align: right;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
}

.item-meta .qty {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.item-meta .price {
  color: var(--text-heading);
  font-weight: 600;
  font-size: 1.05rem;
}

/* 客户信息 */
.customer-info {
  border-top: 1px dashed var(--border-color);
  padding-top: 24px;
}

.customer-info h4 {
  font-size: 1rem;
  margin-bottom: 16px;
  color: var(--text-heading);
}

.info-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  align-items: center;
  margin-bottom: 12px;
  gap: 12px;
}

.info-row label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.info-row input,
.info-row select,
.info-row textarea {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 12px;
  border-radius: 8px;
  font-family: var(--font-family);
  font-size: 0.9rem;
  width: 100%;
  transition: border-color var(--transition-fast);
}

.info-row textarea {
  min-height: 60px;
  resize: vertical;
}

.info-row input:focus,
.info-row select:focus,
.info-row textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* 右侧栏 */
.payment-aside {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 100px;
}

.pay-card h3 {
  font-size: 1.15rem;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.pay-method {
  display: grid;
  grid-template-columns: auto 48px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 12px;
  transition: all var(--transition-fast);
  background-color: var(--bg-tertiary);
}

.pay-method input[type=radio] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  position: relative;
  transition: border-color var(--transition-fast);
  cursor: pointer;
}

.pay-method input[type=radio]:checked {
  border-color: var(--primary-color);
}

.pay-method input[type=radio]:checked::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 8px;
  height: 8px;
  background-color: var(--primary-color);
  border-radius: 50%;
}

.method-logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.method-info h5 {
  font-size: 0.95rem;
  margin-bottom: 2px;
  color: var(--text-heading);
}

.method-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.check-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: transparent;
  color: transparent;
  text-align: center;
  font-size: 0.85rem;
  line-height: 22px;
  font-weight: 700;
  transition: all var(--transition-fast);
}

.pay-method.active {
  border-color: var(--primary-color);
  background-color: rgba(88, 166, 255, 0.08);
  box-shadow: 0 0 0 1px var(--primary-color);
}

.pay-method.active .check-mark {
  background-color: var(--primary-color);
  color: #000;
}

.pay-method.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* 金额卡片 */
.amount-card {
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
}

.amount-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 0.95rem;
  color: var(--text-main);
}

.amount-row .discount {
  color: #f78166;
}

.amount-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 12px 0;
}

.amount-row.total {
  font-size: 1rem;
  margin-top: 8px;
}

.amount-row.total .total-price {
  color: var(--primary-color);
  font-size: 1.4rem;
  font-weight: 700;
}

.amount-row.total .total-price strong {
  font-size: 1.8rem;
  font-weight: 700;
  margin-left: 2px;
}

.pay-btn {
  width: 100%;
  margin-top: 20px;
  font-size: 1.05rem;
  padding: 16px;
}

.security-tip {
  margin-top: 14px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.agreement-tip {
  text-align: center;
  margin-top: 32px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.agreement-tip a {
  color: var(--primary-color);
}

/* 二维码弹窗 */
.qr-modal {
  position: fixed;
  inset: 0;
  background-color: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.qr-modal.show {
  display: flex;
  animation: qrFadeIn 0.25s ease;
}

@keyframes qrFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.qr-content {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  position: relative;
}

.qr-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}

.qr-close:hover {
  color: var(--text-heading);
}

.qr-brand-tag {
  display: inline-block;
  padding: 4px 12px;
  background-color: rgba(22, 119, 255, 0.15);
  color: #1677FF;
  border: 1px solid rgba(22, 119, 255, 0.4);
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.qr-header h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.qr-amount {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.qr-amount strong {
  font-size: 1.6rem;
}

.qr-box {
  background-color: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.qr-image {
  width: 220px;
  height: 220px;
  margin: 0 auto;
  position: relative;
  background-image:
    radial-gradient(#000 35%, transparent 36%),
    radial-gradient(#000 35%, transparent 36%);
  background-size: 8px 8px, 12px 12px;
  background-position: 0 0, 4px 4px;
  background-color: #fff;
  border: 1px solid #eee;
}

.qr-finder {
  position: absolute;
  width: 48px;
  height: 48px;
  background-color: #fff;
  border: 8px solid #000;
  box-shadow: inset 0 0 0 8px #fff, inset 0 0 0 16px #000;
}

.qr-finder.tl { top: 8px; left: 8px; }
.qr-finder.tr { top: 8px; right: 8px; }
.qr-finder.bl { bottom: 8px; left: 8px; }

.qr-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  background-color: #1677FF;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 4px #fff;
}

.qr-tip {
  margin-top: 12px;
  color: #666;
  font-size: 0.85rem;
}

.qr-tip span {
  color: #f5222d;
  font-weight: 600;
}

.qr-steps {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
}

/* 响应式 */
@media (max-width: 992px) {
  .payment-grid {
    grid-template-columns: 1fr;
  }
  .payment-aside {
    position: static;
  }
}

@media (max-width: 768px) {
  .payment-page {
    padding: 100px 16px 40px;
  }
  .order-card,
  .pay-card,
  .amount-card {
    padding: 20px;
  }
  .order-item {
    grid-template-columns: 48px 1fr;
  }
  .item-meta {
    grid-column: 2;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }
  .step-line {
    width: 40px;
  }
  .info-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
