/* ============================================ */
/* 🎨 工具分类页样式 - 2026专业版 redesign */
/* 参考：Product Hunt / Tool Finder / B2B平台 */
/* ============================================ */

/* ===== Hero区域 ===== */
.tc-hero-premium {
  position: relative;
  overflow: hidden;
  padding: clamp(3rem, 8vw, 6rem) 1rem clamp(2.5rem, 6vw, 4rem);
  background: var(--gradient-hero);
  min-height: 420px;
  display: flex;
  align-items: center;
}

.tc-hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.tc-hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.25;
}

.tc-orb-1 {
  width: 450px;
  height: 450px;
  background: var(--accent);
  top: -120px;
  right: -80px;
  animation: tcFloatOrb 18s ease-in-out infinite;
}

.tc-orb-2 {
  width: 350px;
  height: 350px;
  background: var(--accent-warm);
  bottom: -80px;
  left: -60px;
  animation: tcFloatOrb 22s ease-in-out infinite reverse;
}

@keyframes tcFloatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(25px, -25px) scale(1.05); }
  66% { transform: translate(-15px, 15px) scale(0.95); }
}

.tc-hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
  background-size: 50px 50px;
  opacity: 0.4;
}

/* 面包屑导航 */
.tc-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.tc-breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.tc-breadcrumb a:hover {
  color: var(--accent);
}

.bc-sep {
  color: var(--text-muted);
  font-size: 11px;
}

.bc-current {
  color: var(--text-primary);
  font-weight: 600;
}

/* Hero内容区 */
.tc-hero-content {
  max-width: 700px;
  position: relative;
  z-index: 1;
}

.tc-cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  background: color-mix(in srgb, var(--accent-warm) 12%, transparent);
  color: var(--accent-warm-dark);
  border: 1px solid color-mix(in srgb, var(--accent-warm) 20%, transparent);
  margin-bottom: 1.5rem;
  backdrop-filter: blur(8px);
  letter-spacing: 0.02em;
}

.tc-badge-icon {
  font-size: 16px;
}

.tc-hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-primary);
  margin: 0 0 1rem;
  letter-spacing: -0.03em;
}

.tc-hero-desc {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0 0 2rem;
  max-width: 550px;
}

/* 统计数据条 */
.tc-stats-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem 1.75rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border-card);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  max-width: fit-content;
}

.tc-stat-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tc-stat-icon {
  font-size: 24px;
  line-height: 1;
}

.tc-stat-info {
  display: flex;
  flex-direction: column;
}

.tc-stat-num {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.tc-stat-lbl {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

.tc-stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border-card);
}

/* 返回按钮 */
.tc-back-btn {
  position: absolute;
  top: 2rem;
  right: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1.5px solid var(--border-card);
  text-decoration: none;
  transition: all var(--transition-base);
  backdrop-filter: blur(8px);
  z-index: 2;
}

.tc-back-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateX(-4px);
}

.back-arrow {
  font-size: 16px;
  transition: transform var(--transition-base);
}

.tc-back-btn:hover .back-arrow {
  transform: translateX(-4px);
}

/* ===== 内容区域 ===== */
.tc-content-premium {
  padding: 3rem 1rem;
  background: var(--bg-page);
  min-height: 500px;
}

/* 工具栏 */
.tc-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-subtle);
}

.tc-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tc-result-count {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.tc-result-count strong {
  color: var(--accent);
  font-weight: 700;
  font-size: 16px;
}

.tc-toolbar-right {
  display: flex;
  gap: 8px;
}

.tc-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tc-sort-btn:hover {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  border-color: var(--border-card);
}

.tc-sort-btn.active {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-color: transparent;
  box-shadow: var(--shadow-md);
}

/* ===== 工具卡片网格 ===== */
.tc-grid-premium {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  margin-bottom: 3rem;
}

/* 卡片主体 */
.tc-card-premium {
  position: relative;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-card);
  border-radius: 18px;
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: all 0.35s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  animation: tcFadeInUp 0.6s ease-out backwards;
}

@keyframes tcFadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 顶部装饰线 */
.tc-card-top-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-warm));
  opacity: 0;
  transition: opacity 0.3s;
}

.tc-card-premium:hover .tc-card-top-line {
  opacity: 1;
}

/* 悬浮效果 */
.tc-card-premium:hover {
  transform: translateY(-8px);
  box-shadow:
    0 24px 56px rgba(0,0,0,0.12),
    0 0 0 1px var(--accent-light);
  border-color: var(--accent);
}

/* 卡片头部 */
.tc-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.tc-favicon-wrapper {
  position: relative;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
}

.tc-card-favicon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: contain;
  background: var(--bg-page);
  padding: 8px;
  box-sizing: border-box;
  border: 1.5px solid var(--border-card);
  transition: all 0.3s cubic-bezier(.4,0,.2,1);
}

.tc-card-premium:hover .tc-card-favicon {
  border-color: var(--accent);
  transform: scale(1.08) rotate(-3deg);
  box-shadow: 0 4px 12px rgba(37,99,235,0.15);
}

