/* ================================================================
   小螺号 工具页共享样式 · tools-common.css
   适用于：常用工具、工具分类、工作流分类等工具列表页
   依赖：common.css（需先加载）
   ================================================================ */

/* ===== 工具页布局 ===== */
.tools-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.tools-main {
  flex: 1;
  width: min(100%, 480px);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md) calc(100px + env(safe-area-inset-bottom, 0));
}

@media (min-width: 768px) {
  .tools-main {
    width: min(100%, 720px);
    padding: var(--space-xl) var(--space-lg) calc(100px + env(safe-area-inset-bottom, 0));
  }
}

@media (min-width: 1024px) {
  .tools-main {
    width: min(100%, 960px);
  }
}

/* ===== 返回导航 ===== */
.tools-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--text-muted);
  font-size: var(--font-sm);
  font-weight: var(--weight-medium);
  padding: var(--space-sm) 0;
  margin-bottom: var(--space-md);
  min-height: 44px;
}

.tools-back:hover {
  color: var(--brand-primary);
}

/* ===== 页面标题 ===== */
.tools-page-title {
  font-size: var(--font-2xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  margin: 0 0 var(--space-xs);
  line-height: 1.2;
}

.tools-page-desc {
  font-size: var(--font-sm);
  color: var(--text-muted);
  margin: 0 0 var(--space-xl);
}

/* ===== 搜索栏 ===== */
.tools-search {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--bg-surface);
  border-radius: var(--radius-full);
  padding: 0 var(--space-lg);
  height: 46px;
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-xl);
  color: var(--text-muted);
}

.tools-search input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-size: var(--font-base);
  color: var(--text-primary);
  min-width: 0;
}

.tools-search input::placeholder {
  color: var(--text-disabled);
}

/* ===== 分类标签横向滚动 ===== */
.tools-categories {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-xl);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tools-categories::-webkit-scrollbar {
  display: none;
}

.tools-cat-chip {
  flex: 0 0 auto;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-full);
  font-size: var(--font-sm);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  cursor: pointer;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  transition: all var(--transition-fast);
}

.tools-cat-chip:hover,
.tools-cat-chip.active {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
}

/* ===== 工具卡片网格 ===== */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

@media (min-width: 768px) {
  .tools-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
  }
}

@media (min-width: 1024px) {
  .tools-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ===== 工具卡片 ===== */
.tools-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  min-height: 100px;
}

.tools-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.tools-card-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
}

.tools-card-title {
  font-size: var(--font-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  line-height: 1.3;
}

.tools-card-desc {
  font-size: var(--font-xs);
  color: var(--text-muted);
  line-height: 1.4;
}

/* ===== 工作流分组（评估/训练/备课/作业） ===== */
.workflow-section {
  margin-bottom: var(--space-2xl);
}

.workflow-section-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-lg);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  margin: 0 0 var(--space-md);
}

.workflow-section-title::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: var(--brand-primary);
}

/* ===== 底部导航栏（工具页版） ===== */
.tools-tabbar {
  flex-shrink: 0;
  display: flex;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-default);
  padding: var(--space-sm) var(--space-xs) calc(var(--space-xs) + env(safe-area-inset-bottom, 0));
}

.tools-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: var(--weight-medium);
  padding: var(--space-xs) 0;
  min-height: 50px;
  justify-content: center;
}

.tools-tab.active {
  color: var(--brand-primary);
}

/* ===== 空状态 ===== */
.tools-empty {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
  color: var(--text-muted);
  font-size: var(--font-base);
}

.tools-empty-icon {
  font-size: 48px;
  margin-bottom: var(--space-md);
  opacity: 0.4;
}
