/* 登录页 · Figma 节点 2740:3307（402×874）
   坐标、尺寸直接取自设计稿；动效取自 Figma 画板「登录页-动效」3832:2489 的关键帧 */

/* ---------- 背景层 ---------- */
.lg-sky {                     /* 顶部蓝紫渐变 2740:3311 */
  position: absolute; inset: 0;
  background: linear-gradient(13.783deg, #ccdbfd 27.966%, #b1d1fd 68.573%, #65bdfd 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.9) 35%, rgba(0,0,0,.65) 65%, rgba(0,0,0,.8) 100%);
          mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.9) 35%, rgba(0,0,0,.65) 65%, rgba(0,0,0,.8) 100%);
}
.lg-tint {                    /* 深色斜铺 2740:3314 */
  position: absolute; inset: 0;
  opacity: .3;
  background: radial-gradient(490px 430px at 410px -40px,
    rgba(95,108,232,.8) 0%, rgba(104,116,235,.66) 25%, rgba(124,135,239,.4) 50%,
    rgba(163,173,245,.16) 75%, rgba(199,206,250,0) 100%);
}
.lg-ambient {                 /* 氛围底色 2740:3328 */
  position: absolute; left: -255px; top: 307px; width: 892px; height: 610px;
}

/* ---------- 插画区 ---------- */
.lg-rings { position: absolute; left: 45px; top: 108px; width: 312px; height: 312px; }
.lg-elephant { position: absolute; left: 94px; top: 156px; width: 219px; height: 292px; object-fit: cover; }

.lg-card-box { position: absolute; }
.lg-card {
  position: absolute;
  /* 描边：Figma 为 brand/primary 渐变（不透明→透明→不透明）× 15% 透明度，几乎看不出，不是实色蓝边 */
  border: 1px solid transparent;
  background:
    linear-gradient(rgba(255,255,255,.9), rgba(255,255,255,.9)) padding-box,
    linear-gradient(147.3deg, rgba(63,95,224,.15) 21.7%, rgba(63,95,224,0) 48.2%, rgba(63,95,224,.15) 72.6%) border-box;
  border-radius: var(--radius-16);
  box-shadow: 4px 4px 4px rgba(63,95,224,.05);
  -webkit-backdrop-filter: blur(15px);
          backdrop-filter: blur(15px);
  transform: rotate(var(--r, 0deg)) translateY(var(--ty, 0px));
}
.lg-card > img { position: absolute; }

/* 心形卡 Group 33：卡片和图标在 Figma 里是两个独立旋转层，整组做位移 */
.lg-heart { left: 238.96px; top: 76px; width: 73.485px; height: 73.485px; transform: translateY(var(--ty, 0px)); }
.lg-heart .lg-card { left: 6.74px; top: 6.74px; width: 60px; height: 60px; --r: 15deg; transform: rotate(var(--r)); }
.lg-heart .lg-heart-icon { position: absolute; left: 19.05px; top: 18.05px; width: 36px; height: 36px; transform: rotate(15deg); }

