/**
 * 订单与财务（#/merchantPayments）表格与布局加固
 * 依赖 admin-layout-v2；不改动其它业务页。
 */

/* —— 财务页内容区：卡片内表格壳，横向滚动不撑破主栏 —— */
html.admin-layout-v2 #tab-merchantPayments {
  min-width: 0;
  max-width: 100%;
}

html.admin-layout-v2 #tab-merchantPayments .fin-panel {
  min-width: 0;
}

html.admin-layout-v2 #tab-merchantPayments .fin-table-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  min-width: 0;
}

html.admin-layout-v2 #tab-merchantPayments .fin-table-card > .admin-card {
  border: 0;
  box-shadow: none;
  background: transparent;
  border-radius: 0;
  padding: 16px 18px 0;
  margin: 0;
}

html.admin-layout-v2 #tab-merchantPayments .fin-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
  margin: 0 0 12px;
}

html.admin-layout-v2 #tab-merchantPayments .fin-table-shell {
  position: relative;
  overflow: auto;
  max-height: min(56vh, 560px);
  min-height: 160px;
  border-top: 1px solid rgba(226, 232, 240, 0.95);
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

html.admin-layout-v2 #tab-merchantPayments .fin-table-shell.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(248, 250, 252, 0.55);
  pointer-events: none;
  z-index: 2;
}

html.admin-layout-v2 #tab-merchantPayments .fin-table-shell .admin-table {
  width: max-content;
  min-width: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

html.admin-layout-v2 #tab-merchantPayments .fin-table-shell .admin-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f8fafc;
  box-shadow: 0 1px 0 rgba(203, 213, 225, 0.95);
  white-space: nowrap;
  font-size: 12px;
  height: 40px;
  padding: 8px 12px;
  vertical-align: middle;
}

html.admin-layout-v2 #tab-merchantPayments .fin-table-shell .admin-table tbody td {
  height: 44px;
  max-height: 44px;
  padding: 8px 12px;
  vertical-align: middle;
  font-size: 13px;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
}

html.admin-layout-v2 #tab-merchantPayments .fin-table-shell .admin-table tbody tr:hover td {
  background: #f8fafc;
}

/* 列宽（提现表默认；其它表用 data-cols 或类名微调） */
html.admin-layout-v2 #tab-merchantPayments #finWdTable {
  min-width: 980px;
}
html.admin-layout-v2 #tab-merchantPayments #finWdTable th:nth-child(1),
html.admin-layout-v2 #tab-merchantPayments #finWdTable td:nth-child(1) { width: 148px; }
html.admin-layout-v2 #tab-merchantPayments #finWdTable th:nth-child(2),
html.admin-layout-v2 #tab-merchantPayments #finWdTable td:nth-child(2) { width: 100px; }
html.admin-layout-v2 #tab-merchantPayments #finWdTable th:nth-child(3),
html.admin-layout-v2 #tab-merchantPayments #finWdTable td:nth-child(3) { width: 140px; }
html.admin-layout-v2 #tab-merchantPayments #finWdTable th:nth-child(4),
html.admin-layout-v2 #tab-merchantPayments #finWdTable td:nth-child(4) { width: 110px; text-align: right; font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
html.admin-layout-v2 #tab-merchantPayments #finWdTable th:nth-child(5),
html.admin-layout-v2 #tab-merchantPayments #finWdTable td:nth-child(5) { width: 200px; }
html.admin-layout-v2 #tab-merchantPayments #finWdTable th:nth-child(6),
html.admin-layout-v2 #tab-merchantPayments #finWdTable td:nth-child(6) { width: 200px; }
html.admin-layout-v2 #tab-merchantPayments #finWdTable th:nth-child(7),
html.admin-layout-v2 #tab-merchantPayments #finWdTable td:nth-child(7) { width: 180px; }

html.admin-layout-v2 #tab-merchantPayments #finRcTable,
html.admin-layout-v2 #tab-merchantPayments #finLdTable,
html.admin-layout-v2 #tab-merchantPayments #finAbTable,
html.admin-layout-v2 #tab-merchantPayments #maTable {
  min-width: 960px;
}

