/* ===== 首页（/）专用样式，仅 index.html 引入 ===== */

/* 首页容器：比工具页的 .container 更宽，便于横排卡片 */
.home {
  max-width: 1040px;
  margin: 0 auto;
  padding: 64px 24px 48px;
}

/* 标题区 */
.home-header {
  margin-bottom: 44px;
}

.home-header h1 {
  margin-bottom: 12px;
}

.home-header .desc {
  font-size: 15px;
  margin-bottom: 0;
}

/* 工具卡片网格：自动换列，新增卡片无需改布局 */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  align-items: stretch;
}

/* 单张工具卡片（整张可点击） */
.tool-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: #ffffff;
  border: 1px solid #e1e4e8;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

/* 悬停反馈 */
.tool-card:hover {
  transform: translateY(-3px);
  border-color: #5865f2;
  box-shadow: 0 10px 24px rgba(44, 62, 80, 0.12);
}

/* 键盘焦点反馈 */
.tool-card:focus-visible {
  outline: 3px solid #5865f2;
  outline-offset: 3px;
  border-color: #5865f2;
}

/* 按下反馈 */
.tool-card:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(44, 62, 80, 0.12);
}

/* 图标容器（内嵌 SVG，不依赖外部图片） */
.tool-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  background: #eef0fe;
  border-radius: 10px;
  color: #5865f2;
  flex-shrink: 0;
}

.tool-icon svg {
  width: 22px;
  height: 22px;
}

/* 工具名称 */
.tool-name {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
  overflow-wrap: break-word;
}

/* 工具说明 */
.tool-desc {
  flex: 1;
  font-size: 14px;
  color: #5d6d7e;
  margin-bottom: 20px;
  overflow-wrap: break-word;
}

/* 进入按钮 */
.tool-action {
  align-self: flex-start;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  background: #5865f2;
  border-radius: 6px;
  transition: background 0.18s ease;
}

.tool-card:hover .tool-action {
  background: #4752c4;
}

.tool-card:focus-visible .tool-action {
  background: #4752c4;
}

/* “即将上线”占位卡片：不可点击、低强调 */
.tool-card--soon {
  background: #fafbfc;
  border: 1px dashed #d5dae1;
  cursor: default;
}

.tool-card--soon:hover {
  transform: none;
  border-color: #d5dae1;
  box-shadow: none;
}

.tool-card--soon .tool-icon {
  background: #f0f2f5;
  color: #9aa7b4;
}

.tool-card--soon .tool-name {
  color: #7f8c8d;
}

.tool-action--muted {
  color: #7f8c8d;
  background: #eceff3;
}

.tool-card--soon:hover .tool-action--muted {
  background: #eceff3;
}

/* 底部：后端连通性自检 */
.home-footer {
  margin-top: 48px;
  text-align: center;
}

.btn-ghost {
  font-weight: 500;
  color: #5d6d7e;
  background: #ffffff;
  border: 1px solid #dcdfe6;
}

.btn-ghost:hover {
  color: #2c3e50;
  background: #f0f2f5;
}

.btn-ghost:focus-visible {
  outline: 3px solid #5865f2;
  outline-offset: 2px;
}

.home-footer .result {
  max-width: 480px;
  margin: 16px auto 0;
  text-align: left;
}

/* ===== 手机 / 窄屏：单列布局 ===== */
@media (max-width: 640px) {
  .home {
    padding: 40px 18px 32px;
  }

  .home-header {
    margin-bottom: 32px;
  }

  .home-header h1 {
    font-size: 24px;
  }

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

  .tool-card {
    padding: 20px;
  }

  .tool-action {
    align-self: stretch;
    text-align: center;
  }
}
