/* ==========================================================================
   WecomBetter 官网 —— Builder H：S0 导航 / S1 Hero / S2 Marquee
   v2 · 像素级规格精修
   所有选择器均以 .nav- / .hero- / .marquee- 开头，不污染他人
   ========================================================================== */

/* ---------------- S0 导航 · 悬浮胶囊 ---------------- */
.nav-shell {
  position: fixed;
  top: 28px;
  left: 50%;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 18px;
  width: max-content; /* 必须：否则 shrink-to-fit 被 left:50% 后的剩余空间卡住，窄屏重叠 */
  height: 52px;
  max-width: min(520px, calc(100vw - 24px));
  padding: 0 14px 0 6px; /* 只剩品牌，左右收拢 */
  background: #F8F8F8; /* 不透明 */
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-nav);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 0 2px rgba(0, 0, 0, 0.04);
  transform: translateX(-50%);
  /* 滚动后不做任何变化：无 is-scrolled 态 */
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px; /* 40×40 起点的点击区 */
  padding: 0 6px;
}
.nav-logo {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 6px;
}
.nav-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #000000;
  white-space: nowrap;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav-link {
  font-size: 16px;
  font-weight: 400;
  color: #000000;
  opacity: 0.7; /* 纯黑 + 透明度，不用灰字 */
  white-space: nowrap;
  transition: opacity var(--dur-hover) ease;
}
.nav-link:hover {
  opacity: 1;
}
.nav-cta {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  background: var(--btn);
  color: var(--paper-soft);
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
  transition: background var(--dur-hover) ease;
}
.nav-cta:hover {
  background: rgba(0, 0, 0, 0.88);
}

