/* 自定义样式 */

.post-card {
  transition: all 0.3s ease;
  border-radius: 12px !important;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
}

.avatar-img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border: 2px solid #f8f9fa;
  transition: transform 0.2s ease;
}

.avatar-img:hover {
  transform: scale(1.05);
}

.user-name {
  font-size: 1.1rem;
  transition: color 0.2s ease;
}

.user-name:hover {
  color: #0d6efd !important;
}

.post-content {
  line-height: 1.6;
  word-wrap: break-word;
}

.image-grid {
  max-width: 100%;
}

.image-thumbnail {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease;
  position: relative;
}

.image-thumbnail:hover {
  transform: scale(1.02);
}

.image-thumbnail img {
  transition: transform 0.3s ease;
}

.image-thumbnail:hover img {
  transform: scale(1.1);
}

.object-fit-cover {
  object-fit: cover;
}

.cursor-pointer {
  cursor: pointer;
}

.action-btn {
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.action-btn:hover {
  color: #0d6efd !important;
  transform: translateY(-1px);
}

.tags-section .badge {
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.tags-section .badge:hover {
  background-color: #0d6efd !important;
  color: white !important;
  transform: translateY(-1px);
}

.reply-form textarea {
  resize: vertical;
  min-height: 80px;
}

.reply-form textarea:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* 图片查看器样式 - 修复Chrome兼容性 */
.image-viewer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  touch-action: none; /* 防止默认触摸行为 */
}

.image-viewer.active {
  display: flex;
  flex-direction: column;
}

.image-viewer-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
}

.image-viewer-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* 顶部工具栏 */
.image-viewer-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  z-index: 10;
  transition: opacity 0.3s ease;
}

.image-counter {
  color: white;
  font-size: 16px;
  font-weight: 500;
}

.image-viewer-actions {
  display: flex;
  gap: 10px;
}

.viewer-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  font-size: 14px;
}

.viewer-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.viewer-btn:active {
  transform: scale(0.95);
}

/* 图片内容区域 */
.image-viewer-content {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.image-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none; /* 防止默认触摸行为 */
}

.image-container.dragging {
  cursor: grabbing;
}

.image-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  pointer-events: none;
  transition: transform 0.1s ease-out;
  transform-origin: center center;
  will-change: transform; /* 优化性能 */
}

/* 导航按钮 */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  z-index: 10;
}

.nav-prev {
  left: 20px;
}

.nav-next {
  right: 20px;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.1);
}

.nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.nav-btn:disabled:hover {
  transform: translateY(-50%) scale(1);
}

/* 底部缩略图 */
.image-viewer-thumbnails {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 25px;
  backdrop-filter: blur(10px);
  max-width: 90%;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.image-viewer-thumbnails::-webkit-scrollbar {
  display: none;
}

.thumbnail-item {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  flex-shrink: 0;
}

.thumbnail-item.active {
  border-color: #007bff;
  transform: scale(1.1);
}

.thumbnail-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 加载指示器 */
.loading-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  z-index: 20;
}

.loading-indicator.show {
  display: block;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* 缩放指示器 */
.zoom-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 18px;
  font-weight: bold;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 15;
}

.zoom-indicator.show {
  opacity: 1;
}

/* 图片缩略图悬停效果 */
.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.image-overlay i {
  color: white;
  font-size: 24px;
}

.image-thumbnail:hover .image-overlay {
  opacity: 1;
}

/* 移动端优化 */
@media (max-width: 768px) {
  .post-card {
    margin-bottom: 1rem;
    border-radius: 8px !important;
  }

  .card-body {
    padding: 1rem !important;
  }

  .avatar-img {
    width: 40px;
    height: 40px;
  }

  .user-name {
    font-size: 1rem;
  }

  .image-thumbnail {
    aspect-ratio: 4 / 3;
  }

  .action-btn {
    font-size: 0.8rem;
  }

  .tags-section .badge {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
  }

  .image-viewer-header {
    height: 50px;
    padding: 0 15px;
  }

  .image-counter {
    font-size: 14px;
  }

  .viewer-btn {
    width: 35px;
    height: 35px;
    font-size: 12px;
  }

  .image-viewer-actions {
    gap: 8px;
  }

  .nav-btn {
    width: 45px;
    height: 45px;
  }

  .nav-prev {
    left: 10px;
  }

  .nav-next {
    right: 10px;
  }

  .image-viewer-thumbnails {
    bottom: 10px;
    padding: 8px 15px;
  }

  .thumbnail-item {
    width: 50px;
    height: 50px;
  }

  /* 隐藏工具栏在移动端滚动时 */
  .image-viewer.hide-ui .image-viewer-header,
  .image-viewer.hide-ui .image-viewer-thumbnails,
  .image-viewer.hide-ui .nav-btn {
    opacity: 0;
    pointer-events: none;
  }
}

