/* ============================================================
   网页版外壳：导航栏、弹层、桌面限宽
   页面内部的版式全部由 miniprogram/*.wxss 提供，这里只管
   小程序里「由微信框架提供、网页需要自己补」的那一层。
   ============================================================ */

:root {
  --nav-h: 46px;
  --frame-max: 430px;
  --shell-bg: #060608;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--shell-bg);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  color: #f4f4f7;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

#app-root {
  min-height: 100vh;
  background: var(--bg, #0b0b10);
  padding-top: env(safe-area-inset-top);
  max-width: var(--frame-max);
  margin: 0 auto;
  position: relative;
}

#app-root.has-top-nav {
  padding-top: calc(var(--nav-h) + env(safe-area-inset-top));
}

/* 手机内容和固定操作栏使用相同宽度。 */
#page > .page, #page > .action-bar { max-width: var(--frame-max); }

#page .customer-overlay { z-index: 90; }
#page .customer-dialog { max-height: 90dvh; }

/* 手机视口铺满屏幕，导航、页签和固定操作栏共享这一宽度。 */
@media (max-width: 767px) {
  :root { --frame-max: 100vw; }
  #app-root { box-shadow: none; }
}

@media (min-width: 768px) {
  body { background: #08080b; }
  #app-root {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .05), 0 20px 80px rgba(0, 0, 0, .6);
  }
}

/* ------------------------------------------------ 顶部导航栏 */
#nav {
  position: fixed;
  z-index: 60;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--frame-max);
  height: calc(var(--nav-h) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  display: flex;
  align-items: center;
  background: rgba(11, 11, 16, .88);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

#nav[hidden] { display: none; }

#nav-back {
  position: absolute;
  left: 4px;
  bottom: 0;
  width: 44px;
  height: var(--nav-h);
  border: 0;
  background: transparent;
  color: #f4f4f7;
  font-size: 30px;
  line-height: 1;
  padding: 0 0 4px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
}
#nav-back.on { opacity: .9; pointer-events: auto; }
#nav-back:active { opacity: .5; }

#nav-title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .02em;
  padding: 0 44px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ------------------------------------------------ 自定义 tabBar 容器 */
#tabbar {
  position: fixed;
  z-index: 60;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: var(--frame-max);
  margin: 0 auto;
  pointer-events: none;
}
#tabbar > * { pointer-events: auto; }
/* .tb 本身是 fixed，会以 #tabbar 为包含块；这里退回普通流，让容器撑出正确高度。
   同时把底色压到接近不透明：网页里内容会从底下滚过，4% 透光能看见文字 */
#tabbar .tb {
  position: static;
  background: rgba(16, 16, 22, .985);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
#tabbar[hidden] { display: none; }

/* ------------------------------------------------ 弹层 */
#ui-root { position: relative; z-index: 200; }

.wx-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .55);
  opacity: 0;
  transition: opacity .18s ease;
}
.wx-mask.is-open { opacity: 1; }

.wx-toast {
  position: fixed;
  z-index: 300;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(.94);
  max-width: 76vw;
  padding: 14px 20px;
  border-radius: 12px;
  background: rgba(24, 24, 32, .94);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
  color: #f4f4f7;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  white-space: pre-line;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s, transform .16s;
}
.wx-toast.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.wx-modal {
  width: min(320px, 84vw);
  border-radius: 16px;
  background: #1b1b24;
  border: 1px solid rgba(255, 255, 255, .08);
  overflow: hidden;
  transform: translateY(4px) scale(.98);
  transition: transform .18s ease;
}
.wx-mask.is-open .wx-modal { transform: none; }

.wx-modal-title {
  padding: 22px 22px 6px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}
