/* News detail page styles */
.qrcode-container {
  width: 147px;
  height: 147px;
  margin: 10px auto;
}

.qrcode-container canvas {
  width: 100% !important;
  height: 100% !important;
}

.soft-box.active {
  border: 1px solid #e8ecf3;
  background: linear-gradient(180deg, #fbfdff 0%, #f6f8fc 100%);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.article-layout {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.article-directory {
  width: 240px;
  flex: 0 0 240px;
  position: sticky;
  top: 20px;
  align-self: flex-start;
  border: 1px solid #dfe8ff;
  background: linear-gradient(180deg, #f7faff 0%, #eef4ff 100%);
  border-radius: 12px;
  padding: 16px 14px;
  box-shadow: 0 8px 20px rgba(59, 72, 226, 0.06);
}

.article-directory-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: #3b48e2;
  margin-bottom: 10px;
}

.article-directory-content {
  max-height: calc(100vh - 180px);
  overflow: auto;
  padding-right: 4px;
}

.article-directory-content ul,
.article-directory-content ol {
  margin: 0;
  padding-left: 18px;
  list-style-position: outside;
}

.article-directory-content .article-toc__list,
.article-directory-content .article-toc__list--nested {
  padding-left: 0;
  margin: 0;
  list-style: none;
}

.article-directory-content li {
  margin: 6px 0;
  line-height: 1.5;
  min-width: 0;
}

.article-directory-content .article-toc__item {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  line-height: 1.5;
}

.article-directory-content .article-toc__level-3 {
  padding-left: 14px;
}

.article-directory-content .article-toc__index,
.article-directory-content .article-toc__bullet {
  flex: 0 0 auto;
  white-space: nowrap;
  line-height: 1.5;
  color: #64748b;
}

.article-directory-content .article-toc__bullet {
  width: 10px;
  text-align: center;
}

.article-directory-content li.is-active > a,
.article-directory-content a {
  color: #334155;
  text-decoration: none;
  font-size: 14px;
  display: block;
  align-items: center;
  max-width: 100%;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
  flex: 1 1 auto;
}

.article-directory-content a:hover {
  color: #3b48e2;
}

.article-directory-content a.is-active {
  color: #3b48e2;
  font-weight: 600;
}

.article-directory-content li.is-active > a {
  color: #3b48e2;
  font-weight: 600;
}

.article-directory-content h1,
.article-directory-content h2,
.article-directory-content h3,
.article-directory-content h4,
.article-directory-content h5,
.article-directory-content h6 {
  margin: 10px 0 6px;
  color: #1f2a37;
  line-height: 1.4;
}

.article-directory-content p {
  margin: 6px 0;
  color: #475569;
  font-size: 14px;
  line-height: 1.6;
}

.article-main {
  flex: 1;
  min-width: 0;
}

.soft-box.active .soft-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.soft-box.active .soft-meta img.soft-logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #eef2f7;
  background: #fff;
}

.soft-box.active .soft-name {
  color: #1f2a37;
  font-size: 17px;
  line-height: 1.4;
  font-weight: 600;
  margin-bottom: 6px;
  word-break: break-all;
}

.soft-box.active .soft-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.soft-box.active .soft-tag {
  display: inline-flex;
  align-items: center;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}

.soft-box.active .soft-tag img {
  width: 14px;
  height: 14px;
  margin-right: 4px;
}

.soft-box.active .soft-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.soft-box.active .btn-detail,
.soft-box.active .btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 104px;
  height: 40px;
  padding: 0 18px;
  border-radius: 8px;
  font-size: 15px;
  text-decoration: none;
  transition: all 0.25s ease;
  border: 1px solid #d9e1ea;
  box-sizing: border-box;
  white-space: nowrap;
}

.soft-box.active .btn-detail {
  color: #4b5563;
  background: #ffffff;
}

.soft-box.active .btn-detail:hover {
  color: #1f2937;
  border-color: #b9c4d1;
  background: #f8fafc;
}

