/* 页面增强样式：进场动画、平台卡片水波纹、流程进度、页脚卡片等（叠加在 site.css 之上）
   Page enhancements: reveal, carousel ripples, process progress, footer cards (layered on top of site.css) */

/* ---------- 全局：滚动进度、顶栏、进场动画 / Global: progress, header, reveal ---------- */
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: 3px; pointer-events: none; }
.scroll-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--green-2), #9fdcb4); transform: scaleX(var(--p, 0)); transform-origin: left; }
.site-header { transition: box-shadow .3s, background-color .3s; }
.site-header.is-scrolled { box-shadow: 0 8px 28px rgba(24, 60, 39, .08); background: rgba(251, 253, 252, .96); }
.nav a { position: relative; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; border-radius: 2px; background: var(--green); transform: scaleX(0); transition: transform .3s var(--ease); }
.nav a:hover::after { transform: scaleX(1); }

/* 滚动到时才渐渐浮现 / Fade up when scrolled into view */
html.fx [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .9s var(--ease); transition-delay: var(--d, 0ms); }
html.fx [data-reveal].is-in { opacity: 1; transform: none; }
/* 锚点跳到的元素直接显示：带着下移状态会让浏览器算错滚动位置，标题被页头挡住 / Anchor targets show at once; the pending offset would make the browser scroll to the wrong spot */
html.fx [data-reveal]:target { opacity: 1; transform: none; transition: none; }

