/* 入组流程 5 屏 + 消息弹窗。坐标、尺寸取自 Figma 03 高保真页对应画板（402×874）。
   渐变角度按 use_figma 读到的 gradientTransform 换算，没有用 codegen 给的角度（codegen 偏差大）。 */

/* ---------- 公共背景 ---------- */
.bg-top {              /* 顶部淡渐变-同医生主页：402×330，透明度 51%，向下淡出 */
  left: 0; top: 0; width: 402px; height: 330px; opacity: .51;
  background: linear-gradient(57.98deg, #deecff 10.6%, #afd5ff 56.3%, #7fc7fd 93.7%);
  -webkit-mask-image: linear-gradient(#000, rgba(0,0,0,.85) 55%, rgba(0,0,0,.35) 82%, transparent);
          mask-image: linear-gradient(#000, rgba(0,0,0,.85) 55%, rgba(0,0,0,.35) 82%, transparent);
}
.bg-page {             /* 顶部蓝紫渐变：整屏，透明度 28% */
  left: 0; top: 0; width: 402px; height: 874px; opacity: .28;
  background: linear-gradient(21.74deg, #bed1fd 26.3%, #bed1fd 51.1%, #7fc7fd 93.8%);
  -webkit-mask-image: linear-gradient(rgba(0,0,0,.55), rgba(0,0,0,.25) 30%, rgba(0,0,0,.25));
          mask-image: linear-gradient(rgba(0,0,0,.55), rgba(0,0,0,.25) 30%, rgba(0,0,0,.25));
}

/* ================= 扫码入组页 2740:1965 ================= */
.page-scan { background: var(--text-secondary); }   /* 模拟取景画面：text/secondary #666 */
.sc-body {
  left: 40px; top: 178px; width: 322px;
  display: flex; flex-direction: column; align-items: center; gap: 137px;
}
.sc-top { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 52px; }
.sc-view { position: relative; width: 322px; height: 322px; flex: none; cursor: pointer; border-radius: 16px; }
.sc-view > * { position: absolute; }
.sc-qr { left: 51px; top: 51px; width: 220px; height: 220px; border-radius: var(--radius-16); background: #fff; overflow: hidden; }
.sc-qr > * { position: absolute; }
.sc-qr-code { left: 17.5px; top: 17.5px; width: 185px; height: 185px; }
.sc-logo-bg { left: 84px; top: 84px; width: 52px; height: 52px; border-radius: 12px; background: #fff; }
.sc-logo { left: 88px; top: 88px; width: 44px; height: 44px; border-radius: 12px; overflow: hidden; }
.sc-logo img { position: absolute; left: -12.5%; top: -3.33%; width: 125%; height: 166.67%; max-width: none; }
.sc-frame { left: -1.5px; top: -1.5px; width: 325px; height: 325px; }

/* 扫描线：光晕 + 3px 线，左右淡出（Figma 用蒙版，同样做法） */
.sc-line {
  left: 0; top: 0; width: 322px; height: 64px;
  transform: translateY(163px);      /* 设计稿静帧位置 */
  -webkit-mask-image: linear-gradient(90deg, transparent, rgba(0,0,0,.85) 15%, #000 35%, #000 65%, rgba(0,0,0,.85) 85%, transparent);
          mask-image: linear-gradient(90deg, transparent, rgba(0,0,0,.85) 15%, #000 35%, #000 65%, rgba(0,0,0,.85) 85%, transparent);
  pointer-events: none;
}
.sc-glow { position: absolute; left: 0; top: 0; width: 100%; height: 61px;
  background: linear-gradient(rgba(104,135,237,0), rgba(104,135,237,.2) 60%, rgba(104,135,237,.5)); }
.sc-bar { position: absolute; left: 0; top: 61px; width: 100%; height: 3px; border-radius: 1px;
  background: var(--brand-primary); box-shadow: 0 0 6px rgba(104,135,237,.9); }

/* 扫描中：自上而下慢扫，首尾淡入淡出（不闪、不回弹） */
.page-scan.is-scanning .sc-line { animation: ww-scan 2.4s ease-in-out infinite; }
@keyframes ww-scan {
  0%   { transform: translateY(-10px); opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translateY(210px); opacity: 0; }
}

/* 识别成功：扫描线收起，二维码中央出勾 */
.sc-ok {
  left: 133px; top: 133px; width: 56px; height: 56px; border-radius: 50%;
  box-shadow: 0 0 0 6px #fff;
  opacity: 0; transform: scale(.9);
  transition: opacity 250ms var(--ease-out), transform 250ms var(--ease-out);
}
.sc-ok img { width: 56px; height: 56px; }
.page-scan.is-done .sc-line { animation: none; opacity: 0; transition: opacity 200ms var(--ease-out); }
.page-scan.is-done .sc-ok { opacity: 1; transform: none; }

.sc-tip { width: 100%; font-size: 18px; line-height: 27px; color: var(--text-anti); text-align: center; }
.sc-actions { width: 224px; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.btn-ghost {           /* 次按钮在深色取景上的覆盖：黑 25% */
  height: 44px; min-width: 88px; padding: 0 16px;
  border-radius: var(--radius-full);
  background: rgba(0,0,0,.25);
  color: var(--text-anti); font-size: 18px; line-height: 27px; font-weight: 600;
  transition: background-color 200ms var(--ease-out);
}
.btn-ghost:active { background: rgba(0,0,0,.4); }
.sc-hint { width: 100%; font-size: 16px; line-height: 24px; color: var(--text-anti); text-align: center; white-space: nowrap; }

/* ================= 确认医生页 2740:1989 ================= */
.dc-rings { left: 30px; top: 66px; width: 343px; height: 343px; }
.dc-photo { left: 78px; top: 106px; width: 252px; height: 336px; }
.dc-sheet-blur {       /* Rectangle 16 的背景模糊：用 mask 限定形状（backdrop-filter 不受 clip-path 裁切） */
  left: 0; top: 367px; width: 402px; height: 507px;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='402' height='507'%3E%3Cpath d='M0 24C0 10.745 10.745 0 24 0H168.429C173.279 0 177.988 1.519 182.25 3.834C187.444 6.655 194.892 10 201 10C207.108 10 214.556 6.655 219.75 3.834C224.012 1.519 228.721 0 233.571 0H378C391.255 0 402 10.745 402 24V507H0Z'/%3E%3C/svg%3E") 0 0 / 402px 507px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='402' height='507'%3E%3Cpath d='M0 24C0 10.745 10.745 0 24 0H168.429C173.279 0 177.988 1.519 182.25 3.834C187.444 6.655 194.892 10 201 10C207.108 10 214.556 6.655 219.75 3.834C224.012 1.519 228.721 0 233.571 0H378C391.255 0 402 10.745 402 24V507H0Z'/%3E%3C/svg%3E") 0 0 / 402px 507px no-repeat;
}
.dc-sheet { left: -20.5px; top: 340.5px; width: 443px; height: 548px; pointer-events: none; }  /* 白 50% + 白描边 + 向上白色投影 */

.dc-content { left: 16px; top: 391px; width: 370px; display: flex; flex-direction: column; gap: 42px; z-index: 1; }
.dc-info { display: flex; flex-direction: column; gap: 24px; }
.dc-head { width: 240px; display: flex; flex-direction: column; gap: 12px; }
.dc-name-row { display: flex; align-items: center; gap: 12px; }
.dc-name { font-size: 28px; line-height: 36px; font-weight: 600; white-space: nowrap; }
.dc-org { display: flex; align-items: center; gap: 4px; font-size: 16px; line-height: 24px; white-space: nowrap; }
.dc-org img { width: 20px; height: 20px; margin-right: 4px; }

.dc-card { height: 247px; padding: 24px 16px; border-radius: var(--radius-16); background: var(--bg-container); display: flex; flex-direction: column; align-items: center; }
.dc-card-in { width: 338px; display: flex; flex-direction: column; align-items: center; gap: 24px; }
.dc-stats { display: flex; align-items: center; gap: 58px; }
.dc-stat { display: flex; align-items: center; gap: 12px; }
.dc-stat > div { width: 80px; display: flex; flex-direction: column; gap: 2px; }
.icon-circle { width: 40px; height: 40px; border-radius: 50%; background: var(--brand-light); display: flex; align-items: center; justify-content: center; flex: none; }
.icon-circle img { width: 24px; height: 24px; }
.dc-num { display: flex; align-items: flex-start; gap: 4px; white-space: nowrap; }
.dc-num b { font-size: 22px; line-height: 30px; font-weight: 600; }
.dc-num span { font-size: 18px; line-height: 27px; }
.dc-label { font-size: 14px; line-height: 20px; color: var(--text-secondary); white-space: nowrap; }
.dc-divider { width: 100%; height: 1px; border: 0; background: var(--border-divider); }
.dc-tabs { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.dc-tab-row { position: relative; width: 256px; height: 35px; display: flex; justify-content: space-between; align-items: flex-start; }
.dc-tab {
  position: relative; width: 72px; height: 27px;
  font-size: 18px; line-height: 27px; text-align: center; color: var(--text-secondary);
  transition: color 200ms var(--ease-out);
}
.dc-tab::before { content: ""; position: absolute; left: -14px; right: -14px; top: -9px; bottom: -12px; }  /* 热区 100×48 */
.dc-tab.is-on { font-weight: 600; color: var(--text-primary); }
.dc-tab-line {         /* Line 3：长 18、描边 5、圆头，中心在 y=35；切换时滑动 */
  position: absolute; left: 27px; top: 32.5px; width: 18px; height: 5px; border-radius: 3px;
  background: var(--brand-primary);
  transition: transform 250ms var(--ease-out);
}
.dc-tab-row[data-active="1"] .dc-tab-line { transform: translateX(184px); }
.dc-panels { position: relative; width: 100%; min-height: 48px; }
.dc-desc { width: 100%; font-size: 16px; line-height: 24px; color: var(--text-secondary);
  opacity: 0; visibility: hidden; position: absolute; left: 0; top: 0;
  transition: opacity 200ms var(--ease-out), visibility 0s linear 200ms; }
.dc-desc.is-on { opacity: 1; visibility: visible; position: relative; transition: opacity 200ms var(--ease-out); }

/* ================= 选择服务页 2740:2080 ================= */
.sv-photo { left: 248px; top: 90px; width: 156px; height: 208px; }
.sv-head { left: 16px; top: 134px; display: flex; flex-direction: column; gap: 8px; white-space: nowrap; }
.sv-title { font-size: 28px; line-height: 36px; font-weight: 600; }
.sv-sub { font-size: 14px; line-height: 20px; color: var(--text-secondary); }

/* 两张服务卡总宽 456，超出屏宽 → 横向滑动（设计稿里第二张卡被屏幕边缘截断） */
.sv-plans {
  left: 0; top: 242px; width: 402px; padding: 0 16px;
  display: flex; gap: 16px; align-items: stretch;
  overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; scroll-padding: 0 16px;
}
.sv-plans::-webkit-scrollbar { display: none; }
.sv-plans::after { content: ""; flex: none; width: 1px; }
.sv-plan {
  flex: none; width: 220px; min-height: 129px; padding: 16px;
  border-radius: var(--radius-16); background: var(--bg-container);
  display: flex; flex-direction: column; justify-content: center; gap: 12px;
  text-align: left; scroll-snap-align: start;
  transition: background-color 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.sv-plan.is-on { background: var(--brand-light); box-shadow: inset 0 0 0 2px var(--brand-primary); }  /* Figma 内描边 2，不占布局 */
.sv-plan-top { display: flex; flex-direction: column; gap: 4px; }
.sv-plan-name { display: flex; align-items: baseline; gap: 6px; font-size: 18px; line-height: 27px; font-weight: 600; white-space: nowrap; }
.sv-plan-name .tag { width: 68px; align-self: center; }
.sv-plan-desc { font-size: 14px; line-height: 20px; color: var(--text-secondary); white-space: nowrap; }
.sv-price { display: flex; align-items: baseline; gap: 2px; white-space: nowrap; }
.sv-yen { font-size: 18px; line-height: 27px; font-weight: 600; }
.sv-price b { font-size: 22px; line-height: 30px; font-weight: 600; }
.sv-per { font-size: 16px; line-height: 24px; color: var(--text-secondary); }
.sv-free { font-size: 22px; line-height: 30px; font-weight: 600; }

.sv-sheet {
  left: 0; top: 395px; width: 402px; height: 479px;
  padding: 24px 16px; border-radius: var(--radius-24) var(--radius-24) 0 0;
  background: var(--bg-container);
  display: flex; flex-direction: column; gap: 24px;
}
.sv-sheet-title { font-size: 18px; line-height: 27px; font-weight: 600; }
.sv-sheet-title span { font-size: 14px; line-height: 20px; font-weight: 400; color: var(--text-placeholder); }
.sv-list { list-style: none; display: flex; flex-direction: column; gap: 24px; transition: opacity 200ms var(--ease-out); }
.sv-list li { display: flex; align-items: center; gap: 16px; }
.sv-list li > span:last-child { display: flex; flex-direction: column; gap: 4px; }
.sv-list b { font-size: 16px; line-height: 24px; font-weight: 400; }
.sv-list small { font-size: 14px; line-height: 20px; color: var(--text-secondary); }
.icon-box { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-light); display: flex; align-items: center; justify-content: center; flex: none; }
.icon-box img { width: 24px; height: 24px; }

.sv-foot { left: 16px; top: 736px; width: 370px; display: flex; flex-direction: column; gap: 16px; }
.agree-row {           /* 视觉高 24，热区 44 */
  min-height: 44px; margin: -10px 0;
  display: flex; align-items: center; gap: 6px; cursor: pointer; align-self: flex-start;
}
.agree-text { font-size: 14px; line-height: 20px; color: var(--text-placeholder); white-space: nowrap; }
.page-service[data-plan="basic"] .agree-row { visibility: hidden; }
/* 两套权益：随访=叠加在基础之上的 3 项；基础=AI 解读 / 危急通知 / 记录查看 */
.sv-list[data-for="basic"], .page-service[data-plan="basic"] .sv-list[data-for="follow"], .page-service[data-plan="basic"] .sv-note { display: none; }
.page-service[data-plan="basic"] .sv-list[data-for="basic"] { display: flex; }
.sv-list { animation: ww-fade 200ms var(--ease-out); }

/* ================= 基本信息页 2740:2058 / 添加家人页 2740:2160 ================= */
.form-content { left: 16px; top: 122px; width: 370px; display: flex; flex-direction: column; }
.gap-info { gap: 362px; }
.gap-family { gap: 121px; }
.form-group { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.form-stack { width: 100%; display: flex; flex-direction: column; gap: 16px; }
.card { width: 100%; border-radius: var(--radius-16); background: var(--bg-container); overflow: hidden; }
.form-note { width: 100%; font-size: 14px; line-height: 20px; color: var(--text-secondary); text-align: center; }

.group { width: 100%; border-radius: var(--radius-16); overflow: hidden; }
.group-head {
  height: 59px; padding: 16px; background: var(--brand-light);
  display: flex; align-items: center; justify-content: space-between;
}
.group-head h2 { font-size: 18px; line-height: 27px; font-weight: 600; }
.group-add {
  height: 44px; margin: -8px -8px -8px 0; padding: 0 8px;
  display: flex; align-items: center; gap: 8px;
  font-size: 16px; line-height: 24px; color: var(--text-primary);
  border-radius: var(--radius-full);
}
.group-add img { width: 20px; height: 20px; }
.group-add:active { background: rgba(63,95,224,.08); }
.group-body { background: var(--bg-container); }
.form-actions { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 16px; }

/* ================= 消息弹窗页 2740:2200 ================= */
.mask {                /* 遮罩 1756:1722：黑 60% */
  inset: 0; z-index: 10; background: rgba(0,0,0,.6);
  opacity: 0; visibility: hidden;
  transition: opacity 250ms var(--ease-out), visibility 0s linear 250ms;
}
.sheet {               /* 底部弹层 */
  left: 0; bottom: 0; width: 402px; height: 302px; z-index: 11;
  padding: 48px 16px 50px;
  border-radius: var(--radius-24) var(--radius-24) 0 0;
  background: var(--bg-container);
  display: flex; flex-direction: column; gap: 56px;
  transform: translateY(100%);
  transition: transform 300ms var(--ease-out);
}
.sheet[hidden] { display: flex; visibility: hidden; }
.sheet-text { display: flex; flex-direction: column; gap: 12px; text-align: center; }
.sheet-text h2 { font-size: 22px; line-height: 30px; font-weight: 600; }
.sheet-text p { font-size: 18px; line-height: 27px; color: var(--text-secondary); }
.homebar-top { z-index: 12; opacity: 0; transition: opacity 250ms var(--ease-out); }

.page-family.is-sheet .mask { opacity: 1; visibility: visible; transition: opacity 250ms var(--ease-out); }
.page-family.is-sheet .sheet { transform: none; }
.page-family.is-sheet .homebar-top { opacity: 1; }

/* ================= 手机端底部选择器（选项 / 日期滚轮） ================= */
.pk-mask {
  position: absolute; inset: 0; z-index: 40; background: rgba(0,0,0,.6);
  opacity: 0; visibility: hidden;
  transition: opacity 250ms var(--ease-out), visibility 0s linear 250ms;
}
.pk {
  position: absolute; left: 0; bottom: 0; width: 402px; z-index: 41;
  padding: 8px 0 34px;                          /* 底部让出 Home 条 */
  border-radius: var(--radius-24) var(--radius-24) 0 0;
  background: var(--bg-container);
  transform: translateY(100%);
  transition: transform 300ms cubic-bezier(.22,.61,.36,1);
}
.pk[hidden] { display: block; visibility: hidden; }
.screen.is-picking .pk-mask { opacity: 1; visibility: visible; transition: opacity 250ms var(--ease-out); }
.screen.is-picking .pk { transform: none; }

.pk-head { height: 64px; padding: 0 8px; display: flex; align-items: center; }
.pk-head h2 { flex: 1; text-align: center; font-size: 18px; line-height: 27px; font-weight: 600; }
.pk-cancel, .pk-ok {
  min-width: 72px; height: 48px; padding: 0 12px; border-radius: var(--radius-full);
  font-size: 18px; line-height: 27px;
}
.pk-cancel { color: var(--text-secondary); }
.pk-ok { color: var(--brand-primary); font-weight: 600; }
.pk-cancel:active, .pk-ok:active { background: var(--bg-page); }
.pk[data-mode="list"] .pk-ok { visibility: hidden; }       /* 选项：点一下即选中并收起 */
.pk[data-mode="list"] .pk-wheels, .pk[data-mode="date"] .pk-list { display: none; }

.pk-list { padding: 0 16px 8px; display: flex; flex-direction: column; }
.pk-opt {
  position: relative; height: 64px; padding: 0 16px; border-radius: var(--radius-16);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 18px; line-height: 27px; color: var(--text-primary); text-align: left;
  transition: background-color 200ms var(--ease-out);
}
.pk-opt + .pk-opt::before { content: ""; position: absolute; left: 16px; right: 16px; top: 0; height: 1px; background: var(--border-divider); }
.pk-opt:active { background: var(--bg-page); }
.pk-opt[aria-selected="true"] { color: var(--brand-primary); font-weight: 600; }
.pk-opt img { width: 24px; height: 24px; opacity: 0; transition: opacity 200ms var(--ease-out); }
.pk-opt[aria-selected="true"] img { opacity: 1; }

/* 日期滚轮：每行 52，显示 5 行，中间一行是选中项 */
.pk-wheels {
  position: relative; height: 260px; margin: 0 16px 16px;
  display: grid; grid-template-columns: 1.3fr 1fr 1fr;
  -webkit-mask-image: linear-gradient(transparent, #000 32%, #000 68%, transparent);
          mask-image: linear-gradient(transparent, #000 32%, #000 68%, transparent);
}
.pk-band { position: absolute; left: 0; right: 0; top: 104px; height: 52px; border-radius: 12px; background: var(--bg-page); }
.pk-col {
  position: relative; height: 260px; overflow-y: auto; scrollbar-width: none;
  scroll-snap-type: y mandatory; overscroll-behavior: contain;
  padding: 104px 0; outline: none;
}
.pk-col::-webkit-scrollbar { display: none; }
.pk-col:focus-visible { box-shadow: inset 0 0 0 2px var(--brand-primary); border-radius: 12px; }
.pk-item {
  height: 52px; display: flex; align-items: center; justify-content: center;
  scroll-snap-align: center; cursor: pointer;
  font-size: 20px; line-height: 28px; color: var(--text-placeholder);
  transition: color 150ms var(--ease-out);
}
.pk-item.is-on { color: var(--text-primary); font-weight: 600; }
