/**
 * article.css - 文章页面样式
 * 说明：文章列表页、文章详情页的完整样式
 * 适用：article-list.html（文章列表页）、article-detail.html（文章详情页）
 * 依赖：base.css, layout.css, common.css
 */

/* ========== 内容容器 ========== */
.content-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* ========== 文章详情页通用卡片 ========== */
.detail-card {
  background: white;
  border-radius: 4px;
  margin-bottom: 16px;
  
  overflow: visible;
  
}

/* ========== 标签页导航（文章详情页 + 文章列表页共用） ========== */
.page-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  background: white;
  border-radius: 4px;
  padding: 0 20px;
  margin-bottom: 16px;
}

.page-tabs-left {
  display: flex;
  align-items: center;
}

.page-tabs .page-tab-item,
.page-tab-item {
  padding: 16px 0;
  margin-right: 32px;
  font-size: 15px;
  color: #606266;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
}

.page-tabs .page-tab-item:last-child {
  margin-right: 0;
}

.page-tabs .page-tab-item:hover {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  font-weight: 500;
}

.page-tabs .page-tab-item.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  font-weight: 500;
}

.page-tabs .page-tab-link {
  text-decoration: none;
}

.page-tabs .page-tab-link:hover {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  font-weight: 500;
}

.page-tabs-right {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 13px;
  color: #909399;
}

.page-tabs-right .view-count,
.page-tabs-right .update-time {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 文章主体容器 */
.article-main {
  width: 100%;
}

/* ========== 文章列表页样式 ========== */

/* 面包屑导航 */
.breadcrumb {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  font-size: 14px;
  color: #64748b;
}

.breadcrumb-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

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

.separator {
  color: #d1d5db;
  margin: 0 8px;
}

.breadcrumb .current {
  color: var(--text-primary);
}

/* 页面标题区 */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--primary-color);
  margin-bottom: 24px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

/* ========== 文章列表页样式 ========== */
.article-list-container {
  position: relative;
}

/* 文章分类区域 */
.article-category {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 32px;
  animation: fadeIn 0.3s ease;
}

.article-category.hidden {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 文章卡片 */
.article-card {
  display: flex;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  transition: all 0.3s;
}

.article-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

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

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

.article-card-content {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.article-card-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.article-card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 12px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.article-card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 12px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.article-card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-light);
}

.meta-source {
  color: var(--primary-color);
}

/* 文章列表分页 */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 0;
}

.page-btn,
.page-num {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--text-secondary);
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.page-btn:hover:not(.disabled),
.page-num:hover:not(.active) {
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.page-num.active {
  color: #fff;
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.page-btn.disabled {
  color: #d1d5db;
  cursor: not-allowed;
}


/* ========== 文章详情页样式 ========== */

/* 标签页内容链接 */
.tab-content-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 60px 20px;
  background: white;
  border-radius: 4px;
  
  text-decoration: none;
  transition: all 0.2s ease;
}

.tab-content-link:hover {
  border-color: var(--primary-color);
  background: #f8faff;
}

.tab-content-link .link-text {
  font-size: 15px;
  color: #606266;
}

.tab-content-link:hover .link-text {
  color: var(--primary-color);
}

.tab-content-link .link-arrow {
  font-size: 16px;
  color: #909399;
}

.tab-content-link:hover .link-arrow {
  color: var(--primary-color);
}

/* 文章头部卡片 */
.article-header-card {
  padding: 20px 32px;
  margin-bottom: 16px;
}

.article-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 20px;
}

.article-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 12px;
}

.meta-left {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 14px;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.author-name {
  color: var(--primary-color);
  font-weight: 500;
}

.meta-divider {
  color: #d1d5db;
}

.meta-right {
  color: var(--text-light);
  font-size: 13px;
}

.article-share {
  display: flex;
  align-items: center;
  gap: 12px;
}

.share-label {
  color: var(--text-secondary);
  font-size: 14px;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.share-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.share-btn.wechat:hover {
  border-color: #07C160;
  color: #07C160;
}

.share-btn.weibo:hover {
  border-color: #E6162D;
  color: #E6162D;
}

/* 文章内容卡片 */
.article-content-card {
  padding: 20px 32px;
  margin-bottom: 16px;
}

/* 文章正文 */
.article-body {
  font-size: 16px;
  line-height: 1.9;
  color: #374151;
}

.article-body h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 24px 0 16px;
}

.article-body h2:first-child {
  margin-top: 0;
}

.article-body h3 {
  font-size: 18px;
  font-weight: 600;
  color: #374151;
  margin: 32px 0 16px;
}

.article-body p {
  margin: 16px 0;
  text-align: justify;
}

.article-body a {
  color: var(--primary-color);
  text-decoration: none;
}

.article-body a:hover {
  text-decoration: underline;
}

/* 文章图片 */
.article-image-full {
  margin: 24px 0;
  text-align: center;
}

.article-image-full img {
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.image-caption {
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-light);
  text-align: center;
}

/* 图片网格 */
.article-image-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.article-image-grid .grid-item {
  text-align: center;
}

.article-image-grid img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.article-image-grid p {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* 文章引用 */
.article-quote {
  display: flex;
  gap: 16px;
  padding: 20px 24px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin: 24px 0;
}

.quote-icon {
  flex-shrink: 0;
  color: var(--primary-color);
  opacity: 0.6;
}

.quote-content p {
  margin: 0 0 8px;
  font-size: 15px;
  font-style: italic;
  color: #4b5563;
}

.quote-source {
  font-size: 13px;
  color: var(--text-light);
}

/* 文章统计卡片 */
.article-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.stat-card {
  padding: 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 8px;
  text-align: center;
}

.stat-number {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
}

/* 免责声明 */
.article-disclaimer {
  margin-top: 24px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: 8px;
  font-size: 13px;
  color: #909399;
}

.disclaimer-title {
  font-size: 14px;
  font-weight: 600;
  color: #606266;
  margin-bottom: 8px;
}

.article-disclaimer p {
  margin: 0;
  font-size: 13px;
  color: #7f1d1d;
  line-height: 1.6;
}

/* 文章标签 */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-color);
}

