* {
  box-sizing: border-box;
}

:root {
  --page-bg: #e3c5a0 url("/security-bg-pattern.png?v=20260603-pure-bg") repeat center top / auto 100dvh;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--page-bg);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: start center;
  background: var(--page-bg);
}

.artboard {
  position: relative;
  width: min(100vw, calc(100dvh * 9 / 16), 640px);
  aspect-ratio: 1080 / 1920;
  overflow: hidden;
  background: #e8cba7;
}

.state-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: fill;
  user-select: none;
  pointer-events: none;
}

.icp-link {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  bottom: 2.4%;
  color: rgba(117, 72, 33, 0.72);
  font-size: clamp(10px, min(2.8vw, 1.42dvh), 15px);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.icp-link:hover {
  color: #754821;
}

.entry-form {
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: 0;
}

.scan-hotspot,
.query-hotspot,
.reset-hotspot {
  position: absolute;
  z-index: 3;
  border: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
  background: transparent;
}

.scan-hotspot {
  left: 15.2%;
  top: 50.95%;
  width: 69.6%;
  height: 6.32%;
}

.code-input {
  position: absolute;
  z-index: 4;
  left: 15.1%;
  top: 58.76%;
  width: 50.9%;
  height: 6.36%;
  padding: 0 0 0 12%;
  border: 0;
  outline: 0;
  color: #754821;
  background: transparent;
  font-size: clamp(14px, min(3.7vw, 2.08dvh), 24px);
  line-height: 1;
}

.code-input::placeholder {
  color: #754821;
  opacity: 0.72;
}

.query-hotspot {
  left: 66%;
  top: 59.47%;
  width: 18.2%;
  height: 5.25%;
}

.reset-hotspot {
  z-index: 8;
  left: 15.2%;
  top: 55.47%;
  width: 69.6%;
  height: 6.32%;
}

.result-panel {
  position: absolute;
  z-index: 6;
  left: 0;
  right: 0;
  top: 39.6%;
  bottom: 15.2%;
  background-color: #e8cba7;
  background-image: url("/security-bg-pattern.png?v=20260603-pure-bg");
  background-repeat: no-repeat;
  background-size: 100% 227.3%;
  background-position: center 71.5%;
  color: #754821;
  text-align: center;
}

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

.result-main {
  position: absolute;
  top: 4.2%;
  left: 11%;
  width: 78%;
  padding: 0;
}

.result-kicker,
.result-title,
.result-code,
.result-detail p {
  margin: 0;
}

.result-kicker {
  font-size: clamp(17px, min(4.65vw, 2.6dvh), 31px);
  font-weight: 600;
  line-height: 1.18;
}

.result-title {
  max-width: 100%;
  margin-top: 2.15%;
  font-size: clamp(19px, min(5.25vw, 2.95dvh), 35px);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: 0;
}

.result-code {
  max-width: 100%;
  margin-top: 2.4%;
  overflow-wrap: anywhere;
  font-size: clamp(14px, min(3.75vw, 2.1dvh), 25px);
  font-weight: 500;
  line-height: 1.2;
}

.result-button {
  position: absolute;
  top: 29.5%;
  left: 18%;
  width: 64%;
  height: 14.6%;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff7ec;
  background: #754821;
  font-size: clamp(18px, min(5vw, 2.82dvh), 34px);
  font-weight: 500;
  line-height: 1;
  pointer-events: none;
}

.result-detail {
  position: absolute;
  top: 55.4%;
  left: 10%;
  width: 80%;
  padding: 1% 0 2%;
  font-size: clamp(12px, min(3.15vw, 1.78dvh), 21px);
  font-weight: 600;
  line-height: 1.62;
}

.result-detail p + p {
  margin-top: 1.4%;
}

.result-detail strong {
  color: #cf1d20;
  font-size: 1.08em;
}

.result-detail .small {
  font-size: 0.86em;
  font-weight: 500;
  opacity: 0.82;
}

.scanner-panel {
  position: absolute;
  z-index: 10;
  left: 14%;
  right: 14%;
  top: 38%;
  padding: 10px;
  border: 1px solid rgba(117, 72, 33, 0.35);
  border-radius: 12px;
  background: rgba(235, 210, 176, 0.96);
}

.scanner-panel[hidden],
[hidden] {
  display: none !important;
}

.scanner-frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 2px solid rgba(117, 72, 33, 0.65);
  border-radius: 8px;
  background: #111;
}

