/* 咨询动态页面专用样式 */

/* 确保容器正确显示 */
.consultation-main .container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

/* 头部区域 */
.consultation-hero {
  background: linear-gradient(135deg, #1c41ac 0%, #0f2d7a 100%);
  color: #fff;
  padding: 80px 0 60px;
  position: relative;
  overflow: hidden;
}

.consultation-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
      800px 400px at 20% 30%,
      rgba(255, 255, 255, 0.1),
      transparent 60%
    ),
    radial-gradient(
      600px 300px at 80% 70%,
      rgba(127, 160, 255, 0.08),
      transparent 50%
    );
  pointer-events: none;
}

.consultation-hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.consultation-title {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.consultation-subtitle {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
}

/* 主体内容区 */
.consultation-main {
  padding: 60px 0 80px;
  background: #fafbff;
  min-height: 600px;
  position: relative;
}

.consultation-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
}

/* 左侧边栏 */
.consultation-sidebar {
  position: sticky;
  top: 100px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  width: 280px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  align-self: start;
  z-index: 10;
  /* 优化滚动条样式 */
  scrollbar-width: thin;
  scrollbar-color: rgba(28, 65, 172, 0.3) transparent;
}

.consultation-sidebar::-webkit-scrollbar {
  width: 6px;
}

.consultation-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.consultation-sidebar::-webkit-scrollbar-thumb {
  background: rgba(28, 65, 172, 0.3);
  border-radius: 3px;
}

.consultation-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(28, 65, 172, 0.5);
}

.sidebar-header {
  padding: 24px 20px;
  background: linear-gradient(135deg, #f6f8ff 0%, #eef2ff 100%);
  border-bottom: 1px solid rgba(28, 65, 172, 0.1);
}

.sidebar-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #1c41ac;
  margin: 0;
  text-align: center;
  display: block;
}

.category-nav {
  padding: 12px 0;
  display: block !important;
  width: 100%;
  visibility: visible !important;
}

.category-item {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  color: #333;
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.category-item:hover {
  background: #f6f8ff;
  color: #1c41ac;
  border-left-color: #1c41ac;
}

.category-item.active {
  background: linear-gradient(90deg, #eef2ff 0%, #f6f8ff 100%);
  color: #1c41ac;
  font-weight: 600;
  border-left-color: #1c41ac;
}

.category-item.active::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: #1c41ac;
  border-radius: 50%;
}

.category-icon {
  width: 20px;
  height: 20px;
  margin-right: 12px;
  flex-shrink: 0;
}

/* 右侧内容区 */
.consultation-content {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  padding: 40px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.content-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 2px solid #eef2ff;
}

.current-category-title {
  font-size: 32px;
  font-weight: 700;
  color: #1c1e27;
  margin: 0 0 12px 0;
}

.current-category-desc {
  font-size: 16px;
  color: #6b7280;
  margin: 0;
  line-height: 1.6;
}

/* 文章列表 */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.post-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  background: #fff;
}

.post-card:hover {
  box-shadow: 0 8px 24px rgba(28, 65, 172, 0.12);
  transform: translateY(-2px);
  border-color: rgba(28, 65, 172, 0.2);
}

.post-card-inner {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  padding: 20px;
}

.post-cover {
  width: 240px;
  height: 160px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.post-cover a {
  display: block;
  width: 100%;
  height: 100%;
}

.post-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.post-card:hover .post-cover img {
  transform: scale(1.05);
}

.post-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 160px;
}

.post-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 12px 0;
}

.post-title a {
  color: #1c1e27;
  text-decoration: none;
  transition: color 0.2s ease;
}

.post-title a:hover {
  color: #1c41ac;
}

.post-excerpt {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.6;
  margin: 0 0 16px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid #f3f4f6;
}

.post-date {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: #9ca3af;
}

.meta-icon {
  width: 16px;
  height: 16px;
  margin-right: 6px;
}

.post-read-more {
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  color: #1c41ac;
  text-decoration: none;
  transition: all 0.2s ease;
}

.post-read-more:hover {
  color: #0f2d7a;
  gap: 6px;
}

.arrow-icon {
  width: 16px;
  height: 16px;
  margin-left: 4px;
  transition: transform 0.2s ease;
}

