/* ============================================================
   AI 找鞋助手 — 浮窗样式（暗色科技风）
   ============================================================ */

/* ---- FAB 浮动按钮 ---- */
.ai-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(99, 102, 241, 0.45), 0 0 0 0 rgba(139, 92, 246, 0.4);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
  animation: ai-pulse 2.5s infinite;
}
.ai-fab:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 6px 32px rgba(99, 102, 241, 0.6);
}
@keyframes ai-pulse {
  0% { box-shadow: 0 4px 24px rgba(99, 102, 241, 0.45), 0 0 0 0 rgba(139, 92, 246, 0.5); }
  70% { box-shadow: 0 4px 24px rgba(99, 102, 241, 0.45), 0 0 0 16px rgba(139, 92, 246, 0); }
  100% { box-shadow: 0 4px 24px rgba(99, 102, 241, 0.45), 0 0 0 0 rgba(139, 92, 246, 0); }
}

/* ---- 聊天面板 ---- */
.ai-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 48px);
  background: rgba(17, 17, 27, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ai-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ---- 面板头部 ---- */
.ai-panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.ai-panel-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.ai-panel-titles { flex: 1; min-width: 0; }
.ai-panel-title {
  color: #f0f0f5;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.ai-panel-sub {
  color: #8686a3;
  font-size: 11px;
  margin-top: 1px;
}
.ai-panel-close {
  background: none;
  border: none;
  color: #8686a3;
  font-size: 24px;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
  transition: color 0.2s;
}
.ai-panel-close:hover { color: #f0f0f5; }

/* ---- 消息区 ---- */
.ai-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.ai-panel-body::-webkit-scrollbar { width: 4px; }
.ai-panel-body::-webkit-scrollbar-track { background: transparent; }
.ai-panel-body::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.3); border-radius: 4px; }

.ai-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
  animation: ai-fadeIn 0.3s ease;
}
@keyframes ai-fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.ai-msg-bot {
  background: rgba(255, 255, 255, 0.06);
  color: #d0d0e0;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.ai-msg-user {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.ai-summary {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  font-size: 12px;
}
.ai-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

/* ---- 思考动画 ---- */
.ai-thinking {
  display: flex;
  align-items: center;
  gap: 3px;
}
.ai-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #8b5cf6;
  animation: ai-bounce 1.4s infinite;
}
.ai-dot:nth-child(2) { animation-delay: 0.2s; }
.ai-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes ai-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ---- 建议词条 ---- */
.ai-suggest {
  margin-top: 4px;
}
.ai-suggest-label {
  color: #8686a3;
  font-size: 11px;
  margin-bottom: 8px;
}
.ai-chip {
  display: inline-block;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 980px;
  margin: 0 6px 6px 0;
  cursor: pointer;
  transition: all 0.2s;
}
.ai-chip:hover {
  background: rgba(139, 92, 246, 0.25);
  border-color: rgba(139, 92, 246, 0.4);
  color: #e0d5ff;
}

/* ---- 商品卡片 ---- */
.ai-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.ai-card {
  display: flex;
  align-items: stretch;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
  animation: ai-fadeIn 0.4s ease;
}
.ai-card:hover {
  border-color: rgba(139, 92, 246, 0.3);
  transform: translateX(2px);
}
.ai-card-link {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  padding: 8px;
  text-decoration: none;
  min-width: 0;
}
.ai-card-img {
  width: 56px; height: 56px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ai-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.ai-card-info {
  flex: 1;
  min-width: 0;
}
.ai-card-brand {
  color: #8686a3;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ai-card-name {
  color: #e0e0e8;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 2px 0;
}
.ai-card-price {
  color: #a5b4fc;
  font-size: 14px;
  font-weight: 700;
}
.ai-card-add {
  background: rgba(99, 102, 241, 0.15);
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  color: #a5b4fc;
  font-size: 12px;
  font-weight: 600;
  padding: 0 14px;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.ai-card-add:hover {
  background: rgba(99, 102, 241, 0.3);
  color: #fff;
}

/* ---- 输入区 ---- */
.ai-panel-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.2);
}
.ai-panel-input input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 980px;
  padding: 10px 16px;
  color: #e0e0e8;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.ai-panel-input input::placeholder { color: #5c5c70; }
.ai-panel-input input:focus {
  border-color: rgba(139, 92, 246, 0.4);
  background: rgba(255, 255, 255, 0.08);
}
.ai-send-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s, box-shadow 0.2s;
}
.ai-send-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.5);
}
.ai-photo-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #8686a3;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}
.ai-photo-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  transform: scale(1.08);
}
.ai-msg-photo {
  padding: 4px;
  background: transparent;
}
.ai-msg-photo img {
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ---- 移动端 ---- */
@media (max-width: 480px) {
  .ai-panel {
    bottom: 0; right: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border: none;
  }
  .ai-fab {
    bottom: 16px; right: 16px;
    width: 52px; height: 52px;
  }
}
