/*
 * =======================================
 *  article.css — 文章详情页独有样式
 *  依赖：base.css（全局变量 + 通用组件 + 响应式基础）
 * =======================================
 */

/* ===== Article Page Layout ===== */
.article-page { padding: 48px 0 80px; }
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
}

/* ===== Article Main Card ===== */
.article-main {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(0, 47, 95, 0.06);
  overflow: hidden;
}
.article-hero {
  width: 100%;
  height: 400px;
  overflow: hidden;
  position: relative;
}
.article-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.article-hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 48px 32px;
  background: linear-gradient(to top, rgba(0, 47, 95, 0.92) 0%, rgba(0, 80, 165, 0.5) 60%, transparent 100%);
}
.article-hero-overlay .tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 4px;
  background: rgba(223, 76, 54, 0.12);
  color: var(--gold-400);
  margin-bottom: 12px;
  border: 1px solid rgba(223, 76, 54, 0.25);
}

/* ===== Article Header ===== */
.article-body { padding: 40px 48px; }
.article-header {
  margin-bottom: 36px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--gray-100);
}
.article-header h1 {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.5vw, 32px);
  font-weight: 700;
  color: var(--navy-800);
  line-height: 1.4;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
}
.article-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--gray-500);
}
.article-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.article-meta-item svg {
  width: 16px;
  height: 16px;
  color: var(--gray-400);
}

/* ===== Article Content ===== */
.article-content {
  font-size: 16px;
  line-height: 2;
  color: var(--gray-700);
}
.article-content p { margin-bottom: 20px; text-indent: 2em; }
.article-content h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--navy-800);
  margin: 36px 0 20px;
  padding-left: 16px;
  border-left: 4px solid;
  border-image: linear-gradient(180deg, var(--gold-500), var(--navy-500)) 1;
  text-indent: 0;
}
.article-content h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy-800);
  margin: 28px 0 16px;
  text-indent: 0;
}
.article-content blockquote {
  margin: 24px 0;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--navy-50), var(--gold-100));
  border-left: 4px solid;
  border-image: linear-gradient(180deg, var(--gold-500), var(--navy-500)) 1;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  text-indent: 0;
  font-style: italic;
  color: var(--gray-600);
}
.article-content img {
  border-radius: var(--radius-md);
  margin: 16px 0;
  text-indent: 0;
  display: block;
  max-width: 100%;
  width: 100%;
  height: auto;
  margin-left: auto;
  margin-right: auto;
}
.article-content figure {
  margin: 24px 0;
  text-indent: 0;
}
.article-content figcaption {
  font-size: 13px;
  color: var(--gray-400);
  text-align: center;
  margin-top: 8px;
}
.article-content ul,
.article-content ol {
  margin: 16px 0 20px 2em;
  text-indent: 0;
}
.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }
.article-content li { margin-bottom: 8px; }

/* ===== Tags & Share ===== */
.article-footer {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--gray-100);
}
.article-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}
.article-tags .label {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-600);
}
.article-tags a {
  font-size: 13px;
  padding: 4px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 100px;
  color: var(--gray-500);
  transition: all var(--transition-fast);
}
.article-tags a:hover {
  background: linear-gradient(135deg, var(--navy-50), var(--gold-100));
  border-color: var(--navy-200);
  color: var(--navy-600);
}
.article-share {
  display: flex;
  align-items: center;
  gap: 12px;
}
.article-share .label {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-600);
}
.share-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: transparent;
  color: var(--gray-500);
  font-size: 16px;
}
.share-btn:hover {
  border-color: var(--navy-300);
  color: var(--navy-600);
  background: var(--navy-50);
}

/* ===== Article Nav (Prev/Next) ===== */
.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--gray-100);
}
.article-nav a {
  padding: 16px;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}
.article-nav a:hover {
  border-color: var(--navy-200);
  background: linear-gradient(135deg, var(--navy-50), transparent);
}
.article-nav .nav-label {
  font-size: 12px;
  color: var(--gray-400);
  margin-bottom: 6px;
}
.article-nav .nav-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy-700);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-nav .nav-next { text-align: right; }

/* ===== Article Sidebar ===== */
.article-sidebar {
  position: sticky;
  top: 120px;
  align-self: start;
}
.sidebar-widget {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 2px 16px rgba(0, 47, 95, 0.06);
  margin-bottom: 20px;
  border: 1px solid var(--navy-100);
}
.sidebar-widget h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy-800);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid;
  border-image: linear-gradient(90deg, var(--gold-500), var(--navy-500)) 1;
}
.sidebar-widget .toc-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-widget .toc-list a {
  display: block;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--gray-600);
  border-left: 2px solid var(--gray-200);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transition: all var(--transition-fast);
}
.sidebar-widget .toc-list a:hover {
  background: linear-gradient(90deg, var(--navy-50), transparent);
  color: var(--navy-600);
  border-left-color: var(--navy-400);
}
.sidebar-widget .toc-list a.active {
  color: var(--gold-600);
  font-weight: 600;
  border-left-color: var(--gold-500);
  background: linear-gradient(90deg, #FDE0DA, #fff7ed);
}
.related-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.related-item {
  display: flex;
  gap: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 4px;
  border-radius: var(--radius-sm);
}
.related-item:hover { background: var(--navy-50); }
.related-item-img {
  flex-shrink: 0;
  width: 72px;
  height: 48px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.related-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.related-item-title {
  font-size: 13px;
  color: var(--gray-700);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.related-item-date {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 4px;
}

/* ===== Reading Progress Bar ===== */
.reading-progress {
  position: fixed;
  top: 72px;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-500), var(--navy-500), var(--navy-400), #06b6d4);
  z-index: 95;
  transition: width 0.1s;
  width: 0;
}

/* Back to Top 样式已统一至 base.css */

/* ==========================================================================
 *  RESPONSIVE — 文章详情页独有布局
 *  全局组件（header/footer/container）响应式规则已在 base.css 中定义
 * ========================================================================== */

/* --- Tablet: <= 1024px --- */
@media (max-width: 1024px) {
  .article-layout {
    grid-template-columns: 1fr 240px;
    gap: 32px;
  }
  .article-hero { height: 320px; }
  .article-body { padding: 32px; }
}

/* --- Mobile: <= 768px --- */
@media (max-width: 768px) {
  .article-page { padding: 28px 0 48px; }

  /* Single column */
  .article-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .article-sidebar {
    position: static;
    margin-top: 32px;
  }

  /* Article hero */
  .article-hero { height: 220px; }
  .article-hero-overlay {
    padding: 24px 20px 16px;
  }

  /* Article body */
  .article-body { padding: 24px 20px; }
  .article-header h1 { font-size: 20px; }
  .article-meta { gap: 12px; font-size: 12px; }

  /* Article content */
  .article-content { font-size: 15px; line-height: 1.9; }
  .article-content h2 { font-size: 18px; margin: 28px 0 16px; padding-left: 12px; }
  .article-content h3 { font-size: 16px; }
  .article-content blockquote { padding: 16px; margin: 20px 0; }

  /* Tags & share */
  .article-tags { gap: 8px; }
  .article-share { gap: 8px; }

  /* Article nav (prev/next) */
  .article-nav {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .article-nav .nav-next { text-align: left; }

  /* Reading progress */
  .reading-progress { top: 60px; }

  /* Back to top 尺寸调整见 base.css 响应式部分 */
}

/* --- Small Mobile: <= 480px --- */
@media (max-width: 480px) {
  .article-hero { height: 180px; }
  .article-body { padding: 20px 16px; }
  .article-header h1 { font-size: 18px; }
  .article-content h2 { font-size: 17px; }
}
