:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --blue: #216caf;
  --deep-blue: #115a98;
  --muted: #66727d;
  --line: #e8eef4;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: #eef6fb;
}

button,
input {
  font: inherit;
}

.app-shell {
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
  background: #f5f3ee;
}

.map-panel {
  position: fixed;
  inset: 0 0 0 0;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 83% 7%, rgba(97, 190, 96, 0.34) 0 7%, transparent 7.5%),
    radial-gradient(circle at 15% 67%, rgba(94, 188, 88, 0.28) 0 5%, transparent 5.4%),
    linear-gradient(135deg, #f7f5ef 0%, #f4f3ef 56%, #eef2ef 100%);
}

.real-map {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: none;
  background: #eef2ef;
}

.map-panel.is-live-map {
  background: #eef2ef;
}

.map-panel.is-live-map .real-map {
  display: block;
}

.map-panel.is-live-map .fallback-map {
  display: none;
}

.amap-logo,
.amap-copyright {
  display: none !important;
}

.map-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  color: #333;
  font-size: clamp(18px, 3.3vw, 31px);
}

.place,
.road,
.river {
  position: absolute;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.82);
}

.p1 { left: 25%; top: 1%; }
.p2 { left: 43%; top: 2%; }
.p3 { left: 13%; top: 10%; }
.p4 { left: 29%; top: 16%; }
.p5 { left: 38%; top: 23%; }
.p6 { left: 26%; top: 31%; }
.p7 { right: 9%; top: 13%; }
.p8 { right: 10%; top: 43%; }
.p9 { left: 37%; top: 80%; }

.road {
  color: #735c3a;
  font-size: clamp(14px, 2.8vw, 25px);
}

.r1 {
  right: 4%;
  top: 55%;
  transform: rotate(12deg);
}

.r2 {
  left: 30%;
  top: 70%;
  transform: rotate(-16deg);
}

.r3 {
  right: 22%;
  top: 64%;
  transform: rotate(-10deg);
}

.river {
  color: #1885b4;
  font-size: clamp(13px, 2.5vw, 23px);
}

.rv1 {
  left: 49%;
  top: 63%;
}

.rv2 {
  right: 7%;
  top: 19%;
  transform: rotate(-14deg);
}

.route,
.river-line {
  position: absolute;
  pointer-events: none;
  opacity: 0.95;
}

.route-main {
  left: -12%;
  top: 55%;
  width: 130%;
  height: 24px;
  background: #f7d982;
  border: 3px solid #e8bd4d;
  border-radius: 999px;
  transform: rotate(-8deg);
}

.route-side {
  left: 18%;
  top: 46%;
  width: 15px;
  height: 33%;
  background: #f7d982;
  border: 3px solid #e8bd4d;
  border-radius: 999px;
  transform: rotate(5deg);
}

.river-main {
  left: -8%;
  top: 66%;
  width: 76%;
  height: 28px;
  border-radius: 999px;
  border-top: 14px solid rgba(89, 185, 222, 0.72);
  transform: rotate(-12deg);
}

.river-side {
  right: -6%;
  top: 16%;
  width: 42%;
  height: 110px;
  border-radius: 46%;
  border: 12px solid rgba(113, 194, 226, 0.62);
  border-left-color: transparent;
  transform: rotate(28deg);
}

.pin {
  position: absolute;
  width: 32px;
  height: 32px;
  border-radius: 50% 50% 50% 0;
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.24));
}

.pin::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: #fff;
}

.live-user-marker {
  width: 22px;
  height: 22px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: #1688db;
  box-shadow: 0 0 0 7px rgba(22, 136, 219, 0.22), 0 3px 10px rgba(0, 0, 0, 0.25);
}

.live-office-marker {
  width: 24px;
  height: 24px;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  background: #e93030;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
  transform: rotate(-45deg);
}

.live-office-marker::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #fff;
}

.user-pin {
  left: 48%;
  top: 63%;
  background: #1688db;
  transform: rotate(-45deg);
}

.target-pin {
  right: 18%;
  top: 60%;
  background: #e93030;
  transform: rotate(-45deg);
}

.verify-fab {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: 30.5vh;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 62px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #1f2a33;
  font-size: clamp(19px, 4vw, 28px);
  font-weight: 650;
  box-shadow: 0 0 18px rgba(34, 112, 173, 0.42);
}

.scan-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--blue);
  position: relative;
  flex: 0 0 auto;
}

.scan-icon::before,
.scan-icon::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 3px solid #fff;
  border-left-color: transparent;
  border-right-color: transparent;
}

.scan-icon::after {
  transform: rotate(90deg);
}

.sheet {
  position: relative;
  z-index: 3;
  width: 100%;
  margin-top: 72vh;
  padding: 0 18px max(24px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(238, 249, 255, 0.3), #eef8fd 72px);
}

.search-bar {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 62px;
  margin: 0 auto 20px;
  padding: 0 22px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 6px 24px rgba(64, 78, 96, 0.16);
}

.city-btn {
  border: 0;
  background: transparent;
  color: #0c1014;
  font-size: clamp(18px, 4vw, 27px);
  font-weight: 520;
  padding: 0;
  white-space: nowrap;
}

.city-btn::after {
  content: "";
  display: inline-block;
  margin-left: 8px;
  border: 6px solid transparent;
  border-top-color: #111;
  transform: translateY(3px);
}

.divider {
  width: 1px;
  height: 30px;
  margin: 0 18px;
  background: #bfc6cc;
}

.search-field {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 12px;
}

.search-field span {
  width: 23px;
  height: 23px;
  border: 2px solid #929aa1;
  border-radius: 50%;
  position: relative;
  flex: 0 0 auto;
}

.search-field span::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 2px;
  background: #929aa1;
  right: -7px;
  bottom: 0;
  transform: rotate(45deg);
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: #2d3338;
  background: transparent;
  font-size: clamp(17px, 3.7vw, 25px);
}

