.ptest-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html:has(.ptest-stage) {
  overflow-x: clip;
}

body:has(.ptest-stage:not(.is-done)) {
  background: #f5f5f7;
}

body:has(.ptest-stage:not(.is-done)) .layout-wrapper,
body:has(.ptest-stage:not(.is-done)) .layout-container,
body:has(.ptest-stage:not(.is-done)) .layout-page,
body:has(.ptest-stage:not(.is-done)) .content-wrapper {
  background: transparent !important;
  position: relative;
  z-index: 1;
}

.ptest-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 84px);
  padding: 2rem 1.5rem 9.5rem;
  overflow: visible;
  color: #1d1d1f;
  background-color: #f5f5f7;
  background-image: url("/medias/home/hongkong.svg");
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: 100% auto;
}

.ptest-stage.is-done {
  display: none;
}

.ptest-stage-inner {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
}

.ptest-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 2.75rem;
}

.ptest-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #6e6e73;
  cursor: pointer;
}

.ptest-back.is-off {
  visibility: hidden;
}

.ptest-back svg {
  width: 22px;
  height: 22px;
}

.ptest-back:hover {
  color: #1d1d1f;
  background: rgba(255, 255, 255, 0.7);
}

.ptest-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 32px;
  margin: 0;
}

.ptest-progress i {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #d2d2d7;
  transition: width 0.45s cubic-bezier(0.16, 1, 0.3, 1), background 0.45s ease;
}

.ptest-progress i.is-done {
  background: #1d1d1f;
}

.ptest-progress i.is-now {
  width: 28px;
  background: #1d1d1f;
}

.ptest-count {
  margin-left: 4px;
  color: #6e6e73;
  font-size: 0.82rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  line-height: 1;
}

.ptest-step {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
  text-align: center;
  background: transparent;
}

.ptest-piece {
  will-change: transform, opacity;
}

.ptest-step:not(.is-on):not(.is-leave) .ptest-piece {
  opacity: 0;
}

.ptest-step.is-on .ptest-piece {
  animation: ptest-in 1.05s cubic-bezier(0.08, 0.85, 0.14, 1) backwards;
}

.ptest-step.is-leave .ptest-piece {
  animation: ptest-out 0.72s cubic-bezier(0.78, 0.02, 0.92, 0.28) forwards;
}

@keyframes ptest-in {
  from {
    opacity: 0;
    transform: translate(var(--from-x), var(--from-y));
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes ptest-out {
  from {
    opacity: 1;
    transform: none;
  }
  to {
    opacity: 0;
    transform: translate(var(--from-x), var(--from-y));
  }
}

.ptest-step[hidden] {
  display: none !important;
}

.ptest-step h2 {
  margin: 0 0 1.35rem;
  padding: 0;
  color: #1d1d1f;
  font-size: clamp(1.65rem, 3vw, 2.15rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.25;
}

.ptest-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.ptest-opt {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4.6rem;
  margin: 0;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.28);
  color: #1d1d1f;
  font-size: 1.02rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.01em;
  text-align: center;
  gap: 0.7rem;
  cursor: pointer;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 0 0 1px rgba(90, 98, 112, 0.08),
    0 10px 24px rgba(40, 48, 64, 0.05);
  transition:
    background 0.28s ease,
    border-color 0.28s ease,
    box-shadow 0.28s ease,
    transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.ptest-letter {
  flex: 0 0 auto;
  color: rgba(29, 29, 31, 0.62);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.ptest-opt:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  width: calc(50% - 0.375rem);
  margin-inline: auto;
}

.ptest-opt:hover {
  background: rgba(255, 255, 255, 0.46);
  border-color: rgba(255, 255, 255, 0.92);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 0 0 1px rgba(90, 98, 112, 0.06),
    0 14px 28px rgba(40, 48, 64, 0.08);
}

.ptest-opt:active {
  background: rgba(255, 255, 255, 0.58);
  transform: translateY(0) scale(0.985);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 0 0 1px rgba(90, 98, 112, 0.08),
    0 4px 12px rgba(40, 48, 64, 0.05);
}

.ptest-opt:focus {
  outline: none;
}

.ptest-opt:focus-visible {
  outline: 2px solid rgba(29, 29, 31, 0.45);
  outline-offset: 3px;
}

body:has(#ptest-result:not([hidden])) .layout-page {
  padding-top: 0 !important;
}

#ptest-result.ptest-result {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
  color: #6e6e73;
  font-family: Inter, "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  scroll-margin-top: 0;
}

.ptest-result[hidden] {
  display: none !important;
}

.ptest-result-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ptest-result-shade {
  display: none;
}

.ptest-result-copy {
  position: relative;
  z-index: 1;
  width: min(34rem, 46vw);
  margin-left: 6vw;
  padding: 1.7rem 1.55rem 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(18px) saturate(1.45);
  -webkit-backdrop-filter: blur(18px) saturate(1.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 0 0 1px rgba(90, 98, 112, 0.05),
    0 16px 40px rgba(40, 48, 64, 0.07);
}

.ptest-result h2 {
  margin: 0;
  color: #6e6e73;
  font-size: clamp(1.7rem, 3.2vw, 2.45rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.ptest-result-en {
  margin: 0.4rem 0 0;
  color: #6e6e73;
  font-size: 0.95rem;
}

.ptest-reason {
  max-width: 28rem;
  margin: 0.9rem 0 0;
  color: #6e6e73;
  font-size: 1.05rem;
  line-height: 1.65;
}

.ptest-meta {
  margin: 0.75rem 0 0;
  color: #6e6e73;
  font-size: 0.9rem;
}

.ptest-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.35rem;
}

.ptest-go,
.ptest-next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
}

.ptest-go {
  background: #fff;
  color: #1d1d1f;
  border: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.ptest-go:hover {
  background: #fff;
  color: #000;
}

.ptest-next {
  background: transparent;
  color: #6e6e73;
  border: 1px solid rgba(110, 110, 115, 0.35);
}

.ptest-next:hover {
  background: rgba(255, 255, 255, 0.45);
  color: #6e6e73;
}

@media (prefers-reduced-motion: reduce) {
  .ptest-step:not(.is-on):not(.is-leave) .ptest-piece,
  .ptest-step.is-on .ptest-piece,
  .ptest-step.is-leave .ptest-piece,
  .ptest-progress i {
    animation: none;
    transition: none;
    opacity: 1;
  }
}

@media (max-width: 767.98px) {
  .ptest-stage {
    min-height: calc(100vh - 72px);
    padding: 1.5rem 1rem 7.5rem;
  }

  .ptest-result-copy {
    width: min(34rem, calc(100% - 2rem));
    margin-left: 1rem;
    padding: 1.35rem 1.15rem 1.15rem;
  }
}