/* ---------------- S1 Hero 骨架（M1.5 等比缩放体系） ---------------- */
.hero {
  --s: min(100vw / 1440, 100svh / 854);
  position: relative;
  height: 100svh;
  min-height: 640px;
  overflow: hidden;
  background: #FFCB30; /* 平底色，canvas 失败时兜底 */
}
.hero-sky {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
}
/* M1 ③：底部 20px 棕色微渐变压底（拱以下部分被遮住，可见段紧贴拱缘） */
.hero-haze {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  height: calc(180 * var(--s));
  background: linear-gradient(0deg, rgba(91, 63, 8, 0.08) calc(160 * var(--s)), transparent calc(180 * var(--s)));
  pointer-events: none;
}
.hero-arch {
  position: absolute;
  left: -20vw;
  bottom: 0;
  z-index: 1;
  width: 140vw;
  height: calc(160 * var(--s));
  background: var(--paper);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.hero-inner {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: max(104px, calc(140 * var(--s)));
}
.hero-eyebrow {
  margin: 0 0 calc(22 * var(--s));
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
}
.hero-title {
  margin: 0 0 calc(36 * var(--s));
  font-family: var(--font-display);
  font-size: clamp(34px, calc(60 * var(--s)), 60px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: #ffffff;
  text-wrap: balance;
}
.hero-title-mask {
  display: block;
  overflow: hidden;
  padding: 0.06em 0;
  margin: -0.06em 0;
}
.hero-title-line {
  display: block;
  will-change: transform;
}
.hero-sub {
  max-width: 520px;
  margin: 0 0 calc(34 * var(--s));
  font-size: clamp(15px, calc(18 * var(--s)), 18px);
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.82);
}
.hero-ctas {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
/* 主 CTA 下载规格：随 hero 的 --s 等比缩放，补齐 §4 主按钮全部参数 */
.hero-btn-download {
  height: clamp(48px, calc(56 * var(--s)), 56px);
  padding: 0 clamp(20px, calc(24 * var(--s)), 24px);
  gap: 10px;
  font-size: clamp(16px, calc(20 * var(--s)), 20px);
  font-weight: 400;
  box-shadow: none; /* 静止态零阴影 */
  transition:
    transform 0.22s var(--ease-out),
    box-shadow 0.42s var(--ease-out),
    background var(--dur-hover) ease;
}
.hero-btn-download:hover {
  background: var(--btn); /* hover 不改底色 */
  transform: scale(1.02);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 2px 4px rgba(0, 0, 0, 0.16),
    0 18px 40px -10px rgba(0, 0, 0, 0.34);
}
.hero-btn-download:active {
  transform: scale(0.98);
}
.hero-btn-arrow {
  opacity: 0.8;
}
.hero-btn-ghost {
  height: clamp(48px, calc(56 * var(--s)), 56px);
  padding: 0 clamp(20px, calc(24 * var(--s)), 24px);
  font-size: clamp(15px, calc(16 * var(--s)), 16px);
  font-weight: 400;
}
.hero-note {
  margin: 0 0 calc(96 * var(--s));
  font-size: 14px;
  color: rgba(0, 0, 0, 0.55);
}

/* ---------------- 模拟企微文档窗口（重叠构图 + M4.5 视差载体） ---------------- */
.hero-window {
  position: relative;
  width: calc(860 * var(--s));
  max-width: calc(100% - 32px);
  min-width: min(560px, calc(100% - 32px));
  margin: auto auto 0; /* 文案收掉后，窗口贴在首屏底部 */
  background: #ffffff;
  border: 1px solid var(--stroke);
  border-radius: max(12px, calc(16 * var(--s)));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.07);
  text-align: left;
  will-change: transform;
}
.hero-window-bar {
  position: relative;
  height: 36px;
  border-bottom: 1px solid var(--stroke);
}
.hero-dots {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 6px;
}
.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.hero-dot-r { background: #ff5f57; }
.hero-dot-y { background: #febc2e; }
.hero-dot-g { background: #28c840; }
.hero-search {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 6px;
  width: 300px;
  max-width: 62%;
  height: 24px;
  padding: 0 12px;
  background: var(--fill);
  border-radius: var(--radius-pill);
  font-size: 12px;
  color: var(--ink);
}
.hero-search-icon {
  flex: none;
  color: var(--ink-3);
}
.hero-search-text {
  white-space: nowrap;
  transition: opacity 0.3s ease;
}
.hero-caret {
  flex: none;
  width: 1.5px;
  height: 13px;
  background: var(--wecom);
  animation: hero-caret-blink 1.1s linear infinite;
}
@keyframes hero-caret-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
.hero-suggest {
  position: absolute;
  top: 42px;
  left: 50%;
  z-index: 5;
  width: 320px;
  max-width: 72%;
  padding: 6px;
  background: #ffffff;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
  transition: opacity 0.32s var(--ease-out), transform 0.32s var(--ease-out);
}
.hero-window.is-suggest .hero-suggest {
  opacity: 1;
  transform: translate(-50%, 0);
}
.hero-suggest-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}
.hero-suggest-item.is-active {
  background: var(--fill);
}
.hero-window.is-suggest .hero-suggest-item {
  opacity: 1;
  transform: none;
}
.hero-window.is-suggest .hero-suggest-item:nth-child(1) { transition-delay: 0.05s; }
.hero-window.is-suggest .hero-suggest-item:nth-child(2) { transition-delay: 0.13s; }
.hero-window.is-suggest .hero-suggest-item:nth-child(3) { transition-delay: 0.21s; }
.hero-suggest-icon {
  flex: none;
  color: var(--wecom);
}
.hero-suggest-meta {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-3);
}
.hero-window.is-fading .hero-suggest {
  opacity: 0;
  transform: translate(-50%, -4px);
  transition-duration: 0.28s;
  transition-delay: 0s;
}
.hero-window.is-fading .hero-suggest-item {
  transition-delay: 0s;
}
.hero-window.is-fading .hero-search-text {
  opacity: 0;
}
.hero-window-body {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 28px 36px 46px;
}
.hero-skel {
  height: 10px;
  border-radius: 5px;
  background: var(--fill);
}

/* ---------------- 金色星形贴纸（深色手写字保对比） ---------------- */
.hero-sticker {
  position: absolute;
  top: max(112px, calc(150 * var(--s)));
  right: max(20px, calc(50% - 556px));
  z-index: 3;
  display: grid;
  place-items: center;
  width: max(72px, calc(132 * var(--s)));
  aspect-ratio: 1 / 1;
  transform: rotate(-8deg);
  transition: transform 0.3s var(--ease-out);
}
.hero-sticker:hover {
  transform: rotate(0deg) scale(1.05);
}
.hero-sticker-star {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--gold);
  filter: drop-shadow(0 6px 16px rgba(255, 176, 5, 0.35));
}
.hero-sticker-text {
  position: relative;
  font-family: var(--font-hand);
  font-size: max(15px, calc(20 * var(--s)));
  color: rgba(0, 0, 0, 0.75);
  transform: rotate(-4deg);
  pointer-events: none;
}

/* ---------------- M2 加载编排 ----------------
   JS 在脚本执行第一时间给 <html> 加 .hero-boot（初始隐藏写在这里，
   无 JS 时元素天然可见）；defer 执行后双 rAF 加 .is-on 触发编排。 */
.hero-boot .nav-shell {
  opacity: 0;
  transform: translate(-50%, -16px);
}
.hero-boot .hero-eyebrow {
  opacity: 0;
  transform: translateY(10px);
}
.hero-boot .hero-title-line {
  transform: translateY(110%);
}
.hero-boot .hero-sub,
.hero-boot .hero-ctas,
.hero-boot .hero-note {
  opacity: 0;
  transform: translateY(12px);
}
.hero-boot .hero-sticker {
  opacity: 0;
  transform: rotate(-8deg) translateY(14px) scale(0.82);
}
.hero-boot .hero-window {
  opacity: 0;
  transform: translateY(24px);
}

.hero-boot.is-on .nav-shell {
  opacity: 1;
  transform: translate(-50%, 0);
  transition: opacity 0.5s var(--ease-out) 0.2s, transform 0.5s var(--ease-out) 0.2s;
}
.hero-boot.is-on .hero-eyebrow {
  opacity: 1;
  transform: none;
  transition: opacity 0.55s var(--ease-out) 0.5s, transform 0.55s var(--ease-out) 0.5s;
}
.hero-boot.is-on .hero-title-line {
  transform: translateY(0);
  transition: transform 0.9s var(--ease-swoop) 0.62s;
}
.hero-boot.is-on .hero-title-mask:nth-child(2) .hero-title-line {
  transition-delay: 0.71s;
}
.hero-boot.is-on .hero-sub {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s var(--ease-out) 0.89s, transform 0.7s var(--ease-out) 0.89s;
}
.hero-boot.is-on .hero-ctas {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s var(--ease-out) 0.97s, transform 0.7s var(--ease-out) 0.97s;
}
.hero-boot.is-on .hero-note {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s var(--ease-out) 1.05s, transform 0.7s var(--ease-out) 1.05s;
}
.hero-boot.is-on .hero-sticker {
  opacity: 1;
  transform: rotate(-8deg);
  transition: opacity 0.55s ease 1.12s, transform 0.6s var(--ease-spring) 1.12s;
}
.hero-boot.is-on .hero-window {
  opacity: 1;
  transform: none;
  transition: opacity 1s var(--ease-out) 1.15s, transform 1s var(--ease-swoop) 1.15s;
}

/* ---------------- S2 Marquee ---------------- */
.marquee {
  position: relative;
  z-index: 2;
  padding: 18px 0;
  background: var(--paper);
  border-top: 1px solid var(--stroke);
  border-bottom: 1px solid var(--stroke);
  overflow: hidden;
}
.marquee-track {
  display: flex;
  width: max-content;
}
.marquee-ready .marquee-track {
  animation: marquee-scroll 40s linear infinite;
}
.marquee:hover .marquee-track {
  animation-play-state: paused;
}
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.marquee-group {
  display: flex;
  flex: none;
  align-items: center;
  gap: 12px;
  padding-right: 12px;
}
.marquee-chip {
  flex: none;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--fill);
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
}

