/* ===== ForgePrecision AI — Chat Widget ===== */
/* 全站统一的聊天浮动窗口，所有页面共用 */

/* ---- CSS ---- */
.chat-widget-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  cursor: pointer;
  width: 56px;
  height: 56px;
  border-radius: 28px;
  background: linear-gradient(135deg, #5B3CC4, #7C5CFC);
  box-shadow: 0 4px 20px rgba(91, 60, 196, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}
.chat-widget-btn:hover { transform: scale(1.1); }

.chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ff4757;
  color: white;
  font-size: 11px;
  width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.chat-widget {
  display: none;
  position: fixed;
  bottom: 90px;
  right: 24px;
  z-index: 9999;
  width: 360px;
  height: 520px;
  border-radius: 16px;
  background: white;
  box-shadow: 0 8px 40px rgba(0,0,0,0.15);
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  flex-direction: column;
  border: 1px solid #e8e8e8;
  animation: slideUp 0.3s ease;
}

.chat-header {
  background: linear-gradient(135deg, #5B3CC4, #7C5CFC);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-close {
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 14px;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f8f9fa;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

.chat-quick-replies {
  padding: 6px 12px;
  background: white;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  border-top: 1px solid #eee;
}
.chat-quick-tag {
  background: #f0edff;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  cursor: pointer;
  color: #5B3CC4;
  white-space: nowrap;
  transition: all 0.2s;
}
.chat-quick-tag:hover { background: #ddd6ff; }

.chat-input-row {
  padding: 8px 12px 12px;
  background: white;
  display: flex;
  gap: 8px;
}
.chat-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
.chat-input:focus { border-color: #7C5CFC; }
.chat-send-btn {
  border: none;
  background: linear-gradient(135deg, #5B3CC4, #7C5CFC);
  color: white;
  border-radius: 20px;
  padding: 8px 18px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}
.chat-send-btn:hover { opacity: 0.9; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-msg {
  display: flex;
  margin-bottom: 12px;
  align-items: flex-start;
}
.chat-msg-ai { justify-content: flex-start; }
.chat-msg-user { justify-content: flex-end; }

.chat-avatar {
  width: 32px; height: 32px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.chat-avatar-ai {
  background: linear-gradient(135deg, #5B3CC4, #7C5CFC);
  color: white;
  margin-right: 8px;
}
.chat-avatar-user {
  background: #666;
  color: white;
  margin-left: 8px;
}

.chat-bubble {
  padding: 10px 14px;
  max-width: 260px;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.chat-bubble-ai {
  background: white;
  color: #333;
  border-radius: 12px 12px 12px 0;
}
.chat-bubble-user {
  background: #5B3CC4;
  color: white;
  border-radius: 12px 12px 0 12px;
}

/* 注册引导按钮 */
.chat-register-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 20px;
  background: linear-gradient(135deg, #5B3CC4, #7C5CFC);
  color: white !important;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  font-size: 13px;
}

/* 响应式 */
@media (max-width: 480px) {
  .chat-widget {
    width: 100%;
    height: 100%;
    bottom: 0;
    right: 0;
    border-radius: 0;
  }
}
\n@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }
