/* ============================================================
   Cartoon DuangDuang Modal — 样式
============================================================ */

/* ---- 动画关键帧 ---- */
@keyframes duangOpen {
  0%   { transform: scale(0.3) rotate(-4deg); opacity: 0; }
  35%  { transform: scale(1.18) rotate(2deg); opacity: 1; }
  55%  { transform: scale(0.93) rotate(-1deg); }
  75%  { transform: scale(1.05) rotate(0.5deg); }
  90%  { transform: scale(0.98) rotate(0deg); }
  100% { transform: scale(1) rotate(0deg); }
}
@keyframes duangClose {
  0%   { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.5) rotate(4deg); opacity: 0; }
}
@keyframes duangShake {
  0%, 100% { transform: translateX(0); }
  20%  { transform: translateX(-6px); }
  40%  { transform: translateX(6px); }
  60%  { transform: translateX(-4px); }
  80%  { transform: translateX(4px); }
}
@keyframes duangIconBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  40%  { transform: translateY(-8px) scale(1.1); }
  70%  { transform: translateY(0) scale(0.95); }
}
@keyframes duangPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(55,138,221,0.4); }
  50%  { box-shadow: 0 0 0 14px rgba(55,138,221,0); }
}

/* ---- 遮罩 ---- */
#duangModal { position: fixed; inset: 0; z-index: 10000; display: none; align-items: center; justify-content: center; }
.duang-mask {
  position: absolute; inset: 0;
  background: rgba(15, 25, 40, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ---- 卡片 ---- */
.duang-card {
  position: relative; z-index: 1;
  width: min(420px, 90vw);
  background: #fff;
  border-radius: 28px;
  padding: 36px 28px 24px;
  display: flex; flex-direction: column; gap: 20px;
  box-shadow: 0 28px 60px rgba(0,0,0,.28), 0 6px 16px rgba(0,0,0,.18);
  animation: duangOpen .48s cubic-bezier(.36,.07,.19,.97) both;
  font-family: -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: #1a202c;
}
.duang-card.duang-close { animation: duangClose .22s ease-in forwards; }

/* 图标圆 */
.duang-icon {
  width: 72px; height: 72px; margin: 0 auto 4px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 36px; color: #fff; line-height: 1;
  box-shadow: 0 8px 20px rgba(0,0,0,.18);
  animation: duangIconBounce .55s ease-out both;
}
/* 不同颜色脉冲光环 */
.duang-card.duang-open .duang-icon { animation: duangIconBounce .55s ease-out both, duangPulse 1.6s ease-in-out 0.55s 2; }

/* 内容区 */
.duang-title {
  text-align: center; font-size: 20px; font-weight: 700;
  letter-spacing: .02em; color: #1a202c;
}
.duang-msg {
  text-align: center; font-size: 15px; line-height: 1.75;
  color: #4a5568; min-height: 24px; word-break: break-word;
}
.duang-msg.duang-error { color: #c53030; }
.duang-msg.duang-warning { color: #975a16; }
.duang-msg.duang-success { color: #276749; }

/* 按钮区 */
.duang-footer {
  display: flex; gap: 12px; justify-content: center; margin-top: 4px;
}
.duang-btn {
  min-width: 100px; padding: 11px 24px; border: none; border-radius: 14px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s;
  box-shadow: 0 4px 12px rgba(0,0,0,.13);
}
.duang-btn:active { transform: scale(.96); }
.duang-btn-ok {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}
.duang-btn-ok:hover { box-shadow: 0 6px 18px rgba(102,126,234,.45); transform: translateY(-1px); }
.duang-btn-cancel {
  background: #edf2f7; color: #4a5568;
}
.duang-btn-cancel:hover { background: #e2e8f0; }
.hidden { display: none !important; }

/* ---- 错误 shake 特效 ---- */
.duang-shake { animation: duangShake .42s ease !important; }

/* ---- 响应式 ---- */
@media (max-width: 480px) {
  .duang-card { padding: 28px 18px 20px; border-radius: 22px; }
  .duang-icon { width: 58px; height: 58px; font-size: 28px; }
  .duang-title { font-size: 17px; }
  .duang-msg   { font-size: 14px; }
  .duang-btn   { min-width: 88px; padding: 10px 16px; font-size: 14px; }
}
