/* Manual review results stay visible while scanning dense order lists. */
.responsive-table tbody tr.xb-order-reviewed--received {
  background: rgba(16, 185, 129, 0.055);
  box-shadow: inset 3px 0 0 #10b981;
}

.responsive-table tbody tr.xb-order-reviewed--not-received {
  background: rgba(244, 63, 94, 0.055);
  box-shadow: inset 3px 0 0 #f43f5e;
}

.responsive-table tbody tr.xb-order-reviewed--received > td.sticky {
  background: #f2fcf7;
}

.responsive-table tbody tr.xb-order-reviewed--not-received > td.sticky {
  background: #fff6f7;
}

.dark .responsive-table tbody tr.xb-order-reviewed--received,
.dark .responsive-table tbody tr.xb-order-reviewed--received > td.sticky {
  background: rgba(16, 185, 129, 0.09);
}

.dark .responsive-table tbody tr.xb-order-reviewed--not-received,
.dark .responsive-table tbody tr.xb-order-reviewed--not-received > td.sticky {
  background: rgba(244, 63, 94, 0.09);
}

.xb-order-source-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid hsl(var(--border));
  border-radius: 6px;
  background: hsl(var(--muted) / 0.55);
  color: hsl(var(--foreground) / 0.72);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.xb-order-payment,
.xb-order-timeline,
.xb-order-client {
  min-width: 0;
}

.xb-order-timeline {
  white-space: normal !important;
}

.xb-orders-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  background: hsl(var(--card));
}

.xb-orders-summary-item {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 88px;
  align-content: center;
  gap: 3px;
  padding: 14px 18px 14px 21px;
}

.xb-orders-summary-item + .xb-orders-summary-item {
  border-left: 1px solid hsl(var(--border));
}

.xb-orders-summary-item::before {
  position: absolute;
  inset: 18px auto 18px 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #64748b;
  content: "";
}

.xb-orders-summary-item--reviewed::before {
  background: #10b981;
}

.xb-orders-summary-item--pending::before {
  background: #f59e0b;
}

.xb-orders-summary-item span,
.xb-orders-summary-item small {
  color: hsl(var(--foreground) / 0.5);
  font-size: 12px;
  line-height: 1.25;
}

.xb-orders-summary-item strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: hsl(var(--foreground));
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
}

.xb-orders-summary-item--reviewed strong {
  color: #047857;
}

.xb-orders-summary-item--pending strong {
  color: #b45309;
}

.dark .xb-orders-summary-item--reviewed strong {
  color: #34d399;
}

.dark .xb-orders-summary-item--pending strong {
  color: #fbbf24;
}

@media (max-width: 640px) {
  .xb-orders-summary-item {
    min-height: 76px;
    padding: 11px 9px 11px 12px;
  }

  .xb-orders-summary-item::before {
    inset-block: 14px;
  }

  .xb-orders-summary-item strong {
    font-size: 15px;
  }

  .xb-orders-summary-item span,
  .xb-orders-summary-item small {
    font-size: 11px;
  }
}

@media (min-width: 1400px) {
  .xb-orders-table {
    width: 100%;
    min-width: 100%;
    table-layout: fixed;
  }

  .xb-orders-table th:nth-child(1),
  .xb-orders-table td:nth-child(1) { width: 3%; }
  .xb-orders-table th:nth-child(2),
  .xb-orders-table td:nth-child(2) { width: 20%; }
  .xb-orders-table th:nth-child(3),
  .xb-orders-table td:nth-child(3) { width: 9%; }
  .xb-orders-table th:nth-child(4),
  .xb-orders-table td:nth-child(4) { width: 13%; }
  .xb-orders-table th:nth-child(5),
  .xb-orders-table td:nth-child(5) { width: 7%; }
  .xb-orders-table th:nth-child(6),
  .xb-orders-table td:nth-child(6) { width: 9%; }
  .xb-orders-table th:nth-child(7),
  .xb-orders-table td:nth-child(7) { width: 7%; }
  .xb-orders-table th:nth-child(8),
  .xb-orders-table td:nth-child(8) { width: 12%; }
  .xb-orders-table th:nth-child(9),
  .xb-orders-table td:nth-child(9) { width: 11%; }
  .xb-orders-table th:nth-child(10),
  .xb-orders-table td:nth-child(10) { width: 9%; }

  .xb-orders-table td {
    overflow: hidden;
  }

  .xb-orders-table .text-xs {
    font-size: 13px !important;
    line-height: 1.4 !important;
  }

  .xb-orders-table .text-\[11px\] {
    font-size: 12px !important;
    line-height: 1.4 !important;
  }

  .xb-orders-table .text-\[10px\] {
    font-size: 11px !important;
    line-height: 1.4 !important;
  }

  .xb-orders-table .xb-order-source-pill {
    font-size: 12px;
  }

  .xb-orders-table .xb-order-account {
    overflow: visible;
    white-space: normal;
    overflow-wrap: anywhere;
    text-overflow: clip;
  }
}