.scanner-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scan-line {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 12%;
  height: 2px;
  background: #cf1d20;
  box-shadow: 0 0 16px rgba(207, 29, 32, 0.6);
  animation: scanMove 1.7s ease-in-out infinite alternate;
}

.scanner-copy {
  display: grid;
  gap: 4px;
  margin: 8px 0;
  color: #754821;
  text-align: center;
}

.scanner-copy strong {
  font-size: 14px;
}

.scanner-copy span {
  font-size: 12px;
}

.stop-scan-button {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: #754821;
}

.notice-panel {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(61, 37, 18, 0.38);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(0);
  transition:
    opacity 360ms ease,
    backdrop-filter 360ms ease;
}

.notice-panel.is-visible {
  opacity: 1;
  pointer-events: auto;
  backdrop-filter: blur(2px);
}

.notice-card {
  width: min(86vw, 360px);
  display: grid;
  gap: 10px;
  padding: 20px;
  border: 1px solid rgba(117, 72, 33, 0.24);
  border-radius: 14px;
  color: #754821;
  text-align: center;
  background: rgba(235, 210, 176, 0.98);
  box-shadow: 0 18px 46px rgba(61, 37, 18, 0.26);
  opacity: 0;
  transform-origin: center;
  transform: translateY(16px) scale(0.92);
  will-change: opacity, transform;
  transition:
    opacity 460ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 460ms cubic-bezier(0.16, 1, 0.3, 1);
}

.notice-panel.is-visible .notice-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.notice-card strong {
  font-size: clamp(18px, 4.2vw, 23px);
}

.notice-card span {
  font-size: clamp(13px, 3.1vw, 16px);
  line-height: 1.6;
}

.notice-button {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: #754821;
  cursor: pointer;
}

.follow-panel {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(61, 37, 18, 0.38);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(0);
  transition:
    opacity 360ms ease,
    backdrop-filter 360ms ease;
}

.follow-panel.is-visible {
  opacity: 1;
  pointer-events: auto;
  backdrop-filter: blur(2px);
}

.follow-card {
  width: min(86vw, 380px);
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 18px 18px 16px;
  border: 1px solid rgba(117, 72, 33, 0.26);
  border-radius: 14px;
  color: #754821;
  text-align: center;
  background: rgba(235, 210, 176, 0.98);
  box-shadow: 0 14px 40px rgba(61, 37, 18, 0.2);
  opacity: 0;
  transform-origin: center;
  transform: translateY(16px) scale(0.92);
  will-change: opacity, transform;
  transition:
    opacity 460ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 460ms cubic-bezier(0.16, 1, 0.3, 1);
}

.follow-panel.is-visible .follow-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.follow-card strong {
  font-size: clamp(18px, 4.2vw, 24px);
}

.follow-card span {
  font-size: clamp(13px, 3.1vw, 16px);
}

.wechat-code {
  width: min(58%, 170px);
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(117, 72, 33, 0.45);
  border-radius: 8px;
  color: rgba(117, 72, 33, 0.72);
  background: rgba(255, 244, 226, 0.82);
}

.wechat-code img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 6px;
}

.follow-confirm-button,
.follow-cancel-button {
  width: 100%;
  min-height: 38px;
  border-radius: 999px;
  cursor: pointer;
}

.follow-confirm-button {
  border: 0;
  color: #fff;
  background: #754821;
}

.follow-cancel-button {
  border: 1px solid rgba(117, 72, 33, 0.35);
  color: #754821;
  background: transparent;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

@keyframes scanMove {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(220px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .notice-panel,
  .notice-card,
  .follow-panel,
  .follow-card,
  .scan-line {
    animation: none;
    transition: none;
  }
}

@media (max-width: 767px) {
  body {
    background-color: #e3c5a0;
    background-image: url("/security-bg-pattern.png?v=20260603-pure-bg");
    background-repeat: repeat;
    background-position: center top;
    background-size: auto 177.777vw;
  }

  .page {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: start center;
    background-color: #e3c5a0;
    background-image: url("/security-bg-pattern.png?v=20260603-pure-bg");
    background-repeat: repeat;
    background-position: center top;
    background-size: auto 177.777vw;
  }

  .artboard {
    width: 100vw;
    max-width: none;
    aspect-ratio: 1080 / 1920;
  }
}
