/**
 * assets/css/base.css —— 变量 / 重置 / 排版 / 通用组件（前后台共用）
 */

:root {
  --brand: #2563EB;
  --brand-dark: #1D4ED8;
  --brand-soft: #EFF4FF;
  --ink: #111827;
  --ink-2: #1F2937;
  --item-text: #374151;
  --muted: #9CA3AF;
  --muted-2: #6B7280;
  --hw-bg: #F0F5FF;
  --bg: #F7F8FA;
  --card: #FFFFFF;
  --border: #E5E7EB;
  --danger: #DC2626;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(17, 24, 39, .08), 0 1px 2px rgba(17, 24, 39, .04);
  --shadow-lg: 0 10px 30px rgba(17, 24, 39, .12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--brand); text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink-2);
  font-size: 14px;
  cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { background: #F3F4F6; }
.btn--primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn--primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn--danger { color: var(--danger); border-color: #FECACA; }
.btn--danger:hover { background: #FEF2F2; }
.btn--sm { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field__label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--muted-2); }
.input, .textarea, .select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.7; }

/* ---------- 标签 / 徽标 ---------- */
.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 18px;
  background: var(--muted);
  color: #fff;
}

/* ---------- 轻提示 ---------- */
.hs-toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  z-index: 9999;
  max-width: 88vw;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(17, 24, 39, .92);
  color: #fff;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  transition: opacity .3s, transform .3s;
}
.hs-toast--error { background: rgba(220, 38, 38, .95); }
.hs-toast--out { opacity: 0; transform: translateX(-50%) translateY(8px); }

/* ---------- 工具类 ---------- */
.text-muted { color: var(--muted-2); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.hidden { display: none !important; }
