/* ============================================================
   懂工具 - 首页样式 home.css
   ============================================================ */

/* ---------- Hero 区 ---------- */
.hero {
  position: relative;
  padding: 96px 0 72px;
  background:
    radial-gradient(120% 100% at 80% 0%, #7DD3FC 0%, #0EA5E9 38%, #0284C7 70%, #0F2A3D 100%);
  color: #fff;
  overflow: hidden;
}

/* 噪点纹理 */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
  opacity: 0.12;
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* 装饰几何 */
.hero::after {
  content: "";
  position: absolute;
  right: -120px;
  top: -120px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  text-align: center;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 13px;
  font-weight: 500;
  backdrop-filter: blur(8px);
  margin-bottom: 24px;
}

.hero__title {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}

.hero__title em {
  font-style: normal;
  background: linear-gradient(90deg, #E0F2FE, #BAE6FD);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero__subtitle {
  font-size: clamp(15px, 2vw, 18px);
  opacity: 0.92;
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

/* Hero 大搜索 */
.hero-search {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
}

.hero-search input {
  width: 100%;
  height: 56px;
  padding: 0 24px 0 56px;
  border: none;
  border-radius: var(--radius-full);
  background: #fff;
  font-size: 16px;
  color: var(--color-ink);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
}

.hero-search input:focus {
  outline: none;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22), 0 0 0 4px rgba(255, 255, 255, 0.4);
}

.hero-search__icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  color: var(--color-ink-mute);
}

.hero-search__results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-height: 380px;
  overflow-y: auto;
  display: none;
  text-align: left;
}

.hero-search__results.is-open {
  display: block;
}

.hero-search__results a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  color: var(--color-ink);
  border-bottom: 1px solid var(--color-border-soft);
}

.hero-search__results a:last-child {
  border-bottom: none;
}

.hero-search__results a:hover {
  background: var(--color-primary-soft);
}

.hero-search__results .empty {
  padding: 24px;
  text-align: center;
  color: var(--color-ink-mute);
  font-size: 14px;
}

/* 统计数字 */
.hero__stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.hero__stat {
  text-align: center;
}

.hero__stat-num {
  font-size: 32px;
  font-weight: 800;
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

.hero__stat-label {
  font-size: 13px;
  opacity: 0.85;
  margin-top: 4px;
}

/* ---------- 工具区 ---------- */
.tools-section {
  padding: 64px 0 24px;
}

.tools-section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.tools-section__title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.tools-section__title span {
  color: var(--color-primary);
}

.tools-section__sub {
  color: var(--color-ink-mute);
  font-size: 14px;
  margin-top: 6px;
}

/* 工具网格 */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.tools-grid .tool-card {
  opacity: 0;
  transform: translateY(12px);
  animation: cardIn 0.5s ease forwards;
}

@keyframes cardIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 空状态 */
.empty-state {
  grid-column: 1 / -1;
  padding: 60px 24px;
  text-align: center;
  color: var(--color-ink-mute);
}

.empty-state svg {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  opacity: 0.4;
}

/* ---------- 分类区块 ---------- */
.category-block {
  margin-bottom: 56px;
}

.category-block__head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.category-block__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
}

.category-block__title {
  font-size: 22px;
  font-weight: 800;
}

.category-block__desc {
  font-size: 13px;
  color: var(--color-ink-mute);
  margin-top: 2px;
}

/* ---------- 隐私条 ---------- */
.privacy-banner {
  margin: 0 auto;
  max-width: var(--container);
  padding: 0 24px;
  margin-top: 48px;
}

.privacy-banner__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--cat-document);
  border-radius: var(--radius-lg);
}

.privacy-banner__icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: #ECFDF5;
  color: var(--cat-document);
}

.privacy-banner__text {
  font-size: 14px;
  color: var(--color-ink-soft);
}

.privacy-banner__text strong {
  color: var(--color-ink);
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .tools-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 64px 0 48px;
  }
  .hero__stats {
    gap: 28px;
  }
  .hero__stat-num {
    font-size: 26px;
  }
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .tools-section {
    padding: 48px 0 16px;
  }
  .privacy-banner__inner {
    padding: 16px;
  }
}

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