/* =============================================================================
   详情页面特有样式
============================================================================= */

/* 详情页面布局和样式复用博客页面的基础样式 */
/* 这个文件可以扩展详情页面特有的样式 */

/* 移动端导航栏 */
.mobile-nav {
  display: none;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-bottom: 16px;
  overflow: hidden;
}

.mobile-nav-item {
  border-bottom: 1px solid #f5f5f5;
}

.mobile-nav-item:last-child {
  border-bottom: none;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  padding: 16px;
  text-decoration: none;
  color: #333;
  transition: background-color 0.3s ease;
}

.mobile-nav-link:hover {
  background-color: #f8f9ff;
  color: #1890ff;
}

.mobile-nav-link i {
  margin-right: 12px;
  font-size: 16px;
  color: #1890ff;
  width: 20px;
}

.mobile-nav-link span {
  font-size: 15px;
  font-weight: 500;
}

/* 移动端相关文章推荐 */
.mobile-related-articles {
  display: none;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-top: 16px;
  overflow: hidden;
}

.mobile-section-title {
  padding: 16px;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #222;
  border-bottom: 1px solid #f5f5f5;
  background: #f8f9ff;
}

.mobile-article-list {
  padding: 0;
}

.mobile-article-item {
  display: flex;
  align-items: center;
  padding: 16px;
  text-decoration: none;
  color: #333;
  border-bottom: 1px solid #f5f5f5;
  transition: background-color 0.3s ease;
}

.mobile-article-item:last-child {
  border-bottom: none;
}

.mobile-article-item:hover {
  background-color: #f8f9ff;
}

.mobile-article-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #ede9fe;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
}

.mobile-article-icon i {
  font-size: 18px;
  color: #1890ff;
}

.mobile-article-content {
  flex: 1;
}

.mobile-article-content h4 {
  margin: 0 0 4px 0;
  font-size: 15px;
  font-weight: 600;
  color: #222;
  line-height: 1.3;
}

.mobile-article-content p {
  margin: 0;
  font-size: 12px;
  color: #666;
}

.mobile-article-arrow {
  font-size: 14px;
  color: #ccc;
  margin-left: 8px;
}

/* 移动端联系客服按钮 */
.mobile-contact-btn {
  display: none;
  position: fixed;
  bottom: 120px;
  right: 16px;
  z-index: 1000;
}

.mobile-contact-btn a {
  display: flex;
  align-items: center;
  background: #1890ff;
  color: #fff;
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 25px;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.mobile-contact-btn a:hover {
  background: #5b21b6;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.4);
}

.mobile-contact-btn i {
  margin-right: 6px;
  font-size: 16px;
}

/* 移动端返回按钮 */
.mobile-back-btn {
  display: none;
  position: fixed;
  bottom: 90px;
  right: 16px;
  z-index: 1001;
}

.mobile-back-btn a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: #1890ff;
  color: #fff;
  text-decoration: none;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
  transition: all 0.3s ease;
}

.mobile-back-btn a:hover {
  background: #5b21b6;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.4);
}

.mobile-back-btn i {
  font-size: 18px;
}

.detail-content {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 32px;
  margin-bottom: 24px;
}

.detail-title {
  font-size: 24px;
  font-weight: 700;
  color: #222;
  margin-bottom: 16px;
  line-height: 1.4;
}

.detail-meta {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f3f3f3;
  color: #666;
  font-size: 14px;
}

.detail-meta .meta-item {
  display: flex;
  align-items: center;
  margin-right: 24px;
}

.detail-meta .meta-item i {
  margin-right: 6px;
}

.detail-body {
  line-height: 1.8;
  font-size: 16px;
  color: #444;
}

.detail-body h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 24px 0 16px 0;
  color: #222;
}

.detail-body h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 20px 0 12px 0;
  color: #222;
}

.detail-body p {
  margin-bottom: 16px;
}

.detail-body ul,
.detail-body ol {
  margin: 16px 0;
  padding-left: 24px;
}

.detail-body li {
  margin-bottom: 8px;
}

.detail-body code {
  background: #f5f5f5;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
}

.detail-body pre {
  background: #f8f8f8;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 16px 0;
}

.detail-body blockquote {
  border-left: 4px solid #1890ff;
  padding: 12px 16px;
  background: #f8f9ff;
  margin: 16px 0;
  color: #555;
}

.detail-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 16px 0;
}

/* 相关文章推荐 */
.related-articles {
  margin-top: 32px;
}

.related-title {
  font-size: 18px;
  font-weight: 600;
  color: #222;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #1890ff;
  display: inline-block;
}

