/* =================================================================
   RisingStar CTA — SHARED ENGINE (single source of truth)
   -----------------------------------------------------------------
   NINE variants, ZERO JavaScript. Link this file once per page.

     .cta                     01 blue / 02 light-grey / 03 black
     .cta--primary/--secondary/--lg   → 07 no-disc capsule
     .cta4                    04 billiard   (static capsule + detached disc)
     .cta5                    05 disc-morph LEFT   (circle grows into capsule)
     .cta6                    06 disc-morph RIGHT  (mirror of 05)
     .cta8--motion / --fill / --brand   08 icon + text capsule
     .cta9                    09 form submit (--block = full width)

   ARCHITECTURE (v1.6 audit — deduplicated)
     1. :root         every colour / duration / shadow, one source
     2. base reset    ONE rule for all clickable engines (was 6 copies)
     3. shared parts  .cta__sizer / .cta__sweep / .cta__disc /
                      .cta__icon / .cta__slide + .cta__stack + .cta__line
     4. engines A–F   only what genuinely differs per variant

   The text-motion primitive (.cta__slide / __stack / __line) is shared
   by 07, 08A and 09 — ONE hover rule drives all three animations.
   ================================================================= */

/* =================================================================
   SINGLE MOTION DRIVER (v1.8)
   --cta-rise ∈ [0,1] 在宿主上过渡；sweep 升起与 stack 上滑的位移都
   calc 派生自它 → 升起把文字推走、回落把文字拉回，同一时长同一曲线，
   零割裂。不支持 @property 的老浏览器降级为状态直切（功能不受影响）。
   ================================================================= */
@property --cta-rise{
  syntax:'<number>';
  inherits:true;
  initial-value:0;
}

:root{
  --cta-brand:#036EB7;                 /* 唯一品牌蓝 */
  --cta-brand-2:#036EB7;               /* 渐变终点（01–03 引擎用） */
  --cta-black:#18181B;                 /* 统一黑 */
  --cta-gray:#F1F3F5;                  /* 统一灰 */
  --cta-white:#FFFFFF;
  --cta-ease:cubic-bezier(.2,.8,.2,1); /* 统一缓动 */
  --cta-dur:.5s;                       /* 统一时长 */
  --cta-rise-ease:cubic-bezier(.45,0,.25,1); /* 单一动效曲线（v1.8.1 中和：介于圆盘升起 .66 与文字滑动 .2 之间） */
  --cta-rise-dur:.55s;                 /* 单一动效时长（v1.8.1 中和 0.6/0.5）：01–03 略加快、07–09 略放慢 */
  --cta-shadow:0 6px 18px rgba(3,110,183,.35);        /* hover 主题蓝阴影 */
  --cta-shadow-active:0 3px 10px rgba(3,110,183,.28); /* 09 按压阴影 */
  --cta-shadow-ink:0 6px 18px rgba(24,24,27,.25);
  --cta-shadow-ink-active:0 3px 10px rgba(24,24,27,.28);
  --cta-icon:18px;                     /* 08/09 前置图标尺寸 */
  --cta-icon-gap:10px;                 /* 08/09 图标与文字间距 */
  --cta-font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif; /* 站点字体 */
  --cta-font-size:16px;
  --cta-font-weight:500;
}

/* =================================================================
   BASE RESET — every clickable engine shares this single rule
   (previously the font stack / cursor / appearance / radius were
   copy-pasted into each of the six engines)
   ================================================================= */
.cta,.cta4__pill,.cta5,.cta6,.cta8,.cta9{
  box-sizing:border-box;     /* <a> is content-box by default, <button> is
                                border-box — without this the same tier is
                                4px taller as an anchor (48 vs 52) */
  height:var(--cta-h);
  margin:0;
  border-radius:9999px;
  font-family:var(--cta-font-family,Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif);
  font-weight:var(--cta-font-weight,500);
  line-height:1;
  cursor:pointer;
  text-decoration:none;
  -webkit-appearance:none;
  appearance:none;
}

/* =================================================================
   SHARED PARTS
   ================================================================= */
/* Text-motion primitive: 2-line stack clipped by a 1-line viewport.
   Shared by 07 (overlay variant), 08A and 09. */
