/**
 * 标签页面样式
 *
 * @format
 */

.tag-page {
  max-width: 1200px;
  margin: 100px auto;
  padding: 20px;
  min-height: 80vh;
}

/* 头部区域 */
.tag-header {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  padding: 40px 30px;
  border-radius: 12px;
  margin-bottom: 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.tag-header::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200px;
  height: 200px;
  background: rgba(0, 102, 204, 0.1);
  border-radius: 50%;
}

.tag-header::after {
  content: "";
  position: absolute;
  bottom: -30%;
  left: -20%;
  width: 150px;
  height: 150px;
  background: rgba(0, 102, 204, 0.05);
  border-radius: 50%;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #0066cc;
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 15px;
  background: white;
  padding: 8px 16px;
  border-radius: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.back-link:hover {
  background: #0066cc;
  color: white !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 102, 204, 0.2);
}

.tag-title {
  font-size: 2.8rem;
  color: #2c3e50;
  margin: 15px 0;
  position: relative;
  z-index: 1;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}

.tag-count {
  font-size: 1.1rem;
  color: #666;
  background: white;
  padding: 6px 15px;
  border-radius: 20px;
  display: inline-block;
  margin-top: 10px;
  font-weight: 500;
  position: relative;
  z-index: 1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 内容类型标签 */
.content-type-tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 2px solid #eaeaea;
}

.content-tab {
  padding: 12px 24px;
  background: #f5f7fa;
  border: none;
  border-bottom: 2px solid transparent;
  color: #666;
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-right: 2px;
}

.content-tab:hover {
  background: #e8f0fe;
  color: #0066cc;
}

.content-tab.active {
  background: white;
  color: #0066cc;
  border-bottom-color: #0066cc;
  box-shadow: 0 -2px 0 #0066cc;
}

/* 控制栏 */
.controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid #eaeaea;
  flex-wrap: wrap;
  gap: 15px;
}

.sort-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.sort-btn {
  padding: 8px 16px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.sort-btn:hover {
  background: #eaeaea;
}

.sort-btn.active {
  background: #0066cc;
  color: white;
  border-color: #0066cc;
}

.view-toggle {
  display: flex;
  gap: 5px;
}

.view-btn {
  padding: 5px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 10px;
  cursor: pointer;
  font-size: 20px;
}

.view-btn.active {
  background: #0066cc;
  color: white;
  border-color: #0066cc;
}

.search-box {
  padding: 8px 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  width: 250px;
  font-size: 0.95rem;
}

/* 内容结果容器 */
.content-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 25px;
  margin-top: 30px;
}

.content-results.list-view {
  grid-template-columns: 1fr;
  gap: 20px;
}

/* 博客列表样式 - 优雅设计 */
.blog-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 25px;
}

