.td-main {
  flex: 1;
  padding: 24px;
}

.td-main > .breadcrumb {
  max-width: 1200px;
  margin: 0 auto 24px;
  width: 100%;
}

.td-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.td-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9rem;
  color: var(--color-primary);
  text-decoration: none;
  margin-bottom: 24px;
}

.td-back:hover {
  text-decoration: underline;
}

/* Hero: two-column — left (icon + info), right (cover) */
.td-hero {
  display: flex;
  gap: 24px;
  padding: 32px;
  background: var(--color-white);
  border-radius: 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--color-border);
  margin-bottom: 24px;
  align-items: stretch;
}

.td-hero-left {
  flex: 1;
  display: flex;
  gap: 20px;
  min-width: 0;
}

.td-hero-cover {
  flex-shrink: 0;
  width: 320px;
  max-height: 220px;
  border-radius: 12px;
  overflow: hidden;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.td-hero-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.td-hero-covers {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 100%;
}
.td-hero-covers img {
  width: 160px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
}

.td-covers-strip {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 8px 0 20px;
  margin-bottom: 24px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
}
.td-covers-strip::-webkit-scrollbar {
  display: none;
}
.td-covers-strip img {
  flex-shrink: 0;
  width: calc((100% - 48px) / 4);
  height: auto;
  max-height: 80vh;
  border-radius: 18px;
  object-fit: contain;
  background: #f5f5f7;
  border: 1px solid rgba(0,0,0,.06);
  scroll-snap-align: start;
}

.td-icon {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  border-radius: 24px;
  overflow: hidden;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
}

.td-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.td-icon-placeholder {
  font-size: 3rem;
  color: var(--color-text-muted);
  user-select: none;
}

.td-hero-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.td-name {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
  line-height: 1.3;
}

.td-oneline {
  font-size: 1rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.5;
}

.td-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.td-domain-badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #6b7280;
  background: #f3f4f6;
  border-radius: 20px;
}

.td-category-badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-primary);
  background: rgba(37, 99, 235, 0.08);
  border-radius: 20px;
  text-decoration: none;
  transition: background 0.2s;
}

.td-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.td-tags-wrap .td-category-badge {
  margin: 0;
}

.td-category-badge:hover {
  background: rgba(37, 99, 235, 0.16);
}

.td-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.td-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: var(--color-primary);
  border: none;
  border-radius: 24px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.td-btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
}

.td-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-primary);
  background: rgba(37, 99, 235, 0.08);
  border: none;
  border-radius: 24px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
}

.td-btn-secondary:hover {
  background: rgba(37, 99, 235, 0.16);
}

/* Stats row */
.td-stats {
  display: flex;
  gap: 0;
  background: var(--color-white);
  border-radius: 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--color-border);
  margin-bottom: 24px;
  overflow: hidden;
}

.td-stat {
  flex: 1;
  padding: 16px 20px;
  text-align: center;
  border-right: 1px solid var(--color-border);
}

.td-stat:last-child {
  border-right: none;
}

.td-stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.td-stat-value {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.td-stat-value a {
  color: var(--color-primary);
  text-decoration: none;
}

.td-stat-value a:hover {
  text-decoration: underline;
}

/* Description section */
.td-section {
  background: var(--color-white);
  border-radius: 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--color-border);
  padding: 24px 32px;
  margin-bottom: 24px;
}

.td-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.td-description {
  font-size: 0.95rem;
  color: var(--color-text);
  line-height: 1.7;
}
.td-description h2 {
  font-size: 1.05rem;
  color: var(--color-heading, #1a1a1a);
  margin: 1em 0 0.3em;
  padding-bottom: 0;
}
.td-description h2:first-child {
  margin-top: 0;
}
.td-description p {
  margin: 0 0 0.3em;
}
.td-description ul {
  margin: 0 0 0.2em;
  padding-left: 1.4em;
}
.td-description li {
  margin: 0.15em 0;
}
.td-description strong {
  color: var(--color-heading, #1a1a1a);
}

.td-desc-empty {
  color: var(--color-text-muted);
  font-style: italic;
}

/* Related tools */
.td-related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.td-related-card {
  display: block;
  background: var(--color-bg);
  border-radius: 12px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, transform 0.2s;
  border: 1px solid var(--color-border);
  min-width: 0;
  overflow: hidden;
}

.td-related-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.td-related-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  min-width: 0;
  overflow: hidden;
}

.td-related-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--color-white);
  flex-shrink: 0;
}

.td-related-card-icon-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.td-related-card-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.td-related-card-desc {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
}

/* Toast */
.td-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 24px;
  background: var(--color-text);
  color: #fff;
  font-size: 0.9rem;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  z-index: 300;
}

.td-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Not found */
.td-not-found {
  text-align: center;
  padding: 80px 24px;
}

.td-not-found h1 {
  font-size: 1.5rem;
  color: var(--color-text);
  margin-bottom: 12px;
}

.td-not-found p {
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

.td-not-found a {
  color: var(--color-primary);
  text-decoration: none;
}

.td-not-found a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  .td-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px;
    gap: 16px;
  }

  .td-hero-left {
    flex-direction: column;
    align-items: center;
  }

  .td-hero-cover {
    width: 100%;
    max-height: 200px;
  }

  .td-icon {
    width: 96px;
    height: 96px;
    border-radius: 20px;
  }

  .td-hero-body {
    align-items: center;
  }

  .td-meta {
    justify-content: center;
  }

  .td-actions {
    justify-content: center;
  }

  .td-name {
    font-size: 1.4rem;
  }

  .td-stats {
    flex-wrap: wrap;
  }

  .td-stat {
    flex: none;
    width: 50%;
    border-bottom: 1px solid var(--color-border);
  }

  .td-stat:nth-child(2n) {
    border-right: none;
  }

  .td-stat:nth-last-child(-n+2) {
    border-bottom: none;
  }

  .td-covers-strip img {
    width: calc((100% - 24px) / 2);
    border-radius: 14px;
    object-fit: contain;
    max-height: 70vh;
  }

  .td-section {
    padding: 20px;
  }

  .td-related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .td-related-grid {
    grid-template-columns: 1fr;
  }
}

/* Profile section */
.td-profile {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.td-profile-item h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
  padding-left: 10px;
  border-left: 3px solid var(--color-primary);
}

.td-profile-item p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.7;
  white-space: pre-line;
}

.td-profile-content {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}
.td-profile-content p { margin: 0 0 0.5em; }
.td-profile-content ul, .td-profile-content ol { margin: 0 0 0.5em; padding-left: 1.4em; }
.td-profile-content li { margin: 0.2em 0; }
.td-profile-content h2, .td-profile-content h3 { font-size: 0.95rem; margin: 0.8em 0 0.3em; }
.td-profile-content strong { color: var(--color-heading, #1a1a1a); }
.td-profile-content a { color: var(--color-primary); }
