* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Arial', sans-serif;
  background-color: #f5f5f5;
  color: #333;
  min-height: 100vh;
  overflow-x: hidden;
}

/* 登录页面样式 */
#loginPage {
  min-height: 100vh;
  width: 100%;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  padding: 15px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-size: cover;
  background-size: cover;
  position: relative;
}

#registerPage, #adminLoginPage {
  min-height: 100vh;
  width: 100%;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  padding: 15px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: none;
}

#app, #adminPanel {
  min-height: 100vh;
  display: none;
}

.login-container {
  background-color: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  padding: 30px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  position: relative;
}

.login-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(90deg, #3498db, #e74c3c, #f39c12, #27ae60);
}

.login-container h1 {
  margin-bottom: 25px;
  color: #2c3e50;
  font-size: 28px;
  font-weight: 600;
}

.login-form {
  margin-top: 15px;
}

.login-form h2 {
  margin-bottom: 25px;
  color: #3498db;
  font-size: 22px;
}

.login-links {
  margin-top: 25px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-links button {
  background-color: transparent;
  color: #3498db;
  border: 1px solid #3498db;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 15px;
  transition: all 0.3s ease;
}

.login-links button:hover {
  background-color: #3498db;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* 表单输入框样式优化 */
.login-form .form-group {
  margin-bottom: 20px;
  text-align: left;
}

.login-form .form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #4a5568;
  font-size: 14px;
}

.login-form .form-group input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 16px;
  transition: all 0.3s ease;
  background-color: #f8fafc;
}

.login-form .form-group input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
  background-color: white;
}

.login-form .form-group input::placeholder {
  color: #94a3b8;
}

/* 登录按钮样式 */
.login-form button[type="submit"] {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
}

.login-form button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.login-form button[type="submit"]:active {
  transform: translateY(0);
}

/* 错误提示样式 */
.login-error {
  color: #e74c3c;
  font-size: 14px;
  margin-top: 15px;
  display: none;
}

.login-error.show {
  display: block;
}

/* 主应用样式 */
#app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
}

.header-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

#userInfo {
  margin-right: 10px;
  font-weight: bold;
}

h1 {
  font-size: 24px;
  color: #2c3e50;
}

button {
  padding: 10px 20px;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #2980b9;
}

.search-container {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  justify-content: center;
}

.search-container input {
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  width: 300px;
}

.search-container button {
  padding: 10px 20px;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
}

.search-container button:hover {
  background-color: #2980b9;
}

#albumList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.album-card {
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
  cursor: pointer;
}

.album-card:hover {
  transform: translateY(-5px);
}

.album-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.album-info {
  padding: 15px;
}

.album-info h3 {
  margin-bottom: 10px;
  font-size: 18px;
}

.album-info p {
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
}

.album-stats {
  font-size: 12px;
  color: #999;
}

#albumDetail {
  margin-top: 20px;
}

.album-header {
  display: flex;
  align-items: center;
  margin-bottom: 30px;
}

.album-header h2 {
  flex: 1;
  margin: 0 20px;
  font-size: 24px;
}

.header-actions {
  display: flex;
  gap: 10px;
}

.album-cover {
  position: relative;
  width: 100%;
  height: 400px;
  margin-bottom: 30px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

#changeCoverBtn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background-color: rgba(0, 0, 0, 0.6);
  padding: 8px 16px;
  font-size: 12px;
}

#changeCoverBtn:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

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

.photo-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

.photo-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.upload-section {
  margin-bottom: 30px;
  padding: 20px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#photoUpload {
  margin-bottom: 10px;
}

.comments-section {
  background-color: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.comments-section h3 {
  margin-bottom: 15px;
}

#commentsList {
  margin-bottom: 20px;
}

.comment-item {
  padding: 10px 0;
  border-bottom: 1px solid #e0e0e0;
}

.comment-item:last-child {
  border-bottom: none;
}

.comment-item p {
  margin-bottom: 5px;
}

.comment-item .comment-time {
  font-size: 12px;
  color: #999;
}

.comment-form {
  display: flex;
  gap: 10px;
}

#commentInput {
  flex: 1;
  padding: 10px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 14px;
}

/* 管理员后台样式 */
#adminPanel {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.admin-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 10px;
}

.nav-btn {
  padding: 10px 20px;
  background-color: #f0f0f0;
  color: #333;
  border: none;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.nav-btn.active {
  background-color: #3498db;
  color: white;
}

.content-section {
  background-color: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#userList {
  margin-top: 20px;
}

.user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #e0e0e0;
}

.user-item:last-child {
  border-bottom: none;
}

.user-info {
  flex: 1;
}

.user-actions {
  display: flex;
  gap: 10px;
}

.delete-btn {
  background-color: #e74c3c;
}

.delete-btn:hover {
  background-color: #c0392b;
}

#adminAlbumList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.admin-album-card {
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.admin-album-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.admin-album-info {
  padding: 15px;
}

.admin-album-info h3 {
  margin-bottom: 10px;
  font-size: 18px;
}

.admin-album-info p {
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
}

.admin-album-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.admin-action-btn {
  background-color: #e74c3c;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  margin-bottom: 20px;
  transition: background-color 0.3s;
}

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

/* 模态框样式 */
#modal, #addUserModal, #shareModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  display: none;
}

