/* ============================================================
   screens.css — 各屏幕布局
   拍立得模拟器 · 阶段三 Round 1
   ============================================================ */

/* —— ① 主页 —— */
.home { align-items: center; text-align: center; padding: 0 28px; }

.hero { margin-top: clamp(28px, 9vh, 72px); }
.hero-title {
  margin: 0; font-size: clamp(30px, 9vw, 40px); font-weight: 700;
  letter-spacing: -.5px; line-height: 1.1;
}
.hero-title span { color: var(--accent); }
.hero-sub {
  margin: 12px 0 0; font-size: 15px; color: var(--label-2); font-weight: 500;
}

.home-preview {
  flex: 1; display: grid; place-items: center; width: 100%;
}
.home-preview .paper-thumb {
  width: clamp(150px, 46vw, 200px);
  transform: rotate(-3deg);
  transition: transform .5s var(--ease);
}
.home-preview .paper-thumb .pt-image {
  background: linear-gradient(155deg, #F7C59F, #E8825E 50%, #C25B9A);
}
.home-preview .paper-thumb .pt-caption { color: var(--label-2); }

.home-hint, .home-preview { animation: floaty 4s ease-in-out infinite; }
.home-preview { animation: floaty 5s ease-in-out infinite; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
/* 仅让预览浮动，提示文字不参与旋转 */
.home-hint { animation: none; margin: 0 0 calc(120px + env(safe-area-inset-bottom,0px)); font-size: 13px; color: var(--label-3); }

/* —— ② 选相纸 —— */
.select { background: var(--bg); }
.select-body {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; justify-content: center;
  padding: 20px 18px; gap: 22px;
}
.section-label {
  margin: 0; font-size: 13px; font-weight: 600; color: var(--label-2);
  text-transform: none; letter-spacing: .02em; padding-left: 4px;
}

.type-cards { display: flex; flex-direction: column; gap: 12px; }
.type-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--card);
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  transition: border-color .2s var(--ease), transform .12s var(--ease);
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
/* 选中态：用 ::after 预渲染蓝边+阴影，仅做 opacity/scale 合成层动画，
   避免 box-shadow 逐帧重绘（移动端卡顿主因） */
.type-card::after {
  content: ""; position: absolute; inset: 0;
  border-radius: var(--radius);
  border: 1.5px solid var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 6px 16px -6px rgba(0,122,255,.35);
  opacity: 0; transform: scale(.96);
  transition: opacity .22s var(--ease), transform .22s var(--ease);
  pointer-events: none;
}
.type-card.sel::after { opacity: 1; transform: scale(1); }
.type-card:active { transform: scale(.985); }
.tc-thumb { flex: none; width: 48px; display: grid; place-items: center; }
.tc-meta { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.tc-meta b { font-size: 16px; font-weight: 600; }
.tc-meta i { font-size: 12.5px; color: var(--label-2); font-style: normal; }
.tc-check {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid var(--label-3);
  display: grid; place-items: center; color: #fff;
  transition: background .2s, border-color .2s;
}
.tc-check svg { width: 16px; height: 16px; opacity: 0; transition: opacity .15s; }
.type-card.sel .tc-check { background: var(--accent); border-color: var(--accent); }
.type-card.sel .tc-check svg { opacity: 1; }

/* sq 排版分段 */
.seg-field { display: flex; flex-direction: column; gap: 10px; }
.seg-label { font-size: 13px; font-weight: 600; color: var(--label-2); padding-left: 4px; }
.seg-field[hidden] { display: none; }

/* —— ③ 编辑屏 —— */
.editor { background: var(--bg); }

.editor-stage {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  padding: 16px; min-height: 0;
  container-type: size;   /* 相纸尺寸以实际舞台宽高为基准，确保不溢出 */
}
.editor-paper {
  position: relative; background: #fff; border-radius: 8px;
  box-shadow: 0 20px 44px -16px rgba(0,0,0,.4), 0 6px 16px rgba(0,0,0,.18);
  overflow: hidden;
}
/* 容器查询单位：宽度受 cqw 限制、高度受剩余舞台 cqh 限制，min 取较小值，比例恒不失真 */
.editor-paper.mini { aspect-ratio: 54 / 86;  width: min(90cqw, 84cqh * 54 / 86); }
.editor-paper.sq   { aspect-ratio: 72 / 86;  width: min(90cqw, 84cqh * 72 / 86); }
.editor-paper.wide { aspect-ratio: 108 / 86; width: min(92cqw, 84cqh * 108 / 86); }
.editor-image { position: absolute; overflow: hidden; background: #fff; }

.ecell-grid { position: absolute; inset: 0; display: grid; gap: 3px; background: #fff; }
.ecell-grid.g1 { grid-template-columns: 1fr;            grid-template-rows: 1fr; }
.ecell-grid.g4 { grid-template-columns: 1fr 1fr;        grid-template-rows: 1fr 1fr; }
.ecell-grid.g9 { grid-template-columns: 1fr 1fr 1fr;    grid-template-rows: 1fr 1fr 1fr; }
.ecell { position: relative; overflow: hidden; background: #111; touch-action: none; }
.ecell canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ecell-empty {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--label-3); cursor: pointer;
}
.ecell-empty svg { width: 34px; height: 34px; }

.editor-hint {
  margin: 0; padding: 8px 4px 0; text-align: center;
  font-size: 13px; color: var(--label-2); line-height: 1.4;
}

/* 滤镜胶囊条 */
.filter-bar {
  flex: none; display: flex; gap: 10px; overflow-x: auto;
  padding: 12px 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.filter-bar::-webkit-scrollbar { display: none; }
.fpill {
  flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px;
  border: 0; background: none; padding: 0; cursor: pointer;
}
.fpill-thumb {
  width: 54px; height: 54px; border-radius: 10px; overflow: hidden;
  background: #d9d9de; box-shadow: 0 0 0 2px transparent;
  transition: box-shadow .15s var(--ease), transform .12s var(--ease);
}
.fpill-thumb canvas { width: 100%; height: 100%; display: block; }
.fpill:active .fpill-thumb { transform: scale(.95); }
.fpill.sel .fpill-thumb { box-shadow: 0 0 0 2.5px var(--accent); }
.fpill-name { font-size: 12px; font-weight: 600; color: var(--label-2); }
.fpill.sel .fpill-name { color: var(--accent); }

/* —— 占位屏（下轮实现） —— */
.placeholder { background: var(--bg); }
.ph-body {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; gap: 10px; padding: 0 32px;
}
.ph-icon { font-size: 56px; margin-bottom: 6px; filter: saturate(.9); }
.ph-body h2 { margin: 0; font-size: 22px; font-weight: 700; }
.ph-body p { margin: 0; font-size: 15px; color: var(--label-2); line-height: 1.6; }
.ph-meta { margin-top: 14px; font-size: 12.5px; color: var(--label-3);
  font-family: ui-monospace, "SF Mono", monospace; letter-spacing: .02em; }

/* —— ④ 显影屏 —— */
.develop { position: relative; background: #0a0a0c; overflow: hidden; }
.dev-bg {
  position: absolute; inset: -8%; width: 116%; height: 116%;
  object-fit: cover; filter: blur(34px) brightness(.6) saturate(.9);
  transform: scale(1.12); pointer-events: none;
}
.dev-layer {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  container-type: size;   /* 出片尺寸同样以舞台为基准，避免溢出 */
}
.dev-paper {
  position: relative; background: #fff; border-radius: 8px;
  box-shadow: 0 30px 70px -22px rgba(0,0,0,.65), 0 8px 22px rgba(0,0,0,.35);
  overflow: hidden;
  /* 初始在最下方（顶端贴底），由 JS 用 transform: translateY 匀速上滑入场 */
  transform: translateY(105%);
  will-change: transform;
}
.dev-paper.mini { aspect-ratio: 54 / 86;  width: min(90cqw, 84cqh * 54 / 86); }
.dev-paper.sq   { aspect-ratio: 72 / 86;  width: min(90cqw, 84cqh * 72 / 86); }
.dev-paper.wide { aspect-ratio: 108 / 86; width: min(92cqw, 84cqh * 108 / 86); }
.dev-image { position: absolute; overflow: hidden; background: #111; }

.dev-skip {
  position: absolute; top: 54px; right: 18px;
  font-size: 13px; color: rgba(245,243,238,.66);
  letter-spacing: .04em; background: rgba(0,0,0,.2);
  border: 0; padding: 7px 15px; border-radius: 20px; cursor: pointer;
  -webkit-tap-highlight-color: transparent; backdrop-filter: blur(6px);
}
.dev-skip:active { opacity: .6; }

/* —— ⑤ 成片屏 —— */
.result { background: var(--bg); }
.result-stage {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  padding: 18px; min-height: 0;
}
.result-canvas {
  max-width: 86%; max-height: 60vh;
  border-radius: 0; background: transparent;
  touch-action: none;          /* 长按不触发滚动/选中 */
  -webkit-touch-callout: none;
}
.result-hint {
  margin: 0; font-size: 13px; color: var(--label-2);
  font-weight: 500; letter-spacing: .02em;
}
