/* =================================
   文章列表页面样式 - ask.css
================================= */

/* =================================
   页面头部区域
================================= */
.page-header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f1419 100%);
  padding: 120px 0 80px;
  color: white;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}

.page-header-content {
  position: relative;
  z-index: 2;
  text-align: center;
}

.page-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: bold;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #ffffff, var(--primary-color));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-description {
  font-size: 1.2rem;
  margin-bottom: 30px;
  opacity: 0.9;
}

.breadcrumb {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.breadcrumb a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: var(--transition);
}

.breadcrumb a:hover {
  color: var(--primary-color);
}

.breadcrumb .separator {
  color: rgba(255, 255, 255, 0.5);
}

.breadcrumb .current {
  color: var(--primary-color);
  font-weight: 500;
}

/* =================================
   搜索和筛选区域
================================= */
.search-filter-section {
  background: #f8f9fa;
  padding: 40px 0;
  border-bottom: 1px solid #e9ecef;
}

.search-box {
  margin-bottom: 20px;
}

.search-box .layui-input-group {
  box-shadow: var(--box-shadow);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.search-box .layui-input {
  border: none;
  padding: 15px 20px;
  font-size: 1rem;
  background: white;
}

.search-box .layui-input:focus {
  box-shadow: 0 0 0 3px rgba(231, 181, 40, 0.1);
}

.search-btn {
  padding: 0px 25px !important;
  background: var(--primary-color) !important;
  color: #000 !important;
  border: none !important;
  font-weight: 600;
}

.search-btn:hover {
  background: var(--primary-hover) !important;
}

.filter-box {
  margin-bottom: 20px;
}

.filter-box .layui-input {
  padding: 6px 20px;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  background: white;
  box-shadow: var(--box-shadow);
}

/* =================================
   分类导航区域
================================= */
.category-nav-section {
  background: white;
  padding: 30px 0;
  border-bottom: 1px solid #e9ecef;
}

.category-nav {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: #f8f9fa;
  border-radius: 25px;
  color: var(--text-gray);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
  cursor: pointer;
  border: 2px solid transparent;
}

.category-item:hover {
  background: rgba(231, 181, 40, 0.1);
  color: var(--primary-color);
  border-color: rgba(231, 181, 40, 0.3);
}

.category-item.active {
  background: var(--primary-color);
  color: #000;
  font-weight: 600;
}

.category-item i {
  font-size: 1.1rem;
}

/* =================================
   文章列表区域
================================= */
.articles-section {
  background: white;
  padding: 50px 0;
}

.articles-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 2px solid #f8f9fa;
}

.articles-count {
  font-size: 1.1rem;
  color: var(--text-gray);
}

.articles-count span {
  color: var(--primary-color);
  font-weight: 600;
}

.sort-options .layui-input {
  width: 150px;
  padding: 8px 15px;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
}

/* =================================
   文章卡片样式（新的3列布局）
================================= */
.article-card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid #f0f0f0;
  height: 480px;
  /* 固定高度 */
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  border-color: rgba(231, 181, 40, 0.3);
}

.post-img {
  position: relative;
  overflow: hidden;
  height: 220px;
}

.post-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

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

.post-date {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

.post-content {
  padding: 25px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-title {
  margin: 0 0 15px 0;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.4;
  color: #333;
  /* 标题最多显示2行 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: calc(1.4em * 2);
}

.post-title a {
  color: #333;
  text-decoration: none;
  transition: var(--transition);
}

.post-title a:hover {
  color: var(--primary-color);
}

.meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  font-size: 0.9rem;
  color: var(--text-gray);
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.meta .separator {
  color: #ddd;
  font-weight: 300;
}

.post-summary {
  color: var(--text-gray);
  line-height: 1.6;
  margin-bottom: 20px;
  font-size: 0.9rem;
  flex: 1;
  /* 3行省略样式 */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  /* 兼容方案 */
  max-height: calc(1.6em * 3);
  /* line-height * 行数 */
}

.post-content hr {
  border: none;
  height: 1px;
  background: #e9ecef;
  margin: 15px 0;
  margin-top: auto;
  /* 将分割线推到底部区域 */
}

.readmore {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition);
}

.readmore:hover {
  color: var(--primary-hover);
  transform: translateX(5px);
}

.readmore i {
  transition: var(--transition);
}

.readmore:hover i {
  transform: translateX(3px);
}

/* =================================
   兼容旧样式（保持向后兼容）
================================= */
.articles-list {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.article-item {
  display: flex;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid #f0f0f0;
}

.article-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  border-color: rgba(231, 181, 40, 0.3);
}

.article-content {
  flex: 1;
  padding: 30px;
}

.article-header {
  margin-bottom: 15px;
}

.article-title {
  margin-bottom: 15px;
}

.article-title a {
  color: #333;
  text-decoration: none;
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.4;
  transition: var(--transition);
}

.article-title a:hover {
  color: var(--primary-color);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 0.9rem;
  color: var(--text-gray);
  flex-wrap: wrap;
}

.article-meta .category {
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 500;
  color: white;
}

.category.install {
  background: #28a745;
}

.category.firmware {
  background: #007bff;
}

.category.hardware {
  background: #6f42c1;
}

.category.network {
  background: #17a2b8;
}

.category.troubleshooting {
  background: #dc3545;
}

.category.other {
  background: #6c757d;
}

.article-meta i {
  margin-right: 4px;
}

.article-summary {
  color: var(--text-gray);
  line-height: 1.6;
  margin-bottom: 20px;
  font-size: 0.95rem;
  /* 3行省略样式 */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  /* 兼容方案 */
  max-height: calc(1.6em * 3);
  /* line-height * 行数 */
}

.article-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  padding: 4px 10px;
  background: #f8f9fa;
  color: var(--text-gray);
  border-radius: 12px;
  font-size: 0.8rem;
  border: 1px solid #e9ecef;
  transition: var(--transition);
}

