:root { --brand: #d4780a; --dark: #3a2a1a; --light: #fff8ee; --line: #ecdcc6; --muted: #8a7a68; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; }
html, body { margin: 0; height: 100%; background: var(--light); color: var(--dark); font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif; overflow: hidden; }
#app { height: 100%; display: flex; flex-direction: column; }
button { font: inherit; color: inherit; border: none; cursor: pointer; }
.muted { color: var(--muted); }
.center { margin: auto; text-align: center; padding: 40px; font-size: 22px; }
.center h1 { font-size: 40px; margin-bottom: 16px; }

/* 顶栏 */
.top { display: flex; align-items: center; gap: 20px; padding: 18px 28px; background: var(--dark); color: #fff; }
.top .name { font-size: 30px; font-weight: bold; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .btn { background: rgba(255,255,255,.15); color: #fff; padding: 14px 26px; border-radius: 40px; font-size: 22px; }
.top .back { background: var(--brand); }

/* 搜索 */
.searchbar { display: flex; gap: 14px; padding: 20px 28px 10px; }
.searchbar input { flex: 1; font-size: 28px; padding: 18px 26px; border: 3px solid var(--brand); border-radius: 50px; outline: none; background: #fff; user-select: text; }
.searchbar button { background: var(--brand); color: #fff; font-size: 26px; padding: 0 36px; border-radius: 50px; }
.cats { display: flex; gap: 12px; padding: 8px 28px 14px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cat { background: #fff; border: 2px solid var(--line); padding: 12px 24px; border-radius: 40px; font-size: 22px; color: var(--dark); flex: none; }
.cat.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.hint { padding: 0 32px 8px; font-size: 20px; color: var(--muted); }

/* 列表 */
.list { flex: 1; overflow-y: auto; padding: 6px 28px 28px; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; align-content: start; grid-auto-rows: max-content; }
.card { display: flex; flex-direction: column; background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 2px 8px rgba(58,42,26,.08); text-align: left; padding: 0; }
.card .img { flex: none; height: 180px; background: #f3e8d8 center/cover no-repeat; }
.card .t { font-size: 24px; font-weight: bold; padding: 12px 16px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .s { font-size: 20px; color: var(--muted); padding: 0 16px 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .booth { color: var(--brand); font-weight: bold; }
.more { grid-column: 1 / -1; padding: 22px; font-size: 22px; background: #fff; border-radius: 16px; color: var(--brand); }
.empty { grid-column: 1 / -1; text-align: center; padding: 60px; font-size: 24px; color: var(--muted); }

/* 店铺页 */
.detail { flex: 1; overflow-y: auto; padding: 24px 28px; display: grid; grid-template-columns: 1fr 360px; gap: 28px; align-content: start; }
.detail .cover { width: 100%; height: 360px; border-radius: 20px; background: #f3e8d8 center/cover no-repeat; }
.detail h1 { font-size: 40px; margin: 18px 0 8px; }
.detail .meta { font-size: 24px; color: var(--muted); line-height: 1.7; }
.detail .meta b { color: var(--brand); }
.detail .tagline { font-size: 24px; margin: 12px 0; line-height: 1.6; }
.side { display: flex; flex-direction: column; gap: 18px; }
.qr { background: #fff; border-radius: 20px; padding: 22px; text-align: center; }
.qr img { width: 260px; height: 260px; }
.qr .q1 { font-size: 26px; font-weight: bold; margin-top: 8px; }
.qr .q2 { font-size: 20px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.bigbtn { background: var(--brand); color: #fff; font-size: 26px; padding: 22px; border-radius: 20px; }
.prods { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-top: 16px; }
.prod { background: #fff; border-radius: 14px; overflow: hidden; }
.prod .img { height: 150px; background: #f3e8d8 center/cover no-repeat; }
.prod .t { font-size: 20px; padding: 8px 12px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod .p { font-size: 20px; color: #c0392b; padding: 0 12px 10px; }
.sec { font-size: 26px; font-weight: bold; margin-top: 26px; }

/* 方位图 */
.mapwrap { flex: 1; position: relative; overflow: hidden; background: #f5efe5; touch-action: none; }
.mapwrap canvas { position: absolute; left: 0; top: 0; }
.maptools { position: absolute; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 12px; }
.maptools button { width: 72px; height: 72px; border-radius: 50%; background: #fff; font-size: 36px; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.legend { position: absolute; left: 24px; bottom: 24px; background: rgba(255,255,255,.92); padding: 12px 18px; border-radius: 14px; font-size: 20px; line-height: 1.8; }
.legend i { display: inline-block; width: 18px; height: 18px; border-radius: 4px; vertical-align: -3px; margin-right: 6px; }
.floors { display: flex; gap: 10px; padding: 12px 28px; }
.pop { position: absolute; left: 50%; top: 24px; transform: translateX(-50%); background: #fff; border-radius: 18px; padding: 16px 24px; box-shadow: 0 4px 16px rgba(0,0,0,.18); font-size: 24px; display: flex; gap: 18px; align-items: center; }
.pop button { background: var(--brand); color: #fff; padding: 12px 22px; border-radius: 30px; font-size: 22px; }

/* 数字键盘（摊位号） */
.pad { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; padding: 0 28px 14px; }
.pad button { background: #fff; border: 2px solid var(--line); font-size: 28px; padding: 14px 0; border-radius: 14px; }

/* 绑定 / 暂停 */
.bind { margin: auto; text-align: center; }
.bind h1 { font-size: 40px; }
.bind .code { font-size: 64px; letter-spacing: 18px; height: 96px; border-bottom: 4px solid var(--brand); width: 420px; margin: 20px auto; }
.bind .err { color: #c0392b; font-size: 22px; height: 30px; }
.bind .pad { width: 520px; margin: 0 auto; grid-template-columns: repeat(3, 1fr); padding: 0; }
.bind .pad button { font-size: 40px; padding: 18px 0; }

/* 待机 */
.idle { position: fixed; inset: 0; background: var(--dark); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 50; text-align: center; }
.idle .m { font-size: 64px; font-weight: bold; }
.idle .s { font-size: 32px; margin-top: 24px; color: #f2b45c; }
.idle .tap { margin-top: 70px; font-size: 30px; padding: 26px 60px; border-radius: 60px; background: var(--brand); animation: pulse 2s infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }

/* ===== 以方位图为主（2026-11-02 Tommy 定） ===== */
.main { flex: 1; display: flex; min-height: 0; }
.panel { width: 420px; flex: none; display: flex; flex-direction: column; background: #fff; border-right: 2px solid var(--line); min-height: 0; }
.panel .searchbar { padding: 18px 18px 10px; gap: 10px; }
.panel .searchbar input { font-size: 24px; padding: 14px 20px; min-width: 0; }
.panel .searchbar button { font-size: 22px; padding: 0 20px; }
.panel .searchbar .ghost { background: #fff; color: var(--brand); border: 3px solid var(--brand); }
.panel .pad { grid-template-columns: repeat(4, 1fr); padding: 0 18px 10px; }
.panel .pad button { font-size: 24px; padding: 12px 0; }
.panel .cats { flex-wrap: wrap; white-space: normal; overflow: visible; padding: 4px 18px 10px; gap: 8px; }
.panel .cat { font-size: 19px; padding: 8px 16px; }
.panel .hint { padding: 4px 22px 8px; }
.results { flex: 1; overflow-y: auto; padding: 0 12px 12px; }
.results .empty { padding: 50px 16px; line-height: 1.9; font-size: 22px; text-align: center; color: var(--dark); }
.row { display: block; width: 100%; text-align: left; background: #fff; border-bottom: 1px solid var(--line); padding: 14px 12px; }
.row.on { background: #fff1de; border-left: 6px solid #c0392b; }
.row .t { font-size: 23px; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { font-size: 19px; margin-top: 4px; }
.row .booth { color: var(--brand); font-weight: bold; }
.top .cat.sm { background: rgba(255,255,255,.15); border: none; color: #fff; font-size: 22px; }
.top .cat.sm.on { background: var(--brand); }
.maptools .txt { font-size: 22px; }
#card { position: absolute; left: 20px; right: 120px; top: 20px; pointer-events: none; }
.card2 { pointer-events: auto; display: flex; gap: 18px; align-items: center; background: #fff; border-radius: 20px; padding: 16px; box-shadow: 0 6px 22px rgba(0,0,0,.18); max-width: 760px; }
.card2 .img { width: 120px; height: 120px; flex: none; border-radius: 14px; background: #f3e8d8 center/cover no-repeat; }
.card2 .info { flex: 1; min-width: 0; }
.card2 .t { font-size: 28px; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card2 .s { font-size: 20px; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card2 .s b { color: var(--brand); }
.card2 .walk { font-size: 22px; color: #1e88e5; font-weight: bold; margin-top: 6px; }
.card2 .acts { display: flex; flex-direction: column; gap: 10px; flex: none; }
.card2 .acts button { font-size: 21px; padding: 14px 20px; border-radius: 30px; background: #f3ece2; }
.card2 .acts .pri { background: var(--brand); color: #fff; }
.toast { position: absolute; left: 50%; top: 40%; transform: translateX(-50%); background: rgba(58,42,26,.9); color: #fff; padding: 16px 30px; border-radius: 30px; font-size: 24px; }
.overlay { position: fixed; inset: 0; background: var(--light); z-index: 40; display: flex; flex-direction: column; }
/* 竖屏（立式广告机 1080×1920，2026-11-02）：屏幕上沿离地近 2 米，顾客够不着上半部分——
   上面大半是方位图（只看不用点），搜索、品类、结果放在下面手边；结果横排一行左右滑，不挤占图；选中卡片浮在图底部 */
@media (orientation: portrait) {
  .main { flex-direction: column-reverse; }
  .panel { width: auto; flex: none; border-right: none; border-top: 3px solid var(--line); padding-bottom: 18px; }
  .panel .searchbar { padding: 20px 24px 10px; }
  .panel .searchbar input { font-size: 30px; padding: 20px 26px; }
  .panel .searchbar button { font-size: 26px; padding: 0 30px; }
  .panel .pad { grid-template-columns: repeat(8, 1fr); padding: 0 24px 10px; }
  .panel .cats { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; padding: 4px 24px 10px; }
  .panel .cat { font-size: 22px; padding: 12px 22px; }
  .results { flex: none; display: flex; gap: 14px; overflow-x: auto; overflow-y: hidden; padding: 4px 24px 6px; }
  .results .row { flex: none; width: 300px; border: 2px solid var(--line); border-radius: 16px; padding: 16px; }
  .results .row.on { border: 3px solid #c0392b; border-left-width: 3px; }
  .results .empty { width: 100%; padding: 16px; font-size: 22px; line-height: 1.7; }
  .results .empty br { display: none; }
  #card { top: auto; bottom: 20px; right: 110px; }
  .legend { top: 20px; bottom: auto; }
  .detail { grid-template-columns: 1fr; }
  .detail .side { flex-direction: row; }
  .detail .side .qr { flex: 1; }
  .detail .side .bigbtn { flex: 1; align-self: center; }
  .idle .tap { margin-top: 0; position: absolute; bottom: 260px; }
}