@media (max-width: 1399px) {
  .xb-orders-table,
  .xb-orders-table tbody,
  .xb-orders-table tr,
  .xb-orders-table td {
    display: block;
    width: 100%;
  }

  .xb-orders-table thead {
    display: none;
  }

  .xb-orders-table tbody {
    display: grid;
    gap: 10px;
    padding: 1px;
  }

  .xb-orders-table tbody tr {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto auto auto auto auto;
    column-gap: 14px;
    padding: 12px;
    overflow: hidden;
    border: 1px solid hsl(var(--border));
    border-radius: 8px;
    background: hsl(var(--card));
  }

  .xb-orders-table tbody td {
    display: block;
    min-width: 0;
    min-height: 0;
    max-width: none;
    padding: 8px 0 !important;
    overflow: hidden;
    border: 0 !important;
    text-align: left;
  }

  .xb-orders-table tbody td::before {
    display: block;
    margin-bottom: 4px;
    color: hsl(var(--foreground) / 0.48);
    content: attr(data-label);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
  }

  .xb-orders-table tbody td[data-primary="true"] {
    grid-column: 1 / -1;
    grid-row: 1;
    padding: 0 38px 10px 0 !important;
    margin: 0;
    border-bottom: 1px solid hsl(var(--border)) !important;
  }

  .xb-orders-table tbody td[data-primary="true"]::before,
  .xb-orders-table tbody td[data-label="选择"]::before {
    display: none;
  }

  .xb-orders-table tbody td[data-label="选择"] {
    position: absolute;
    top: 13px;
    right: 13px;
    z-index: 2;
    width: auto;
    padding: 0 !important;
  }

  .xb-orders-table tbody td[data-label="来源"] {
    grid-column: 1;
    grid-row: 2;
  }

  .xb-orders-table tbody td[data-label="核销 / 商户"] {
    grid-column: 2;
    grid-row: 2;
  }

  .xb-orders-table tbody td[data-label="项目 / 充值账号"] {
    grid-column: 1 / -1;
    grid-row: 3;
    border-top: 1px dashed hsl(var(--border)) !important;
    border-bottom: 1px dashed hsl(var(--border)) !important;
  }

  .xb-orders-table tbody td[data-label="支付"] {
    grid-column: 1;
    grid-row: 4;
  }

  .xb-orders-table tbody td[data-label="状态"] {
    grid-column: 2;
    grid-row: 4;
  }

  .xb-orders-table tbody td[data-label="IP / 设备"] {
    grid-column: 1;
    grid-row: 5;
  }

  .xb-orders-table tbody td[data-label="时间"] {
    grid-column: 2;
    grid-row: 5;
  }

  .xb-orders-table tbody td[data-label="操作"] {
    grid-column: 1 / -1;
    grid-row: 6;
    padding: 6px 0 0 !important;
    background: transparent !important;
  }

  .xb-orders-table tbody td[data-label="操作"]::before {
    display: none;
  }

  .xb-orders-table tbody td[data-label="操作"] > div {
    justify-content: flex-end;
  }

  .xb-orders-table .xb-order-cell p,
  .xb-orders-table .xb-order-client p,
  .xb-orders-table .xb-order-timeline p {
    line-height: 1.35;
  }

  .xb-orders-table .xb-order-status {
    justify-items: start;
  }

  .xb-orders-table .xb-order-status > * {
    width: auto !important;
    max-width: 100%;
  }

  .xb-orders-table .text-xs {
    font-size: 13px !important;
    line-height: 1.4 !important;
  }

  .xb-orders-table .text-\[11px\] {
    font-size: 12px !important;
    line-height: 1.4 !important;
  }

  .xb-orders-table .text-\[10px\] {
    font-size: 11px !important;
    line-height: 1.4 !important;
  }

  .xb-orders-table .xb-order-source-pill {
    font-size: 12px;
  }

  .xb-orders-table input[type="checkbox"] {
    width: 16px;
    height: 16px;
  }
}

