/* ========== 文章详情页专用样式 ========== */

/* 主体内容区域 */
main {
  padding-top: 30px;
  padding-bottom: 60px;
}

/* 面包屑导航 */
.breadcrumb-wrapper {
  margin-bottom: 30px;
  animation: fadeInDown 0.6s ease-out;
}

.breadcrumb {
  background: white;
  padding: 16px 24px;
  margin-bottom: 0;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.breadcrumb-item {
  font-size: 0.95rem;
}

.breadcrumb-item a {
  color: var(--text-gray);
  text-decoration: none;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.breadcrumb-item a:hover {
  color: var(--ai-blue);
  transform: translateX(2px);
}

.breadcrumb-item.active {
  color: var(--text-dark);
  font-weight: 600;
}

/* ========== 文章头部卡片 ========== */
.article-header-card {
  background: white;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.6s ease-out 0.1s backwards;
}

.article-header-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--ai-gradient);
}

.article-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(124, 58, 237, 0.1));
  color: var(--ai-blue);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.article-title {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text-dark);
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

.article-meta-info {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  color: var(--text-gray);
  font-size: 0.95rem;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.3s;
}

.meta-item:hover {
  color: var(--ai-blue);
}

.meta-item i {
  font-size: 1.1rem;
}

/* ========== 文章摘要 ========== */
.article-summary {
  background: linear-gradient(135deg, #f0f9ff, #faf5ff);
  padding: 16px 20px;
  border-radius: 10px;
  margin-bottom: 24px;
  border-left: 4px solid var(--ai-blue);
  position: relative;
  animation: fadeInUp 0.6s ease-out 0.2s backwards;
}

.quote-icon {
  position: absolute;
  top: 14px;
  left: 20px;
  font-size: 1rem;
  color: var(--ai-blue);
  opacity: 0.3;
}

.article-summary p {
  margin: 0 0 0 24px;
  color: var(--text-gray);
  font-size: 0.9rem;
  line-height: 1.6;
  font-style: italic;
  max-height: 4.8em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* ========== 文章内容 ========== */
.article-content {
  background: white;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  color: var(--text-dark);
  font-size: 1.06rem;
  line-height: 1.9;
  margin-bottom: 24px;
  animation: fadeInUp 0.6s ease-out 0.3s backwards;
}

.article-content h2 {
  font-size: 1.9rem;
  font-weight: 700;
  margin: 48px 0 24px;
  color: var(--ai-blue);
  padding-left: 20px;
  border-left: 5px solid var(--ai-blue);
  line-height: 1.4;
}

.article-content h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 36px 0 20px;
  color: var(--ai-purple);
  padding-left: 16px;
  border-left: 4px solid var(--ai-purple);
}

.article-content h4 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 28px 0 16px;
  color: var(--text-dark);
}

.article-content p {
  margin-bottom: 20px;
  text-align: justify;
}

.article-content strong {
  color: var(--ai-blue);
  font-weight: 700;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 32px auto;
  display: block;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  transition: all 0.4s ease;
}

.article-content img:hover {
  transform: scale(1.02);
  box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.article-content ul,
.article-content ol {
  margin: 20px 0 28px 28px;
  padding-left: 20px;
}

.article-content li {
  margin-bottom: 12px;
  line-height: 1.9;
}

.article-content ul li::marker {
  color: var(--ai-blue);
  font-size: 1.2em;
}

.article-content ol li::marker {
  color: var(--ai-purple);
  font-weight: 700;
}

.article-content a {
  color: var(--ai-blue);
  text-decoration: underline;
  font-weight: 600;
  transition: all 0.3s;
}

.article-content a:hover {
  color: var(--ai-purple);
  text-decoration: none;
}

.article-content blockquote {
  background: linear-gradient(135deg, #f0f9ff, #faf5ff);
  border-left: 4px solid var(--ai-gradient);
  padding: 24px 28px;
  margin: 28px 0;
  border-radius: 8px;
  font-style: italic;
  color: var(--text-gray);
  position: relative;
}

.article-content code {
  background: #f1f5f9;
  padding: 3px 10px;
  border-radius: 5px;
  font-family: 'Courier New', monospace;
  color: var(--ai-purple);
  font-size: 0.92em;
}

.article-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 24px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 28px 0;
  line-height: 1.6;
}

.article-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* ========== 文章标签 ========== */
.article-tags {
  background: white;
  padding: 24px 32px;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  animation: fadeInUp 0.6s ease-out 0.4s backwards;
}

.article-tags i {
  color: var(--ai-blue);
  font-size: 1.2rem;
}

.tag-item {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(124, 58, 237, 0.08));
  color: var(--ai-blue);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s;
  cursor: pointer;
}

.tag-item:hover {
  background: var(--ai-gradient);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* ========== 文章分享 ========== */
.article-share {
  background: white;
  padding: 24px 32px;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: fadeInUp 0.6s ease-out 0.5s backwards;
}

.share-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-dark);
}

.share-label i {
  color: var(--ai-blue);
  font-size: 1.2rem;
}

.share-buttons {
  display: flex;
  gap: 12px;
}

.share-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.3s;
  text-decoration: none;
}

.share-wechat {
  background: #07C160;
  color: white;
}

.share-weibo {
  background: #E6162D;
  color: white;
}

.share-qq {
  background: #12B7F5;
  color: white;
}

.share-link {
  background: #64748b;
  color: white;
}

