/* 多端通用屏：三台设备是背景装置，正中文案与按钮才是可点的行动区 */

.platforms {
  /* 局部几何：2026-08-31 定稿——图片内缘锚定中央文字块边缘（各向外铺、外缘出屏由区块裁掉），
     高度恒定不随视口变（--win-w 定死 ⇒ 窗口带 90%/上留空 5% ⇒ 区块高 949 恒定）。
     缩窄时只多藏外侧、画面不缩不内收；藏到只剩 30%（≈1380px 视口）时
     图片回贴屏幕边缘半露、文字退场下放 */
  --win-w: 1364px;                              /* 固定尺寸：高度 854 恒定（用户裁定不再动） */
  --win-h: calc(var(--win-w) * .62618);         /* 1902:1191 截图高宽比 ≈ 854px */
  --text-w: 480px;                              /* 中央文字块宽（用户裁定定值） */
  --text-gap: 120px;                            /* 文字边缘与图片内缘的呼吸空间 */
  --win-peek: .5;
  --phone-w: clamp(165px, 13.5vw, 240px);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: calc(var(--win-h) / .9);          /* 窗口带恰占 90%，上下各留空 5% */
  padding: 0 var(--gutter);
  border-top: 1px solid var(--border);
  text-align: center;
}

/* 设备层放弃命中：中间「立即下载」必须能点；canvas 十字线在本屏用不上 */
.platforms__scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.device {
  position: absolute;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #05070B; /* 与 .stage__vector 同色，缩放留白不露异色 */
  box-shadow:
    0 0 0 1px rgba(var(--ink-rgb), .09),
    0 40px 90px -30px rgba(0, 0, 0, .8);
}

.device__bar {
  display: flex;
  flex: none;
  align-items: center;
  padding: 0 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.device__name {
  font-size: 12px;
  line-height: 1;
  color: var(--text-1);
  white-space: nowrap;
}

.device__ctl {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
}

.device__ctl > i { display: block; }

.device__canvas {
  display: block;
  flex: 1;
  min-height: 0;
  width: 100%;
}

/* Windows 桌面真机截图：整幅自带应用铬层，外壳不再画顶栏（防双栏）。
   设备比例对齐素材 1902:1191，cover 全幅零裁切 */
.device__shot {
  display: block;
  flex: 1;
  min-height: 0;
  width: 100%;
  object-fit: cover;
  background: #05070B;
}

/* ── Windows：左列底层——与手机重叠、藏在手机后面，边缘伸到手机中线
   （用户裁定：手机才是左侧贴文字的锚） ── */
.device--win {
  right: calc(50% + var(--text-w) / 2 + var(--text-gap) + var(--phone-w) / 2);
  top: 5%;
  z-index: 1;
  width: var(--win-w);
  aspect-ratio: 1902 / 1191;   /* 与截图同比对，cover 才是零裁切满幅 */
  border-radius: var(--r-sm);
}

/* ── macOS：内缘（左边）锚定文字块右缘外 --text-gap，向右外铺、外缘出屏由区块裁掉；
   真机截图自带交通灯标题栏，外壳不再画顶栏（防双栏）；底边与 Windows 同基线（下留空 5%） ── */
.device--mac {
  left: calc(50% + var(--text-w) / 2 + var(--text-gap));
  bottom: 5%;
  z-index: 1;
  width: var(--win-w);
  aspect-ratio: 16 / 10;   /* 1600/1000 烘焙图恰为 16:10 */
  border-radius: var(--r-md);
}

/* ── 手机：左列贴文字的锚——右缘距文字块左缘 120px（用户裁定），
   Windows 藏它后面、边缘到中线。轮廓照 iPhone 画：外圈金属中框 + 内圈屏幕黑边 + 侧键 + 灵动岛，
   真机截图（自身无铬层）铺满屏幕 ── */
.device--phone {
  /* 中框/黑边取 --phone-w 的比例而非固定像素：绝对定位元素的百分比 padding 按场景宽解析会变成巨框，
     而定死 4px 会让手机缩到 165px 时边框显得笨重——这正是原外壳「粗糙」的来源 */
  --rail: max(.75px, calc(var(--phone-w) * .011));   /* 兜到 0.75px：再细就整条中框消失在黑底里 */
  --bezel: calc(var(--phone-w) * .019);
  --key-out: max(1px, calc(var(--phone-w) * .006));
  right: calc(50% + var(--text-w) / 2 + var(--text-gap));
  bottom: 5%;
  z-index: 2;
  width: var(--phone-w);
  aspect-ratio: 1200 / 2670;   /* 与手机截图同比对，cover 零裁切 */
  padding: calc(var(--rail) + var(--bezel));
  overflow: visible;           /* 侧键要探出机身；屏幕由 .device__shot 自身圆角裁 */
  /* 金属中框：真机是圆边倒角，正投影下就是「两侧亮、正面暗」的一条横向光带 */
  background: linear-gradient(90deg, #99a1ac, #454b55 14%, #292d34 50%, #454b55 86%, #99a1ac);
  /* 斜杠写法：横竖半径都按宽度折算（竖 = 横 × 1200/2670），否则高瘦盒子的角会被拉成竖椭圆。
     squircle 是苹果那条连续曲率角，Chromium 139+ 生效，其余浏览器退回等半径圆角 */
  border-radius: 16% / 7.2%;
  corner-shape: squircle;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .55),
    0 40px 90px -30px rgba(0, 0, 0, .8);
}

/* 侧键：左侧操作钮 + 音量上下（一条渐变按硬色标切成三段），右侧电源。
   只探出机身一线——正投影下真机就这么点，画粗立刻塑料感 */
.device--phone::before,
.device--phone::after {
  content: "";
  position: absolute;
  width: calc(var(--key-out) * 2);
  background: #5b616a;
}

.device--phone::before {
  left: calc(var(--key-out) * -1);
  top: 17.5%;
  height: 20%;
  border-radius: 1px 0 0 1px;
  background: linear-gradient(180deg,
    #5b616a 0 17%, transparent 17% 32%,
    #5b616a 32% 61%, transparent 61% 69%,
    #5b616a 69% 100%);
}

.device--phone::after {
  right: calc(var(--key-out) * -1);
  top: 25.5%;
  height: 10.5%;
  border-radius: 0 1px 1px 0;
}

/* 屏幕：黑边用 spread 阴影画——它跟着屏幕圆角外扩，正好填满中框内圈那一环，
   比再套一层 DOM 干净 */
.device--phone .device__shot {
  border-radius: 14% / 6.3%;
  corner-shape: squircle;
  box-shadow: 0 0 0 var(--bezel) #05070B;
}

/* 灵动岛：屏幕顶端居中的黑药丸，尺寸照 iPhone 折算（126×37.3pt 之于 393pt 屏宽），
   右侧那颗是镜头开孔 */
.device__island {
  position: absolute;
  top: 2.5%;
  left: 50%;
  z-index: 1;
  width: 30%;
  aspect-ratio: 126 / 37.33;
  border-radius: 999px;
  background: #000;
  transform: translateX(-50%);
}

.device__island::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 8.5%;
  width: 14%;
  aspect-ratio: 1;
  border-radius: 50%;
  /* 镜头只比岛体亮一点点：真机上它几乎融进黑色，画亮就成了塑料玩具的大眼珠 */
  background: radial-gradient(circle at 36% 30%, #1b2430, #070a0e 70%);
  transform: translateY(-50%);
}

.platforms__inner {
  position: relative;
  z-index: 2;
  /* 宽度即图片内缘锚点（--text-w）：两侧图片在这个边界外 --text-gap 铺开。
     文字落在空出来的间隙里、不压图，背景阴影块（径向暗幕）已按用户裁定移除 */
  max-width: var(--text-w);
  margin-inline: auto;
}

/* 文字压画面，间距收一档让暗幕罩得住（全局节奏在别的屏不受影响） */
.platforms__inner .section__eyebrow { margin-bottom: var(--sp-8); }

.platforms__inner .section__lede {
  margin-inline: auto;
  margin-top: var(--sp-8);
}

.platforms__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-12);
  margin-top: var(--sp-16);
}

