:root {
  --blue: #526feb;
  --deep-blue: #23499e;
  --cyan: #19aee1;
  --sky: #cfefff;
  --red: #ef3d39;
  --ink: #17306f;
  --muted: #6b7893;
  --line: #68cce5;
  --paper: #ffffff;
  --shadow: 0 8px 22px rgba(25, 65, 118, .15);
}

* { box-sizing: border-box; }
html { background: #e7f7ff; }
body {
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background: linear-gradient(90deg, #e9f9ff 0, #fff 30%, #fff 70%, #e9f9ff 100%);
}
button, input, select { font: inherit; }
button { cursor: pointer; }

#app {
  width: min(100%, 430px);
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: linear-gradient(180deg, #e0f5ff 0, #c9efff 66%, #dbf7ff 100%);
  box-shadow: 0 0 30px rgba(0, 74, 150, .14);
}

.login-view { min-height: 100dvh; position: relative; }
.hero {
  height: 235px;
  background: url("assets/hero.png") center top / cover no-repeat;
}
.title-ribbon {
  position: relative;
  z-index: 2;
  margin-top: -2px;
  padding: 15px 18px 18px;
  color: #fff;
  background: linear-gradient(180deg, #5570ea, #25aee0);
  box-shadow: 0 7px 8px rgba(19, 96, 158, .32);
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0;
}
.login-form { padding: 52px 40px 30px; }
.field-row { display: grid; grid-template-columns: 58px 1fr; align-items: center; gap: 10px; margin-bottom: 26px; }
.field-row label { font-size: 19px; font-weight: 800; color: #6040b3; }
.field-row input, .field-row select, .select-like {
  width: 100%;
  border: 0;
  border-radius: 7px;
  min-height: 48px;
  padding: 0 15px;
  background: rgba(255,255,255,.93);
  color: var(--ink);
  outline: none;
  box-shadow: inset 0 0 0 2px transparent;
}
.field-row input:focus, .field-row select:focus { box-shadow: inset 0 0 0 2px var(--cyan); }
.primary-btn, .secondary-btn, .danger-btn {
  border: 0;
  color: #fff;
  font-weight: 800;
  border-radius: 28px;
  min-height: 52px;
  padding: 0 25px;
}
.primary-btn { background: linear-gradient(90deg, #5b72ec, #16afe3); box-shadow: 0 8px 16px rgba(38,122,220,.22); }
.secondary-btn { background: #6276e8; }
.danger-btn { background: var(--red); }
.login-form .primary-btn { width: 158px; display: block; margin: 46px auto 0; font-size: 22px; }
.login-note { margin: 27px 0 0; color: #d83636; text-align: center; font-size: 13px; font-weight: 700; }
.footer-mark { padding: 42px 12px 24px; text-align: center; color: #573caa; font-weight: 800; font-size: 13px; }

.map-view { position: relative; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; background: #76e126; }
.map-header { position: relative; flex: 0 0 auto; width: 100%; aspect-ratio: 744 / 526; background: #dff4ff; }
.map-header > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.map-header-nav { position: absolute; left: 0; bottom: 15%; width: 24%; height: 13%; border: 0; background: transparent; color: transparent; }
.map-stage { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; touch-action: none; container-type: inline-size; background: #76e126; cursor: grab; }
.map-stage:active { cursor: grabbing; }
.map-transform { position: relative; width: 100%; transform-origin: center top; will-change: transform; }
.map-transform > img { display: block; width: 100%; height: auto; }
.map-overlay { position: absolute; inset: 0; }
.map-link { position: absolute; border: 0; background: transparent; color: transparent; }
.map-link:focus-visible { outline: 3px solid #fff; border-radius: 8px; }
.map-flow { right: 0; top: 0; width: 29%; height: 7.5%; }
.map-points { right: 0; top: 7.7%; width: 29%; height: 7.5%; }
.map-prizes { right: 0; top: 15.2%; width: 29%; height: 7.5%; }
.map-coupons { right: 0; top: 22.8%; width: 29%; height: 7.5%; }
.map-bus { right: 0; top: 30.4%; width: 29%; height: 7.5%; }
.map-tips { right: 0; top: 38%; width: 29%; height: 7.5%; }
.hotspot-team { left: 52%; top: 59%; width: 17%; height: 10%; }
.hotspot-food { left: 43%; top: 27%; width: 16%; height: 9%; }
.hotspot-kids { left: 73%; top: 21%; width: 17%; height: 9%; }
.hotspot-craft { left: 72%; top: 29%; width: 18%; height: 9%; }
.map-fixed-actions { position: absolute; z-index: 4; right: 0; top: 10px; width: min(34%, 146px); display: grid; gap: 5px; pointer-events: none; }
.map-fixed-actions button { width: 100%; min-height: 38px; padding: 0 10px; display: grid; grid-template-columns: 28px 1fr; align-items: center; border: 0; border-radius: 22px 0 0 22px; color: #fff; background: linear-gradient(100deg, #256bd2 0%, #148fda 55%, #17b9d2 100%); box-shadow: 0 3px 8px rgba(20, 76, 145, .38); font-weight: 800; pointer-events: auto; }
.map-fixed-actions button:hover { background: linear-gradient(100deg, #1e5ebe 0%, #087fc9 55%, #0aa7c0 100%); }
.map-fixed-actions b { display: grid; place-items: center; width: 25px; height: 25px; font-size: 19px; line-height: 1; font-family: Arial, "Microsoft YaHei", sans-serif; }
.map-fixed-actions button:nth-child(3) b, .map-fixed-actions button:nth-child(5) b { font-size: 0; }
.map-fixed-actions button:nth-child(3) b::after { content: "🎁"; font-size: 18px; }
.map-fixed-actions button:nth-child(5) b::after { content: "🚌"; font-size: 18px; }
.map-fixed-actions button:nth-child(3) b, .map-fixed-actions button:nth-child(5) b { filter: grayscale(1) brightness(0) invert(1); }
.map-fixed-actions span { white-space: nowrap; font-size: 14px; }
.map-fixed-actions button:focus-visible { outline: 3px solid #fff; outline-offset: -4px; }
.map-zoom-controls { position: absolute; z-index: 5; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(3, 42px); gap: 6px; }
.map-zoom-controls button { width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.85); border-radius: 50%; color: #21428f; background: rgba(255,255,255,.94); box-shadow: 0 3px 10px rgba(0,0,0,.2); font-size: 22px; font-weight: 800; }
.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 8;
  border: 0;
  background: rgba(0, 23, 48, .18);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.drawer-scrim.open { opacity: 1; pointer-events: auto; }
.side-drawer {
  position: fixed;
  z-index: 9;
  top: 18px;
  left: max(0px, calc(50% - 215px));
  width: min(54vw, 232px);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  background: #fff;
  border-radius: 0 0 16px 0;
  box-shadow: 10px 8px 25px rgba(18, 55, 86, .22);
  transform: translateX(-110%);
  transition: transform .23s ease;
  scrollbar-width: thin;
}
.side-drawer.open { transform: translateX(0); }
.drawer-title {
  position: sticky;
  top: 0;
  z-index: 1;
  width: 100%;
  min-height: 48px;
  border: 0;
  color: #fff;
  background: linear-gradient(90deg, #4d65d8, #6544a8);
  font-weight: 800;
  text-align: left;
  padding: 0 18px;
}
.drawer-title span { float: right; }
.drawer-item {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-bottom: 1px solid #e7e7e7;
  background: #fff;
  color: #333;
  text-align: left;
  font-size: 14px;
}
.drawer-item:active, .drawer-item:focus-visible { background: #edf5ff; color: var(--deep-blue); }

.page { min-height: 100dvh; }
.page-hero {
  height: 245px;
  position: relative;
  background: url("assets/hero.png") center top / cover no-repeat;
}
.nav-chip {
  position: absolute;
  bottom: 12px;
  min-height: 42px;
  padding: 0 13px;
  border: 0;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(90deg, #566fe5, #1bafe2);
}
.nav-chip.left { left: 0; border-radius: 0 22px 22px 0; }
.nav-chip.right { right: 0; border-radius: 22px 0 0 22px; }
.page-title {
  margin: 0;
  min-height: 66px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(180deg, #5871e8, #27aadd);
  box-shadow: 0 7px 9px rgba(33, 91, 149, .3);
}
.page-body { padding: 34px 22px 18px; }
.content-panel { background: #fff; border-radius: 7px; box-shadow: var(--shadow); padding: 22px; min-height: 320px; }
.flow-content { height: 520px; overflow-y: auto; overscroll-behavior: contain; padding-right: 10px; }
.flow-content::-webkit-scrollbar { width: 7px; }
.flow-content::-webkit-scrollbar-thumb { border-radius: 8px; background: #6bbbd5; }
.flow-content::-webkit-scrollbar-track { background: #edf8fc; }
.editable-content { height: 360px; overflow-y: auto; overflow-x: auto; padding-right: 10px; }
.detail-window { height: 430px; overflow-y: auto; overflow-x: hidden; padding-right: 10px; scrollbar-width: thin; }
.detail-window::-webkit-scrollbar { width: 7px; }
.detail-window::-webkit-scrollbar-thumb { border-radius: 8px; background: #6bbbd5; }
.detail-window::-webkit-scrollbar-track { background: #edf8fc; }
.section-line { border: 0; height: 5px; border-radius: 4px; background: linear-gradient(90deg, #7ed3e7, #16acd6); margin: 18px 0; }
.content-panel h2, .content-panel h3 { color: var(--deep-blue); margin: 0 0 16px; }
.content-panel p, .content-panel li { color: #34445f; line-height: 1.75; }
.content-panel ul { padding-left: 20px; }

.quick-tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
.quick-tabs button { min-height: 44px; border: 1px solid #dbe7ff; background: #f4f8ff; color: var(--deep-blue); border-radius: 6px; font-weight: 800; }
.quick-tabs button.active { background: var(--blue); color: #fff; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.metric { background: #fff; border-radius: 7px; padding: 18px 14px; box-shadow: var(--shadow); min-height: 112px; }
.metric span { display: block; color: #6960d2; font-weight: 800; }
.metric strong { display: block; margin-top: 10px; color: #694ee0; font-size: 27px; }
.rule-list { margin: 0; padding-left: 20px; }
.rule-list li::marker { color: #111; }
.accent { color: #e63d36 !important; font-weight: 800; }

.project-select { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; margin-bottom: 14px; }
.project-select label { font-size: 18px; font-weight: 800; }
.project-select select { border: 0; min-height: 44px; border-radius: 5px; padding: 0 12px; color: #fff; background: linear-gradient(90deg, #88d5e7, #11a9d8); }
.project-card { margin-top: 18px; border: 1px solid #e5edf4; border-radius: 7px; overflow: hidden; background: #fff; }
.project-visual { height: 170px; display: grid; place-items: center; background: linear-gradient(145deg, #d4f1ff, #fff6d1); font-size: 74px; }
.project-copy { padding: 17px; }
.project-copy h3 { margin-bottom: 8px; }
.action-stack { display: grid; gap: 10px; margin-top: 20px; }
.action-stack button { width: 100%; }

.prize-list { display: grid; gap: 12px; }
.prize-card { width: 100%; display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid #dce6f0; border-radius: 7px; background: #fff; color: inherit; text-align: left; }
.prize-art { width: 58px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 6px; background: #eef5ff; font-size: 30px; }
.prize-summary strong, .prize-summary small { display: block; }
.prize-summary strong { margin-bottom: 5px; font-size: 16px; color: var(--ink); }
.prize-summary small { color: var(--muted); }
.prize-arrow { color: var(--blue); font-size: 30px; }
.prize-detail { text-align: center; }
.prize-detail-art { width: 150px; aspect-ratio: 1; margin: 0 auto 20px; display: grid; place-items: center; border-radius: 7px; background: #eef5ff; font-size: 76px; }
.prize-meta { color: #e63d36 !important; font-weight: 800; }
.prize-detail dl { margin: 22px 0; border-block: 1px solid #e0e7ef; }
.prize-detail dl div { display: flex; justify-content: space-between; gap: 14px; padding: 13px 0; }
.prize-detail dt { color: var(--muted); }
.prize-detail dd { margin: 0; font-weight: 800; }
.prize-detail .primary-btn { width: 100%; }
.score-redeem-btn { width: 100%; margin-top: 22px; }
.prize-detail .primary-btn:disabled { background: #aab4c5; box-shadow: none; }
.prize-name-input { width: min(220px, 100%); min-height: 38px; border: 1px solid #cad7e8; border-radius: 5px; padding: 0 8px; }

.staff-box { margin-top: 18px; padding: 16px; background: #f2f7ff; border: 1px dashed #7490e7; border-radius: 7px; }
.staff-box > strong { color: var(--deep-blue); }
.staff-controls { display: grid; grid-template-columns: 1fr 100px; gap: 10px; margin-top: 14px; }
.staff-controls input { min-width: 0; min-height: 42px; border: 1px solid #cad7e8; border-radius: 5px; padding: 0 10px; }
.staff-controls button { border: 0; border-radius: 5px; color: #fff; background: var(--red); font-weight: 800; }
.staff-controls button:disabled { background: #aab4c5; }

.subproject-picker { margin-top: 20px; }
.subproject-picker h3 { margin-bottom: 10px; }
.subproject-picker label { display: block; position: relative; margin-top: 8px; }
.subproject-picker input { position: absolute; opacity: 0; }
.subproject-picker span { display: block; padding: 12px 14px; border: 1px solid #d7e2ef; border-radius: 6px; color: var(--ink); background: #f7fbff; }
.subproject-picker input:checked + span { border-color: var(--blue); color: #fff; background: var(--blue); font-weight: 800; }
.experience-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.experience-link { min-width: 0; min-height: 120px; padding: 14px 8px; border: 1px solid #dbe7f3; border-radius: 7px; background: #f7fbff; color: var(--ink); }
.experience-link span, .experience-link strong, .experience-link small { display: block; }
.experience-link span { font-size: 30px; }
.experience-link strong { margin: 8px 0 5px; }
.experience-link small { color: var(--muted); }

.qr-action { display: grid; justify-items: center; gap: 8px; margin-top: 22px; }
.qr-generate { min-height: 44px; padding-inline: 22px; }
.qr-generate span { font-size: 20px; }
.qr-action small { color: var(--muted); text-align: center; line-height: 1.5; }
.qr-modal { padding-top: 24px; }
.qr-modal > p { margin: 7px 0 14px; }
.qr-code { width: 236px; min-height: 236px; margin: 0 auto; padding: 8px; display: grid; place-items: center; border: 1px solid #d7e4ef; background: #fff; }
.qr-code canvas, .qr-code img { display: block; width: 220px !important; height: 220px !important; }
.qr-modal .qr-user { margin: 12px 0 4px; color: var(--deep-blue); font-weight: 800; }
.scanner-modal { width: min(100%, 390px); }
#qr-reader { width: 100%; min-height: 260px; overflow: hidden; border: 1px solid #d5e2ed !important; border-radius: 6px; background: #08111b; }
#qr-reader video { object-fit: cover; }
.scanner-status { min-height: 24px; margin: 12px 0 !important; color: var(--deep-blue) !important; font-weight: 700; }
.scanner-status.error { color: #c93439 !important; }
.scanner-modal .secondary-btn { width: 100%; }

.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 24px; background: rgba(4, 13, 22, .76); }
.modal { width: min(100%, 360px); padding: 28px 24px 22px; background: #fff; border-radius: 8px; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.modal-icon { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 46px; font-weight: 800; background: var(--cyan); }
.modal-icon.error { background: #d83e42; }
.modal h2 { color: #111; margin: 0 0 12px; }
.modal p { color: #3b4659; line-height: 1.6; }
.modal .primary-btn { width: 100%; margin-top: 12px; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.modal-actions button { width: 100%; }
.toast { position: fixed; z-index: 40; left: 50%; bottom: 24px; transform: translate(-50%, 20px); padding: 11px 18px; border-radius: 22px; color: #fff; background: rgba(15,24,38,.92); opacity: 0; pointer-events: none; transition: .2s ease; white-space: nowrap; max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.empty-state { text-align: center; padding: 45px 10px; color: var(--muted); }
.empty-state strong { display: block; color: var(--ink); font-size: 22px; margin-bottom: 8px; }

@media (min-width: 700px) {
  body { padding: 20px 0; }
  #app { min-height: calc(100dvh - 40px); border-radius: 8px; }
}
@media (max-width: 360px) {
  .page-body { padding-inline: 15px; }
  .title-ribbon, .page-title { font-size: 24px; }
  .hero { height: 220px; }
}
