/* ==========================================================================
   统一弹窗系统样式（dialog.css）
   供占卜页、管理后台等多页面复用
   弹窗居中显示，Toast 顶部居中，统一视觉风格
   ========================================================================== */

/* ---- 遮罩层 ---- */
.dlg-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none; /* 透明时禁止鼠标事件，避免遮挡页面操作 */
  transition: opacity 0.2s ease;
}
.dlg-overlay.show { opacity: 1; pointer-events: auto; }

/* ---- 弹窗主体 ---- */
.dlg-box {
  background: var(--bg-card, #1a1d2e);
  border: 2px solid var(--border, #2a2f4a);
  border-radius: 14px;
  padding: 28px 32px 24px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  transform: scale(0.92) translateY(-8px);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.dlg-overlay.show .dlg-box { transform: scale(1) translateY(0); }

/* ---- 弹窗标题 ---- */
.dlg-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text, #ecedf2);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.dlg-title .dlg-icon {
  display: inline-flex;
  width: 28px; height: 28px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  flex-shrink: 0;
}
.dlg-title .dlg-icon.info  { background: rgba(108, 142, 255, 0.15); color: var(--primary, #6c8eff); }
.dlg-title .dlg-icon.warn  { background: rgba(251, 146, 60, 0.15);  color: var(--orange, #fb923c); }
.dlg-title .dlg-icon.error { background: rgba(239, 68, 68, 0.15);   color: var(--red, #ef4444); }
.dlg-title .dlg-icon.success { background: rgba(74, 222, 128, 0.15); color: var(--green, #4ade80); }

/* ---- 弹窗内容 ---- */
.dlg-body {
  font-size: 15px;
  color: var(--text-soft, #a5acc0);
  line-height: 1.8;
  margin-bottom: 24px;
  word-break: break-word;
}

/* ---- 弹窗内表单辅助类（供管理后台表单弹窗复用） ---- */
.dlg-box h3 { margin-bottom: 16px; }
.dlg-box .row { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.dlg-box input, .dlg-box select {
  padding: 8px 12px; border: 2px solid var(--border, #2a2f4a); border-radius: 8px;
  background: var(--bg-input, #14172a); font-size: 13px; outline: none;
  color: var(--text, #ecedf2);
  flex: 1;
}
.dlg-box input:focus, .dlg-box select:focus { border-color: var(--primary, #6c8eff); }
.dlg-box .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.dlg-box .msg { font-size: 13px; color: var(--text-mute, #6e7691); margin-top: 8px; }

/* ---- 按钮区 ---- */
.dlg-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
.dlg-btn {
  font-size: 14px;
  font-weight: 600;
  padding: 9px 24px;
  border: 2px solid var(--border, #2a2f4a);
  border-radius: 8px;
  background: transparent;
  color: var(--text, #ecedf2);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, border-color 0.15s;
}
.dlg-btn:hover { background: rgba(255, 255, 255, 0.05); border-color: var(--text-mute, #6e7691); }
.dlg-btn:active { transform: scale(0.97); }
.dlg-btn.primary {
  background: var(--primary, #6c8eff);
  color: #fff;
  border-color: var(--primary, #6c8eff);
}
.dlg-btn.primary:hover { background: var(--primary-2, #5570e0); border-color: var(--primary-2, #5570e0); }
.dlg-btn.danger {
  background: var(--red, #ef4444);
  color: #fff;
  border-color: var(--red, #ef4444);
}
.dlg-btn.danger:hover { background: #dc2626; border-color: #dc2626; }

/* ---- 浮动 Toast ---- */
.dlg-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  background: var(--bg-card, #1a1d2e);
  border: 2px solid var(--border, #2a2f4a);
  border-radius: 12px;
  padding: 14px 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 10001;
  max-width: 90%;
  max-height: 60vh;
  overflow-y: auto;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 14px;
  line-height: 1.7;
  word-break: break-word;
  display: flex;
  align-items: center;
  gap: 12px;
}
.dlg-toast.show { transform: translateX(-50%) translateY(0); }
.dlg-toast.toast-error   { border-color: var(--red, #ef4444); }
.dlg-toast.toast-success { border-color: var(--green, #4ade80); }
.dlg-toast.toast-info    { border-color: var(--primary, #6c8eff); }
.dlg-toast .toast-icon {
  flex-shrink: 0;
  font-size: 18px;
  font-weight: 800;
}
.dlg-toast.toast-error .toast-icon   { color: var(--red, #ef4444); }
.dlg-toast.toast-success .toast-icon { color: var(--green, #4ade80); }
.dlg-toast.toast-info .toast-icon    { color: var(--primary, #6c8eff); }
.dlg-toast .toast-close {
  cursor: pointer;
  font-size: 18px;
  color: var(--text-mute, #6e7691);
  flex-shrink: 0;
  line-height: 1;
}
.dlg-toast .toast-close:hover { color: var(--text, #ecedf2); }