.tag-label {
  font-size: 13px;
  color: #909399;
  font-weight: 500;
}

.article-tag {
  display: inline-block;
  padding: 4px 12px;
  font-size: 12px;
  color: #606266;
  background: #f3f4f6;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.2s;
}

.article-tag:hover {
  background: var(--border-color);
  color: var(--primary-color);
}

/* 文章操作按钮 */
.article-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.action-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.article-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: #fff;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.article-action-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.article-action-btn.like-btn:hover {
  border-color: #ef4444;
  color: #ef4444;
}

.like-count,
.comment-count span:last-child {
  font-weight: 500;
}

.action-right .comment-count {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 14px;
}

/* 相关推荐模块 */
.recommend-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.recommend-card {
  background: white;
  border-radius: 4px;
  
  overflow: hidden;
  
}

.recommend-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
}

.recommend-card .card-title {
  font-size: 15px;
}

.recommend-card .view-more-link {
  font-size: 13px;
  color: #909399;
  text-decoration: none;
  transition: color 0.2s;
}

.recommend-card .view-more-link:hover {
  color: var(--primary-color);
}


.recommend-list {
  padding: 12px 16px;
}

.recommend-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #ebeef5;
  text-decoration: none;
  transition: background 0.2s;
}

.recommend-item:last-child {
  border-bottom: none;
}

.recommend-item:hover {
  background: #f5f7fa;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
}

.recommend-img {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  background: #f5f7fa;
}

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

.recommend-info {
  flex: 1;
  min-width: 0;
}

.recommend-name {
  font-size: 14px;
  color: #303133;
  margin-bottom: 4px;
}

.recommend-price {
  font-size: 13px;
  color: #f56c6c;
  font-weight: 500;
}

/* 参考资料列表 */
.reference-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reference-item {
  display: flex;
  gap: 8px;
  font-size: 14px;
  line-height: 1.6;
  color: #4b5563;
}

.reference-number {
  flex-shrink: 0;
  color: var(--primary-color);
  font-weight: 500;
}

.reference-text {
  flex: 1;
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
  /* 文章列表页响应式 */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .page-tabs {
    flex-wrap: wrap;
    gap: 8px;
  }

  .article-list-container {
    grid-template-columns: 1fr;
  }

  .article-card {
    flex-direction: column;
  }

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

  .article-card-meta {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* 文章详情页响应式 */
  .article-header-card,
  .article-content-card {
    padding: 20px;
  }

  .article-title {
    font-size: 22px;
  }

  .article-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .article-stats {
    grid-template-columns: 1fr;
  }

  .article-image-grid {
    grid-template-columns: 1fr;
  }

  .recommend-section {
    grid-template-columns: 1fr;
  }

  .article-nav {
    flex-direction: column;
    gap: 12px;
  }

  .article-nav-item {
    max-width: 100%;
  }

  .article-nav-item.next {
    flex-direction: row;
    text-align: left;
  }

  .article-tags {
    gap: 6px;
  }

  .article-tag {
    padding: 3px 10px;
  }
}

/* ========== 上一篇/下一篇导航 ========== */
.article-nav {
  display: flex;
  justify-content: space-between;
  padding: 20px 0;
}

.article-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 48%;
  font-size: 14px;
  color: #606266;
  text-decoration: none;
  transition: color 0.2s;
}

.article-nav-item:hover {
  color: var(--primary-color);
}

.article-nav-item.prev {
  flex-direction: row;
}

.article-nav-item.next {
  flex-direction: row-reverse;
  text-align: right;
}

.article-nav-item .nav-label {
  color: #909399;
  flex-shrink: 0;
}

.article-nav-item .nav-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}