.soft-box.active .btn-download {
  color: #fff;
  border-color: #0084ff;
  background: linear-gradient(135deg, #0084ff 0%, #0066ff 100%);
  box-shadow: 0 8px 18px rgba(0, 132, 255, 0.22);
  animation: downloadPulse 1.8s ease-in-out infinite;
}

.soft-box.active .btn-download:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 132, 255, 0.30);
  animation-play-state: paused;
}

.soft-box.active .download-dropdown {
  position: relative;
}

.soft-box.active .download-dropdown .download-arrow {
  margin-left: 6px;
  font-size: 12px;
  transition: transform 0.2s ease;
}

.soft-box.active .download-dropdown.open .download-arrow {
  transform: rotate(180deg);
}

.soft-box.active .download-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: auto;
  min-width: 100%;
  background: #fff;
  border: 1px solid #d9e1ea;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.12);
  overflow: hidden;
  display: none;
  z-index: 20;
}

.soft-box.active .download-dropdown.open .download-menu {
  display: block;
}

.soft-box.active .download-menu a {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  color: #334155;
  font-size: 14px;
  text-decoration: none;
  background: #fff;
}

.soft-box.active .download-menu a img {
  width: 16px;
  height: 16px;
  margin-right: 8px;
  flex-shrink: 0;
}

.soft-box.active .download-menu a:hover {
  background: #f3f7ff;
  color: #1e40af;
}

.soft-box.active .download-menu li + li a {
  border-top: 1px solid #edf2f7;
}

@keyframes downloadPulse {
  0% {
    box-shadow: 0 8px 18px rgba(0, 132, 255, 0.18);
  }
  50% {
    box-shadow: 0 10px 24px rgba(0, 132, 255, 0.34);
  }
  100% {
    box-shadow: 0 8px 18px rgba(0, 132, 255, 0.18);
  }
}

.article-summary {
  border: 1px solid #dfe8ff;
  background: linear-gradient(180deg, #f5f8ff 0%, #edf3ff 100%);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 20px;
}

.article-summary .summary-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  line-height: 1.4;
  color: #1f2a37;
  font-weight: 600;
  margin-bottom: 10px;
}

.article-summary .summary-title img {
  width: 28px;
  height: 28px;
  display: block;
  flex-shrink: 0;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.article-summary .summary-title.is-ai {
  color: #3b48e2;
  background: linear-gradient(90deg, #3b48e2 0%, #5b6af2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.article-summary .summary-text {
  margin: 0;
  color: #374151;
  line-height: 1.85;
  font-size: 15px;
}

.article-summary .summary-ai-note {
  margin-top: 10px;
  color: #9ca3af;
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .article-layout {
    flex-direction: column;
    gap: 14px;
  }

  .article-directory {
    width: 100%;
    flex: none;
    position: static;
    top: auto;
    padding: 14px 12px;
    border-radius: 10px;
  }

  .article-directory-content {
    max-height: none;
  }

  .soft-box.active {
    padding: 14px 12px;
    margin-bottom: 16px;
    border-radius: 10px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .soft-box.active .soft-meta {
    width: 100%;
  }

  .soft-box.active .soft-name {
    font-size: 16px;
  }

  .soft-box.active .soft-actions {
    width: 100%;
    gap: 8px;
  }

  .soft-box.active .btn-detail,
  .soft-box.active .btn-download {
    flex: 1;
    min-width: 0;
    height: 38px;
    font-size: 14px;
  }

  .soft-box.active .download-menu {
    left: 0;
    right: 0;
    min-width: 0;
  }

  .article-summary {
    padding: 14px 12px;
    margin-bottom: 16px;
    border-radius: 10px;
  }

  .article-summary .summary-title {
    font-size: 16px;
    margin-bottom: 8px;
  }

  .article-summary .summary-title img {
    width: 26px;
    height: 26px;
  }

  .article-summary .summary-text {
    font-size: 14px;
    line-height: 1.75;
  }

  .article-summary .summary-ai-note {
    font-size: 12px;
    margin-top: 8px;
  }
}
