<script setup>
import SiteHeader from '~/components/site/SiteHeader.vue'
import SiteFooter from '~/components/site/SiteFooter.vue'
import { featuredInsight, insightCategories, insights } from '~/data/insights'

const activeCategory = ref('全部')
const visibleCount = ref(4)
const { openConsultation } = useConsultation()

useHead({
  title: '增长洞察｜大马棒·云途全域 GEO',
  meta: [
    {
      name: 'description',
      content:
        '阅读 AI 搜索、GEO 行业知识、增长实战复盘与行业白皮书，了解品牌在生成式搜索中的增长方法。'
    }
  ]
})

const filteredInsights = computed(() => {
  const list = insights.filter((item) => !item.featured)
  if (activeCategory.value === '全部') return list
  if (activeCategory.value === '最新文章') return list.slice(0, 3)
  return list.filter((item) => item.category === activeCategory.value)
})
const visibleInsights = computed(() => filteredInsights.value.slice(0, visibleCount.value))
const canLoadMore = computed(() => visibleCount.value < filteredInsights.value.length)

watch(activeCategory, () => {
  visibleCount.value = 4
})

function requestDiagnosis(source) {
  openConsultation({ title: '预约免费 GEO 增长诊断', source })
}

function requestWhitepaper(source) {
  openConsultation({
    title: '获取 2026 AI 搜索与品牌增长观察',
    need: '行业白皮书',
    source
  })
}
</script>