.share-btn:hover {
  transform: translateY(-3px) scale(1.1);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* ========== 分页导航 ========== */
.pagination-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
  animation: fadeInUp 0.6s ease-out 0.6s backwards;
}

.nav-prev,
.nav-next {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  overflow: hidden;
  transition: all 0.3s;
}

.nav-prev:hover,
.nav-next:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.nav-prev a,
.nav-next a,
.nav-disabled {
  display: flex;
  flex-direction: column;
  padding: 20px 24px;
  text-decoration: none;
  gap: 8px;
}

.nav-label {
  font-size: 0.85rem;
  color: var(--text-gray);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-title {
  color: var(--text-dark);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nav-prev a:hover .nav-title,
.nav-next a:hover .nav-title {
  color: var(--ai-blue);
}

.nav-next {
  text-align: right;
}

.nav-next a,
.nav-next .nav-disabled {
  align-items: flex-end;
}

.nav-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========== 返回按钮 ========== */
.back-button-wrapper {
  animation: fadeInUp 0.6s ease-out 0.7s backwards;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  color: var(--text-dark);
  padding: 14px 32px;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transition: all 0.3s;
  border: 2px solid var(--border);
}

.btn-back:hover {
  background: var(--ai-gradient);
  color: white;
  border-color: transparent;
  transform: translateX(-5px);
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.3);
}

/* ========== 侧边栏卡片 ========== */
.sidebar-card {
  background: white;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  margin-bottom: 24px;
  animation: fadeInUp 0.6s ease-out 0.3s backwards;
}

/* 侧边栏容器固定 - 关键修复 */
aside .sidebar-wrapper {
  position: -webkit-sticky;
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  overflow-x: hidden;
  /* 隐藏滚动条但保持功能 */
  scrollbar-width: thin;
  scrollbar-color: rgba(37, 99, 235, 0.3) transparent;
}

aside .sidebar-wrapper::-webkit-scrollbar {
  width: 6px;
}

aside .sidebar-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

aside .sidebar-wrapper::-webkit-scrollbar-thumb {
  background: rgba(37, 99, 235, 0.3);
  border-radius: 3px;
}

aside .sidebar-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(37, 99, 235, 0.5);
}

.sidebar-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
}

.sidebar-title i {
  color: var(--ai-blue);
  font-size: 1.3rem;
}

/* ========== 作者信息卡片 ========== */
.author-card {
  text-align: center;
}

.author-avatar {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  background: var(--ai-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: white;
}

.author-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.author-desc {
  color: var(--text-gray);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.author-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.stat {
  text-align: center;
}

.stat strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--ai-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 4px;
}

.stat span {
  font-size: 0.85rem;
  color: var(--text-gray);
}

/* ========== 相关文章列表 ========== */
.related-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.related-list li {
  margin-bottom: 0;
}

.related-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: var(--text-dark);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s;
  margin-bottom: 8px;
  background: linear-gradient(90deg, transparent, transparent);
}

.related-index {
  width: 28px;
  height: 28px;
  background: var(--ai-gradient);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.related-title {
  flex: 1;
  font-weight: 500;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-list a i {
  color: var(--ai-blue);
  opacity: 0;
  transition: opacity 0.3s;
}

.related-list a:hover {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.08), transparent);
  transform: translateX(4px);
}

.related-list a:hover i {
  opacity: 1;
}

.empty-text {
  color: var(--text-gray);
  text-align: center;
  padding: 20px 0;
  font-style: italic;
}

/* ========== 热门标签 ========== */
.hot-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hot-tag {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(124, 58, 237, 0.08));
  color: var(--ai-blue);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s;
}

.hot-tag:hover {
  background: var(--ai-gradient);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* ========== 动画效果 ========== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== 响应式设计 ========== */
@media (max-width: 992px) {
  .article-title {
    font-size: 2rem;
  }

  .article-content,
  .article-header-card {
    padding: 28px;
  }

  .sidebar-card {
    margin-top: 20px;
  }

  aside .sidebar-wrapper {
    position: static;
  }

  .pagination-nav {
    grid-template-columns: 1fr;
  }

  .nav-next {
    text-align: left;
  }

  .nav-next a,
  .nav-next .nav-disabled {
    align-items: flex-start;
  }

  .article-share {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  main {
    padding-top: 20px;
  }

  .breadcrumb {
    padding: 12px 16px;
  }

  .article-title {
    font-size: 1.7rem;
  }

  .article-content,
  .article-header-card {
    padding: 20px;
    font-size: 1rem;
  }

  .article-content h2 {
    font-size: 1.6rem;
    margin: 32px 0 16px;
  }

  .article-content h3 {
    font-size: 1.3rem;
  }

  .article-meta-info {
    gap: 16px;
    font-size: 0.85rem;
  }

  .sidebar-card {
    padding: 20px;
  }

  .article-tags,
  .article-share {
    padding: 16px 20px;
  }

  .share-buttons {
    width: 100%;
    justify-content: space-around;
  }
}

@media (max-width: 576px) {
  .article-title {
    font-size: 1.5rem;
  }

  .article-content,
  .article-header-card {
    padding: 16px;
  }

  .article-meta-info {
    gap: 12px;
  }

  .meta-item {
    font-size: 0.8rem;
  }

  .breadcrumb {
    font-size: 0.85rem;
  }

  .nav-prev a,
  .nav-next a,
  .nav-disabled {
    padding: 16px 20px;
  }

  .btn-back {
    width: 100%;
    justify-content: center;
  }
}
