/* 词云组件样式 */

.wordcloud-section {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(15px);
  border-radius: 15px;
  padding: 20px; /* 减小padding，压缩布局 */
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.08),
    0 2px 4px rgba(0, 0, 0, 0.04),
    inset 0 1px 1px rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
  /* 移除margin，确保与stats-bottom-section对齐 */
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  width: 100%; /* 确保占满可用宽度 */
  box-sizing: border-box;
}

.wordcloud-section:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.12),
    0 4px 8px rgba(0, 0, 0, 0.06),
    inset 0 2px 2px rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.85);
}

.wordcloud-section h3 {
  margin: 0 0 20px 0;
  font-size: 1.4rem;
  color: #333;
  font-weight: 600;
  position: relative;
  padding-bottom: 10px;
}

.wordcloud-section h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, #1a73e8, #1557b0);
  border-radius: 2px;
}

.wordcloud-container {
  position: relative;
  height: 320px; /* 增加高度，减少与动画下边缘的空白 */
  width: 100%; /* 确保占满容器宽度 */
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-sizing: border-box;
}

.wordcloud-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 30%, rgba(26, 115, 232, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(21, 87, 176, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(52, 168, 83, 0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: 1;
}

/* 词云SVG容器样式 */
.wordcloud-container svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

/* 词云文本样式 */
.wordcloud-container text {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  user-select: none;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
  pointer-events: auto;
  will-change: transform, opacity;
}

.wordcloud-container text:hover {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  filter: brightness(1.1);
  transform: scale(1.05);
}

/* 词云动画效果 - 简化版 */
@keyframes wordcloudFadeIn {
  0% { 
    opacity: 0; 
    transform: scale(0.5); 
  }
  50% {
    opacity: 0.7;
    transform: scale(0.9);
  }
  100% { 
    opacity: 1; 
    transform: scale(1); 
  }
}

.wordcloud-container text {
  animation: wordcloudFadeIn 0.8s ease-out forwards;
}

/* 加载动画 */
.wordcloud-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #666;
  z-index: 3;
  position: relative;
}

.wordcloud-loading .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #1a73e8;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .wordcloud-container {
    height: 280px; /* 平板端适当减小高度 */
  }
}

@media (max-width: 768px) {
  .wordcloud-section {
    padding: 18px; /* 移动端进一步压缩 */
    /* 移除margin，确保与layout.css一致 */
    width: 100%;
  }
  
  .wordcloud-section h3 {
    font-size: 1.2rem;
  }
  
  .wordcloud-container {
    height: 260px; /* 移动端调整高度 */
    width: 100%; /* 确保占满容器宽度 */
  }
}

@media (max-width: 480px) {
  .wordcloud-section {
    padding: 15px; /* 小屏幕进一步压缩 */
    /* 移除margin，确保与layout.css一致 */
    width: 100%;
  }
  
  .wordcloud-container {
    height: 220px; /* 小屏幕调整高度 */
    width: 100%; /* 确保占满容器宽度 */
  }
} 