/* 文章中的gallery样式 */
.gallery-container {
  margin: 1.5rem 0;
  border-radius: 8px;
  background: var(--card-bg-color, #fff);
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.gallery {
  width: 100%;
  display: inline-flex;
  gap: 10px;
  overflow-x: auto;
  white-space: nowrap;
  padding-bottom: 8px;
  scroll-behavior: smooth;
}

/* 自定义滚动条样式 */
.gallery::-webkit-scrollbar {
  height: 4px;
}

.gallery::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 2px;
}

.gallery::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 2px;
  transition: background 0.3s ease;
}

.gallery::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.4);
}

/* Firefox 滚动条样式 */
.gallery {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.2) rgba(0, 0, 0, 0.05);
}

/* 图片容器样式 */
.gallery-item {
  position: relative;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-color-secondary, #f8f9fa);
  border: 1px solid transparent;
  transition: all 0.3s ease;
}

.gallery-item:hover {
  border-color: var(--link-color, #0066cc);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
  width: auto;
  height: 200px;
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
  object-fit: cover;
  display: block;
}

.gallery-description {
  margin-top: 15px;
  padding: 10px;
  font-size: 14px;
  color: var(--text-color-secondary, #666);
  text-align: center;
  background: var(--bg-color-secondary, #f8f9fa);
  border-radius: 6px;
  min-height: 1.2em;
  line-height: 1.4;
  position: relative;
}

/* 暗色模式适配 */
@media (prefers-color-scheme: dark) {
  .gallery-container {
    background: var(--card-bg-color, #1a1a1a);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
  }
  
  .gallery-item {
    background: var(--bg-color-secondary, #2a2a2a);
  }
  
  .gallery-description {
    background: var(--bg-color-secondary, #2a2a2a);
    color: var(--text-color-secondary, #aaa);
  }
  
  /* 暗色模式下的滚动条样式 */
  .gallery::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
  }
  
  .gallery::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
  }
  
  .gallery::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
  }
  
  .gallery {
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.05);
  }
}