:root {
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-50: #eff6ff;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #94a3b8;
  --line: #e2e8f0;
  --bg: #f1f5f9;
  --white: #ffffff;
  --ok: #16a34a;
  --err: #dc2626;
  --warn: #d97706;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }
.hidden { display: none !important; }

/* ===== 表单控件（公用） ===== */
.field { display: flex; flex-direction: column; gap: 8px; }
.field__label { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.field__wrap { position: relative; display: flex; }

.field__input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  color: var(--ink);
  background: #f8fafc;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.field__input::placeholder { color: var(--ink-3); }
.field__input::-ms-reveal,
.field__input::-ms-clear { display: none; }
.field__input:focus {
  border-color: var(--blue-500);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
}

.field__toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--blue-600);
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 8px;
}
.field__toggle:hover { background: var(--blue-50); }

/* ===== 按钮（公用） ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 18px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  transition: transform .06s ease, background .18s ease, opacity .18s ease, border-color .18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn--primary { background: var(--blue-600); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--blue-700); }

.btn--ghost {
  background: #fff;
  color: var(--blue-700);
  border: 1.5px solid var(--line);
}
.btn--ghost:hover:not(:disabled) {
  border-color: var(--blue-500);
  background: var(--blue-50);
}

.btn--danger { background: var(--err); color: #fff; }
.btn--danger:hover:not(:disabled) { background: #b91c1c; }

.btn--sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 9px; }

/* ===== 顶部气泡弹窗（公用） ===== */
.toast-root {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: min(92vw, 420px);
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.4;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(-16px);
  transition: opacity .22s ease, transform .22s ease;
}

.toast.is-show { opacity: 1; transform: translateY(0); }
.toast.is-hide { opacity: 0; transform: translateY(-16px); }

.toast__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--blue-500);
}
.toast--success .toast__dot { background: var(--ok); }
.toast--error .toast__dot { background: var(--err); }
.toast--warning .toast__dot { background: var(--warn); }
.toast--info .toast__dot { background: var(--blue-500); }

.toast__msg { flex: 1 1 auto; }

/* ===== 确认弹窗（公用） ===== */
body.confirm-open { overflow: hidden; }

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.42);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}
.confirm-overlay.is-show {
  opacity: 1;
  visibility: visible;
}

.confirm {
  width: 100%;
  max-width: 340px;
  background: var(--white);
  border-radius: 16px;
  padding: 24px 22px 18px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
  text-align: center;
  transform: translateY(10px) scale(0.97);
  transition: transform .2s ease;
}
.confirm-overlay.is-show .confirm {
  transform: translateY(0) scale(1);
}

.confirm__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: #fef2f2;
  color: var(--err);
  display: flex;
  align-items: center;
  justify-content: center;
}
.confirm__icon svg { width: 24px; height: 24px; }

.confirm__title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}
.confirm__msg {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
}

.confirm__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.confirm__actions .btn {
  width: 100%;
  height: 42px;
}
