/* ==========================================================================
   layout.css
   固定导航、第二屏、页脚与页面骨架。
   控制区域：.site-header、.header-inner、.primary-nav、.hero、.site-footer。
   关键变量：--header-h 决定导航高度；第二屏高度与首屏计算都依赖它。
   修改注意：导航和下拉菜单的 z-index 要高于轮播；不要让 header 裁剪绝对定位的下拉层。
   ========================================================================== */

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

/* Header 使用 sticky，z-index 高于首屏轮播和箭头；
   下拉菜单是 header 内的绝对定位层，因此 header 不能设置 overflow: hidden。 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  border-bottom: 1px solid transparent;
  background: #faf9f5;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 8px 24px rgba(6, 59, 66, 0.06);
}

.header-inner {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  height: var(--header-h);
  padding-inline: clamp(20px, 3vw, 64px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
}

.brand__logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.brand__text {
  display: flex;
  align-items: center;
}

.brand__text strong {
  color: #046969;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  white-space: nowrap;
}

.primary-nav {
  flex: 0 0 auto;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: var(--header-h);
  padding: 0 12px;
  color: var(--body);
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.2s var(--ease);
}

.nav-link::after {
  position: absolute;
  right: 12px;
  bottom: 16px;
  left: 12px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand-700);
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--brand-800);
}

.nav-link.is-active::after {
  transform: scaleX(1);
}

.nav-link:focus-visible {
  outline: 2px solid var(--brand-700);
  outline-offset: 4px;
  border-radius: 2px;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}

.nav-toggle.is-active span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle.is-active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-active span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.mobile-menu {
  position: fixed;
  top: var(--header-h);
  right: 0;
  left: 0;
  z-index: 79;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 18px 24px 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.mobile-menu__list {
  display: grid;
  gap: 4px;
}

.mobile-menu__list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 4px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
}

.mobile-menu__contact {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.mobile-menu__contact a {
  color: var(--brand-800);
  font-weight: 700;
}

/* V2.8 顶部导航：纯文字纵向下拉菜单 */
.nav-link[aria-expanded="true"] {
  color: var(--brand-800);
}

.site-dropdown {
  position: absolute;
  top: 100%;
  z-index: 90;
  width: 260px;
  padding: 6px 0;
  border: 1px solid #e1e8e5;
  background: #faf9f5;
  box-shadow: 0 18px 36px rgba(6, 59, 66, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0s linear 0.2s;
}

.site-dropdown.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0s;
}