@media (min-width: 900px) and (max-width: 1399px) {
  .xb-orders-filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .xb-orders-table tbody tr {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: auto auto auto auto;
  }

  .xb-orders-table tbody td[data-label="来源"] {
    grid-column: 1;
    grid-row: 2;
  }

  .xb-orders-table tbody td[data-label="项目 / 充值账号"] {
    grid-column: 2 / 4;
    grid-row: 2;
    border-top: 0 !important;
    border-bottom: 0 !important;
  }

  .xb-orders-table tbody td[data-label="核销 / 商户"] {
    grid-column: 4;
    grid-row: 2;
  }

  .xb-orders-table tbody td[data-label="支付"] {
    grid-column: 1;
    grid-row: 3;
    border-top: 1px dashed hsl(var(--border)) !important;
  }

  .xb-orders-table tbody td[data-label="状态"] {
    grid-column: 2;
    grid-row: 3;
    border-top: 1px dashed hsl(var(--border)) !important;
  }

  .xb-orders-table tbody td[data-label="IP / 设备"] {
    grid-column: 3;
    grid-row: 3;
    border-top: 1px dashed hsl(var(--border)) !important;
  }

  .xb-orders-table tbody td[data-label="时间"] {
    grid-column: 4;
    grid-row: 3;
    border-top: 1px dashed hsl(var(--border)) !important;
  }

  .xb-orders-table tbody td[data-label="操作"] {
    grid-row: 4;
  }
}

@media (max-width: 899px) {
  .xb-orders-table tbody tr {
    column-gap: 10px;
    padding: 10px;
  }

  .xb-orders-table tbody td {
    padding: 5px 0 !important;
  }

  .xb-orders-table tbody td::before {
    margin-bottom: 3px;
  }

  .xb-orders-table tbody td[data-primary="true"] {
    padding: 0 34px 8px 0 !important;
  }

  .xb-orders-table tbody td[data-label="选择"] {
    top: 11px;
    right: 11px;
  }

  .xb-orders-table tbody td[data-label="项目 / 充值账号"] {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
  }

  .xb-orders-table tbody td[data-label="操作"] {
    padding-top: 3px !important;
  }

  .xb-orders-table .xb-order-source-pill {
    min-height: 26px;
    padding-top: 1px;
    padding-bottom: 1px;
  }

  .xb-orders-table .xb-order-payment > span:first-child {
    height: 28px;
  }

  .xb-orders-table .xb-order-client p:last-child {
    overflow: visible;
    white-space: normal;
    overflow-wrap: anywhere;
    text-overflow: clip;
  }
}

@media (max-width: 767px) {
  .xb-orders-status-tabs > div {
    height: 36px;
  }

  .xb-orders-status-tabs button {
    min-height: 32px;
    padding-right: 12px;
    padding-left: 12px;
    font-size: 13px;
  }

  .xb-orders-mobile-search input,
  .xb-orders-mobile-search button,
  .xb-orders-page button[aria-label="刷新"],
  .xb-orders-page button[aria-label="显示列"] {
    min-width: 40px;
    min-height: 40px;
  }

  .xb-orders-mobile-search input {
    font-size: 14px;
  }

  .xb-orders-filter-grid input,
  .xb-orders-filter-grid select,
  .xb-orders-filter-grid button {
    min-height: 42px;
    font-size: 14px;
  }

  .xb-orders-filter-grid label {
    font-size: 13px;
  }

  .xb-orders-table .xb-order-actions button {
    min-width: 40px;
    min-height: 40px;
  }

  .xb-orders-table .xb-order-actions button:not([aria-label]) {
    padding-right: 12px;
    padding-left: 12px;
    font-size: 13px;
  }

  body:has(.xb-orders-page) [role="menu"] [role="menuitem"] {
    min-height: 40px;
    font-size: 14px;
  }

  body:has(.xb-order-review-dialog-content) [role="dialog"] button {
    min-height: 40px;
  }

  .xb-order-review-dialog-content .text-xs {
    font-size: 13px !important;
    line-height: 1.4 !important;
  }

  div:has(> table.xb-orders-table) {
    max-height: none !important;
    overflow: visible !important;
  }
}

