/**
 * 融资日报筛选栏样式 - 优化版 v2.0
 * 更好的视觉层次和交互体验
 * 优化日期: 2025-10-18
 */

/* 数据可视化图表 - 优化版 */
.funding-charts {
  padding: 1.5rem;
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  border-radius: 16px;
  border: 1px solid rgba(250, 140, 50, 0.1);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.08),
    0 1px 4px rgba(0, 0, 0, 0.04);
  width: 100%;
  box-sizing: border-box;
}

.chart-container {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  border: 1px solid rgba(250, 140, 50, 0.1);
  width: 100%;
  box-sizing: border-box;
}

.chart-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #333;
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(250, 140, 50, 0.1);
}

.chart-content {
  min-height: auto; /* 改为auto,根据内容自适应高度 */
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chart-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chart-bar-label {
  min-width: 90px;
  font-size: 0.9rem;
  color: #555;
  font-weight: 600;
  text-align: left;
}

.chart-bar-track {
  flex: 1;
  height: 32px;
  background: #f5f5f5;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.chart-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color, #FA8C32), var(--secondary-color, #FFBB33));
  border-radius: 16px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 12px;
  min-width: 60px; /* 增加最小宽度以容纳文字 */
  box-shadow: 0 2px 4px rgba(250, 140, 50, 0.2);
  position: relative;
}

.chart-bar-value {
  font-size: 0.85rem;
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 1;
}

/* 快捷筛选预设 */
.filter-presets {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(90deg, rgba(250, 140, 50, 0.05) 0%, rgba(255, 187, 51, 0.05) 100%);
  border-radius: 8px;
  border: 1px solid rgba(250, 140, 50, 0.1);
}

.presets-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #666;
  white-space: nowrap;
}

