body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  height: 100vh;
  transition: background-color 0.3s, color 0.3s, font-family 0.3s;
  display: flex;
}

body.light-mode {
  background-color: #f0f4f8;
  color: #2e3b4e;
}

body.dark-mode {
  background-color: #121212;
  color: #e0e0e0;
  font-family: "Arial", sans-serif; /* 夜间模式使用不同的字体 */
}

.sidebar {
  position: fixed;
  width: 15%;
  background-color: #eef1f4;
  box-sizing: border-box;
  border-right: 1px solid #e0e6eb;
  transition: width 0.3s, background-color 0.3s, border-right-color 0.3s;
  height: 100vh;
  overflow: auto;
}
.sidebar.dark-mode {
  background-color: #181e24; /* 夜间模式下的侧边栏背景色 */
  border-right: 1px solid #101418; /* 夜间模式下的边框颜色 */
}

h2 {
  margin-top: 0;
  font-size: 1.2rem;
  font-weight: 600;
  display: inline-block;
  margin-right: 10px;
}

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

li {
  cursor: pointer;
  padding: 10px;
  transition: background-color 0.3s;
}

li:hover {
  background-color: #404a5a;
}

.main {
  width: 85%;
  margin-left: 15%;
  flex: 1;
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
}
.main.dark-mode {
  background-color: #101418;
}

#gallery {
  margin: 0px;
  padding: 10px;
}

.item {
  margin-left: 15%;
  float: left;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 30px;
  font-weight: 700;
  color: aliceblue;
  width: 410px;
  position: absolute;
}

#toggle-sidebar,
#toggle-theme {
  background-color: transparent;
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
  margin-bottom: 20px;
  transition: transform 0.3s ease, background-color 0.3s ease;
  border-radius: 8px;
  padding: 10px;
}

#toggle-sidebar.collapsed {
  transform: rotate(180deg);
}

#toggle-theme {
  font-size: 1rem;
}

.subfolder-list {
  padding-left: 20px;
  display: none;
}

.folder.active .subfolder-list {
  display: block;
}

.subfolder {
  padding: 5px;
}

.folder:before {
  content: "📁";
  margin-right: 5px;
}

.subfolder:before {
  content: "📂";
  margin-right: 5px;
}

/* 模态框样式 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.5); /* 降低不透明度 */
  backdrop-filter: blur(20px) saturate(180%); /* 增加模糊度并调整饱和度 */
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: inset 0 0 2000px rgba(255, 255, 255, 0.5); /* 添加内阴影 */
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.show {
  opacity: 1;
}

/* 优化亚克力效果 */
.modal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    125deg,
    rgba(255, 255, 255, 0.3),
    rgba(255, 255, 255, 0.1)
  );
  pointer-events: none;
}

.modal-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  max-width: 90%;
  max-height: 90vh;
  object-fit: contain;
  transition: transform 0.2s ease;
  cursor: grab;
  user-select: none;
}

.modal-controls {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 20px;
  align-items: center;
  background-color: rgba(28, 28, 28, 0.8);
  padding: 15px 25px;
  border-radius: 50px;
  backdrop-filter: blur(10px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.modal-prev,
.modal-next {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.1);
}

.modal-prev:hover,
.modal-next:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.modal-zoom-controls {
  display: flex;
  gap: 10px;
}

.modal-zoom-controls button {
  background-color: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  padding: 8px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.modal-zoom-controls button:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.modal-close {
  position: fixed;
  right: 30px;
  top: 30px;
  width: 50px; /* 增加尺寸 */
  height: 50px; /* 增加尺寸 */
  background-color: rgba(0, 0, 0, 0.6); /* 深色背景 */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white; /* 白色图标 */
  font-size: 32px; /* 增加图标大小 */
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  z-index: 1010; /* 确保在最上层 */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.modal-close:hover {
  background-color: rgba(0, 0, 0, 0.8);
  transform: rotate(90deg) scale(1.1);
}

/* 在亮色背景下的样式 */
body:not(.dark-mode) .modal-close {
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
}

/* 在暗色背景下的样式 */
body.dark-mode .modal-close {
  background-color: rgba(255, 255, 255, 0.6);
  color: black;
}

/* 添加操作提示 */
.modal-controls::after {
  content: "使用方向键切换图片，滚轮缩放，ESC关闭";
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  white-space: nowrap;
}

/* 优化图片网格样式 */
.item {
  cursor: zoom-in;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: 8px;
  overflow: hidden;
}

.item:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}
