.tx-topic-item {
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
}

.tx-topic-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
  transition: left 0.6s ease;
}

.tx-topic-item:hover::before {
  left: 100%;
}

.tx-topic-item:hover {
  transform: translateY(-5px);
}

/* 用户头像动画 */
.tx-topic-avatar, .tx-reply-avatar {
  transition: all 0.3s ease;
  position: relative;
}

.tx-topic-avatar::after {
  content: '';
  position: absolute;
  inset: -3px;
  background: linear-gradient(45deg, #3b82f6, #8b5cf6);
  border-radius: inherit;
  opacity: 0;
  z-index: -1;
  transition: opacity 0.3s ease;
}

.tx-topic-item:hover .tx-topic-avatar::after {
  opacity: 0.5;
}

.tx-topic-avatar:hover, .tx-reply-avatar:hover {
  transform: scale(1.1) rotate(5deg);
}

/* 话题标签动画 */
.tx-topic-meta span {
  transition: all 0.3s ease;
}

.tx-topic-item:hover .tx-topic-meta span {
  transform: translateY(-2px);
}

/* 动作按钮特效 */
.tx-action-btn {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.tx-action-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: currentColor;
  border-radius: 50%;
  opacity: 0.1;
  transform: translate(-50%, -50%);
  transition: all 0.4s ease;
}

.tx-action-btn:hover::before {
  width: 100px;
  height: 100px;
}

.tx-action-btn:hover {
  transform: translateY(-2px);
}

/* 回复区域特效 */
.tx-latest-replies {
  position: relative;
}

.tx-latest-replies::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20px;
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom, rgba(147, 51, 234, 0.3), transparent);
}

.tx-reply-item {
  transition: all 0.3s ease;
  position: relative;
}

.tx-reply-item:hover {
  transform: translateX(10px);
  background: rgba(147, 51, 234, 0.05);
}

/* 精选回复特效 */
.tx-reply-item:has(.bg-green-100) {
  position: relative;
}

.tx-reply-item:has(.bg-green-100)::before {
  content: '✨';
  position: absolute;
  top: -5px;
  right: -5px;
  font-size: 1.5rem;
  animation: tx-star-twinkle 2s ease-in-out infinite;
}

@keyframes tx-star-twinkle {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.2) rotate(180deg); }
}

/* 官方回复特效 */
.tx-reply-item:has(.bg-purple-100) {
  position: relative;
  border-left: 4px solid #8b5cf6;
}

.tx-reply-item:has(.bg-purple-100)::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.05));
  border-radius: inherit;
  pointer-events: none;
}

/* 话题统计数字动画 */
.tx-topic-stats span {
  transition: all 0.3s ease;
}

.tx-topic-item:hover .tx-topic-stats span {
  transform: scale(1.1);
  color: #8b5cf6;
}

/* 活跃用户卡片动画 */
.tx-user-card {
  transition: all 0.4s ease;
  position: relative;
}

.tx-user-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
  opacity: 0;
  transition: opacity 0.4s ease;
  border-radius: inherit;
}

.tx-user-card:hover::before {
  opacity: 1;
}

.tx-user-card:hover {
  transform: translateY(-10px) rotateY(5deg);
}

.tx-user-card:hover .tx-user-avatar {
  transform: scale(1.1);
}

/* 用户等级徽章动画 */
.tx-user-level {
  transition: all 0.3s ease;
  position: relative;
}

.tx-user-card:hover .tx-user-level {
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* 社区统计动画 */
.tx-community-stats .tx-stat-item:hover .tx-stat-number {
  animation: tx-stat-bounce 0.6s ease;
}

@keyframes tx-stat-bounce {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.1) rotateX(10deg); }
  50% { transform: scale(1.05) rotateX(-5deg); }
  75% { transform: scale(1.08) rotateX(3deg); }
}

/* 发表话题按钮特效 */
.tx-hero-container button {
  position: relative;
  overflow: hidden;
}

.tx-hero-container button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.tx-hero-container button:hover::before {
  left: 100%;
}

/* 加载更多按钮动画 */
.tx-load-more button {
  transition: all 0.4s ease;
}

.tx-load-more button:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
}

/* 响应式设计优化 */
@media (max-width: 768px) {
  .tx-topic-item {
    padding: 1rem;
  }
  
  .tx-topic-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .tx-topic-stats {
    margin-top: 1rem;
    flex-direction: column;
    align-items: flex-start;
  }
  
  .tx-action-buttons {
    flex-direction: column;
    align-items: flex-start;
    space-x: 0;
    space-y: 0.5rem;
  }
  
  .tx-community-stats {
    grid-template-columns: 2fr 2fr;
  }
}

@media (max-width: 480px) {
  .tx-topic-avatar {
    width: 3rem;
    height: 3rem;
  }
  
  .tx-topic-title {
    font-size: 1.2rem;
  }
  
  .tx-user-card {
    padding: 1rem;
  }
  
  .tx-user-stats {
    grid-template-columns: 1fr 1fr;
  }
}

/* 页面加载动画 */
.tx-community-layout .tx-topic-item {
  animation: tx-topic-slide-in 0.6s ease forwards;
  opacity: 0;
  transform: translateX(-50px);
}

.tx-topic-item:nth-child(1) { animation-delay: 0.1s; }
.tx-topic-item:nth-child(2) { animation-delay: 0.2s; }
.tx-topic-item:nth-child(3) { animation-delay: 0.3s; }

@keyframes tx-topic-slide-in {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.tx-community-layout .tx-user-card {
  animation: tx-user-card-pop 0.6s ease forwards;
  opacity: 0;
  transform: scale(0.8);
}

.tx-user-card:nth-child(1) { animation-delay: 0.2s; }
.tx-user-card:nth-child(2) { animation-delay: 0.3s; }
.tx-user-card:nth-child(3) { animation-delay: 0.4s; }

@keyframes tx-user-card-pop {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 话题分类标签特效 */
.tx-topic-meta .bg-red-100,
.tx-topic-meta .bg-blue-100,
.tx-topic-meta .bg-purple-100 {
  transition: all 0.3s ease;
  position: relative;
}

.tx-topic-meta .bg-red-100:hover,
.tx-topic-meta .bg-blue-100:hover,
.tx-topic-meta .bg-purple-100:hover {
  transform: scale(1.1) translateY(-2px);
}

/* 在线指示器 */
.tx-community-stats::before {
  content: '🟢 实时在线';
  position: absolute;
  top: -2rem;
  right: 0;
  font-size: 0.8rem;
  color: #22c55e;
  animation: tx-online-blink 2s ease-in-out infinite;
}

@keyframes tx-online-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}