* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #f5f7fa;
  color: #333;
}

.app-container {
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  height: 100vh;
  background-color: #2c3e50;
  color: white;
  position: fixed;
  left: 0;
  top: 0;
  transition: all 0.3s ease;
}

.sidebar-header {
  padding: 20px;
  background-color: #34495e;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.sidebar-header:hover {
  background-color: #3498db;
}

/* 侧边栏菜单收起状态 */
.sidebar-menu.collapsed {
  display: none;
}

.sidebar-menu {
  list-style: none;
  padding: 20px 0;
}

.sidebar-menu li {
  padding: 10px 20px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.sidebar-menu li:hover {
  background-color: #34495e;
}

.sidebar-menu li.active {
  background-color: #3498db;
}

.main-content {
  margin-left: 250px;
  padding: 20px;
  min-height: 100vh;
  transition: all 0.3s ease;
}

.content-header {
  margin-bottom: 30px;
}

.content-header h1 {
  font-size: 24px;
  font-weight: bold;
}

.card {
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.card-header {
  background-color: #ffffff;
  border-bottom: 1px solid #e9ecef;
  padding: 15px;
  border-radius: 8px 8px 0 0;
  font-weight: bold;
}

.card-body {
  padding: 20px;
  background-color: #ffffff;
  border-radius: 0 0 8px 8px;
}

.form-group {
  margin-bottom: 15px;
}

.form-control {
  border-radius: 4px;
  border: 1px solid #ced4da;
  padding: 10px;
  width: 100%;
}

.btn {
  border-radius: 4px;
  padding: 10px 20px;
  cursor: pointer;
  border: none;
  font-size: 14px;
  transition: all 0.3s ease;
}

.btn-primary {
  background-color: #3498db;
  color: white;
}

.btn-primary:hover {
  background-color: #2980b9;
}

.btn-success {
  background-color: #27ae60;
  color: white;
}

.btn-success:hover {
  background-color: #219a52;
}

.btn-danger {
  background-color: #e74c3c;
  color: white;
}

.btn-danger:hover {
  background-color: #c0392b;
}

.btn-secondary {
  background-color: #95a5a6;
  color: white;
}

.btn-secondary:hover {
  background-color: #7f8c8d;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.table th,
.table td {
  padding: 12px;
  text-align: center;
  border: 1px solid #000;
  white-space: nowrap;
}

.table th {
  background-color: #f8f9fa;
  font-weight: bold;
}

.table-hover tbody tr:hover {
  background-color: #f8f9fa;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background-color: white;
  border-radius: 8px;
  padding: 20px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h2 {
  font-size: 20px;
  font-weight: bold;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
  gap: 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }
  
  .main-content {
    margin-left: 0;
    padding: 10px;
  }
  
  .content-header h1 {
    font-size: 20px;
  }
  
  .card-body {
    padding: 15px;
  }
  
  .table th,
  .table td {
    padding: 8px;
    font-size: 14px;
  }
}

/* 动画效果 */
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.5s ease;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

/* 加载状态 */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 消息提示 */
.message {
  padding: 10px 15px;
  border-radius: 4px;
  margin-bottom: 15px;
  font-size: 14px;
}

.message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.message.info {
  background-color: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* 登录页面样式 */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-image: url('bg-s.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.login-box {
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  padding: 40px;
  width: 90%;
  max-width: 400px;
  backdrop-filter: blur(5px);
}

.login-box h2 {
  margin-bottom: 30px;
  text-align: center;
  color: #2c3e50;
}

.captcha-image {
  background-color: #f8f9fa;
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 10px;
  min-width: 100px;
  text-align: center;
  font-weight: bold;
  font-size: 18px;
  letter-spacing: 2px;
  color: #3498db;
  user-select: none;
}

.captcha-image:hover {
  background-color: #e9ecef;
}

/* 用户信息样式 */
.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.role-badge {
  background-color: #3498db;
  color: white;
  padding: 5px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
}

/* 退出登录按钮样式 */
.logout-item {
  margin-top: 20px;
  border-top: 1px solid #34495e;
  padding-top: 10px;
  color: #e74c3c;
}

.logout-item:hover {
  background-color: rgba(231, 76, 60, 0.1);
}

/* 仪表盘豆腐块样式 */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.dashboard-card {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: all 0.3s ease;
}

.dashboard-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.dashboard-card-header {
  background-color: #3498db;
  color: white;
  padding: 15px;
  font-weight: bold;
  font-size: 14px;
}

.dashboard-card-body {
  padding: 20px;
}

.dashboard-card-value {
  font-size: 32px;
  font-weight: bold;
  color: #2c3e50;
  margin-bottom: 10px;
}

.dashboard-card-desc {
  font-size: 14px;
  color: #7f8c8d;
}

/* 工具类 */
.d-flex {
  display: flex;
}

.justify-content-between {
  justify-content: space-between;
}

.align-items-center {
  align-items: center;
}

.gap-2 {
  gap: 10px;
}

.flex-nowrap {
  flex-wrap: nowrap;
}

.mb-3 {
  margin-bottom: 15px;
}

.mb-4 {
  margin-bottom: 20px;
}

.w-100 {
  width: 100%;
}

.ms-2 {
  margin-left: 10px;
}

.table-responsive {
  overflow-x: auto;
}