/* ================================================================
   儿童发育行为评估系统 · 统一提示组件
   Toast（顶部居中浮动提示，带关闭按钮 / 自动消失进度条）
   + 居中对话框（毛玻璃遮罩 / 关闭按钮 / 图标 / 按钮组）
   自包含样式，不依赖 assessment_base.css 变量，可在任意页面独立引入
   ================================================================ */
.asm-toasts {
  position: fixed;
  top: 14px;
  left: 0;
  right: 0;
  z-index: 20000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  pointer-events: none;
}

/* ---------- Toast ---------- */
.asm-toast {
  position: relative;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: .6rem;
  max-width: min(540px, 94vw);
  background: #fff;
  border: 1px solid rgba(236, 241, 248, 0.95);
  border-radius: 14px;
  padding: .72rem .85rem .8rem .7rem;
  box-shadow: 0 14px 38px rgba(42, 71, 138, 0.18);
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  opacity: 0;
  transform: translateY(-18px) scale(.96);
  transition: opacity .3s ease, transform .3s cubic-bezier(.34, 1.56, .64, 1);
}
.asm-toast.in { opacity: 1; transform: translateY(0) scale(1); }
.asm-toast.out {
  opacity: 0;
  transform: translateY(-12px) scale(.97);
  transition-duration: .28s;
}
/* 顶部流光装饰条 */
.asm-toast::before {
  content: '';
  position: absolute;
  left: 0; top: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #5A7DFF, #FFB020, #3D5BF5);
  background-size: 220% 100%;
}
.asm-toast-icon {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
}
.asm-toast-success .asm-toast-icon { background: #E6F8F0; color: #1E9B6C; }
.asm-toast-info    .asm-toast-icon { background: #EEF3FF; color: #3D5BF5; }
.asm-toast-warning .asm-toast-icon { background: #FFF6E0; color: #C77B00; }
.asm-toast-danger  .asm-toast-icon { background: #FDEBEC; color: #E04552; }
.asm-toast-body {
  flex: 1;
  font-size: .9rem;
  font-weight: 600;
  color: #2A3346;
  line-height: 1.6;
  word-break: break-word;
}
.asm-toast-close {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border: none;
  border-radius: 50%;
  background: none;
  color: #93A0B3;
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background .18s ease, color .18s ease;
}
.asm-toast-close:hover { background: #F1F4FB; color: #2A3346; }
/* 自动关闭倒计时进度条 */
.asm-toast-bar {
  position: absolute;
  left: 0; bottom: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, #5A7DFF, #3D5BF5);
  transform-origin: left;
  animation-name: asm-bar-shrink;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}
@keyframes asm-bar-shrink {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* ---------- 居中对话框 ---------- */
.asm-modal {
  position: fixed;
  inset: 0;
  z-index: 21000;
  background: rgba(35, 48, 88, 0.46);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.asm-modal.show { display: flex; }
.asm-dialog {
  position: relative;
  width: min(390px, 92vw);
  background: #fff;
  border-radius: 20px;
  padding: 28px 22px 22px;
  text-align: center;
  box-shadow: 0 28px 80px rgba(28, 40, 82, 0.42);
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  animation: asm-dialog-in .32s cubic-bezier(.34, 1.4, .64, 1) backwards;
}
.asm-dialog.closing { animation: asm-dialog-out .2s ease forwards; }
@keyframes asm-dialog-in {
  from { opacity: 0; transform: translateY(26px) scale(.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes asm-dialog-out {
  to { opacity: 0; transform: translateY(18px) scale(.96); }
}
/* 顶部流光装饰条 */
.asm-dialog-top {
  position: absolute;
  left: 0; top: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #5A7DFF, #FFB020, #3D5BF5, #5A7DFF);
  background-size: 260% 100%;
  animation: asm-sheen 2.4s linear infinite;
}
@keyframes asm-sheen {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}
.asm-dialog-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 30px; height: 30px;
  border: none;
  border-radius: 50%;
  background: #F1F4FB;
  color: #5B6675;
  font-size: .8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.asm-dialog-close:hover { background: #E4EBFA; color: #2A3346; transform: rotate(90deg); }
.asm-dialog-icon {
  width: 58px; height: 58px;
  margin: 6px auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
}
.asm-dialog-info    .asm-dialog-icon { background: #EEF3FF; color: #3D5BF5; }
.asm-dialog-warning .asm-dialog-icon { background: #FFF6E0; color: #C77B00; }
.asm-dialog-success .asm-dialog-icon { background: #E6F8F0; color: #1E9B6C; }
.asm-dialog-danger  .asm-dialog-icon { background: #FDEBEC; color: #E04552; }
.asm-dialog-title {
  font-size: 1.06rem;
  font-weight: 800;
  color: #2A3346;
  letter-spacing: .5px;
  margin-bottom: .5rem;
}
.asm-dialog-msg {
  font-size: .9rem;
  color: #5B6675;
  line-height: 1.75;
}
.asm-dialog-count {
  display: block;
  margin-top: .5rem;
  font-size: .78rem;
  color: #93A0B3;
  letter-spacing: .5px;
}
.asm-dialog-actions {
  display: flex;
  gap: .7rem;
  margin-top: 1.4rem;
}
.asm-btn {
  flex: 1;
  border: none;
  border-radius: 12px;
  padding: .72rem 1rem;
  font-size: .92rem;
  font-weight: 700;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 1px;
  cursor: pointer;
  transition: transform .2s cubic-bezier(.34, 1.56, .64, 1), box-shadow .2s ease, border-color .2s ease, color .2s ease, background .2s ease;
}
.asm-btn:active { transform: scale(.97); }
.asm-btn-primary {
  background: linear-gradient(135deg, #5A7DFF, #3D5BF5);
  color: #fff;
  box-shadow: 0 8px 20px rgba(61, 91, 245, 0.32);
}
.asm-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(61, 91, 245, 0.40); }
.asm-btn-danger {
  background: linear-gradient(135deg, #FF7A85, #F0525F);
  color: #fff;
  box-shadow: 0 8px 20px rgba(240, 82, 95, 0.32);
}
.asm-btn-danger:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(240, 82, 95, 0.40); }
.asm-btn-ghost {
  background: #fff;
  color: #5B6675;
  border: 1.5px solid #E3E9F4;
}
.asm-btn-ghost:hover { border-color: #C4D4FF; color: #3D5BF5; background: #F7FAFF; }
