:root {
  --main-blue: #c7faff;
  --main-orange: #ff623c;
  --black: #2a2a2a;
  --white: #ffffff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #dedede;
  font-family: "Noto Serif TC", serif;
  color: var(--black);
  -webkit-tap-highlight-color: transparent;
}

#app {
  width: 390px;
  min-height: 844px;
  margin: 0 auto;
  position: relative;
  background: var(--main-blue);
  overflow-x: hidden;
  box-shadow: 0 0 24px rgba(0,0,0,0.15);
}

@media (max-width: 430px) {
  #app { width: 100vw; box-shadow: none; }
}

.page {
  min-height: 844px;
  width: 100%;
  position: relative;
  background: var(--main-blue);
  padding-bottom: 40px;
  display: flow-root;
}

.eng-title {
  font-family: "Cormorant Infant", serif;
  font-weight: 600;
  font-size: 22px;
  padding: 24px 24px 0;
  margin: 0;
}

.top-bar {
  position: absolute;
  top: 48px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0 24px;
}

.top-bar .cn-title {
  font-family: "Noto Serif TC", serif;
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 1.8px;
}

/* ---------- P1 ---------- */
.p1-logo {
  position: absolute;
  top: 213px;
  left: 16px;
  width: 358px;
  height: 227.302px;
  aspect-ratio: 358 / 227.302;
  display: block;
}

.p1-copy {
  padding: 0 51px;
  margin-top: 481px;
}
.p1-copy p { margin: 0; line-height: 28px; letter-spacing: 2px; }
.p1-copy .small { font-size: 15px; }
.p1-copy .big { font-size: 20px; font-weight: 500; }

.p1-input-wrap { padding: 0 52px; margin-top: 24px; }
.p1-input {
  width: 100%;
  height: 40px;
  background: var(--main-blue);
  border: 2px solid var(--main-orange);
  border-radius: 0;
  padding: 0 12px;
  font-family: "Noto Serif TC", serif;
  font-size: 14px;
  color: var(--black);
  outline: none;
}
.p1-input::placeholder { color: rgba(0,0,0,0.5); }

/* ---------- Bottom nav arrow / buttons ---------- */
.btn-arrow-next {
  position: absolute;
  right: 32px;
  bottom: 40px;
  width: 56px;
  height: 56px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}
.btn-arrow-next img { width: 100%; height: 100%; }

.btn-text-arrow {
  position: absolute;
  right: 32px;
  bottom: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  background: none;
  border: none;
  font-family: "Noto Serif TC", serif;
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 1.8px;
  color: var(--black);
}
.btn-text-arrow img { width: 32px; height: 32px; }

.btn-text-arrow-left {
  position: absolute;
  left: 32px;
  bottom: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  background: none;
  border: none;
  font-family: "Noto Serif TC", serif;
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 1.8px;
  color: var(--black);
}
.btn-text-arrow-left img { width: 32px; height: 32px; }

/* ---------- P2 onboarding ---------- */
.p2-copy {
  padding: 216px 64px 0;
  font-size: 18px;
  line-height: 34px;
  letter-spacing: 1.8px;
}

/* ---------- P3 collection pages ---------- */
.p3-header {
  padding: 56px 32px 0;
}
.p3-header .stamp { font-family: "Cormorant Infant", serif; font-weight: 600; font-size: 24px; margin: 0; }
.p3-header .cat-title { font-size: 20px; letter-spacing: 2px; margin: 12px 0 0; font-weight: 500; }
.p3-header .hint { font-size: 15px; letter-spacing: 1.5px; margin: 8px 0 0; }

.p3-tabs {
  position: relative;
  display: flex;
  margin-top: 21px;
  height: 47px;
  border-top: 1px solid var(--main-orange);
}
.p3-tabs .tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  font-size: 15px;
  letter-spacing: 1.5px;
  font-weight: 500;
  background: var(--main-blue);
  border-right: 1px solid var(--main-orange);
}
.p3-tabs .tab:last-child { border-right: none; }
.p3-tabs .tab .dot {
  width: 5px; height: 5px; background: var(--black); border-radius: 1px;
  flex: none;
}
.p3-tabs .tab.active {
  background-image: url('assets/icons/btn_b.svg');
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.p3-list { border-top: 1px solid var(--main-orange); }
.p3-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  min-height: 128px;
  padding: 37px 90px 32px 58px;
  border-bottom: 1px solid var(--main-orange);
}
.p3-item .dot {
  position: absolute;
  left: 32px;
  top: 43px;
  width: 16px; height: 16px;
  background: var(--main-orange);
}
.p3-item .txt { padding-top: 0; max-width: 220px; }
.p3-item .txt .work-title { font-family: "Noto Serif TC", serif; font-size: 19px; font-weight: 600; margin: 0; letter-spacing: 0.95px; line-height: 26px; }
.p3-item .txt .work-author { font-size: 16px; font-weight: 500; margin: 4px 0 0; letter-spacing: 1.6px; line-height: 26px; }
.p3-item .stamp-btn {
  position: absolute;
  right: 32px;
  top: 32px;
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 1px solid var(--black);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.p3-item .stamp-btn img { width: 50px; height: 50px; display: none; }
.p3-item .stamp-btn.checked img { display: block; }

.p3-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  font-size: 20px;
  letter-spacing: 2px;
  font-weight: 500;
}
.p3-progress .dot-sq { width: 8px; height: 8px; background: var(--black); }

.p3-footer-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 43px;
  margin-top: 40px;
}
.p3-footer-nav .spacer { flex: 1; }

