/* ============================================
   文章详情页专属样式
   注意：此文件依赖全局 style.css，需在其之后引入
   ============================================ */

/* 文章内容容器 */
.article-detail {
  background: #fff;
  border-radius: 18px;
  padding: 0.2rem 0 1rem 0;
}

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

.article-header .post-date {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: #8a8a8a;
  margin-bottom: 0.5rem;
}

.article-header h1 {
  font-size: 1.9rem;
  font-weight: 520;
  letter-spacing: -0.3px;
  line-height: 1.25;
  color: #111;
  margin-bottom: 1rem;
}

/* ============================================
   文章正文排版
   ============================================ */
.article-content {
  font-size: 1rem;
  color: #2c2c2c;
  line-height: 1.65;
}

.article-content h2 {
  font-size: 1.45rem;
  font-weight: 520;
  margin: 1.6rem 0 0.6rem 0;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid #efefef;
}

.article-content h3 {
  font-size: 1.2rem;
  font-weight: 500;
  margin: 1.3rem 0 0.5rem 0;
}

.article-content p {
  margin-bottom: 1rem;
}

.article-content ul,
.article-content ol {
  margin: 0.8rem 0 1rem 1.5rem;
}

.article-content li {
  margin-bottom: 0.4rem;
}

/* 行内代码 */
.article-content code {
  background: #f4f4f4;
  padding: 0.2rem 0.4rem;
  border-radius: 8px;
  font-family: 'SF Mono', 'JetBrains Mono', monospace;
  font-size: 0.88em;
  color: #d14;
}

/* 代码块 */
.article-content pre {
  background: #f8f8f8;
  padding: 1rem;
  border-radius: 16px;
  overflow-x: auto;
  font-size: 0.85rem;
  margin: 1rem 0;
  border: 1px solid #eee;
}

.article-content pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

/* 引用块 */
.article-content blockquote {
  border-left: 4px solid #ccc;
  background: #fafafa;
  padding: 0.7rem 1rem;
  margin: 1rem 0;
  color: #555;
  font-style: normal;
  border-radius: 0 12px 12px 0;
}

/* ============================================
   表格（支持水平滚动）
   ============================================ */
.article-content .table-wrapper {
  overflow-x: auto;
  margin: 1rem 0;
  border-radius: 12px;
  border: 1px solid #eee;
}

.article-content table {
  width: 100%;
  min-width: 500px;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.article-content th,
.article-content td {
  border: 1px solid #e0e0e0;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.article-content th {
  background: #f5f5f5;
  font-weight: 600;
}

/* ============================================
   警告/提示框
   ============================================ */
.warning-note {
  background: #fff6e5;
  border-left: 4px solid #e9b35f;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  margin: 1.4rem 0;
}

/* ============================================
   返回首页链接
   ============================================ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 1.5rem 0 0.8rem;
  font-size: 0.85rem;
}

.back-link a {
  color: #555;
  text-decoration: none;
  border-bottom: 1px solid #ddd;
  transition: 0.2s;
}

.back-link a:hover {
  color: #000;
  border-bottom-color: #000;
}

/* ============================================
   外部链接样式
   ============================================ */
.article-content a[href*="://"]:not([href*="localhost"]) {
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg>') no-repeat right center;
  background-size: 12px;
  padding-right: 18px;
  transition: opacity 0.2s ease;
}

.article-content a[href*="://"]:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* ============================================
   移动端适配
   ============================================ */
@media (max-width: 500px) {
  .article-header h1 {
    font-size: 1.6rem;
  }
  
  .article-content table {
    min-width: 460px;
    font-size: 0.8rem;
  }
  
  .article-content th,
  .article-content td {
    padding: 8px 10px;
  }
}