/* QR code 網頁（ticket 14，見 page.js）：家長的手機上看。
   字型、注音、線條抖動和紙紋的規則在 /tablet/style.css，這裡蓋掉平板（展示機）專用的設定：
   網頁可以捲動、放大、長按存圖。 */

html,
body {
  height: auto;
  overflow: auto;
  background: var(--wall);
  touch-action: auto;
  overscroll-behavior: auto;
  -webkit-user-select: auto;
  user-select: auto;
}
html {
  /* 長按圖片可以存到相簿（平板上關掉了） */
  -webkit-touch-callout: default;
}
html.zooming,
html.zooming body {
  overflow: hidden;
}

body {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
}
/* 換行時兩行差不多長，不會剩一個字掉到下一行 */
p {
  text-wrap: balance;
}

.take-home {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px calc(40px + env(safe-area-inset-bottom));
  text-align: center;
}

/* 招牌：平板待機畫面「檔案管理部」那塊黑色招牌，從網頁上緣吊下來（美術 tv-count-sign 580×196，招牌在吊線下面 64 到 196） */
.sign {
  position: relative;
  width: min(72%, 320px);
  aspect-ratio: 580 / 196;
  margin: 0 auto;
}
.sign > .art {
  position: absolute;
  inset: 0;
}
.sign-text {
  position: absolute;
  left: 0;
  top: 32.7%;
  width: 100%;
  height: 67.3%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: min(7.6vw, 34px);
  letter-spacing: 0.04em;
}

.title {
  margin: 18px 0 14px;
  font-size: 22px;
  font-weight: 700;
}

/* 找檔案中、找到了、找不到：一次只出現一種 */
.loading,
.missing,
.found {
  display: none;
}
[data-state='loading'] .loading,
[data-state='missing'] .missing,
[data-state='ready'] .found {
  display: block;
}
.loading,
.missing-note {
  color: #7f6e6c;
}
.missing-title {
  margin: 32px 0 8px;
  font-size: 20px;
  font-weight: 700;
}

/* 個人檔案：平板畫好的 PNG，點一下放大看 */
.file {
  position: relative;
  /* 圖上已經有紙紋（平板畫的時候就蓋上了），放在網頁的紙紋上面，紙紋才不會蓋兩層 */
  z-index: 2;
  margin: 0;
}
.file-button {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: zoom-in;
}
.file-image {
  display: block;
  width: 100%;
  height: auto;
  box-shadow: 0 4px 14px rgba(27, 25, 24, 0.18);
}
.file-hint {
  margin-top: 8px;
  font-size: 14px;
  color: #7f6e6c;
}

/* 小星星：在檔案的角落輪流閃（跟平板待機畫面一樣一格一格地動） */
.sparkle {
  position: absolute;
  width: 44px;
  height: 44px;
  animation: twinkle 2.4s step-end infinite;
  pointer-events: none;
}
.sparkle-1 {
  left: -14px;
  top: -16px;
}
.sparkle-2 {
  right: -16px;
  top: 30%;
  animation-delay: -0.8s;
}
.sparkle-3 {
  left: -12px;
  bottom: 18%;
  animation-delay: -1.6s;
}

/* 存到相簿：沿用平板的黃色開始按鈕 */
.save {
  position: relative;
  display: block;
  width: min(80%, 320px);
  aspect-ratio: 560 / 190;
  margin: 20px auto 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}
.save > .art {
  position: absolute;
  inset: 0;
}
.save-text {
  position: relative;
  font-size: 24px;
  font-weight: 700;
}
.save:active {
  transform: scale(0.95);
}
.save-done {
  margin: 10px 0 0;
  font-weight: 700;
}
.save-help {
  margin: 10px 0 0;
  font-size: 14px;
  color: #7f6e6c;
}

.expiry {
  margin: 28px 0 0;
}
.contact {
  margin: 4px 0 0;
}
.number {
  margin: 28px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(127, 110, 108, 0.35);
  color: #7f6e6c;
}
.number-value {
  color: var(--ink);
  font-size: 20px;
  letter-spacing: 0.08em;
}

/* 放大看：蓋滿整個畫面，點一下放大、再點一下縮回整張，可以拖著看 */
.zoom {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: var(--wall);
}
.zoom[hidden] {
  display: none;
}
.zoom-scroller {
  position: absolute;
  inset: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  align-items: safe center;
  justify-content: safe center;
}
.zoom-image {
  display: block;
  flex: none;
  width: 100%;
  height: auto;
  cursor: zoom-in;
}
.zoom.zoomed .zoom-image {
  cursor: zoom-out;
}
.zoom-close {
  position: absolute;
  right: 12px;
  top: calc(12px + env(safe-area-inset-top));
  padding: 8px 18px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
}

/* 紙紋蓋在整個網頁上（捲動時不跟著動），個人檔案的圖除外（見 .file） */
.paper {
  position: fixed;
  z-index: 1;
}
