body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f8f9fa;
  margin: 0;
  padding: 0;
  color: #333;
}
.header {
  position: sticky;
  top: 0;
  background-color: #ffffff;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 15px 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.media-container {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  aspect-ratio: 1 / 1;
  transition: transform 0.3s, box-shadow 0.3s;
}
.media-type {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 5px;
  border-radius: 5px;
  font-size: 14px;
  z-index: 10;
  cursor: pointer;
  display: none;
}
.file-name {
  position: absolute;
  bottom: 10px;
  left: 10px;
  color: black;
  padding: 5px;
  font-size: 14px;
  z-index: 10;
  cursor: pointer;
  display: block;
}
.upload-time {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background-color: rgba(255, 255, 255, 0.7);
  padding: 5px;
  border-radius: 5px;
  color: #000;
  font-size: 14px;
  z-index: 10;
  display: none;
}
.media-container:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
.gallery-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.3s;
  opacity: 0;
}
.gallery-image.loaded {
  opacity: 1;
}
.gallery-video, .gallery-audio {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.copy-url-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #007bff;
  color: white;
  padding: 5px 10px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  display: none;
}      
.copy-url-btn:hover {
  background-color: #0056b3;
}
.media-container.selected {
  border: 2px solid #007bff;
  background-color: rgba(0, 123, 255, 0.1);
}
.footer {
  margin-top: 20px;
  text-align: center;
  font-size: 18px;
  color: #555;
}
.delete-button {
  background-color: #ff4d4d;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 10px 15px;
  cursor: pointer;
  transition: background-color 0.3s;
  width: auto;
}
.delete-button:hover {
  background-color: #ff1a1a;
}
.hidden {
  display: none !important;
}
@media (max-width: 600px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
  .header {
    flex-direction: row;
    align-items: center;
  }
  .header-right {
    margin-left: auto;
  }
  .footer {
    font-size: 16px;
  }
  .delete-button {
    width: 100%;
    margin-top: 10px;
  }
}

/* 登录界面 */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(45deg, #007bff, #6610f2);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.login-header {
  background-color: #f8f9fa;
  padding: 30px 20px;
  text-align: center;
  border-bottom: 1px solid #e9ecef;
}

.login-logo {
  width: 50px;
  height: 50px;
  margin-bottom: 15px;
}

.login-header h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: #333;
}

.login-header p {
  color: #6c757d;
  margin: 10px 0 0;
}

.login-body {
  padding: 30px;
}

.login-body .form-group {
  margin-bottom: 25px;
}

.login-body label {
  font-weight: 500;
  color: #495057;
  margin-bottom: 8px;
}

.login-body .form-control {
  height: 46px;
  border-radius: 8px;
  border: 1px solid #ced4da;
  padding: 10px 15px;
  transition: all 0.3s;
}

.login-body .form-control:focus {
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.password-container {
  position: relative;
}

.toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #6c757d;
  cursor: pointer;
}

.login-btn {
  height: 46px;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.3s;
}

.login-error {
  color: #dc3545;
  font-size: 14px;
  margin-top: 15px;
  text-align: center;
}

.login-footer {
  padding: 15px 20px;
  text-align: center;
  background-color: #f8f9fa;
  border-top: 1px solid #e9ecef;
}

.back-link {
  color: #6c757d;
  text-decoration: none;
  transition: color 0.3s;
}

.back-link:hover {
  color: #007bff;
}

