/* ============================================
   AI科技前沿 — 文章详情页样式
   ============================================ */

/* ===== Loading ===== */
.article-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 16px;
  color: var(--text-secondary);
}

.article-loading__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Error ===== */
.article-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 12px;
  text-align: center;
}

.article-error__icon {
  font-size: 4rem;
  opacity: 0.5;
}

.article-error h2 {
  font-size: 1.5rem;
  color: var(--text-primary);
}

.article-error p {
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* ===== Breadcrumb ===== */
.article-breadcrumb {
  padding: 100px 0 16px;
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

.article-breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.article-breadcrumb a:hover {
  color: var(--accent-cyan);
}

.article-breadcrumb__sep {
  margin: 0 8px;
  opacity: 0.5;
}

/* ===== Article Header ===== */
.article-header {
  padding: 16px 0 32px;
}

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

.article-header__cat {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.2);
}

.article-header__badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-orange);
  background: rgba(255, 107, 53, 0.1);
  border: 1px solid rgba(255, 107, 53, 0.2);
}

.article-header__title {
  font-size: 2rem;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: 16px;
  font-weight: 700;
}

.article-header__excerpt {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.article-header__meta {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

.article-header__date::before {
  content: "📅 ";
}

.article-header__reads::before {
  content: "👁 ";
}

.article-header__share {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.article-header__share:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.05);
}

/* ===== Hero Image ===== */
.article-hero {
  width: 100%;
  max-width: 900px;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  border-radius: 12px;
  margin: 0 auto 40px;
}

/* ===== Article Body ===== */
.article-body-wrapper {
  padding-bottom: 60px;
}

.article-body {
  max-width: 800px;
  margin: 0 auto;
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text-secondary);
}

/* Markdown 渲染样式 */
.article-body h2 {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin: 36px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}

.article-body h3 {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin: 28px 0 12px;
  font-weight: 600;
}

.article-body h4 {
  font-size: 1.05rem;
  color: var(--text-primary);
  margin: 20px 0 8px;
  font-weight: 600;
}

.article-body p {
  margin-bottom: 16px;
}

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

.article-body li {
  margin-bottom: 8px;
}

.article-body ul li::marker {
  color: var(--accent-cyan);
}

.article-body ol li::marker {
  color: var(--accent-cyan);
  font-weight: 600;
}

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

.article-body a {
  color: var(--accent-cyan);
  text-decoration: none;
  border-bottom: 1px dashed rgba(0, 212, 255, 0.3);
  transition: border-color 0.2s;
}

.article-body a:hover {
  border-bottom-color: var(--accent-cyan);
}

.article-body blockquote {
  margin: 16px 0;
  padding: 12px 20px;
  border-left: 3px solid var(--accent-cyan);
  background: rgba(0, 212, 255, 0.05);
  border-radius: 0 8px 8px 0;
  color: var(--text-secondary);
}

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

.article-body code {
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 0.9em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 212, 255, 0.1);
  color: var(--accent-cyan);
}

.article-body pre {
  margin: 16px 0;
  padding: 16px 20px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  overflow-x: auto;
}

.article-body pre code {
  background: none;
  color: var(--text-primary);
  padding: 0;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.9rem;
}

.article-body th {
  text-align: left;
  padding: 10px 14px;
  background: rgba(0, 212, 255, 0.08);
  color: var(--text-primary);
  font-weight: 600;
  border-bottom: 2px solid var(--border);
}

.article-body td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.article-body tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

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

.article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}

/* ===== Article Footer ===== */
.article-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

/* ===== Related Articles ===== */
.article-related {
  margin-top: 48px;
}

.article-related__title {
  font-size: 1.3rem;
  color: var(--text-primary);
  margin-bottom: 20px;
  font-weight: 700;
}

.article-related__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.related-card {
  display: block;
  text-decoration: none;
  border-radius: 10px;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--border);
  transition: transform 0.3s, border-color 0.3s;
}

.related-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-cyan);
}

.related-card__img {
  width: 100%;
  height: 140px;
  background-size: cover;
  background-position: center;
}

/* 技能相关卡片：无图片时以 emoji 图标展示 */
.related-card__img--icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.12), rgba(124, 77, 255, 0.12));
}

.related-card__body {
  padding: 14px 16px;
}

.related-card__cat {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

.related-card__title {
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-top: 6px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-card__date {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 8px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .article-header__title {
    font-size: 1.4rem;
  }

  .article-header__excerpt {
    font-size: 0.95rem;
  }

  .article-hero {
    border-radius: 8px;
  }

  .article-body {
    font-size: 0.95rem;
  }

  .article-body h2 {
    font-size: 1.25rem;
  }

  .article-body h3 {
    font-size: 1.1rem;
  }

  .article-related__grid {
    grid-template-columns: 1fr;
  }

  .article-footer {
    flex-direction: column;
    gap: 12px;
  }

  .article-breadcrumb {
    padding-top: 80px;
  }
}

@media (max-width: 420px) {
  .article-header__title {
    font-size: 1.2rem;
  }

  .article-header__meta {
    gap: 12px;
  }
}
