/* ========================================================
   味源 OA 智能协同副驾驶 (Optic Glass AI Copilot) 样式体系
   ======================================================== */

.oa-ai-trigger-fab {
  position: fixed;
  z-index: 9999;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4A121A 0%, #6E1B27 50%, #872030 100%);
  color: #FFFFFF;
  border: 1.5px solid rgba(226, 168, 92, 0.7);
  box-shadow: 0 6px 20px rgba(74, 18, 26, 0.35), 0 0 16px rgba(200, 138, 62, 0.3);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease, border-color 0.22s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.oa-ai-trigger-fab.is-dragging {
  cursor: grabbing !important;
  transition: none !important;
  transform: scale(1.08) !important;
  box-shadow: 0 12px 32px rgba(74, 18, 26, 0.48), 0 0 24px rgba(200, 138, 62, 0.5) !important;
}

.oa-ai-trigger-fab:hover:not(.is-dragging) {
  transform: scale(1.08);
  box-shadow: 0 10px 28px rgba(74, 18, 26, 0.42), 0 0 24px rgba(200, 138, 62, 0.48);
  border-color: rgba(226, 168, 92, 0.95);
}

.oa-ai-trigger-fab:active:not(.is-dragging) {
  transform: scale(0.95);
}

.oa-ai-fab-core {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.oa-ai-fab-svg {
  display: block;
  margin-top: -3px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
  animation: oa-pulse-sparkle 3s infinite ease-in-out;
}

@keyframes oa-pulse-sparkle {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25)); }
  50% { transform: scale(1.06); filter: drop-shadow(0 0 8px rgba(226, 168, 92, 0.8)); }
}

.oa-ai-fab-badge {
  position: absolute;
  bottom: 3.5px;
  font-size: 8px;
  font-weight: 800;
  color: #FFF;
  background: linear-gradient(135deg, #C88A3E, #9C5F1C);
  padding: 0 4.5px;
  border-radius: 6px;
  letter-spacing: 0.6px;
  line-height: 1.25;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  border: 0.8px solid rgba(255, 255, 255, 0.45);
  font-family: -apple-system, BlinkMacSystemFont, monospace;
}

.oa-ai-fab-ping-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid rgba(200, 138, 62, 0.5);
  pointer-events: none;
  animation: oa-fab-ping 2.6s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes oa-fab-ping {
  0% { transform: scale(0.95); opacity: 0.8; }
  70%, 100% { transform: scale(1.28); opacity: 0; }
}

/* ================= 抽屉面板 ================= */
.oa-ai-drawer {
  position: fixed;
  right: 28px;
  bottom: 88px;
  width: 440px;
  height: 640px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 110px);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(74, 18, 26, 0.12);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(74, 18, 26, 0.18), 0 0 1px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10000;
  transform-origin: bottom right;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.9) translateY(20px);
}

.oa-ai-drawer.is-open {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
}

/* 顶部导航 */
.oa-ai-header {
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid rgba(74, 18, 26, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.oa-ai-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.oa-ai-logo-dot {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, #4A121A, #781C2A);
  color: #C88A3E;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
}

.oa-ai-title-wrap {
  display: flex;
  flex-direction: column;
}

.oa-ai-title {
  font-size: 15px;
  font-weight: 700;
  color: #4A121A;
}

.oa-ai-subtitle {
  font-size: 11px;
  color: #8C787B;
}

.oa-ai-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.oa-ai-icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #7E7072;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-size: 14px;
}

.oa-ai-icon-btn:hover {
  background: rgba(74, 18, 26, 0.06);
  color: #4A121A;
}

/* 快捷预设提示词芯片 */
.oa-ai-chips-bar {
  padding: 10px 16px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
  background: rgba(247, 244, 238, 0.6);
  border-bottom: 1px solid rgba(74, 18, 26, 0.05);
  scrollbar-width: none;
}

.oa-ai-chips-bar::-webkit-scrollbar {
  display: none;
}

.oa-ai-chip {
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(74, 18, 26, 0.1);
  color: #4A121A;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.oa-ai-chip:hover {
  background: #4A121A;
  color: #FFFFFF;
  border-color: #4A121A;
  transform: translateY(-1px);
}

/* 消息流区域 */
.oa-ai-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.oa-ai-msg {
  display: flex;
  flex-direction: column;
  max-width: 90%;
  animation: oa-msg-fade 0.3s ease;
}

@keyframes oa-msg-fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.oa-ai-msg.user {
  align-self: flex-end;
}

.oa-ai-msg.assistant {
  align-self: flex-start;
}

.oa-ai-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 13.5px;
  line-height: 1.6;
  word-break: break-word;
}

.oa-ai-msg.user .oa-ai-bubble {
  background: linear-gradient(135deg, #4A121A, #661824);
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(74, 18, 26, 0.18);
}

.oa-ai-msg.assistant .oa-ai-bubble {
  background: rgba(255, 255, 255, 0.95);
  color: #2D2325;
  border: 1px solid rgba(74, 18, 26, 0.08);
  border-bottom-left-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.oa-ai-tools-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 3px 8px;
  background: rgba(200, 138, 62, 0.12);
  border: 1px solid rgba(200, 138, 62, 0.25);
  color: #9E6422;
  border-radius: 6px;
  font-size: 11px;
}

/* 输入框区域 */
.oa-ai-footer {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.8);
  border-top: 1px solid rgba(74, 18, 26, 0.08);
}

.oa-ai-input-box {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: #FFFFFF;
  border: 1px solid rgba(74, 18, 26, 0.15);
  border-radius: 16px;
  padding: 8px 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  transition: border-color 0.2s;
}

.oa-ai-input-box:focus-within {
  border-color: #4A121A;
  box-shadow: 0 0 0 3px rgba(74, 18, 26, 0.1);
}

.oa-ai-textarea {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  font-size: 13.5px;
  font-family: inherit;
  color: #2D2325;
  max-height: 100px;
  line-height: 1.5;
  padding: 4px 0;
}

.oa-ai-send-btn {
  background: #4A121A;
  color: #FFFFFF;
  border: none;
  border-radius: 12px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}

.oa-ai-send-btn:hover {
  background: #781C2A;
  transform: scale(1.05);
}

.oa-ai-send-btn:disabled {
  background: #C4BDBC;
  cursor: not-allowed;
  transform: none;
}

/* 正在思考流光动效 */
.oa-ai-thinking {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #7E7072;
  font-size: 12px;
  padding: 8px 12px;
}

.oa-ai-thinking-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #C88A3E;
  animation: oa-dot-pulse 1.4s infinite ease-in-out both;
}

.oa-ai-thinking-dot:nth-child(1) { animation-delay: -0.32s; }
.oa-ai-thinking-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes oa-dot-pulse {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}