/* 灵动岛与圆角取百分比：下沉态行高随视口缩放，固定像素会在小尺寸上比例失调 */

/* 文字下沉态（外侧藏到 30% 以下）：三设备改居中一行——两窗口分列、手机正中，
   间距 40px；行高随视口等比缩放（可用宽 − 两个间距摊到三台高宽比之和 3.659），
   全员完整可见、不重叠不裁切 */
@media (max-width: 1436px) {
  .platforms {
    /* 行高预算：可用宽 − 两个 40px 间距，摊到三台高宽比之和 3.646
       （win 1.597 + 手机 1200/2670≈0.449 + mac 1.6） */
    --row-h: calc((100vw - 2 * var(--gutter) - 80px) / 3.646);
    /* 手机改由宽度驱动（高度交给 aspect-ratio 得回 --row-h）：中框/侧键都按 --phone-w 折算，
       宽度不落到变量上，缩到这一档时边框比例会失真 */
    --phone-w: calc(var(--row-h) * 1200 / 2670);
    min-height: auto;
    padding-bottom: clamp(24px, 3vw, 40px);
  }
  .platforms__scene {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 40px;
    padding: 24px var(--gutter) 0;
  }
  /* relative 而非 static：手机灵动岛与侧键是绝对定位，static 会让它们逃逸到场景层、
     百分比按场景宽解析成巨大长条（用户报障的「巨大圆边形状」根因） */
  .platforms__scene .device { position: relative; transform: none; }
  .device--win { right: auto; top: auto; width: auto; height: var(--row-h); }
  .device--phone { left: auto; right: auto; bottom: auto; order: 2; }
  .device--mac { left: auto; right: auto; bottom: auto; width: auto; height: var(--row-h); order: 3; }
  .platforms__inner { padding-top: calc(24px + var(--row-h) + 32px); }
}

/* 手机：场景退役，文字独居（padding-top 清零防止大空洞） */
@media (max-width: 600px) {
  .platforms { padding-block: var(--sp-64); }
  .platforms__scene { display: none; }
  .platforms__inner { padding-top: 0; }
}
