/* 置顶消息容器 - 优化为更紧凑的布局 */
.pinned-messages-container {
  position: sticky;
  top: 0;
  z-index: 50;
  margin-bottom: 4px;
  /* 减少底部间距 */
  animation: pinnedSlideIn 0.3s ease-out;
  max-height: 40vh;
  /* 限制最大高度 */
  overflow: hidden;
}

.pinned-messages-container.mobile {
  position: sticky;
  top: 0;
  z-index: 20;
  margin-bottom: 2px;
  /* 移动端进一步减少间距 */
  max-height: 35vh;
  /* 移动端更小的最大高度 */
}

/* 平板模式优化 */
.pinned-messages-container.tablet {
  margin-bottom: 3px;
  /* 减少平板模式间距 */
  z-index: 40;
  max-height: 35vh;
  /* 平板模式更小的最大高度 */
}

/* 置顶消息卡片 - 平板模式紧凑布局 */
.pinned-messages-card {
  background: linear-gradient(135deg, #fff8e1 0%, #fff3c4 100%);
  border: 1px solid #faad14;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(250, 173, 20, 0.15);
  transition: all 0.3s ease;
  overflow: hidden;
  transform-origin: top center;
}

/* 折叠状态的卡片 - 更加紧凑 */
.pinned-messages-card:not(.expanded) {
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(250, 173, 20, 0.1);
}

.pinned-messages-card.tablet-mode {
  background: linear-gradient(135deg, #fffbf0 0%, #fff8e1 100%);
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(250, 173, 20, 0.1);
  margin: 0 4px;
}

.pinned-messages-card.tablet-mode .pinned-header {
  padding: 4px 8px;
  /* 进一步减少内边距 */
  background: rgba(250, 173, 20, 0.08);
}

.pinned-messages-card.tablet-mode .pinned-message-content {
  padding: 8px 10px;
  gap: 6px;
}

.pinned-messages-card.tablet-mode .pinned-text .ant-typography {
  font-size: 13px;
  line-height: 1.3;
}

.pinned-messages-card.tablet-mode .pinned-jump .ant-btn {
  height: 24px;
  font-size: 11px;
  padding: 0 8px;
}

.pinned-messages-card:hover {
  box-shadow: 0 4px 12px rgba(250, 173, 20, 0.25);
  transform: translateY(-1px);
}

.pinned-messages-card.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: #f9f9f9;
  border-color: #d9d9d9;
}

/* 置顶消息头部 - 减少高度 */
.pinned-header {
  display: flex;
  align-items: center;
  gap: 4px;
  /* 减少间距 */
  padding: 3px 8px;
  /* 减少内边距 */
  background: rgba(250, 173, 20, 0.1);
  border-bottom: 1px solid rgba(250, 173, 20, 0.2);
  min-height: 28px;
  /* 设置最小高度 */
  cursor: pointer;
  /* 让整个头部可点击 */
  user-select: none;
  /* 防止文字被选中 */
}

/* 折叠状态下不显示底部边框 */
.pinned-messages-card:not(.expanded) .pinned-header {
  border-bottom: none;
}

/* 可点击提示 */
.pinned-header:hover {
  background-color: rgba(250, 173, 20, 0.15);
}

.pinned-icon {
  color: #faad14;
  font-size: 14px;
  /* 减少图标大小 */
  flex-shrink: 0;
}

.pinned-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  /* 减少间距 */
}

.pinned-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pinned-count {
  font-size: 12px;
  background: rgba(250, 173, 20, 0.2);
  padding: 2px 6px;
  border-radius: 10px;
  white-space: nowrap;
}

.pinned-dots {
  display: flex;
  gap: 4px;
}

.pinned-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(250, 173, 20, 0.3);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.pinned-dot:hover {
  background: rgba(250, 173, 20, 0.6);
  transform: scale(1.3);
  box-shadow: 0 2px 4px rgba(250, 173, 20, 0.3);
}

.pinned-dot.active {
  background: #faad14;
  transform: scale(1.4);
  box-shadow: 0 2px 6px rgba(250, 173, 20, 0.4);
}

.pinned-dot.active::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border: 1px solid rgba(250, 173, 20, 0.4);
  border-radius: 50%;
  animation: dotPulse 2s infinite;
}

