/* 动画定义 */
@keyframes float {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-20px);
  }

  100% {
    transform: translateY(0px);
  }
}

/* 随机漂浮动画（用于聚类文字） */
@keyframes float-random {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }

  25% {
    transform: translate(10px, -15px) rotate(5deg);
  }

  50% {
    transform: translate(5px, -20px) rotate(0deg);
  }

  75% {
    transform: translate(-10px, -10px) rotate(-5deg);
  }

  100% {
    transform: translate(0, 0) rotate(0deg);
  }
}

/* 淡入淡出过渡 */
.fade-transition {
  transition: opacity 1s ease-in-out;
}

/* 列表视图样式（资源专用） */
.list-view {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* 方格视图样式（文献专用） */
.grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.9rem;
}

/* 错落视图样式（项目和游戏专用） */
.masonry-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  grid-auto-flow: dense;
}

/* 错落视图中的大项 */
.masonry-item-large {
  grid-column: span 2;
  grid-row: span 2;
}

/* 内容项基础样式 */
.content-item {
  padding: 0.8rem;
  border-radius: 0.75rem;
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  background: rgba(255, 255, 255, 0.05);
}

/* 列表项样式 */
.list-view .content-item {
  justify-content: space-between;
  align-items: center;
}

/* 方格项样式 */
.grid-view .content-item,
.masonry-view .content-item {
  flex-direction: column;
  align-items: flex-start;
}

/* 进度条样式（项目专用） */
.progress-container {
  width: 100%;
  height: 6px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin: 0.5rem 0;
}

.progress-bar {
  height: 100%;
  border-radius: 3px;
}

/* 电脑端四宫格按钮样式 */
.desktop-grid-button {
  border-radius: 1rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  cursor: pointer;
  color: white;
}

/* 手机端样式调整 */
@media (max-width: 768px) {
  .content-item {
    padding: 0.7rem;
  }

  .masonry-item-large {
    grid-column: span 1;
    grid-row: span 1;
  }

  .grid-view,
  .masonry-view {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  h3.text-xl {
    font-size: 1.2rem;
  }

  .float-random {
    animation: float 6s ease-in-out infinite;
  }
}

/* 左侧导航栏样式 */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 280px;
  z-index: 50;
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
  overflow-y: auto;
}

#sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
  font-size: 1.2rem;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.close-btn:hover {
  opacity: 1;
}

.sidebar-menu {
  padding: 1rem 0;
}

.sidebar-menu li {
  list-style: none;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  color: #ffffff;
  text-decoration: none;
  transition: background-color 0.2s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
  background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-menu i {
  width: 24px;
  margin-right: 12px;
  text-align: center;
}

.user-profile {
  padding: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 1rem;
}

.profile-info {
  display: flex;
  align-items: center;
}

.profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 12px;
  object-fit: cover;
}

.profile-name {
  font-weight: 500;
}

.profile-role {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

/* 头部样式 */
header {
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(26, 26, 46, 0.1);
  backdrop-filter: blur(10px);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: #4cc9f0;
  display: flex;
  align-items: center;
}

.logo i {
  margin-right: 10px;
}

/* 自定义滚动条 */
#left-scroll-container::-webkit-scrollbar {
  width: 6px; /* 滚动条宽度 */
}
#left-scroll-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2); /* 滚动条颜色 */
  border-radius: 3px;
}
#left-scroll-container::-webkit-scrollbar-track {
  background: transparent; /* 滚动条背景透明 */
}