/*
 * 解决方案详情页 —— 1:1 对应设计稿 Astra 6月 / Peak Shaving & Load Shifting 893:650
 * 五个区块共用这一份样式（只会同时出现在详情页模板里）：
 *   首屏   893:651  1920×960，文案居中，标题 48/53(-1.92px) 白 + 红线 100×4 + 副标题 18/25 Bold 白
 *   要点   903:246  居中标题 + 五张要点卡（3+2 自动换行）+ 实心红按钮
 *            卡片内边距 32/25、图标 32、文字 28/34(-0.56px)，hover 底色 #FDF1F1
 *   图廊   903:307  左标题（红线 124）+ 可展开图廊：展开 1023 / 收起 128、间距 12、高 562
 *   通栏   908:484  整幅底图 + 20% 黑蒙版；左标题白字 + 三张 512×208 卡
 *            默认毛玻璃（blur 18、rgba(0,0,0,.4)、描边 #333），hover 转白底黑字
 *   优势   933:1754 左标题 + 三张 458×350 卡：左侧水印大图标、底部 4px 线
 *            默认 #999，hover 转 #E60012
 */

.astra-sd {
  --sd-primary: #e60012;
  --sd-primary-soft: #fdf1f1;
  --sd-text-strong: #000000;
  --sd-text-muted: #808080;
  --sd-text-subtle: #999999;
  --sd-border-subtle: #eaeced;
  --sd-bg: #ffffff;
  --sd-rule-width: 124px;
}

/* 通用：区块标题 */
.astra-sd__header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  width: 100%;
}

.astra-sd__header--center {
  align-items: center;
  text-align: center;
  max-width: 1280px;
  margin: 0 auto;
}

.astra-sd__title {
  margin: 0;
  width: 100%;
  font-size: var(--sd-title-size, 48px);
  line-height: var(--sd-title-line, 53px);
  font-weight: 700;
  letter-spacing: -1.92px;
  color: var(--sd-text-strong);
  overflow-wrap: break-word;
}

.astra-sd__rule {
  flex: 0 0 auto;
  width: var(--sd-rule-width);
  height: 4px;
  background: var(--sd-primary);
}

/* 设计稿里居中款的红线是 100（903:210），左对齐款是 124（903:310 / 908:466 / 933:1757） */
.astra-sd__header--center .astra-sd__rule {
  width: 100px;
}

.astra-sd__sub {
  margin: 0;
  width: 100%;
  font-size: var(--sd-sub-size, 24px);
  line-height: var(--sd-sub-line, 32px);
  font-weight: 600;
  letter-spacing: -0.24px;
  color: var(--sd-text-muted);
}

/* 通用：ASTRA / Button —— Primary 实心 / 高 56 / 图标在右（Figma 467:510） */
.astra-sd__btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 56px;
  padding: 0 24px;
  border: 1px solid var(--sd-primary);
  background: var(--sd-primary);
  font-size: 16px;
  line-height: 20px;
  font-weight: 700;
  letter-spacing: -0.16px;
  color: #ffffff;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.3s, border-color 0.3s;
}

.astra-sd__btn:hover,
.astra-sd__btn:focus-visible {
  background: #c1000f;
  border-color: #c1000f;
}

.astra-sd__btn-icon {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  display: block;
}

.astra-sd__btn-icon path {
  stroke: currentColor;
}

.astra-sd__empty {
  margin: 0;
  padding: 48px 0;
  text-align: center;
  font-size: 18px;
  line-height: 28px;
  color: var(--sd-text-subtle);
}

/* ======================================================= 首屏 893:651 */
.astra-sd-hero {
  --sd-hero-height: 960px;
  --sd-hero-color: #ffffff;
  --sd-hero-overlay: transparent;
  --sd-hero-title-size: 48px;
  --sd-hero-title-line: 53px;
  --sd-hero-sub-size: 18px;
  --sd-hero-sub-line: 25px;

  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: var(--sd-hero-height);
  padding: 48px 0 120px;
  overflow: hidden;
}