@media (min-width: 768px) and (max-width: 1279px) {
  .xb-orders-filter-grid input,
  .xb-orders-filter-grid select,
  .xb-orders-filter-grid button {
    min-height: 36px;
  }

  .xb-orders-status-tabs > div {
    height: 34px;
  }

  .xb-orders-status-tabs button {
    min-height: 30px;
    font-size: 13px;
  }
}

@media (min-width: 768px) {
  .xb-orders-status-tabs > div {
    height: 36px;
  }

  .xb-orders-status-tabs button {
    min-height: 32px;
    font-size: 13px;
  }

  .xb-orders-filter-grid input,
  .xb-orders-filter-grid select,
  .xb-orders-filter-grid button {
    min-height: 36px;
  }

  .xb-orders-page button[aria-label="刷新"],
  .xb-orders-page button[aria-label="显示列"] {
    min-width: 36px;
    min-height: 36px;
  }

  .xb-orders-table input[type="checkbox"] {
    width: 16px;
    height: 16px;
  }

  .xb-orders-table .xb-order-actions button {
    min-width: 36px;
    min-height: 36px;
  }
}
.xb-order-payment-query-panel {
  grid-column: 1 / -1;
}

@media (min-width: 640px) {
  .xb-order-payment-query-row {
    grid-template-columns: 150px 110px minmax(0, 1fr);
    align-items: center;
  }
}
/* ==========================================================================
   订单核对状态视觉优化追加样式
   配合 orders-review-override.js 使用
   ========================================================================== */

/* 隐藏状态列中“待人工核对”的灰色解释 badge，避免与“已支付”等状态重复解释 */
.xb-order-review-badge.xb-review-pending {
  display: none !important;
}

/* 已核对状态 badge 保持可见并强化 */
.xb-order-review-badge.xb-review-received {
  background-color: #d1fae5 !important;
  color: #065f46 !important;
}

.xb-order-review-badge.xb-review-not-received {
  background-color: #ffe4e6 !important;
  color: #9f1239 !important;
}

/* 操作按钮颜色强化（覆盖原内联样式） */
.xb-order-actions .xb-review-btn-received {
  border-color: #10b981 !important;
  background-color: #d1fae5 !important;
  color: #065f46 !important;
}

.xb-order-actions .xb-review-btn-received:hover {
  background-color: #a7f3d0 !important;
}

.xb-order-actions .xb-review-btn-not-received {
  border-color: #f43f5e !important;
  background-color: #ffe4e6 !important;
  color: #9f1239 !important;
}

.xb-order-actions .xb-review-btn-not-received:hover {
  background-color: #fecdd3 !important;
}

.xb-order-actions .xb-review-btn-pending {
  border-color: #f59e0b !important;
  background-color: #fffbeb !important;
  color: #b45309 !important;
}

.xb-order-actions .xb-review-btn-pending:hover {
  background-color: #fef3c7 !important;
}

/* 暗色模式适配 */
.dark .xb-order-review-badge.xb-review-received {
  background-color: rgba(16, 185, 129, 0.2) !important;
  color: #34d399 !important;
}

.dark .xb-order-review-badge.xb-review-not-received {
  background-color: rgba(244, 63, 94, 0.2) !important;
  color: #fb7185 !important;
}

.dark .xb-order-actions .xb-review-btn-received {
  border-color: #10b981 !important;
  background-color: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
}

.dark .xb-order-actions .xb-review-btn-not-received {
  border-color: #f43f5e !important;
  background-color: rgba(244, 63, 94, 0.15) !important;
  color: #fb7185 !important;
}

.dark .xb-order-actions .xb-review-btn-pending {
  border-color: #f59e0b !important;
  background-color: rgba(245, 158, 11, 0.12) !important;
  color: #fbbf24 !important;
}
