/* ==========================================================================
   首页（index.html）
   沿用 style.css 的设计 token：白色底、细线分割、4px 小圆角、
   橙色 --accent 作为唯一强调色。插画已统一为暖石墨灰 + 橙。
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. 首页专用 token
   -------------------------------------------------------------------------- */

.home {
  --home-ink: #2b2b2b;          /* 主标题，同 .page-intro h1 */
  --home-body: #5a5a5a;        /* 正文 */
  --home-muted: #8c8c8c;       /* 次级说明 */
  --home-line: #ececec;        /* 细线 */
  --home-line-strong: #e0e0e0;
  --home-wash: #fafafa;        /* 极浅底色 */
  --home-wash-2: #f5f5f5;

  font-size: 16px;
  color: var(--home-body);
  background: #fff;
}

/* 锚点跳转时给吸顶头部留出空间，避免标题被压住 */
.home [id] {
  scroll-margin-top: calc(var(--header-h) + 16px);
}

/* 首页内不需要演示用的留白块 */
.home .container {
  width: min(100% - var(--gutter) * 2, var(--maxw));
  margin-inline: auto;
}

/* --------------------------------------------------------------------------
   1. 通用：按钮 / 区块标题
   -------------------------------------------------------------------------- */

.home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 26px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--accent);
  transition: background-color 0.22s var(--ease), color 0.22s var(--ease),
    border-color 0.22s var(--ease);
}

.home-btn:hover {
  background: #e58c12;
}

.home-btn__arrow {
  transition: transform 0.22s var(--ease);
}

.home-btn:hover .home-btn__arrow {
  transform: translateX(4px);
}

/* 描边按钮：鼠标悬停时填充橙色 */
.home-btn--ghost {
  color: var(--home-ink);
  background: transparent;
  border-color: var(--home-line-strong);
}

.home-btn--ghost:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

/* 文字链接 */
.home-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
}

.home-link span {
  transition: transform 0.22s var(--ease);
}

.home-link:hover span {
  transform: translateX(5px);
}

/* 区块标题组：左侧短橙线 + 标题 */
.home-section {
  padding: clamp(56px, 6vw, 104px) 0;
}

.home-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: clamp(26px, 2.6vw, 44px);
}

.home-head__eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.26em;
  color: var(--accent);
  text-transform: uppercase;
}

.home-head__eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--accent);
}

.home-head__title {
  margin: 0;
  font-size: clamp(24px, 2.3vw, 40px);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: var(--home-ink);
}

.home-head__lead {
  margin: 14px 0 0;
  max-width: 52ch;
  font-size: clamp(14px, 0.98vw, 16px);
  line-height: 1.9;
  color: var(--home-muted);
}

/* 居中变体 */
.home-head--center {
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.home-head--center .home-head__eyebrow {
  justify-content: center;
}

.home-head--center .home-head__lead {
  margin-inline: auto;
}

/* --------------------------------------------------------------------------
   2. 首屏轮播
   -------------------------------------------------------------------------- */

.home-hero {
  position: relative;
  background: var(--home-wash);
  border-bottom: 1px solid var(--home-line);
}

.home-hero__deck {
  position: relative;
  height: clamp(520px, calc(100svh - var(--header-h)), 780px);
  overflow: hidden;
}

.home-hero__radio {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.home-hero__track {
  position: relative;
  height: 100%;
}

.home-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.85s var(--ease), visibility 0s linear 0.85s;
}

/* 状态机：被选中的 radio 决定显示哪一屏 */
#home-hero-1:checked ~ .home-hero__track .home-slide--1,
#home-hero-2:checked ~ .home-hero__track .home-slide--2,
#home-hero-3:checked ~ .home-hero__track .home-slide--3 {
  visibility: visible;
  opacity: 1;
  z-index: 2;
  transition: opacity 0.85s var(--ease), visibility 0s;
}

.home-slide__art {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.home-slide__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 72% center;
}

/* 左侧压白：保证文字可读，同时让插画右侧透出 */
.home-slide__art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0.97) 0%,
    rgba(255, 255, 255, 0.93) 26%,
    rgba(255, 255, 255, 0.62) 48%,
    rgba(255, 255, 255, 0.12) 72%,
    rgba(255, 255, 255, 0) 100%
  );
}

