/* 后台管理样式 */
.admin-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.admin-login {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 2rem;
  background-color: white;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.error-message {
  color: #d32f2f;
  margin-bottom: 1rem;
  padding: 0.5rem;
  background-color: #ffebee;
  border-radius: 4px;
}

.admin-menu {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.admin-card {
  display: block;
  padding: 2rem;
  background-color: white;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.admin-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--accent-color);
}

.upload-section {
  margin-bottom: 3rem;
  padding: 1.5rem;
  background-color: white;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.slides-grid, .artworks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.slide-item, .artwork-item {
  background-color: white;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.slide-item img, .artwork-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.slide-info, .artwork-info {
  padding: 1rem;
}

.toggle-group {
  display: flex;
  margin: 1rem 0;
}

.toggle-group label {
  margin-right: 1rem;
}

.btn-small {
  padding: 0.5rem 1rem;
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.btn-small:hover {
  background-color: #8a7b88;
}

/* 管理页面样式 */
.admin-body {
  background-color: #f8f9fa;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-header {
  background-color: #343a40;
  color: white;
  padding: 1rem 2rem;
}

.admin-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-logo a {
  font-size: 1.5rem;
  color: white;
  font-weight: 500;
}

.admin-menu ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.admin-menu li {
  margin-left: 1.5rem;
}

.admin-menu a {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.admin-menu a:hover {
  color: white;
}

.admin-main {
  flex: 1;
  padding: 2rem;
}

.admin-container {
  max-width: 1200px;
  margin: 0 auto;
  background-color: white;
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  padding: 2rem;
}

.admin-container h1 {
  margin-bottom: 2rem;
  border-bottom: 1px solid #eee;
  padding-bottom: 1rem;
}

.admin-actions {
  margin-bottom: 3rem;
}

.upload-form {
  max-width: 600px;
  background-color: #f8f9fa;
  padding: 1.5rem;
  border-radius: 5px;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 3px;
}

.btn-admin {
  background-color: #343a40;
  color: white;
  border: none;
  padding: 0.5rem 1.5rem;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-admin:hover {
  background-color: #23272b;
}

.subscribers-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.subscribers-hint {
  margin: 0.5rem 0 1rem 0;
  font-size: 0.9rem;
  color: #666;
}

.admin-list h2 {
  margin-bottom: 1.5rem;
}

.artworks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.artwork-card {
  border: 1px solid #eee;
  border-radius: 5px;
  overflow: hidden;
}

.artwork-image {
  height: 200px;
  overflow: hidden;
}

.artwork-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.artwork-info {
  padding: 1rem;
}

.artwork-info h3 {
  margin-bottom: 0.5rem;
}

.update-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

.admin-login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
}

.login-form-wrapper {
  width: 100%;
  max-width: 400px;
  background-color: white;
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  padding: 2rem;
}

.login-form-wrapper h1 {
  text-align: center;
  margin-bottom: 2rem;
}

.error-message {
  background-color: #f8d7da;
  color: #721c24;
  padding: 0.75rem;
  border-radius: 3px;
  margin-bottom: 1rem;
}

.back-to-site {
  text-align: center;
  margin-top: 1.5rem;
}

.admin-footer {
  background-color: #343a40;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  padding: 1rem;
  font-size: 0.8rem;
}

/* 管理员界面样式 */
.admin-dashboard {
  padding: 8rem 0 4rem;
  position: relative;
  z-index: 5;
  background-color: #f5f5f5;
}

.admin-container {
  position: relative;
  z-index: 10;
  background-color: #f5f5f5;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.admin-title {
  font-size: 2.5rem;
  margin: 0;
}

.admin-actions {
  display: flex;
  gap: 1rem;
}

.admin-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  margin-bottom: 2rem;
  position: relative;
  z-index: 1; /* 确保卡片在其他元素之上 */
}

.admin-card-title {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #eee;
  padding-bottom: 1rem;
}

.admin-form {
  margin-top: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
}

textarea.form-control {
  min-height: 150px;
}

.btn-admin {
  display: inline-block;
  padding: 0.8rem 2rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.btn-admin:hover {
  background-color: #333;
}

.btn-outline-admin {
  background-color: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline-admin:hover {
  background-color: var(--primary-color);
  color: white;
}

.btn-danger {
  background-color: #dc3545;
}

.btn-danger:hover {
  background-color: #c82333;
}

/* 管理员登录页面 */
.admin-login {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #f5f5f5;
}

.login-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  width: 100%;
  max-width: 400px;
}

.login-title {
  text-align: center;
  margin-bottom: 2rem;
}

.login-form {
  margin-top: 1rem;
}

.error-message {
  color: #dc3545;
  margin-bottom: 1rem;
}

/* 确保管理员界面元素在其他元素之上 */
.admin-dashboard,
.admin-login,
.admin-card,
.login-card {
  position: relative;
  z-index: 10;
}

/* 修复可能的遮挡问题 */
.navbar {
  z-index: 1000;
}

/* 如果有音乐播放器或其他固定元素，确保它们不会遮挡管理界面 */
.music-player,
.music-toggle-btn,
.lyrics-toggle-btn,
#artistic-lyrics {
  z-index: 1001;
}

/* 确保弹出层或模态框在最上层 */
.modal,
.popup {
  z-index: 2000;
}

.admin-content {
  position: relative;
  z-index: 5;
}

/* 全屏管理员界面 */
.admin-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #f5f5f5;
  z-index: 9999;
  overflow-y: auto;
  padding: 2rem;
}

.admin-close-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #dc3545;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10000;
}

/* 表单行布局 */
.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 1.5rem;
}

.form-group.half {
  flex: 1;
}

/* 预览容器样式 */
.preview-image-container {
  width: 100%;
  max-width: 300px;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f0f0f0;
}

.preview-image {
  width: 100%;
  height: auto;
  object-fit: contain;
  max-height: 300px;
}

small {
  display: block;
  color: #666;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.artwork-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.artwork-link {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
}

.artwork-edit-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.artwork-link:hover .artwork-edit-overlay {
  opacity: 1;
}

.edit-label {
  color: white;
  font-size: 1.2rem;
  font-weight: bold;
  background-color: rgba(0, 123, 255, 0.8);
  padding: 8px 16px;
  border-radius: 4px;
}

.artwork-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.artwork-item:hover .artwork-overlay {
  opacity: 1;
}

.edit-btn {
  display: inline-block;
  padding: 10px 20px;
  background-color: #007bff;
  color: white;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

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

.artwork-info {
  padding: 1rem;
}

.btn-primary {
  background-color: #007bff;
}

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

/* 图片管理样式 */
.artwork-images-container {
  margin-top: 20px;
}

.primary-image, .additional-images {
  margin-bottom: 30px;
}

.image-preview {
  width: 200px;
  height: 200px;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  margin-bottom: 10px;
  background-color: #f0f0f0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.image-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

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

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

.image-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.image-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 10px;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: space-between;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.image-item:hover .image-actions {
  opacity: 1;
}

.btn-delete-image, .btn-make-primary {
  background-color: #dc3545;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.8rem;
}

.btn-make-primary {
  background-color: #007bff;
}

.image-caption {
  width: 100%;
  padding: 8px;
  border: none;
  border-top: 1px solid #ddd;
  font-size: 0.9rem;
}

/* 裁剪模态框样式 */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
  background-color: #fefefe;
  margin: 5% auto;
  padding: 20px;
  border-radius: 8px;
  width: 80%;
  max-width: 800px;
}

.close-modal {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close-modal:hover {
  color: black;
}

.crop-container {
  max-height: 60vh;
  overflow: hidden;
  margin: 20px 0;
}

.crop-controls {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  justify-content: center;
}