/* ==========================================================================
   新闻详情页样式
   风格与首页/列表页保持统一，主色 #00B4D8
   ========================================================================== */

.news-detail-page {
  min-height: calc(100vh - 280px);
  background-color: #f8fafc;
}

/* ----- 面包屑 ----- */
.news-detail__breadcrumb {
  background-color: #fff;
  padding: 16px 0;
  border-bottom: 1px solid #e2e8f0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #64748b;
  margin: 0;
  padding: 0;
  list-style: none;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: #64748b;
  text-decoration: none;
  transition: color 0.3s ease;
}

.breadcrumb a:hover {
  color: #00B4D8;
}

.breadcrumb__separator {
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
}

.breadcrumb__separator i {
  font-size: 12px;
}

.breadcrumb__current {
  color: #1e293b;
  font-weight: 500;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ----- 主内容区 ----- */
.news-detail__content {
  padding: 30px 0 60px;
}

.news-detail__layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 30px;
  align-items: start;
}

/* ----- 文章主体 ----- */
.news-detail__main {
  background-color: #fff;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  min-height: 400px;
}

/* 加载状态 */
.news-detail__main.is-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.news-detail__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: #94a3b8;
}

.news-detail__loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e2e8f0;
  border-top-color: #00B4D8;
  border-radius: 50%;
  animation: news-spin 0.8s linear infinite;
}

@keyframes news-spin {
  to { transform: rotate(360deg); }
}

/* 文章头部 */
.article__header {
  position: relative;
  margin-bottom: 30px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e2e8f0;
}

.article__category {
  display: inline-block;
  position: absolute;
  right: 0;
  top: 0;
  padding: 8px 24px;
  background-color: rgba(0, 180, 216, 0.1);
  color: #00B4D8;
  font-size: 14px;
  font-weight: 500;
  border-radius: 4px;
}

.article__title {
  font-size: 28px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.4;
  margin: 0 0 20px 0;
}

.article__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  font-size: 13px;
  color: #94a3b8;
}

.article__meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.article__meta-item i {
  font-size: 14px;
  color: #00B4D8;
}

.article__author {
  color: #475569;
  font-weight: 500;
}

/* 文章封面图 */
.article__cover {
  margin: 0 0 24px 0;
  border-radius: 8px;
  overflow: hidden;
}

.article__cover img {
  width: 100%;
  max-height: 450px;
  object-fit: cover;
  display: block;
}

.article__cover-caption {
  text-align: center;
  font-size: 13px;
  color: #94a3b8;
  margin-top: 10px;
  margin: 0;
}

/* 文章正文 - 阅读体验优化 */
.article__body {
  font-size: 16px;
  line-height: 1.85;
  color: #334155;
  word-break: break-word;
}

.article__body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 18px 0;
  display: block;
}

/*.article__body p {
  margin: 0 0 22px 0;
}

.article__body h2 {
  font-size: 22px;
  font-weight: 600;
  color: #1e293b;
  margin: 36px 0 16px 0;
  padding-left: 12px;
  border-left: 4px solid #00B4D8;
  line-height: 1.4;
}

.article__body h3 {
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
  margin: 28px 0 14px 0;
  line-height: 1.5;
}

!* 图片懒加载占位 *!
.article__body img[data-src] {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: news-loading-shimmer 1.5s infinite;
  min-height: 200px;
}

.article__body img.lazy-loaded {
  background: none;
  animation: none;
  min-height: auto;
}*/

@keyframes news-loading-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.article__body blockquote {
  margin: 24px 0;
  padding: 16px 24px;
  background-color: #f8fafc;
  border-left: 4px solid #00B4D8;
  color: #475569;
  font-style: normal;
  border-radius: 0 8px 8px 0;
}

.article__body blockquote p {
  margin: 0;
}

.article__body ul,
.article__body ol {
  margin: 0 0 22px 0;
  padding-left: 24px;
}

.article__body li {
  margin-bottom: 8px;
}

.article__body a {
  color: #00B4D8;
  text-decoration: none;
  border-bottom: 1px dashed #00B4D8;
  transition: all 0.3s ease;
}

.article__body a:hover {
  color: #0096C7;
  border-bottom-style: solid;
}

.article__body strong {
  color: #1e293b;
  font-weight: 600;
}

.article__body table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
}

.article__body th,
.article__body td {
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  text-align: left;
}

.article__body th {
  background-color: #f8fafc;
  font-weight: 600;
  color: #1e293b;
}

/* 文章底部：标签 + 分享 */
.article__footer {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid #e2e8f0;
}

.article__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.article__tags-label {
  font-size: 14px;
  color: #64748b;
  margin-right: 4px;
}