.presets-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.preset-btn {
  padding: 6px 14px;
  border: 1.5px solid rgba(250, 140, 50, 0.3);
  background: #fff;
  border-radius: 16px;
  font-size: 0.8rem;
  color: var(--primary-color, #FA8C32);
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
  font-weight: 600;
  position: relative;
  overflow: hidden;
}

.preset-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(250, 140, 50, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
}

.preset-btn:hover {
  background: linear-gradient(135deg, rgba(255, 251, 247, 1) 0%, rgba(255, 243, 224, 1) 100%);
  border-color: var(--primary-color, #FA8C32);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(250, 140, 50, 0.2);
}

.preset-btn:hover::before {
  width: 120%;
  height: 120%;
}

.preset-btn.active {
  background: linear-gradient(135deg, var(--primary-color, #FA8C32) 0%, var(--secondary-color, #FFBB33) 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 12px rgba(250, 140, 50, 0.3),
              0 4px 8px rgba(250, 140, 50, 0.15);
  transform: translateY(-1px);
}

.preset-btn.active::before {
  display: none;
}

.funding-filter-bar {
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  border: 1px solid rgba(250, 140, 50, 0.1);
  border-radius: 16px;
  padding: 1.5rem;
  margin: 0 0 20px 0;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.08),
    0 1px 4px rgba(0, 0, 0, 0.04);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
}

/* 筛选组容器 */
.filter-groups-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #333;
  margin: 0;
  padding: 0 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 筛选标签左侧视觉指示器 */
.filter-label::before {
  content: '';
  width: 3px;
  height: 14px;
  background: linear-gradient(180deg, var(--primary-color, #FA8C32), var(--secondary-color, #FFBB33));
  border-radius: 2px;
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.filter-btn {
  padding: 7px 14px;
  border: 1.5px solid #e0e0e0;
  background: #fff;
  border-radius: 20px;
  font-size: 0.8rem;
  color: #555;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

/* 按钮悬停效果 */
.filter-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(250, 140, 50, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
}

.filter-btn:hover::before {
  width: 120%;
  height: 120%;
}

.filter-btn:hover {
  border-color: var(--primary-color, #FA8C32);
  color: var(--primary-color, #FA8C32);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(250, 140, 50, 0.15);
}

/* 激活状态 */
.filter-btn.active {
  background: linear-gradient(135deg, var(--primary-color, #FA8C32) 0%, var(--secondary-color, #FFBB33) 100%);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(250, 140, 50, 0.3),
              0 4px 8px rgba(250, 140, 50, 0.15);
  transform: translateY(-1px);
  animation: pulse 0.3s ease-out;
}

.filter-btn.active::before {
  display: none;
}

/* 按钮激活脉冲动画 */
@keyframes pulse {
  0% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 16px rgba(250, 140, 50, 0.4),
                0 6px 12px rgba(250, 140, 50, 0.2);
  }
  100% {
    transform: translateY(-1px) scale(1);
  }
}

.filter-reset-btn {
  align-self: flex-start;
  padding: 10px 20px;
  border: 1.5px solid #ddd;
  background: #fff;
  border-radius: 20px;
  font-size: 0.875rem;
  color: #666;
  cursor: pointer;
  transition: all 0.25s ease;
  font-weight: 600;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.filter-reset-btn::before {
  content: '🔄';
  margin-right: 4px;
  font-size: 0.9rem;
}

.filter-reset-btn:hover {
  background: #f8f8f8;
  border-color: #aaa;
  color: #333;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.filter-reset-btn:active {
  transform: translateY(0);
}

/* 筛选结果提示 */
.filter-result-info {
  padding: 12px 18px;
  background: linear-gradient(90deg, rgba(250, 140, 50, 0.08) 0%, rgba(255, 187, 51, 0.08) 100%);
  border-left: 3px solid var(--primary-color, #FA8C32);
  border-radius: 8px;
  font-size: 0.9rem;
  color: #666;
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideInDown 0.3s ease-out;
}

.filter-result-info::before {
  content: '🔍';
  font-size: 1.1rem;
}

.filter-result-info strong {
  color: var(--primary-color, #FA8C32);
  font-weight: 700;
  font-size: 1.05em;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 筛选结果淡入动画 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.funding-highlights {
  animation: fadeInUp 0.4s ease-out;
}

.funding-card {
  animation: fadeInUp 0.4s ease-out backwards;
}

.funding-card:nth-child(1) { animation-delay: 0.05s; }
.funding-card:nth-child(2) { animation-delay: 0.1s; }
.funding-card:nth-child(3) { animation-delay: 0.15s; }
.funding-card:nth-child(4) { animation-delay: 0.2s; }
.funding-card:nth-child(5) { animation-delay: 0.25s; }
.funding-card:nth-child(6) { animation-delay: 0.3s; }
.funding-card:nth-child(n+7) { animation-delay: 0.35s; }

/* 响应式设计 */
@media (max-width: 1024px) {
  .filter-groups-container {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .funding-filter-bar {
    grid-template-columns: 1fr;
  }

  .filter-reset-btn {
    width: 100%;
    text-align: center;
  }

  /* 图表在平板端开始堆叠 */
  .funding-charts {
    grid-template-columns: 1fr !important;
    padding: 16px;
  }

  .chart-container {
    padding: 16px;
  }

  .chart-title {
    font-size: 1rem;
  }

  .chart-bar-label {
    min-width: 80px;
    font-size: 0.85rem;
  }

  .chart-bar-track {
    height: 28px;
  }

  .chart-bar-value {
    font-size: 0.8rem;
  }
}

@media (max-width: 768px) {
  .funding-filter-bar {
    padding: 1rem;
    gap: 14px;
    border-radius: 12px;
  }

  .filter-groups-container {
    gap: 14px;
  }

  .filter-group {
    gap: 6px;
  }

  .filter-label {
    font-size: 0.8rem;
  }

  .filter-options {
    gap: 4px;
  }

  .filter-btn {
    padding: 6px 11px;
    font-size: 0.75rem;
  }

  .filter-reset-btn {
    padding: 8px 16px;
    font-size: 0.8rem;
  }

  /* 图表移动端优化 */
  .funding-charts {
    padding: 1rem;
    gap: 12px;
    border-radius: 12px;
  }

  .chart-container {
    padding: 14px;
  }

  .chart-title {
    font-size: 0.95rem;
    margin-bottom: 12px;
    padding-bottom: 10px;
  }

  .chart-content {
    min-height: auto; /* 自适应高度 */
    gap: 10px;
  }

  .chart-bar {
    gap: 10px;
  }

  .chart-bar-label {
    min-width: 70px;
    font-size: 0.8rem;
  }

  .chart-bar-track {
    height: 26px;
  }

  .chart-bar-fill {
    padding-right: 10px;
    min-width: 35px;
  }

  .chart-bar-value {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .funding-filter-bar {
    padding: 0.75rem;
    gap: 12px;
  }

  .filter-groups-container {
    gap: 12px;
  }

  .filter-label {
    font-size: 0.75rem;
  }

  .filter-options {
    gap: 3px;
  }

  .filter-btn {
    padding: 5px 9px;
    font-size: 0.7rem;
    border-radius: 14px;
  }

  .filter-result-info {
    font-size: 0.8rem;
    padding: 10px 14px;
  }

  /* 图表小屏幕优化 */
  .funding-charts {
    padding: 0.75rem;
    gap: 10px;
  }

  .chart-container {
    padding: 12px;
  }

  .chart-title {
    font-size: 0.9rem;
    margin-bottom: 10px;
    padding-bottom: 8px;
  }

  .chart-content {
    min-height: auto; /* 自适应高度 */
    gap: 8px;
  }

  .chart-bar {
    gap: 8px;
  }

  .chart-bar-label {
    min-width: 60px;
    font-size: 0.75rem;
  }

  .chart-bar-track {
    height: 24px;
    border-radius: 12px;
  }

  .chart-bar-fill {
    padding-right: 8px;
    min-width: 30px;
    border-radius: 12px;
  }

  .chart-bar-value {
    font-size: 0.7rem;
  }
}

/* 当前筛选状态条 */
.active-filters-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: rgba(250, 140, 50, 0.05);
  border-radius: 8px;
  margin-top: 12px;
  font-size: 0.85rem;
  color: #666;
  animation: slideInDown 0.3s ease-out;
}

.active-filters-summary::before {
  content: '✓';
  color: var(--primary-color, #FA8C32);
  font-weight: 700;
  font-size: 1.1rem;
}

.filter-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #fff;
  border: 1px solid rgba(250, 140, 50, 0.25);
  border-radius: 12px;
  color: var(--primary-color, #FA8C32);
  font-size: 0.8rem;
  font-weight: 600;
}

.filter-tag-pill::before {
  content: '#';
  opacity: 0.6;
}

/* 热门标签样式 */
.hot-tag {
  position: relative;
  border-color: rgba(250, 140, 50, 0.4);
  background: linear-gradient(135deg, rgba(255, 251, 247, 1) 0%, rgba(255, 243, 224, 1) 100%);
}

.hot-tag:hover {
  border-color: var(--primary-color, #FA8C32);
  background: linear-gradient(135deg, rgba(255, 243, 224, 1) 0%, rgba(255, 235, 204, 1) 100%);
}

.hot-tag-badge {
  font-size: 0.75rem;
  margin-left: 2px;
  display: inline-block;
  animation: twinkle 2s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.1); }
}

/* 可点击图表条样式 */
.clickable-chart-bar {
  cursor: pointer;
  transition: all 0.2s ease;
}

.clickable-chart-bar:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.clickable-chart-bar:hover .chart-bar-fill {
  filter: brightness(1.1);
}

/* 图表条激活状态 */
.chart-bar-active .chart-bar-fill {
  background: linear-gradient(90deg, #FF6B35, #FF8C42) !important;
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.4);
}

.chart-bar-active {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(255, 107, 53, 0.2);
}

/* 无障碍优化 */
.filter-btn:focus-visible {
  outline: 2px solid var(--primary-color, #FA8C32);
  outline-offset: 2px;
}

.filter-reset-btn:focus-visible {
  outline: 2px solid #666;
  outline-offset: 2px;
}