.tc-favicon-fallback {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: var(--bg-page);
  border: 1.5px solid var(--border-card);
  border-radius: 14px;
  transition: all 0.3s;
}

.tc-card-premium:hover .tc-favicon-fallback {
  border-color: var(--accent);
  transform: scale(1.08);
}

/* 标题区域 */
.tc-card-title-wrap {
  flex: 1;
  min-width: 0;
}

.tc-card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin: 0 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color var(--transition-fast);
}

.tc-card-premium:hover .tc-card-title {
  color: var(--accent);
}

/* 人气指示器 */
.tc-card-popularity {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.popularity-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  animation: tcPulse 2s ease-in-out infinite;
}

@keyframes tcPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}

/* 描述文本 */
.tc-card-desc {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0 0 16px;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 底部信息栏 */
.tc-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

.tc-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.meta-icon {
  font-size: 14px;
}

.tc-action-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s cubic-bezier(.4,0,.2,1);
}

.tc-card-premium:hover .tc-action-indicator {
  opacity: 1;
  transform: translateX(0);
}

.action-arrow {
  font-size: 16px;
  transition: transform var(--transition-base);
}

.tc-card-premium:hover .action-arrow {
  transform: translateX(4px);
}

/* ===== 空状态 ===== */
.tc-empty-state,
.tc-error-state {
  text-align: center;
  padding: 4rem 2rem;
  max-width: 500px;
  margin: 0 auto;
}

.empty-icon,
.error-icon {
  font-size: 64px;
  margin-bottom: 1.5rem;
  animation: tcBounce 2s ease-in-out infinite;
}

@keyframes tcBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.empty-title,
.error-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.75rem;
}

.empty-desc,
.error-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0 0 2rem;
}

.tc-empty-btn,
.tc-error-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-base);
}

.tc-empty-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white;
  border: none;
  box-shadow: var(--shadow-md);
}

.tc-empty-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
}

.btn-arrow {
  font-size: 18px;
  transition: transform var(--transition-base);
}

.tc-empty-btn:hover .btn-arrow {
  transform: translateX(4px);
}

.tc-error-btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white;
  border: none;
  box-shadow: var(--shadow-md);
}

.tc-error-btn.secondary {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1.5px solid var(--border-card);
}

.tc-error-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.error-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== 相关推荐区域 ===== */
.tc-related-section {
  padding: 3rem 1rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
}

.related-header {
  text-align: center;
  margin-bottom: 2rem;
}

.related-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.5rem;
}

.related-header p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

.tc-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  max-width: 900px;
  margin: 0 auto;
}

.tc-related-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-card);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--transition-base);
  font-weight: 500;
  font-size: 14px;
}

.tc-related-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateX(6px);
}

.related-favicon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: contain;
  flex-shrink: 0;
}

.related-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.related-arrow {
  font-size: 16px;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-8px);
  transition: all var(--transition-base);
}

.tc-related-card:hover .related-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ============================================ */
/* 响应式设计
/* ============================================ */
@media(max-width:1024px){
  .tc-back-btn {
    position: static;
    margin-top: 1.5rem;
    display: inline-flex;
  }

  .tc-hero-content {
    max-width: 100%;
  }

  .tc-grid-premium {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

@media(max-width:768px){
  .tc-hero-premium {
    min-height: auto;
    padding: 2.5rem 1rem 2rem;
  }

  .tc-breadcrumb {
    font-size: 12px;
    margin-bottom: 1rem;
  }

  .tc-hero-title {
    font-size: 1.75rem;
  }

  .tc-hero-desc {
    font-size: 0.95rem;
  }

  .tc-stats-bar {
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem;
  }

  .tc-stat-divider {
    width: 80%;
    height: 1px;
  }

  .tc-stat-item {
    width: 100%;
  }

  .tc-content-premium {
    padding: 2rem 1rem;
  }

  .tc-toolbar {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .tc-toolbar-right {
    width: 100%;
  }

  .tc-sort-btn {
    flex: 1;
    justify-content: center;
  }

  .tc-grid-premium {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .tc-card-premium {
    padding: 20px;
  }

  .tc-related-grid {
    grid-template-columns: 1fr;
  }

  .error-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .tc-error-btn {
    justify-content: center;
  }
}

@media(max-width:480px){
  .tc-hero-title {
    font-size: 1.5rem;
  }

  .tc-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .tc-favicon-wrapper {
    width: 42px;
    height: 42px;
  }

  .tc-card-favicon,
  .tc-favicon-fallback {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 20px;
  }

  .tc-card-title {
    font-size: 15px;
  }

  .tc-card-footer {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .tc-action-indicator {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
  .tc-card-premium:hover {
    transform: none;
  }

  .tc-card-premium:active {
    transform: scale(0.98);
  }

  .tc-back-btn:hover {
    transform: none;
  }

  .tc-related-card:hover {
    transform: none;
  }

  .tc-empty-btn:hover,
  .tc-error-btn:hover {
    transform: none;
  }
}
