/* ============================================================
 * wb-modal.css — 通用自定义弹窗（替换浏览器原生 alert/confirm/prompt）
 *
 * 暴露 3 个 JS 函数（详见 wb-modal.js）：
 *   wbConfirm({ title, text, okText, cancelText, danger }) -> Promise<bool>
 *   wbAlert(title, text)                                    -> Promise<void>
 *   wbPrompt({ title, text, defaultValue, okText, cancelText }) -> Promise<string|null>
 *
 * 与页面其他 CSS 完全独立，只要 <link> 这一个文件 + <script src> wb-modal.js
 * 即可在任意 HTML 中使用，无需打包工具。
 * ============================================================ */

.wb-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.7);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.wb-modal-overlay.show { display: flex; }

.wb-modal-box {
  background: #fff;
  border-radius: 16px;
  padding: 28px 28px 20px;
  width: 340px;
  max-width: 90%;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
  text-align: center;
  border: 1px solid #e5e7ee;
  animation: wb-modal-in 0.18s ease-out;
}
@keyframes wb-modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.wb-modal-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(90, 107, 130, 0.10);
  color: #5a6b82;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}
.wb-modal-icon.danger { background: #fee2e2; color: #dc2626; }
.wb-modal-icon.success { background: #d1fae5; color: #059669; }
.wb-modal-icon.warn { background: #fef3c7; color: #d97706; }

.wb-modal-title {
  font-size: 17px;
  font-weight: 600;
  color: #1e1e2e;
  margin: 0 0 8px;
}
.wb-modal-text {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.5;
  margin: 0 0 20px;
  white-space: pre-wrap;
  word-break: break-word;
}
.wb-modal-input {
  width: 100%;
  height: 40px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
  color: #1e293b;
  outline: none;
  margin: 0 0 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
  font-family: inherit;
}
.wb-modal-input:focus {
  border-color: #5a6b82;
  box-shadow: 0 0 0 3px rgba(90, 107, 130, 0.12);
}

.wb-modal-actions { display: flex; gap: 10px; }
.wb-modal-btn {
  flex: 1;
  height: 40px;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.wb-modal-cancel { background: #f3f4f8; color: #5b5478; }
.wb-modal-cancel:hover { background: #e5e7ee; }
.wb-modal-ok {
  background: linear-gradient(135deg, #5a6b82, #94a3b8);
  color: #fff;
}
.wb-modal-ok:hover { opacity: 0.9; }
.wb-modal-ok.danger { background: linear-gradient(135deg, #dc2626, #ef4444); }

/* 移动端适配 */
@media (max-width: 480px) {
  .wb-modal-box { width: 320px; padding: 24px 22px 18px; }
  .wb-modal-title { font-size: 16px; }
  .wb-modal-text { font-size: 13px; }
}