.cta__slide{
  position:relative;
  display:block;
  height:var(--cta-slide-lh,1.25em);
  overflow:hidden;
}
.cta__stack{
  display:flex;
  flex-direction:column;
  /* v1.8：位移由宿主的 --cta-rise 派生（单一驱动源），自身不再带过渡——
     与 sweep 同帧同曲线，升起推字、回落拉字。 */
  transform:translateY(calc(var(--cta-rise,0) * -50%));
}
.cta__line{
  display:flex;
  align-items:center;
  height:var(--cta-slide-lh,1.25em);
  line-height:1.25;          /* not 1 — keeps q/y/j descenders inside */
  white-space:nowrap;
}

/* 07 geometry: invisible sizer reserves the capsule width, the slide
   covers the capsule and repeats the same padding so glyphs line up. */
.cta__sizer,.cta__slide--cover{
  box-sizing:border-box;
  padding:0 var(--cta-pad-r) 0 var(--cta-pad-l);
}
.cta__sizer{
  display:inline-flex;
  height:calc(var(--cta-h) - 4px);
  align-items:center;
  gap:var(--cta-gap);
  white-space:nowrap;
  visibility:hidden;
}
.cta__slide--cover{
  position:absolute;
  inset:0;
  height:100%;
  z-index:2;                 /* Engine A：文字浮于 sweep(z1) 之上；07 无 sweep 不受影响 */
  --cta-slide-lh:calc(var(--cta-h) - 4px);
}

/* Leading decorative icon (08 / 09) — never moves, never scales. */
.cta__icon{
  flex:none;
  width:var(--cta-icon);
  height:var(--cta-icon);
  display:block;
}

/* =================================================================
   ENGINE A — 01 / 02 / 03 (sweep + disc)  ·  07 (no disc, no sweep)
   ================================================================= */
.cta{
  --cta-h:48px;
  --cta-disc:34px;
  --cta-pad-l:24px;
  --cta-pad-r:10px;
  --cta-gap:12px;
  --cta-bg:transparent;
  --cta-border:var(--cta-brand);
  --cta-ink:var(--cta-black);
  --cta-ink-hover:#fff;
  --cta-disc-bg:var(--cta-black);
  --cta-disc-ink:#fff;
  --cta-disc-bg-hover:#fff;
  --cta-disc-ink-hover:var(--cta-brand);
  --cta-border-hover:var(--cta-brand);
  --cta-sweep:var(--cta-brand);
  --cta-sweep-2:var(--cta-brand);

  position:relative;
  display:inline-flex;
  align-items:center;
  padding:0;
  overflow:hidden;
  border:2px solid var(--cta-border);
  background:var(--cta-bg);
  color:var(--cta-ink);
  font-size:var(--cta-font-size,16px);
  transition:border-color var(--cta-rise-dur) var(--cta-rise-ease),--cta-rise var(--cta-rise-dur) var(--cta-rise-ease);
}

/* token-only modifiers — no duplicated rules */
.cta--lightgray{
  --cta-bg:var(--cta-gray);
  --cta-border:var(--cta-gray);
  --cta-ink:var(--cta-black);
}
.cta--black{
  --cta-bg:var(--cta-black);
  --cta-border:var(--cta-black);
  --cta-ink:#fff;
  --cta-disc-bg:#fff;
  --cta-disc-ink:var(--cta-black);
}
/* 07 — no-disc capsule. 口径：底色/描边/文字色恒不变，只有文字滑动
   + 主题蓝阴影。Engine A 的底升起斜切色幕不用于此（升起过程中左下
   端帽长期未盖满，2026-11-26 截图逐像素实锤）。 */
.cta--primary{
  --cta-bg:var(--cta-brand);
  --cta-border:var(--cta-brand);
  --cta-border-hover:var(--cta-brand);   /* 07: border never changes */
  --cta-ink:#fff;
  --cta-ink-hover:#fff;
  --cta-pad-r:24px;
  font-size:15px;
}
.cta--secondary{
  --cta-bg:var(--cta-white);
  --cta-border:var(--cta-black);
  --cta-border-hover:var(--cta-black);
  --cta-ink:var(--cta-black);
  --cta-ink-hover:var(--cta-black);
  --cta-pad-r:24px;
  font-size:15px;
}
.cta--primary,.cta--secondary{
  transition:border-color var(--cta-dur),box-shadow var(--cta-dur),--cta-rise var(--cta-rise-dur) var(--cta-rise-ease);
}
.cta--primary:is(:hover,:focus-visible),
.cta--secondary:is(:hover,:focus-visible){
  box-shadow:var(--cta-shadow);
}
.cta--lg{
  --cta-h:52px;
  font-size:16px;
}

