body {
  font-family: sans-serif;
  margin: 0;
  padding: 0;
  background: #ffffff;
}

h1 {
  text-align: left;
  padding: 20px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* 自动填充列，最小宽度150px */
  gap: 10px; /* 网格间距 */
  padding: 20px /* 内边距 */;
}

.gallery img {
  width: 100%;
  display: block;
  cursor: pointer;/* 鼠标悬停时显示手型 */
  transition: transform 0.3s ease;
  margin: 0; /* 去除图片自身的外边距 */
}

.gallery img:hover {
   filter: brightness(1.1) ;
}

/* 左右布局容器 */
.container {
  display: flex;
  min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
  width: 220px;
  background: #f5f5f5;
  padding: 30px 20px;
  box-sizing: border-box;
  border-right: 1px solid #ddd;
}

.sidebar h1 {
  font-size: 2em;
  margin-bottom: 1em;
  text-align: left;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar li {
  margin-bottom: 1em;
}

.sidebar a {
  color: #333;
  text-decoration: none;
  font-size: 1.1em;
}

/* 预览样式 */
.preview {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  z-index: 1000;
}

.preview-img-wrapper {
  position: relative;
  display: inline-block;
}

.preview-img-wrapper img {
  max-width: 80vw;
  max-height: 80vh;
  display: block;
}

.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  background: rgba(0,0,0,0.4);
  border-radius: 50%;
  padding: 0.2em 0.4em;
  user-select: none;
}

#prevBtn { left: 10px; }
#nextBtn { right: 10px; }

#closePreview {
  position: absolute;
  top: 10px;
  right: 20px;
}
