/* 商户后台 — 独立基础主题（不依赖总后台 theme.css） */
:root {
  --mch-font: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mch-sidebar-w: 260px;
  --mch-radius: 10px;
  --mch-radius-sm: 6px;
  --mch-bg: #eef1f5;
  --mch-surface: #ffffff;
  --mch-text: #0f172a;
  --mch-text-muted: #64748b;
  --mch-border: #e2e8f0;
  --mch-primary: #4f46e5;
  --mch-primary-hover: #4338ca;
  --mch-success: #059669;
  --mch-warning: #d97706;
  --mch-danger: #dc2626;
  --mch-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 16px rgba(15, 23, 42, 0.04);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 15px;
}

body {
  margin: 0;
  font-family: var(--mch-font);
  background: var(--mch-bg);
  color: var(--mch-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--mch-primary);
}

/* —— 按钮 —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--mch-radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s, border-color 0.15s;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--mch-primary);
  color: #fff;
}

.btn--primary:hover {
  background: var(--mch-primary-hover);
}

.btn--ghost {
  background: var(--mch-surface);
  color: var(--mch-text);
  border: 1px solid var(--mch-border);
}

.btn--ghost:hover {
  background: #f8fafc;
}

.btn--danger {
  background: var(--mch-danger);
  color: #fff;
}

.btn--sm {
  padding: 6px 12px;
  font-size: 0.8125rem;
}

.btn--block {
  width: 100%;
}

/* —— 表单字段 —— */
.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--mch-text-muted);
  margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--mch-border);
  border-radius: var(--mch-radius-sm);
  font-size: 0.9375rem;
  font-family: inherit;
  background: #fff;
  color: var(--mch-text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--mch-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.form-error {
  color: var(--mch-danger);
  font-size: 0.8125rem;
  min-height: 1.25em;
  margin-top: 8px;
}

/* —— 徽章 —— */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge--ok {
  background: #d1fae5;
  color: #065f46;
}

.badge--warn {
  background: #fef3c7;
  color: #92400e;
}

.badge--danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge--muted {
  background: #f1f5f9;
  color: #475569;
}

/* —— 图片上传 —— */
.img-upload {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.img-upload__preview {
  width: 120px;
  height: 120px;
  border: 1px dashed var(--mch-border);
  border-radius: var(--mch-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--mch-bg);
  overflow: hidden;
  flex-shrink: 0;
}

.img-upload__preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.img-upload__placeholder {
  font-size: 0.75rem;
  color: var(--mch-text-muted);
}

.img-upload__path {
  margin: 0 0 4px;
  font-size: 0.8125rem;
  word-break: break-all;
  font-family: ui-monospace, monospace;
}

.img-upload__hint {
  margin: 0 0 10px;
  font-size: 0.75rem;
  color: var(--mch-text-muted);
}

.img-upload__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* —— 分页 —— */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8125rem;
  color: var(--mch-text-muted);
}

.pager button {
  padding: 6px 14px;
  border: 1px solid var(--mch-border);
  border-radius: var(--mch-radius-sm);
  background: #fff;
  cursor: pointer;
  font-size: 0.8125rem;
  font-family: inherit;
}

.pager button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pager button:not(:disabled):hover {
  border-color: var(--mch-primary);
  color: var(--mch-primary);
}
