:root {
  --primary-color: #3498db;
  --success-color: #2ecc71;
  --danger-color: #e74c3c;
  --warning-color: #f39c12;
  --dark-color: #2c3e50;
  --light-color: #ecf0f1;
  --gray-color: #95a5a6;
  --border-color: #ddd;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f7fa;
  color: #333;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  touch-action: manipulation;
}

/* 导航栏样式 */
.navbar {
  background: #fff;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.navbar-content {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  height: 60px;
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
}

/* 导航栏中的编辑器控件 */
.navbar-editor-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 20px;
}

.navbar-title-input {
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 14px;
  min-width: 200px;
  background: white;
}

.navbar-title-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.navbar-save-btn {
  padding: 6px 12px;
  background: var(--success-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.3s ease;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.navbar-save-btn:hover {
  background: #27ae60;
}

.navbar-save-btn:disabled {
  background: var(--gray-color);
  cursor: not-allowed;
}

.navbar-logo {
  height: 40px;
  width: auto;
}

.nav-link {
  color: var(--dark-color);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 4px;
  transition: background-color 0.3s ease;
  font-weight: 500;
}

.nav-link:hover {
  background-color: var(--light-color);
}

.upload-link {
  cursor: pointer;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.username {
  font-weight: 600;
  color: var(--dark-color);
}

.admin-badge {
  background: var(--warning-color);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.logout-link {
  color: var(--danger-color);
}

.logout-link:hover {
  background-color: rgba(231, 76, 60, 0.1);
}

/* 主内容区域 */
.main-content {
  padding-top: 80px; /* 为固定导航栏留出空间 */
  min-height: calc(100vh - 80px);
}

/* 闪现消息样式 */
.flash-messages {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 1001;
}

.flash-message {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  margin-bottom: 10px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  min-width: 300px;
  animation: slideIn 0.3s ease-out;
}

.flash-success {
  background: var(--success-color);
  color: white;
}

.flash-error {
  background: var(--danger-color);
  color: white;
}

.flash-warning {
  background: var(--warning-color);
  color: white;
}

.flash-close {
  background: none;
  border: none;
  color: currentColor;
  font-size: 18px;
  cursor: pointer;
  margin-left: 10px;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.flash-close:hover {
  opacity: 1;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* 按钮样式 */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-size: 14px;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: #2980b9;
}

.btn-success {
  background-color: var(--success-color);
  color: white;
}

.btn-success:hover {
  background-color: #27ae60;
}

.btn-danger {
  background-color: var(--danger-color);
  color: white;
}

.btn-danger:hover {
  background-color: #c0392b;
}

.btn-secondary {
  background-color: var(--gray-color);
  color: white;
}

.btn-secondary:hover {
  background-color: #7f8c8d;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

/* 表单样式 */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: var(--dark-color);
}

.form-input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-checkbox {
  margin-right: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .navbar-content {
    padding: 0 10px;
    height: auto;
    min-height: 60px;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
  }
  
  .navbar-left {
    width: 100%;
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .navbar-right {
    width: 100%;
    justify-content: space-between;
  }
  
  .navbar-editor-controls {
    width: 100%;
    margin-left: 0;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .navbar-title-input {
    min-width: 150px;
    flex: 1;
  }
  
  .nav-link {
    padding: 6px 12px;
    font-size: 14px;
  }
  
  .flash-message {
    min-width: 250px;
  }
  
  .main-content {
    padding-top: 120px; /* 为更高的移动端导航栏留出空间 */
  }
}

/* 确认对话框样式 */
.confirm-dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.confirm-dialog-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
}

.confirm-dialog-content {
  position: relative;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  max-width: 480px;
  width: 90%;
  margin: 20px;
  animation: confirmDialogSlideIn 0.3s ease-out;
}

@keyframes confirmDialogSlideIn {
  from {
      transform: translateY(-50px);
      opacity: 0;
  }
  to {
      transform: translateY(0);
      opacity: 1;
  }
}

.confirm-dialog-header {
  padding: 20px 24px 0;
  border-bottom: 1px solid #e5e7eb;
}

.confirm-dialog-header h3 {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
}

.confirm-dialog-body {
  padding: 20px 24px;
}

.confirm-dialog-body p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #4b5563;
}

.confirm-dialog-footer {
  padding: 0 24px 20px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.confirm-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 100px;
  justify-content: center;
}

.confirm-btn:hover {
  transform: translateY(-1px);
}

.confirm-btn-primary {
  background-color: #10b981;
  color: white;
}

.confirm-btn-primary:hover {
  background-color: #059669;
}

.confirm-btn-secondary {
  background-color: #f59e0b;
  color: white;
}

.confirm-btn-secondary:hover {
  background-color: #d97706;
}

.confirm-btn-cancel {
  background-color: #6b7280;
  color: white;
}

.confirm-btn-cancel:hover {
  background-color: #4b5563;
}

.confirm-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* 移动端适配 */
@media (max-width: 640px) {
  .confirm-dialog-content {
      margin: 10px;
      width: calc(100% - 20px);
  }
  
  .confirm-dialog-footer {
      flex-direction: column;
  }
  
  .confirm-btn {
      width: 100%;
      min-width: auto;
  }
}