/* jxhl.html 页面样式 */

:root {
  --ui-text: rgba(255, 255, 255, 0.96);
  --ui-text-weak: rgba(255, 255, 255, 0.82);
  --ui-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
  min-width: 1200px;
  overflow-x: hidden;
  background: #fff;
}

.screen {
  position: relative;
  width: 100%;
  min-width: 1200px;
  overflow: hidden;
}

.screen__bg {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.ui-layer,
.walker-layer {
  position: absolute;
  inset: 0;
}

.walker-layer {
  pointer-events: none;
  z-index: 7;
}

.ui-logo {
  position: absolute;
  left: 2.2%;
  top: 2.4%;
  width: 22.55%;
  height: auto;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.28));
}

.ui-counter {
  position: absolute;
  right: 2.8%;
  top: 5.3%;
  left: auto;
  bottom: auto;
  transform: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: clamp(12px, 0.9vw, 16px);
  font-weight: 600;
  letter-spacing: 0.2px;
  color: rgba(0, 0, 0, 0.72);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.22);
  user-select: none;
  pointer-events: none;
  z-index: 9;
}

.ui-counter__num {
  font-variant-numeric: tabular-nums;
  color: #c6322d;
}

.action-button {
  position: absolute;
  border: 0;
  padding: 0;
  background: url("../images/jxhl_action_btn.png") center / 100% 100% no-repeat;
  cursor: pointer;
  appearance: none;
  outline: none;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.32);
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.18));
  z-index: 8;
}

.action-button__label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(12px, 0.85vw, 16px);
  font-weight: 700;
  letter-spacing: 0.4px;
}

.action-button.is-busy {
  cursor: wait;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.18)) saturate(0.86);
}

.share-tip {
  --share-tip-scale: 0.5;
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(32vw, 420px);
  min-width: 260px;
  padding: 16px 18px 14px;
  background: #ececec;
  border: 2px solid rgba(128, 128, 128, 0.82);
  box-shadow: 0 18px 28px rgba(0, 0, 0, 0.28);
  color: #868686;
  z-index: 12;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, calc(-100% - 16px)) scale(var(--share-tip-scale));
  transform-origin: 50% 100%;
  transition: opacity 160ms ease;
}

.share-tip.is-visible {
  opacity: 1;
  visibility: visible;
}

.share-tip__title {
  margin: 0 0 12px;
  text-align: center;
  font-size: clamp(18px, 1.8vw, 28px);
  font-weight: 600;
  letter-spacing: 2px;
}

.share-tip__qr {
  display: block;
  width: min(20vw, 240px);
  min-width: 160px;
  margin: 0 auto 10px;
  padding: 8px;
  border: 1px solid #d2d2d2;
  background: #fff;
  text-align: center;
}

.share-tip__qr img,
.share-tip__qr canvas {
  display: block;
  width: 100%;
  height: auto;
}

.share-tip__body {
  margin: 0;
  text-align: center;
  font-size: clamp(14px, 1.45vw, 20px);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.share-tip__mobile-text {
  display: none;
}

body.is-mobile-device .share-tip {
  --share-tip-scale: 1;
  width: auto;
  max-width: min(58vw, 220px);
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid #000;
  border-radius: 0;
  background: #f0f0f0;
  color: #000;
  box-shadow: none;
  transform: translate(-50%, calc(-100% - 12px));
}

body.is-mobile-device .share-tip__title,
body.is-mobile-device .share-tip__qr,
body.is-mobile-device .share-tip__body {
  display: none;
}

body.is-mobile-device .share-tip__mobile-text {
  display: block;
  margin: 0;
  text-align: center;
  line-height: 1.5;
  white-space: normal;
  font-size: clamp(12px, 3.2vw, 16px);
  font-weight: 400;
  color: #000;
}

.action-toast {
  position: fixed;
  left: 50%;
  top: 9%;
  z-index: 30;
  min-width: 220px;
  max-width: min(80vw, 420px);
  padding: 14px 22px;
  border-radius: 999px;
  background: rgba(34, 20, 18, 0.86);
  color: #fff3dc;
  text-align: center;
  font-size: 16px;
  line-height: 1.4;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -12px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
  pointer-events: none;
}

.action-toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.flower-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
}

