/* ============================================================================
 * 麦麦克小秘书 · 全局悬浮球 + 右侧抽屉
 * 2026-11-06 阶段5
 *
 * 命名统一前缀 .asst- ，避免和现有 2000 行 app.css 里的类名撞车。
 * 层级：悬浮球 900 / 抽屉 901 —— 高过页面所有内容，
 *       但低于 Element Plus 的弹窗(2000+)，避免挡住确认框。
 * ========================================================================== */

/* ---------------------------------------------------------------- 悬浮球 */
.asst-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 900;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1e3a8a);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(30, 58, 138, .35);
  transition: transform .18s, box-shadow .18s;
  user-select: none;
}
.asst-fab:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 10px 26px rgba(30, 58, 138, .45);
}
.asst-fab:active { transform: scale(.97); }
.asst-fab-ico { font-size: 18px; line-height: 1; }
.asst-fab-txt { font-size: 9px; line-height: 1; opacity: .95; letter-spacing: .5px; }

/* 有新回答时的小红点（可选，暂未启用） */
.asst-fab-dot {
  position: absolute; top: 6px; right: 6px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #ef4444; border: 1.5px solid #fff;
}

/* ---------------------------------------------------------------- 抽屉 */
.asst-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 380px;
  z-index: 901;
  background: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(15, 32, 51, .18);
  border-left: 1px solid #e2e8f0;
  /* 用 transform 滑入，不改变原页面布局 → 满足「不打断操作」 */
  transform: translateX(0);
  transition: transform .22s ease;
}
.asst-drawer.hidden {
  /* 保持挂载但滑出屏幕：动画结束即不可见，也不占页面空间 */
  transform: translateX(100%);
  pointer-events: none;
}

/* ---------------------------------------------------------------- 顶部栏 */
.asst-head {
  flex: 0 0 auto;
  height: 52px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #eef2f7;
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #fff;
}
.asst-head-title { font-size: 15px; font-weight: 600; letter-spacing: .3px; }
.asst-head-sub {
  font-size: 10px; opacity: .75; margin-left: 2px;
  padding: 1px 6px; border: 1px solid rgba(255,255,255,.45); border-radius: 8px;
}
.asst-head-gap { flex: 1; }
.asst-head-btn {
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 15px; opacity: .9;
  transition: background .15s;
}
.asst-head-btn:hover { background: rgba(255,255,255,.18); opacity: 1; }

/* ---------------------------------------------------------------- 快捷问句 */
.asst-quick {
  flex: 0 0 auto;
  padding: 8px 10px 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
}
.asst-quick-item {
  font-size: 12px;
  padding: 4px 9px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #dbe4f0;
  color: #334155;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.asst-quick-item:hover {
  border-color: #3b82f6;
  color: #1d4ed8;
  background: #eff6ff;
}

/* ---------------------------------------------------------------- 消息区 */
.asst-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px 12px 6px;
  background: #f7f9fc;
  scroll-behavior: smooth;
}
.asst-msg { display: flex; margin-bottom: 14px; }
.asst-msg.me { justify-content: flex-end; }
.asst-bubble {
  max-width: 86%;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.62;
  word-break: break-word;
  white-space: pre-wrap;
}
.asst-msg.me .asst-bubble {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  border-bottom-right-radius: 3px;
}
.asst-msg.ai .asst-bubble {
  background: #fff;
  color: #1e293b;
  border: 1px solid #e8eef6;
  border-bottom-left-radius: 3px;
  box-shadow: 0 1px 2px rgba(15,32,51,.04);
}

/* 意图小标 */
.asst-intent {
  display: inline-block;
  font-size: 10px;
  padding: 0 5px;
  border-radius: 3px;
  margin-bottom: 5px;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #dbeafe;
}

/* 合规提示 */
.asst-warn {
  margin-top: 8px;
  padding: 6px 9px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  font-size: 12px;
  color: #9a3412;
  line-height: 1.5;
}

/* 保存到文稿库 */
.asst-save {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.asst-save-btn {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid #3b82f6;
  background: #fff;
  color: #2563eb;
  cursor: pointer;
  transition: all .15s;
}
.asst-save-btn:hover:not(:disabled) { background: #eff6ff; }
.asst-save-btn:disabled {
  border-color: #cbd5e1;
  color: #94a3b8;
  background: #f8fafc;
  cursor: default;
}
.asst-save-link { font-size: 12px; color: #2563eb; cursor: pointer; text-decoration: underline; }

/* 系统提示（错误/额度） */
.asst-sys {
  margin: 0 auto 14px;
  max-width: 94%;
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}
.asst-sys.err { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.asst-sys.warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }

/* loading */
.asst-loading { display: flex; align-items: center; gap: 5px; padding: 10px 14px; }
.asst-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #93c5fd;
  animation: asst-blink 1.2s infinite ease-in-out;
}
.asst-dot:nth-child(2) { animation-delay: .18s; }
.asst-dot:nth-child(3) { animation-delay: .36s; }
@keyframes asst-blink {
  0%, 80%, 100% { opacity: .3; transform: scale(.85); }
  40% { opacity: 1; transform: scale(1); }
}

/* 空态 */
.asst-empty {
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
}
.asst-empty-ico { font-size: 40px; margin-bottom: 10px; opacity: .8; }
.asst-empty-t { font-size: 14px; color: #475569; margin-bottom: 6px; font-weight: 600; }
.asst-empty-s { font-size: 12px; line-height: 1.7; }

/* ---------------------------------------------------------------- 输入区 */
.asst-foot {
  flex: 0 0 auto;
  border-top: 1px solid #eef2f7;
  padding: 9px 10px 7px;
  background: #fff;
}
.asst-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.asst-ta {
  flex: 1;
  min-height: 38px;
  max-height: 96px;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.5;
  font-family: inherit;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  resize: none;
  outline: none;
  transition: border-color .15s;
  background: #fbfdff;
}
.asst-ta:focus { border-color: #3b82f6; background: #fff; }
.asst-ta:disabled { background: #f1f5f9; color: #94a3b8; }
.asst-send {
  flex: 0 0 auto;
  height: 38px;
  padding: 0 16px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.asst-send:hover:not(:disabled) { box-shadow: 0 3px 10px rgba(37,99,235,.35); }
.asst-send:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  box-shadow: none;
}
.asst-quota {
  margin-top: 5px;
  font-size: 11px;
  color: #94a3b8;
  text-align: right;
}
.asst-quota.warn { color: #d97706; }
.asst-quota.out { color: #dc2626; font-weight: 600; }

/* ---------------------------------------------------------------- 窄屏适配 */
@media (max-width: 640px) {
  .asst-drawer { width: 100%; }
}

/* ---------------------------------------------------------------- 5.2 空态引导 */
.asst-empty-list {
  margin: 12px 0 14px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.asst-empty-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.6;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  padding: 8px 10px;
}
.asst-empty-k { flex: 0 0 auto; font-size: 13px; line-height: 1.6; }
.asst-empty-rule {
  margin: 0 auto 14px;
  max-width: 300px;
  padding: 9px 11px;
  font-size: 11.5px;
  line-height: 1.7;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  text-align: left;
}
.asst-empty-rule b { color: #78350f; font-weight: 600; }
.asst-empty-tip { font-size: 11.5px; color: #94a3b8; margin-top: 4px; }