.astra-sd-hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.astra-sd-hero__bg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.astra-sd-hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--sd-hero-overlay);
}

.astra-sd-hero__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: calc(var(--sd-hero-content-width, 1440px) + 32px);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  text-align: center;
}

.astra-sd-hero__title {
  margin: 0;
  width: 100%;
  font-size: var(--sd-hero-title-size);
  line-height: var(--sd-hero-title-line);
  font-weight: 700;
  letter-spacing: -1.92px;
  color: var(--sd-hero-color);
  overflow-wrap: break-word;
}

.astra-sd-hero__rule {
  flex: 0 0 auto;
  width: 100px;
  height: 4px;
  background: var(--sd-primary);
}

.astra-sd-hero__sub {
  margin: 0;
  width: 100%;
  max-width: var(--sd-hero-sub-width, 1280px);
  font-size: var(--sd-hero-sub-size);
  line-height: var(--sd-hero-sub-line);
  font-weight: 700;
  letter-spacing: -0.36px;
  color: var(--sd-hero-color);
}

/* ======================================================= 要点 903:246 */
.astra-sd-points {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sd-points-gap, 96px);
  padding: var(--sd-points-padding, 120px) 0;
}

/* 设计稿 3+2：靠 flex-wrap 自然分行，末行两张会自动撑满 */
.astra-sd-points__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  width: 100%;
  padding: 0 12px;
}

.astra-sd-points__card {
  flex: 1 1 calc(33.333% - 14px);
  min-width: 260px;
  min-height: 229px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px 25px;
  background: var(--sd-bg);
  transition: background-color 0.3s;
}

.astra-sd-points__card:hover {
  background: var(--sd-primary-soft);
}

.astra-sd-points__icon {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: block;
}

.astra-sd-points__icon img,
.astra-sd-points__icon svg {
  display: block;
  width: 32px;
  height: 32px;
}

.astra-sd-points__text {
  margin: 0;
  font-size: var(--sd-point-size, 28px);
  line-height: var(--sd-point-line, 34px);
  font-weight: 600;
  letter-spacing: -0.56px;
  color: var(--sd-text-strong);
}

/* ======================================================= 图廊 903:307 */
.astra-sd-gallery {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sd-gallery-gap, 96px);
  padding: var(--sd-gallery-padding, 120px) 0;
  background: var(--sd-bg);
}

.astra-sd-gallery__strip {
  display: flex;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  height: var(--sd-gallery-height, 562px);
}

/* 展开只动 flex-grow，flex-basis 始终是收起宽度。
 * 不能用 flex 简写把 basis 换成 auto —— auto 和长度之间无法插值，
 * 宽度会跳变，跳变又让元素在光标下错位、连锁触发相邻项的 hover，就是闪动的来源。 */
.astra-sd-gallery__item {
  position: relative;
  flex-grow: 0;
  flex-shrink: 0;
  flex-basis: var(--sd-gallery-collapsed, 128px);
  min-width: 0;
  overflow: hidden;
  cursor: pointer;
  will-change: flex-grow;
  transition: flex-grow 0.45s ease;
}

.astra-sd-gallery__item.is-active {
  flex-grow: 1;
}

.astra-sd-gallery__item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 文案只在展开的那张上显示，位置按设计稿 903:319 / 903:323 */
/* 收起时立刻淡出（文字要赶在宽度缩下去之前消失，否则会在窄条里挤成一团闪一下）；
 * 展开时等宽度铺开一点再淡入。不用 visibility：它是跳变的，会顿一下。 */
