/* 文章详情页样式 */
:root {
  --primary-color: #4a90e2;
  --secondary-color: #f0f7ff;
  --text-primary: #333333;
  --text-secondary: #666666;
  --text-light: #999999;
  --bg-light: #f8f9fa;
  --border-light: #e0e0e0;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
}

/* 文章容器 */
.article-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: var(--spacing-lg);
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* 返回按钮 */
.back-button {
  display: inline-flex;
  align-items: center;
  color: var(--primary-color);
  font-weight: 500;
  margin-bottom: var(--spacing-lg);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
  text-decoration: none;
}

.back-button:hover {
  background-color: var(--secondary-color);
  transform: translateX(-4px);
}

.back-button svg {
  margin-right: var(--spacing-sm);
}

/* 文章标题 */
.article-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--spacing-lg);
  line-height: 1.3;
}

/* 文章元信息 */
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--border-light);
  color: var(--text-light);
  font-size: 0.9rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.meta-item svg {
  width: 16px;
  height: 16px;
}

/* 文章内容 */
.article-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-primary);
  margin-bottom: var(--spacing-xl);
}

/* 文章内容排版优化 */
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
  margin-top: 1.5em;
  margin-bottom: 0.75em;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.article-content h1 {
  font-size: 1.8rem;
}

.article-content h2 {
  font-size: 1.5rem;
}

.article-content h3 {
  font-size: 1.3rem;
}

.article-content h4 {
  font-size: 1.2rem;
}

.article-content p {
  margin-bottom: 1.2em;
}

.article-content ul,
.article-content ol {
  margin-bottom: 1.2em;
  padding-left: 1.5em;
}

.article-content li {
  margin-bottom: 0.5em;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin: 1.5em 0;
}

.article-content blockquote {
  border-left: 4px solid var(--primary-color);
  padding-left: var(--spacing-md);
  margin: 1.5em 0;
  color: var(--text-secondary);
  font-style: italic;
}

.article-content pre {
  background-color: var(--bg-light);
  padding: var(--spacing-md);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 1.5em 0;
}

.article-content code {
  background-color: var(--bg-light);
  padding: 2px 4px;
  border-radius: 3px;
  font-family: monospace;
  font-size: 0.9em;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
}

.article-content th,
.article-content td {
  border: 1px solid var(--border-light);
  padding: var(--spacing-sm);
  text-align: left;
}

.article-content th {
  background-color: var(--bg-light);
  font-weight: 600;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .article-container {
    padding: var(--spacing-md);
  }
  
  .article-title {
    font-size: 1.8rem;
  }
  
  .article-meta {
    gap: var(--spacing-sm);
    flex-direction: column;
    align-items: flex-start;
  }
  
  .article-content {
    font-size: 1rem;
  }
  
  .article-content h1 {
    font-size: 1.6rem;
  }
  
  .article-content h2 {
    font-size: 1.4rem;
  }
  
  .article-content h3 {
    font-size: 1.2rem;
  }
}

/* 图片延迟加载 */
.lazy-load {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lazy-load.loaded {
  opacity: 1;
}

/* 图片占位符 */
.img-placeholder {
  background-color: #f0f0f0;
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-placeholder::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.2), rgba(255,255,255,0));
  transform: translateX(-100%);
  animation: loading 1.5s infinite;
}

@keyframes loading {
  100% {
    transform: translateX(100%);
  }
}