html.admin-layout-v2 #tab-merchantPayments .fin-cell-money {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
}

html.admin-layout-v2 #tab-merchantPayments .fin-mono-clip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
}

html.admin-layout-v2 #tab-merchantPayments .fin-mono-clip code {
  display: inline-block;
  max-width: 148px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: #334155;
  background: #f1f5f9;
  border-radius: 6px;
  padding: 2px 6px;
  vertical-align: middle;
}

html.admin-layout-v2 #tab-merchantPayments .fin-copy-btn {
  flex: 0 0 auto;
  appearance: none;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.3;
}
html.admin-layout-v2 #tab-merchantPayments .fin-copy-btn:hover {
  border-color: #94a3b8;
  color: #0f172a;
}
html.admin-layout-v2 #tab-merchantPayments .fin-copy-btn.is-ok {
  border-color: rgba(5, 150, 105, 0.45);
  color: #047857;
  background: rgba(5, 150, 105, 0.08);
}

html.admin-layout-v2 #tab-merchantPayments .fin-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.4;
  border: 1px solid transparent;
  text-transform: lowercase;
}
html.admin-layout-v2 #tab-merchantPayments .fin-tag.is-ok {
  color: #166534;
  background: #dcfce7;
  border-color: #bbf7d0;
}
html.admin-layout-v2 #tab-merchantPayments .fin-tag.is-warn {
  color: #9a3412;
  background: #ffedd5;
  border-color: #fed7aa;
}
html.admin-layout-v2 #tab-merchantPayments .fin-tag.is-bad {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fecaca;
}
html.admin-layout-v2 #tab-merchantPayments .fin-tag.is-muted {
  color: #475569;
  background: #f1f5f9;
  border-color: #e2e8f0;
}

/* 分页：卡片底部独立条，绝不叠在表格上 */
html.admin-layout-v2 #tab-merchantPayments .fin-table-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px 12px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  min-height: 48px;
  flex: 0 0 auto;
}

html.admin-layout-v2 #tab-merchantPayments .fin-table-pager[hidden] {
  display: none !important;
}

html.admin-layout-v2 #tab-merchantPayments .fin-pager-left,
html.admin-layout-v2 #tab-merchantPayments .fin-pager-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

html.admin-layout-v2 #tab-merchantPayments .fin-table-pager select {
  min-width: 72px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 12px;
}

html.admin-layout-v2 #tab-merchantPayments .fin-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 28px 16px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
}
html.admin-layout-v2 #tab-merchantPayments .fin-state strong {
  display: block;
  color: #0f172a;
  font-size: 14px;
  margin-bottom: 6px;
}
html.admin-layout-v2 #tab-merchantPayments .fin-state .admin-btn {
  margin-top: 12px;
}

html.admin-layout-v2 #tab-merchantPayments .fin-spin {
  width: 22px;
  height: 22px;
  border: 2px solid #cbd5e1;
  border-top-color: #059669;
  border-radius: 50%;
  animation: finSpin 0.7s linear infinite;
  margin: 0 auto 10px;
}
@keyframes finSpin {
  to { transform: rotate(360deg); }
}

/* 交易记录表也走同一壳（payments 子页） */
html.admin-layout-v2 #tab-merchantPayments #finPanel-payments .fin-table-shell #maTable th,
html.admin-layout-v2 #tab-merchantPayments #finPanel-payments .fin-table-shell #maTable td {
  white-space: nowrap;
}

html.admin-layout-v2 #tab-merchantPayments .fin-subtabs {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 4px 0 10px;
  background: linear-gradient(180deg, rgba(243, 246, 251, 0.96) 70%, transparent);
}

@media (max-width: 880px) {
  html.admin-layout-v2 #tab-merchantPayments .fin-table-shell {
    max-height: min(50vh, 420px);
  }
  html.admin-layout-v2 #tab-merchantPayments .fin-table-pager {
    padding: 10px 12px;
  }
}
