* {
  box-sizing: border-box;
}
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  margin: 0;
  background: #eef0f4;
  color: #1a1a1a;
  font-size: 14px;
}
.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}
h1 {
  font-size: 1.35rem;
  margin: 0 0 6px;
  font-weight: 600;
}
.sub {
  color: #666;
  font-size: 0.88rem;
  margin-bottom: 16px;
}
.card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
label {
  display: block;
  font-size: 0.85rem;
  color: #444;
  margin-bottom: 6px;
}
input[type="text"],
input[type="password"],
input[type="search"] {
  width: 100%;
  max-width: 320px;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 14px;
}
button {
  background: #b81c22;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}
button.secondary {
  background: #e8eaed;
  color: #333;
}
button.small {
  padding: 6px 12px;
  font-size: 0.85rem;
}
button.danger {
  background: #c62828;
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.err {
  color: #c62828;
  font-size: 0.88rem;
  margin-top: 8px;
}
.hidden {
  display: none !important;
}

/* App shell */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.toolbar-spacer {
  flex: 1;
}

/* Tabs */
.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid #e0e4ea;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.tab {
  padding: 10px 18px;
  cursor: pointer;
  color: #666;
  border-radius: 8px 8px 0 0;
  margin-bottom: -2px;
  border: 2px solid transparent;
  border-bottom: none;
  font-weight: 500;
}
.tab:hover {
  color: #b81c22;
  background: rgba(184, 28, 34, 0.06);
}
.tab.active {
  color: #b81c22;
  background: #fff;
  border-color: #e0e4ea;
  border-bottom-color: #fff;
}
.tab-panel {
  min-height: 200px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}
.stat {
  background: #f8f9fb;
  padding: 14px;
  border-radius: 10px;
  text-align: center;
  border: 1px solid #eee;
}
.stat b {
  display: block;
  font-size: 1.2rem;
  color: #b81c22;
  font-weight: 600;
}
.stat span {
  font-size: 0.78rem;
  color: #666;
  margin-top: 4px;
  display: block;
}

.sub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.sub-tab {
  padding: 6px 14px;
  border-radius: 20px;
  background: #f0f2f5;
  color: #555;
  cursor: pointer;
  font-size: 0.86rem;
  border: 1px solid transparent;
}
.sub-tab.active {
  background: #fde8e9;
  color: #b81c22;
  border-color: #f5c2c5;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid #e8eaed;
  border-radius: 10px;
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
table.data th,
table.data td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
}
table.data th {
  background: #f8f9fb;
  font-weight: 600;
  color: #444;
  white-space: nowrap;
}
table.data tr:hover td {
  background: #fafbfc;
}
table.data td.mono {
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 500;
}
.tag.cert {
  background: #e3f2fd;
  color: #1565c0;
}
.tag.svc {
  background: #f3e5f5;
  color: #6a1b9a;
}
.tag.pending {
  background: #fff8e1;
  color: #f57f17;
}
.tag.approved {
  background: #e8f5e9;
  color: #2e7d32;
}
.tag.rejected {
  background: #ffebee;
  color: #c62828;
}

.pager {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.detail-header h2 {
  margin: 0;
  font-size: 1.1rem;
  flex: 1;
}

.dl-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 16px;
  max-width: 720px;
}
.dl-grid dt {
  color: #888;
  font-size: 0.86rem;
}
.dl-grid dd {
  margin: 0;
  color: #222;
}
.section-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 20px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #eee;
}
.img-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.img-row img,
.img-row .proof-img {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #ddd;
  cursor: zoom-in;
}

/* 审核详情：点击图片在本页放大（适配笔记本屏宽约 90vw） */
.img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 32px;
  cursor: zoom-out;
}
.img-lightbox.hidden {
  display: none !important;
}
.img-lightbox-img {
  max-width: min(92vw, 1200px);
  max-height: min(88vh, 900px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  cursor: default;
}
.img-lightbox-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  z-index: 201;
}
.img-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.28);
}
.detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}
.history-item {
  background: #f8f9fb;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 0.88rem;
}
.history-item .t {
  color: #888;
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.user-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 14px;
}
.user-filters input {
  margin-bottom: 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  max-width: 400px;
  width: 100%;
}
.modal h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}
.modal textarea {
  width: 100%;
  min-height: 100px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
  margin-bottom: 12px;
  font-family: inherit;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.empty-hint {
  color: #888;
  padding: 24px;
  text-align: center;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: #333;
  cursor: pointer;
  margin-bottom: 0;
}
.inline-check input {
  margin: 0;
}

.kp-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 16px;
}
.kp-toolbar input {
  margin-bottom: 0;
}
.kp-tree-container {
  border: 1px solid #e8eaed;
  border-radius: 10px;
  min-height: 200px;
  max-height: 600px;
  overflow-y: auto;
  background: #fafbfc;
}
.kp-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid #f0f2f5;
  transition: background 0.15s;
}
.kp-row:hover {
  background: #f0f2f5;
}
.kp-row.kp-disabled {
  opacity: 0.5;
}
.kp-toggle {
  width: 20px;
  text-align: center;
  font-size: 0.8rem;
  color: #888;
  flex-shrink: 0;
}
.kp-toggle.kp-leaf {
  color: #bbb;
  font-size: 0.6rem;
}
.kp-name {
  font-weight: 500;
  font-size: 0.9rem;
  min-width: 80px;
}
.kp-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  background: #e3f2fd;
  color: #1565c0;
}
.kp-sort {
  font-size: 0.78rem;
  color: #999;
}
.kp-actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.id-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.linklike {
  background: none;
  border: none;
  color: #1677ff;
  cursor: pointer;
  padding: 0;
  font-family: ui-monospace, monospace;
  font-size: inherit;
  text-decoration: underline;
}

.fin-order-sub {
  margin-top: 4px;
}

.actions-cell {
  white-space: nowrap;
}

.actions-cell .small {
  margin-right: 4px;
  margin-bottom: 4px;
}

.fin-refund-modal {
  max-width: 520px;
}

.fin-detail-grid {
  margin-bottom: 12px;
}

.wrap-id {
  word-break: break-all;
}

.fin-slot-list {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.9rem;
}
