/* 图像编辑PS 页（测试版）：上面是网站导航（样式来自 /assets/css/site-nav.css），下面是全屏的 PhotoCraft；
   要输测试码才能进的阶段，编辑器的位置上先显示「门口」（.ps-gate）。 */
html, body { height: 100%; margin: 0; }
body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #262626; /* 和 PhotoCraft 自己的底色一致，载入时不闪白 */
  color: #e7ecf5;
  font-family: "Ziheng UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}
.site-nav { flex: 0 0 auto; }

.ps-stage { position: relative; flex: 1 1 auto; min-height: 0; }
.ps-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #262626; }
/* 载入层：不透明（和 iframe 一样的底色 #262626），盖在 iframe 上面（门口 .ps-gate 是 z-index 5，在它上面）。
   原来它是透明的，iframe 里编辑器自己的英文载入文字（「Loading PhotoCraft…」，20 秒后还有「This is taking longer than usual…」）会透出来；
   不透明以后这些都被盖住，编辑器起来、字体清单读完（host.js 隐藏它）之前，也看不到画面里还没有字体时的方框。 */
.ps-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  text-align: center;
  color: #b8b8b8;
  font-size: 14px;
  line-height: 1.6;
  background: #262626;
}
.ps-loading[hidden] { display: none; }
.ps-loading__box { width: min(460px, 100%); }
.ps-loading__text, .ps-loading__hint, .ps-loading__slow { margin: 0; }
.ps-loading__slow { margin-top: 14px; color: #8f8f8f; }
.ps-loading__slow[hidden] { display: none; }
.ps-loading__slow a { color: #cfd6e4; text-decoration: underline; }
/* 进度条（第 9 版第六轮）：放行以后 host.js 自己下载编辑器的大文件，按 Content-Length 算百分比；
   data-mode：download 有进度｜start 下完了、正在启动（满格，轻微闪动）｜indeterminate 拿不到总大小或预下载出错（来回滑动的不定进度）｜wait 还在确认权限（不显示条） */
.ps-loading__bar {
  position: relative;
  box-sizing: border-box;
  width: min(320px, 100%);
  height: 6px;
  margin: 14px auto 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .13);
}
.ps-loading__bar[hidden] { display: none; }
.ps-loading__fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #3b82f6;
  transition: width .25s ease-out;
}
.ps-loading[data-mode="start"] .ps-loading__fill { width: 100%; animation: ps-loading-pulse 1.3s ease-in-out infinite; }
.ps-loading[data-mode="indeterminate"] .ps-loading__fill { width: 38%; transition: none; animation: ps-loading-slide 1.4s ease-in-out infinite; }
@keyframes ps-loading-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes ps-loading-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(263%); } }
.ps-loading__hint { margin-top: 12px; font-size: 12px; line-height: 1.6; color: #8f8f8f; }
.ps-loading__hint[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) {
  .ps-loading[data-mode="start"] .ps-loading__fill, .ps-loading[data-mode="indeterminate"] .ps-loading__fill { animation: none; }
  .ps-loading[data-mode="indeterminate"] .ps-loading__fill { width: 100%; opacity: .5; }
}

/* 测试码入口（门口）：盖在编辑器的位置上；顶部网站导航照常显示，用户可以直接点别的栏目离开 */
.ps-gate {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  padding: 24px 16px 56px; /* 底部留出右下角角标的位置 */
  overflow: auto;
  background: #262626;
}
.ps-gate[hidden] { display: none; }
.ps-gate__card {
  box-sizing: border-box;
  width: min(400px, 100%);
  margin: auto; /* 空间够就居中；空间不够（手机弹出键盘）就从顶部开始，可以滚动 */
  padding: 30px 28px 26px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 16px;
  background: #1d222d;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
  text-align: center;
}
.ps-gate__title { margin: 0 0 20px; font-size: 21px; line-height: 1.4; font-weight: 700; color: #f3f6fc; }
.ps-gate__label { display: block; margin: 0 0 10px; font-size: 14px; color: #b9c3d6; }
.ps-gate__input {
  box-sizing: border-box;
  width: 100%;
  height: 48px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 10px;
  background: #0f131c;
  color: #fff;
  font: 600 22px/1 ui-monospace, Consolas, "Courier New", monospace; /* 字号不小于 16px，iOS 不会自动放大页面 */
  letter-spacing: .3em;
  text-align: center;
}
.ps-gate__input:focus { outline: none; border-color: #6aa3ff; box-shadow: 0 0 0 3px rgba(106, 163, 255, .28); }
.ps-gate__input:disabled { opacity: .6; }
.ps-gate__msg { min-height: 1.6em; margin: 10px 0 14px; font-size: 14px; line-height: 1.6; color: #ff9b9b; overflow-wrap: anywhere; }
.ps-gate__btn {
  box-sizing: border-box;
  width: 100%;
  height: 46px;
  margin: 0;
  border: 0;
  border-radius: 10px;
  background: #3b82f6;
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 650;
  cursor: pointer;
}
.ps-gate__btn:hover:not(:disabled), .ps-gate__btn:focus-visible { background: #5595ff; outline: none; }
.ps-gate__btn:disabled { opacity: .55; cursor: default; }

/* 使用提示（放行以后每次打开都弹）：盖在编辑器的位置上，样式跟门口一致（暗色卡片），比门口的卡片宽一点，因为要放三条说明；
   z-index 6（载入层 2、门口 5）。卡片下面的载入层是 host.js 在后台下载编辑器的进度，点「我知道了」之前看不到 */
.ps-notice {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  padding: 24px 16px 56px; /* 底部留出右下角角标的位置 */
  overflow: auto;
  background: #262626;
}
.ps-notice[hidden] { display: none; }
.ps-notice__card {
  box-sizing: border-box;
  width: min(480px, 100%);
  margin: auto; /* 空间够就居中；窗口矮的时候从顶部开始，可以滚动 */
  padding: 28px 28px 26px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 16px;
  background: #1d222d;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}
.ps-notice__title { margin: 0 0 18px; font-size: 21px; line-height: 1.4; font-weight: 700; color: #f3f6fc; text-align: center; }
.ps-notice__list { margin: 0 0 24px; padding: 0; list-style: none; counter-reset: ps-notice; }
.ps-notice__list li {
  position: relative;
  margin: 0 0 14px;
  padding-left: 30px;
  font-size: 15px;
  line-height: 1.75;
  color: #cfd6e4;
  overflow-wrap: anywhere;
  text-wrap: pretty; /* 最后一行不要只剩一两个字（Chrome 117 起认，别的浏览器忽略） */
  counter-increment: ps-notice;
}
.ps-notice__list li:last-child { margin-bottom: 0; }
.ps-notice__list li::before {
  content: counter(ps-notice);
  position: absolute;
  left: 0;
  top: .3em;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(106, 163, 255, .22);
  color: #9cc2ff;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.ps-notice__list strong { color: #f3f6fc; font-weight: 650; }
.ps-notice__btn {
  box-sizing: border-box;
  width: 100%;
  height: 46px;
  margin: 0;
  border: 0;
  border-radius: 10px;
  background: #3b82f6;
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 650;
  cursor: pointer;
}
.ps-notice__btn:hover, .ps-notice__btn:focus-visible { background: #5595ff; outline: none; }
.ps-notice__btn:focus-visible { box-shadow: 0 0 0 3px rgba(106, 163, 255, .35); }

/* 自动分层面板（图层 › 自动分层…）：盖在编辑器的位置上，样式跟使用提示卡一致（暗色卡片、同样的按钮）；z-index 6，和提示卡一样盖过载入层（2）和门口（5）。
   面板开着的时候 host.js 给 iframe 设了 inert，编辑器点不动、键盘也进不去。卡片里中间一块（选项）可以滚动，标题和下面的按钮始终在窗口里 */
.ps-split {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 16px 16px 44px; /* 底部留出右下角角标的位置 */
  overflow: hidden;
  background: rgba(20, 22, 28, .78);
}
.ps-split[hidden] { display: none; }
.ps-split__card {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: min(540px, 100%);
  max-height: 100%;
  padding: 22px 26px 20px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 16px;
  background: #1d222d;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}
.ps-split__title { flex: 0 0 auto; margin: 0 0 8px; font-size: 21px; line-height: 1.4; font-weight: 700; color: #f3f6fc; text-align: center; }
.ps-split__body { flex: 1 1 auto; min-height: 0; margin: 0 -8px; padding: 0 8px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .25) transparent; }
.ps-split__lead { margin: 0 0 6px; font-size: 13.5px; line-height: 1.65; color: #b9c3d6; text-wrap: pretty; }
.ps-split__doc { margin: 0 0 10px; font-size: 12.5px; line-height: 1.6; color: #8f9bb0; }
.ps-split__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 0 6px; }
.ps-split__choice, .ps-split__check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 10px;
  background: rgba(255, 255, 255, .03);
  cursor: pointer;
}
.ps-split__choice:hover, .ps-split__check:hover { background: rgba(255, 255, 255, .06); }
.ps-split__choice input, .ps-split__check input { flex: 0 0 auto; width: 16px; height: 16px; margin: 2px 0 0; accent-color: #3b82f6; }
.ps-split__choice b, .ps-split__check b { display: block; font-size: 14px; font-weight: 650; color: #e7ecf5; }
.ps-split__choice small, .ps-split__check small { display: block; margin-top: 1px; font-size: 12px; line-height: 1.5; color: #8f9bb0; }
.ps-split__choice[aria-disabled="true"], .ps-split__check[aria-disabled="true"] { opacity: .5; cursor: default; }
.ps-split__check[hidden] { display: none; }
.ps-split__inline { margin: 0 0 8px; font-size: 12.5px; line-height: 1.9; color: #b9c3d6; }
.ps-split__inline[hidden] { display: none; }
.ps-split__inline label { display: block; cursor: pointer; }
.ps-split__inline input { width: 14px; height: 14px; margin: 0 4px 0 0; vertical-align: -2px; accent-color: #3b82f6; }
.ps-split__label { display: block; font-size: 12.5px; color: #8f9bb0; }
.ps-split__note { margin: 0 0 8px; padding: 7px 11px; border-radius: 8px; background: rgba(255, 196, 87, .1); font-size: 12.5px; line-height: 1.6; color: #ffd27a; }
.ps-split__note[hidden] { display: none; }
.ps-split__cost { margin: 2px 0 8px; padding: 8px 14px; border: 1px solid rgba(106, 163, 255, .28); border-radius: 10px; background: rgba(106, 163, 255, .08); }
.ps-split__cost-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; line-height: 1.75; color: #cfd6e4; }
.ps-split__cost-row strong { font-weight: 700; color: #f3f6fc; }
.ps-split__cost-row[hidden] { display: none; }
.ps-split__cost-note { margin: 3px 0 0; font-size: 12px; line-height: 1.55; color: #8f9bb0; }
.ps-split__cost-note:empty { display: none; }
.ps-split__msg { margin: 0 0 8px; font-size: 13.5px; line-height: 1.6; color: #ff9b9b; overflow-wrap: anywhere; }
.ps-split__msg[hidden] { display: none; }
.ps-split__msg.is-info { color: #cfd6e4; }
.ps-split__links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 8px; font-size: 14px; }
.ps-split__links[hidden] { display: none; }
.ps-split__links a { color: #9cc2ff; text-decoration: underline; }
.ps-split__links button { padding: 0; border: 0; background: none; color: #cfd6e4; font: inherit; text-decoration: underline; cursor: pointer; }
.ps-split__bar { position: relative; height: 6px; margin: 18px 0 14px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, .13); }
.ps-split__bar i { position: absolute; top: 0; left: 0; width: 38%; height: 100%; border-radius: inherit; background: #3b82f6; animation: ps-loading-slide 1.4s ease-in-out infinite; }
.ps-split__run-text { margin: 0 0 6px; font-size: 15px; line-height: 1.6; color: #e7ecf5; text-align: center; }
.ps-split__run-note { margin: 0 0 12px; font-size: 12.5px; line-height: 1.65; color: #8f9bb0; text-align: center; }
.ps-split__run-note:empty { display: none; }
.ps-split__actions { flex: 0 0 auto; display: flex; gap: 10px; margin-top: 12px; }
.ps-split__btn {
  box-sizing: border-box;
  flex: 1 1 auto;
  height: 44px;
  margin: 0;
  border: 0;
  border-radius: 10px;
  background: #3b82f6;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
}
.ps-split__btn[hidden] { display: none; }
.ps-split__btn--ghost { flex: 0 0 30%; border: 1px solid rgba(255, 255, 255, .2); background: transparent; color: #cfd6e4; }
.ps-split__btn:hover:not(:disabled), .ps-split__btn:focus-visible { background: #5595ff; outline: none; }
.ps-split__btn--ghost:hover:not(:disabled), .ps-split__btn--ghost:focus-visible { background: rgba(255, 255, 255, .08); }
.ps-split__btn:focus-visible { box-shadow: 0 0 0 3px rgba(106, 163, 255, .35); }
.ps-split__btn:disabled { opacity: .5; cursor: default; }
@media (prefers-reduced-motion: reduce) { .ps-split__bar i { animation: none; width: 100%; opacity: .5; } }

/* 角上的标记 */
.ps-corner {
  position: fixed;
  right: 12px;
  bottom: 6px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 1;
}
.ps-badge {
  padding: 5px 10px;
  border: 1px solid rgba(255, 196, 87, .55);
  border-radius: 999px;
  background: rgba(60, 44, 12, .88);
  color: #ffd27a;
  font-weight: 650;
  letter-spacing: .02em;
  white-space: nowrap;
  user-select: none;
}

/* 提示 */
.ps-toast {
  position: fixed;
  left: 50%;
  bottom: 42px;
  z-index: 40;
  max-width: min(92vw, 560px);
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(15, 20, 30, .95);
  color: #eef2fa;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}
.ps-toast[hidden] { display: none; }
.ps-toast.is-error { background: rgba(92, 24, 24, .96); color: #ffe3e3; }

@media (max-width: 640px) {
  .ps-corner { right: 8px; bottom: 4px; gap: 6px; }
  .ps-badge { padding: 4px 8px; }
  .ps-gate { padding: 16px 12px 48px; }
  .ps-gate__card { padding: 24px 18px 20px; }
  .ps-gate__title { font-size: 19px; }
  .ps-notice { padding: 16px 12px 48px; }
  .ps-notice__card { padding: 22px 18px 18px; }
  .ps-notice__title { margin-bottom: 14px; font-size: 19px; }
  .ps-notice__list { margin-bottom: 20px; }
  .ps-notice__list li { margin-bottom: 12px; padding-left: 28px; font-size: 14px; line-height: 1.7; }
  .ps-split { padding: 12px 10px 40px; }
  .ps-split__card { padding: 16px 14px 14px; }
  .ps-split__title { font-size: 19px; }
  .ps-split__grid { grid-template-columns: 1fr; }
}