/* 第二屏插画主体在左侧，文字改到右半边 */
.home-slide--2 .home-slide__art img {
  object-position: 26% center;
}

.home-slide--2 .home-slide__art::after {
  background: linear-gradient(
    260deg,
    rgba(255, 255, 255, 0.97) 0%,
    rgba(255, 255, 255, 0.93) 26%,
    rgba(255, 255, 255, 0.62) 48%,
    rgba(255, 255, 255, 0.12) 72%,
    rgba(255, 255, 255, 0) 100%
  );
}

.home-slide__inner {
  position: relative;
  z-index: 1;
  width: min(100% - var(--gutter) * 2, var(--maxw));
  margin-inline: auto;
}

.home-slide--2 .home-slide__inner {
  display: flex;
  justify-content: flex-end;
}

.home-slide__copy {
  max-width: 620px;
}

.home-slide__title {
  margin: 0;
  font-size: clamp(28px, 3.4vw, 56px);
  font-weight: 400;
  line-height: 1.24;
  letter-spacing: 0.01em;
  color: var(--home-ink);
  text-wrap: balance;
}

.home-slide__title span {
  display: block;
  color: var(--accent);
}

.home-slide__desc {
  margin: 24px 0 0;
  font-size: clamp(14px, 1.05vw, 17px);
  line-height: 1.95;
  color: var(--home-body);
  max-width: 38em;
}

.home-slide__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

/* 每屏切换时文字依次上浮 */
.home-slide [data-reveal] {
  opacity: 0;
}

#home-hero-1:checked ~ .home-hero__track .home-slide--1 [data-reveal="1"],
#home-hero-2:checked ~ .home-hero__track .home-slide--2 [data-reveal="1"],
#home-hero-3:checked ~ .home-hero__track .home-slide--3 [data-reveal="1"] {
  animation: home-rise 0.8s var(--ease) 0.06s forwards;
}

#home-hero-1:checked ~ .home-hero__track .home-slide--1 [data-reveal="2"],
#home-hero-2:checked ~ .home-hero__track .home-slide--2 [data-reveal="2"],
#home-hero-3:checked ~ .home-hero__track .home-slide--3 [data-reveal="2"] {
  animation: home-rise 0.8s var(--ease) 0.18s forwards;
}

#home-hero-1:checked ~ .home-hero__track .home-slide--1 [data-reveal="3"],
#home-hero-2:checked ~ .home-hero__track .home-slide--2 [data-reveal="3"],
#home-hero-3:checked ~ .home-hero__track .home-slide--3 [data-reveal="3"] {
  animation: home-rise 0.8s var(--ease) 0.3s forwards;
}

@keyframes home-rise {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 分页指示条（居中小横条） */
.home-hero__dots {
  position: absolute;
  left: 50%;
  bottom: clamp(24px, 3.6vh, 42px);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateX(-50%);
}

.home-hero__dots label {
  position: relative;
  display: block;
  width: 54px;
  height: 18px;
  cursor: pointer;
}

.home-hero__dots label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 100%;
  height: 2px;
  background: #dcdcdc;
  transition: background-color 0.28s var(--ease);
}

.home-hero__dots label:hover::before {
  background: #c2c2c2;
}

#home-hero-1:checked ~ .home-hero__dots label[for="home-hero-1"]::before,
#home-hero-2:checked ~ .home-hero__dots label[for="home-hero-2"]::before,
#home-hero-3:checked ~ .home-hero__dots label[for="home-hero-3"]::before {
  background: var(--accent);
}

/* 分页文字（读屏 + 视觉隐藏） */
.home-hero__dots label span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* 右侧数字页码 */
.home-hero__index {
  position: absolute;
  right: max(24px, calc((100% - var(--maxw)) / 2));
  bottom: clamp(20px, 3.4vh, 38px);
  z-index: 5;
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-variant-numeric: tabular-nums;
}

.home-hero__index label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #c4c4c4;
  cursor: pointer;
  transition: color 0.22s var(--ease), font-size 0.22s var(--ease);
}