.modal-content {
  background-color: white;
  padding: 30px;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  position: relative;
}

.close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 24px;
  cursor: pointer;
  color: #999;
}

.close:hover {
  color: #333;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  font-size: 14px;
}

.form-group.checkbox-group {
  display: flex;
  align-items: center;
}

.form-group.checkbox-group input[type="checkbox"] {
  width: auto;
  margin-right: 10px;
  padding: 0;
}

.form-group.checkbox-group label {
  display: inline-block;
  margin-bottom: 0;
  font-weight: normal;
}

/* 横向排列的复选框组 */
.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
  align-items: center;
}

.checkbox-item {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
  padding: 0;
  cursor: pointer;
}

.checkbox-item span {
  font-size: 14px;
  color: #333;
}

/* 横向排列的表单行 */
.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

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

/* 日期范围选择器 */
#dateRangePicker {
  position: relative;
}

.date-picker-inputs {
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-input-wrapper {
  flex: 1;
  position: relative;
}

.date-input {
  width: 100%;
  padding: 10px 30px 10px 10px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  background-color: white;
}

.date-input:focus {
  outline: none;
  border-color: #667eea;
}

.date-label {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #999;
}

.date-separator {
  font-size: 18px;
  color: #ccc;
  margin: 0 5px;
}

/* 日历容器 */
#calendarContainer {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  padding: 15px;
  z-index: 1000;
  min-width: 280px;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.calendar-nav-btn {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: #f5f5f5;
  color: #333;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.calendar-nav-btn:hover {
  background: #e0e0e0;
}

.calendar-title {
  font-weight: 600;
  color: #333;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 10px;
}

.calendar-weekdays span {
  text-align: center;
  font-size: 12px;
  color: #999;
  padding: 5px 0;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  color: #333;
}

.calendar-day:hover:not(.other-month) {
  background: #f0f0f0;
}

.calendar-day.other-month {
  color: #ccc;
  cursor: default;
}

.calendar-day.today {
  background: #667eea;
  color: white;
}

.calendar-day.selected-start {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.calendar-day.selected-end {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  color: white;
}

.calendar-day.in-range {
  background: #e8e4ff;
}

.calendar-day.selected-start.in-range,
.calendar-day.selected-end.in-range {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.calendar-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

.calendar-actions button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

#clearDatesBtn {
  background: #f5f5f5;
  color: #666;
}

#clearDatesBtn:hover {
  background: #e0e0e0;
}

#confirmDatesBtn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

#confirmDatesBtn:hover {
  opacity: 0.9;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 14px;
}

.form-group textarea {
  height: 100px;
  resize: vertical;
}

.form-group button {
  width: 100%;
  padding: 12px;
  font-size: 16px;
}

.share-section {
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.share-content {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}

.share-link {
  flex: 1;
  min-width: 300px;
}

.qr-code {
  text-align: center;
}

.share-buttons {
  display: flex;
  gap: 10px;
}

@media (max-width: 768px) {
  /* 登录页面移动端适配 */
  #loginPage, #registerPage, #adminLoginPage {
    padding: 10px;
  }
  
  .login-container {
    padding: 25px 20px;
    border-radius: 12px;
  }
  
  .login-container h1 {
    font-size: 24px;
    margin-bottom: 20px;
  }
  
  .login-form h2 {
    font-size: 20px;
    margin-bottom: 20px;
  }
  
  .login-form .form-group input {
    padding: 12px 14px;
    font-size: 15px;
  }
  
  .login-form button[type="submit"] {
    padding: 13px;
    font-size: 15px;
  }
  
  .login-links button {
    padding: 11px 20px;
    font-size: 14px;
  }
  
  /* 主应用移动端适配 */
  #app, #adminPanel {
    padding: 10px;
  }
  
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .header-buttons {
    flex-wrap: wrap;
  }
  
  .album-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .album-header h2 {
    margin: 0;
  }
  
  .album-cover {
    height: 250px;
  }
  
  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  
  .photo-item img {
    height: 150px;
  }
  
  .comment-form {
    flex-direction: column;
  }
  
  .login-container {
    padding: 20px;
  }
  
  .admin-nav {
    flex-direction: column;
  }
  
  .user-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .user-actions {
    align-self: flex-end;
  }
  
  .share-content {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .share-link {
    min-width: 100%;
  }
  
  #shareUrl {
    width: 100% !important;
  }
  
  .share-buttons {
    width: 100%;
    justify-content: space-between;
  }
  
  }

/* 封面轮播图片样式 */
.cover-slide-item {
  position: relative;
  margin: 5px;
  text-align: center;
}

.cover-slide-label {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.cover-slide-upload {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

.cover-slide-preview {
  max-width: 120px;
  max-height: 120px;
  object-fit: cover;
  border-radius: 8px;
}

.cover-slide-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  border: 2px dashed #ddd;
  border-radius: 8px;
  color: #999;
  cursor: pointer;
  transition: all 0.2s;
}

.cover-slide-placeholder:hover {
  border-color: #3498db;
  color: #3498db;
}

.remove-cover-slide {
  margin-top: 5px;
  padding: 4px 10px;
  background-color: #dc3545;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.2s;
}

.remove-cover-slide:hover {
  background-color: #c82333;
}