/* ---------- 平台轮播：水波纹、切换动效、悬浮 / Carousel: ripples, arrival, float ---------- */
.pcard { overflow: hidden; isolation: isolate; }
/* 跟随鼠标的柔光 / Soft glow that follows the cursor */
.pcard::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(240px circle at var(--gx, 50%) var(--gy, 40%), rgba(47, 174, 100, .13), transparent 62%); opacity: 0; transition: opacity .35s; }
.pcard:hover::before { opacity: 1; }
/* 水波纹：由脚本在鼠标位置生成 / Ripples spawned by script at the cursor */
.ripple { position: absolute; z-index: -1; width: 44px; height: 44px; margin: -22px 0 0 -22px; border: 1.5px solid rgba(47, 174, 100, .42); border-radius: 50%; background: radial-gradient(circle, rgba(47, 174, 100, .10), transparent 70%); pointer-events: none; animation: ripple-out 1.7s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes ripple-out { from { transform: scale(.2); opacity: 1; } to { transform: scale(8.5); opacity: 0; } }
/* 居中卡片：悬浮、切换到时弹出、图标跳入 / Centered card: float, pop on arrival, icon bounce */
.pcard[data-offset="0"] { animation: card-float 5.5s ease-in-out .8s infinite; }
.pcard[data-offset="0"].is-arriving { animation: card-pop .7s var(--ease), card-float 5.5s ease-in-out .8s infinite; }
.pcard.is-arriving .pcard-icon { animation: icon-bounce .8s var(--ease); }
.pcard.is-arriving .pcard-ask { animation: rise-in .6s .15s var(--ease) both; }
.pcard[data-offset="0"]:hover { border-color: #bfe3ce; box-shadow: 0 26px 54px rgba(31, 157, 84, .16); }
@keyframes card-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes card-pop { 0% { scale: .93; } 55% { scale: 1.03; } 100% { scale: 1; } }
@keyframes icon-bounce { 0% { opacity: .3; transform: translateY(16px) scale(.78); } 60% { opacity: 1; transform: translateY(-6px) scale(1.06); } 100% { transform: none; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.car-arrow:hover { box-shadow: 0 0 0 6px rgba(47, 174, 100, .12), 0 6px 18px rgba(24, 60, 39, .08); }

/* ---------- 专区首屏分层图：落下叠放、呼吸起伏、绿光自下而上扫过、悬停抬起、鼠标倾斜
   Facebook hero layers: drop into place, breathe, a green light sweeps upward, hover lifts a layer, pointer tilt ---------- */
.fl-scene { transform: perspective(2000px) rotateX(var(--fl-ry, 0deg)) rotateY(var(--fl-rx, 0deg)); transition: transform .5s ease-out; }
.fl-layer { transition: transform .45s var(--ease); }
.fl-face { transition: border-color .3s, box-shadow .3s; }
.fl-face::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, rgba(47, 174, 102, .32), transparent 70%); opacity: 0; pointer-events: none; }
.fl-face::after { content: ""; position: absolute; inset: 0; z-index: 2; background: rgba(241, 249, 243, .65); opacity: 0; transition: opacity .3s; pointer-events: none; }
.fb-layers.has-hot .fl-layer:not(.is-hot) .fl-face::after { opacity: 1; }
.fl-layer.is-hot { --lift: 26px; }
.fl-layer.is-hot .fl-face { border-color: #2fae66; box-shadow: inset 0 0 0 1px rgba(47, 174, 102, .35), 0 0 0 4px rgba(47, 174, 102, .14); }
.fl-layer[data-layer="personal"] { --d: .1s; --amp: 0px; --g: 2.2s; }
.fl-layer[data-layer="page"] { --d: .35s; --amp: 6px; --g: 2.65s; }
.fl-layer[data-layer="bm"] { --d: .6s; --amp: 12px; --g: 3.1s; }
.fl-layer[data-layer="ads"] { --d: .85s; --amp: 18px; --g: 3.55s; }
.fl-labels a[data-layer="personal"] { --d: .1s; --g: 2.2s; }
.fl-labels a[data-layer="page"] { --d: .35s; --g: 2.65s; }
.fl-labels a[data-layer="bm"] { --d: .6s; --g: 3.1s; }
.fl-labels a[data-layer="ads"] { --d: .85s; --g: 3.55s; }
@media (prefers-reduced-motion: no-preference) {
  .fl-layer { transition: transform .45s var(--ease), translate .9s cubic-bezier(.2, 1.25, .4, 1) var(--d); animation: fl-breathe 5s ease-in-out 2.2s infinite; }
  .fl-slab, .fl-face { transition: opacity .5s ease var(--d), border-color .3s, box-shadow .3s; }
  .fl-face::before { animation: fl-glow 6s ease-in-out var(--g) infinite; }
  .fl-labels a { transition: opacity .5s ease calc(var(--d) + .3s), translate .6s var(--ease) calc(var(--d) + .3s); }
  .fl-labels a::after { animation: fl-dot 6s ease-in-out var(--g) infinite; }
  @starting-style {
    .fl-layer { translate: 0 0 240px; }
    .fl-slab, .fl-face { opacity: 0; }
    .fl-labels a { opacity: 0; translate: 14px 0; }
  }
}
@keyframes fl-breathe { 0%, 100% { translate: 0 0 0; } 50% { translate: 0 0 var(--amp); } }
@keyframes fl-glow { 0%, 22%, 100% { opacity: 0; } 9% { opacity: 1; } }
@keyframes fl-dot { 0%, 22%, 100% { box-shadow: 0 0 0 0 rgba(47, 174, 102, 0); } 9% { box-shadow: 0 0 0 6px rgba(47, 174, 102, .3); } }

/* ---------- 关于页品牌理念：口号逐字浮现、署名线展开、底部缎带缓慢流动 / About brand statement: letters rise in, the sign-off rule grows, ribbons drift ---------- */
@media (prefers-reduced-motion: no-preference) {
  html.fx .ab-quote .ab-slogan-text span { opacity: 0; translate: 0 .45em; transition: opacity .6s ease, translate .8s cubic-bezier(.2, 1.1, .3, 1); transition-delay: .05s; }
  html.fx .ab-quote .ab-slogan-text span:nth-child(2) { transition-delay: 0.19s; }
  html.fx .ab-quote .ab-slogan-text span:nth-child(3) { transition-delay: 0.26s; }
  html.fx .ab-quote .ab-slogan-text span:nth-child(4) { transition-delay: 0.33s; }
  html.fx .ab-quote .ab-slogan-text span:nth-child(5) { transition-delay: 0.40s; }
  html.fx .ab-quote .ab-slogan-text span:nth-child(6) { transition-delay: 0.47s; }
  html.fx .ab-quote .ab-slogan-text span:nth-child(7) { transition-delay: 0.54s; }
  html.fx .ab-quote .ab-slogan-text span:nth-child(8) { transition-delay: 0.61s; }
  html.fx .ab-quote .ab-slogan-text span:nth-child(9) { transition-delay: 0.68s; }
  html.fx .ab-quote .ab-slogan-text span:nth-child(10) { transition-delay: 0.75s; }
  html.fx .ab-quote .ab-slogan-text span:nth-child(11) { transition-delay: 0.82s; }
  html.fx .ab-quote .ab-slogan-text span:nth-child(12) { transition-delay: 0.89s; }
  html.fx .ab-quote .ab-slogan-text span:nth-child(13) { transition-delay: 0.96s; }
  html.fx .ab-quote .ab-slogan-text span:nth-child(14) { transition-delay: 1.03s; }
  html.fx .ab-quote .ab-slogan-text span:nth-child(15) { transition-delay: 1.10s; }
  html.fx .ab-quote .ab-slogan-text span:nth-child(16) { transition-delay: 1.17s; }
  html.fx .ab-quote .is-in .ab-slogan-text span { opacity: 1; translate: 0 0; }
  html.fx .ab-quote-by i { transform: scaleX(0); transform-origin: left center; transition: transform .8s var(--ease) .6s; }
  html.fx .ab-quote .is-in .ab-quote-by i { transform: none; }
  .ab-ribbon { transform-box: fill-box; animation: ab-ribbon 30s linear infinite; }
  .ab-ribbon.r2 { animation-duration: 42s; animation-direction: reverse; }
  .ab-ribbon.r3 { animation-duration: 56s; }
}
@keyframes ab-ribbon { to { transform: translateX(-50%); } }

/* ---------- 专区：点卡片跳到分组时，分组闪一下 / Facebook page: the group you jump to flashes once ---------- */
@media (prefers-reduced-motion: no-preference) {
  .type-group:target { animation: group-flash 1.6s var(--ease) .15s 1; }
}
@keyframes group-flash { from { border-color: #2fae66; box-shadow: 0 0 0 0 rgba(47, 174, 102, .4); } to { border-color: var(--line); box-shadow: 0 0 0 18px rgba(47, 174, 102, 0); } }

/* ---------- 切换页面：新页面淡入上移，页头保持不动（支持的浏览器）/ Page change: the new page fades up while the header stays put, where supported ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .site-header { view-transition-name: site-header; }
  ::view-transition-old(root) { animation: vt-out .2s ease both; }
  ::view-transition-new(root) { animation: vt-in .42s cubic-bezier(.22, .8, .24, 1) both; }
}
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; translate: 0 16px; } }

/* ---------- 导航：悬停底色在菜单项之间滑动 / Nav: a hover pill that slides between links ---------- */
.nav.has-pill { position: relative; isolation: isolate; }
.nav.has-pill a::after { display: none; }
.nav-pill { position: absolute; top: 50%; left: 0; z-index: -1; width: var(--pw, 0px); height: 34px; margin-top: -17px; transform: translateX(var(--px, 0px)); background: var(--green-soft); border-radius: 999px; opacity: 0; pointer-events: none; transition: transform .35s var(--ease), width .35s var(--ease), opacity .2s; }
.nav-pill.is-on { opacity: 1; }
.nav-pill.is-jump { transition: opacity .2s; }
@media (max-width: 960px) { .nav-pill { display: none; } }

/* ---------- 卡片：跟随鼠标的柔光 / Cards: soft light following the pointer ---------- */
html.fx .tool-card, html.fx .guide-card, html.fx .type-card { position: relative; isolation: isolate; overflow: hidden; }
/* 规格气泡弹出 / Picker pop-in */
html.fx .type-pick:not([hidden]) { animation: pick-in .22s var(--ease); }
@keyframes pick-in { from { opacity: 0; transform: translateY(-6px); } }
html.fx .tool-card::before, html.fx .guide-card::before, html.fx .type-card::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(240px circle at var(--sx, 50%) var(--sy, 0%), rgba(47, 174, 102, .13), transparent 65%); opacity: 0; transition: opacity .3s; }
html.fx .tool-card:hover::before, html.fx .guide-card:hover::before, html.fx .type-card:hover::before { opacity: 1; }

/* ---------- 问答：展开收起时高度平滑过渡（浏览器支持时）/ Q&A: smooth height when opening, where supported ---------- */
@media (prefers-reduced-motion: no-preference) {
  @supports (interpolate-size: allow-keywords) {
    .qa-item { interpolate-size: allow-keywords; }
    .qa-item::details-content { height: 0; overflow: clip; transition: height .35s var(--ease), content-visibility .35s allow-discrete; }
    .qa-item[open]::details-content { height: auto; }
  }
}


/* ---------- 流程进度线 / Process progress ---------- */
.steps-track { height: 4px; margin: -8px 0 30px; overflow: hidden; background: var(--line); border-radius: 999px; }
.steps-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--green-2), #9fdcb4); transform: scaleX(var(--sp, 0)); transform-origin: left; }
.step-num { transition: background-color .4s, color .4s, box-shadow .4s; }
.step.is-lit .step-num { color: #fff; background: var(--green-2); box-shadow: 0 0 0 7px rgba(47, 174, 100, .14); }

/* ---------- 页脚：跟随鼠标的柔光 / Footer: soft light following the pointer ---------- */
.site-footer3 { position: relative; overflow: hidden; isolation: isolate; }
.site-footer3::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(520px circle at var(--fx, 18%) var(--fy, 0%), rgba(95, 196, 141, .16), transparent 62%); }

/* ---------- 首页首屏：标题和导语立即可见（不拖慢 LCP），右侧装饰卡片依次入场 / Home hero: headline and lead paint immediately for LCP; decorative cards deal in ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hcard { transition: transform .8s var(--ease), opacity .5s, box-shadow .3s, scale .9s cubic-bezier(.2, 1.35, .4, 1); transition-delay: 0s, 0s, 0s, var(--deal, 0s); }
  .hcard[data-pos="left"] { --deal: .35s; }
  .hcard[data-pos="right"] { --deal: .5s; }
  .hcard[data-pos="front"] { --deal: .7s; }
  @starting-style { .hcard { scale: .2; } }
}

/* ---------- 悬浮联系按钮：外圈脉冲 / Floating contact button: pulse ring ---------- */
.fab-pulse { position: absolute; inset: 0; background: rgba(47, 174, 100, .5); border-radius: 50%; animation: fab-ripple 2.4s ease-out infinite; }
@keyframes fab-ripple { from { transform: scale(.65); opacity: .9; } to { transform: scale(1.45); opacity: 0; } }

/* ---------- 响应式 / Responsive ---------- */
@media (max-width: 860px) {
  .steps-track { display: none; }
}

/* ---------- 关于我们页动效 / About page motion ---------- */
@keyframes orbit-spin { to { transform: rotate(360deg); } }
@keyframes orbit-counter { to { transform: rotate(-360deg); } }
@keyframes core-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
html.fx .orbit-track { animation: orbit-spin 40s linear infinite; }
html.fx .orbit-icon { animation: orbit-counter 40s linear infinite; }
html.fx .orbit-ring.r1 { animation: orbit-spin 90s linear infinite reverse; }
html.fx .orbit-core img { animation: core-float 4.5s ease-in-out infinite; }
html.fx [data-anim].is-paused, html.fx [data-anim].is-paused * { animation-play-state: paused !important; }
html.fx .about-pillar { transition: transform .35s var(--ease), box-shadow .35s, border-color .35s, opacity .8s ease; }
html.fx .about-pillar::before { content: ""; position: absolute; inset: 0; background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(24, 214, 103, .14), transparent 70%); opacity: 0; transition: opacity .3s; pointer-events: none; }
html.fx .about-pillar:hover { transform: translateY(-6px); border-color: #cdebd9; box-shadow: 0 24px 48px rgba(12, 99, 48, .14); }
html.fx .about-pillar:hover::before { opacity: 1; }
