/* ======= commands.css ======= */

/* 命令区域卡片样式增强 */
.command-card {
  background-color: #ffffff;
  border: 1px solid #e5e7eb; /* Tailwind's gray-200 */
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  position: relative;
  overflow: hidden;
}

.command-card:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.command-card::after {
  content: "";
  position: absolute;
  inset: auto -20% 0 -20%;
  height: 60%;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.18), transparent 70%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.command-card:hover::after {
  opacity: 1;
}

.command-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.command-code {
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-weight: 600;
  color: #0ea5e9;
  word-break: break-all;
  flex: 1;
}

.command-desc {
  font-size: 0.95rem;
  color: #334155;
}

/* 命令复制按钮 */
.copy-btn {
  background: none;
  border: none;
  color: #6b7280; /* Tailwind gray-500 */
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.2rem 0.4rem;
  border-radius: 0.375rem;
  transition: color 0.2s ease;
}

.copy-btn:hover {
  color: #3b82f6; /* Tailwind blue-500 */
}

/* 搜索工具条 */
.command-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 2rem auto 1.5rem;
  max-width: 960px;
}

.command-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.command-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.command-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: #64748b;
}

.command-hint {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.75rem;
}

select#command-category {
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
  background: #fff;
}

.ghost-btn {
  border: 1px solid #d1d5db;
  background: #fff;
  padding: 0.45rem 0.85rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  color: #475569;
  transition: all 0.2s ease;
}

.ghost-btn:hover {
  border-color: #38bdf8;
  color: #0ea5e9;
}

/* 搜索框美化 */
#command-search {
  border-radius: 0.45rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid #d1d5db; /* gray-300 */
  font-size: 0.95rem;
  box-shadow: 0 0 0 2px transparent;
  transition: all 0.2s ease;
  width: 100%;
  max-width: 600px;
  flex: 1 1 320px;
  margin-bottom: 0;
}

#command-search:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* 折叠分类标题按钮 */
.command-section-header {
  background-color: #f9fafb;
  padding: 0.75rem 1rem;
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
  gap: 0.75rem;
}

.command-section-header:hover {
  background-color: #f3f4f6;
}

.command-section-meta {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-left: auto;
  white-space: nowrap;
}

/* 分类列表容器 */
.command-section {
  margin-bottom: 2rem;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  overflow: hidden;
}

.command-list {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* 标签 / 分类颜色条（可选） */
.category-tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  background-color: #eff6ff;
  color: #2563eb;
  border-radius: 9999px;
  margin-right: 0.5rem;
}

/* 暂无匹配内容提示 */
.no-results {
  text-align: center;
  color: #9ca3af;
  font-style: italic;
  margin-top: 2rem;
}

.search-hit {
  background: #fef3c7;
  color: #92400e;
  padding: 0 0.2rem;
  border-radius: 0.25rem;
}

@media screen and (max-width: 768px) {
  .command-toolbar {
    padding: 0 1rem;
  }

  #command-search {
    margin-bottom: 0;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    line-height: 1.2;
    height: 2.25rem;
  }

  .command-toolbar-row {
    flex-direction: column;
    align-items: stretch;
  }

  .command-filters {
    width: 100%;
    justify-content: space-between;
  }

  .command-filters select,
  .command-filters .ghost-btn {
    flex: 1 1 140px;
  }

  .command-meta {
    width: 100%;
    justify-content: space-between;
  }
}
