.checkout-wrapper {
  --dark-green: #064e3b;
  --text-main: #111827;
  --text-muted: #6b7280;
  --border-color: #e5e7eb;
  --alert-red: #b91c1c;
  background: #fff;
  min-height: 100vh;
  padding: 0 24px 50px;
}

.checkout-container {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}

.left-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 24px;
  align-self: start;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  scrollbar-width: none;
}

.right-column {
  position: sticky;
  top: 24px;
  align-self: start;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  scrollbar-width: none;
}

.left-column h2 {
  font-size: 1.15rem;
  margin-bottom: 18px;
  color: var(--dark-green);
}

.address-section {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.address-saved-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f0fdf4;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.selected-addr-display {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  margin: 12px 0;
  position: relative;
}

.sad-name {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.sad-line {
  font-size: 0.85rem;
  line-height: 1.5;
}

.sad-change-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 6px 12px;
  font-size: 0.75rem;
  border: 1px solid var(--border-color);
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
}

.address-toggle-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.hint-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.address-toggle-btn {
  font-size: 0.85rem;
  color: var(--dark-green);
  display: flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: none;
  cursor: pointer;
}

.payment-option-group {
  width: 100%;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.payment-option-group--active {
  border-color: var(--dark-green);
  background: #f0fdf4;
}

.payment-option-group__header {
  width: 100%;
  border: none;
  border-radius: 0;
  background: transparent;
}

.payment-option-group__header.payment-method-option--active {
  border-color: transparent;
  background: transparent;
}

.payment-header {
  padding: 13px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f0fdf4;
  font-weight: 600;
}

.payment-header__label {
  display: flex;
  align-items: center;
  gap: 12px;
}

.paypal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.paypal-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.paypal-preview {
  padding: 16px 0;
  text-align: center;
}

.paypal-hint {
  color: #6b7280;
  margin-bottom: 8px;
}

.paypal-amount strong {
  font-size: 1.25rem;
}

.paypal-buttons-container {
  min-height: 48px;
  padding: 8px 0;
}

.payment-section-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 12px;
}

.payment-section-card {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  border: 1px solid var(--dark-green);
  box-shadow: 0 0 0 1px var(--dark-green), 0 4px 20px rgba(0, 0, 0, 0.05);
}

.payment-method-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.payment-option-group__chevron {
  flex-shrink: 0;
  color: #9ca3af;
  transition: transform 0.2s ease;
}

.payment-option-group__chevron--open {
  transform: rotate(180deg);
  color: var(--dark-green);
}

.payment-alipay-dropdown {
  padding: 0;
  border-top: 1px solid var(--border-color);
  background: #fff;
}

.payment-alipay-dropdown .paypal-container--checkout {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.payment-paypal-dropdown {
  padding: 0;
  border-top: 1px solid var(--border-color);
  background: #fff;
}

.paypal-container--checkout {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 20px 18px 18px;
  border: none;
  border-radius: 0;
  box-sizing: border-box;
}

.paypal-box--reserved {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 180px;
  min-height: 180px;
  margin: 0 auto;
  padding: 16px;
  background: #f9fafb;
  border: 1px dashed #e5e7eb;
  border-radius: 8px;
  box-sizing: border-box;
}

.paypal-box--checkout-active {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 320px;
  min-height: auto;
  margin: 0 auto;
  padding: 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-sizing: border-box;
}

.paypal-box--checkout-active .alipay-qr-card {
  width: 100%;
}

.paypal-box--checkout-active .alipay-qr-card .qr-frame {
  width: 100%;
  display: flex;
  justify-content: center;
}

.paypal-box--checkout-active .alipay-qr-card .qr-inner {
  width: auto;
  max-width: 100%;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

.paypal-box--checkout-active .alipay-qr-card .qr-order-no {
  margin: 0 0 12px;
  text-align: center;
}

.paypal-box--checkout-active .alipay-qr-card .qr-image-wrap {
  display: flex;
  justify-content: center;
  padding: 0;
}

.paypal-box--checkout-active .alipay-qr-card .alipay-qr-image {
  display: block;
}

.paypal-box--checkout-active .alipay-qr-card .alipay-iframe {
  width: 100%;
  min-width: 280px;
  max-width: 300px;
  height: 360px;
  margin: 0 auto;
  border: none;
  background: #fff;
  display: block;
}

.paypal-box__placeholder-text {
  font-size: 0.75rem;
  color: #9ca3af;
  text-align: center;
  padding: 0 8px;
  line-height: 1.4;
}

.paypal-box--paypal-buttons {
  width: 100%;
  max-width: 360px;
  min-height: 120px;
}

.paypal-box--paypal-buttons .paypal-buttons-container {
  width: 100%;
  min-height: 44px;
}

.paypal-buttons-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 120px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.paypal-actions-hint {
  flex: 1;
  text-align: right;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  max-width: 280px;
}

.paypal-preview .paypal-amount strong {
  color: #ff4d4f;
}

.qr-container--checkout {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 20px 18px 18px;
  border: none;
  border-radius: 0;
  box-sizing: border-box;
}

.qr-box--reserved {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9fafb;
  border-style: dashed;
}

.qr-box__placeholder-text {
  font-size: 0.75rem;
  color: #9ca3af;
  text-align: center;
  padding: 0 12px;
  line-height: 1.4;
}

.alipay-qr-card {
  width: 100%;
}

.alipay-qr-card .qr-frame {
  display: flex;
  justify-content: center;
}

.alipay-qr-card .qr-inner {
  width: 100%;
  max-width: 360px;
}

.qr-placeholder {
  width: 160px;
  height: 160px;
  margin: 0 auto;
  background: #f3f4f6;
  border-radius: 8px;
}

.qr-order-no {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-align: center;
}

.qr-footer {
  margin-top: 12px;
}

.qr-loading {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
}

.payment-method-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}

.payment-method-option__label {
  flex: 1;
  font-weight: 500;
}

.payment-method-option--active {
  border-color: var(--dark-green);
  background: #f0fdf4;
}

.payment-method-option__icon {
  flex-shrink: 0;
}

.radio-dot--active {
  border-color: var(--dark-green);
  background: var(--dark-green);
  box-shadow: inset 0 0 0 3px #fff;
}

.alipay-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.alipay-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.alipay-icon--lg {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
}

.radio-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
}

.radio-dot.active {
  border-color: var(--dark-green);
  background: var(--dark-green);
}

.payment-content {
  padding: 15px 18px;
  border-top: 1px solid var(--border-color);
}

.alipay-preview {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
}

.alipay-hint {
  margin: 14px 0 8px;
  font-size: 0.9rem;
}

.alipay-amount strong {
  color: #ff4d4f;
}

.qr-container {
  text-align: center;
  max-width: 320px;
  margin: 0 auto;
  padding: 25px;
  border: 1px solid #eef2f7;
  border-radius: 12px;
}

.qr-box {
  width: 180px;
  height: 180px;
  margin: 0 auto 15px;
  padding: 10px;
  border: 1px solid #eee;
  position: relative;
}

.scan-line {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 2px;
  background: #00a1e9;
  animation: checkout-scan 2s infinite;
  z-index: 2;
  pointer-events: none;
}

@keyframes checkout-scan {
  0% {
    top: 0;
  }
  100% {
    top: 100%;
  }
}

.alipay-iframe {
  width: 100%;
  min-width: 280px;
  height: 360px;
  border: none;
  background: #fff;
}

.alipay-qr-card .qr-image-wrap {
  display: flex;
  justify-content: center;
  padding: 8px 0 4px;
}

.alipay-qr-card .alipay-qr-image {
  width: 200px;
  height: 200px;
  object-fit: contain;
  border: 1px solid #eee;
  border-radius: 8px;
  background: #fff;
}

.pay-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 12px 0;
}

