﻿/* ================================================================
   线路相册页面样式
   ================================================================ */

/* ------------------------------------------------------------
   01. 面包屑导航
   ------------------------------------------------------------ */
.breadcrumb {
  padding: 16px 0;
  background-color: #f8f9fa;
  border-bottom: 1px solid #e5e7eb;
}

.breadcrumb-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14px;
  color: #6b7280;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
}

.breadcrumb-item:not(:last-child)::after {
  content: '>';
  margin: 0 8px;
  color: #9ca3af;
}

.breadcrumb-item a {
  color: #6b7280;
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
  color: #3b82f6;
}

.breadcrumb-item.active {
  color: #1f2937;
  font-weight: 500;
}

/* ====================
   头部信息卡片
   ==================== */
.gallery-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 24px 0;
  color: white;
}

.gallery-header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.gallery-info-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px 24px;
  margin-top: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  transition: opacity 0.3s ease;
}

/* 悬浮卡片样式 */
.gallery-info-card-sticky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-radius: 0;
  padding: 12px 24px;
  margin: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.gallery-info-card-sticky.active {
  transform: translateY(0);
}

/* 悬浮卡片内部布局精简 */
.gallery-info-card-sticky .gallery-card-header {
  margin-bottom: 8px;
  padding-bottom: 8px;
}

.gallery-info-card-sticky .gallery-card-title {
  font-size: 18px;
}

.gallery-info-card-sticky .gallery-stat-value {
  font-size: 20px;
}

.gallery-info-card-sticky .gallery-tags {
  margin-bottom: 8px;
}

.gallery-info-card-sticky .gallery-tag {
  padding: 3px 10px;
  font-size: 12px;
}

.gallery-info-card-sticky .gallery-intro {
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 卡片头部：标题 + 统计数据 */
.gallery-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}

.gallery-card-title {
  font-size: 22px;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
}

.gallery-stats {
  display: flex;
  gap: 24px;
}

.gallery-stat-item {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.gallery-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #059669;
  line-height: 1;
}

.gallery-stat-label {
  font-size: 12px;
  color: #9ca3af;
  font-weight: 400;
}

/* 标签区域 */
.gallery-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.gallery-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 16px;
  transition: all 0.2s ease;
  cursor: default;
}

.gallery-tag:hover {
  background: #dcfce7;
  border-color: #86efac;
  color: #059669;
}

/* 简介文字 */
.gallery-intro {
  font-size: 14px;
  line-height: 1.7;
  color: #6b7280;
  margin: 0;
}

/* ====================
   瀑布流相册布局
   ==================== */
.gallery-section {
  padding: 48px 0 80px 0;
  background-color: #f9fafb;
}

.gallery-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

/* 五列瀑布流布局 - 保持原始比例 */
.gallery-masonry {
  column-count: 5 !important;
  column-gap: 16px;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: white;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease forwards;
  display: inline-block;
  width: 100%;
}

/* 添加渐入动画延迟，创造流式加载效果 */
.gallery-item:nth-child(1) { animation-delay: 0.05s; }
.gallery-item:nth-child(2) { animation-delay: 0.1s; }
.gallery-item:nth-child(3) { animation-delay: 0.15s; }
.gallery-item:nth-child(4) { animation-delay: 0.2s; }
.gallery-item:nth-child(5) { animation-delay: 0.25s; }
.gallery-item:nth-child(6) { animation-delay: 0.3s; }
.gallery-item:nth-child(7) { animation-delay: 0.35s; }
.gallery-item:nth-child(8) { animation-delay: 0.4s; }
.gallery-item:nth-child(9) { animation-delay: 0.45s; }
.gallery-item:nth-child(10) { animation-delay: 0.5s; }
.gallery-item:nth-child(n+11) { animation-delay: 0.55s; }

/* fadeInUp 已移至 main.css */

.gallery-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.15);
  z-index: 10;
}

.gallery-image-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}

/* 图片加载占位符 - 骨架屏动画 */
.gallery-image-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    #f0f0f0 25%,
    #e8e8e8 50%,
    #f0f0f0 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  z-index: 0;
}

/* shimmer 已移至 main.css */

/* 图片加载完成后隐藏占位符 */
.gallery-image-wrapper:has(.gallery-image.loaded)::before {
  display: none;
}

/* 加载状态指示器 */
.gallery-image-wrapper::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid #e5e7eb;
  border-top-color: #059669;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-image-wrapper:has(.gallery-image:not(.loaded))::after {
  opacity: 1;
}

.gallery-image-wrapper:has(.gallery-image.loaded)::after {
  display: none;
}

/* spin 已移至 main.css */

.gallery-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1;
  opacity: 0;
}

.gallery-image.loaded {
  opacity: 1;
}

.gallery-item:hover .gallery-image {
  transform: scale(1.08);
}