#home-hero-1:checked ~ .home-hero__index label[for="home-hero-1"],
#home-hero-2:checked ~ .home-hero__index label[for="home-hero-2"],
#home-hero-3:checked ~ .home-hero__index label[for="home-hero-3"] {
  font-size: 18px;
  color: var(--home-ink);
}

.home-hero__index label:not(:last-child)::after {
  content: "/";
  margin-left: 10px;
  font-size: 11px;
  color: #dedede;
}

#home-hero-1:focus-visible ~ .home-hero__dots label[for="home-hero-1"],
#home-hero-2:focus-visible ~ .home-hero__dots label[for="home-hero-2"],
#home-hero-3:focus-visible ~ .home-hero__dots label[for="home-hero-3"] {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   3. 业务板块
   -------------------------------------------------------------------------- */

.home-business {
  background: #fff;
}

.home-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;                       /* 与产品页六宫格一致的极窄缝 */
  border: 1px solid var(--home-line);
  border-radius: 4px;
  overflow: hidden;
  background: var(--home-line);
}

.home-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  transition: background-color 0.3s var(--ease);
}

.home-card:hover {
  background: #fdfdfd;
}

/* 场景图（内联 SVG，由 scene-effects.js 驱动内部图层） */
.home-card__media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #14110f;
}

.home-card__media .scene {
  display: block;
  width: 100%;
  height: 100%;
  transition: transform 0.6s var(--ease);
}

.home-card:hover .home-card__media .scene {
  transform: scale(1.03);
}

/* 场景内动画图层的缩放原点 */
#laser-beam {
  transform-box: view-box;
  transform-origin: 392px 383px;
}

#laser-impact {
  transform-box: view-box;
  transform-origin: 392px 480px;
}

#chip-leds .led-core circle,
#chip-leds .led-halo circle {
  transform-box: fill-box;
  transform-origin: center;
}

#chip-bars rect {
  transform-box: fill-box;
  transform-origin: center bottom;
}

.home-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 2.4vw, 36px) clamp(20px, 2.2vw, 32px)
    clamp(28px, 2.8vw, 38px);
}

.home-card__title {
  margin: 0;
  font-size: clamp(16px, 1.3vw, 21px);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--home-ink);
}

.home-card__title a {
  color: inherit;
  transition: color 0.22s var(--ease);
}

.home-card:hover .home-card__title a {
  color: var(--accent);
}

/* 标题下的橙色短线 */
.home-card__title::after {
  content: "";
  display: block;
  width: 28px;
  height: 2px;
  margin-top: 14px;
  background: var(--accent);
  transition: width 0.32s var(--ease);
}

.home-card:hover .home-card__title::after {
  width: 46px;
}

.home-card__list {
  margin: clamp(16px, 1.6vw, 22px) 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-card__list a {
  display: inline-block;
  font-size: clamp(13.5px, 0.95vw, 15px);
  line-height: 1.7;
  color: var(--home-muted);
  transition: color 0.2s var(--ease);
}

.home-card__list a:hover {
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   4. 关于我们 + 数据
   -------------------------------------------------------------------------- */

.home-about {
  background: var(--home-wash);
  border-top: 1px solid var(--home-line);
  border-bottom: 1px solid var(--home-line);
}

.home-about__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  gap: clamp(40px, 5vw, 88px);
  align-items: start;
}

.home-about__body > p {
  margin: 20px 0 0;
  max-width: 40em;
  font-size: clamp(14px, 0.98vw, 16px);
  line-height: 1.95;
  color: var(--home-muted);
}

.home-about__body .home-btn {
  margin-top: 30px;
}

/* 数据格：1px 线分隔 */
.home-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--home-line);
  border: 1px solid var(--home-line);
  border-radius: 4px;
  overflow: hidden;
}

.home-stat {
  padding: clamp(24px, 2.6vw, 36px) clamp(20px, 2.2vw, 30px);
  background: #fff;
}

.home-stat__num {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin: 0;
  font-size: clamp(30px, 3vw, 44px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--home-ink);
  font-variant-numeric: tabular-nums;
}