.qr-hint {
  font-size: 0.75rem;
  color: #999;
  margin: 0;
  white-space: nowrap;
  text-align: center;
  width: 100%;
}

.btn-cancel-qr {
  margin-top: 10px;
  width: 100%;
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
}

.action-container {
  margin-top: 30px;
  padding-top: 25px;
  border-top: 1px solid var(--border-color);
}

.btn-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.btn-back {
  color: var(--text-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-back--disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-pay {
  color: #fff;
  background: var(--dark-green);
  border: none;
  padding: 12px 30px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  min-width: 200px;
}

.btn-pay:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.security-badge {
  display: flex;
  justify-content: center;
  margin-top: 15px;
  font-size: 0.75rem;
  color: var(--text-muted);
  width: 100%;
}

.security-badge--inline {
  margin-top: 0;
}

.security-badge-line--single {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  max-width: 100%;
  white-space: nowrap;
  line-height: 1.5;
  overflow-x: auto;
  scrollbar-width: none;
}

.security-badge-icon {
  flex-shrink: 0;
}

.security-badge-text {
  flex: 0 1 auto;
  min-width: 0;
}

.security-badge-line--single::-webkit-scrollbar {
  display: none;
}

.qr-footer-notices {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 4px;
}

.order-summary {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  border: 1px solid var(--dark-green);
  box-shadow: 0 0 0 1px var(--dark-green), 0 4px 20px rgba(0, 0, 0, 0.05);
  width: 100%;
}

.order-summary h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 600;
}

.product-item {
  display: flex;
  gap: 15px;
  padding: 15px 0;
  border-bottom: 1px solid #f3f4f6;
}

.product-img {
  width: 75px;
  height: 106px;
  border-radius: 4px;
  object-fit: cover;
  background: #eee;
  flex-shrink: 0;
}

.product-info {
  flex: 1;
  min-width: 0;
}

.p-title {
  font-weight: 700;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.p-composer {
  color: var(--text-muted);
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toggle-btn {
  width: 100%;
  padding: 10px;
  margin: 15px 0;
  border: 1px solid #ddd;
  background: #f9f9f9;
  cursor: pointer;
  font-size: 0.85rem;
}

.price-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.price-row-order-no {
  padding: 10px 0;
  border-bottom: 1px dashed #e2e8f0;
}

.price-row.total {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--dark-green);
  border-top: 1px solid var(--border-color);
  padding-top: 15px;
  margin-top: 15px;
}

.price-discount {
  color: var(--alert-red);
}

.free-ship {
  color: var(--dark-green);
  font-weight: 600;
}

.addr-card-list {
  margin-bottom: 16px;
}

.addr-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px 16px 16px 40px;
  margin-bottom: 12px;
  cursor: pointer;
  position: relative;
}

.addr-card.selected {
  border-color: var(--dark-green);
  background: #f0fdf4;
}

.addr-card-radio {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-color);
  border-radius: 50%;
}