/* 医生卡 Frame 472 */
.lg-doctor { left: 75px; top: 101.41px; width: 88.182px; height: 88.182px; }
.lg-doctor .lg-card {
  left: 8.09px; top: 8.09px; width: 72px; height: 72px; --r: -15deg;
  /* 填充与描边按 Figma gradientTransform 换算（codegen 给的 125deg 角度不准） */
  border: 1px solid transparent;
  border-radius: var(--radius-24);
  background:
    linear-gradient(163.6deg, #9487fa -127.2%, #3f5fe0 96.1%) padding-box,
    linear-gradient(142.8deg, #fff 28.5%, rgba(255,255,255,.5) 53.5%, #fff 70.8%) border-box;
  box-shadow: 0 4px 4px rgba(63,95,224,.25);
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.lg-doctor .lg-card > img { left: 13.71px; top: 14.22px; width: 42px; height: 42px; }

/* 血糖卡 Frame 473 */
.lg-drop { left: 25.4px; top: 253.59px; width: 61.522px; height: 61.522px; }
.lg-drop .lg-card { left: 6.76px; top: 6.76px; width: 48px; height: 48px; --r: -20deg; }
.lg-drop .lg-card > img { left: 10.73px; top: 10.14px; width: 24px; height: 24px; }

/* 家人卡 Frame 474 */
.lg-user { left: 316.48px; top: 198px; width: 61.237px; height: 61.237px; }
.lg-user .lg-card { left: 5.62px; top: 5.62px; width: 50px; height: 50px; --r: 15deg; }
.lg-user .lg-card > img { left: 10px; top: 10px; width: 28px; height: 28px; }

/* 注：CSS rotate 正值为顺时针，Figma rotation 正值为逆时针，已换算 */

/* ---------- 毛玻璃弧形 2740:3350 ---------- */
.lg-glass {
  position: absolute; left: 0; top: 334px; width: 402px; height: 540px;
  background: rgba(255,255,255,.6);
  -webkit-backdrop-filter: blur(15px);
          backdrop-filter: blur(15px);
  /* 用 mask 而不是 clip-path：Chrome 的 backdrop-filter 不受 clip-path 裁切，会把弧线上方的小象也糊掉 */
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='402' height='540'%3E%3Cpath d='M0 0C0 0 122.117 29.649 201 29.649C279.883 29.649 402 0 402 0V540H0Z'/%3E%3C/svg%3E") 0 0 / 402px 540px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='402' height='540'%3E%3Cpath d='M0 0C0 0 122.117 29.649 201 29.649C279.883 29.649 402 0 402 0V540H0Z'/%3E%3C/svg%3E") 0 0 / 402px 540px no-repeat;
}
.lg-glass-edge { position: absolute; left: 0; top: 334px; overflow: visible; pointer-events: none; }

/* ---------- 内容 Frame 476 ---------- */
.lg-content {
  position: absolute; z-index: 1; left: 16px; top: 406px; width: 370px;
  display: flex; flex-direction: column; align-items: center; gap: 72px;
}
.lg-head { width: 236px; display: flex; flex-direction: column; gap: 8px; text-align: center; }
.lg-title {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 28px; line-height: 36px;
  color: var(--text-primary);
}
.lg-title em { font-style: normal; color: var(--brand-primary); }
.lg-sub { font-size: 18px; line-height: 27px; color: var(--text-secondary); }

.lg-actions { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 52px; }
.lg-main { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.lg-phone { width: 100%; font-size: 28px; line-height: 36px; font-weight: 600; text-align: center; color: var(--text-primary); }

/* 协议行：视觉高 24，热区扩到 44（上下各让 10px） */
.lg-agree {
  width: 100%; min-height: 44px; margin: -10px 0;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer;
}
.lg-agree-text { font-size: 14px; line-height: 20px; white-space: nowrap; color: var(--text-primary); }
.lg-agree-text span { color: var(--text-placeholder); }

/* ---------- 进入动效（Figma 3832:2489 关键帧换算） ---------- */
@property --ty { syntax: "<length>"; inherits: false; initial-value: 0px; }

@keyframes ww-fade   { from { opacity: 0; } to { opacity: 1; } }
@keyframes ww-rise   { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ww-card-in{ from { opacity: 0; --ty: 8px; } to { opacity: 1; --ty: 0px; } }
@keyframes ww-float  { 0%, 100% { --ty: 0px; } 50% { --ty: -4px; } }

.play .lg-rings    { animation: ww-fade var(--dur) var(--ease-out) .10s both; }
.play .lg-elephant { animation: ww-rise var(--dur) var(--ease-out) .20s both; }

/* 卡片：300ms 浮现，随后 4s 一个来回、幅度 4px 的慢速漂浮 */
.play .js-float {
  animation:
    ww-card-in var(--dur) var(--ease-out) var(--d) both,
    ww-float 4s var(--ease-in-out) calc(var(--d) + .3s) infinite;
}
.lg-doctor .lg-card { --d: .45s; }
.lg-heart           { --d: .53s; }
.lg-user .lg-card   { --d: .61s; }
.lg-drop .lg-card   { --d: .69s; }

.play .lg-head      { animation: ww-rise var(--dur) var(--ease-out) .75s both; }
.play .lg-main      { animation: ww-rise var(--dur) var(--ease-out) .85s both; }
.play .btn-secondary{ animation: ww-rise var(--dur) var(--ease-out) .95s both; }

/* 图片未加载完前先不播，避免小象「闪现」 */
.screen:not(.ready) .lg-rings,
.screen:not(.ready) .lg-elephant,
.screen:not(.ready) .js-float,
.screen:not(.ready) .lg-head,
.screen:not(.ready) .lg-main,
.screen:not(.ready) .btn-secondary { opacity: 0; }