.btn-orange-wide {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 304px;
  height: 72px;
  margin: 32px auto 0;
  background: var(--main-orange);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: "Noto Serif TC", serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 2px;
}
.btn-orange-wide img { width: 48px; height: 48px; filter: brightness(0) invert(1); }

/* ---------- P4 loading ---------- */
.p4-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 844px;
}
.loading-ring {
  display: block;
  width: 162px;
  height: 159px;
  transform-origin: 50% 50%;
  animation: spin-ring 1s linear infinite;
}
@keyframes spin-ring { from { transform: rotate(0deg); } to { transform: rotate(1080deg); } }
.p4-text {
  margin-top: 40px;
  text-align: center;
  font-size: 18px;
  letter-spacing: 1.8px;
  line-height: 30px;
  font-weight: 500;
}

/* ---------- P5 step pages ---------- */
.p5-copy {
  padding: 216px 64px 0;
  font-size: 18px;
  line-height: 34px;
  letter-spacing: 1.8px;
  white-space: pre-line;
}

/* ---------- P6 result page ---------- */
.p6-page { position: relative; min-height: 1803px; padding-bottom: 0; }
.p6-white-bg {
  position: absolute;
  left: 0;
  top: 868px;
  width: 100%;
  height: 676px;
  background: #fff;
  border-top: 1px solid var(--main-orange);
  border-bottom: 1px solid var(--main-orange);
}
.p6-username {
  position: absolute;
  left: 32px;
  top: 56px;
  font-size: 20px;
  letter-spacing: 2px;
  font-weight: 500;
  margin: 0;
}
.p6-badge-img {
  position: absolute;
  left: 39px;
  top: 115px;
  width: 288px;
  height: 288px;
  object-fit: contain;
}
.p6-badge-row {
  position: absolute;
  left: 32px;
  top: 401px;
  width: 326px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}
.p6-badge-row .left { display: flex; flex-direction: column; }
.p6-badge-row .label { font-size: 15px; line-height: 24px; letter-spacing: 1.5px; margin: 0; }
.p6-badge-row .object { font-size: 30px; font-weight: 600; letter-spacing: 3px; margin: 5px 0 0 -21px; }
.p6-badge-row .badge-cn {
  font-size: 56px;
  font-weight: 500;
  line-height: 60px;
  letter-spacing: 5.6px;
  margin: 0;
  width: 56px;
  text-align: center;
  word-break: break-all;
}
.p6-slogan {
  position: absolute;
  left: 32px;
  top: 608px;
  width: 326px;
  font-size: 24px;
  letter-spacing: 2.4px;
  line-height: 34px;
  font-weight: 500;
  margin: 0;
}
.p6-desc {
  position: absolute;
  left: 32px;
  top: 700px;
  width: 326px;
  font-size: 16px;
  letter-spacing: 1.6px;
  line-height: 30px;
  margin: 0;
}
.p6-percentage-num {
  position: absolute;
  left: 32px;
  top: 924px;
  height: 40px;
  font-family: "Cormorant Infant", serif;
  font-style: italic;
  font-size: 64px;
  letter-spacing: 6.4px;
  line-height: 1;
}
.p6-percentage-label {
  position: absolute;
  left: 32px;
  top: 980px;
  height: 34px;
  width: 311px;
  font-size: 15px;
  letter-spacing: 1.5px;
  line-height: 34px;
}
.p6-prescription {
  position: absolute;
  left: 32px;
  top: 1051px;
  width: 326px;
}
.p6-prescription .title-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin: 0 0 16px;
}
.p6-prescription .title-row .sq { width: 8px; height: 8px; background: var(--black); flex: none; }
.p6-prescription .title-row .title { font-size: 20px; line-height: 24px; letter-spacing: 2px; font-weight: 600; }
.p6-prescription .sub { font-size: 16px; letter-spacing: 1.6px; line-height: 24px; margin: 0 0 40px; }
.p6-prescription .list { font-size: 16px; letter-spacing: 1.6px; line-height: 34px; margin: 0 0 49px; }
.p6-prescription .list div::before { content: "-\00a0"; }
.p6-prescription .note { font-size: 16px; letter-spacing: 1.6px; line-height: 30px; margin: 0; }

.p6-actions {
  position: absolute;
  left: 0;
  top: 1609px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 40px;
}
.p6-actions .action {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  background: none;
  border: none;
  font-family: "Noto Serif TC", serif;
  font-size: 18px;
  letter-spacing: 1.8px;
  color: var(--black);
}
.p6-actions .action img { width: 32px; height: 32px; }

/* ---------- P7 print ---------- */
.p7-copy {
  padding: 0 32px;
  font-size: 16px;
  letter-spacing: 1.6px;
  line-height: 30px;
  margin-top: 24px;
}
.qr-box {
  width: 200px;
  height: 200px;
  border: 4px solid var(--main-orange);
  margin: 40px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 8px;
}
.qr-box canvas, .qr-box img { width: 100%; height: 100%; }
.qr-hint {
  text-align: center;
  font-size: 15px;
  letter-spacing: 1.5px;
  margin-top: 12px;
  line-height: 24px;
}

/* shared page title block used on several screens */
.page-title-block { padding: 56px 32px 0; }
.page-title-block .eng { font-family: "Cormorant Infant", serif; font-weight: 600; font-size: 24px; margin: 0; }
.page-title-block .cn { font-size: 20px; letter-spacing: 2px; margin: 4px 0 0; font-weight: 500; }

.hidden { display: none !important; }
