/* =========================================================
 * 站内统一弹窗 / 轻提示（kb-dialog.css）
 * 与知识库前端视觉保持一致：圆角、暖色主色、柔和阴影
 * ========================================================= */

/* ---------- 遮罩 ---------- */
body.kbd-locked { overflow: hidden; }

.kbd-mask {
  position: fixed; inset: 0; z-index: 99990;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(20, 22, 38, .45);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .18s ease;
}
.kbd-mask.show { opacity: 1; }
/* 关闭淡出期间：不再拦截点击，也不再算作「打开的弹窗」（否则会残留 body 锁滚动） */
.kbd-mask.kbd-closing { pointer-events: none; }

/* ---------- 弹窗主体 ---------- */
.kbd-box {
  width: 404px; max-width: 100%; max-height: 88vh; overflow: auto;
  background: #fff; border-radius: 20px;
  padding: 26px 26px 20px; text-align: center;
  box-shadow: 0 40px 90px -30px rgba(20, 22, 38, .55), 0 2px 0 rgba(255, 255, 255, .6) inset;
  transform: translateY(12px) scale(.97); opacity: 0;
  transition: transform .24s cubic-bezier(.2, .9, .3, 1.15), opacity .18s ease;
}
.kbd-mask.show .kbd-box { transform: none; opacity: 1; }

/* 顶部细色条：随类型变化 */
.kbd-box { position: relative; overflow: hidden; }
.kbd-box::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, #ff6b35, #ff8f5e);
}
.kbd-box.kbd-success::before { background: linear-gradient(90deg, #06a96e, #34d399); }
.kbd-box.kbd-error::before { background: linear-gradient(90deg, #ef4444, #f87171); }
.kbd-box.kbd-login::before { background: linear-gradient(90deg, #2563eb, #7c3aed); }

/* ---------- 图标 ---------- */
.kbd-ico {
  width: 56px; height: 56px; margin: 2px auto 14px;
  border-radius: 18px; display: flex; align-items: center; justify-content: center;
  font-size: 27px; line-height: 1;
  background: linear-gradient(135deg, #fff2e9, #ffe3d3);
  box-shadow: 0 10px 22px -14px rgba(255, 107, 53, .8);
}
.kbd-box.kbd-success .kbd-ico { background: linear-gradient(135deg, #e7fbf2, #d3f7e6); box-shadow: 0 10px 22px -14px rgba(6, 169, 110, .8); }
.kbd-box.kbd-error .kbd-ico { background: linear-gradient(135deg, #fdecec, #fbdcdc); box-shadow: 0 10px 22px -14px rgba(239, 68, 68, .8); }
.kbd-box.kbd-login .kbd-ico { background: linear-gradient(135deg, #e8f1ff, #ebe4ff); box-shadow: 0 10px 22px -14px rgba(37, 99, 235, .8); }

/* ---------- 文案 ---------- */
.kbd-title {
  font-size: 17.5px; font-weight: 800; color: #2b2f44; letter-spacing: .3px;
  margin-bottom: 10px; line-height: 1.45;
}
.kbd-text { color: #6b7280; font-size: 13.5px; line-height: 1.85; }
.kbd-text p { margin: 0 0 6px; }
.kbd-text p:last-child { margin-bottom: 0; }
.kbd-text b { color: #2b2f44; }
.kbd-text .kbd-em {
  color: #ff6b35; font-weight: 700; font-style: normal;
}

/* ---------- 按钮 ---------- */
.kbd-foot { display: flex; gap: 10px; margin-top: 20px; }
.kbd-foot.one .kbd-btn { flex: 1; }
.kbd-btn {
  flex: 1; height: 42px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid #eceef5; background: #fff;
  color: #6b7280; font-size: 13.5px; font-weight: 700;
  font-family: inherit; transition: all .18s;
}
.kbd-btn:hover { border-color: #ffb38a; color: #ff6b35; }
.kbd-btn:active { transform: translateY(1px); }
.kbd-btn.primary {
  background: linear-gradient(135deg, #ff6b35, #ff8f5e);
  border-color: transparent; color: #fff;
  box-shadow: 0 12px 24px -14px rgba(255, 107, 53, .9);
}
.kbd-btn.primary:hover { filter: brightness(1.05); color: #fff; }
.kbd-btn.danger {
  background: linear-gradient(135deg, #ef4444, #f87171);
  border-color: transparent; color: #fff;
  box-shadow: 0 12px 24px -14px rgba(239, 68, 68, .9);
}
.kbd-btn.danger:hover { filter: brightness(1.05); color: #fff; }
.kbd-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255, 107, 53, .22); }

/* ---------- 轻提示（toast） ---------- */
.kbd-toast-wrap {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  z-index: 99999; display: flex; flex-direction: column; align-items: center; gap: 10px;
  pointer-events: none; padding: 0 16px;
}
.kbd-toast {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid #f0e9e2; border-radius: 999px;
  padding: 10px 18px; max-width: min(88vw, 520px);
  color: #2b2f44; font-size: 13px; font-weight: 600; line-height: 1.5;
  box-shadow: 0 18px 40px -18px rgba(20, 22, 38, .45);
  opacity: 0; transform: translateY(-10px);
  transition: opacity .2s ease, transform .24s cubic-bezier(.2, .9, .3, 1.15);
}
.kbd-toast.show { opacity: 1; transform: none; }
.kbd-toast.out { opacity: 0; transform: translateY(-8px); }
.kbd-toast-ico { font-size: 15px; line-height: 1; }
.kbd-toast.success { border-color: #d3f7e6; }
.kbd-toast.error { border-color: #fbdcdc; }

/* ---------- 移动端 ---------- */
@media (max-width: 480px) {
  .kbd-box { width: 100%; padding: 22px 18px 16px; border-radius: 18px; }
  .kbd-title { font-size: 16.5px; }
  .kbd-btn { height: 44px; }
}