.addr-card.selected .addr-card-radio {
  border-color: var(--dark-green);
  background: var(--dark-green);
}

.addr-default-tag {
  background: var(--dark-green);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
}

.addr-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.addr-action-btn {
  padding: 4px 8px;
  font-size: 0.75rem;
  border: 1px solid var(--border-color);
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
}

.addr-action-btn.delete {
  color: var(--alert-red);
  border-color: var(--alert-red);
}

.addr-add-section {
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

.addr-add-title {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.modal-form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.modal-form-group {
  flex: 1;
  min-width: 120px;
}

.modal-form-group label {
  display: block;
  font-size: 0.78rem;
  margin-bottom: 5px;
  color: var(--text-muted);
}

.modal-form-group input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.88rem;
}

.modal-field-error {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: #dc2626;
}

.modal-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  font-size: 0.85rem;
}

.modal-btn-save {
  width: 100%;
  padding: 10px 16px;
  background: var(--dark-green);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

/* 结账地址簿 Dialog（对齐 Vue CheckoutView Modal width=600） */
.checkout-dialog-overlay[data-slot='dialog-overlay'] {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
}

.checkout-address-dialog[data-slot='dialog-content'] {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 601;
  translate: -50% -50%;
  display: flex;
  flex-direction: column;
  width: calc(100% - 32px);
  max-width: 600px;
  max-height: min(90vh, 720px);
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  ring: none;
  outline: none;
  animation: checkoutDialogIn 0.25s ease-out;
}

.checkout-address-dialog [data-slot='dialog-header'] {
  padding: 20px 24px 12px;
  border-bottom: 1px solid var(--border-color);
}

.checkout-address-dialog [data-slot='dialog-title'] {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.checkout-address-dialog__footer[data-slot='dialog-footer'] {
  margin: 0;
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  background: #f8fafc;
  flex-direction: row;
  justify-content: flex-end;
  gap: 10px;
  border-radius: 0;
}

.checkout-dialog-btn {
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  border: 1px solid var(--border-color);
  background: #fff;
  color: var(--text-main);
}

.checkout-dialog-btn--primary {
  background: var(--dark-green);
  border-color: var(--dark-green);
  color: #fff;
}

.checkout-dialog-btn--primary:hover {
  filter: brightness(0.95);
}

.checkout-dialog-btn--outline:hover {
  background: #f1f5f9;
}

@keyframes checkoutDialogIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 960px) {
  .checkout-container {
    grid-template-columns: 1fr;
  }
  .left-column,
  .right-column {
    position: static;
    max-height: none;
  }
  .order-summary {
    width: 100%;
  }
}