/* 4:3 比例图片 - 保持原始比例 */
.gallery-item.aspect-4-3 {
  aspect-ratio: 4/3;
}

/* 3:4 比例图片 - 保持原始比例 */
.gallery-item.aspect-3-4 {
  aspect-ratio: 3/4;
}

/* 1:1 比例图片 - 可选 */
.gallery-item.aspect-1-1 {
  aspect-ratio: 1/1;
}

/* 16:9 比例图片 - 可选 */
.gallery-item.aspect-16-9 {
  aspect-ratio: 16/9;
}

/* 为不同比例的图片添加视觉差异 */
.gallery-item.aspect-3-4 {
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
}

.gallery-item.aspect-4-3 {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* 为特定位置的图片添加特殊效果，创造随机感 */
.gallery-item:nth-child(7n) .gallery-image-wrapper {
  border-radius: 20px;
}

.gallery-item:nth-child(11n) {
  border-radius: 8px;
}

/* 添加微妙的背景色差异 */
.gallery-item.aspect-3-4:nth-child(3n) {
  background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
}

.gallery-item.aspect-4-3:nth-child(4n) {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* 图片放大图标 - 优化显示效果 */
.gallery-zoom-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 4;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.gallery-item:hover .gallery-zoom-icon {
  opacity: 1;
  transform: scale(1);
}

.gallery-zoom-icon:hover {
  transform: scale(1.1);
  background: white;
}

.gallery-zoom-icon svg {
  width: 22px;
  height: 22px;
  color: #374151;
}

/* ====================
   加载更多
   ==================== */
.gallery-load-more {
  text-align: center;
  margin-top: 48px;
}

.load-more-btn {
  padding: 14px 32px;
  background-color: #3b82f6;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.load-more-btn:hover {
  background-color: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* ====================
   响应式设计
   ==================== */

/* iPad平板设备 (768px - 1024px) - 3列瀑布流 */
@media (min-width: 768px) and (max-width: 1024px) {
  .gallery-section {
    padding: 20px !important;
    background-color: #1a1a1a !important;
  }
  
  .gallery-masonry {
    column-count: 3 !important;
    column-gap: 8px !important;
  }
  
  .gallery-item {
    break-inside: avoid !important;
    margin-bottom: 8px !important;
    border-radius: 10px !important;
    overflow: hidden !important;
  }
  
  .gallery-image {
    width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
    display: block !important;
  }
  
  /* 平板图片保持原始比例 */
  .gallery-item.aspect-4-3,
  .gallery-item.aspect-3-4,
  .gallery-item.aspect-1-1,
  .gallery-item.aspect-16-9 {
    aspect-ratio: auto !important;
  }
  
  .lightbox-thumbnails {
    bottom: 10px;
    padding: 8px;
    width: 95%;
    max-width: 600px;
  }

  .thumbnail-item {
    width: 60px;
    height: 45px;
  }

  .thumb-nav {
    width: 28px;
    height: 28px;
  }
}


/* ====================
   H5移动端两列瀑布流 (4:3与3:4混排)
   ==================== */
@media (max-width: 768px) {
  /* 隐藏PC元素 */
  .breadcrumb { display: none !important; }
  .gallery-header { display: none !important; }
  .gallery-load-more { display: none !important; }
  
  /* 全屏瀑布流 - 深色背景 */
  .gallery-section {
    padding: 0 !important;
    background-color: #0a0a0a !important;
    min-height: 100vh !important;
  }
  
  .gallery-container {
    padding: 0 !important;
    max-width: 100% !important;
  }
  
  /* 两列瀑布流布局 */
  .gallery-masonry {
    column-count: 2 !important;
    column-gap: 3px !important;
    padding: 3px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* 图片卡片 - 全屏宽度大图 */
  .gallery-item {
    break-inside: avoid !important;
    break-inside: avoid;
    margin-bottom: 3px !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    background: #1a1a1a !important;
    display: block !important;
    width: 100% !important;
    float: none !important;
    position: relative !important;
  }
  
  /* 移除悬浮效果 */
  .gallery-item:hover {
    transform: none !important;
    box-shadow: none !important;
  }
  
  /* 图片容器 */
  .gallery-image-wrapper {
    border-radius: 6px !important;
    background: #1a1a1a !important;
    overflow: hidden !important;
    position: relative !important;
  }
  
  .gallery-image-wrapper::before,
  .gallery-image-wrapper::after {
    display: none !important;
  }
  
  /* 图片 - 显示完整大图，保持原始比例 */
  .gallery-image {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    object-fit: cover !important;
    display: block !important;
    opacity: 1 !important;
    transition: none !important;
    border-radius: 6px !important;
  }
  
  /* 4:3图片 - 横向大图，两列全宽显示 */
  .gallery-item.aspect-4-3 .gallery-image {
    aspect-ratio: 4/3;
    object-fit: cover;
  }
  
  /* 3:4图片 - 纵向大图，两列全宽显示 */
  .gallery-item.aspect-3-4 .gallery-image {
    aspect-ratio: 3/4;
    object-fit: cover;
  }
  
  /* 1:1图片 - 方形 */
  .gallery-item.aspect-1-1 .gallery-image {
    aspect-ratio: 1/1;
    object-fit: cover;
  }
  
  /* 16:9图片 */
  .gallery-item.aspect-16-9 .gallery-image {
    aspect-ratio: 16/9;
    object-fit: cover;
  }
  
  /* 隐藏放大图标 */
  .gallery-zoom-icon { display: none !important; }
  
  /* 灯箱优化 */
  .lightbox {
    background: rgba(0, 0, 0, 0.98) !important;
    padding: 0 !important;
  }
  
  .lightbox-content {
    max-width: 100% !important;
    max-height: 100% !important;
    width: 100% !important;
    height: auto !important;
    border-radius: 0 !important;
    object-fit: contain !important;
  }
  
  .lightbox-close {
    top: env(safe-area-inset-top, 10px) !important;
    right: 10px !important;
    width: 44px !important;
    height: 44px !important;
    background: rgba(255, 255, 255, 0.15) !important;
  }
  
  .lightbox-nav {
    width: 44px !important;
    height: 44px !important;
    top: 50% !important;
  }
  
  .lightbox-prev { left: 10px !important; }
  .lightbox-next { right: 10px !important; }
  
  .lightbox-hint { display: none !important; }
  
  .lightbox-thumbnails {
    bottom: 80px !important;
    width: 95% !important;
  }
  
  .thumbnail-item {
    width: 50px !important;
    height: 38px !important;
  }
  
  /* 底部导航 */
  .h5-bottom-nav {
    bottom: env(safe-area-inset-bottom, 0) !important;
    background: rgba(20, 20, 20, 0.95) !important;
    backdrop-filter: blur(10px) !important;
  }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
  .gallery-item:hover {
    transform: none;
  }

  .gallery-item:hover .gallery-image {
    transform: none;
  }

  /* 触摸设备总是显示放大图标 */
  .gallery-zoom-icon {
    opacity: 1;
    transform: scale(1);
  }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
  .gallery-section {
    background-color: #111827;
  }

  .gallery-section-title {
    color: #f9fafb;
  }

  .gallery-item {
    background: #1f2937;
  }

  .gallery-image-wrapper::before {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
  }
}

/* ====================
   图片灯箱（Lightbox）
   ==================== */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(10px);
}

.lightbox.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

/* fadeIn 已移至 main.css */

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  object-fit: contain;
  animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* 灯箱信息 */
.lightbox-info {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  padding: 16px 24px;
  border-radius: 12px;
  color: white;
  text-align: center;
  max-width: 80%;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

.lightbox-info h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
}

.lightbox-info p {
  margin: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
}

.lightbox-counter {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  padding: 8px 20px;
  border-radius: 20px;
  color: white;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
  z-index: 10;
}

/* 灯箱加载指示器 */
.lightbox-loading {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: white;
  font-size: 14px;
}

.lightbox-loading::before {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* spin 已移至 main.css */

/* 灯箱关闭按钮 */
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: rotate(90deg) scale(1.1);
}

.lightbox-close svg {
  width: 24px;
  height: 24px;
  color: white;
}

/* 灯箱导航按钮 */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-nav:active {
  transform: translateY(-50%) scale(0.95);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-nav.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.lightbox-nav svg {
  width: 24px;
  height: 24px;
  color: white;
}

/* 灯箱键盘提示 */
.lightbox-hint {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  padding: 8px 16px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.lightbox-hint kbd {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 11px;
}

/* 灯箱缩略图区域 */
.lightbox-thumbnails {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 800px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  padding: 12px;
  border-radius: 12px;
  z-index: 10;
  overflow: hidden;
}

.thumb-nav {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  color: white;
  padding: 0;
}

.thumb-nav:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.thumb-nav svg {
  width: 16px;
  height: 16px;
}

.thumb-track {
  flex: 1;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 2px;
}

.thumb-track::-webkit-scrollbar {
  display: none;
}

.thumbnail-item {
  flex-shrink: 0;
  width: 80px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  position: relative;
  background: rgba(255, 255, 255, 0.1);
}

.thumbnail-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumbnail-item:hover {
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.3);
}

.thumbnail-item.active {
  border-color: #3b82f6;
  transform: scale(1.08);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
}

/* ====================
   隐藏状态工具类
   ==================== */
.lightbox-info.hidden,
.lightbox-loading.hidden {
  display: none !important;
}

