/* article.css - 文章详情排版（技术文库/新闻动态页加载） */

/* ===== 文章页布局 ===== */
.article-page {
  padding: 40px 0 60px;
}

.article-main {
  width: calc(70% - 30px);
  margin-right: 30px;
  float: left;
}

.article-sidebar {
  width: 30%;
  float: right;
}

.article-wrap {
  background: #fff;
  border-radius: 10px;
  padding: 40px;
  box-shadow: 0 2px 12px rgba(47, 27, 61, 0.06);
}

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

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

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

.article-meta span {
  margin-right: 20px;
}

.article-meta .category {
  display: inline-block;
  padding: 3px 12px;
  background-color: rgba(0, 217, 192, 0.1);
  color: var(--secondary);
  border-radius: 20px;
}

/* ===== 文章正文 ===== */
.article-content {
  font-size: 15px;
  line-height: 1.9;
  color: var(--text-dark);
}

.article-content h2 {
  font-size: 20px;
  color: var(--primary);
  margin: 35px 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.article-content h3 {
  font-size: 17px;
  color: var(--primary);
  margin: 25px 0 12px;
}

.article-content p {
  margin-bottom: 18px;
  line-height: 1.9;
}

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

.article-content ul li {
  list-style: disc;
  margin-bottom: 8px;
  line-height: 1.8;
}

.article-content ol li {
  list-style: decimal;
  margin-bottom: 8px;
  line-height: 1.8;
}

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

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

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

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

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

.article-content table {
  margin: 20px 0;
  border: 1px solid var(--border-color);
}

.article-content table th {
  background: var(--page-bg);
  padding: 12px 15px;
  font-weight: 600;
  text-align: left;
  border-bottom: 2px solid var(--border-color);
}

.article-content table td {
  padding: 10px 15px;
  border-bottom: 1px solid var(--border-color);
}

.article-content table tr:nth-child(even) {
  background: rgba(245, 243, 247, 0.5);
}

/* ===== 文章底部 ===== */
.article-footer {
  margin-top: 40px;
  padding-top: 25px;
  border-top: 1px solid var(--border-color);
}

.article-tags {
  margin-bottom: 20px;
}

.article-tags .tag-label {
  font-size: 14px;
  color: var(--text-gray);
  margin-right: 10px;
}

/* 相关文章 */
.related-articles {
  margin-top: 35px;
}

.related-articles h3 {
  font-size: 18px;
  color: var(--primary);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--secondary);
  display: inline-block;
}

.related-list {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-wrap: wrap;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  margin: 0 -10px;
}

.related-item {
  width: calc(50% - 20px);
  margin: 0 10px 15px;
  padding: 15px;
  background: var(--page-bg);
  border-radius: 6px;
  transition: var(--transition);
}

.related-item:hover {
  background: rgba(0, 217, 192, 0.05);
}

.related-item a {
  color: var(--text-dark);
  font-size: 14px;
}

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

.related-item .date {
  font-size: 12px;
  color: var(--text-gray);
  margin-top: 5px;
}

/* ===== 侧边栏 ===== */
.sidebar-section {
  margin-bottom: 25px;
}

.sidebar-section h3 {
  font-size: 16px;
  color: var(--primary);
  padding-bottom: 12px;
  border-bottom: 2px solid var(--secondary);
  margin-bottom: 15px;
}

.hot-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  counter-increment: hot-item;
}

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

.hot-list li a {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: start;
  -webkit-align-items: flex-start;
  -ms-flex-align: start;
  align-items: flex-start;
  color: var(--text-dark);
  font-size: 14px;
}

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

.hot-num {
  width: 22px;
  height: 22px;
  background: var(--page-bg);
  border-radius: 4px;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-gray);
  margin-right: 10px;
  -webkit-flex-shrink: 0;
  -ms-flex-negative: 0;
  flex-shrink: 0;
}

.hot-list li:nth-child(1) .hot-num,
.hot-list li:nth-child(2) .hot-num,
.hot-list li:nth-child(3) .hot-num {
  background: var(--secondary);
  color: var(--dark-bg);
}

/* ===== TAG页样式 ===== */
.tag-page .article-list {
  background: #fff;
  border-radius: 10px;
  padding: 30px;
  box-shadow: 0 2px 12px rgba(47, 27, 61, 0.06);
}

.tag-page .list-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--border-color);
}

.tag-page .list-item:last-child {
  border-bottom: none;
}

.tag-page .list-item h3 {
  font-size: 17px;
  margin-bottom: 8px;
}

.tag-page .list-item h3 a {
  color: var(--primary);
}

.tag-page .list-item h3 a:hover {
  color: var(--secondary);
}

.tag-page .list-item .desc {
  font-size: 14px;
  color: var(--text-gray);
  line-height: 1.7;
  margin-bottom: 8px;
}

.tag-page .list-item .meta {
  font-size: 12px;
  color: var(--text-gray);
}

.tag-page .list-item .meta a {
  color: var(--secondary);
}

/* ===== 响应式 ===== */
@media (max-width: 991px) {
  .article-main {
    width: 100%;
    margin-right: 0;
    float: none;
  }

  .article-sidebar {
    width: 100%;
    float: none;
    margin-top: 30px;
  }

  .article-wrap {
    padding: 25px;
  }

  .article-header h1 {
    font-size: 20px;
  }

  .related-item {
    width: calc(100% - 20px);
  }
}

@media (max-width: 767px) {
  .article-wrap {
    padding: 20px;
  }

  .article-content h2 {
    font-size: 18px;
  }

  .article-content h3 {
    font-size: 16px;
  }
}
