/* ==========================================================================
 * 首页专属样式 (ecapi.cn)
 * ========================================================================== */

/* ---------- Banner 轮播（公共组件，文章/文档页复用） ---------- */
.carousel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-700);
  box-shadow: var(--shadow);
}
.carousel__track { position: relative; width: 100%; padding-top: 42%; }
.carousel__slide {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  display: block;
  opacity: 0;
  transition: opacity .6s ease;
  pointer-events: none;
}
.carousel__slide.is-active { opacity: 1; pointer-events: auto; }
.carousel__slide img { display: block; width: 100%; height: 100%; object-fit: cover; }
.carousel__dots {
  position: absolute; left: 0; right: 0; bottom: 16px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  z-index: 2;
}
.carousel__dot {
  width: 8px; height: 8px; padding: 0;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .45);
  border: 1px solid rgba(255, 255, 255, .3);
  transition: width .25s ease, background .25s ease;
}
.carousel__dot.is-active { width: 24px; background: var(--accent); border-color: var(--accent); }
.carousel__arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(6, 10, 26, .55);
  border: 1px solid var(--border-strong);
  color: #fff; font-size: 22px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .25s ease, background .25s ease;
}
.carousel:hover .carousel__arrow { opacity: 1; }
.carousel__arrow:hover { background: var(--primary); }
.carousel__arrow--prev { left: 14px; }
.carousel__arrow--next { right: 14px; }

/* ---------- Hero ---------- */
.home-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 500px at 78% 12%, rgba(59, 110, 246, .20), transparent 65%),
    radial-gradient(600px 400px at 8% 88%, rgba(56, 189, 248, .10), transparent 70%),
    linear-gradient(180deg, var(--bg-900), var(--bg-800));
  border-bottom: 1px solid var(--border);
}
.home-hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(120, 140, 220, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 140, 220, .05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.9), transparent 85%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.9), transparent 85%);
  pointer-events: none;
}
.home-hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr);
  gap: 56px;
  align-items: center;
  padding: 84px 0 92px;
}
.home-hero__tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--primary-soft);
  color: var(--primary-2);
  font-size: 13px;
  margin-bottom: 24px;
}
.home-hero__tag::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 6px rgba(56, 189, 248, .4);
}
.home-hero__title {
  font-size: 44px;
  line-height: 1.28;
  font-weight: 700;
  letter-spacing: .01em;
  color: #fff;
}
.home-hero__title em {
  font-style: normal;
  background: linear-gradient(120deg, var(--primary-2), var(--accent));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.home-hero__desc {
  margin-top: 20px;
  color: var(--text-2);
  font-size: 16px;
  line-height: 1.9;
  max-width: 480px;
}
.home-hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.home-hero__meta {
  display: flex; flex-wrap: wrap; gap: 24px;
  margin-top: 40px; padding-top: 26px;
  border-top: 1px solid var(--border);
  color: var(--text-3); font-size: 13px;
}
.home-hero__meta span::before { content: "✓"; color: var(--success); margin-right: 7px; font-weight: 700; }
.home-hero__visual { min-width: 0; }

/* 入场动效：首屏元素依次淡入上移（系统开启"减少动画"时由全局规则禁用） */
@media (prefers-reduced-motion: no-preference) {
  .home-hero__tag, .home-hero__title, .home-hero__desc,
  .home-hero__actions, .home-hero__meta {
    animation: hero-rise .55s ease-out both;
  }
  .home-hero__title { animation-delay: .05s; }
  .home-hero__desc { animation-delay: .12s; }
  .home-hero__actions { animation-delay: .18s; }
  .home-hero__meta { animation-delay: .24s; }
}
@keyframes hero-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 无广告数据时展示的静态能力卡 */
.home-hero__panel {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: linear-gradient(145deg, var(--bg-700), var(--bg-800));
  padding: 30px;
  box-shadow: var(--shadow);
}
.home-hero__panel-head { display: flex; align-items: center; gap: 8px; margin-bottom: 22px; }
.home-hero__panel-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); }
.home-hero__panel-dot:nth-child(2) { background: var(--warn); }
.home-hero__panel-dot:nth-child(3) { background: var(--success); }
.home-hero__panel-title { margin-left: 8px; color: var(--text-3); font-size: 12px; font-family: var(--mono); }
.home-hero__panel code {
  display: block;
  font-family: var(--mono); font-size: 13px; line-height: 2;
  color: #B8C6F5;
  word-break: break-all;
}
.home-hero__panel .k { color: var(--primary-2); }
.home-hero__panel .s { color: var(--success); }
.home-hero__panel .n { color: var(--accent); }
.home-hero__panel-foot {
  margin-top: 22px; padding-top: 18px;
  border-top: 1px dashed var(--border);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: 13px; color: var(--text-2);
}

/* ---------- 数据看板（白色悬浮卡，骑跨 Hero 深色区与浅色内容区交界） ---------- */
.home-data {
  position: relative; z-index: 5;
  margin-top: -54px;
}
.home-data__inner {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 18px 0;
  font-size: 15px; color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-light);
  padding: 30px 12px 26px;
}
.home-data__item { display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 0 26px; }
.home-data__item + .home-data__item { border-left: 1px solid var(--border-light); }
.home-data__note { text-align: center; color: var(--ink-3); font-size: 12px; margin-top: 14px; }