.search-field input::placeholder {
  color: #b8c0c6;
}

.status-line {
  margin: -8px 8px 12px;
  color: #5f7180;
  font-size: 15px;
}

.office-list {
  display: grid;
  gap: 14px;
}

.office-card {
  min-height: 214px;
  padding: 24px 24px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 4px 16px rgba(57, 100, 138, 0.08);
}

.office-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 12px;
  align-items: start;
}

.office-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.office-title h2 {
  margin: 0;
  color: #080b0f;
  font-size: clamp(21px, 4.5vw, 29px);
  line-height: 1.2;
}

.tag {
  flex: 0 0 auto;
  padding: 4px 8px;
  background: #e7f2fb;
  color: #2c6f9b;
  font-size: clamp(12px, 2.6vw, 17px);
}

.nav-link {
  color: #6d747a;
  text-align: center;
  text-decoration: none;
  font-size: 18px;
}

.nav-dot {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 0 auto 5px;
  border-radius: 50%;
  background: var(--blue);
}

.nav-dot::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 14px solid #fff;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  transform: rotate(-35deg) translateX(2px);
}

.meta {
  display: grid;
  gap: 18px;
  margin: 18px 0 22px;
}

.meta-row {
  display: grid;
  grid-template-columns: 27px 1fr;
  gap: 12px;
  align-items: start;
  color: #5d646b;
  font-size: clamp(15px, 3.1vw, 21px);
  line-height: 1.42;
}

.meta-icon {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--blue);
  position: relative;
}

.meta-icon.loc::before {
  content: "";
  position: absolute;
  inset: 6px;
  background: #fff;
  border-radius: 50%;
}

.meta-icon.time::before {
  content: "";
  position: absolute;
  width: 2px;
  height: 8px;
  left: 10px;
  top: 4px;
  background: #fff;
}

.meta-icon.time::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 2px;
  left: 10px;
  top: 11px;
  background: #fff;
  transform: rotate(35deg);
  transform-origin: left center;
}

.actions {
  display: flex;
  gap: 34px;
}

.primary-btn,
.ghost-btn {
  min-width: 138px;
  min-height: 48px;
  border-radius: 7px;
  font-size: clamp(16px, 3.2vw, 22px);
  font-weight: 650;
}

.primary-btn {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
}

.ghost-btn {
  border: 1px solid #8ba3b4;
  background: #fff;
  color: #2d648e;
}

.scanner-dialog,
.pdf-dialog {
  width: min(100vw, 760px);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: #05080b;
  color: #fff;
}

.scanner-dialog::backdrop,
.pdf-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.scanner-head,
.pdf-head {
  display: grid;
  grid-template-columns: 54px 1fr 74px;
  align-items: center;
  min-height: calc(64px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 14px 0;
  background: #111820;
}

.scanner-head strong,
.pdf-head strong {
  text-align: center;
  font-size: 18px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 32px;
}

.upload-btn,
.pdf-head a {
  color: #d9ebff;
  text-align: center;
  text-decoration: none;
  font-size: 15px;
}

.upload-btn input {
  display: none;
}

.scanner-view {
  position: relative;
  height: calc(100dvh - 150px - env(safe-area-inset-top));
  overflow: hidden;
  background: #000;
}

#scannerVideo,
#scanCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#scanCanvas {
  display: none;
}

.scan-frame {
  position: absolute;
  left: 50%;
  top: 45%;
  width: min(72vw, 330px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 255, 255, 0.86);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.46);
}

.scanner-tip {
  margin: 18px 24px;
  color: #cbd3dc;
  text-align: center;
  line-height: 1.5;
}

.pdf-dialog {
  background: #f5f6f7;
}

.pdf-head {
  color: #fff;
}

.pdf-head a {
  font-size: 13px;
}

#pdfFrame {
  display: block;
  width: 100%;
  height: calc(100dvh - 64px - env(safe-area-inset-top));
  border: 0;
  background: #fff;
}

@media (min-width: 768px) {
  .app-shell,
  .scanner-dialog,
  .pdf-dialog {
    max-width: 760px;
    margin: 0 auto;
  }

  .map-panel {
    left: 50%;
    width: 760px;
    transform: translateX(-50%);
  }
}

@media (max-width: 420px) {
  .verify-fab {
    min-height: 54px;
    padding: 0 18px;
    gap: 10px;
  }

  .scan-icon {
    width: 36px;
    height: 36px;
  }

  .sheet {
    padding-inline: 12px;
  }

  .search-bar {
    min-height: 56px;
    padding: 0 16px;
    border-radius: 12px;
  }

  .office-card {
    padding: 21px 18px;
  }

  .actions {
    gap: 16px;
  }

  .primary-btn,
  .ghost-btn {
    min-width: 118px;
  }
}
