/* 行业洞察文章详情页样式 - 带TOC目录功能 */

/* 文章页面布局 - 内容版心居中，TOC在版心右侧外 */
.article-page-layout {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 主内容区域 - 版心 */
.article-main {
  width: 100%;
}

/* 文章容器 - 全宽，不限制宽度 */
.article-container {
  width: 100%;
  padding: 100px 0 60px;
}

/* TOC侧边栏 - 固定在版心右侧外 */
.toc-sidebar {
  position: fixed;
  right: calc((100vw - 800px) / 2 - 300px);
  top: 120px;
  width: 260px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}

.toc-container {
  background: #f8fafc;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e2e8f0;
}

.toc-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #1890ff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toc-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 18px;
  background: linear-gradient(135deg, #1890ff 0%, #40a9ff 100%);
  border-radius: 2px;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-list li {
  margin-bottom: 8px;
}

.toc-list a {
  display: block;
  color: #666;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.5;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.toc-list a:hover {
  color: #1890ff;
  background: #e6f7ff;
}

.toc-list a.active {
  color: #1890ff;
  background: #e6f7ff;
  border-left-color: #1890ff;
  font-weight: 500;
}

/* TOC层级缩进 */
.toc-list .toc-h2 {
  padding-left: 12px;
}

.toc-list .toc-h3 {
  padding-left: 24px;
  font-size: 13px;
}

.toc-list .toc-h4 {
  padding-left: 36px;
  font-size: 12px;
  color: #888;
}

/* 面包屑导航 */
.breadcrumb {
  max-width: 800px;
  margin: 0 auto 30px;
  padding: 0 20px;
  font-size: 14px;
  color: #666;
}

.breadcrumb a {
  color: #666;
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: #1890ff;
}

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

.breadcrumb .current {
  color: #999;
}

/* 文章头部 */
.article-header {
  margin-bottom: 30px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.article-meta .category {
  display: inline-block;
  padding: 4px 12px;
  background: linear-gradient(135deg, #e6f7ff 0%, #bae7ff 100%);
  border-radius: 4px;
  font-size: 13px;
  color: #1890ff;
  font-weight: 500;
}

.article-meta .date,
.article-meta .author {
  color: #999;
  font-size: 14px;
}

.article-meta .reading-time {
  color: #999;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.article-title {
  font-size: 32px;
  font-weight: 700;
  color: #222;
  line-height: 1.4;
  margin: 0;
}

/* 封面图 */
.cover-image,
.article-cover {
  margin-bottom: 40px;
  border-radius: 12px;
  overflow: hidden;
  max-height: 400px;
}

.cover-image img,
.article-cover img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  display: block;
}

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

.article-content h2 {
  font-size: 24px;
  font-weight: 600;
  color: #222;
  margin: 40px 0 20px;
  padding-left: 12px;
  border-left: 4px solid #1890ff;
  scroll-margin-top: 100px;
}

.article-content h3 {
  font-size: 20px;
  font-weight: 600;
  color: #333;
  margin: 30px 0 16px;
  scroll-margin-top: 100px;
}

.article-content h4 {
  font-size: 18px;
  font-weight: 600;
  color: #444;
  margin: 24px 0 12px;
  scroll-margin-top: 100px;
}

.article-content p {
  margin-bottom: 20px;
  text-align: justify;
}

.article-content ul,
.article-content ol {
  margin: 16px 0 24px;
  padding-left: 24px;
}

.article-content li {
  margin-bottom: 10px;
  line-height: 1.8;
}

.article-content strong {
  color: #222;
  font-weight: 600;
}

.article-content a {
  color: #1890ff;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.article-content a:hover {
  border-bottom-color: #1890ff;
}

.article-content blockquote {
  margin: 24px 0;
  padding: 20px 24px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e6f7ff 100%);
  border-left: 4px solid #1890ff;
  border-radius: 0 8px 8px 0;
  color: #555;
  font-style: italic;
}

.article-content img {
  max-width: 100%;
  border-radius: 8px;
  margin: 20px 0;
}

.article-content pre {
  background: #f5f5f5;
  padding: 16px 20px;
  border-radius: 8px;
  overflow-x: auto;
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 14px;
  line-height: 1.6;
}

.article-content code {
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 14px;
  color: #1890ff;
}

/* 表格样式 */
.article-content table,
.article-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}

.article-content table th,
.article-content table td,
.article-table th,
.article-table td {
  padding: 12px 16px;
  text-align: left;
  border: 1px solid #e8e8e8;
}

.article-content table th,
.article-table th {
  background: #fafafa;
  font-weight: 600;
  color: #333;
}

.article-content table tr:hover,
.article-table tr:hover {
  background: #f5f5f5;
}

/* 文章标签 */
.article-tags {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid #eee;
}

.article-tags .label {
  color: #666;
  font-size: 14px;
  margin-right: 8px;
}

.article-tags .tag {
  display: inline-block;
  padding: 4px 12px;
  background: #f5f5f5;
  border-radius: 4px;
  margin-right: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  color: #666;
  text-decoration: none;
  transition: all 0.2s;
}

.article-tags .tag:hover {
  background: #e6f7ff;
  color: #1890ff;
}

/* 文章导航 */
.article-nav {
  margin-top: 40px;
  text-align: center;
}

.article-nav .back-to-list {
  display: inline-block;
  padding: 12px 32px;
  background: linear-gradient(135deg, #1890ff 0%, #40a9ff 100%);
  color: white;
  text-decoration: none;
  border-radius: 24px;
  font-size: 15px;
  transition: all 0.3s;
}

.article-nav .back-to-list:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(24, 144, 255, 0.4);
}

/* 相关推荐 - 文字链接形式 */
.related-articles {
  max-width: 800px;
  margin: 60px auto 0;
  padding: 40px 20px 0;
  border-top: 1px solid #eee;
}

.related-articles h3 {
  font-size: 18px;
  font-weight: 600;
  color: #222;
  margin-bottom: 20px;
}

.related-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.related-item {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: 8px;
  transition: all 0.2s;
  border: 1px solid #e8e8e8;
}

.related-item:hover {
  background: #e6f7ff;
  border-color: #1890ff;
}

.related-item::before {
  content: '📄';
  font-size: 16px;
}

.related-item .info {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.related-item h4 {
  font-size: 15px;
  font-weight: 500;
  color: #333;
  line-height: 1.5;
  margin: 0;
  flex: 1;
}

.related-item:hover h4 {
  color: #1890ff;
}

.related-item .date {
  font-size: 13px;
  color: #999;
  white-space: nowrap;
}

/* 隐藏相关推荐的封面图 */
.related-cover {
  display: none;
}

/* 响应式 - 小屏幕隐藏TOC */
@media screen and (max-width: 1400px) {
  .toc-sidebar {
    display: none;
  }
}

@media screen and (max-width: 768px) {
  .article-container {
    padding: 80px 0 40px;
  }

  .article-page-layout {
    padding: 0 16px;
  }

  .breadcrumb {
    padding: 0 16px;
  }

  .related-articles {
    padding: 40px 16px 0;
  }

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

  .article-content {
    font-size: 15px;
  }

  .article-content h2 {
    font-size: 20px;
    margin: 30px 0 16px;
  }

  .related-item {
    padding: 10px 12px;
  }

  .related-item .info {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .related-item h4 {
    font-size: 14px;
  }
}