.home-stat__num small {
  font-size: 0.5em;
  font-weight: 400;
  color: var(--accent);
}

.home-stat__label {
  margin: 12px 0 0;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--home-muted);
}

/* --------------------------------------------------------------------------
   5. 新闻中心
   -------------------------------------------------------------------------- */

.home-news {
  background: #fff;
}

.home-news__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.62fr) minmax(0, 1.38fr);
  gap: clamp(28px, 4vw, 72px);
}

.home-news__list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--home-line-strong);
}

.home-news__list li {
  border-bottom: 1px solid var(--home-line-strong);
}

.home-news__list a {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 20px;
  padding: 24px 2px;
  transition: padding-left 0.28s var(--ease);
}

.home-news__list time {
  font-size: 13px;
  color: var(--home-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}

.home-news__title {
  font-size: clamp(14.5px, 1.02vw, 16.5px);
  line-height: 1.65;
  color: var(--home-body);
  transition: color 0.22s var(--ease);
}

.home-news__arrow {
  color: var(--accent);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
}

.home-news__list a:hover {
  padding-left: 12px;
}

.home-news__list a:hover .home-news__title {
  color: var(--accent);
}

.home-news__list a:hover .home-news__arrow {
  opacity: 1;
  transform: translateX(0);
}

/* --------------------------------------------------------------------------
   6. 联系 CTA
   -------------------------------------------------------------------------- */

.home-contact {
  background: var(--home-wash-2);
  border-top: 1px solid var(--home-line);
}

.home-contact__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(24px, 4vw, 56px);
  padding: clamp(48px, 5.4vw, 80px) 0;
}

.home-contact__title {
  margin: 0;
  font-size: clamp(20px, 1.9vw, 32px);
  font-weight: 400;
  line-height: 1.4;
  color: var(--home-ink);
  text-wrap: balance;
}

.home-contact__text {
  margin: 12px 0 0;
  max-width: 44em;
  font-size: clamp(13.5px, 0.95vw, 15px);
  line-height: 1.85;
  color: var(--home-muted);
}

.home-contact__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: none;
}

/* --------------------------------------------------------------------------
   7. 响应式
   -------------------------------------------------------------------------- */

@media (max-width: 1200px) {
  .home-hero__index {
    display: none;
  }

  .home-about__grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .home-news__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1099px) {
  .home-hero__deck {
    height: clamp(500px, calc(100svh - var(--header-h)), 720px);
  }

  /* 竖屏：插画压到上半部，文字叠在下半部 */
  .home-slide__art {
    inset: 0 0 auto 0;
    height: 62%;
  }

  .home-slide__art img,
  .home-slide--2 .home-slide__art img {
    object-position: 62% 52%;
  }

  .home-slide__art::after,
  .home-slide--2 .home-slide__art::after {
    background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.1) 40%,
      rgba(255, 255, 255, 0.86) 78%,
      #fff 100%
    );
  }

  .home-slide {
    align-items: flex-end;
    padding-bottom: clamp(72px, 11vh, 104px);
  }

  .home-slide--2 .home-slide__inner {
    display: block;
  }

  .home-slide__title {
    font-size: clamp(26px, 6.4vw, 38px);
  }

  .home-slide__desc br {
    display: none;
  }

  /* 业务卡：小屏两列 */
  .home-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }

  .home-head--center {
    align-items: center;
  }
}

@media (max-width: 760px) {
  .home-cards {
    grid-template-columns: 1fr;
  }

  .home-slide__actions .home-btn {
    flex: 1 1 auto;
  }

  .home-contact__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .home-news__list a {
    grid-template-columns: minmax(0, 1fr) 20px;
    gap: 6px 14px;
    padding: 18px 2px;
  }

  .home-news__list time {
    grid-column: 1 / -1;
    font-size: 12.5px;
  }

  .home-news__arrow {
    opacity: 1;
    transform: none;
    align-self: center;
  }

  .home-news__list a:hover {
    padding-left: 2px;
  }
}

/* 动效偏好 */
@media (prefers-reduced-motion: reduce) {
  .home-slide [data-reveal] {
    opacity: 1;
  }
}