<template>
  <div class="insights-page">
    <a class="skip-link" href="#main-content">跳到主要内容</a>
    <SiteHeader />

    <main id="main-content">
      <section class="insights-hero">
        <div class="insights-hero-art" aria-hidden="true"></div>
        <div class="page-width insights-hero-grid">
          <div class="insights-hero-copy">
            <p class="page-eyebrow">全域营销增长洞察</p>
            <h1>行业人在看的东西，<br /><span>全都在这里</span></h1>
            <p>持续记录 AI 搜索的变化、可执行的 GEO 方法，以及我们从真实项目里得到的判断。</p>
            <div class="hero-actions">
              <a href="#insight-library" class="primary-button"
                >开始阅读 <AppIcon name="bottom"
              /></a>
              <button type="button" @click="requestDiagnosis('增长洞察页 Hero')">
                免费诊断品牌可见性
              </button>
            </div>
          </div>
          <div class="editorial-index" aria-label="增长洞察内容索引">
            <div class="index-header"><span>YUNTU / INSIGHTS</span><small>2026.07</small></div>
            <strong>06</strong>
            <p>围绕 AI 搜索、品牌认知与业务转化，建立一套可持续更新的知识索引。</p>
            <div class="index-lines"><i></i><i></i><i></i><i></i></div>
            <div class="index-footer">
              <span>KNOWLEDGE</span><span>PRACTICE</span><span>REPORT</span>
            </div>
          </div>
        </div>
      </section>

      <section id="insight-library" class="insight-library">
        <div class="page-width">
          <header class="library-heading">
            <div>
              <p class="section-kicker">本期推荐</p>
              <h2>先从一个关键变化开始</h2>
            </div>
            <p>AI 不只是新的流量入口，它正在改变用户理解品牌、比较方案和做出选择的方式。</p>
          </header>

          <article class="featured-insight">
            <NuxtLink :to="`/insights/${featuredInsight.slug}`" class="featured-image">
              <img :src="featuredInsight.cover" :alt="featuredInsight.title" />
              <span>EDITOR'S PICK</span>
            </NuxtLink>
            <div class="featured-copy">
              <div class="article-meta">
                <span>{{ featuredInsight.category }}</span
                ><time>{{ featuredInsight.date }}</time>
              </div>
              <h2>
                <NuxtLink :to="`/insights/${featuredInsight.slug}`">{{
                  featuredInsight.title
                }}</NuxtLink>
              </h2>
              <p>{{ featuredInsight.excerpt }}</p>
              <div class="featured-footer">
                <NuxtLink :to="`/insights/${featuredInsight.slug}`"
                  >阅读全文 <AppIcon name="arrow-right"
                /></NuxtLink>
                <span>{{ featuredInsight.readingTime }} · {{ featuredInsight.views }} 阅读</span>
              </div>
            </div>
          </article>

          <nav class="insight-filters" aria-label="洞察文章分类">
            <button
              v-for="category in insightCategories"
              :key="category"
              type="button"
              :class="{ active: activeCategory === category }"
              @click="activeCategory = category"
            >
              {{ category }}
            </button>
          </nav>

          <Transition name="insight-change" mode="out-in">
            <div :key="activeCategory" class="article-results">
              <div v-if="visibleInsights.length" class="article-grid">
                <article
                  v-for="(article, index) in visibleInsights"
                  :key="article.slug"
                  :class="{ lead: index === 0 }"
                >
                  <NuxtLink :to="`/insights/${article.slug}`" class="article-cover">
                    <img :src="article.cover" :alt="article.title" />
                    <span>{{ article.category }}</span>
                  </NuxtLink>
                  <div class="article-copy">
                    <div class="article-meta">
                      <time>{{ article.date }}</time
                      ><span>{{ article.views }} 阅读</span>
                    </div>
                    <h3>
                      <NuxtLink :to="`/insights/${article.slug}`">{{ article.title }}</NuxtLink>
                    </h3>
                    <p>{{ article.excerpt }}</p>
                    <NuxtLink :to="`/insights/${article.slug}`" class="read-link"
                      >查看详情 <AppIcon name="arrow-right"
                    /></NuxtLink>
                  </div>
                </article>
              </div>
              <div v-else class="insight-empty">
                <span>CONTENT IN PROGRESS</span>
                <h3>该分类内容正在整理</h3>
                <p>可以先预约诊断，我们会结合你的行业分享对应的 GEO 判断与资料。</p>
                <button
                  class="primary-button small"
                  type="button"
                  @click="requestDiagnosis('洞察分类空状态')"
                >
                  预约免费诊断 <AppIcon name="arrow-right" />
                </button>
              </div>
              <button v-if="canLoadMore" class="load-more" type="button" @click="visibleCount += 4">
                加载更多 <AppIcon name="plus" />
              </button>
            </div>
          </Transition>
        </div>
      </section>

      <section class="whitepaper-section">
        <div class="whitepaper-art" aria-hidden="true"></div>
        <div class="page-width whitepaper-grid">
          <div class="whitepaper-number"><span>REPORT</span><strong>2026</strong></div>
          <div class="whitepaper-copy">
            <p>行业白皮书</p>
            <h2>AI 搜索与品牌增长观察</h2>
            <span>用户行为 · 内容信源 · 衡量框架 · 行业实践</span>
          </div>
          <button type="button" @click="requestWhitepaper('增长洞察页白皮书')">
            获取白皮书 <AppIcon name="arrow-right" />
          </button>
        </div>
      </section>

      <section class="insights-cta">
        <div class="page-width insights-cta-content">
          <p>阅读方法，也要回到自己的业务</p>
          <h2>看看你的品牌，正在被 AI 如何理解</h2>
          <button
            class="primary-button"
            type="button"
            @click="requestDiagnosis('增长洞察页底部 CTA')"
          >
            预约免费 GEO 诊断 <AppIcon name="arrow-right" />
          </button>
        </div>
      </section>
    </main>
    <SiteFooter />
  </div>
</template>