.article__tag {
  display: inline-block;
  padding: 4px 12px;
  background-color: #f1f5f9;
  color: #475569;
  font-size: 13px;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.article__tag:hover {
  background-color: rgba(0, 180, 216, 0.1);
  color: #00B4D8;
}

.article__share {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.article__share-label {
  font-size: 14px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.article__share-btns {
  display: flex;
  gap: 10px;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  color: #fff;
  font-size: 16px;
  transition: all 0.3s ease;
}

.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.share-btn--weixin { background-color: #07c160; }
.share-btn--weibo { background-color: #e6162d; }
.share-btn--qq { background-color: #12b7f5; }
.share-btn--link { background-color: #64748b; }

/* 上一篇/下一篇导航 */
.article__nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 30px;
}

.article__nav-item {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  background-color: #f8fafc;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.article__nav-item:hover {
  background-color: #fff;
  border-color: #00B4D8;
  box-shadow: 0 4px 12px rgba(0, 180, 216, 0.1);
}

.article__nav-item--next {
  text-align: right;
}

.article__nav-label {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.article__nav-item--next .article__nav-label {
  justify-content: flex-end;
}

.article__nav-title {
  font-size: 14px;
  color: #1e293b;
  font-weight: 500;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  transition: color 0.3s ease;
}

.article__nav-item:hover .article__nav-title {
  color: #00B4D8;
}

.article__nav-item--placeholder {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ----- 侧边栏 ----- */
.news-detail__sidebar {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar__back {
  background-color: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.sidebar__back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background-color: rgba(0, 180, 216, 0.08);
  color: #00B4D8;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.sidebar__back-btn:hover {
  background-color: #00B4D8;
  color: #fff;
}

.sidebar__block {
  background-color: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.sidebar__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 16px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.sidebar__title i {
  color: #00B4D8;
  font-size: 18px;
}

.sidebar__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar__list-item {
  padding: 10px 0;
  border-bottom: 1px dashed #e2e8f0;
}

.sidebar__list-item:last-child {
  border-bottom: none;
}

.sidebar__list-link {
  display: flex;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

.sidebar__list-link:hover {
  color: #00B4D8;
}

.sidebar__list-rank {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background-color: #e2e8f0;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
}

.sidebar__list-item:nth-child(1) .sidebar__list-rank,
.sidebar__list-item:nth-child(2) .sidebar__list-rank,
.sidebar__list-item:nth-child(3) .sidebar__list-rank {
  background-color: #00B4D8;
  color: #fff;
}

.sidebar__list-content {
  flex: 1;
  min-width: 0;
}

.sidebar__list-title {
  font-size: 13px;
  color: #334155;
  line-height: 1.5;
  margin: 0 0 4px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.3s ease;
}

.sidebar__list-link:hover .sidebar__list-title {
  color: #00B4D8;
}

.sidebar__list-date {
  font-size: 12px;
  color: #94a3b8;
}

/* ----- 错误状态 ----- */
.news-detail__error {
  padding: 60px 0;
}

.error-box {
  text-align: center;
  background-color: #fff;
  border-radius: 12px;
  padding: 60px 40px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.error-box__icon {
  font-size: 64px;
  color: #cbd5e1;
  margin-bottom: 20px;
}

.error-box__title {
  font-size: 24px;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 12px 0;
}

.error-box__desc {
  font-size: 14px;
  color: #64748b;
  margin: 0 0 30px 0;
}

.error-box__actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.error-box__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
}

.error-box__btn--primary {
  background-color: #00B4D8;
  color: #fff;
}

.error-box__btn--primary:hover {
  background-color: #0096C7;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 180, 216, 0.3);
}

.error-box__btn--default {
  background-color: #f1f5f9;
  color: #475569;
}

.error-box__btn--default:hover {
  background-color: #e2e8f0;
}

/* ----- 返回顶部 ----- */
.back-to-top {
  position: fixed;
  right: 30px;
  bottom: 30px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background-color: #00B4D8;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 180, 216, 0.4);
  z-index: 999;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background-color: #0096C7;
  transform: translateY(-4px);
}

/* ----- 响应式适配 ----- */
@media (max-width: 1200px) {
  .news-detail__layout {
    grid-template-columns: 1fr 280px;
    gap: 24px;
  }

  .news-detail__main {
    padding: 32px;
  }
}

@media (max-width: 992px) {
  .news-detail__layout {
    grid-template-columns: 1fr;
  }

  .news-detail__sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .sidebar__back {
    flex: 1 1 100%;
  }

  .sidebar__block {
    flex: 1 1 calc(50% - 10px);
    min-width: 280px;
  }
}

@media (max-width: 768px) {
  .news-detail__content {
    padding: 20px 0 40px;
  }

  .news-detail__main {
    padding: 24px 20px;
  }

  .article__title {
    font-size: 22px;
  }

  .article__body {
    font-size: 15px;
    line-height: 1.8;
  }

  .article__body h2 {
    font-size: 19px;
  }

  .article__body h3 {
    font-size: 17px;
  }

  .article__meta {
    gap: 12px;
    font-size: 12px;
  }

  .article__nav {
    grid-template-columns: 1fr;
  }

  .article__nav-item--next {
    text-align: left;
  }

  .article__nav-item--next .article__nav-label {
    justify-content: flex-start;
  }

  .news-detail__sidebar {
    flex-direction: column;
  }

  .sidebar__block {
    flex: 1 1 100%;
    min-width: 0;
  }

  .article__cover img {
    max-height: 260px;
  }

  .error-box {
    padding: 40px 20px;
  }

  .error-box__icon {
    font-size: 48px;
  }

  .error-box__title {
    font-size: 20px;
  }

  .back-to-top {
    right: 20px;
    bottom: 20px;
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .breadcrumb__current {
    max-width: 180px;
  }

  .article__share {
    flex-direction: column;
    align-items: flex-start;
  }
}
