/*以下是拍立得样式*/
.polaroid-gallery { /* 拍立得相册容器 */
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: center;
  padding-top: 10px;
}

.polaroid { /* 拍立得样式 */
  background-color: #fff;
  border: 1px solid #ccc;
  border-bottom: 30px solid #fff;
  box-shadow: 5px 10px 20px rgba(0, 0, 0, 0.15);
  width: 220px;
  text-align: center;
  padding: 10px;
  transform: rotate(var(--rotate));
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: 4px;
  position: relative;
}

.polaroid img { /* 拍立得图片样式 */
  width: 100%;
  border-radius: 4px;
}

.polaroid p { /* 拍立得文字样式 */
  margin-top: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #444;
  font-style: italic;
}

.masonry-gallery { /* 瀑布流布局 */
  column-count: 3; /* 设置列数 */
  column-gap: 10px; /* 列间距 */
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 10px;
}

.masonry-item img {
  width: 100%;
  border-radius: 8px;
}

/* Hover effect */
.polaroid:hover { /* 鼠标悬停效果 */
  transform: scale(1.05) rotate(0deg);
  box-shadow: 8px 12px 25px rgba(0, 0, 0, 0.2);
  z-index: 2;
}
/*以上是Polaroid的样式*/

.gallery-lightbox { /* 画廊灯箱样式 */
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: center;
  padding-top: 10px;
}

.gallery-lightbox img {
  width: 100%;
  transition: 0.3s;
}
.gallery-lightbox img:hover {
  transform: scale(1.1);
}

.gallery-carousel { /* 画廊轮播样式 */
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 20px;
  padding: 20px;
}

.gallery-carousel img {
  width: 100%;
  border-radius: 8px;
}

.gallery-justified { /* 画廊对齐样式 */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  padding: 20px;
}
.gallery-justified img {
  height: 150px;
  width: auto;
}

.gallery-hover {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.gallery-hover .item{
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.gallery-hover .overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-hover .item:hover .overlay {
  opacity: 1;
}

.gallery-hover img {
  width: 100%;
  border-radius: 8px;
}

.flip-card {
  background: transparent;
  width: 300px;
  height: 400px;
  perspective: 1000px;
  margin: 0 auto;
}

.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s ease;
  transform-style: preserve-3d;
}

/* 使卡片在鼠标悬停时翻转 
.flip-card:hover .flip-inner {
  transform: rotateY(180deg);
} */

/* 点击卡片时翻转 */
.flip-card.clicked .flip-inner {
  transform: rotateY(180deg);
}
.flip-card {
  cursor: pointer;
}

.flip-front, .flip-back {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  backface-visibility: hidden;
  background-color: white;
  padding: 20px;
}

.flip-front img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 15px;
}

.flip-front h3, .flip-back h3 {
  color: var(--highlight);
  font-size: 1.4rem;
}

.flip-back {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.button-link {
  display: inline-block;
  margin-top: 15px;
  text-decoration: none;
  color: white;
  background: var(--accent);
  padding: 10px 16px;
  border-radius: 6px;
  transition: background 0.3s;
}

.button-link:hover {
  background: #ff7364;
}
/* 以上是Flip Card的样式 */



/* Gallery */
.gallery-grid-basic { /* 相册网格布局 */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.gallery-grid-basic img {
  width: 100%;
  border-radius: 8px;
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.gallery-grid img {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.gallery-grid img:hover {
  transform: scale(1.03);
}