/* SmarTOP AI 客服样式 — 坚锋™ Topcentral™ www.topcentral.vip */

/* 浮动按钮 */
#smartop-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a5f7a, #134e63);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(26, 95, 122, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 24px;
}

#smartop-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(26, 95, 122, 0.45);
}

/* 聊天窗口 */
#smartop-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  z-index: 9998;
  width: 380px;
  height: 560px;
  max-height: calc(100vh - 140px);
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

#smartop-window.open {
  display: flex;
}

/* 头部 */
#smartop-header {
  background: linear-gradient(135deg, #1a5f7a, #134e63);
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

#smartop-header h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

#smartop-header .subtitle {
  font-size: 11px;
  opacity: 0.8;
  margin-top: 2px;
}

#smartop-close {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.8;
}

#smartop-close:hover {
  opacity: 1;
}

/* 消息区 */
#smartop-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
}

/* 消息气泡 */
.smartop-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
  word-wrap: break-word;
  animation: smartop-fadeIn 0.3s ease;
}

@keyframes smartop-fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.smartop-msg.user {
  align-self: flex-end;
  background: #1a5f7a;
  color: white;
  border-bottom-right-radius: 4px;
}

.smartop-msg.bot {
  align-self: flex-start;
  background: white;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
}

.smartop-msg.bot a {
  color: #1a5f7a;
  text-decoration: underline;
}

/* 快捷问题 */
#smartop-quick {
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 1px solid #e2e8f0;
  background: white;
}

.smartop-quick-btn {
  padding: 6px 12px;
  font-size: 11px;
  border: 1px solid #d1d5db;
  border-radius: 16px;
  background: white;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.smartop-quick-btn:hover {
  background: #f0fdfa;
  border-color: #1a5f7a;
  color: #1a5f7a;
}

/* 输入区 */
#smartop-input-area {
  padding: 12px 16px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
  background: white;
}

#smartop-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 24px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

#smartop-input:focus {
  border-color: #1a5f7a;
  box-shadow: 0 0 0 2px rgba(87, 197, 182, 0.28);
}

#smartop-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #1a5f7a;
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

#smartop-send:hover {
  background: #134e63;
}

/* 打字指示器 */
.smartop-typing {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  align-items: center;
}

.smartop-typing span {
  width: 6px;
  height: 6px;
  background: #94a3b8;
  border-radius: 50%;
  animation: smartop-bounce 1.4s infinite;
}

.smartop-typing span:nth-child(2) { animation-delay: 0.2s; }
.smartop-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes smartop-bounce {
  0%, 80%, 100% { transform: scale(0.6); }
  40% { transform: scale(1); }
}

/* 溯源提示 */
#smartop-trace {
  padding: 6px 16px;
  font-size: 10px;
  color: #94a3b8;
  text-align: center;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
}

/* 移动端适配 */
@media (max-width: 480px) {
  #smartop-window {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 88px;
    height: 60vh;
  }
}
