/* 布局容器 */
.post-list-page {
  display: flex;
  max-width: var(--max-width);
  margin: 4.5rem auto 2rem;
  padding: 4rem 0;
  justify-content: space-between;
  min-height: 100vh;
  gap: 2rem;
}

/* 左侧栏 */
.plp-sidebar {
  width: 250px;
  flex-shrink: 0;
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  height: fit-content;
  position: sticky;
  top: 20px;
}

.plp-sidebar-title {
  margin-top: 0;
  color: #333;
  font-size: 18px;
  border-bottom: 2px solid #007cba;
  padding-bottom: 10px;
}

.plp-cat-list {
  list-style: none;
  padding: 0;
  margin: 15px 0;
}

.plp-cat-list li {
  margin-bottom: 0.5rem;
}

.plp-cat-list li.active a {
  background: #007cba;
  color: white;
}

.plp-cat-list a {
  display: block;
  padding: 10px 15px;
  text-decoration: none;
  color: #333;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.plp-cat-list a:hover {
  background: #007cba;
  color: white;
}

/* 右侧文章头 */
.plp-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px;
  border-radius: 8px;
  margin-bottom: 30px;
  text-align: center;
}

.plp-header h1 {
  margin: 0;
  font-size: 28px;
}

.plp-header p {
  margin: 10px 0 0 0;
  opacity: 0.9;
}

/* 右侧文章区 */
.plp-content {
  flex: 1;
  max-width: 900px;
}

.plp-posts {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  gap: 3rem;
}

.plp-post-item {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  width: 100%;
  transition: transform 0.3s ease;
}

.plp-post-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.plp-post-item .post-link {
  display: flex;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
  width: 100%;
}

.plp-post-item .post-link:hover {
  background-color: #f5f5f5;
}

/* 图片容器 */
.plp-post-item .post-thumb {
  flex-shrink: 0;
  width: 160px;
  height: 160px;
  overflow: hidden;
}

/* 图片本身 */
.plp-post-item .post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 文字信息容器 */
.plp-post-item .post-info {
  flex: 1;
  min-width: 0;
  padding: 1.25rem;
}

/* 标题 */
.plp-post-item .post-title {
  font-size: 1.5rem;
  margin: 0 0 1rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 摘要 */
.plp-post-item .post-excerpt {
  color: #666;
  line-height: 1.5;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 分页 */
.page-numbers {
  display: flex;
  list-style: none;
  padding: 0;
  gap: 0.5rem;
  margin: 2rem 0;
  justify-content: center;
}

.page-numbers a,
.page-numbers span {
  display: block;
  padding: 0.5rem 0.75rem;
  background: #f1f1f1;
  border-radius: 4px;
  text-decoration: none;
  color: #333;
  transition: all 0.3s ease;
}

.page-numbers a:hover {
  background: var(--blue);
  color: white;
}

.page-numbers .current {
  background: var(--blue);
  color: #fff;
}

/* 移动端分类切换按钮 */
.mobile-category-toggle {
  display: none;
  width: 100%;
  padding: 1rem;
  background: #007cba;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.mobile-category-toggle:hover {
  background: #005a8b;
}

.mobile-category-toggle:after {
  content: ' ▼';
  float: right;
  transition: transform 0.3s ease;
}

.mobile-category-toggle.active:after {
  transform: rotate(180deg);
}

/* ================ 桌面端样式 (1200px以上) ================ */
@media (min-width: 1200px) {
  .post-list-page {
    margin: 60px auto 2rem;
    padding: 2rem;
  }

  .plp-sidebar {
    top: 80px;
  }
}

/* ================ 移动端样式 (1200px以下) ================ */
@media (max-width: 1199px) {
  .post-list-page {
    flex-direction: column;
    margin: 60px auto 2rem;
    padding: 1rem 16px;
    gap: 0.75rem;
  }

  /* 显示移动端分类切换按钮 */
  .mobile-category-toggle {
    display: block;
    order: 1;
  }

  /* 默认隐藏侧边栏，点击按钮后显示 */
  .plp-sidebar {
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    order: 2;
    position: static;
    margin-bottom: 0;
    padding: 0;
    background: transparent;
  }

  .plp-sidebar.active {
    padding: 20px;
    background: #f8f9fa;
    margin-bottom: 1.5rem;
  }

  .plp-content {
    order: 3;
    max-width: 100%;
  }

  .plp-header {
    padding: 20px;
    margin-bottom: 20px;
  }

  .plp-header h1 {
    font-size: 20px;
  }

  /* 移动端文章卡片调整 */
  .plp-post-item .post-link {
    flex-direction: column;
  }

  .plp-post-item .post-thumb {
    width: 100%;
    height: 200px;
  }

  .plp-post-item .post-info {
    padding: 1rem;
  }

  .plp-post-item .post-title {
    font-size: 1.25rem;
    white-space: normal;
    line-height: 1.4;
  }

  .plp-posts {
    gap: 1.5rem;
  }

  /* 移动端分页优化 */
  .page-numbers {
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 1.5rem 0;
  }

  .page-numbers a,
  .page-numbers span {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
  }
}