/**
 * 单页 ai_tool 详情（原 single.php 内联样式）
 */
.content-area {
  padding: 16px;
}

.top-bar {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}
.top-bar-inner {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}
.top-bar-inner::-webkit-scrollbar {
  display: none;
}
.top-link {
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 4px;
  flex-shrink: 0;
}
.top-link:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}
.top-link.highlight {
  background: #fbbf24;
  color: #1f2937;
  font-weight: 500;
}

.main-header {
  background: white;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
}
.main-header-inner {
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 56px;
}
.hamburger-btn {
  display: none;
  padding: 8px;
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
}
.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.logo-icon.ait-brand-logo-img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: contain;
  display: block;
  background: transparent;
  flex-shrink: 0;
}
.logo-text {
  font-size: 16px;
  font-weight: 700;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.header-nav-link {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s;
}
.header-nav-link:hover,
.header-nav-link.active {
  background: var(--bg-secondary);
  color: var(--primary-color);
}
.header-search {
  margin-left: auto;
}
.search-toggle {
  padding: 8px;
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
}

.tool-header-section {
  display: grid;
  grid-template-columns: 240px 1fr 300px;
  gap: 20px;
  margin-bottom: 24px;
  align-items: stretch;
}

.tool-preview-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.preview-footer .preview-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  flex-shrink: 0;
}
.price-tag {
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
}
.price-tag.free {
  background: #d1fae5;
  color: #059669;
}
.price-tag.trial,
.price-tag.freemium {
  background: #dbeafe;
  color: #2563eb;
}
.price-tag.paid {
  background: #fce7f3;
  color: #db2777;
}

.preview-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}
.preview-logo {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin-bottom: 16px;
}
.preview-image {
  width: 120px;
  height: 120px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  margin-bottom: 16px;
  border-radius: var(--radius-lg);
}
.preview-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}
.preview-btn {
  padding: 10px 24px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 13px;
  cursor: pointer;
}
a.preview-btn,
a.btn-visit {
  text-decoration: none;
  display: inline-block;
  box-sizing: border-box;
  color: #fff;
  cursor: pointer;
}
a.preview-btn:hover,
a.btn-visit:hover {
  color: #fff;
}
.preview-btn:hover {
  background: var(--primary-hover);
}

.preview-footer {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px 28px;
  padding: 12px;
  border-top: 1px solid var(--border-color);
}
.footer-action {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
}

.tool-info-box {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
}
.info-category {
  margin-bottom: 12px;
}
.cat-label {
  display: inline-block;
  padding: 4px 12px;
  background: var(--primary-color);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 12px;
}
.info-title {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 8px;
}
.info-published {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 12px;
  line-height: 1.4;
}
.info-published time {
  font-variant-numeric: tabular-nums;
}
.info-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
  overflow-wrap: anywhere;
  /* 视觉硬上限：即使 PHP/缓存未更新，也不会在标题下铺满长文 */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 10;
  line-clamp: 10;
  overflow: hidden;
}
.info-actions {
  display: flex;
  gap: 12px;
}
.btn-visit {
  padding: 12px 32px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
}
.btn-visit:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.tool-ad-box {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 2px dashed var(--border-color);
}
.ad-rectangle {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-placeholder {
  color: var(--text-secondary);
  font-size: 14px;
}

.tool-detail-section {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}
.section-title {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}
.section-title h2 {
  font-size: 20px;
  font-weight: 600;
}
.section-content {
  font-size: 15px;
  line-height: 1.8;
}
.section-content p {
  margin-bottom: 16px;
}

.features-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}
.feature-icon {
  color: var(--primary-color);
  font-weight: bold;
}
.feature-text {
  font-size: 14px;
}

.related-tools-section {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.related-tool-card {
  padding: 12px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.related-tool-card .tool-icon-sm {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.related-tool-card .tool-icon-sm.tool-thumb {
  background-size: cover;
  background-position: center;
  background-color: var(--bg-tertiary);
}
.related-tool-card:hover {
  border-color: var(--primary-color);
  background: #fff;
}
.related-tool-card .tool-info-compact h3 {
  margin: 0 0 4px;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.related-tool-card .tool-info-compact p {
  margin: 0;
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.related-tools-empty {
  color: var(--text-secondary);
  font-size: 14px;
}

.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 100;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 1023px) {
  .tool-header-section {
    grid-template-columns: 1fr;
  }
  .tool-preview-card {
    max-width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  .preview-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 16px 14px;
    min-height: 88px;
    flex-wrap: nowrap;
  }
  .preview-logo {
    width: 72px;
    height: 72px;
    font-size: 36px;
    margin: 0;
    flex-shrink: 0;
    border-radius: var(--radius-md);
  }
  .preview-image {
    width: 72px;
    height: 72px;
    margin: 0;
    flex-shrink: 0;
    border-radius: var(--radius-md);
  }
  .preview-title {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 16px;
    line-height: 1.35;
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .preview-btn {
    flex-shrink: 0;
    padding: 10px 18px;
    font-size: 13px;
    margin: 0;
  }
  .preview-footer {
    padding: 12px 14px;
    gap: 16px 24px;
    justify-content: center;
  }
  .features-list {
    grid-template-columns: 1fr;
  }
  .related-tools-grid {
    grid-template-columns: 1fr;
  }
  .info-title {
    font-size: 22px;
  }
  .tool-info-box {
    padding: 20px;
  }
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 480px) {
  .tool-detail-section {
    padding: 16px;
  }
  .info-actions {
    flex-direction: column;
  }
  .btn-visit {
    text-align: center;
  }
}

/* 面包屑 + 标签（SEO / 结构参考目录站详情页） */
.tool-breadcrumb {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.tool-breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
  list-style: none;
  margin: 0;
  padding: 0;
}
.tool-breadcrumb__item {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
}
.tool-breadcrumb__item:not(:last-child)::after {
  content: '/';
  margin: 0 8px;
  color: var(--text-light);
  pointer-events: none;
}
.tool-breadcrumb__item a {
  color: var(--text-secondary);
  text-decoration: none;
}
.tool-breadcrumb__item a:hover {
  color: var(--primary-color);
}
.tool-breadcrumb__item--current {
  color: var(--text-primary);
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-info-tags {
  margin: 10px 0 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.tool-info-tags__label {
  margin-right: 6px;
  color: var(--text-muted);
}
.tool-info-tags__link {
  display: inline-block;
  margin: 0 8px 4px 0;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 12px;
  text-decoration: none;
}
.tool-info-tags__link:hover {
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary-color);
}