/* 返回顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: #1890ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: #5b21b6;
  transform: scale(1.1);
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .main-row {
    display: block;
  }

  .col-left {
    width: 100%;
    margin-bottom: 20px;
  }

  .col-right {
    width: 100%;
  }
}

@media (max-width: 768px) {

  /* 隐藏所有非必要元素，只显示文章内容 */
  .mobile-nav {
    display: none;
  }

  .mobile-related-articles {
    display: none;
  }

  .mobile-contact-btn {
    display: none;
  }

  .col-left {
    display: none;
  }

  /* 隐藏分享卡片 */
  .col-right .n-card {
    display: none;
  }

  .col-right {
    width: 100%;
    margin: 0;
  }

  .container {
    padding: 12px;
  }

  .detail-content {
    padding: 20px 16px;
    margin-bottom: 0;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
  }

  .detail-title {
    font-size: 22px;
    line-height: 1.3;
    margin-bottom: 12px;
  }

  .detail-meta {
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 12px;
  }

  .detail-meta .meta-item {
    margin-right: 0;
    margin-bottom: 0;
    font-size: 13px;
  }

  .detail-body {
    font-size: 15px;
    line-height: 1.6;
  }

  .detail-body h2 {
    font-size: 18px;
    margin: 20px 0 12px 0;
  }

  .detail-body h3 {
    font-size: 16px;
    margin: 16px 0 8px 0;
  }

  .detail-body p {
    margin-bottom: 12px;
  }

  .detail-body ul,
  .detail-body ol {
    padding-left: 20px;
    margin-bottom: 12px;
  }

  .detail-body li {
    margin-bottom: 6px;
  }

  .detail-body blockquote {
    margin: 16px 0;
    padding: 12px 16px;
    font-size: 14px;
    border-left-width: 3px;
  }

  .detail-body pre {
    padding: 12px;
    margin: 12px 0;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 13px;
  }

  .detail-body code {
    font-size: 13px;
    padding: 2px 6px;
  }

  /* 分享卡片优化 */
  .n-card {
    border-radius: 12px;
    margin-bottom: 16px;
  }

  .n-card__content {
    padding: 16px;
  }

  .n-card__content div[style*="display: flex"] {
    flex-wrap: wrap;
    gap: 8px !important;
  }

  .n-card__content button {
    flex: 1;
    min-width: calc(50% - 4px);
    padding: 10px 12px !important;
    font-size: 13px !important;
  }

  /* 移动端返回按钮 */
  .mobile-back-btn {
    display: block;
  }

  .back-to-top {
    bottom: 150px;
    right: 16px;
    width: 48px;
    height: 48px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }
}

@media (max-width: 480px) {
  .container {
    padding: 8px;
    margin-bottom: 52px;
  }

  .detail-content {
    padding: 16px 12px;
    margin: 0;
  }

  .detail-title {
    font-size: 20px;
  }

  .detail-body {
    font-size: 14px;
  }

  .detail-body h2 {
    font-size: 17px;
  }

  .detail-body h3 {
    font-size: 15px;
  }
}

/* 文章导航 - 上一篇/下一篇 */
.article-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0;
}

.article-navigation .nav-prev,
.article-navigation .nav-next {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  text-decoration: none;
  color: #333;
  min-height: 80px;
}

.article-navigation .nav-prev:empty,
.article-navigation .nav-next:empty {
  border: none;
  background: transparent;
}

.article-navigation .nav-prev {
  justify-content: flex-start;
}

.article-navigation .nav-next {
  justify-content: flex-end;
  text-align: right;
}

.article-navigation .nav-prev i {
  color: #999;
  font-size: 16px;
  margin-top: 2px;
  flex-shrink: 0;
}

.article-navigation .nav-next i {
  color: #999;
  font-size: 16px;
  margin-top: 2px;
  flex-shrink: 0;
  order: 2;
}

.article-navigation .nav-prev>div,
.article-navigation .nav-next>div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.article-navigation .nav-next>div {
  order: 1;
}

.article-navigation .nav-label {
  font-size: 12px;
  color: #999;
  font-weight: 400;
}

.article-navigation .nav-title {
  font-size: 14px;
  color: #333;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.5;
}

/* 响应式 - 平板 */
@media (max-width: 768px) {
  .article-navigation {
    gap: 12px;
    margin: 20px 0;
  }

  .article-navigation .nav-prev,
  .article-navigation .nav-next {
    padding: 14px;
    min-height: 70px;
  }

  .article-navigation .nav-title {
    font-size: 13px;
  }
}

/* 响应式 - 手机 */
@media (max-width: 480px) {
  .article-navigation {
    grid-template-columns: 1fr;
    margin: 16px 0;
    gap: 10px;
  }

  .article-navigation .nav-prev,
  .article-navigation .nav-next {
    padding: 12px;
    gap: 10px;
    min-height: 60px;
    border-radius: 3px;
    box-shadow: none;
  }

  .article-navigation .nav-next {
    text-align: left;
  }

  .article-navigation .nav-next>div {
    order: 0;
  }

  .article-navigation .nav-next i {
    order: 0;
  }

  .article-navigation .nav-prev i,
  .article-navigation .nav-next i {
    font-size: 14px;
  }

  .article-navigation .nav-label {
    font-size: 11px;
  }

  .article-navigation .nav-title {
    font-size: 12px;
    -webkit-line-clamp: 1;
    line-clamp: 1;
  }
}