.blog-item {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.blog-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.blog-item.list-view {
  min-height: 150px;
  flex-direction: row;
  align-items: flex-start;
  padding: 20px;
}

.blog-content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.blog-content h3{
  margin-bottom: 10px;
  /* 文本两行 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
.blog-item.list-view .blog-content {
  padding: 0;
  flex: 1;
}

/* 标题区域 - 统一处理 */
.blog-title-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
  position: relative;
}

.blog-title-wrapper h3 {
  flex: 1;
  font-size: 1.3rem;
  line-height: 1.4;
  color: #2c3e50;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 日期样式 - 优雅设计 */
.blog-date {
  font-size: 0.85rem;
  font-weight: 500;
  color: #666;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* 网格视图：日期在标题右侧，竖线分隔 */
.blog-item:not(.list-view) .blog-date {
  padding-left: 12px;
  margin-left: 12px;
  border-left: 1px solid #e0e0e0;
  color: #888;
  font-size: 0.8rem;
}

.blog-item:not(.list-view) .blog-date::before {
  content: "📅";
  font-size: 0.9rem;
}
/* 列表视图：日期在右侧 */
.blog-item.list-view .blog-date {
  position: absolute;
  top: 0;
  right: 0;
  background: #f8f9fa;
  padding: 4px 12px;
  border-radius: 4px;
  color: #0066cc;
  font-weight: 600;
  border: 1px solid #e8f0fe;
}

.blog-item.list-view .blog-date::before {
  content: "📅";
  margin-right: 5px;
  font-size: 0.9rem;
}

.blog-item a {
  color: #0066cc;
  text-decoration: none;
  transition: color 0.2s;
}

.blog-item a:hover {
  color: #0052a3;
  text-decoration: underline;
}

.blog-summary {
  color: #555;
  line-height: 1.6;
  margin-bottom: 20px;
  font-size: 0.95rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.blog-item.list-view .blog-summary {
  -webkit-line-clamp: 2;
  margin-bottom: 15px;
}

.blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.blog-tag {
  background: #e8f0fe;
  color: #0066cc;
  padding: 4px 10px;
  border-radius: 15px;
  font-size: 0.85rem;
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.blog-tag:hover {
  background: #d6e4ff;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 102, 204, 0.1);
}

.blog-tag.current {
  background: #0066cc;
  color: white;
  font-weight: 500;
}

/* 产品列表样式 */
.product-item {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.product-item.list-view {
  flex-direction: row;
  align-items: flex-start;
  padding: 20px;
}

.product-content {
  padding: 25px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-item.list-view .product-content {
  padding: 0;
  flex: 1;
}

.product-item h3 {
  margin: 0 0 15px 0;
  line-height: 1.4;
  color: #2c3e50;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-item a {
  color: #0066cc;
  text-decoration: none;
  transition: color 0.2s;
}

.product-item a:hover {
  color: #0052a3;
}

/* 无结果样式 */
.no-results {
  text-align: center;
  padding: 60px 20px;
  color: #666;
  grid-column: 1 / -1;
}

.no-results-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.3;
}

.no-results h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: #444;
}

.no-results p {
  margin-bottom: 20px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.browse-all-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.pagination-controls {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: center;
}

.page-btn {
  padding: 8px 15px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  color: #333;
  min-width: 40px;
  text-align: center;
}

.page-btn:hover:not(:disabled) {
  background: #eaeaea;
  transform: translateY(-1px);
}

.page-btn.active {
  background: #0066cc;
  color: white;
  border-color: #0066cc;
  box-shadow: 0 2px 5px rgba(0, 102, 204, 0.3);
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* 搜索高亮样式 */
.search-highlight-title {
  background-color: #ffeb3b;
  padding: 2px 4px;
  border-radius: 2px;
  font-weight: bold;
  color: #333;
}

.search-highlight-summary {
  background-color: #4fc3f7;
  padding: 1px 3px;
  border-radius: 2px;
  font-weight: bold;
  color: #333;
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.blog-item,
.product-item {
  animation: fadeIn 0.3s ease-out;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .tag-page {
    padding: 15px;
  }

  .tag-header {
    padding: 30px 20px;
  }

  .tag-title {
    font-size: 2rem;
  }

  .controls-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .sort-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-box {
    width: 100%;
  }

  .content-results {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .blog-results {
    grid-template-columns: 1fr;
  }

  .blog-item.list-view,
  .product-item.list-view {
    flex-direction: column;
    padding: 20px;
  }

  .blog-item.list-view .blog-date {
    position: static;
    margin-top: 10px;
    margin-bottom: 10px;
    align-self: flex-end;
  }

  .blog-title-wrapper {
    flex-direction: column;
    align-items: flex-start;
  }

  .blog-item:not(.list-view) .blog-date {
    margin: 10px 0 0 0;
    padding: 0;
    border: none;
    align-self: flex-start;
  }

  .blog-item:not(.list-view) .blog-date::before {
    margin-right: 5px;
  }

  .blog-item h3,
  .product-item h3 {
    font-size: 1.2rem;
  }

  .blog-summary {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .pagination-controls {
    gap: 3px;
  }

  .page-btn {
    padding: 6px 10px;
    font-size: 13px;
    min-width: 35px;
  }
  
  .browse-all-links {
    flex-direction: column;
    gap: 10px;
  }
}

/* 小屏幕优化 */
@media (max-width: 480px) {
  .tag-header {
    padding: 20px 15px;
  }

  .content-tab {
    padding: 10px 15px;
    font-size: 1rem;
  }

  .blog-content,
  .product-content {
    padding: 20px;
  }

  .blog-item.list-view .blog-content,
  .product-item.list-view .product-content {
    padding: 0;
  }

  .blog-tags {
    gap: 5px;
  }

  .blog-tag {
    font-size: 0.8rem;
    padding: 3px 8px;
  }
}

/* Font Awesome 图标 */
.fa-th:before {
  content: "\f00a";
}

.fa-list:before {
  content: "\f03a";
}

/* 确保所有必要的显示属性 */
.blog-results.grid-view,
.product-results.grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 25px;
}

.blog-results.list-view,
.product-results.list-view {
  display: grid;
  grid-template-columns: 1fr !important;
  gap: 20px;
}

#blog-results,
#product-results {
  display: grid;
}

/* 错误信息样式 */
.content-results .no-results {
  text-align: center;
  padding: 60px 20px;
  color: #666;
  font-style: italic;
  border: 1px dashed #ddd;
  border-radius: 8px;
  background: #f9f9f9;
}