@keyframes dotPulse {
  0% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.pinned-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 置顶消息内容 */
.pinned-content {
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

/* 消息内容部分 - 进一步减少高度 */
.pinned-content.visible {
  max-height: 80px;
  /* 大幅减少最大高度 */
  opacity: 1;
  transform: translateY(0);
}

.pinned-content.hidden {
  max-height: 0;
  opacity: 0;
  transform: translateY(-10px);
}

.pinned-message-content {
  padding: 4px 8px;
  /* 减少内边距 */
  display: flex;
  flex-direction: column;
  gap: 2px;
  /* 减少间距 */
  animation: contentSlideIn 0.3s ease-out;
}

@keyframes contentSlideIn {
  from {
    opacity: 0;
    transform: translateX(10px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 发送者信息 - 更紧凑 */
.pinned-sender {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
  /* 减少间距 */
}

.pinned-date {
  font-size: 11px;
  /* 减小字体 */
}

/* 消息文本 - 更紧凑 */
.pinned-text {
  color: #262626;
  line-height: 1.2;
  /* 减少行高 */
  font-size: 12px;
  /* 减小字体大小 */
}

.pinned-text .ant-typography {
  color: inherit;
  font-size: 12px;
  /* 保持一致的字体大小 */
}

/* 媒体信息 */
.pinned-media {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #8c8c8c;
}

/* 跳转按钮 - 更小巧 */
.pinned-jump {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
  /* 减少上边距 */
}

.pinned-jump .ant-btn {
  border-radius: 12px;
  font-size: 11px;
  /* 减小字体 */
  height: 22px;
  /* 减小高度 */
  padding: 0 8px;
}

/* 展开状态 */
.pinned-messages-card.expanded {
  border-radius: 8px 8px 0 0;
  margin-bottom: 0;
}

/* 动画效果 */
@keyframes pinnedSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 添加折叠/展开按钮样式 */
.pinned-toggle-btn {
  padding: 0 4px;
  height: 22px;
  width: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 4px;
  background-color: rgba(250, 173, 20, 0.1);
  border: none;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.pinned-toggle-btn:hover {
  background-color: rgba(250, 173, 20, 0.2);
  transform: translateY(-1px);
}

.pinned-toggle-btn:active {
  transform: translateY(0);
}

/* 移动端适配 - 更紧凑的布局 */
@media (max-width: 768px) {
  .pinned-messages-container {
    margin-bottom: 2px;
    /* 进一步减少移动端间距 */
  }

  .pinned-messages-card {
    border-radius: 6px;
  }

  .pinned-header {
    padding: 2px 6px;
    /* 减少移动端头部内边距 */
  }

  .pinned-icon {
    font-size: 12px;
  }

  .pinned-info .ant-typography {
    font-size: 12px;
  }

  .pinned-message-content {
    padding: 4px 8px;
    /* 减少移动端内容内边距 */
    gap: 3px;
    /* 减少移动端间距 */
  }

  .pinned-text {
    font-size: 12px;
    /* 减小移动端字体 */
    line-height: 1.2;
    /* 减少移动端行高 */
  }

  .pinned-jump .ant-btn {
    font-size: 10px;
    height: 20px;
    /* 减小按钮高度 */
    padding: 0 6px;
  }

  .pinned-toggle-btn {
    height: 20px;
    width: 20px;
    padding: 0 2px;
  }
}

/* 置顶消息空状态 */
.pinned-empty {
  text-align: center;
  padding: 16px;
  color: #8c8c8c;
}

/* 置顶消息指示器 */
.pinned-indicator {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #faad14;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  animation: pinnedPulse 2s infinite;
}

@keyframes pinnedPulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
  }
}

/* 自动播放进度条 */
.pinned-autoplay-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: #faad14;
  transition: width 0.1s linear;
  border-radius: 0 0 8px 8px;
}

.pinned-messages-card.autoplay {
  position: relative;
  overflow: hidden;
}

/* 自动播放指示器 */
.pinned-autoplay-indicator {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(250, 173, 20, 0.9);
  color: white;
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: bold;
  animation: autoplayPulse 2s infinite;
}

@keyframes autoplayPulse {
  0% {
    opacity: 0.8;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.8;
  }
}

/* 置顶消息导航按钮 */
.pinned-nav-btn {
  border: none;
  background: rgba(250, 173, 20, 0.1);
  color: #faad14;
  border-radius: 6px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.pinned-nav-btn:hover {
  background: rgba(250, 173, 20, 0.2);
  color: #d48806;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(250, 173, 20, 0.2);
}

.pinned-nav-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(250, 173, 20, 0.3);
}

.pinned-nav-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.pinned-nav-btn:hover::before {
  left: 100%;
}

/* 置顶消息关闭按钮 */
.pinned-close-btn {
  border: none;
  background: transparent;
  color: #8c8c8c;
  transition: all 0.2s ease;
}

.pinned-close-btn:hover {
  background: rgba(255, 0, 0, 0.1);
  color: #ff4d4f;
}

/* 置顶消息滚动条 */
.pinned-content::-webkit-scrollbar {
  width: 4px;
}

.pinned-content::-webkit-scrollbar-track {
  background: rgba(250, 173, 20, 0.1);
}

.pinned-content::-webkit-scrollbar-thumb {
  background: rgba(250, 173, 20, 0.3);
  border-radius: 2px;
}

.pinned-content::-webkit-scrollbar-thumb:hover {
  background: rgba(250, 173, 20, 0.5);
}