/* Membership Orders page specific */
.membership-orders {
  padding: 28px 32px 34px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.membership-orders__table {
  border: 1px solid #e2e6f2;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  position: relative;
}

.membership-orders__table table {
  width: 100%;
  border-collapse: collapse;
}

.membership-orders__table th,
.membership-orders__table td {
  padding: 16px 18px;
  font-size: 14px;
  border-bottom: 1px solid #edf0f7;
  color: #42485b;
}

.membership-orders__table thead th {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #98a1b3;
  background: #f6f8fb;
}

.membership-orders__table tbody tr:last-child td {
  border-bottom: none;
}

/* Pagination uses global styles from common.css; only keep container spacing if needed */
.membership-pagination {
  margin-top: 20px;
  padding-bottom: 8px;
}

/* Status chips by payment status */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  background: #e8ebf3;
  color: #475065;
}

.status-pill--pending {
  background: #fff6e5;
  color: #b77000;
}

.status-pill--paid {
  background: #e7f6ef;
  color: #1b7b45;
}

.status-pill--cancelled {
  background: #f2f3f7;
  color: #5a6275;
}

.status-pill--failed {
  background: #ffe8e8;
  color: #c53030;
}

.status-pill--refunded {
  background: #e8f2ff;
  color: #1a64c7;
}

/* Order action buttons */
.order-action {
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
}

.order-action--primary {
  color: #0b61aa;
}

.order-action--secondary {
  color: #7a8092;
}

.order-action--default {
  color: #1f2640;
}

/* Order action buttons - text only */
.order-action {
  border: none;
  background: none;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease;
}

.order-action--primary {
  color: #0b61aa;
}

.order-action--primary:hover {
  color: #0a5299;
}

.order-action--secondary {
  color: #667082;
}

.order-action--secondary:hover {
  color: #4a5165;
}

.order-action--default {
  color: #667082;
}

.order-action--default:hover {
  color: #4a5165;
}

/* Payment Modal */
.payment-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.payment-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.payment-modal__content {
  position: relative;
  z-index: 1001;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.payment-modal__header {
  padding: 24px 28px;
  border-bottom: 1px solid #e2e6f2;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.payment-modal__header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1f2640;
}

.payment-modal__close {
  background: none;
  border: none;
  font-size: 28px;
  color: #98a1b3;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.payment-modal__close:hover {
  color: #42485b;
}

.payment-modal__body {
  padding: 28px;
  flex: 1;
}

.payment-options {
  display: flex;
  flex-direction: row;
  gap: 24px;
  justify-content: center;
  align-items: center;
}

.payment-option {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.payment-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  margin: 0;
}

.payment-option__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: #f6f8fb;
  border-radius: 12px;
  flex-shrink: 0;
  border: 2px solid #e2e6f2;
  transition: all 0.2s ease;
}

.payment-option__icon img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.payment-option:hover .payment-option__icon {
  border-color: #d0d5e8;
  background: #f0f6ff;
}

.payment-option--active .payment-option__icon {
  border-color: #0b61aa;
  background: #f0f6ff;
  box-shadow: 0 0 0 3px rgba(11, 97, 170, 0.1);
}