.astra-sd-gallery__caption {
  position: absolute;
  left: 70px;
  right: 70px;
  bottom: 45px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.astra-sd-gallery__item.is-active .astra-sd-gallery__caption {
  opacity: 1;
  transition: opacity 0.35s ease 0.2s;
}

.astra-sd-gallery__cap-title {
  margin: 0;
  font-size: var(--sd-gallery-title-size, 36px);
  line-height: 40px;
  font-weight: 700;
  letter-spacing: -0.72px;
  color: #ffffff;
}

.astra-sd-gallery__cap-desc {
  margin: 0;
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
  letter-spacing: -0.24px;
  color: #ffffff;
}

/* ======================================================= 通栏 908:484 */
.astra-sd-banner {
  --sd-banner-height: 960px;
  --sd-banner-overlay: rgba(0, 0, 0, 0.2);

  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: var(--sd-banner-gap, 273px);
  min-height: var(--sd-banner-height);
  padding: var(--sd-banner-padding, 96px) 160px;
  overflow: hidden;
}

.astra-sd-banner__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.astra-sd-banner__bg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.astra-sd-banner__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--sd-banner-overlay);
}

.astra-sd-banner__header {
  position: relative;
  z-index: 1;
  max-width: 1434px;
}

.astra-sd-banner__header .astra-sd__title {
  color: #ffffff;
}

.astra-sd-banner__header .astra-sd__sub {
  color: #f9f9f9;
}

.astra-sd-banner__cards {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: stretch;
  gap: 32px;
  width: 100%;
}

.astra-sd-banner__card {
  flex: 1 1 0;
  min-width: 0;
  min-height: 208px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 36px;
  padding: 36px;
  border: 1px solid #333333;
  background: rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  color: #ffffff;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.astra-sd-banner__card:hover {
  background: var(--sd-bg);
  border-color: var(--sd-bg);
  color: var(--sd-text-strong);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.astra-sd-banner__card-title {
  margin: 0;
  font-size: 28px;
  line-height: 34px;
  font-weight: 600;
  letter-spacing: -0.56px;
  color: inherit;
}

.astra-sd-banner__card-desc {
  margin: 0;
  font-size: 18px;
  line-height: 25px;
  font-weight: 700;
  letter-spacing: -0.36px;
  color: inherit;
}

/* ===================================================== 优势 933:1754 */
.astra-sd-adv {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sd-adv-gap, 120px);
  padding: var(--sd-adv-padding, 120px) 0;
}

.astra-sd-adv__grid {
  display: flex;
  align-items: stretch;
  gap: 32px;
  width: 100%;
}

.astra-sd-adv__card {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  min-height: 350px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 35px 50px 63px;
  background: var(--sd-bg);
  border: 1px solid var(--sd-border-subtle);
  overflow: hidden;
}

/* 水印图标从左边缘探出来一半，SVG 自带 0.045 透明度 */
.astra-sd-adv__watermark {
  position: absolute;
  left: -151px;
  top: 9px;
  width: 300px;
  height: 300px;
  pointer-events: none;
}

.astra-sd-adv__watermark img,
.astra-sd-adv__watermark svg {
  display: block;
  width: 300px;
  height: 300px;
}

.astra-sd-adv__card-title,
.astra-sd-adv__card-desc {
  position: relative;
  z-index: 1;
  margin: 0;
}

.astra-sd-adv__card-title {
  font-size: 28px;
  line-height: 34px;
  font-weight: 600;
  letter-spacing: -0.56px;
  color: var(--sd-text-strong);
}

.astra-sd-adv__card-desc {
  font-size: 18px;
  line-height: 25px;
  font-weight: 700;
  letter-spacing: -0.36px;
  color: var(--sd-text-muted);
}

/* 底部 4px 线：默认 #999，hover 转主色（设计稿把首卡画成了 hover 态） */
.astra-sd-adv__card::after {
  content: "";
  position: absolute;
  left: -1px;
  right: -1px;
  bottom: -1px;
  height: 4px;
  background: var(--sd-text-subtle);
  transition: background-color 0.3s;
}

.astra-sd-adv__card:hover::after {
  background: var(--sd-primary);
}

/* ---------------------------------------------------------- 响应式 */
/* 设计稿只有 1920 桌面稿。上下留白、字号行高由组件的响应式控制项按断点输出，
 * 本段只处理控制项没覆盖的排布与固定尺寸。 */
@media (max-width: 1768px) {
  .astra-sd-banner {
    padding-left: 6%;
    padding-right: 6%;
  }
}

