/* ===== GLOBAL AI ASSISTANT - 公共浮窗样式 ===== */
/* 从 student/home.css 提取，供所有学生端页面共用 */
/* 路径: /student/components/global-ai-assistant.css */

.gai-root { all: initial; }

.gai-float {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  user-select: none;
  cursor: grab;
  font-family: 'Plus Jakarta Sans', 'Microsoft YaHei', sans-serif;
}
.gai-float.dragging { cursor: grabbing; }
.gai-float-tip {
  background: rgba(26, 31, 46, 0.95);
  border: 1px solid rgba(193, 255, 254, 0.2);
  border-radius: 12px;
  padding: 6px 12px;
  font-size: 12px;
  color: #ECEDF6;
  white-space: nowrap;
  margin-bottom: 8px;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  font-weight: 500;
  backdrop-filter: blur(10px);
}
.gai-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2.5px solid white;
  overflow: hidden;
  background: linear-gradient(135deg, #00E6E6, #BF81FF);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(193, 255, 254, 0.4);
  transition: transform 0.2s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.gai-avatar:hover { transform: scale(1.1); }
.gai-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gai-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #0B0E14;
  background: linear-gradient(135deg, #00E6E6, #BF81FF);
}
.gai-online-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #4ade80;
  border: 2px solid white;
  animation: gai-pulse 2s infinite;
}
@keyframes gai-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* AI Chat Window */
.gai-chat {
  position: fixed;
  z-index: 10000;
  width: 340px;
  max-height: 480px;
  background: rgba(22, 26, 33, 0.98);
  border: 1px solid rgba(193, 255, 254, 0.25);
  border-radius: 20px;
  overflow: hidden;
  display: none;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(193, 255, 254, 0.15);
  backdrop-filter: blur(20px);
  font-family: 'Plus Jakarta Sans', 'Microsoft YaHei', sans-serif;
}
.gai-chat.open {
  display: flex;
  flex-direction: column;
}
.gai-chat-hd {
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(0, 230, 230, 0.08), rgba(209, 163, 255, 0.06));
  border-bottom: 1px solid rgba(193, 255, 254, 0.15);
  display: flex;
  align-items: center;
  gap: 10px;
}
.gai-chat-av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid #00E6E6;
  background: linear-gradient(135deg, #00E6E6, #BF81FF);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.gai-chat-av img { width: 100%; height: 100%; object-fit: cover; }
.gai-chat-name { font-size: 14px; font-weight: 800; color: #ECEDF6; }
.gai-chat-sub { font-size: 11px; color: #A9ABB3; }
.gai-chat-sub.is-busy { color: #C1FFFE; }
.gai-chat-close {
  font-size: 20px;
  cursor: pointer;
  color: #A9ABB3;
  background: none;
  border: none;
  line-height: 1;
  margin-left: auto;
  padding: 0 4px;
  font-family: inherit;
  transition: color 0.2s;
}
.gai-chat-close:hover { color: #f87171; }

.gai-msgs {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 280px;
  overflow-y: auto;
  background: rgba(11, 14, 20, 0.5);
}
.gai-msgs::-webkit-scrollbar { width: 5px; }
.gai-msgs::-webkit-scrollbar-track { background: transparent; }
.gai-msgs::-webkit-scrollbar-thumb { background: rgba(193, 255, 254, 0.2); border-radius: 3px; }

.gai-msg { display: flex; gap: 8px; align-items: flex-end; }
.gai-msg.user { flex-direction: row-reverse; }
.gai-msg-av {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(193, 255, 254, 0.2);
  background: linear-gradient(135deg, #00E6E6, #BF81FF);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.gai-msg-av img { width: 100%; height: 100%; object-fit: cover; }
.gai-msg-av-u {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 117, 252, 0.2), rgba(209, 163, 255, 0.2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #FF51FA;
  flex-shrink: 0;
  border: 1px solid rgba(255, 117, 252, 0.3);
}
.gai-bubble {
  max-width: 80%;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.65;
  border-radius: 16px;
  word-wrap: break-word;
}
.gai-bubble.ai-b {
  background: rgba(37, 43, 59, 0.9);
  color: #ECEDF6;
  border: 1px solid rgba(193, 255, 254, 0.15);
  border-bottom-left-radius: 4px;
}
.gai-bubble.user-b {
  background: linear-gradient(135deg, rgba(0, 230, 230, 0.15), rgba(209, 163, 255, 0.1));
  color: #ECEDF6;
  border: 1px solid rgba(193, 255, 254, 0.2);
  border-bottom-right-radius: 4px;
}

/* Typing Animation */
.gai-typing-b {
  background: rgba(37, 43, 59, 0.9);
  border: 1px solid rgba(193, 255, 254, 0.15);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  padding: 12px 16px;
  display: flex;
  gap: 4px;
  align-items: center;
}
.gai-td {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #C1FFFE;
  animation: gai-bounce 1s ease-in-out infinite;
}
.gai-td:nth-child(2) { animation-delay: 0.15s; }
.gai-td:nth-child(3) { animation-delay: 0.3s; }
@keyframes gai-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* Quick Questions (optional) */
.gai-qq-row { padding: 0 14px 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.gai-qq {
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 20px;
  border: 1px solid rgba(193, 255, 254, 0.2);
  background: transparent;
  color: #A9ABB3;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  font-family: 'Plus Jakarta Sans', 'Microsoft YaHei', sans-serif;
  font-weight: 600;
}
.gai-qq:hover {
  background: rgba(193, 255, 254, 0.1);
  color: #C1FFFE;
  border-color: rgba(193, 255, 254, 0.35);
}

/* Input Area */
.gai-inp-row {
  padding: 12px 14px;
  border-top: 1px solid rgba(193, 255, 254, 0.15);
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(22, 26, 33, 0.8);
}
.gai-inp {
  flex: 1;
  border: 1px solid rgba(193, 255, 254, 0.2);
  border-radius: 22px;
  padding: 8px 14px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.04);
  color: #ECEDF6;
  outline: none;
  font-family: 'Plus Jakarta Sans', 'Microsoft YaHei', sans-serif;
  transition: border-color 0.2s ease;
}
.gai-inp:focus { border-color: #C1FFFE; box-shadow: 0 0 0 3px rgba(193, 255, 254, 0.1); }
.gai-inp::placeholder { color: rgba(203, 208, 219, 0.4); }
.gai-inp:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
.gai-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00E6E6, #00b8b8);
  color: #0B0E14;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(0, 230, 230, 0.3);
}
.gai-send:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(0, 230, 230, 0.45);
}
.gai-send:active { transform: scale(0.95); }
.gai-send:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.gai-send.is-busy {
  background: linear-gradient(135deg, #7dd3fc, #38bdf8);
}
.gai-send-wait {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .gai-chat { width: calc(100vw - 32px); max-width: 340px; }
  .gai-float { right: 16px; bottom: 16px; }
  .gai-avatar { width: 50px; height: 50px; }
}