.site-dropdown__list {
  display: block;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-dropdown__li {
  margin: 0;
  padding: 0;
}

.site-dropdown__item {
  display: flex;
  min-height: 50px;
  align-items: center;
  padding: 0 22px;
  color: #3f5559;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  text-align: left;
  transition: color 0.18s var(--ease), background-color 0.18s var(--ease);
}

.site-dropdown__item:hover,
.site-dropdown__item:focus-visible {
  color: #087f79;
  background: #eaf4f1;
}

.site-dropdown__item:focus-visible {
  outline: 2px solid #087f79;
  outline-offset: -2px;
}

.site-dropdown__item.is-disabled {
  color: #7b8e8d;
  cursor: default;
}

.site-dropdown__item.is-disabled:hover {
  color: #7b8e8d;
  background: transparent;
}

/* V2.8 移动端手风琴二级菜单 */
.mobile-menu__toggle {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  padding: 0 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.mobile-menu__toggle[aria-expanded="true"] {
  color: var(--brand-800);
}

.mobile-menu__toggle:focus-visible {
  outline: 2px solid var(--brand-700);
  outline-offset: -2px;
}

.mobile-submenu {
  display: grid;
  padding: 2px 0 8px;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 59, 66, 0.035);
}

.mobile-submenu a,
.mobile-submenu__item {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: flex-start;
  padding: 8px 4px 8px 16px;
  border-bottom: 0;
  color: var(--body);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
}

.mobile-submenu a::after {
  content: "";
}

.mobile-submenu a:hover,
.mobile-submenu a:focus-visible {
  color: var(--brand-800);
}

.mobile-submenu__item.is-disabled {
  color: #7b8e8d;
}

.mobile-submenu a.mobile-submenu__all {
  margin-top: 4px;
  color: var(--brand-800);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 76px 0 64px;
  background: var(--brand-900);
  color: #fff;
}

.hero::before {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 72% 38%, rgba(69, 213, 201, 0.18), transparent 30%),
    radial-gradient(circle at 18% 8%, rgba(10, 127, 123, 0.28), transparent 34%),
    linear-gradient(160deg, #063b42 0%, #042f35 100%);
  content: "";
}

.hero::after {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(69, 213, 201, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(69, 213, 201, 0.07) 1px, transparent 1px);
  background-size: 64px 64px;
  content: "";
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 78%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
  gap: 54px;
  align-items: center;
  flex: 1 1 auto;
  min-height: 650px;
  padding-bottom: 0;
}

.hero__copy {
  max-width: 640px;
}

.hero__eyebrow {
  color: var(--brand-400);
}

.hero h1,
.hero .hero__headline {
  margin-top: 18px;
  color: #fff;
  font-size: clamp(42px, 4.5vw, 68px);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.hero h1 span,
.hero .hero__headline span {
  color: var(--brand-400);
}

.hero__sub {
  margin-top: 18px;
  color: #d8f4f0;
  font-size: clamp(17px, 1.5vw, 22px);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.hero__desc {
  max-width: 560px;
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 15px;
  line-height: 1.9;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.hero__visual {
  position: relative;
}

.hero__photo {
  position: relative;
  height: 620px;
  overflow: hidden;
  border: 1px solid rgba(69, 213, 201, 0.22);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, #0a5d60, #042f35);
  box-shadow: var(--shadow-dark);
}

.hero-carousel {
  position: absolute;
  inset: 0;
  z-index: 1;
  touch-action: pan-y;
}

.hero-carousel:focus-visible {
  outline: 3px solid var(--brand-400);
  outline-offset: -3px;
}

.hero-carousel__slides {
  position: absolute;
  inset: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateX(10px);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease), visibility 0s linear 0.45s;
}

.hero-slide.is-active {
  z-index: 1;
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease), visibility 0s;
}

.hero-slide img {
  width: 100%;
  height: 100%;
}

.hero-slide--photo img {
  object-fit: cover;
  object-position: center 38%;
}

.hero-slide--illustration {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px 46px 118px;
  background:
    linear-gradient(rgba(69, 213, 201, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(69, 213, 201, 0.06) 1px, transparent 1px),
    linear-gradient(160deg, #0a5d60, #042f35);
  background-size: 32px 32px, 32px 32px, auto;
}

.hero-slide--illustration img {
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
}

.hero-carousel::after {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(to top, rgba(4, 47, 53, 0.9), transparent 46%),
    linear-gradient(to right, rgba(4, 47, 53, 0.32), transparent 45%);
  content: "";
  pointer-events: none;
}

.hero-carousel__caption {
  position: absolute;
  right: 22px;
  bottom: 20px;
  left: 22px;
  z-index: 3;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(4, 47, 53, 0.6);
  pointer-events: none;
}

.hero-carousel__info {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.hero-carousel__eyebrow {
  color: var(--brand-400);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  line-height: 1.5;
}

.hero-carousel__info strong {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
}

.hero-carousel__meta {
  color: rgba(255, 255, 255, 0.66);
  font-size: 11px;
  line-height: 1.6;
}

.hero-carousel__desc {
  display: -webkit-box;
  max-width: 36em;
  margin-top: 4px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.hero-carousel__side {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: auto;
}

.hero-carousel__toggle {
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(4, 47, 53, 0.5);
  color: rgba(255, 255, 255, 0.82);
  font-family: var(--font-sans);
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.hero-carousel__toggle:hover,
.hero-carousel__toggle:focus-visible {
  border-color: var(--brand-400);
  background: rgba(10, 127, 123, 0.72);
  color: #fff;
}

.hero-carousel__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--brand-400);
  font-size: 12px;
  font-weight: 700;
  pointer-events: auto;
}

.hero-carousel__link[hidden] {
  display: none;
}

.hero-carousel__link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hero-carousel__count {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.hero-carousel__count [data-carousel-index] {
  color: #fff;
  font-size: 12px;
}

.hero-carousel__sep {
  margin: 0 3px;
  color: rgba(255, 255, 255, 0.35);
}

.hero-carousel__arrow {
  position: absolute;
  top: 50%;
  z-index: 4;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  transform: translateY(-50%);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: rgba(4, 47, 53, 0.62);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease);
}

.hero-carousel__arrow--prev {
  left: 16px;
}

.hero-carousel__arrow--next {
  right: 16px;
}

.hero-carousel__arrow svg {
  width: 18px;
  height: 18px;
}

.hero-carousel__arrow:hover {
  border-color: var(--brand-400);
  background: rgba(10, 127, 123, 0.82);
  color: #fff;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  background: var(--brand-950);
  color: rgba(255, 255, 255, 0.55);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 40px;
  padding: 44px 0 30px;
}

.footer-brand {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.footer-brand__logo {
  width: 46px;
  height: 46px;
  padding: 4px;
  border-radius: 12px;
  background: #fff;
  object-fit: contain;
}

.footer-brand strong {
  display: block;
  color: #fff;
  font-size: 15px;
  line-height: 1.6;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: flex-end;
  gap: 10px 18px;
  font-size: 12px;
}

.footer-nav a:hover {
  color: var(--brand-400);
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 20px;
  padding: 18px 0 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11px;
}

.footer-meta a:hover {
  color: var(--brand-400);
}

/* ==========================================================================
   V2.3 首屏品牌入场、滚动提示与锚点偏移
   ========================================================================== */

/* 首屏使用 CSS 入场，不依赖 JS；JS 关闭或失败时内容仍然可见 */
.hero .reveal {
  opacity: 1;
  transform: none;
  transition: none;
}

@keyframes v23HeroUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes v23HeroFade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.hero__eyebrow {
  animation: v23HeroUp 0.5s var(--ease) both;
}

.hero h1,
.hero .hero__headline {
  animation: v23HeroUp 0.55s var(--ease) 0.08s both;
}

.hero__sub {
  animation: v23HeroUp 0.45s var(--ease) 0.17s both;
}

.hero__desc {
  animation: v23HeroUp 0.45s var(--ease) 0.24s both;
}

.hero__actions {
  animation: v23HeroUp 0.45s var(--ease) 0.31s both;
}

.hero__visual {
  animation: v23HeroUp 0.55s var(--ease) 0.2s both;
}

/* 真实可点击的滚动提示 */
.scroll-cue {
  position: absolute;
  bottom: 28px;
  left: max(20px, calc((100% - var(--container)) / 2));
  z-index: 2;
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  line-height: 1.4;
  text-decoration: none;
  animation: v23HeroFade 0.5s var(--ease) 0.45s both;
  transition: color 0.2s ease;
}

.scroll-cue:hover {
  color: #fff;
}

.scroll-cue__arrow {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1;
  animation: v23Cue 2.6s ease-in-out infinite;
}

@keyframes v23Cue {

  0%,
  100% {
    opacity: 0.4;
    transform: translateY(0);
  }

  50% {
    opacity: 1;
    transform: translateY(2px);
  }
}

.scroll-cue:hover .scroll-cue__arrow {
  animation: none;
  opacity: 1;
  transform: translateY(3px);
}

@media (max-width: 980px) {
  .scroll-cue {
    display: none;
  }
}

/* 保证导航跳转时模块标题不被粘性导航遮挡 */
main section[id] {
  scroll-margin-top: calc(var(--header-h) + 8px);
}

/* 导航下划线从中心自然展开 */
.nav-link::after {
  transform-origin: center;
  transition: transform 0.22s var(--ease);
}

@media (prefers-reduced-motion: reduce) {

  .hero__eyebrow,
  .hero h1,
  .hero .hero__headline,
  .hero__sub,
  .hero__desc,
  .hero__actions,
  .hero__visual {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .scroll-cue__arrow,
  .scroll-cue:hover .scroll-cue__arrow {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .scroll-cue {
    animation: none;
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-dropdown,
  .site-dropdown.is-open,
  .site-dropdown__item {
    animation: none;
    transition: none;
  }
}