.post-item {
  position: relative;
  transition: all 0.3s ease;
}

.post-item:hover {
  background-color: #f8f9ff;
  border-radius: 4px;
}

/* 移除CSS hover控制，改用JavaScript精确控制 */

.post-preview {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  margin-top: 5px;
  max-width: 600px;
}

.preview-content {
  padding: 20px;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  border-bottom: 1px solid #e1e5e9;
  padding-bottom: 10px;
}

.preview-title {
  margin: 0;
  font-size: 18px;
  color: #333;
  flex: 1;
}

.preview-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.preview-close:hover {
  background-color: #f0f0f0;
}

.preview-excerpt {
  color: #666;
  line-height: 1.6;
  margin-bottom: 15px;
}

.preview-footer {
  text-align: center;
}

.read-full-btn {
  display: inline-block;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.8) 0%, rgba(16, 185, 129, 0.8) 100%);
  color: white;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 20px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.read-full-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.section-title {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: rgba(59, 130, 246, 0.9);
  font-weight: 600;
  border-bottom: 1px solid #e1e5e9;
  padding-bottom: 5px;
}

.preview-contribution {
  color: #555;
  line-height: 1.6;
  font-size: 14px;
  max-height: 200px;
  overflow-y: auto;
}

.preview-loading {
  text-align: center;
  color: #666;
  font-style: italic;
}

.preview-error {
  text-align: center;
  color: #e53e3e;
}

.retry-btn {
  background: #e53e3e;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 10px;
}

.retry-btn:hover {
  background: #c53030;
}

/* Slides链接样式 */
.slides-link {
  display: block;
  padding: 8px 12px;
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
  color: white !important;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  transition: all 0.3s ease;
  margin: 8px 0;
  text-align: center;
}

.slides-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
  background: linear-gradient(135deg, #ff5252 0%, #d63031 100%);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .post-preview {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: none;
    max-height: 80vh;
    overflow-y: auto;
  }
  
  .preview-content {
    padding: 15px;
  }
  
  .preview-title {
    font-size: 16px;
  }
}

/* ===================== */
/* 分类页层次可视化样式  */
/* ===================== */

.collection-page .main-category-title {
  margin-top: 2rem;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: .25rem;
}

.collection-page .subcategory-title {
  margin-top: 1rem;
  color: #374151;
  padding-left: .25rem;
  border-left: 3px solid #e5e7eb;
}

.collection-page .sub-subcategory-title {
  margin-top: .75rem;
  color: #4b5563;
  padding-left: .5rem;
  border-left: 3px dashed #e5e7eb;
}

.collection-page .fourth-level-title {
  margin-top: .5rem;
  color: #6b7280;
  padding-left: .75rem;
  border-left: 2px dotted #e5e7eb;
}

.collection-page .category-section { margin-bottom: 1.5rem; }
.collection-page .sub-category { margin-left: 0; padding-left: 0; border-left: none; }
.collection-page .sub-sub-category { margin-left: 0; padding-left: 0; border-left: none; }
.collection-page .fourth-level-category { margin-left: 0; }

.post-list-with-tags { list-style: none; padding-left: 0; }
.post-list-with-tags .post-item { padding: 0; }

/* 侧边栏层次样式 */
.sidebar-nav .main-category { margin-top: 1rem; font-weight: 700; }
.sidebar-nav .sub-category-title { margin-top: .5rem; font-weight: 600; padding-left: .25rem; border-left: 3px solid #e5e7eb; }
.sidebar-nav .sub-sub-category-title { margin-top: .25rem; font-weight: 500; padding-left: .5rem; border-left: 3px dashed #e5e7eb; }
.sidebar-nav .fourth-level-category { margin-top: .125rem; padding-left: .75rem; }

/* ============ 卡片网格 ============ */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.post-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  flex-direction: column;
}
.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}
.post-card-link { text-decoration: none; color: inherit; display: block; }
.post-card-meta { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.post-card-title { font-weight: 600; line-height: 1.4; color: #1f2937; }

/* 卡片右上角Tag - 仅用于旧版样式 */
.post-card-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  padding: 4px 10px;
  font-size: 0.7em;
  font-weight: 600;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 确保现代化标签样式不被覆盖 */
.post-card-tag-modern {
  padding: 4px 12px !important;
  font-size: 0.75em !important;
  font-weight: 600 !important;
  border-radius: 12px !important;
  color: white !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  white-space: nowrap !important;
}

/* ARXIV标签 - 绿色渐变 */
.post-card-tag-modern.tag-arxiv {
  background: linear-gradient(135deg, #10b981, #059669) !important;
}

/* 其他标签 - 蓝青色渐变 */
.post-card-tag-modern:not(.tag-arxiv) {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.8), rgba(16, 185, 129, 0.8)) !important;
}

/* ============ 缩略图与摘要 ============ */
.post-card { overflow: hidden; }
.post-card-thumb { position: relative; width: 100%; height: 160px; border-radius: 8px; overflow: hidden; margin-bottom: 12px; background: #f8fafc; flex-shrink: 0; }
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card-thumb.placeholder { background: repeating-linear-gradient(45deg, #f1f5f9, #f1f5f9 10px, #e2e8f0 10px, #e2e8f0 20px); }
.post-card-body { display: flex; flex-direction: column; gap: 6px; }
.post-card-excerpt { color: #6b7280; font-size: 14px; line-height: 1.5; margin: 0; }

@media (max-width: 768px) {
  .post-card-thumb { height: 120px; }
}

/* ============ 折叠树 ============ */
/* 折叠树的样式已移至 main.scss 中，使用现代化的右上角按钮设计 */

/* 顶/次级标题的间距微调 */
.collection-page .main-category-title { margin: 8px 0; }
.collection-page .subcategory-title { margin: 6px 0; }
.collection-page .sub-subcategory-title,
.collection-page .fourth-level-title { margin: 4px 0; }

