/* 跨畫面共用的元件。跑者手機（index.html）、工作人員平板（tablet/）、手機保存頁（Worker 輸出的 /s/:id）都載這支。
   骨架期：黑底白字＋紅色按鈕的簡版；色碼、字型、斜切角度都是目測暫代（設計原始檔未取得，docs/assets-index.md §4）。
   座標一律用設計單位 360×640（畫板 1406×2500 ÷ 3.9）。 */

:root {
  --c-bg: #000;
  --c-fg: #fff;
  --c-red: #e4002b;
  --c-red-dark: #b3001f;
  --c-grey: #8d8d8d;
  --c-grey-dark: #3a3a3a;
  --c-muted: #bdbdbd;
  --skew: -8deg;
  --font: "Helvetica Neue", Arial, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

/* 作者樣式的 display 會蓋掉瀏覽器對 [hidden] 的 display:none（.btn、.stack 都是 flex），一律強制 */
[hidden] { display: none !important; }

#app { background: #111; }
#stage { background: var(--c-bg); color: var(--c-fg); font-family: var(--font); }

/* ───── 佔位（素材到位前的色塊） ───── */
.ph {
  position: relative;
  display: grid;
  place-items: center;
  border: 1.5px dashed rgba(255, 255, 255, .35);
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.04) 0 8px, rgba(255,255,255,.09) 8px 16px);
  color: rgba(255, 255, 255, .6);
  font-size: 10px;
  line-height: 1.3;
  text-align: center;
}
.ph::before { content: attr(data-label); padding: 3px 6px; }
.ph--full { position: absolute; inset: 0; z-index: 0; border: 0; }
.ph--full::before { position: absolute; left: 6px; bottom: 4px; }

/* ───── 品牌抬頭／底部 lockup（設計稿每個畫面都有） ───── */
.brand-head {
  position: absolute;
  left: 0; right: 0; top: 0;
  z-index: 2;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  pointer-events: none;
}
.brand-head__en { font-family: Georgia, "Times New Roman", serif; font-size: 20px; letter-spacing: .28em; }
.brand-head__zh { font-size: 17px; letter-spacing: .9em; padding-left: .9em; font-weight: 500; }
.brand-head--dim { opacity: .35; }

.brand-foot {
  position: absolute;
  left: 20px; right: 20px; bottom: 14px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, .45);
  pointer-events: none;
}
.ph--lockup { width: 70px; height: 22px; }
.ph--logo { width: 30px; height: 22px; }

/* 右上角「現場地圖」按鈕（便利貼：現場地圖可來回滑） */
.btn-map {
  position: absolute;
  right: 12px; top: 66px;
  z-index: 3;
  width: 34px; height: 34px;
  border: 1.5px solid #fff;
  border-radius: 8px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 9px;
  line-height: 1;
  cursor: pointer;
  display: grid; place-items: center;
}

/* ───── 標題（設計稿：斜線裝飾 + 斜體粗字） ───── */
.h-slash {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: .2em;
  text-align: center;
}
.h-slash::before { content: '/// '; color: #fff; font-style: normal; letter-spacing: 0; }
.h-sub { margin: 4px 0 0; font-size: 11px; letter-spacing: .08em; text-align: center; color: var(--c-muted); }

/* ───── 按鈕：斜切平行四邊形 ───── */
.btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 280px;
  min-height: 42px;
  margin: 0;
  padding: 6px 16px;
  border: 0;
  background: var(--c-red);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .18em;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transform: skewX(var(--skew));
  -webkit-tap-highlight-color: transparent;
}
.btn > * { transform: skewX(calc(-1 * var(--skew))); }
.btn > small { font-size: 10px; font-weight: 500; letter-spacing: .1em; margin-bottom: 2px; }
.btn:active { filter: brightness(.9); }
.btn:disabled { cursor: default; }
.btn--red { background: var(--c-red); }
.btn--white { background: #fff; color: #000; }
.btn--grey, .btn:disabled.btn--grey { background: var(--c-grey); color: #fff; }
.btn--sm { width: 200px; min-height: 36px; font-size: 13px; }
/* 「*由現場工作人員點擊」兩行式按鈕 */
.btn--staff { min-height: 52px; }
/* 文字連結（返回診斷報告 等） */
.link-back {
  margin: 0;
  padding: 2px 4px;
  border: 0;
  border-bottom: 1px solid #fff;
  background: none;
  color: #fff;
  font: inherit;
  font-size: 12px;
  letter-spacing: .18em;
  cursor: pointer;
}
.link-back::after { content: ' ↺'; }

/* ───── 一行式提示（使用者決定：錯誤提示加在現有畫面上，不另開畫面） ───── */
.hint {
  margin: 0;
  min-height: 16px;
  font-size: 11px;
  line-height: 1.45;
  color: #ffb3b3;
  text-align: center;
}
.hint:empty { display: none; }

/* toast（複製成功等） */
.toast {
  position: absolute;
  left: 50%; top: 300px;
  z-index: 20;
  translate: -50% 0;
  margin: 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: #000;
  font-size: 12px;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}
.toast.is-on { opacity: 1; }

/* 箭頭進度條（畫面 05、14；便利貼「箭頭顏色，製作中的要動起來」） */
.arrow-bar { display: flex; gap: 4px; justify-content: center; }
.arrow-bar span {
  width: 22px; height: 12px;
  background: var(--c-grey-dark);
  clip-path: polygon(0 0, 70% 0, 100% 50%, 70% 100%, 0 100%, 30% 50%);
  animation: arrow-on 1.2s linear infinite;
}
.arrow-bar span:nth-child(2) { animation-delay: .15s; }
.arrow-bar span:nth-child(3) { animation-delay: .3s; }
.arrow-bar span:nth-child(4) { animation-delay: .45s; }
.arrow-bar span:nth-child(5) { animation-delay: .6s; }
.arrow-bar span:nth-child(6) { animation-delay: .75s; }
@keyframes arrow-on { 0%, 30% { background: var(--c-red); } 31%, 100% { background: var(--c-grey-dark); } }
@media (prefers-reduced-motion: reduce) { .arrow-bar span { animation: none; background: var(--c-red); } }

/* 只給螢幕閱讀器的文字 */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
