:root {
  --green: #08c878;
  --deep-green: #009b50;
  --text: #171717;
  --muted: #777;
  --page-width: 578px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: #ededed;
  color: var(--text);
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
.phone {
  position: relative;
  width: min(100%, var(--page-width));
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: #fff;
}

/* 首页：以 1156px 样图按 1/2 比例标定 */
.home-page { min-height: 100vh; background: #f4f4f4; }
.home-header {
  position: relative;
  height: 46px;
  border-bottom: 1px solid #e8e8e8;
  background: #ededed;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 23.4px;
  font-weight: 600;
  letter-spacing: 1px;
}
.home-back {
  position: absolute;
  left: 13px;
  top: 15px;
  width: 10px;
  height: 17px;
}
.home-back::before, .home-back::after {
  content: "";
  position: absolute;
  left: 4px;
  width: 2px;
  height: 11px;
  border-radius: 2px;
  background: #111;
}
.home-back::before { top: 0; transform: rotate(42deg); }
.home-back::after { bottom: 0; transform: rotate(-42deg); }
.home-person {
  position: absolute;
  right: 12px;
  top: 15px;
  width: 17px;
  height: 16px;
  object-fit: cover;
}
.home-body {
  min-height: calc(100vh - 110px);
  padding-top: 42px;
  text-align: center;
}
.home-time {
  display: block;
  color: #777;
  font-size: 20px;
  font-size: clamp(17px, 4.31vw, 24px);
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 400;
  line-height: 1;
}
.location-request {
  width: calc(100% - 24px);
  margin: 30px auto 0;
  color: #7b7b7b;
  font-size: 18px;
  font-size: clamp(15.3px, 3.879vw, 21.6px);
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 400;
  line-height: 1.46;
  white-space: normal;
}
.location-allow {
  display: inline;
  margin-left: 13px;
  color: #315f98;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.home-nav {
  position: relative;
  height: 64px;
  border-top: 1px solid #d8d8d8;
  background: #fff;
  display: flex;
  align-items: flex-start;
  padding-top: 13px;
}
.keyboard-wrap {
  width: 35px;
  height: 32px;
  margin-left: 7px;
  border-right: 1px solid #dedede;
  display: flex;
  align-items: center;
}
.keyboard-icon {
  width: 29px;
  height: 29px;
  object-fit: contain;
  display: block;
}
.menu-trigger {
  flex: 1;
  width: auto;
  height: 25px;
  margin: 0;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #090909;
  font-size: 18.2px;
  line-height: 25px;
  cursor: pointer;
}
.menu-trigger span { margin-left: 5px; color: #aaa; font-size: 10px; vertical-align: 2px; }
.home-menu {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 64px;
  width: 180px;
  transform: translateX(-50%);
  display: none;
  background: #fff;
  box-shadow: 0 0 18px rgba(0,0,0,.24);
}
.home-menu.open { display: block; }
.home-menu a {
  height: 50px;
  padding: 0 8px;
  border-bottom: 1px solid #ececec;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  color: #111;
  text-decoration: none;
  font-size: 18.2px;
  white-space: nowrap;
}
.home-menu a:last-child { border-bottom: 0; }
.home-menu a::after {
  content: "";
  width: 13px;
  height: 14px;
  flex: 0 0 auto;
  margin-left: 3px;
  background: url("../images/链接.png") center / contain no-repeat;
}

/* 扫码页：参考图浏览器栏以下网页部分 */
.scanner-page {
  width: min(100%, var(--page-width), calc(100vh * .5446));
  max-width: var(--page-width);
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: #f5f6f5;
  text-align: center;
  padding-bottom: 0;
}
.scan-canvas {
  position: relative;
  width: 100%;
  height: 0;
  padding-top: 183.39%;
  overflow: hidden;
}
.scan-reference-image {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  width: 100%;
  height: auto;
  transform: translateY(-12.1514%);
}
.scan-button {
  position: absolute;
  z-index: 2;
  left: 16.78%;
  top: 85.90%;
  width: 66.35%;
  height: 9.10%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
  font-size: 0;
  cursor: pointer;
  box-shadow: none;
}
.scan-dialog {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.9);
  color: #fff;
}
.scan-dialog.open { display: flex; }
.scan-dialog video { width: min(92vw, 520px); max-height: 72vh; border-radius: 10px; }
.scan-tip { margin-top: 18px; }
/* 查询页：以 1156x5034 长图按 1/2 比例标定 */
.query-page { background: #f4f4f4; }
.result-banner {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 1290 / 472;
  background: #0fcd77 url('../images/normal-banner-clean.png') center / 100% 100% no-repeat;
}
.banner-serial {
  position: absolute;
  left: 3.49%;
  top: 48.52%;
  width: 60%;
  height: 11%;
  padding: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: transparent;
  color: #17466f;
  font-size: clamp(11px, 2.7vw, 15px);
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.query-summary {
  position: relative;
  z-index: 2;
  width: calc(100% - 48px);
  min-height: 0;
  margin: -1px auto 14px;
  padding: 31px 31px 24px;
  border-radius: 14px;
  background: #fff;
}
.query-summary h1 {
  margin: 0 0 25px;
  font-size: 24px;
  line-height: 1.35;
  font-weight: 700;
}
.status-check {
  display: inline-grid;
  width: 27px;
  height: 27px;
  margin-right: 11px;
  place-items: center;
  border-radius: 50%;
  background: #12c978;
  color: #fff;
  font-size: 19px;
}
.query-summary p {
  margin: 0 0 15px 39px;
  color: #696969;
  font-size: 16px;
  line-height: 1.6;
}
.query-section {
  margin-top: 13px;
  padding: 31px 25px;
  background: #fff;
}
.query-section-title {
  margin: 0;
  padding-left: 13px;
  border-left: 6px solid #08aa60;
  font-size: 22px;
  line-height: 30px;
  font-weight: 700;
}
.product-section { min-height: 0; padding-bottom: 20px; }
.product-main {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 8px;
  object-fit: contain;
}
.product-name { margin: 8px 0 10px; text-align: center; font-size: 19px; font-weight: 600; }
.product-hint { margin: 0; text-align: center; color: #888; font-size: 16px; }
.production-section { min-height: 0; padding-bottom: 20px; }
.production-grid {
  display: grid;
  grid-template-columns: 1fr 125px;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}
.production-copy { font-size: 17px; line-height: 1.9; }
.production-copy p { margin: 0 0 15px; }
.production-copy .location-note { margin-top: 10px; color: #777; font-size: 15px; line-height: 1.7; }
.bottle-image { width: 113px; height: 157px; justify-self: end; object-fit: contain; }
.label-section { min-height: 0; padding-bottom: 64px; }
.key-caption { margin-top: 27px; text-align: center; color: #777; font-size: 16px; letter-spacing: 6px; }
.short-key {
  margin: 13px 0 8px;
  padding-left: 24px;
  text-align: center;
  font-family: Arial, sans-serif;
  font-size: 37px;
  font-weight: 600;
  letter-spacing: 22px;
}
.label-demo {
  display: block;
  width: calc(100% + 50px);
  height: auto;
  margin: 20px -25px 7px;
}
.view-label {
  display: block;
  width: calc(100% - 62px);
  height: 57px;
  margin: 0 auto;
  border: 1px solid #079f58;
  border-radius: 6px;
  background: #fff;
  color: #079f58;
  font-size: 17px;
  cursor: pointer;
}
.query-footer {
  min-height: 0;
  margin-top: 13px;
  padding: 18px 26px 0;
  background: #fff;
  color: #666;
  font-size: 12px;
  line-height: 1.35;
}
.query-footer a { color: #285f89; }
.float-down {
  position: fixed;
  right: max(calc((100vw - 578px) / 2 + 14px), 14px);
  bottom: 72px;
  z-index: 6;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #00a958;
  color: #fff;
  text-align: center;
  font-size: 14px;
  line-height: 1.35;
}
.not-found { min-height: 100vh; padding: 110px 30px; text-align: center; }

/* 标签原图弹窗 */
.modal {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(0,0,0,.48);
}
.modal.open { display: flex; }
.label-modal {
  width: min(460px, 100%);
  max-height: 96vh;
  overflow-y: auto;
  border-radius: 18px;
  background: #fff;
}
.modal-head { padding: 12px 24px 10px; }
.modal-head h2 { margin: 0 0 8px; font-size: 16px; line-height: 1.3; }
.modal-head p { margin: 0; color: #777; font-size: 13px; line-height: 1.35; }
.modal-label-image { display: block; width: 100%; height: auto; }
.modal-caption { margin: 7px 0 10px; text-align: center; color: #777; font-size: 13px; }
.modal-copy { padding: 0 24px 14px; color: #666; font-size: 13px; line-height: 1.45; }
.modal-copy h3 { margin: 0 0 6px; color: #111; font-size: 15px; }
.modal-copy p { margin: 2px 0; }
.modal-close {
  position: fixed;
  left: 50%;
  bottom: 1.5vh;
  width: 50px;
  height: 50px;
  padding: 0;
  transform: translateX(-50%);
  border: 2px solid #fff;
  border-radius: 50%;
  background: #777;
  color: #fff;
  font-size: 36px;
  line-height: 42px;
  cursor: pointer;
}

@media (max-width: 420px) {
  .query-summary { width: calc(100% - 28px); padding-left: 22px; padding-right: 22px; }
  .query-summary p { margin-left: 0; }
  .production-grid { grid-template-columns: 1fr 135px; }
  .bottle-image { width: 113px; }
  .label-demo { width: calc(100% + 50px); }
}

@media (min-aspect-ratio: 545 / 1000) {
  .scanner-page { width: 54.46vh; }
}

@supports (height: 100dvh) {
  .scanner-page { width: min(100%, var(--page-width), calc(100dvh * .5446)); }
}
