:root {
  --theme-primary: #ff6a00;
  --theme-primary-hover: #ff7a1a;
  --theme-primary-active: #e65f00;
  --theme-primary-soft: #fff3e8;
  --theme-primary-soft-hover: #ffe6d1;
  --theme-primary-shadow: rgba(255, 106, 0, 0.14);
  color: #1f2937;
  background: #f5f7fb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

button,
input,
textarea,
select {
  font: inherit;
}

/* ===== 通用布局与页面容器 ===== */

.page-stack {
  display: grid;
  gap: 16px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.page-title {
  margin: 0 !important;
}

.page-description {
  margin: 6px 0 0;
  color: #6b7280;
}

.filter-form {
  row-gap: 12px;
}

.cell-stack {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.muted {
  color: #6b7280;
}

.full-width {
  width: 100%;
}

.json-preview {
  max-height: 460px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border: 1px solid #edf0f5;
  border-radius: 6px;
  background: #0f172a;
  color: #dbeafe;
  font-size: 12px;
  line-height: 1.6;
}

.empty-page {
  min-height: 50vh;
  display: grid;
  place-items: center;
}

.route-loading {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.feedback-prompt p {
  margin-top: 0;
}

.modal-form {
  margin-top: 14px;
}

.payload-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  font-size: 12px;
  color: #4b5563;
  word-break: break-all;
}

.dev-mock-pre {
  margin: 0;
  padding: 12px 14px;
  overflow: auto;
  max-height: 360px;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.5;
}

.total-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  background: var(--theme-primary-soft);
  color: var(--theme-primary);
  font-weight: 700;
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.table-toolbar span {
  color: #6b7280;
  font-size: 13px;
}

.status-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.record-preview {
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #edf0f5;
  border-radius: 6px;
}

.record-preview .ant-image,
.record-preview img {
  max-width: 100%;
}

.record-preview img {
  height: auto;
  border: 1px solid #edf0f5;
  background: #ffffff;
}

.metric-grid {
  display: grid;
  gap: 12px;
}

.metric-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-grid.five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric-card .ant-card-body,
.metric-card {
  min-width: 0;
}

.metric-card .ant-card-body {
  display: grid;
  gap: 5px;
}

.metric-card span,
.metric-card small {
  color: #6b7280;
}

.metric-card strong {
  color: #111827;
  font-size: 24px;
  line-height: 1.1;
}

/* 图片上传通用组件 */
.image-upload-trigger {
  width: 100%;
  height: 100%;
  min-height: 72px;
  border: 0;
  background: transparent;
  color: #64748b;
  display: grid;
  place-items: center;
  gap: 4px;
  cursor: pointer;
}

.image-upload-trigger span {
  font-size: 12px;
}

.image-upload-droppable {
  position: relative;
  display: grid;
  gap: 8px;
  justify-items: start;
  border-radius: 10px;
  padding: 6px;
  margin: -6px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-upload-droppable.is-dragging {
  background: var(--theme-primary-soft, #fff3e8);
}

.image-upload-drag-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(4px);
  border: 2px dashed var(--theme-primary, #ff6a00);
  border-radius: 10px;
  color: var(--theme-primary, #ff6a00);
  pointer-events: none;
  animation: uploadFadeIn 0.15s ease-out;
  box-shadow: 0 8px 24px var(--theme-primary-shadow, rgba(255, 106, 0, 0.14));
}

.image-upload-drag-icon {
  font-size: 32px;
  color: var(--theme-primary, #ff6a00);
  animation: uploadBounce 0.8s infinite alternate ease-in-out;
}

.image-upload-drag-text {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}

.image-upload-drag-subtext {
  font-size: 11px;
  color: #64748b;
}

@keyframes uploadFadeIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes uploadBounce {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-4px);
  }
}

.image-upload-hint {
  font-size: 12px;
  line-height: 1.5;
}

.image-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.image-preview-item {
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
}

.image-preview-more {
  font-size: 12px;
  white-space: nowrap;
}