/* ---------- 主营产品 ---------- */
.home-product__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.home-product__card { position: relative; overflow: hidden; }
.home-product__card::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: var(--metal);
  transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
}
.home-product__card:hover::after { transform: scaleX(1); }
.home-product__letter {
  width: 56px; height: 56px; margin-bottom: 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  border: 1px solid rgba(59,110,246,.22);
  color: var(--primary); font-size: 17px; font-weight: 700; letter-spacing: .04em;
}
.home-product__list { margin-top: 18px; display: grid; gap: 7px; }
.home-product__list li {
  position: relative; padding-left: 16px;
  font-size: 13px; color: var(--ink-3); line-height: 1.6;
}
.home-product__list li::before {
  content: ""; position: absolute; left: 2px; top: 9px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--primary);
}

/* ---------- 接入方案 ---------- */
.home-solution { background: var(--surface-2); border-top: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light); }
.home-solution__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.home-solution__card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 24px 22px;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.home-solution__card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-light-sm);
  color: inherit;
}
.home-solution__index {
  font-family: var(--mono); font-size: 12px; color: var(--primary);
  letter-spacing: .1em; margin-bottom: 12px;
}
.home-solution__title { font-size: 18px; font-weight: 600; color: var(--ink); }
.home-solution__desc { margin-top: 8px; font-size: 13px; color: var(--ink-3); line-height: 1.7; }
.home-solution__more {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 16px; font-size: 13px; color: var(--primary);
}
.home-solution__more::after { content: "\2192"; transition: transform .2s ease; }
.home-solution__card:hover .home-solution__more::after { transform: translateX(4px); }

/* ---------- 合作伙伴 ---------- */
.home-partner__grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}
.home-partner__item {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 18px 10px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  transition: border-color .25s ease, transform .25s ease;
}
.home-partner__item:hover { border-color: var(--border-light-strong); transform: translateY(-3px); }
.home-partner__logo {
  width: 60px; height: 60px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px; background: #fff;
  overflow: hidden;
}
.home-partner__logo img { width: 54px; height: 54px; object-fit: contain; }
.home-partner__name { font-size: 13px; color: var(--ink-2); text-align: center; }

/* ---------- 快速接入 ---------- */
.home-steps { background: var(--surface-2); border-top: 1px solid var(--border-light); }
.home-steps__grid {
  position: relative;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px;
}
.home-steps__grid::before {
  content: ""; position: absolute; top: 34px; left: 12%; right: 12%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-light-strong) 15%, var(--border-light-strong) 85%, transparent);
}
.home-steps__item { text-align: center; position: relative; }
.home-steps__num {
  width: 68px; height: 68px; margin: 0 auto 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-light-strong);
  box-shadow: 0 0 0 8px var(--surface-2), var(--glow-sm);
  font-family: var(--mono); font-size: 24px; font-weight: 700; color: var(--primary);
}
.home-steps__title { font-size: 17px; font-weight: 600; color: var(--ink); }
.home-steps__desc { margin-top: 8px; font-size: 13px; color: var(--ink-3); }
.home-steps__cta { text-align: center; margin-top: 48px; }

/* ---------- 底部 CTA ---------- */
.home-cta {
  position: relative; overflow: hidden;
  padding: 76px 0;
  background: linear-gradient(120deg, #102258, #0A1338 55%, #072033);
  border-top: 1px solid var(--border);
}
.home-cta::before {
  content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%;
  right: -140px; top: -260px;
  background: radial-gradient(circle, rgba(56, 189, 248, .14), transparent 70%);
  pointer-events: none;
}
.home-cta__inner { position: relative; text-align: center; }
.home-cta__title { font-size: 32px; font-weight: 600; color: #fff; }
.home-cta__desc { margin-top: 14px; color: var(--text-2); font-size: 15px; }
.home-cta__actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin-top: 30px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1200px) {
  .home-hero__inner { grid-template-columns: 1fr; gap: 40px; padding: 64px 0 72px; }
  .home-hero__title { font-size: 38px; }
  .home-hero__desc { max-width: none; }
  .home-product__grid, .home-solution__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-partner__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 992px) {
  .home-data__item { padding: 0 16px; }
  .home-steps__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 20px; }
  .home-steps__grid::before { display: none; }
}
@media (max-width: 768px) {
  .home-hero__inner { padding: 48px 0 56px; }
  .home-hero__title { font-size: 30px; }
  .home-hero__desc { font-size: 14px; }
  .home-hero__meta { gap: 12px 18px; font-size: 12px; }
  .home-data__inner { flex-direction: column; gap: 14px; }
  .home-data__item { padding: 0; }
  .home-data__item + .home-data__item { border-left: 0; }
  .home-product__grid, .home-solution__grid { grid-template-columns: 1fr; }
  .home-partner__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .home-partner__logo { width: 48px; height: 48px; }
  .home-partner__logo img { width: 44px; height: 44px; }
  .home-cta { padding: 56px 0; }
  .home-cta__title { font-size: 24px; }
  .carousel__track { padding-top: 52%; }
}
@media (max-width: 480px) {
  .home-hero__title { font-size: 26px; }
  .home-hero__actions .btn { flex: 1; }
  .home-partner__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-steps__grid { grid-template-columns: 1fr; }
  .carousel__arrow { display: none; }
}
