body {
  font-family: Arial, sans-serif;
  background-color: #f0f0f0;
  color: #333;
  transition: background-color 0.5s, color 0.5s;
  margin: 0;
  padding: 0;
}

h1 {
  margin: 10px;
}

@media screen and (max-width: 768px) {
  .header {
    grid-template-columns: repeat(auto-fill, minmax(100%, 1fr)) !important;
  }

  .image-gallery {
    margin: 150px 15px 15px !important;
  }
  
}

.header {
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  z-index: 2;
  background-color: #00aeec;
  color: #fff;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(50%, 1fr));
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin: 0;
}

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

button {
  background-color: #fb7299;
  color: #fff;
  border: none;
  cursor: pointer;
  padding: 10px 10px;
  border-radius: 10px;
  font-weight: bold;
}

button:active {
  -webkit-transform: translate(0, 2px);
  -moz-transform: translate(0, 2px);
  transform: translate(0, 2px);
  border-bottom: none;
}

.search-container {
  display: flex;
  justify-content: center;
  text-align: center;
  margin: 10px 8px;
}

.search-container button {
  margin: 0 8px;
}

.search-container :last-child {
  margin-left: 0;
}

input[type="text"] {
  color: #333;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 10px;
  width: 40%;
  font-size: 16px;
}

.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  grid-gap: 20px;
  margin: 90px 15px 15px;
}

.image-item {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
}

.image-item img {
  margin: auto;
  height: 600px;
  width: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}

.image-item:hover img {
  transform: scale(1.05);
}

/* 添加 loading 样式 */
.image-loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  line-height: 600px;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  color: #fff;
  text-align: center;
  border-radius: 10px;
  font-size: 1.5rem;
  z-index: 1;
}

/* 夜间模式样式 */
.night-mode {
  background-color: #222;
  color: #ddd;
}

.night-mode .header {
  background-color: #333;
  color: #ddd !important;
}

.night-mode header {
  background-color: #333;
  color: #ddd !important;
}

.night-mode button {
  background-color: #4b4a4a !important;
  color: #ddd !important;
  border-color: #fff;
}

.night-mode input[type="text"] {
  background-color: #444;
  color: #ddd !important;
  border-color: #fff !important;
}

/* .night-mode .image-item img {
  filter: grayscale(100%) brightness(0.9);
} */

.night-mode .search-container input[type="text"]::placeholder {
  color: #ccc !important;
}

.night-mode footer {
  background-color: #333 !important;
  color: #ddd !important;
}

.night-mode a {
  color: #ddd !important;
}

.night-mode body {
  color: #ddd !important;
}

.pagination-container {
  position: relative;
  text-align: center;
  margin: 20px auto;
  display: flex;
  justify-content: center;
}

.pagination-container button {
  margin: 0 1px;
}

.pagination-container span {
  display: flex;
  align-items: center;
  margin: 0 10px;
}

.mobile-pagination-container {
  display: none;
  text-align: center;
  margin: 20px auto;
  display: flex;
  justify-content: center;
}

.mobile-pagination-container button {
  margin: 0 1px;
  border-radius: 3em;
  padding: 15px 10em;
}

/* 修改footer颜色 */
footer {
  position: relative;
  text-align: center;
  padding: 10px 0;
  background-color: #00aeec;
  color: #fff;
  font-size: 14px;
}

/* 返回顶部按钮样式 */
.scroll-top-btn {
  display: none;
  position: fixed;
  bottom: 70px;
  right: 20px;
  padding: 10px 20px;
  border-radius: 25em;
  background-color: rgb(0, 174, 236, 0.5);
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  width: 55px;
  box-shadow: 0px 10px 10px 0px rgba(0, 0, 0, 0.2);
  z-index: 3;
}

/* 示例悬停效果 */
.scroll-top-btn:hover {
  background-color: rgb(0, 174, 236, 0.8);
  transition: background-color 0.3s ease;
}

.scroll-top-btn.show {
  display: block;
}

/* 夜间模式按钮 */
.darkmode-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 10px 20px;
  border-radius: 25em;
  background-color: rgb(0, 174, 236, 0.5);
  color: #fff; /* 按钮文本颜色 */
  font-size: 16px; /* 文本字体大小 */
  font-weight: bold; /* 文本加粗 */
  border: none;
  cursor: pointer;
  width: 55px;
  box-shadow: 0px 10px 10px 0px rgba(0, 0, 0, 0.2);
  z-index: 3;
}

/* 示例悬停效果 */
.darkmode-btn:hover {
  background-color: rgb(0, 174, 236, 0.8);
  transition: background-color 0.3s ease;
}

.loader-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loader {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top: 4px solid #3498db;
  width: 40px;
  height: 40px;
  animation: spin 2s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.icon {
  width: 30px;
  cursor: pointer;
}

.detail-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  background: rgb(221, 94, 54, 0.5);
  align-items: center;
  border-radius: 10px;
  margin: 20px;
  height: 800px;
}

.container-row {
  border-radius: 10px;
  color: #fff;
  text-align: center;
}

.detail-img {
  max-height: 700px;
  max-width: 100%;
  border-radius: 10px;
  object-fit: contain;
}

.image-detail {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(100%, 1fr));
  padding-bottom: 20px;
}