/* Engine A text (01–03): 与 07 完全同构的 slide--cover + stack 双行滑动，
   两行无缝衔接（旧双 label 方案 top -150% / bottom +100% 位移不同步，
   中间帧出现文字真空，2026-11-26 实锤废弃）。两行颜色随 token 翻转。
   sizer 里的 .cta__slot 仍负责给绝对定位圆盘占位。 */
.cta__slot{
  flex:none;
  width:var(--cta-disc);
  height:var(--cta-disc);
}
.cta:not(.cta--primary):not(.cta--secondary) .cta__stack .cta__line:first-child{color:var(--cta-ink);}
.cta:not(:is(.cta--primary,.cta--secondary)) .cta__stack .cta__line:last-child{color:var(--cta-ink-hover);}

.cta__sweep{
  /* v1.7 disc-rise：正圆（1.4×胶囊宽）停在胶囊正下方，hover 升起、终态圆心
     正好落在胶囊中心。半径 0.7×宽 ≥ 胶囊半宽 → 胶囊（含底部两角）被完整覆盖，
     不漏白块（旧 260%×2.6H 椭圆底部收成一点，左右下角漏白，2026-11-26 实锤）。
     机制对齐 fixed_action.html .disc-rise--fab 的圆盘升起。 */
  position:absolute;
  left:50%;
  top:50%;
  z-index:1;
  width:140%;
  aspect-ratio:1/1;
  border-radius:50%;
  background:var(--cta-sweep);
  transform:translate(-50%,-50%) translateY(calc((1 - var(--cta-rise,0)) * 78%));
}
.cta__disc{
  position:absolute;
  right:var(--cta-pad-r);
  top:50%;
  transform:translateY(-50%);
  z-index:1;   /* 低于 label(2)，避免压字；高于 sweep(1，同层按 DOM 顺序在前） */
  flex:none;
  width:var(--cta-disc);
  height:var(--cta-disc);
  display:grid;
  place-items:center;
  border-radius:9999px;
  background:var(--cta-disc-bg);
  color:var(--cta-disc-ink);
  transition:background-color var(--cta-rise-dur) var(--cta-rise-ease),color var(--cta-rise-dur) var(--cta-rise-ease);
}
.cta__disc svg{width:18px;height:18px;display:block;}
.cta:is(:hover,:focus-visible){border-color:var(--cta-border-hover);}
.cta:is(:hover,:focus-visible) .cta__disc{background:var(--cta-disc-bg-hover);color:var(--cta-disc-ink-hover);}

/* =================================================================
   ENGINE B — 04 billiard  (static grey capsule + detached disc)
   ================================================================= */
.cta4{
  --cta-h:48px;
  --cta-disc:44px;
  --cta-pad:24px;

  display:inline-flex;
  align-items:center;
  gap:0;                     /* flush at rest; hover opens 6px */
}
.cta4__pill{
  box-sizing:border-box;
  display:inline-flex;
  align-items:center;
  padding:0 var(--cta-pad);
  border:2px solid var(--cta-gray);
  background:var(--cta-gray);
  color:var(--cta-black);
  font-size:16px;
  transition:border-color var(--cta-dur);
}
.cta4__disc{
  flex:none;
  width:var(--cta-disc);
  height:var(--cta-disc);
  display:grid;
  place-items:center;
  border-radius:9999px;
  background:var(--cta-black);
  color:#fff;
  transition:background-color var(--cta-dur),color var(--cta-dur),transform var(--cta-dur);
}
.cta4__disc svg{width:22px;height:22px;display:block;}
.cta4:is(:hover,:focus-within) .cta4__pill{border-color:var(--cta-brand);}
.cta4:is(:hover,:focus-within) .cta4__disc{
  background:var(--cta-brand);
  transform:translateX(6px);
}

/* =================================================================
   ENGINE C/D — 05 disc-morph LEFT  ·  06 disc-morph RIGHT
   -----------------------------------------------------------------
   Resting = one full-height circle holding the arrow, anchored at the
   far end (05 right / 06 left). Hover: the circle itself grows in the
   ARROW's direction into the capsule — the arrow rides the leading
   cap, and the text rides INSIDE the pill (clipped by it) so it only
   ever sits on blue. Final state = arrow + text, no inner disc.
   The two variants are mirror images: everything shared lives in the
   grouped rules below, each variant only overrides its side.
   ================================================================= */