.wx-modal-content {
  padding: 10px 22px 22px;
  font-size: 14px;
  line-height: 1.65;
  color: #b9b9c6;
  text-align: center;
  white-space: pre-line;
  max-height: 46vh;
  overflow: auto;
}
.wx-modal-input {
  display: block;
  width: calc(100% - 44px);
  margin: 4px 22px 22px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: #26262f;
  color: #f4f4f7;
  font-size: 15px;
  outline: none;
}
.wx-modal-btns {
  display: flex;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.wx-modal-btn {
  flex: 1;
  padding: 15px 8px;
  text-align: center;
  font-size: 15px;
  color: #a5a5b3;
  cursor: pointer;
  user-select: none;
}
.wx-modal-btn + .wx-modal-btn { border-left: 1px solid rgba(255, 255, 255, .08); }
.wx-modal-btn:active { background: rgba(255, 255, 255, .04); }
.wx-modal-btn.is-primary { color: #ff5b5b; font-weight: 600; }

.wx-mask.is-sheet { align-items: flex-end; }
.wx-sheet {
  width: 100%;
  max-width: var(--frame-max);
  margin: 0 auto;
  padding-bottom: env(safe-area-inset-bottom);
  background: #141419;
  border-radius: 18px 18px 0 0;
  overflow: hidden;
  transform: translateY(16px);
  transition: transform .2s ease;
}
.wx-mask.is-open .wx-sheet { transform: none; }
.wx-sheet-item {
  padding: 16px;
  text-align: center;
  font-size: 15px;
  color: #d9d9e0;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  cursor: pointer;
}
.wx-sheet-item:active { background: rgba(255, 255, 255, .05); }
.wx-sheet-item.is-cancel { color: #8e8e9c; border-bottom: 0; margin-top: 6px; }

.wx-loading-mask { background: rgba(0, 0, 0, .35); }
.wx-spin {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .18);
  border-top-color: #ff5b5b;
  animation: wx-spin .8s linear infinite;
}
@keyframes wx-spin { to { transform: rotate(360deg); } }
.wx-loading-txt {
  margin-top: 10px;
  font-size: 13px;
  color: #c9c9d4;
}

/* ------------------------------------------------ 表单控件贴合深色 */
/* 小程序的 input/button 没有浏览器默认外观，这里把 UA 样式清掉 */
input, textarea, button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
input, textarea, select {
  color-scheme: dark;
}
input::placeholder, textarea::placeholder { color: rgba(255, 255, 255, .28); }

/* picker 的透明原生控件盖在字段上 */
.wx-picker { position: relative; display: block; }
.wx-picker > input[type="date"],
.wx-picker > input[type="time"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

/* 加载失败提示 */
#boot-error {
  position: fixed;
  z-index: 400;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, 88vw);
  padding: 18px 20px;
  border-radius: 14px;
  background: #2a1418;
  border: 1px solid rgba(255, 91, 91, .35);
  color: #ffd7d7;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* 桌面端提示（很轻，只在小屏以上出现） */
@media (min-width: 900px) {
  #app-root::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(120% 90% at 50% 0%, transparent 55%, rgba(0, 0, 0, .35));
  }
}

.club-mobile #app-root { background: var(--club-bg); }
.club-mobile #nav { background: rgba(16, 16, 21, .97); }
.club-mobile #nav-title { color: var(--club-fg); font-weight: 650; }
.club-mobile #tabbar .tb { background: rgba(22, 22, 28, .98); }
.club-mobile .wx-modal { background: var(--club-panel); border-color: var(--club-line); }
.club-mobile .wx-modal-content { color: var(--club-copy); }
.club-mobile .wx-modal-btn { color: var(--club-muted); }
.club-mobile .wx-modal-btn.is-primary { color: var(--club-accent-text); }
.club-mobile:has(.customer-overlay), .club-mobile:has(.wx-mask.is-open) { overflow: hidden; }
.club-mobile .customer-dialog { overscroll-behavior: contain; }
.club-mobile button:focus-visible, .club-mobile input:focus-visible {
  outline: 2px solid var(--club-accent-text);
  outline-offset: -3px;
}
@media (prefers-reduced-motion: reduce) {
  .club-mobile .wx-modal, .club-mobile .wx-mask, .club-mobile .tb-ico { transition: none; }
}

/* 顾客端页签与到店取餐页面 */
#app-root.customer-journey {
  --customer-tabs-height: 58px;
  background: #f7f4ed;
}

#app-root.customer-journey::after { content: none; }
#app-root.food-channel { background: #fffdf8; }

#app-root.food-channel #nav {
  background: #fffdf8;
  border-bottom-color: #ebe7de;
}

#app-root.food-channel #nav-back,
#app-root.food-channel #nav-title { color: #252c27; }
#app-root.food-channel #nav-back { font-size: 0; }
#app-root.food-channel #nav-back::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  border: solid currentColor;
  border-width: 0 0 1.5px 1.5px;
  transform: rotate(45deg);
}

.customer-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-height: calc(var(--customer-tabs-height) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid #ebe7de;
  background: #fffdf8;
}

.customer-tabs .customer-tab {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  min-height: calc(var(--customer-tabs-height) - 1px);
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 5px 0 4px;
  background: transparent;
  color: #546258;
  font-weight: 500;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.1;
  cursor: pointer;
}

.customer-tabs .customer-tab[aria-current="page"] {
  color: #1e4136;
  font-weight: 700;
}

.club-mobile .customer-tab:focus-visible { outline-color: #537562; }

.customer-tab-icon {
  position: relative;
  display: block;
  width: 36px;
  height: 25px;
}

.customer-tab-icon::before,
.customer-tab-icon::after {
  position: absolute;
  content: "";
}

.customer-tab-icon.is-cup::before {
  top: 7px;
  left: 11px;
  width: 13px;
  height: 13px;
  border: 1.5px solid;
  border-radius: 2px 2px 4px 4px;
}

.customer-tab-icon.is-cup::after {
  top: 9px;
  left: 24px;
  width: 5px;
  height: 7px;
  border: 1.5px solid;
  border-left: 0;
  border-radius: 0 4px 4px 0;
}

.customer-tab-icon.is-bag::before {
  top: 9px;
  left: 10px;
  width: 16px;
  height: 12px;
  border: 1.5px solid;
  border-radius: 3px;
}

.customer-tab-icon.is-bag::after {
  top: 5px;
  left: 14px;
  width: 8px;
  height: 7px;
  border: 1.5px solid;
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
}

.customer-tab-icon.is-person::before {
  top: 4px;
  left: 14px;
  width: 7px;
  height: 7px;
  border: 1.5px solid;
  border-radius: 50%;
}

.customer-tab-icon.is-person::after {
  top: 14px;
  left: 10px;
  width: 15px;
  height: 7px;
  border: 1.5px solid;
  border-radius: 7px 7px 3px 3px;
}
