/* AutoBuy · 前台通用设计系统 */
:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #fafbfe;
  --ink: #0d1730;
  --ink-2: #33415c;
  --muted: #6b7893;
  --line: #e5eaf3;
  --line-2: #eef2f8;
  --primary: #2557ff;
  --primary-dark: #173fd0;
  --primary-soft: #eaf0ff;
  --navy: #081632;
  --navy-2: #122a5c;
  --accent: #ff6a2b;
  --accent-soft: #fff1e9;
  --green: #0ea472;
  --green-soft: #e7f8f1;
  --red: #e5484d;
  --amber: #e8930c;
  --shadow-sm: 0 2px 10px rgba(20, 40, 90, .05);
  --shadow: 0 12px 36px rgba(20, 40, 90, .09);
  --shadow-lg: 0 28px 70px rgba(12, 26, 60, .16);
  --radius: 16px;
  --radius-sm: 10px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, p { margin: 0; }
::selection { background: #d9e3ff; color: var(--navy); }

.container { width: min(1200px, calc(100% - 48px)); margin: 0 auto; }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }
.price { font-variant-numeric: tabular-nums; font-weight: 750; letter-spacing: -.02em; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px; padding: 11px 20px;
  font-weight: 650; font-size: 14px; line-height: 1.2; transition: .18s ease;
  white-space: nowrap; background: transparent; color: var(--ink);
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 20px rgba(37, 87, 255, .22); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 12px 26px rgba(37, 87, 255, .3); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-dark:hover { background: var(--navy-2); transform: translateY(-1px); }
.btn-ghost { border-color: var(--line); background: #fff; color: var(--ink-2); }
.btn-ghost:hover { border-color: #c9d5ea; background: var(--surface-2); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-soft:hover { background: #dde7ff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #ef5a1a; }
.btn-danger { background: #fff0f0; color: var(--red); border-color: #ffdede; }
.btn-danger:hover { background: #ffe4e4; }
.btn-sm { padding: 7px 13px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { padding: 15px 28px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

/* ---------- 表单 ---------- */
.field { display: block; margin-bottom: 16px; }
.field-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; color: var(--ink-2); margin-bottom: 7px; }
.field-label .req { color: var(--accent); }
.field-help { font-size: 11.5px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 10px; padding: 11px 13px; outline: none; transition: .16s;
}
.input::placeholder, .textarea::placeholder { color: #a9b4c9; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 87, 255, .1); }
.textarea { resize: vertical; min-height: 92px; }
.input-group { position: relative; }
.input-group .input { padding-left: 40px; }
.input-group > svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: #a0adc4; }

/* ---------- 卡片 / 标签 ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 650; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
}
.badge-green { background: var(--green-soft); color: var(--green); border-color: #c9f0e0; }
.badge-blue { background: var(--primary-soft); color: var(--primary); border-color: #d5e0ff; }
.badge-amber { background: #fff6e6; color: var(--amber); border-color: #ffe6bd; }
.badge-red { background: #fff0f0; color: var(--red); border-color: #ffdada; }
.badge-dark { background: #eef1f7; color: var(--navy); border-color: #dfe5f0; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: currentColor; }

/* ---------- 提示条 ---------- */
.notice {
  display: flex; gap: 11px; align-items: flex-start; padding: 13px 16px; border-radius: 12px;
  font-size: 13px; line-height: 1.65; border: 1px solid;
}
.notice svg { width: 17px; height: 17px; flex: none; margin-top: 2px; }
.notice-amber { background: #fffbf2; border-color: #f7e2bb; color: #8a5b0a; }
.notice-blue { background: #f3f7ff; border-color: #d8e4ff; color: #1c47a8; }
.notice-green { background: #f1fbf7; border-color: #c8efdf; color: #0b7a55; }

/* ---------- Toast ---------- */
#toast-root { position: fixed; z-index: 9999; top: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
  min-width: 240px; max-width: 380px; background: #fff; border: 1px solid var(--line);
  border-left: 4px solid var(--primary); border-radius: 10px; padding: 12px 16px;
  box-shadow: var(--shadow); font-size: 13px; color: var(--ink-2);
  animation: toastIn .22s ease both;
}
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast.warn { border-left-color: var(--amber); }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* ---------- 加载 ---------- */
.spinner { width: 17px; height: 17px; border: 2px solid rgba(37, 87, 255, .18); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, #eef2f8 25%, #f8fafd 50%, #eef2f8 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 54px 20px; color: var(--muted); }
.empty-ico { width: 58px; height: 58px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; margin: 0 auto 14px; color: #9aa8c0; }
.empty h3 { color: var(--ink-2); font-size: 15px; margin-bottom: 6px; }
.empty p { font-size: 13px; }

/* ---------- 品牌 ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.03em; font-size: 19px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, #3769ff, #1b3fd6); color: #fff;
  box-shadow: 0 6px 16px rgba(37, 87, 255, .28);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-mark.sm { width: 28px; height: 28px; border-radius: 8px; }
.brand-mark.sm svg { width: 16px; height: 16px; }

/* ---------- 平台徽标 ---------- */
.pf-badge {
  width: 27px; height: 27px; border-radius: 8px; display: inline-grid; place-items: center;
  flex: none; background: var(--pf, #2557ff); color: #fff; font-size: 12px; font-weight: 750;
}

/* ---------- 图标 ---------- */
.icon { width: 18px; height: 18px; display: inline-block; vertical-align: middle; flex: none; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }

@media (max-width: 820px) {
  .container { width: min(100% - 32px, 1200px); }
}
