:root {
  --home-design-width: 1920;
  --home-min-width: 1280px;
  --home-fluid-width: max(100vw, var(--home-min-width));
  --home-text: #111827;
  --home-muted: #1E1D29;
  --home-primary: #155eef;
  --home-primary-hover: #004eea;
  --home-surface: #ffffff;
  --home-border: #dbe2ea;
  --home-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

body {
  color: var(--home-text);
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

.cms-home-root {
  width: 100%;
}

/* 第一个 section：核心 API 产品 */
.home-api-product {
  width: 100%;
  min-height: 993px;
  height: 993px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 120px 48px 48px;
  box-sizing: border-box;
}

.home-api-product__header {
  text-align: center;
  max-width: 960px;
}

.home-api-product__title {
  font-weight: 600;
  font-size: 36px;
  color: #1D2129;
  letter-spacing: -0.02em;
}

.home-api-product__subtitle {
  font-weight: 400;
  font-size: 14px;
  color: #656A7B;
  margin-top: 8px;
}

.home-api-product__tabs {
  margin-top: 63px;
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}

.home-api-product__tab {
  border: none;
  background: none;
  padding: 0 4px 12px;
  font-family: inherit;
  font-size: 20px;
  font-weight: 400;
  color: #1d2129;
  cursor: pointer;
  border-bottom: 3px solid transparent;
}

.home-api-product__tab--active {
  color: var(--home-primary);
  border-bottom-color: var(--home-primary);
  font-weight: 600;
}

.home-api-product__card {
  margin-top: 36px;
  width: 1200px;
  display: flex;
  flex-direction: column;
}

.home-api-product__card-main {
  flex: 0 0 480px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 700px;
  gap: 40px;
  align-items: stretch;
  overflow: hidden;
  background: #fff;
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #dde2e9;
}

/* 左侧以「法律咨询」4 条卖点为最低高度，后两个 tab 仅 3 条时容器仍同高 */
.home-api-product__copy {
  flex: 1;
  position: relative;
  min-width: 0;
  padding: 36px 0 51px 36px;
  transition: opacity 0.35s ease;
}

.home-api-product__card-title {
  font-weight: 600;
  font-size: 32px;
  color: #1D2129;
  line-height: 1.3;
}

.home-api-product__features {
  margin-top: 28px;
  list-style: none;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.home-api-product__feature + .home-api-product__feature {
  margin-top: 20px;
}

.home-api-product__feature {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.home-api-product__feature-text,
.home-api-product__feature-text strong {
  font-weight: 400;
  font-size: 14px;
  line-height: 22px;
  color: #656A7B;
}

/* 列表图标：16px 图放在 22×22 对齐格内 */
.home-api-product__icon-slot {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

.home-api-product__icon-slot img {
  width: 16px;
  height: 16px;
  display: block;
}

.home-api-product__cta {
  position: absolute;
  left: 36px;
  bottom: 51px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 116px;
  height: 42px;
  padding: 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  text-decoration: none;
  background: linear-gradient(90deg, #2651f9 0%, #791afa 100%);
}

.home-api-product__cta:hover {
  color: #ffffff;
}

/* 右侧：外层渐变背景；内层 .media-figure 留给产品截图 */
.home-api-product__media-slot {
  position: relative;
  width: 700px;
  min-height: 478px;
  flex-shrink: 0;
  overflow: hidden;
  margin-right: 2px;
  border-radius: 16px;
  background: linear-gradient(89deg, #ffffff 0%, #f1f5fe 54.19%, #f6f8ff 100%);
}

.home-api-product__media-figure {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
}

/* 多图叠放只切显隐，避免改 src 触发重解码闪烁 */
.home-api-product__shot {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 624px;
  height: 349px;
  max-width: calc(100% - 48px);
  max-height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
}

.home-api-product__shot--active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

/* 第二个 section：原子化 AI 技能（小屏在下方 @media 覆盖） */
.home-ai-skills {
  width: 100%;
  height: 612px;
  min-height: 612px;
  box-sizing: border-box;
  background-color: #f6f8ff;
  background-image: url("https://cdn.law.xiaomugua.cn/openapi/ai-skills-bg.png");
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 48px;
}

.home-ai-skills__inner {
  width: 100%;
  max-width: 1200px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 720px;
  gap: 48px;
  align-items: center;
}

.home-ai-skills__copy {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.home-ai-skills__tag {
  align-self: flex-start;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 26px;
  padding: 0;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #1d2129;
  background: #e2e7fc;
}

.home-ai-skills__title {
  margin: 12px 0 0;
  font-size: 36px;
  font-weight: 600;
  color: #1d2129;
  line-height: 1.25;
}

.home-ai-skills__list {
  list-style: none;
  margin: 51px 0 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.home-ai-skills__item {
  margin: 0;
}

.home-ai-skills__item-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: #1d2129;
  line-height: 1.35;
}

.home-ai-skills__item-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.home-ai-skills__icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-top: 2px;
}

.home-ai-skills__icon img {
  width: 16px;
  height: 16px;
  display: block;
}

.home-ai-skills__item-desc {
  margin: 0;
  font-size: 15px;
  line-height: 1.75;
  color: #656a7b;
}

.home-ai-skills__visual {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.home-ai-skills__visual img {
  width: 720px;
  height: 432px;
  display: block;
  object-fit: contain;
}

@media (max-width: 900px) {
  .home-api-product {
    height: auto;
    min-height: auto;
    padding: 40px 20px 36px;
  }

  .home-api-product__title {
    font-size: 28px;
  }

  .home-api-product__tabs {
    gap: 24px;
  }

  .home-api-product__card {
    width: 100%;
    min-height: 0;
  }

  .home-api-product__card-main {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 0;
  }

  .home-api-product__copy {
    padding: 28px 24px;
  }

  .home-api-product__media-slot {
    width: 100%;
    max-width: 700px;
    min-height: 0;
    height: auto;
    aspect-ratio: 700 / 478;
    order: -1;
  }

  .home-api-product__shot {
    width: min(100%, 624px);
    height: auto;
    aspect-ratio: 624 / 349;
    max-width: calc(100% - 32px);
  }

  .home-ai-skills {
    height: auto;
    min-height: 0;
    padding: 40px 20px;
  }

  .home-ai-skills__inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .home-ai-skills__visual {
    justify-content: center;
  }

  .home-ai-skills__visual img {
    width: 100%;
    max-width: 720px;
    height: auto;
    aspect-ratio: 720 / 432;
  }

  /* 第三部分小屏：整块仍属同一 section */
  .home-scenarios {
    height: auto;
    min-height: 0;
    padding: 0;
  }

  .home-scenarios__title {
    font-size: 28px;
  }

  .home-scenarios__cards {
    flex-direction: column;
    align-items: stretch;
  }

  .home-scenarios__card {
    flex: none;
    width: 100%;
    max-width: 380px;
    height: auto;
    min-height: 284px;
  }

  .home-scenarios__steps {
    display: flex;
    flex-direction: column;
    gap: 28px;
  }

  .home-scenarios__step-gap {
    display: none;
  }

  .home-scenarios__step:not(:last-child) {
    border-bottom: 1px dashed #e4e5eb;
    padding-bottom: 28px;
  }
}

/* 第三个 section：赋能场景 — 页眉、三卡、接入流程均在本节（第四部分未单独开发） */
.home-scenarios {
  width: 100%;
  height: 1108px;
  min-height: 1108px;
  box-sizing: border-box;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
}

.home-scenarios__header {
  margin-top: 135px;
  text-align: center;
  max-width: 960px;
}

.home-scenarios__title {
  font-weight: 600;
  font-size: 36px;
  color: #1d2129;
  line-height: 1.25;
}

.home-scenarios__subtitle {
  margin: 12px 0 0;
    font-weight: 400;
    font-size: 14px;
    color: #656A7B;
}

.home-scenarios__cards {
  margin-top: 51px;
  width: 100%;
  max-width: 1200px;
  display: flex;
  justify-content: center;
  gap: 24px;
}

.home-scenarios__card {
  flex: 0 0 380px;
  box-sizing: border-box;
  width: 380px;
  height: 284px;
  padding: 32px 24px 53px 24px;
  background: #ffffff;
  border: 1px solid #dde2e9;
  border-radius: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.home-scenarios__card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.home-scenarios__icon-slot {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-scenarios__icon-slot img {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.home-scenarios__card-title {
  margin: 24px 0 0;
  font-size: 18px;
  font-weight: 600;
  color: #1d2129;
  line-height: 1.35;
}

.home-scenarios__card-desc {
  margin: 24px 0 0;
  font-weight: 400;
  font-size: 16px;
  width: 332px;
  color: #1E1D29;
  line-height: 28px;
}

.home-scenarios__process {
  margin-top: 150px;
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.home-scenarios__process-title {
  font-weight: 600;
  font-size: 36px;
  color: #1D2129;
  line-height: 1.3;
}

/* 四列等分 + 三列居中分隔，避免线贴在某一侧步骤里 */
.home-scenarios__steps {
  margin: 120px 0 0;
  padding: 0;
  list-style: none;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: center;
}

.home-scenarios__step {
  display: flex;
  justify-content: center;
  min-width: 0;
  padding: 0 8px;
}

.home-scenarios__step-gap {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-scenarios__step-line {
  display: block;
  width: 107px;
  height: 0;
  box-sizing: border-box;
  border: none;
  border-top: 1px dashed #e4e5eb;
}

.home-scenarios__step-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}

.home-scenarios__step-num {
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  background: linear-gradient(to bottom, #2651F9, #ffffff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.home-scenarios__step-name {
  margin: 4px 0 0;
  font-weight: 600;
  font-size: 24px;
  color: #1D2129;
  line-height: 1.35;
}

.home-scenarios__step-note {
  margin: 16px 0 0;
  font-weight: 400;
  font-size: 16px;
  color: #57637D;
}

/* 第四部分：底部 CTA */
.home-bottom-cta {
  width: 100%;
  height: 280px;
  min-height: 280px;
  box-sizing: border-box;
  background-color: #f3f6ff;
  background-image: url("https://cdn.law.xiaomugua.cn/openapi/bottom_bg.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 60px;
}

.home-bottom-cta__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 24px;
  max-width: 960px;
}

.home-bottom-cta__title {
  margin: 0;
  font-weight: 600;
  font-size: 36px;
  color: #1d2129;
  line-height: 1.3;
}

.home-bottom-cta__btn {
  margin-top: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 234px;
  height: 78px;
  padding: 0;
    border-radius: 12px;
    font-weight: 500;
    font-size: 26px;
    color: #FFFFFF;
    font-family: inherit;
    color: #ffffff;
    text-decoration: none;
  cursor: pointer;
  background: linear-gradient(90deg, #2651f9 0%, #791afa 100%);
}

.home-bottom-cta__btn:hover {
  color: #ffffff;
}

.feature-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.feature-card {
  background: var(--home-surface);
  border: 1px solid var(--home-border);
  border-radius: 16px;
  padding: 22px 20px;
}

.feature-card h2 {
  margin: 0;
  font-size: 20px;
}

.feature-card p {
  margin: 10px 0 0;
  color: var(--home-muted);
  line-height: 1.75;
}

@media (max-width: 900px) {
  .cms-home-root {
    width: calc(100% - 28px);
    padding: 22px 0 44px;
  }

  .home-bottom-cta {
    height: auto;
    min-height: 280px;
    padding: 40px 24px 48px;
  }

  .home-bottom-cta__title {
    font-size: 24px;
  }

  .home-bottom-cta__btn {
    width: min(234px, 100%);
    height: auto;
    min-height: 52px;
    padding: 14px 24px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }
}

/* 滚动入场动画：初始下移并透明，进入视口后淡入并回到原位 */
.home-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
  will-change: transform, opacity;
}

.home-reveal--visible {
  opacity: 1;
  transform: translateY(0);
}