.flower {
  position: absolute;
  height: auto;
  opacity: 0;
  pointer-events: none;
  user-select: none;
  transform: translateX(var(--flower-shift-x, 0)) translateY(10px) scale(0.985);
  transform-origin: 50% 100%;
  transition:
    opacity 2800ms ease,
    transform 2800ms ease;
  filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.22));
}

.flower-layer.is-visible .flower {
  opacity: 1;
  transform: translateX(var(--flower-shift-x, 0)) translateY(0) scale(1);
}

.walker {
  position: absolute;
  left: 1.8%;
  bottom: 15.5%;
  width: 5.5%;
  aspect-ratio: 300 / 600;
  opacity: 0;
  pointer-events: none;
  display: none;
  overflow: hidden;
  transform-origin: 50% 100%;
  will-change: left, opacity, transform;
}

.walker.is-active {
  display: block;
  opacity: 1;
}

.walker__sprite {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.28))
    drop-shadow(0 1px 2px rgba(255, 255, 255, 0.16));
}

.walker__sheet {
  position: absolute;
  inset: 0 auto auto 0;
  display: block;
  width: 1400%;
  height: 400%;
  max-width: none;
  user-select: none;
  pointer-events: none;
  will-change: transform;
}

.walker[data-phase="turn"] .walker__sprite {
  background-position-y: 33.3333%;
  animation: walker-row-2 0.92s steps(12) forwards;
}

.walker[data-phase="bow"] .walker__sprite {
  background-position-y: 100%;
  animation: walker-row-4 0.72s steps(14) 6 alternate forwards;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.jxhl-footer {
  margin-top: 0;
}

@media (max-width: 768px) {
  .ui-logo {
    left: 3.2%;
    top: 3.1%;
    width: 32%;
  }

  .ui-counter {
    right: 3.6%;
    top: 10.2%;
    gap: 4px;
    font-size: clamp(10px, 2.7vw, 13px);
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.42);
  }

  .action-button {
    top: 83.8% !important;
    width: 18.6% !important;
    height: 7.1% !important;
  }

  .action-button[data-id="home"] {
    left: 8.2% !important;
  }

  .action-button[data-id="flower"] {
    left: 29.4% !important;
  }

  .action-button[data-id="bow"] {
    left: 50.6% !important;
  }

  .action-button[data-id="share"] {
    left: 71.8% !important;
  }

  .action-button__label {
    font-size: clamp(11px, 3.1vw, 15px);
    letter-spacing: 0;
  }

  .share-tip {
    --share-tip-scale: 1;
    width: auto;
    max-width: min(58vw, 220px);
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid #000;
    border-radius: 0;
    background: #f0f0f0;
    color: #000;
    box-shadow: none;
    transform: translate(-50%, calc(-100% - 12px));
  }

  .share-tip__title,
  .share-tip__qr,
  .share-tip__body {
    display: none;
  }

  .share-tip__mobile-text {
    display: block;
    margin: 0;
    text-align: center;
    line-height: 1.5;
    white-space: normal;
    font-size: clamp(12px, 3.2vw, 16px);
    font-weight: 400;
    color: #000;
  }

  .action-toast {
    top: 7%;
    min-width: 0;
    width: min(72vw, 320px);
    padding: 10px 16px;
    font-size: 13px;
  }
}

@media (max-width: 420px) {
  .ui-counter {
    top: 11.4%;
    font-size: clamp(9px, 2.9vw, 12px);
  }

  .action-button {
    top: 84.3% !important;
    width: 21% !important;
    height: 7.4% !important;
  }

  .action-button[data-id="home"] {
    left: 5% !important;
  }

  .action-button[data-id="flower"] {
    left: 28% !important;
  }

  .action-button[data-id="bow"] {
    left: 51% !important;
  }

  .action-button[data-id="share"] {
    left: 74% !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .walker,
  .walker__sheet {
    transition: none;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