/* 管理面板界面 */
.admin-panel {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 导航栏 */
.navbar {
  background-color: #343a40;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  display: flex;
  align-items: center;
  font-weight: 600;
  text-align: left;
  margin-right: 0;
}

.nav-logo {
  width: 24px;
  height: 24px;
  margin-right: 10px;
}

.navbar > .container-fluid {
  justify-content: space-between;
}

.navbar-nav {
  flex-direction: row;
}

.nav-item {
  margin: 0 5px;
}

.nav-link {
  padding: 10px 15px;
  font-weight: 500;
}

/* 内容区域 */
.admin-content {
  flex: 1;
  padding: 30px 0;
}

.search-container {
  display: flex;
  margin-bottom: 20px;
}

.search-container .form-control {
  border-radius: 8px 0 0 8px;
  border-right: none;
  height: 46px;
}

.search-container .btn {
  border-radius: 0 8px 8px 0;
  width: 50px;
}

.action-container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.btn {
  border-radius: 8px;
  padding: 10px 20px;
  font-weight: 500;
}

/* 图库容器 */
.gallery-container {
  position: relative;
  min-height: 300px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.media-container {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  aspect-ratio: 1 / 1;
  transition: transform 0.3s, box-shadow 0.3s;
  background-color: #fff;
}

.media-container:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.media-container.selected {
  border: 2px solid #007bff;
  background-color: rgba(0, 123, 255, 0.1);
}

.media-type {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 12px;
  z-index: 10;
  display: none;
}

.file-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(255, 255, 255, 0.9);
  color: #333;
  padding: 8px 10px;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  z-index: 10;
}

.upload-time {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background-color: rgba(255, 255, 255, 0.7);
  padding: 5px 10px;
  border-radius: 20px;
  color: #000;
  font-size: 12px;
  z-index: 10;
  display: none;
}

.gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s;
  opacity: 0;
}

.gallery-image.loaded {
  opacity: 1;
}

.gallery-video, .gallery-audio {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.copy-url-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #007bff;
  color: white;
  padding: 8px 15px;
  border: none;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 20;
}

.media-container:hover .copy-url-btn {
  opacity: 1;
}

.copy-url-btn:hover {
  background-color: #0056b3;
}

/* 加载状态 */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px;
  text-align: center;
}

.loading-container p {
  margin-top: 15px;
  color: #6c757d;
}

/* 无搜索结果 */
.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px;
  text-align: center;
  color: #6c757d;
}

.no-results i {
  margin-bottom: 20px;
}

/* 页脚 */
.admin-footer {
  background-color: #f8f9fa;
  padding: 20px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  margin-top: 30px;
}

.admin-footer p {
  margin-bottom: 0;
  color: #6c757d;
}

.admin-footer a {
  color: #007bff;
  text-decoration: none;
}

.admin-footer a:hover {
  text-decoration: underline;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .admin-content {
    padding: 20px 0;
  }
  
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
  }
  
  .action-container {
    margin-top: 15px;
    justify-content: flex-start;
  }
  
  .btn {
    padding: 8px 15px;
    font-size: 14px;
  }
  
  .navbar-nav {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  
  .nav-item {
    margin: 0 2px;
  }
  
  .nav-link {
    padding: 8px 10px;
    font-size: 14px;
  }
  
  .nav-logo {
    width: 20px;
    height: 20px;
    margin-right: 8px;
  }
  
  .navbar-nav .nav-link,
  .nav-item,
  .btn,
  .media-container,
  .copy-url-btn {
    transition: none !important;
  }
  
  .media-container:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  }
  
  .audio-container {
    will-change: auto;
  }
  
  .gallery-audio {
    min-height: 30px;
    transform: translateZ(0);
  }
}

@media (max-width: 576px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .action-container {
    flex-direction: column;
    align-items: stretch;
    transition: none !important;
  }
  
  .action-container .btn {
    margin-right: 0 !important;
    margin-bottom: 10px;
    width: 100%;
  }
  
  .navbar-brand {
    font-size: 18px;
  }
  
  .nav-link {
    padding: 6px 8px;
    font-size: 12px;
  }
  
  .media-container:hover .audio-container {
    background-color: transparent;
  }
}

/* 添加初始加载样式 */
.initial-loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f8f9fa;
  z-index: 9999;
}

.initial-loading .spinner-grow {
  width: 3rem;
  height: 3rem;
}

/* 修改导航栏样式 */
.navbar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  margin-right: 0;
}

/* 调整导航栏布局 */
.navbar > .container-fluid {
  justify-content: center;
}

/* 调整导航菜单位置 */
.navbar-collapse {
  justify-content: flex-end;
}

/* 添加音频容器样式 */
.audio-container {
  cursor: pointer;
  transition: background-color 0.3s;
}

.media-container:hover .audio-container {
  background-color: #e9ecef;
}

/* 确保音频控件可用 */
.gallery-audio {
  min-height: 30px;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .gallery-audio {
    width: 95%;
    max-width: 160px;
  }
  
  .audio-container i.fa-music {
    font-size: 2em;
    margin-bottom: 15px;
  }
} 