@media (max-width: 1400px) {
  .astra-sd-gallery__item {
    flex-basis: 96px;
  }

  .astra-sd-gallery__caption {
    left: 40px;
    right: 40px;
    bottom: 32px;
  }

  .astra-sd-adv__card {
    padding: 32px 36px 48px;
  }

  .astra-sd-adv__watermark,
  .astra-sd-adv__watermark img,
  .astra-sd-adv__watermark svg {
    width: 240px;
    height: 240px;
  }

  .astra-sd-adv__watermark {
    left: -120px;
  }
}

@media (max-width: 1200px) {
  .astra-sd-points__card {
    flex: 1 1 calc(50% - 10px);
  }

  /* 窄屏图廊改成上下堆叠，全部展开 */
  .astra-sd-gallery__strip {
    flex-direction: column;
    height: auto;
  }

  .astra-sd-gallery__item,
  .astra-sd-gallery__item.is-active {
    flex: 1 1 auto;
    height: 320px;
    cursor: default;
    will-change: auto;
    transition: none;
  }

  .astra-sd-gallery__caption,
  .astra-sd-gallery__item.is-active .astra-sd-gallery__caption {
    opacity: 1;
    transition: none;
  }

  .astra-sd-banner {
    gap: 64px;
  }

  .astra-sd-banner__cards {
    flex-wrap: wrap;
  }

  .astra-sd-banner__card {
    flex: 1 1 calc(50% - 16px);
    min-width: 260px;
  }

  .astra-sd-adv__grid {
    flex-wrap: wrap;
  }

  .astra-sd-adv__card {
    flex: 1 1 calc(50% - 16px);
    min-width: 280px;
  }
}

@media (max-width: 768px) {
  .astra-sd__title {
    font-size: clamp(15px, 4.8vw, 26px);
    line-height: clamp(18.46px, 5.91vw, 32px);
    letter-spacing: -0.5px;
  }

  .astra-sd__sub {
    font-size: clamp(12px, 3.6vw, 15px);
    line-height: clamp(19.2px, 5.76vw, 24px);
  }

  .astra-sd__btn {
    width: 100%;
    height: 48px;
    font-size: clamp(12px, 3.6vw, 15px);
  }

  .astra-sd-points {
    gap: 40px;
  }

  .astra-sd-points__grid {
    padding: 0;
  }

  .astra-sd-points__card {
    flex: 1 1 100%;
    min-height: 0;
    padding: 24px 20px;
  }

  .astra-sd-points__text {
    font-size: clamp(12px, 3.8vw, 18px);
    line-height: clamp(17.33px, 5.49vw, 26px);
  }

  .astra-sd-gallery {
    gap: 40px;
  }

  .astra-sd-gallery__item,
  .astra-sd-gallery__item.is-active {
    height: 240px;
  }

  .astra-sd-gallery__cap-title {
    font-size: clamp(13px, 4.2vw, 22px);
    line-height: clamp(16.55px, 5.35vw, 28px);
  }

  .astra-sd-gallery__cap-desc {
    font-size: clamp(12px, 3.6vw, 15px);
    line-height: clamp(19.2px, 5.76vw, 24px);
  }

  .astra-sd-banner {
    padding: 48px 16px;
    gap: 40px;
  }

  .astra-sd-banner__card {
    flex: 1 1 100%;
    padding: 24px;
    gap: 16px;
  }

  .astra-sd-banner__card-title,
  .astra-sd-adv__card-title {
    font-size: clamp(13px, 4.2vw, 20px);
    line-height: clamp(18.2px, 5.88vw, 28px);
  }

  .astra-sd-banner__card-desc,
  .astra-sd-adv__card-desc {
    font-size: clamp(12px, 3.6vw, 15px);
    line-height: clamp(19.2px, 5.76vw, 24px);
  }

  .astra-sd-adv {
    gap: 40px;
  }

  .astra-sd-adv__card {
    flex: 1 1 100%;
    min-height: 0;
    padding: 24px 24px 40px;
  }
}
