/* gene_database/frontend/css/style.css */
/* 图表样式补充 */
.chart-bar {
  display: inline-block;
  width: 40px;
  margin: 0 10px;
  background-color: #005826;
  border-radius: 4px 4px 0 0;
  transition: height 0.5s ease;
  position: relative;
}

.chart-bar:hover {
  background-color: #004620;
}

.chart-bar::after {
  content: attr(data-value);
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: #003319;
}

.chart-container {
  position: relative;
}

.chart-legend {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  margin: 0 10px;
}

.chart-legend-color {
  width: 15px;
  height: 15px;
  margin-right: 5px;
  border-radius: 3px;
}

/* 基因卡片动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

.gene-card {
  animation: fadeIn 0.5s ease forwards;
  opacity: 0;
}

.gene-card:nth-child(1) {
  animation-delay: 0.1s;
}

.gene-card:nth-child(2) {
  animation-delay: 0.2s;
}

.gene-card:nth-child(3) {
  animation-delay: 0.3s;
}

.gene-card:nth-child(4) {
  animation-delay: 0.4s;
}

.gene-card:nth-child(5) {
  animation-delay: 0.5s;
}

/* 导航栏样式 */
.navbar {
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: #005826;
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* 基因列表交互效果 */
/* 基因列表交互效果 */
.gene-list-item {
  transition: background-color 0.2s ease;
  cursor: pointer;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* 将边框效果应用到第一个单元格，以解决表格行边框兼容性问题 */
.gene-list-item td:first-child {
  border-left: 4px solid transparent;
  transition: border-left 0.2s ease;
}

.gene-list-item:hover {
  background-color: rgba(0, 88, 38, 0.08);
}

.gene-list-item:hover td:first-child {
  border-left: 4px solid #005826;
}

.gene-list-item:last-child {
  border-bottom: none;
}

/* 基因描述文本优化 */
.description-cell {
  max-width: 400px;
  /* 限制最大宽度 */
  white-space: nowrap;
  /* 不换行 */
  overflow: hidden;
  /* 超出隐藏 */
  text-overflow: ellipsis;
  /* 显示省略号 */
  color: #555;
}

/* 分页控件样式 */
.pagination-container {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.pagination-btn {
  padding: 0.5rem 1rem;
  margin: 0 0.25rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  background-color: white;
  color: #4b5563;
  transition: all 0.2s ease;
}

.pagination-btn:hover {
  background-color: #005826;
  color: white;
  border-color: #005826;
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-info {
  padding: 0.5rem 1rem;
  color: #4b5563;
}

/* 下载卡片样式 */
.download-card {
  transition: all 0.3s ease;
  border-radius: 0.5rem;
  background-color: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.download-card:hover {
  transform: translateY(-0.25rem);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.download-btn {
  transition: all 0.3s ease;
}

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

/* 响应式调整 */
@media (max-width: 768px) {
  .chart-bar {
    width: 30px;
    margin: 0 5px;
  }

  .navbar {
    padding: 0.5rem 0;
  }

  .nav-link {
    padding: 0.5rem 1rem;
  }

  .download-card {
    padding: 1rem;
  }
}