/* 全局样式 */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f5f5f5;
}


h1 {
  font-size: 2rem;
  color: #333;
  text-align: center;
  margin-top: 20px;
}

h2 {
  font-size: 1.5rem;
  color: #333;
  text-align: left;
  margin-top: 20px;
}



h2 span.totle {
  color: #666;
  font-size: 1rem;
  font-weight: 500; /* 你喜欢的高亮色 */
}



.layout-toggle {
  display: flex;
  justify-content: center;
  margin: 20px 0;
  gap: 20px;
}

.layout-toggle button {
  padding: 10px 20px;
  background-color: #333;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.layout-toggle button:hover {
  background-color: #555;
}

.layout-toggle button:active {
  background-color: #150f2a;
}

.layout-toggle button.active {
  background-color: #ffcb00;
  color: #333;
  font-weight: bold;
}

main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

.photo-list {
  display: grid;
  gap: 20px;
  padding: 20px 0;
  justify-items: center;
}

.photo-item {
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* 增加阴影效果 */
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease; /* 增加动画效果 */
}

.photo-item:hover {
  transform: scale(1.03); /* 悬停时稍微放大图片 */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); /* 鼠标悬停时阴影增强 */
}

.photo-thumbnail {
  width: 100%;
  height: auto;
  display: block;
}

.photo-description {
  padding: 15px;
  text-align: center;
}

.photo-description h3 {
  font-size: 1.5rem;
  color: #333;
  margin-bottom: 10px;
}

.photo-description p {
  font-size: 1rem;
  color: #666;
  line-height: 1.6;
}

.small-layout .photo-description p {
  max-height: 3em; /* 限制描述的最大高度 */ 
  overflow: hidden;        /* 隐藏溢出内容 */
  text-overflow: ellipsis; /* 超出部分显示省略号 */
}

/* 小图模式样式 */
.photo-list.small-layout {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); /* 每行3-4个图 */
}

/* 大图模式样式 */
.photo-list.large-layout {
  grid-template-columns: 1fr; /* 每行1张大图 */
}
/* 响应式设计 */
.large-layout .photo-item {
  max-width: 1200px;
  width: 100%;
  max-height: calc(100vh+120px); /* 让每项最大不超过视口高度 */
  display: flex;
  flex-direction: column;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.large-layout .photo-thumbnail { 
  width: 100%;
  height: auto;
  max-height: calc(100vh); /* 预留描述空间，避免超出视口 */
  object-fit: contain; /* 避免裁剪图片 */
  display: block;
}

@media (max-width: 768px) {
  .photo-list.small-layout {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* 在小屏设备下每行显示2-3张图 */
  }

  .photo-list.large-layout {
    grid-template-columns: 1fr; /* 大图模式下每行依然显示1张大图 */
  }
}

@media (max-width: 480px) {
  .photo-description h3 {
    font-size: 1.2rem; /* 在手机屏幕上减少标题字体 */
  }
  .photo-description p {
    font-size: 0.9rem; /* 在手机屏幕上减小描述字体 */
  }
  .photo-list.small-layout {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); /* 每行3-4个图 */
}
}

header {
  background-color: #1f1f1f;
  color: rgb(136, 73, 73);
  padding: 10px 20px;
  text-align: left;
  display: flex;
  flex-wrap: wrap; /* 允许换行 */
  flex-direction: row;
}



header h1 {
  background: url("logo.png") no-repeat;
  background-size: cover;
  font-size: 2.5rem;
  margin: 0;
  display: inlie-block;
  width: 200px;
  min-width: 200px;
  height: 50px;
}


header h1 span {
  display: none;
}

nav {
  gap: 20px;
}

nav ul li {
  display: inline-block;
  margin: 0 20px;
}

nav ul li a {
  color: #fff;
  text-decoration: none;
}

nav ul li a:hover {
  color: #ffcb00;
  text-decoration: none;
}

nav ul li a.active {
  font-weight: bold;
  color: #ffcb00; /* 你喜欢的高亮色 */
  border-bottom: 2px solid currentColor;
}

#lang-toggle {
  background-color: #ffcb00;
  color: #333;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  margin-left: auto;
}

.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 图片预览覆盖层样式 */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.overlay.hidden {
  display: none;
}

.overlay-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.overlay-content img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 8px;
}

.photo-meta {
  margin-top: 1rem;
  text-align: center;
  color: white;
}

.close-button {
  position: absolute;
  top: -2rem;
  right: -2rem;
  font-size: 2rem;
  color: white;
  background: none;
  border: none;
  cursor: pointer;
}

.aboutcontainer {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
}

.aboutcontainer img {
  width: 133px;
  border-radius: 8px;
}

/* 专辑列表样式 */
.alblumscontainer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}


.album-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 2rem;
        padding-block: 2rem;
      }

.album-card {
        background: white;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        overflow: hidden;
        text-decoration: none;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        display: flex;
        flex-direction: column;
        height: 100%;
      }



.album-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
      }

.album-card img {
        width: 100%;
        height: 180px;
        object-fit: cover;
      }

.album-info {
        padding: 1rem;
        flex: 1;
        display: flex;
        flex-direction: column;
      }

.album-info h3 {
        margin: 0 0 0.5rem;
        font-size: 1.2rem;
        color: #222;
      }



.album-info p {
        font-size: 0.95rem;
        color: #555;
        flex-grow: 1;
      }




.album-info small {
        color: #999;
        font-size: 0.8rem;
        margin-top: 0.5rem;
      }

.back-button, .order {
  display: inline-block;
  padding: 0.4em 1em;
  /* margin-bottom: 1.2rem; */
  border: 1px solid #ccc;
  border-radius: 6px;
  text-decoration: none;
  background-color: #f9f9f9;
  color: #333;
  font-size: 0.95rem;
  transition: all 0.2s ease-in-out;
}

.back-button:hover, .order:hover {
  background-color: #e0e0e0;
  border-color: #aaa;
  color: #000;
}


/* 深色主题 */
@media (prefers-color-scheme: dark) {
  .album-card {
    background-color: #313131;
  }

  .large-layout .photo-item {
    background-color: #313131;
  }

   .small-layout .photo-item {
    background-color: #313131;
  }

  .photo-description h3 {
    color: #e8e8e8;
  }

  .photo-description p {
    color: #ccc;
  }

  .album-info h3 {
    color: #e8e8e8;
  }

  .album-info p {
    color: #ccc;
  } 

  h2 {
    color: #ffffff;
  }


  body {
    background-color: #252525;
    color: #eee;
  }

  h2 span.totle {
    color: #cacaca;
  }

  .back-button {
  display: inline-block;
  padding: 0.4em 1em;
  margin-bottom: 1.2rem;
  border: 1px solid #505050;
  border-radius: 6px;
  text-decoration: none;
  background-color: #333;
  color: #fff;
  font-size: 0.95rem;
  transition: all 0.2s ease-in-out;
  }

  .back-button:hover {
  background-color: #555;
  border: 1px solid #727272;
  color: #fff;
  }
  
}