@media (max-width: 576px) {
  .container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
  .post-card {
    background-color: #1a1a1a;
    border-color: #333;
  }

  .card-footer {
    background-color: #2a2a2a !important;
  }

  .text-dark {
    color: #e9ecef !important;
  }

  .text-muted {
    color: #adb5bd !important;
  }
}

/* 加载动画 */
.post-card {
  animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 动画效果 */
.image-viewer {
  animation: fadeIn 0.3s ease;
}

.image-viewer.closing {
  animation: fadeOut 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* 缩放动画 */
.image-container.zoom-in {
  animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}


/* 图片查看器样式 */
.image-viewer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.image-viewer.active {
  display: flex;
  flex-direction: column;
}

.image-viewer-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
}

.image-viewer-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* 顶部工具栏 */
.image-viewer-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  z-index: 10;
  transition: opacity 0.3s ease;
}

.image-counter {
  color: white;
  font-size: 16px;
  font-weight: 500;
}

.image-viewer-actions {
  display: flex;
  gap: 15px;
}

.viewer-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.viewer-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* 图片内容区域 */
.image-viewer-content {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.image-container {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  transition: transform 0.3s ease;
}

.image-container.dragging {
  cursor: grabbing;
}

.image-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
  transition: transform 0.3s ease;
}

/* 导航按钮 */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  z-index: 10;
}

.nav-prev {
  left: 20px;
}

.nav-next {
  right: 20px;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.1);
}

.nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.nav-btn:disabled:hover {
  transform: translateY(-50%) scale(1);
}

/* 底部缩略图 */
.image-viewer-thumbnails {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 25px;
  backdrop-filter: blur(10px);
  max-width: 90%;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.image-viewer-thumbnails::-webkit-scrollbar {
  display: none;
}

.thumbnail-item {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  flex-shrink: 0;
}

.thumbnail-item.active {
  border-color: #007bff;
  transform: scale(1.1);
}

.thumbnail-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 加载指示器 */
.loading-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
}

.loading-indicator.show {
  display: block;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* 图片缩略图悬停效果 */
.image-thumbnail {
  position: relative;
  overflow: hidden;
}

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.image-overlay i {
  color: white;
  font-size: 24px;
}

.image-thumbnail:hover .image-overlay {
  opacity: 1;
}

/* 移动端优化 */
@media (max-width: 768px) {
  .image-viewer-header {
    height: 50px;
    padding: 0 15px;
  }

  .image-counter {
    font-size: 14px;
  }

  .viewer-btn {
    width: 35px;
    height: 35px;
  }

  .nav-btn {
    width: 45px;
    height: 45px;
  }

  .nav-prev {
    left: 10px;
  }

  .nav-next {
    right: 10px;
  }

  .image-viewer-thumbnails {
    bottom: 10px;
    padding: 8px 15px;
  }

  .thumbnail-item {
    width: 50px;
    height: 50px;
  }

  /* 隐藏工具栏在移动端滚动时 */
  .image-viewer.hide-ui .image-viewer-header,
  .image-viewer.hide-ui .image-viewer-thumbnails,
  .image-viewer.hide-ui .nav-btn {
    opacity: 0;
    pointer-events: none;
  }
}

/* 动画效果 */
.image-viewer {
  animation: fadeIn 0.3s ease;
}

.image-viewer.closing {
  animation: fadeOut 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* 缩放动画 */
.image-container.zoom-in {
  animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}







/* 4张图片 - 桌面端1行4列 */
.responsive-image-grid[data-count="4"] {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: 1fr;
}

/* 4张图片 - 移动端2行2列 */
@media (max-width: 767px) {
    .responsive-image-grid[data-count="4"] {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 1fr;
    }
}




/* 悬停效果 */
.image-container:hover {
    transform: scale(1.02);
}

.grid-image:hover {
    transform: scale(1.05);
}

/* 遮罩层 */
.image-overlay {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-container:hover .image-overlay {
    opacity: 1;
}