<style scoped>
.insights-page {
  --insight-blue: #237df0;
  overflow: hidden;
  color: #344359;
  background: #fff;
}
.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: 6px;
  color: #fff;
  background: #1f70df;
  transform: translateY(-150%);
  transition: transform 0.2s;
}
.skip-link:focus {
  transform: translateY(0);
}
.page-eyebrow,
.section-kicker {
  margin: 0;
  color: var(--insight-blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
}
.insights-hero {
  position: relative;
  min-height: 620px;
  display: grid;
  align-items: center;
  isolation: isolate;
  background: #f2f7fd;
}
.insights-hero-art {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(circle at 78% 28%, rgba(66, 151, 251, 0.23), transparent 27%),
    linear-gradient(110deg, #f9fcff, #e8f2ff);
}
.insights-hero-art::after {
  position: absolute;
  inset: 0;
  content: '';
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(54, 124, 214, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(54, 124, 214, 0.08) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: linear-gradient(90deg, transparent 18%, #000);
}
.insights-hero-grid {
  min-height: 620px;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  align-items: center;
  gap: 90px;
  padding: 58px 0 66px;
}
.insights-hero-copy h1 {
  margin: 16px 0 0;
  color: #35465c;
  font-size: clamp(48px, 4.5vw, 72px);
  letter-spacing: -0.055em;
  line-height: 1.16;
}
.insights-hero-copy h1 span {
  color: #1978ef;
}
.insights-hero-copy > p:nth-of-type(2) {
  max-width: 590px;
  margin: 24px 0 0;
  color: #6d7d91;
  font-size: 15px;
  line-height: 1.85;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 31px;
}
.hero-actions a {
  text-decoration: none;
}
.hero-actions > button {
  color: #546b86;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
}
.editorial-index {
  position: relative;
  width: min(570px, 100%);
  min-height: 390px;
  justify-self: end;
  padding: 38px 42px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 4px 24px 4px 24px;
  background: rgba(255, 255, 255, 0.6);
  box-shadow:
    0 30px 65px rgba(56, 117, 193, 0.14),
    inset 0 1px 0 #fff;
  backdrop-filter: blur(14px);
}
.index-header,
.index-footer {
  display: flex;
  justify-content: space-between;
  color: #6e8daf;
  font-size: 9px;
  letter-spacing: 0.12em;
}
.editorial-index > strong {
  display: block;
  margin-top: 37px;
  color: #267fec;
  font-size: 104px;
  font-weight: 600;
  letter-spacing: -0.07em;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}
.editorial-index > p {
  max-width: 360px;
  margin: 23px 0 0;
  color: #5f748d;
  font-size: 14px;
  line-height: 1.75;
}
.index-lines {
  position: absolute;
  top: 75px;
  right: 42px;
  width: 118px;
  display: grid;
  gap: 14px;
}
.index-lines i {
  height: 1px;
  background: #b9d2ec;
  transform-origin: right;
}
.index-lines i:nth-child(2) {
  transform: scaleX(0.7);
}
.index-lines i:nth-child(3) {
  transform: scaleX(0.45);
}
.index-lines i:nth-child(4) {
  transform: scaleX(0.82);
}
.index-footer {
  position: absolute;
  right: 42px;
  bottom: 35px;
  left: 42px;
  padding-top: 17px;
  border-top: 1px solid #d3e1ef;
}
.insight-library {
  padding: 112px 0 132px;
}
.library-heading {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: end;
  gap: 80px;
}
.library-heading h2 {
  margin: 15px 0 0;
  color: #344359;
  font-size: clamp(32px, 3vw, 48px);
  letter-spacing: -0.045em;
  line-height: 1.28;
}
.library-heading > p {
  max-width: 540px;
  margin: 0 0 5px;
  color: #748398;
  font-size: 14px;
  line-height: 1.8;
}
.featured-insight {
  min-height: 450px;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  margin-top: 48px;
  overflow: hidden;
  border-radius: 5px 22px 5px 22px;
  background: #edf6ff;
}
.featured-image {
  position: relative;
  min-height: 450px;
  overflow: hidden;
}
.featured-image::after {
  position: absolute;
  inset: 0;
  content: '';
  background: linear-gradient(90deg, transparent 65%, rgba(237, 246, 255, 0.85));
}
.featured-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.45s;
}
.featured-insight:hover img {
  transform: scale(1.035);
}
.featured-image > span {
  position: absolute;
  z-index: 2;
  top: 28px;
  left: 28px;
  padding: 8px 11px;
  border-radius: 3px;
  color: #fff;
  background: rgba(34, 112, 209, 0.82);
  font-size: 9px;
  letter-spacing: 0.1em;
}
.featured-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 54px 48px 36px;
}
.article-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #8798ab;
  font-size: 10px;
}
.article-meta span:first-child {
  color: #2b7ee5;
  font-weight: 700;
}
.featured-copy h2 {
  margin: 20px 0 0;
  font-size: clamp(30px, 2.6vw, 42px);
  line-height: 1.35;
}
.featured-copy h2 a,
.article-copy h3 a {
  color: #34485f;
  text-decoration: none;
}
.featured-copy > p {
  margin: 18px 0 0;
  color: #718197;
  font-size: 13px;
  line-height: 1.85;
}
.featured-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #cfdeed;
}
.featured-footer a,
.read-link {
  color: #247be8;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.featured-footer > span {
  color: #8997a7;
  font-size: 9px;
}
.insight-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 75px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e0e9f3;
}
.insight-filters button {
  height: 38px;
  padding: 0 17px;
  border-radius: 4px;
  color: #61758c;
  background: #f1f6fc;
  font-size: 12px;
  transition: 0.2s;
}
.insight-filters button:hover,
.insight-filters button.active {
  color: #fff;
  background: #287ff0;
  box-shadow: 0 8px 18px rgba(39, 126, 238, 0.2);
  transform: translateY(-1px);
}
.article-results {
  margin-top: 40px;
}
.article-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
.article-grid article {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  min-height: 285px;
  overflow: hidden;
  border-radius: 14px 4px 14px 4px;
  background: #f3f7fc;
  transition:
    transform 0.25s,
    box-shadow 0.25s,
    background 0.25s;
}
.article-grid article:hover {
  background: #fff;
  box-shadow: 0 20px 42px rgba(61, 119, 189, 0.13);
  transform: translateY(-5px);
}
.article-grid article.lead {
  grid-column: 1 / -1;
  grid-template-columns: 1.05fr 0.95fr;
  min-height: 350px;
}
.article-cover {
  position: relative;
  min-height: 100%;
  overflow: hidden;
}
.article-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.4s;
}
.article-grid article:hover img {
  transform: scale(1.04);
}
.article-cover > span {
  position: absolute;
  top: 18px;
  left: 18px;
  padding: 7px 9px;
  border-radius: 3px;
  color: #fff;
  background: rgba(32, 105, 200, 0.82);
  font-size: 9px;
}
.article-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px;
}
.article-copy h3 {
  margin: 15px 0 0;
  font-size: 20px;
  line-height: 1.45;
}
.article-grid article.lead h3 {
  font-size: 28px;
}
.article-copy > p {
  margin: 12px 0 0;
  color: #75859a;
  font-size: 11px;
  line-height: 1.75;
}
.read-link {
  align-self: flex-start;
  margin-top: 22px;
  padding-bottom: 4px;
  border-bottom: 1px solid #9bc1e9;
}
.load-more {
  min-width: 150px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 42px auto 0;
  border: 1px solid #bad2ea;
  border-radius: 5px;
  color: #527497;
  background: #fff;
  font-size: 12px;
  transition: 0.2s;
}
.load-more:hover {
  color: #247be8;
  border-color: #73aae4;
  transform: translateY(-2px);
}
.insight-empty {
  min-height: 390px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 45px 20px;
  border-radius: 16px 5px 16px 5px;
  background: #f2f7fd;
  text-align: center;
}
.insight-empty > span {
  color: #2a80ea;
  font-size: 9px;
  letter-spacing: 0.14em;
}
.insight-empty h3 {
  margin: 14px 0 0;
  color: #3b4f66;
  font-size: 27px;
}
.insight-empty p {
  max-width: 490px;
  margin: 12px 0 0;
  color: #7b8b9d;
  font-size: 13px;
  line-height: 1.7;
}
.insight-empty button {
  margin-top: 24px;
}
.insight-change-enter-active,
.insight-change-leave-active {
  transition:
    opacity 0.18s,
    transform 0.22s;
}
.insight-change-enter-from {
  opacity: 0;
  transform: translateY(9px);
}
.insight-change-leave-to {
  opacity: 0;
  transform: translateY(-5px);
}
.whitepaper-section {
  position: relative;
  overflow: hidden;
  background: #eaf4ff;
}
.whitepaper-art {
  position: absolute;
  inset: 0;
  background: url('/images/lanhu/slices/home-group98-image24@2x.png') center / cover no-repeat;
  opacity: 0.7;
}
.whitepaper-grid {
  position: relative;
  min-height: 310px;
  display: grid;
  grid-template-columns: 0.65fr 1.35fr auto;
  align-items: center;
  gap: 65px;
}
.whitepaper-number {
  display: grid;
}
.whitepaper-number span {
  color: #6e92b9;
  font-size: 9px;
  letter-spacing: 0.14em;
}
.whitepaper-number strong {
  color: #277fec;
  font-size: 64px;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}
