:root {
  color-scheme: light;
  --page-bg: #f4f6f9;
  --nav-height: 78px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --blue: #8ca2cd;
  --text: #34383f;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--page-bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

body {
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom));
  overscroll-behavior-y: contain;
}

button {
  font: inherit;
}

.app-shell {
  width: 100%;
  max-width: 540px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--page-bg);
  overflow: hidden;
}

.screen {
  position: relative;
  width: 100%;
}

.page-image {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.tab-hitbox {
  position: absolute;
  left: 19.1%;
  top: 15.65%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 61.9%;
  height: 3.05%;
}

.screen-company .tab-hitbox {
  top: 28.65%;
  height: 5.35%;
}

.tab-hotspot,
.record-hotspot {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.tab-hotspot:focus-visible,
.record-hotspot:focus-visible,
.nav-button:focus-visible,
.dialog-close:focus-visible {
  outline: 3px solid rgba(70, 118, 196, 0.85);
  outline-offset: -3px;
}

.record-hotspot {
  position: absolute;
  left: 33.2%;
  top: 29.2%;
  width: 33.7%;
  height: 3.55%;
  border-radius: 999px;
}

.screen-company .record-hotspot {
  display: none;
}

.bottom-nav {
  position: fixed;
  z-index: 50;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding: 6px max(8px, calc((100vw - 540px) / 2)) var(--safe-bottom);
  border-top: 1px solid #e7e9ed;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 -2px 10px rgba(51, 67, 92, 0.04);
}

.nav-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.nav-button img {
  display: block;
  width: auto;
  height: 62px;
  max-width: 82%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.modal[hidden],
.toast[hidden] {
  display: none;
}

.modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: max(22px, env(safe-area-inset-top)) 16px calc(16px + var(--safe-bottom));
  overflow-y: auto;
}

.modal-mask {
  position: fixed;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.5);
}

.record-dialog,
.wechat-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
}

.record-dialog {
  min-height: min(72vh, 560px);
  margin-top: 4vh;
  border-radius: 6px;
}

.record-dialog h2 {
  margin: 0;
  padding: 32px 42px 30px;
  color: #222;
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
}

.dialog-close {
  position: absolute;
  z-index: 3;
  top: 5px;
  right: 7px;
  width: 38px;
  height: 38px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #7d8490;
  font-size: 28px;
  line-height: 38px;
  cursor: pointer;
}

.record-table {
  width: 100%;
  font-size: 15px;
}

.record-row {
  display: grid;
  grid-template-columns: 16% 48% 36%;
  align-items: center;
}

.record-row span {
  min-width: 0;
  padding: 0 5px;
  text-align: center;
  overflow-wrap: anywhere;
}

.record-head {
  min-height: 62px;
  background: var(--blue);
  color: #fff;
  font-size: 16px;
}

.record-data {
  min-height: 78px;
  border-bottom: 1px solid #e8e8e8;
  background: #fff;
  color: #252525;
  font-size: 15px;
}

#scanTime {
  white-space: nowrap;
}

.wechat-dialog {
  width: min(88vw, 360px);
  margin: auto;
  border-radius: 4px;
}

.wechat-dialog img {
  display: block;
  width: 100%;
  height: auto;
}

.wechat-close {
  top: 2px;
  right: 2px;
  color: #5e6470;
  text-shadow: 0 1px 2px #fff;
}

.toast {
  position: fixed;
  z-index: 150;
  right: 20px;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 18px);
  left: 20px;
  width: fit-content;
  max-width: calc(100vw - 40px);
  margin: 0 auto;
  padding: 10px 16px;
  border-radius: 7px;
  background: rgba(32, 35, 40, 0.9);
  color: #fff;
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}

body.modal-open {
  overflow: hidden;
}

@media (min-width: 541px) {
  body {
    background: #e9edf3;
  }

  .app-shell {
    box-shadow: 0 0 30px rgba(53, 68, 92, 0.12);
  }
}

@media (max-width: 360px) {
  :root {
    --nav-height: 70px;
  }

  .nav-button img {
    height: 55px;
  }

  .record-row {
    grid-template-columns: 14% 50% 36%;
  }

  .record-row,
  .record-head {
    font-size: 13px;
  }
}