.payment-modal__footer {
  padding: 20px 28px;
  border-top: 1px solid #e2e6f2;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.payment-modal__cancel,
.payment-modal__confirm {
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.payment-modal__cancel {
  background: #f0f2f7;
  color: #667082;
}

.payment-modal__cancel:hover {
  background: #e2e6f2;
}

.payment-modal__confirm {
  background: #0b61aa;
  color: white;
}

.payment-modal__confirm:hover {
  background: #0a5299;
}

/* Invoice Modal */
.invoice-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.invoice-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.invoice-modal__content {
  position: relative;
  z-index: 1001;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.invoice-modal__header {
  padding: 24px 28px;
  border-bottom: 1px solid #e2e6f2;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.invoice-modal__header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1f2640;
}

.invoice-modal__close {
  background: none;
  border: none;
  font-size: 28px;
  color: #98a1b3;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.invoice-modal__close:hover {
  color: #42485b;
}

.invoice-modal__body {
  padding: 28px;
  flex: 1;
}

.invoice-modal__body .form-group {
  margin-bottom: 20px;
}

.invoice-modal__body .form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #1f2640;
}

.invoice-modal__body .form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2e6f2;
  border-radius: 8px;
  font-size: 14px;
  color: #42485b;
  transition: border-color 0.2s ease;
}

.invoice-modal__body .form-group input:focus {
  outline: none;
  border-color: #0b61aa;
  box-shadow: 0 0 0 3px rgba(11, 97, 170, 0.1);
}

.invoice-modal__footer {
  padding: 20px 28px;
  border-top: 1px solid #e2e6f2;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.invoice-modal__cancel,
.invoice-modal__confirm {
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.invoice-modal__cancel {
  background: #f0f2f7;
  color: #667082;
}

.invoice-modal__cancel:hover {
  background: #e2e6f2;
}

.invoice-modal__confirm {
  background: #0b61aa;
  color: white;
}

.invoice-modal__confirm:hover {
  background: #0a5299;
}

/* Invoice Record Modal */
.invoice-record-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.invoice-record-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.invoice-record-modal__content {
  position: relative;
  z-index: 1001;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  width: 90%;
  max-width: 900px;
  max-height: 80vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.invoice-record-modal__header {
  padding: 24px 28px;
  border-bottom: 1px solid #e2e6f2;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.invoice-record-modal__header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1f2640;
}

.invoice-record-modal__close {
  background: none;
  border: none;
  font-size: 28px;
  color: #98a1b3;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.invoice-record-modal__close:hover {
  color: #42485b;
}

.invoice-record-modal__body {
  padding: 28px;
  flex: 1;
  overflow-x: auto;
}

.invoice-record-table {
  width: 100%;
  border-collapse: collapse;
}

.invoice-record-table th,
.invoice-record-table td {
  padding: 12px 16px;
  font-size: 14px;
  border-bottom: 1px solid #edf0f7;
  color: #42485b;
  text-align: left;
}

.invoice-record-table thead th {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #98a1b3;
  background: #f6f8fb;
  font-weight: 600;
}

.invoice-record-table tbody tr:last-child td {
  border-bottom: none;
}

.invoice-record-table a {
  color: #0b61aa;
  text-decoration: none;
  transition: color 0.2s ease;
}

.invoice-record-table a:hover {
  color: #0a5299;
}

.invoice-record-modal__footer {
  padding: 20px 28px;
  border-top: 1px solid #e2e6f2;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.invoice-record-modal__close-btn {
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: #f0f2f7;
  color: #667082;
  transition: all 0.2s ease;
}

.invoice-record-modal__close-btn:hover {
  background: #e2e6f2;
}

/* Payment Detail Modal Styles */
.payment-detail-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.payment-detail-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.payment-detail-modal__content {
  position: relative;
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.payment-detail-modal__header {
  padding: 24px 28px;
  border-bottom: 1px solid #e2e6f2;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.payment-detail-modal__header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1a202c;
}

.payment-detail-modal__close {
  background: none;
  border: none;
  font-size: 28px;
  color: #98a1b3;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.payment-detail-modal__close:hover {
  color: #42485b;
}

.payment-detail-modal__body {
  padding: 28px;
}

.payment-detail-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.payment-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f0f2f7;
}

.payment-detail-row:last-child {
  border-bottom: none;
}

.payment-detail-label {
  font-size: 14px;
  font-weight: 600;
  color: #667082;
}

.payment-detail-value {
  font-size: 14px;
  color: #42485b;
  font-weight: 500;
}

.payment-detail-modal__footer {
  padding: 20px 28px;
  border-top: 1px solid #e2e6f2;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.payment-detail-modal__close-btn {
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: #f0f2f7;
  color: #667082;
  transition: all 0.2s ease;
}

.payment-detail-modal__close-btn:hover {
  background: #e2e6f2;
}

/* Invoice Action Button Styles */
.invoice-action-btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: #f0f2f7;
  color: #0b61aa;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
}

.invoice-action-btn:hover {
  background: #e2e6f2;
  color: #0a5299;
}

.invoice-action-btn--danger {
  color: #d32f2f;
}

.invoice-action-btn--danger:hover {
  background: #ffebee;
  color: #c62828;
}

/* ==================== */
/* 移动端响应式适配 */
/* ==================== */

@media (max-width: 768px) {

  /* 订单容器 */
  .membership-orders {
    padding: 16px;
  }

  /* 表格切换为卡片布局 */
  .membership-orders__table {
    border: none;
    border-radius: 0;
    background: transparent;
  }

  .membership-orders__table table {
    display: block;
  }

  .membership-orders__table thead {
    display: none;
    /* 隐藏表头 */
  }

  .membership-orders__table tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .membership-orders__table tbody tr {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e2e6f2;
    border-radius: 12px;
    padding: 16px;
    gap: 12px;
  }

  .membership-orders__table tbody tr:last-child td {
    border-bottom: 1px solid #edf0f7;
  }

  .membership-orders__table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f2f7;
  }

  .membership-orders__table td:last-child {
    border-bottom: none;
    padding-top: 12px;
  }

  /* 为每个单元格添加标签 */
  .membership-orders__table td::before {
    content: attr(data-label);
    font-size: 12px;
    font-weight: 600;
    color: #98a1b3;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  /* 操作列样式 */
  .membership-orders__table td:last-child {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .membership-orders__table td:last-child::before {
    display: block;
    width: 100%;
    margin-bottom: 4px;
  }

  /* 操作按钮容器 */
  .order-actions-mobile {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  .order-action {
    flex: 1;
    min-width: 80px;
    text-align: center;
    padding: 8px 12px;
    background: #f6f8fb;
    border-radius: 6px;
  }

  /* Tabs 行 */
  .membership-tabs-row {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
  }

  .membership-tabs__actions {
    width: 100%;
  }

  .membership-tabs__actions .usercenter-btn {
    width: 100%;
  }

  /* 弹窗适配 */
  .payment-modal__content,
  .invoice-modal__content,
  .invoice-record-modal__content,
  .payment-detail-modal__content {
    width: 95%;
    max-height: 90vh;
    margin: 10px;
  }

  .payment-options {
    flex-direction: column;
    gap: 16px;
  }

  .payment-option__icon {
    width: 100%;
    height: 60px;
  }

  /* 开票记录弹窗表格 */
  .invoice-record-modal__body {
    padding: 16px;
  }

  .invoice-record-table thead {
    display: none;
  }

  .invoice-record-table tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .invoice-record-table tbody tr {
    display: flex;
    flex-direction: column;
    background: #f6f8fb;
    border-radius: 8px;
    padding: 12px;
    gap: 8px;
  }

  .invoice-record-table td {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #edf0f7;
  }

  .invoice-record-table td:last-child {
    border-bottom: none;
  }

  .invoice-record-table td::before {
    content: attr(data-label);
    font-size: 12px;
    font-weight: 600;
    color: #98a1b3;
  }
}