.whitepaper-copy p {
  margin: 0;
  color: #277fec;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}
.whitepaper-copy h2 {
  margin: 13px 0 0;
  color: #395069;
  font-size: 35px;
}
.whitepaper-copy span {
  display: block;
  margin-top: 12px;
  color: #72869c;
  font-size: 12px;
}
.whitepaper-grid > button {
  height: 48px;
  padding: 0 24px;
  border-radius: 5px;
  color: #fff;
  background: #277fec;
  box-shadow: 0 12px 25px rgba(39, 127, 236, 0.2);
  font-size: 12px;
  font-weight: 600;
  transition: 0.2s;
}
.whitepaper-grid > button:hover {
  background: #176ed8;
  transform: translateY(-2px);
}
.insights-cta {
  min-height: 410px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(rgba(248, 252, 255, 0.45), rgba(235, 246, 255, 0.7)),
    url('/images/lanhu/slices/home-group105-image31@2x.png') center / cover no-repeat;
}
.insights-cta-content {
  padding: 74px 0;
  text-align: center;
}
.insights-cta-content p {
  margin: 0;
  color: #237df0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}
.insights-cta-content h2 {
  margin: 17px 0 0;
  color: #3375c5;
  font-size: clamp(32px, 3.2vw, 50px);
  letter-spacing: -0.045em;
  line-height: 1.3;
}
.insights-cta-content button {
  margin-top: 29px;
}
@media (max-width: 980px) {
  .insights-hero,
  .insights-hero-grid {
    min-height: auto;
  }
  .insights-hero-grid,
  .library-heading {
    grid-template-columns: 1fr;
  }
  .insights-hero-grid {
    padding-top: 74px;
    padding-bottom: 66px;
  }
  .editorial-index {
    justify-self: center;
  }
  .library-heading {
    gap: 22px;
  }
  .library-heading > p {
    margin: 0;
  }
  .featured-insight {
    grid-template-columns: 1fr;
  }
  .featured-image {
    min-height: 360px;
  }
  .featured-image::after {
    background: linear-gradient(transparent 65%, #edf6ff);
  }
  .featured-copy {
    padding: 42px;
  }
  .article-grid {
    grid-template-columns: 1fr;
  }
  .article-grid article.lead {
    grid-column: auto;
  }
  .whitepaper-grid {
    grid-template-columns: 0.7fr 1.3fr;
    gap: 35px;
    padding-top: 54px;
    padding-bottom: 54px;
  }
  .whitepaper-grid > button {
    grid-column: 2;
    justify-self: start;
  }
}
@media (max-width: 600px) {
  .insights-hero-grid {
    padding-top: 54px;
  }
  .insights-hero-copy h1 {
    font-size: clamp(39px, 11vw, 52px);
  }
  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }
  .editorial-index {
    min-height: 330px;
    padding: 28px 25px;
  }
  .editorial-index > strong {
    font-size: 82px;
  }
  .index-lines {
    right: 25px;
    width: 85px;
  }
  .index-footer {
    right: 25px;
    bottom: 25px;
    left: 25px;
  }
  .insight-library {
    padding-top: 76px;
    padding-bottom: 86px;
  }
  .featured-image {
    min-height: 245px;
  }
  .featured-copy {
    padding: 30px 22px 34px;
  }
  .featured-footer {
    align-items: flex-start;
    flex-direction: column;
  }
  .insight-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  .insight-filters button {
    flex: 0 0 auto;
  }
  .article-grid article,
  .article-grid article.lead {
    grid-template-columns: 1fr;
  }
  .article-cover {
    min-height: 210px;
  }
  .article-copy {
    padding: 25px 22px;
  }
  .article-grid article.lead h3 {
    font-size: 22px;
  }
  .whitepaper-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .whitepaper-number strong {
    font-size: 52px;
  }
  .whitepaper-copy h2 {
    font-size: 29px;
  }
  .whitepaper-grid > button {
    grid-column: auto;
  }
  .insights-cta {
    min-height: 380px;
  }
}
</style>