.cta5,.cta6{
  --cta-h:48px;
  --cta-pad-l:24px;
  --cta-pad-r:24px;
  --cta-gap:14px;
  /* 配色 token：静置/终态各两枚，修饰档只改这四枚即可整档换色 */
  --cta-morph-bg:var(--cta-black);
  --cta-morph-ink:#fff;
  --cta-morph-bg-hover:var(--cta-brand);
  --cta-morph-ink-hover:#fff;

  position:relative;
  display:inline-flex;
  align-items:center;
  padding:0;
  overflow:hidden;
  border:0;                  /* the visible capsule IS the pill child */
  background:transparent;
  font-size:16px;
}
.cta5__sizer,.cta6__sizer{
  box-sizing:border-box;
  display:inline-flex;
  height:var(--cta-h);
  align-items:center;
  white-space:nowrap;
  visibility:hidden;
}
.cta5__sizer{padding:0 var(--cta-pad-r) 0 calc(var(--cta-h)/2 + 9px + var(--cta-gap));}
.cta6__sizer{padding:0 calc(var(--cta-h)/2 + 9px + var(--cta-gap)) 0 var(--cta-pad-l);}

.cta5__pill,.cta6__pill{
  position:absolute;
  top:0;
  z-index:1;
  height:var(--cta-h);
  width:var(--cta-h);
  border-radius:9999px;
  overflow:hidden;
  background:var(--cta-morph-bg);
  color:var(--cta-morph-ink);
  /* width & colour share ONE duration/ease with NO delay — the colour
     tracks the growth frame by frame (desynced phases read as a blue
     flicker). translateZ(0) promotes the layer so the rounded caps
     don't repaint-shimmer while width animates. */
  transition:width var(--cta-dur) var(--cta-ease),background-color var(--cta-dur) var(--cta-ease);
  transform:translateZ(0);
}
.cta5__pill{right:0;}
.cta6__pill{left:0;}

.cta5__pill svg,.cta6__pill svg{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  width:18px;height:18px;display:block;
}
.cta5__pill svg{left:calc(var(--cta-h)/2 - 9px);}
.cta6__pill svg{right:calc(var(--cta-h)/2 - 9px);}

.cta5__text,.cta6__text{
  position:absolute;
  top:0;
  height:100%;
  display:inline-flex;
  align-items:center;
  /* 不写 color：继承 pill 的 --cta-morph-ink，终态自动跟着 pill 翻色 */
  white-space:nowrap;
}
.cta5__text{left:calc(var(--cta-h)/2 + 9px + var(--cta-gap));}
.cta6__text{right:calc(var(--cta-h)/2 + 9px + var(--cta-gap));}

.cta5:is(:hover,:focus-visible) .cta5__pill,
.cta6:is(:hover,:focus-visible) .cta6__pill{
  width:100%;
  background:var(--cta-morph-bg-hover);
  color:var(--cta-morph-ink-hover);
}

/* 纸白档：深底场景（照片/深色 section）用，只换 token —— 静置白盘墨色，
   终态仍走同一颗品牌蓝+白字，零新增几何规则 */
.cta5--paper,.cta6--paper{
  --cta-morph-bg:var(--cta-white);
  --cta-morph-ink:var(--cta-black);
}

/* =================================================================
   ENGINE E — 08 icon + text capsule
   -----------------------------------------------------------------
   .cta8--motion  icon static; text slides (shared primitive);
                  colours unchanged + blue shadow.
   .cta8--brand   仅换配色：实心品牌蓝（站点主按钮），几何/动效不动。
   .cta8--fill    nothing moves; hover only fills the capsule blue and
                  flips icon/text white for contrast.
   ================================================================= */
.cta8{
  --cta-h:48px;

  position:relative;
  display:inline-flex;
  align-items:center;
  gap:var(--cta-icon-gap);
  padding:0 24px;
  border:2px solid var(--cta-black);
  background:var(--cta-white);
  color:var(--cta-black);
  font-size:15px;
}
/* 主按钮档：08 的底色/描边/文字是字面色（纸白 + 墨黑），实心品牌蓝只能显式覆盖；
   必须置于 .cta8 之后（同特异度、后写者胜）。 */
