/* 全局变量 */
:root {
  --primary-color: #2563eb;
  --secondary-color: #3b82f6;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --bg-light: #f9fafb;
  --bg-white: #ffffff;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --transition-base: all 0.3s ease;
}

/* 全局样式 */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-light);
  line-height: 1.6;
  opacity: 1;
  transition: opacity 0.3s ease;
}

body.loading {
  opacity: 0.6;
}

/* 导航栏样式 */
.navbar {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
  box-shadow: var(--shadow-md);
  padding: 1rem 0;
}

.navbar-brand {
  font-weight: 600;
  font-size: 1.25rem;
  transition: var(--transition-base);
}

.navbar-brand:hover {
  transform: translateY(-1px);
}

.nav-link {
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  border-radius: 0.375rem;
  transition: var(--transition-base);
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

/* 卡片样式 */
.card {
  border: none;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-base);
  overflow: hidden;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-header {
  background-color: var(--bg-white);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 1.25rem;
}

.card-body {
  padding: 1.5rem;
}

/* 按钮样式 */
.btn {
  padding: 0.5rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: var(--transition-base);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border: none;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* 表单样式 */
.form-control {
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid #e5e7eb;
  transition: var(--transition-base);
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* 列表样式 */
.list-group-item {
  border: none;
  padding: 1rem 1.25rem;
  margin-bottom: 0.5rem;
  border-radius: 0.5rem;
  background-color: var(--bg-white);
  transition: var(--transition-base);
}

.list-group-item:hover {
  transform: translateX(4px);
  background-color: var(--bg-light);
}

/* 动画效果 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
  opacity: 1 !important;
}

/* 响应式优化 */
@media (max-width: 768px) {
  .navbar {
    padding: 0.5rem 0;
  }
  
  .card {
    margin-bottom: 1rem;
  }
  
  .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }
}

/* 用户头像样式 */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bg-white);
  box-shadow: var(--shadow-sm);
}

/* 下拉菜单样式 */
.dropdown-menu {
  border: none;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
}

.dropdown-item {
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  transition: var(--transition-base);
}

.dropdown-item:hover {
  background-color: var(--bg-light);
  transform: translateX(4px);
}

/* 页脚样式 */
.footer {
  background-color: var(--bg-white) !important;
  box-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0.05);
  padding: 1.5rem 0;
}

/* 加载动画 */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--bg-light);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 管理页面样式 */
.admin-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  padding: 20px 0;
  margin-bottom: 30px;
}

.admin-title {
  margin: 0;
  font-size: 24px;
  color: #343a40;
}

/* 表格样式 */
.table th {
  background-color: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
}

/* 提示信息样式 */
.alert {
  border-radius: 4px;
  margin-bottom: 20px;
}

/* 模态框样式 */
.modal-content {
  border-radius: 8px;
  border: none;
}

.modal-header {
  border-bottom: 1px solid #e9ecef;
  background-color: #f8f9fa;
  border-radius: 8px 8px 0 0;
}

.modal-footer {
  border-top: 1px solid #e9ecef;
  background-color: #f8f9fa;
  border-radius: 0 0 8px 8px;
}

/* 修复模态框位置 */
.modal-fix {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  z-index: 1050;
  display: none;
}

.modal-fix.show {
  display: block;
}

.modal-fix .modal-dialog {
  position: relative;
  width: auto;
  margin: 1.75rem auto;
  pointer-events: none;
  max-width: 500px;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .container {
    padding-left: 15px;
    padding-right: 15px;
    width: 100%;
    max-width: 100%;
  }
  
  .card-body {
    padding: 15px;
  }
} 