/* 
 * 文章详情页面样式
 */

/* 文章详情容器 */
.article-detail-container {
  padding-top: 100px;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding-bottom: 3rem;
}

/* 文章头部 */
.article-header {
  margin-bottom: 2rem;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--text-gray);
}

.article-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.2;
  color: var(--text-dark);
}

.article-author {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.author-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
}

.author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-info {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: var(--text-dark);
}

.article-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-gray);
}

/* 文章封面图 */
.article-cover {
  width: 100%;
  height: 400px;
  margin-bottom: 2rem;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  position: relative;
}

.article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 文章分类徽章 */
.article-category-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background-color: var(--primary-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: var(--border-radius-full);
  font-size: 0.8rem;
  font-weight: 500;
}

/* 文章内容 */
.article-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-dark);
}

.article-content p {
  margin-bottom: 1.5rem;
}

.article-content h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 2rem 0 1rem;
  color: var(--text-dark);
}

.article-image {
  margin: 2rem 0;
  border-radius: var(--border-radius-md);
  overflow: hidden;
}

.article-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.image-caption {
  font-size: 0.9rem;
  color: var(--text-gray);
  text-align: center;
  padding: 0.5rem 0;
  margin-bottom: 0;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 3rem;
}

.tag {
  padding: 0.25rem 0.75rem;
  background-color: var(--bg-secondary);
  color: var(--text-dark);
  border-radius: var(--border-radius-full);
  font-size: 0.85rem;
  transition: background-color var(--transition-fast);
}

.tag:hover {
  background-color: var(--primary-color);
  color: var(--text-light);
}

/* 分享按钮 */
.article-share {
  display: flex;
  align-items: center;
  margin: 2rem 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--bg-secondary);
  border-bottom: 1px solid var(--bg-secondary);
}

.share-text {
  font-size: 0.9rem;
  color: var(--text-gray);
  margin-right: 1rem;
}

.share-buttons {
  display: flex;
  gap: 1rem;
}

.share-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.share-button.weixin {
  background-color: #07C160;
  color: white;
}

.share-button.weibo {
  background-color: #E6162D;
  color: white;
}

.share-button.qq {
  background-color: #12B7F5;
  color: white;
}

.share-button.twitter {
  background-color: #1DA1F2;
  color: white;
}

.share-button:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}

/* 文章评论 */
.article-comments {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--bg-secondary);
}

.article-comments h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-dark);
}

.comment-count-text {
  font-size: 1.1rem;
  color: var(--text-gray);
  font-weight: normal;
}

.comment-form {
  margin-bottom: 2rem;
}

.comment-form textarea {
  width: 100%;
  height: 100px;
  padding: 1rem;
  border: 1px solid var(--bg-secondary);
  border-radius: var(--border-radius-md);
  resize: none;
  margin-bottom: 1rem;
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-dark);
}

.comment-submit {
  padding: 0.5rem 1.5rem;
  background-color: var(--primary-color);
  color: var(--text-light);
  border: none;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  font-weight: 500;
  transition: background-color var(--transition-fast);
}

.comment-submit:hover {
  background-color: var(--primary-color);
  opacity: 0.9;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.comment-item {
  display: flex;
  gap: 1rem;
}

.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.comment-content {
  flex-grow: 1;
}

.comment-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.comment-author {
  font-weight: 500;
  color: var(--text-dark);
}

.comment-date {
  font-size: 0.85rem;
  color: var(--text-gray);
}

.comment-text {
  margin-bottom: 0.75rem;
  line-height: 1.6;
  color: var(--text-dark);
}

.comment-actions {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-gray);
}

.like-action,
.reply-action {
  cursor: pointer;
  transition: color var(--transition-fast);
}

.like-action:hover,
.reply-action:hover {
  color: var(--primary-color);
}

.reply-item {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--bg-secondary);
  margin-left: 1rem;
  display: flex;
  gap: 1rem;
}

/* 相关文章 */
.related-articles {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--bg-secondary);
}

.related-articles h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-dark);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.related-card {
  background-color: var(--bg-primary);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.related-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.related-image {
  width: 100%;
  height: 150px;
  overflow: hidden;
  position: relative;
}

.related-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.related-card:hover .related-image img {
  transform: scale(1.05);
}

/* 相关文章分类徽章 */
.related-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.4));
  opacity: 0;
  transition: opacity var(--transition-normal);
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 0.5rem;
}

.related-card:hover .related-overlay {
  opacity: 1;
}

.related-content {
  padding: 1rem;
}

.related-content h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
  line-height: 1.4;
}

.related-content p {
  font-size: 0.9rem;
  color: var(--text-gray);
  margin-bottom: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 深色模式适配 */
body.dark-mode .article-title,
body.dark-mode .author-name,
body.dark-mode .article-content h2,
body.dark-mode .article-content,
body.dark-mode .article-comments h3,
body.dark-mode .comment-author,
body.dark-mode .comment-text,
body.dark-mode .related-content h4 {
  color: var(--text-light);
}

body.dark-mode .tag {
  background-color: var(--bg-secondary);
  color: var(--text-light);
}

body.dark-mode .comment-form textarea {
  background-color: var(--bg-primary);
  border-color: var(--bg-secondary);
  color: var(--text-light);
}

body.dark-mode .related-card {
  background-color: var(--bg-primary);
}

/* 响应式设计 */
@media (max-width: 992px) {
  .article-detail-container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (max-width: 768px) {
  .article-title {
    font-size: 2rem;
  }

  .article-cover {
    height: 300px;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px) {
  .article-detail-container {
    padding-top: 80px;
  }

  .article-title {
    font-size: 1.75rem;
  }

  .article-cover {
    height: 200px;
  }

  .article-content {
    font-size: 1rem;
  }
}