.tag:hover {
  background: rgba(231, 181, 40, 0.1);
  color: var(--primary-color);
  border-color: rgba(231, 181, 40, 0.3);
}

.article-image {
  width: 200px;
  flex-shrink: 0;
}

.article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =================================
   分页导航
================================= */
.pagination-wrapper {
  margin-top: 50px;
  text-align: center;
}

.layui-laypage {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.layui-laypage a,
.layui-laypage span {
  padding: 8px 12px;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.layui-laypage a:hover {
  background: var(--primary-color);
  color: #000;
}

.layui-laypage-curr em {
  background: var(--primary-color);
  color: #000;
}

/* =================================
   热门文章推荐
================================= */
.popular-articles-section {
  background: #f8f9fa;
  padding: 60px 0;
}

.popular-article-card {
  background: white;
  padding: 25px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  position: relative;
  height: 100%;
}

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

.article-rank {
  position: absolute;
  top: -10px;
  left: -10px;
  width: 30px;
  height: 30px;
  background: var(--primary-color);
  color: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9rem;
}

.popular-article-card h3 {
  margin: 0 0 10px 0;
  font-size: 1rem;
  line-height: 1.4;
}

.popular-article-card h3 a {
  color: #333;
  text-decoration: none;
  transition: var(--transition);
}

.popular-article-card h3 a:hover {
  color: var(--primary-color);
}

.article-excerpt {
  color: var(--text-gray);
  font-size: 0.9rem;
  margin-bottom: 15px;
  line-height: 1.5;
}

.view-count {
  color: var(--text-gray);
  font-size: 0.8rem;
}

/* =================================
   无搜索结果状态
================================= */
.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-gray);
}

.no-results i {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.5;
}

.no-results h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: #333;
}

.no-results p {
  margin-bottom: 30px;
}

.no-results .layui-btn {
  background: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  color: #000 !important;
}

/* =================================
   加载动画
================================= */
.loading-placeholder {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.article-skeleton {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 30px;
  animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-line {
  height: 20px;
  background: #f0f0f0;
  border-radius: 4px;
  margin-bottom: 15px;
}

.skeleton-line.title {
  height: 24px;
  width: 70%;
}

.skeleton-line.short {
  width: 40%;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* =================================
   响应式设计
================================= */
@media (max-width: 768px) {
  .page-header {
    padding: 100px 0 60px;
  }

  .page-title {
    font-size: 2rem;
  }

  .category-nav {
    gap: 15px;
  }

  .category-item {
    padding: 10px 15px;
    font-size: 0.9rem;
  }

  .articles-header {
    flex-direction: column;
    gap: 20px;
    align-items: stretch;
    text-align: center;
  }

  /* 移动端文章卡片样式调整 */
  .article-card {
    height: 420px;
    /* 平板端稍微减小高度 */
  }

  .post-img {
    height: 160px;
    /* 减小图片高度为内容留出更多空间 */
  }

  .post-content {
    padding: 20px;
  }

  .post-title {
    font-size: 1.1rem;
  }

  .meta {
    gap: 8px;
    font-size: 0.8rem;
  }

  .post-summary {
    font-size: 0.85rem;
  }

  /* 兼容旧布局 */
  .article-item {
    flex-direction: column;
  }

  .article-image {
    width: 100%;
    height: 200px;
  }

  .article-content {
    padding: 20px;
  }

  .article-meta {
    gap: 10px;
  }

  .popular-article-card {
    padding: 20px;
  }
}

@media (max-width: 576px) {
  .search-filter-section {
    padding: 30px 0;
  }

  .breadcrumb {
    flex-wrap: wrap;
    font-size: 0.8rem;
  }

  .category-nav {
    gap: 10px;
  }

  .category-item {
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  /* 移动端卡片进一步调整 */
  .article-card {
    height: 380px;
    /* 移动端进一步减小高度 */
  }

  .post-img {
    height: 140px;
    /* 进一步减小图片高度 */
  }

  .post-content {
    padding: 15px;
  }

  .post-title {
    font-size: 1rem;
    margin-bottom: 10px;
  }

  .meta {
    gap: 6px;
    font-size: 0.75rem;
    margin-bottom: 10px;
  }

  .post-summary {
    font-size: 0.8rem;
    margin-bottom: 15px;
  }

  .readmore {
    font-size: 0.8rem;
  }

  /* 兼容旧布局 */
  .article-title a {
    font-size: 1.1rem;
  }

  .article-summary {
    font-size: 0.9rem;
  }

  .article-tags {
    gap: 5px;
  }

  .tag {
    padding: 3px 8px;
    font-size: 0.75rem;
  }
}