/* 自定义样式 */

/* 全局样式 */
body {
  font-family: 'Arial', sans-serif;
  background-color: #f8f9fa;
  color: #333;
  transition: background-color 0.3s, color 0.3s;
}

/* 暗色模式 */
body.dark-mode {
  background-color: #1a1a1a;
  color: #e0e0e0;
}

body.dark-mode .card {
  background-color: #2d2d2d;
  border-color: #444;
}

body.dark-mode .navbar {
  background-color: #2d2d2d;
  border-color: #444;
}

body.dark-mode .sidebar {
  background-color: #2d2d2d;
  border-right: 1px solid #444;
}

/* 导航栏样式 */
.navbar {
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 侧边栏样式 */
.sidebar {
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  width: 250px;
  background-color: #fff;
  border-right: 1px solid #e0e0e0;
  overflow-y: auto;
  transition: all 0.3s;
  z-index: 1000;
}

.sidebar.collapsed {
  width: 70px;
}

.sidebar .nav-link {
  color: #333;
  padding: 10px 15px;
  transition: all 0.3s;
}

.sidebar .nav-link:hover {
  background-color: #f0f0f0;
  color: #007bff;
}

body.dark-mode .sidebar .nav-link {
  color: #e0e0e0;
}

body.dark-mode .sidebar .nav-link:hover {
  background-color: #3d3d3d;
  color: #64b5f6;
}

/* 主内容区域 */
.main-content {
  margin-left: 250px;
  padding: 20px;
  transition: all 0.3s;
  min-height: 100vh;
}

.main-content.expanded {
  margin-left: 70px;
}

/* 卡片样式 */
.card {
  border: none;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.3s;
  cursor: pointer;
  height: 100%;
}

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

.card-body {
  padding: 15px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.card-text {
  font-size: 14px;
  color: #666;
}

body.dark-mode .card-text {
  color: #b0b0b0;
}

/* 图标样式 */
.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  font-size: 24px;
}

/* 搜索框样式 */
.search-container {
  margin-bottom: 30px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 12px 40px 12px 15px;
  border: 1px solid #ddd;
  border-radius: 25px;
  font-size: 14px;
  transition: all 0.3s;
}

.search-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

body.dark-mode .search-input {
  background-color: #2d2d2d;
  border-color: #444;
  color: #e0e0e0;
}

body.dark-mode .search-input:focus {
  border-color: #64b5f6;
  box-shadow: 0 0 0 0.2rem rgba(100,181,246,0.25);
}

.search-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #666;
  font-size: 16px;
  cursor: pointer;
}

body.dark-mode .search-btn {
  color: #b0b0b0;
}

/* 分类标题样式 */
.category-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #007bff;
  display: flex;
  align-items: center;
}

.category-title i {
  margin-right: 10px;
  color: #007bff;
}

body.dark-mode .category-title {
  border-bottom-color: #64b5f6;
}

body.dark-mode .category-title i {
  color: #64b5f6;
}

/* 切换按钮样式 */
.theme-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #007bff;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  z-index: 999;
  transition: all 0.3s;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .mobile-menu-btn {
    display: block !important;
  }
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: fadeIn 0.5s ease-out;
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0,123,255,0.3);
  border-radius: 50%;
  border-top-color: #007bff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

body.dark-mode ::-webkit-scrollbar-track {
  background: #2d2d2d;
}

body.dark-mode ::-webkit-scrollbar-thumb {
  background: #555;
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
  background: #777;
}