/* ---------------- 响应式（仅交互层修补，尺寸全靠 --s 等比缩放） ---------------- */
@media (max-width: 960px) {
  .nav-link-privacy {
    display: none; /* 只留 2 个链接 + CTA */
  }
}
@media (max-width: 640px) {
  .nav-shell {
    gap: 16px;
    padding: 0 16px 0 6px;
  }
  .nav-links {
    gap: 16px;
  }
  .hero-sticker {
    display: none;
  }
  .hero-search {
    width: 220px;
  }
  .hero-suggest {
    width: 264px;
  }
  .hero-window-body {
    padding: 18px 20px 34px;
  }
}

/* ---------------- prefers-reduced-motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  .hero-boot.is-on .nav-shell,
  .hero-boot.is-on .hero-eyebrow,
  .hero-boot.is-on .hero-title-line,
  .hero-boot.is-on .hero-sub,
  .hero-boot.is-on .hero-ctas,
  .hero-boot.is-on .hero-note,
  .hero-boot.is-on .hero-sticker,
  .hero-boot.is-on .hero-window {
    transition: none !important;
  }
  .hero-caret {
    animation: none;
  }
  .hero-suggest,
  .hero-suggest-item,
  .hero-search-text,
  .hero-sticker {
    transition: none !important;
  }
  .marquee-track {
    animation: none !important;
  }
}
