/* ========== 飞书在线客服样式 ========== */

/* 悬浮按钮：固定在屏幕右侧中间，始终可见 */
.feishu-fab {
  position: fixed;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  z-index: 9999;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #3370FF, #1d5fe0);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(51, 112, 255, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.feishu-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(51, 112, 255, 0.5);
}

.feishu-fab:active {
  transform: scale(0.96);
}

.feishu-fab-icon {
  width: 30px;
  height: 30px;
}

.feishu-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ff4d4f;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  color: #fff;
}

/* 聊天窗口：固定在屏幕右下角（不随页面滚动） */
.feishu-chat-window {
  position: fixed;
  bottom: 96px;
  right: 20px;
  z-index: 10000;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 540px;
  max-height: calc(100vh - 120px);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18), 0 0 1px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: feishu-slide-up 0.25s ease-out;
}

@keyframes feishu-slide-up {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 头部 */
.feishu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
  background: #fafafa;
}

.feishu-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.feishu-icon-sm {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.feishu-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #111;
  line-height: 1.3;
}

.feishu-subtitle {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: #888;
  line-height: 1.3;
}

.feishu-close-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #999;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.feishu-close-btn:hover {
  background: #e8e8e8;
  color: #333;
}

/* 消息列表 */
.feishu-msg-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  background: #ededed;
}

.feishu-msg-list::-webkit-scrollbar {
  width: 4px;
}

.feishu-msg-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 4px;
}

/* 欢迎语 */
.feishu-welcome {
  max-width: 85%;
  margin: 0 auto 16px;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 6px;
  font-size: 12.5px;
  line-height: 1.55;
  color: #666;
  text-align: center;
}

/* 消息行 */
.feishu-msg-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 14px;
}

.feishu-msg-user {
  flex-direction: row-reverse;
}

/* 头像 */
.feishu-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feishu-avatar-admin {
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.feishu-avatar-admin svg {
  width: 22px;
  height: 22px;
}

.feishu-avatar-user {
  background: #576b95;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

/* 气泡 */
.feishu-bubble {
  display: inline-block;
  max-width: calc(100% - 80px);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.feishu-bubble-admin {
  background: #fff;
  color: #111;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.feishu-bubble-user {
  background: #95ec69;
  color: #111;
}

.feishu-bubble-system {
  text-align: center;
  font-size: 12px;
  color: #999;
  padding: 4px 10px;
  background: transparent;
}

/* 输入区 */
.feishu-composer {
  flex-shrink: 0;
  background: #f7f7f7;
  border-top: 1px solid #e5e5e5;
  padding: 10px 12px 12px;
}

.feishu-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #111;
  background: #fff;
  resize: none;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
}

.feishu-input:focus {
  border-color: #3370FF;
}

.feishu-input::placeholder {
  color: #b2b2b2;
}

.feishu-composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.feishu-hint {
  font-size: 11.5px;
  color: #999;
}

.feishu-send-btn {
  min-width: 52px;
  height: 30px;
  padding: 0 14px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  background: #c9c9c9;
  cursor: not-allowed;
  transition: background 0.15s;
}

.feishu-send-btn:not(:disabled) {
  background: #07c160;
  cursor: pointer;
}

.feishu-send-btn:not(:disabled):hover {
  background: #06ad56;
}

/* 响应式：移动端 */
@media (max-width: 480px) {
  .feishu-chat-window {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 12px 12px 0 0;
  }

  .feishu-fab {
    width: 50px;
    height: 50px;
  }
}