.post-read-more:hover .arrow-icon {
  transform: translateX(4px);
}

/* 无封面图的文章卡片样式 */
.post-card-inner:not(:has(.post-cover)) {
  grid-template-columns: 1fr;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 80px 20px;
}

.empty-icon {
  margin-bottom: 24px;
  color: #d1d5db;
}

.empty-state h3 {
  font-size: 24px;
  font-weight: 600;
  color: #4b5563;
  margin: 0 0 12px 0;
}

.empty-state p {
  font-size: 16px;
  color: #9ca3af;
  margin: 0;
}

/* 分页 */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid #e5e7eb;
}

.pagination-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: #374151;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.pagination-btn:hover {
  background: #1c41ac;
  border-color: #1c41ac;
  color: #fff;
}

.pagination-btn svg {
  width: 16px;
  height: 16px;
}

.pagination-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #6b7280;
}

.pagination-info strong {
  color: #1c41ac;
  font-weight: 700;
}

.separator {
  color: #d1d5db;
}

/* 移动端分类切换按钮 */
.mobile-category-toggle {
  display: none;
  width: 100%;
  padding: 16px 20px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  color: #1c41ac;
  text-align: left;
  cursor: pointer;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
  position: relative;
}

.mobile-category-toggle:hover {
  background: #f6f8ff;
  border-color: #1c41ac;
}

.mobile-category-toggle::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #1c41ac;
  transition: transform 0.3s ease;
}

.mobile-category-toggle.active::after {
  transform: translateY(-50%) rotate(180deg);
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .consultation-layout {
    grid-template-columns: 240px 1fr;
    gap: 30px;
  }

  .consultation-sidebar {
    width: 240px;
    top: 100px;
    max-height: calc(100vh - 120px);
  }

  .consultation-content {
    padding: 32px 24px;
  }

  .post-card-inner {
    grid-template-columns: 200px 1fr;
    gap: 20px;
  }

  .post-cover {
    width: 200px;
    height: 140px;
  }
}

@media (max-width: 768px) {
  .consultation-title {
    font-size: 36px;
  }

  .consultation-subtitle {
    font-size: 16px;
  }

  .consultation-main {
    padding: 40px 0 60px;
  }

  .consultation-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  /* 移动端显示切换按钮 */
  .mobile-category-toggle {
    display: block;
  }

  /* 移动端侧边栏样式 */
  .consultation-sidebar {
    position: static;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    margin-bottom: 24px;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    box-shadow: none;
  }

  .consultation-sidebar.mobile-open {
    max-height: 600px;
    opacity: 1;
    overflow-y: auto;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  }

  .consultation-content {
    padding: 24px 20px;
  }

  .current-category-title {
    font-size: 28px;
  }

  .post-card-inner {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .post-cover {
    width: 100%;
    height: 200px;
  }

  .post-info {
    min-height: auto;
  }

  .pagination {
    flex-wrap: wrap;
    gap: 12px;
  }

  .pagination-btn {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }

  .pagination-info {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .consultation-hero {
    padding: 60px 0 40px;
  }

  .consultation-title {
    font-size: 28px;
  }

  .consultation-subtitle {
    font-size: 14px;
  }

  .consultation-main {
    padding: 30px 0 50px;
  }

  .consultation-main .container {
    padding: 0 16px;
  }

  .consultation-content {
    padding: 20px 16px;
    border-radius: 8px;
  }

  .current-category-title {
    font-size: 24px;
  }

  .current-category-desc {
    font-size: 14px;
  }

  .post-title {
    font-size: 18px;
  }

  .post-excerpt {
    font-size: 13px;
    -webkit-line-clamp: 3;
  }

  .post-cover {
    height: 180px;
  }

  .category-item {
    padding: 12px 16px;
    font-size: 15px;
  }

  .category-icon {
    width: 18px;
    height: 18px;
    margin-right: 10px;
  }

  .sidebar-header {
    padding: 20px 16px;
  }

  .sidebar-header h3 {
    font-size: 16px;
  }

  .mobile-category-toggle {
    padding: 14px 18px;
    font-size: 15px;
    border-radius: 8px;
  }

  .pagination-btn {
    padding: 10px 16px;
    font-size: 13px;
  }

  .content-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
  }
}
