/* 基础样式 */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 20px;
  background-color: #f5f5f5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h1 {
  text-align: center;
  margin-bottom: 20px;
}
h2 {
  color: #333;
}
li {
  list-style: none;
}

p {
  margin-bottom: 3px; /* 从 5px 调整为 3px */
  margin-top: 3px; /* 从 5px 调整为 3px */
}

/* 成员列表样式 */
.member-list-container {
  margin-top: 20px;
}

#member-list {
  padding: 0;
  display: flex;
  flex-direction: column;
  /* align-items: center; */
}

.member-item {
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-bottom: 10px;
  padding: 15px;
  background: #fff;
  
  transition: all 0.3s ease;
  text-align: center;
}

.member-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

/* 移动端样式 */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
  
  .member-item {
    padding: 10px;
    margin-bottom: 8px;
  }
  
  .member-header {
    flex-direction: row; /* 修改为 row，确保并排显示 */
    align-items: center; /* 确保内容垂直居中 */
    gap: 8px;
  }
  
  .toggle-btn {
    width: auto; /* 自动宽度，避免按钮过长 */
    padding: 8px;
  }
  
  .switch-container {
    flex-direction: column;
    gap: 10px;
  }
  
  .pagination-controls {
    flex-direction: column;
    gap: 10px;
  }
  
  .pagination-controls button {
    width: 100%;
    padding: 8px;
  }
}

.member-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px; /* 减少 padding */
  background-color: #f9f9f9;
  cursor: pointer;
  flex-wrap: nowrap; /* 防止换行 */
  height: 40px; /* 设置固定高度 */
  white-space: nowrap; /* 防止内容换行 */
  overflow: hidden; /* 防止内容溢出 */
}

.member-name {
  flex: 1; /* 允许名称占据剩余空间 */
  overflow: visible; /* 确保内容可见 */
  text-overflow: ellipsis; /* 超出部分显示省略号 */
  white-space: nowrap; /* 防止名称换行 */
  min-width: 50px; /* 设置最小宽度，确保内容不被完全隐藏 */
  text-align: left; /* 新增：向左对齐 */
}

.toggle-btn {
  padding: 5px 10px;
  border: 1px solid #007bff;
  border-radius: 4px;
  background-color: #007bff;
  color: white;
  cursor: pointer;
  flex-shrink: 0; /* 防止按钮缩小 */
  width: 60px; /* 固定按钮宽度 */
  height: 30px; /* 设置按钮高度 */
  line-height: 20px; /* 确保按钮文字垂直居中 */
}

.toggle-btn:hover {
  background-color: #043a6d;
}

.member-details {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eee;
}

/* 开关样式 */
.switch-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
}

.switch-container label {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.switch-container label:hover {
  background-color: #f5f5f5;
}

.admin-switch {
  color: #d32f2f;
}

.member-details {
  transition: all 0.3s ease-out;
  overflow: hidden;
}


.member-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background-color: #f9f9f9;
  cursor: pointer;
}

.toggle-btn {
  padding: 5px 10px;
  border: 1px solid #007bff;
  border-radius: 4px;
  background-color: #007bff;
  color: white;
  cursor: pointer;
}

.toggle-btn:hover {
  background-color: #043a6d;
}

/* 自定义开关样式 */
.switch-container input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 40px;
  height: 20px;
  background: #ccc;
  border-radius: 20px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s ease;
}

.switch-container input[type="checkbox"]:checked {
  background: #4CAF50;
}

.switch-container input[type="checkbox"]::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  top: 2px;
  left: 2px;
  transition: transform 0.3s ease;
}

.switch-container input[type="checkbox"]:checked::before {
  transform: translateX(20px);
}

/* 移动端开关样式 */
@media (max-width: 768px) {
  .switch-container input[type="checkbox"] {
    width: 36px;
    height: 18px;
  }
  
  .switch-container input[type="checkbox"]::before {
    width: 14px;
    height: 14px;
  }
  
  .switch-container input[type="checkbox"]:checked::before {
    transform: translateX(18px);
  }
}

/* 搜索框样式 */
.search-container {
  display: flex;
  gap: 10px;
  margin: 20px 0;
  width: 100%; /* 新增：确保容器宽度占满父容器 */
}