.cta8--brand{
  background:var(--cta-brand);
  border-color:var(--cta-brand);
  color:#fff;
}
.cta8--motion{transition:box-shadow var(--cta-dur),--cta-rise var(--cta-rise-dur) var(--cta-rise-ease);}
.cta8--motion:is(:hover,:focus-visible){box-shadow:var(--cta-shadow);}
.cta8__copy{white-space:nowrap;}
.cta8--fill{
  transition:background-color .25s linear,color .25s linear,border-color .25s linear;
}
.cta8--fill:is(:hover,:focus-visible){
  background:var(--cta-brand);
  border-color:var(--cta-brand);
  color:#fff;
}

/* =================================================================
   ENGINE F — 09 form submit (inquiry / contact / quote forms)
   -----------------------------------------------------------------
   The form's PRIMARY action: solid brand blue. Hover = text slide +
   blue shadow only, colours never change (07 convention). :active
   sinks 1px — form buttons need click acknowledgement. --block makes
   it full width for stacked layouts.
   ================================================================= */
.cta9{
  --cta-h:48px;

  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:var(--cta-icon-gap);
  padding:0 28px;
  border:2px solid var(--cta-brand);
  background:var(--cta-brand);
  color:#fff;
  font-size:15px;
  transition:box-shadow var(--cta-dur),transform .12s ease,--cta-rise var(--cta-rise-dur) var(--cta-rise-ease);
}
.cta9:is(:hover,:focus-visible){box-shadow:var(--cta-shadow);}
.cta9:active{
  transform:translateY(1px);
  box-shadow:var(--cta-shadow-active);
  transition-duration:.12s;
}
.cta9--block{
  display:flex;
  width:100%;
}
.cta9--black{
  background:var(--cta-black);
  border-color:var(--cta-black);
}
.cta9--black:is(:hover,:focus-visible){box-shadow:var(--cta-shadow-ink);}
.cta9--black:active{box-shadow:var(--cta-shadow-ink-active);}
.cta9--roomy{--cta-icon-gap:14px;}

/* =================================================================
   SHARED TEXT-MOTION TRIGGER (v1.8) — 01–03 / 07 / 08A / 09
   hover 只翻转单一驱动变量 --cta-rise（0→1），sweep 升起与 stack 上滑
   同帧同曲线 → 圆盘把文字"推走/拉回"，无割裂。
   （裸 .cta 已覆盖 01/02/03 + 07 primary/secondary；08 fill 无 stack 不受影响）
   ================================================================= */
.cta:is(:hover,:focus-visible),
.cta8--motion:is(:hover,:focus-visible),
.cta9:is(:hover,:focus-visible){
  --cta-rise:1;
}

/* 站点紧凑档（所有引擎）：Inter 14px/700。置于所有引擎之后，
   覆盖 07/08/09 的 demo 档字面 font-size，保证站点按钮不显大、不显细。 */
.cta--header,.cta--site{
  --cta-font-size:14px;
  --cta-font-weight:700;
  font-size:14px;
  font-weight:700;
}
/* 04 的胶囊有字面 font-size:16px，继承不到上面的 token；站点档显式收紧。 */
.cta4--site .cta4__pill{font-size:14px;font-weight:700;}
/* FAQ 区入口（旧 .rsfaq__cta 自带 40px 上间距），仅 FAQ 场景挂载 */
.cta4--faq{margin-top:40px;}
.cta--primary.cta--lightgray{
  --cta-bg:var(--cta-gray);
  --cta-border:var(--cta-gray);
  --cta-border-hover:var(--cta-gray);
  --cta-ink:var(--cta-black);
  --cta-ink-hover:var(--cta-black);
}
.cta--primary.cta--lightgray:is(:hover,:focus-visible){
  box-shadow:none;
  --cta-rise:0;
}
.cta--primary.cta--lightgray:disabled{cursor:default;}
@media (min-width:1024px){
  .cta-card{margin-inline:-48px;}
}

/* =================================================================
   Reduced motion — one block for every engine
   ================================================================= */
@media (prefers-reduced-motion:reduce){
  .cta,.cta--primary,.cta--secondary,.cta8--motion,.cta9,.cta9:active,
  .cta4__pill,.cta4__disc,
  .cta5__pill,.cta6__pill,
  .cta8--fill,.cta__disc{transition-duration:.01ms;}
}
