* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #fafafa;
  color: #111111;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* 返回按钮 */
.back-btn {
  position: fixed;
  top: 32px;
  left: 40px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111111;
  cursor: pointer;
  z-index: 100;
  transition: opacity 0.2s ease;
  text-decoration: none;
}

.back-btn:hover {
  opacity: 0.6;
}

.back-btn svg {
  width: 24px;
  height: 24px;
}

/* 项目信息 */
.project-info {
  position: fixed;
  top: 32px;
  right: 40px;
  text-align: right;
  z-index: 10;
}

.project-title {
  font-size: 25px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* 主图展示区域 */
.main-image-container {
  flex: 1;
  display: block;               /* 使用普通块级容器，避免 flex 布局导致轨道水平居中计算异常 */
  padding: 80px 40px 100px;     /* 给底部缩略图条留足空间，避免主图被遮住 */
  overflow: hidden;
  position: relative;           /* 为左右箭头提供定位参考 */
}

.carousel-track {
  display: flex;
  width: 300%;                  /* 三个面板：上一张 / 当前 / 下一张 */
  height: 100%;
  margin-left: -100%;           /* 默认让中间面板居中显示 */
  will-change: transform;
}

.carousel-item {
  width: 33.3333%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 40px;              /* 每张大图左右各留 15px，图与图之间总共 30px 间距 */
  box-sizing: border-box;
  position: relative;
}

.main-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.carousel-item.is-ready .main-image {
  opacity: 1;
}

.image-status {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 13px;
  line-height: 1.4;
  color: rgba(17, 17, 17, 0.48);
  letter-spacing: 0.02em;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.carousel-item.is-loading .image-status,
.carousel-item.is-error .image-status {
  opacity: 1;
}

/* 底部缩略图滚动条 */
.thumbnail-strip {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;                 /* 减小高度 */
  background-color: #fafafa;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 40px;           /* 减小内边距 */
  z-index: 50;
  display: flex;
  justify-content: flex-start;  /* 从左对齐，避免左右两侧被裁切 */
  align-items: center;
}

.thumbnail-container {
  display: flex;
  gap: 6px;                     /* 减少2px，从8px改为6px */
  align-items: center;
  justify-content: flex-start;  /* 容器内从左对齐 */
}

.thumbnail {
  height: 28px;                 /* 稍微放大，从24px改为28px */
  width: 28px;                  /* 正方形 */
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.2s ease;
  opacity: 0.4;                 /* 未选中时更透明 */
  flex-shrink: 0;
  object-fit: cover;            /* 裁剪成正方形 */
  transform: scale(1);
  user-select: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
}

.thumbnail:hover {
  opacity: 0.85;                /* 更明显的变亮效果，从0.7改为0.85 */
}

.thumbnail.active {
  opacity: 1;
  height: 40px;                 /* 选中时放大 */
  width: 40px;
  transform: scale(1);          /* 不额外放大，用尺寸变化 */
  box-shadow: 0 0 0 1px #111111; /* 边框从2px减到1px */
}

/* 自定义滚动条 */
.thumbnail-strip::-webkit-scrollbar {
  height: 6px;
}

.thumbnail-strip::-webkit-scrollbar-track {
  background: rgba(17, 17, 17, 0.05);
}

.thumbnail-strip::-webkit-scrollbar-thumb {
  background-color: rgba(17, 17, 17, 0.25);
  border-radius: 3px;
}

.thumbnail-strip::-webkit-scrollbar-thumb:hover {
  background-color: rgba(17, 17, 17, 0.4);
}

/* 左右悬浮翻页箭头（覆盖在主图上方） */
.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;                  /* 提高点击区域，但只显示细箭头本身 */
  height: 44px;
  border: none;
  background: none;             /* 去掉背景填充色，仅保留箭头 */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  padding: 0;
  outline: none;
  transition: transform 0.15s ease, opacity 0.2s ease;
}

.nav-arrow-left {
  left: 52px;   /* 与主图 padding 对齐，略向内缩一点 */
}

.nav-arrow-right {
  right: 52px;
  transform: translateY(-50%) scaleX(-1); /* 右箭头水平翻转 */
}

.nav-arrow:hover {
  transform: translateY(-50%) scale(1.04);
}

.nav-arrow-right:hover {
  transform: translateY(-50%) scaleX(-1) scale(1.04); /* 右箭头悬浮时也保持翻转 */
}

.nav-arrow-icon {
  width: 20px;
  height: auto;
  opacity: 0.3;                 /* 默认更透明 */
  pointer-events: none;
  transition: opacity 0.2s ease;
  display: block;
  filter: invert(1);
}

.nav-arrow:hover .nav-arrow-icon {
  opacity: 1;                   /* 悬浮时变成不透明 */
}

/* 移动端：箭头移到缩略图上方 */
@media (max-width: 768px) {
  .nav-arrow {
    width: 36px;                    /* 缩小按钮尺寸 */
    height: 36px;
    top: auto;                      /* 取消垂直居中 */
    bottom: 80px;                   /* 定位在缩略图上方，距离缩小 */
    transform: none;
  }

  .nav-arrow-left {
    left: 16px;
  }

  .nav-arrow-right {
    right: 16px;
    transform: scaleX(-1);          /* 保持水平翻转 */
  }
  
  /* 手机端取消悬浮效果，避免向上位移 */
  .nav-arrow:hover {
    transform: none;
  }
  
  .nav-arrow-right:hover {
    transform: scaleX(-1);          /* 右箭头悬浮时也保持翻转，不位移 */
  }
  
  .nav-arrow-icon {
    width: 16px;                    /* 缩小箭头图标 */
  }
}

/* 响应式 */
@media (max-width: 768px) {
  .back-btn {
    top: 20px;
    left: 20px;
  }

  .project-info {
    top: 68px;
    left: 20px;
    right: 20px;
    text-align: left;
  }

  .project-title {
    font-size: 22px;
    line-height: 1.25;
  }

  .main-image-container {
    padding: 120px 0 150px;     /* 移动端额外给底部缩略图与系统栏留出空间 */
  }
  
  .carousel-item {
    padding: 0 15px;            /* 移动端：减少左右间距，让图片更宽 */
  }

  .main-image {
    max-height: 100%;
  }

  .thumbnail-strip {
    padding: 8px 12px;          /* 手机端左右缩小一点，避免缩略图被裁切 */
    height: 72px;
  }

  .thumbnail {
    height: 26px;
    width: 26px;
  }

  .thumbnail.active {
    height: 36px;
    width: 36px;
  }
}