#search-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  min-width: 0; /* 新增：防止输入框溢出 */
}

#search-btn {
  background: #007bff;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap; /* 新增：防止按钮文字换行 */
}

/* 分页控件样式 */
.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 20px 0;
  width: 100%;
  flex-wrap: nowrap; /* 防止换行 */
  white-space: nowrap; /* 防止内容换行 */
}

.pagination-controls button {
  padding: 5px 15px;
  background-color: #007BFF;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap; /* 防止按钮文字换行 */
  flex-shrink: 0; /* 防止按钮缩小 */
  flex-grow: 0; /* 防止按钮拉伸 */
  width: 80px; /* 设置固定宽度 */
}

.pagination-controls button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.pagination-controls button:hover:not(:disabled) {
  background-color: #0056b3;
}

#page-info {
  font-size: 14px;
  color: #666;
  white-space: nowrap; /* 防止文字换行 */
  flex-shrink: 0; /* 防止文字缩小 */
}

/* 移动端样式 */
@media (max-width: 768px) {
  .pagination-controls {
    gap: 5px; /* 缩小按钮间距 */
    padding: 0 10px; /* 添加内边距防止内容溢出 */
    flex-direction: row; /* 确保按钮在一行显示 */
    flex-wrap: nowrap; /* 防止换行 */
  }

  .pagination-controls button {
    padding: 5px 10px; /* 缩小按钮内边距 */
    font-size: 12px; /* 缩小字体大小 */
    flex-shrink: 0; /* 防止按钮缩小 */
  }

  #page-info {
    font-size: 12px; /* 缩小字体大小 */
    flex-shrink: 0; /* 防止文字缩小 */
  }
}

.btn-btn {
  padding: 5px 10px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  background-color: #007bff;
  color: white;
}
.menu-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.menu-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  background-color: #f0f0f0;
  color: #333;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.menu-btn:hover {
  background-color: #e0e0e0;
}

.menu-btn.active {
  background-color: #007bff;
  color: white;
}

.switch-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}
.status {
  font-weight: bold;
}
.switch {
  position: relative;
  display: inline-block;
  width: 50px; /* 缩小宽度 */
  height: 28px; /* 缩小高度 */
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 28px; /* 根据高度调整圆角 */
}
.slider:before {
  position: absolute;
  content: "";
  height: 20px; /* 缩小高度 */
  width: 20px; /* 缩小宽度 */
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: #4CAF50;
}
input:checked + .slider:before {
  transform: translateX(22px); /* 调整位移 */
}

/* 模态框样式 */
.modal {
  display: none; /* 默认隐藏 */
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4);
}

.modal-content {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 50%;
}

.close-btn {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
}

.close-btn:hover,
.close-btn:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

/* 加载图标样式 */
#loading-icon {
  display: none;
  text-align: center;
  margin-top: 10px;
}

.loader {
  border: 16px solid #f3f3f3; /* Light grey */
  border-top: 16px solid #3498db; /* Blue */
  border-radius: 50%;
  width: 32px;
  height: 32px;
  animation: spin 2s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 提示信息样式 */
#upload-message {
  margin-top: 10px;
  text-align: center;
  font-size: 16px;
}

/* 成功弹窗样式 */
#success-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4);
}

#success-modal .modal-content {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 300px;
  text-align: center;
}

#success-modal .close-btn {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
}

#success-modal .close-btn:hover,
#success-modal .close-btn:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

/* 弹窗样式 */
.popup {
    display: none; /* 默认隐藏 */
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.popup-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    text-align: center;
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-btn:hover,
.close-btn:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* 弹窗样式 */
.popup {
  display: none; /* 默认隐藏 */
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4);
}

.popup-content {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  width: fit-content; /* 适应内容宽度 */
  max-width: 300px; /* 最大宽度 */
  text-align: center;
}

.close-btn1 {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
}

.close-btn1:hover,
.close-btn1:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

/* 图片样式 */
#popup-image {
  width: 100%; /* 图片宽度占满内容宽度 */
  height: auto; /* 保持图片比例 */
  max-width: 600px; /* 最大宽度 */
  max-height: 250px; /* 最大高度 */
  object-fit: contain; /* 保持图片比例 */
}