/* ============================================
   太原市斯航网络科技有限公司 - 文章详情排版
   文件名：article.css
   作用：技术百科/行业动态详情页样式
   ============================================ */

/* ====== 文章页布局 ====== */
.article-page {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
}

.article-main {
  min-width: 0;
}

.article-sidebar {
  min-width: 0;
}

/* ====== 文章头部 ====== */
.article-header {
  margin-bottom: 30px;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--border);
}

.article-header h1 {
  font-size: 28px;
  color: var(--primary);
  margin-bottom: 15px;
  line-height: 1.4;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 14px;
  color: var(--text-muted);
}

.article-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.article-meta a {
  color: var(--secondary);
}

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

/* ====== 文章内容 ====== */
.article-body {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
}

.article-body h2 {
  font-size: 24px;
  color: var(--primary);
  margin: 40px 0 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

.article-body h3 {
  font-size: 20px;
  color: var(--primary);
  margin: 30px 0 15px;
}

.article-body h4 {
  font-size: 18px;
  color: var(--primary);
  margin: 25px 0 12px;
}

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

.article-body ul,
.article-body ol {
  margin-bottom: 20px;
  padding-left: 25px;
}

.article-body ul li {
  list-style-type: disc;
  margin-bottom: 8px;
}

.article-body ol li {
  list-style-type: decimal;
  margin-bottom: 8px;
}

.article-body strong {
  color: var(--primary);
  font-weight: 600;
}

.article-body a {
  color: var(--secondary);
  text-decoration: underline;
}

.article-body a:hover {
  color: #e55a2b;
}

.article-body blockquote {
  background-color: var(--bg);
  border-left: 4px solid var(--secondary);
  padding: 20px 25px;
  margin: 25px 0;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text-muted);
}

.article-body blockquote p {
  margin-bottom: 0;
}

.article-body code {
  background-color: var(--bg);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: "Consolas", "Monaco", monospace;
  font-size: 14px;
  color: var(--secondary);
}

.article-body pre {
  background-color: var(--dark);
  color: var(--white);
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 20px 0;
}

.article-body pre code {
  background-color: transparent;
  color: var(--white);
  padding: 0;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

.article-body th,
.article-body td {
  border: 1px solid var(--border);
  padding: 12px 15px;
  text-align: left;
}

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

.article-body tr:nth-child(even) {
  background-color: rgba(0,0,0,0.02);
}

/* ====== 文章标签 ====== */
.article-tags {
  margin-top: 40px;
  padding-top: 25px;
  border-top: 1px solid var(--border);
}

.article-tags-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 15px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-item {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text);
  transition: all 0.3s ease;
}

.tag-item:hover {
  background-color: var(--secondary);
  color: var(--white);
  border-color: var(--secondary);
}

/* ====== 相关文章 ====== */
.related-articles {
  margin-top: 50px;
  padding-top: 30px;
  border-top: 2px solid var(--border);
}

.related-articles h3 {
  font-size: 22px;
  color: var(--primary);
  margin-bottom: 25px;
}

.related-articles h3::after {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  background-color: var(--secondary);
  margin-top: 10px;
}

.related-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.related-item {
  display: flex;
  gap: 15px;
  padding: 15px;
  background-color: var(--bg);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.related-item:hover {
  box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.related-item-num {
  width: 40px;
  height: 40px;
  min-width: 40px;
  background-color: var(--secondary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 600;
  font-size: 16px;
}

.related-item-content {
  flex: 1;
  min-width: 0;
}

.related-item-content h4 {
  font-size: 15px;
  color: var(--primary);
  margin-bottom: 5px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.related-item-content h4 a {
  color: var(--primary);
}

.related-item-content h4 a:hover {
  color: var(--secondary);
}

.related-item-content p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 0;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ====== 侧边栏 ====== */
.sidebar-widget {
  background-color: var(--white);
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 25px;
  border: 1px solid var(--border);
}

.sidebar-widget-title {
  font-size: 18px;
  color: var(--primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--secondary);
  font-weight: 600;
}

/* 热门文章 */
.hot-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.hot-list li:last-child {
  border-bottom: none;
}

.hot-num {
  width: 28px;
  height: 28px;
  min-width: 28px;
  background-color: var(--bg);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.hot-num.top {
  background-color: var(--secondary);
  color: var(--white);
}

.hot-content {
  flex: 1;
  min-width: 0;
}

.hot-content h4 {
  font-size: 14px;
  color: var(--primary);
  margin-bottom: 4px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hot-content h4 a {
  color: var(--primary);
}

.hot-content h4 a:hover {
  color: var(--secondary);
}

.hot-content .date {
  font-size: 12px;
  color: var(--text-muted);
}

/* 最新文章 */
.new-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.new-list li:last-child {
  border-bottom: none;
}

.new-list li a {
  font-size: 14px;
  color: var(--text);
  display: block;
  line-height: 1.5;
}

.new-list li a:hover {
  color: var(--secondary);
}

.new-list li .date {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* 搜索框 */
.search-box {
  display: flex;
  gap: 0;
}

.search-box input {
  flex: 1;
  padding: 12px 15px;
  border: 1px solid var(--border);
  border-radius: 4px 0 0 4px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s ease;
}

.search-box input:focus {
  border-color: var(--secondary);
}

.search-box button {
  padding: 12px 20px;
  background-color: var(--secondary);
  color: var(--white);
  border: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s ease;
}

.search-box button:hover {
  background-color: #e55a2b;
}

/* TAG云 */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-cloud a {
  padding: 6px 12px;
  background-color: var(--bg);
  border-radius: 4px;
  font-size: 13px;
  color: var(--text);
  transition: all 0.3s ease;
}

.tag-cloud a:hover {
  background-color: var(--secondary);
  color: var(--white);
}

/* ====== 上下篇导航 ====== */
.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 40px;
  padding-top: 25px;
  border-top: 1px solid var(--border);
}

.article-nav-prev,
.article-nav-next {
  padding: 20px;
  background-color: var(--bg);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.article-nav-prev:hover,
.article-nav-next:hover {
  background-color: rgba(255,107,53,0.05);
}

.article-nav-next {
  text-align: right;
}

.article-nav-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.article-nav-title {
  font-size: 15px;
  color: var(--primary);
  font-weight: 500;
  line-height: 1.4;
}

.article-nav a:hover .article-nav-title {
  color: var(--secondary);
}

/* ====== 响应式 ====== */
@media (max-width: 1024px) {
  .article-page {
    grid-template-columns: 1fr;
  }
  
  .article-sidebar {
    order: 2;
  }
  
  .sidebar-widget {
    margin-bottom: 20px;
  }
}

@media (max-width: 767px) {
  .article-header h1 {
    font-size: 22px;
  }
  
  .article-body {
    font-size: 15px;
  }
  
  .article-body h2 {
    font-size: 20px;
  }
  
  .article-body h3 {
    font-size: 18px;
  }
  
  .related-list {
    grid-template-columns: 1fr;
  }
  
  .article-nav {
    grid-template-columns: 1fr;
  }
  
  .article-nav-next {
    text-align: left;
  }
  
  .article-meta {
    gap: 12px;
    font-size: 13px;
  }
}

@media (max-width: 575px) {
  .article-header h1 {
    font-size: 20px;
  }
  
  .article-body h2 {
    font-size: 18px;
  }
  
  .article-body h3 {
    font-size: 16px;
  }
}
