/* ===== 客户预览外壳与桌面布局 ===== */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #0A0C0A;
  color: #F2F4EF;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  overflow: hidden;
}

.preview-layout {
  width: 100%;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  padding: 20px 28px;
  background:
    radial-gradient(circle at 22% 18%, rgba(61, 220, 132, 0.08), transparent 40%),
    radial-gradient(circle at 80% 85%, rgba(61, 220, 132, 0.05), transparent 45%),
    #0A0C0A;
}

/* 手机真机外壳（桌面端） */
.device-column {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  flex: none;
}

.phone-frame {
  --screen-w: 390px;
  --rpx: calc(var(--screen-w) / 750);
  position: relative;
  width: calc(var(--screen-w) + 20px);
  height: min(864px, calc(100dvh - 32px));
  padding: 10px;
  border-radius: 50px;
  background: linear-gradient(145deg, #252924 0%, #161815 100%);
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.72),
    0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
}

.phone-notch {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 112px;
  height: 26px;
  border-radius: 16px;
  background: #080908;
  z-index: 60;
  pointer-events: none;
}

.phone-home-bar {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 126px;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.28);
  z-index: 60;
  pointer-events: none;
}

.wx-viewport {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  border-radius: 40px;
  overflow: hidden;
  background: #111311;
  display: flex;
  flex-direction: column;
  transform: translateZ(0);
}

/* 状态栏 */
.wx-statusbar {
  height: 44px;
  padding: 0 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: #F2F4EF;
  background: #111311;
  flex: none;
  user-select: none;
}
.sb-icons { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.sb-signal { display: inline-flex; align-items: flex-end; gap: 2px; height: 10px; }
.sb-signal i { width: 2.5px; border-radius: 1px; background: #F2F4EF; display: block; }
.sb-signal i:nth-child(1) { height: 4px; }
.sb-signal i:nth-child(2) { height: 6px; }
.sb-signal i:nth-child(3) { height: 8px; }
.sb-signal i:nth-child(4) { height: 10px; }
.sb-bat {
  width: 22px; height: 11px; border: 1.5px solid rgba(242,244,239,0.75); border-radius: 3px;
  padding: 1.5px; display: inline-flex; position: relative;
}
.sb-bat::after {
  content: ''; position: absolute; right: -3.5px; top: 2.5px; width: 2px; height: 4px;
  background: rgba(242,244,239,0.75); border-radius: 0 1px 1px 0;
}
.sb-bat b { display: block; width: 82%; height: 100%; background: #3DDC84; border-radius: 1px; }

/* 微信顶部导航栏 */
.wx-navbar {
  height: 44px;
  padding: 0 10px;
  background: #111311;
  color: #F2F4EF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  position: relative;
  z-index: 40;
  user-select: none;
  border-bottom: 1px solid rgba(42, 45, 39, 0.65);
}

.wx-nav-left, .wx-nav-right {
  width: 96px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.wx-nav-right { justify-content: flex-end; }

.wx-nav-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #F2F4EF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.wx-nav-btn:active { background: rgba(255,255,255,0.08); }

.wx-nav-title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wx-capsule {
  height: 30px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
}
.wx-cap-btn {
  width: 34px;
  height: 28px;
  border: 0;
  background: transparent;
  color: #F2F4EF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.wx-cap-btn:active { opacity: 0.65; }
.wx-cap-sep { width: 1px; height: 14px; background: rgba(255, 255, 255, 0.18); }

/* 页面内容区（作为页面内 position:fixed 元素的包含块） */
.wx-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #111311;
  transform: translateZ(0);
}

.wx-page {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: #111311;
  scrollbar-width: none;
}
.wx-page::-webkit-scrollbar { display: none; width: 0; height: 0; }
.wx-page.wx-page-hidden { display: none; }

/* 下拉刷新提示条 */
.wx-ptr-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 0;
  overflow: hidden;
  font-size: 12px;
  color: #A9AFA4;
  background: #111311;
  transition: height 0.2s ease;
}
.wx-ptr-bar.active { height: 42px; }
.wx-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(61, 220, 132, 0.25);
  border-top-color: #3DDC84;
  animation: wxSpin 0.7s linear infinite;
}
@keyframes wxSpin { to { transform: rotate(360deg); } }

/* 底部 TabBar */
.wx-tabbar {
  height: 64px;
  padding-bottom: 10px;
  background: #111311;
  border-top: 1px solid #232620;
  display: flex;
  align-items: center;
  flex: none;
  z-index: 40;
  user-select: none;
}
.wx-tabbar.hidden { display: none; }
.wx-tab-item {
  flex: 1;
  height: 100%;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #7D8378;
  font-size: 11px;
  cursor: pointer;
  padding: 4px 0 0;
}
.wx-tab-item.active { color: #3DDC84; font-weight: 600; }
.wx-tab-item img { width: 24px; height: 24px; object-fit: contain; display: block; }

/* ===== 小程序自定义标签基础样式 ===== */
wx-view { display: block; box-sizing: border-box; }
wx-text { display: inline; box-sizing: border-box; }
wx-scroll-view { display: block; box-sizing: border-box; scrollbar-width: none; }
wx-scroll-view::-webkit-scrollbar { display: none; width: 0; height: 0; }
wx-scroll-view[scroll-y] { overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
wx-scroll-view[scroll-x] { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
wx-picker { display: block; cursor: pointer; }
img.wx-image { display: inline-block; vertical-align: middle; border: 0; max-width: none; }
img.wx-image.mode-aspectFill { object-fit: cover; }
img.wx-image.mode-aspectFit { object-fit: contain; }
img.wx-image.mode-scaleToFill { object-fit: fill; }

button.wx-button {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  text-align: inherit;
  line-height: inherit;
  cursor: pointer;
}
input.wx-input, textarea.wx-textarea {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  outline: none;
  background: transparent;
  color: inherit;
  font: inherit;
  width: 100%;
}
input.wx-input::placeholder, textarea.wx-textarea::placeholder { color: #7D8378; }

/* Switch 开关 */
wx-switch {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex: none;
}
.wx-switch-track {
  width: 46px;
  height: 28px;
  border-radius: 14px;
  background: #3A3E36;
  padding: 2px;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
}
wx-switch.checked .wx-switch-track { background: #3DDC84; }
.wx-switch-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
wx-switch.checked .wx-switch-thumb { transform: translateX(18px); }

/* Swiper 轮播 */
wx-swiper {
  display: block;
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
}
.wx-swiper-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
wx-swiper-item {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: block;
  overflow: hidden;
}
.wx-swiper-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  z-index: 5;
}
.wx-swiper-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.2s;
}
.wx-swiper-dot.active {
  width: 16px;
  border-radius: 4px;
  background: #3DDC84;
}

/* Movable Area / View（地图缩放拖动） */
wx-movable-area {
  display: block;
  position: relative;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}
wx-movable-view {
  display: block;
  position: relative;
  transform-origin: center center;
  cursor: grab;
  will-change: transform;
}
wx-movable-view:active { cursor: grabbing; }

/* 修复二维码 25x25 网格亚像素折行问题 */
.wx-page[data-page="pages/reservation/index"] .qr {
  display: grid !important;
  grid-template-columns: repeat(25, 1fr) !important;
  grid-template-rows: repeat(25, 1fr) !important;
}
.wx-page[data-page="pages/reservation/index"] .qc {
  width: auto !important;
  height: auto !important;
}

/* 底部操作栏避开桌面手机壳 Home Bar 并增加毛玻璃质感 */
@media (min-width: 861px) {
  .wx-screen .bottom-bar {
    padding-bottom: calc(calc(20 * var(--rpx)) + 18px) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
}

/* ===== 微信系统级原生弹层（Toast / Modal / ActionSheet / Picker） ===== */
.wx-overlay-root {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 100;
}
.wx-toast {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  max-width: 78%;
  padding: 12px 18px;
  border-radius: 12px;
  background: rgba(28, 31, 27, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #F2F4EF;
  font-size: 14px;
  text-align: center;
  line-height: 1.45;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.48);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  animation: wxFadeIn 0.15s ease;
}
.wx-toast.with-icon { min-width: 126px; padding: 18px 20px; }
.wx-toast-check {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(61, 220, 132, 0.16); color: #3DDC84;
  display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700;
}

.wx-sys-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: wxFadeIn 0.16s ease;
}
.wx-sys-mask.bottom { align-items: flex-end; }

.wx-modal {
  width: 82%;
  max-width: 320px;
  background: #1C1F1B;
  border: 1px solid #2D3129;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}
.wx-modal-body { padding: 24px 20px 20px; text-align: center; }
.wx-modal-title { font-size: 16px; font-weight: 700; color: #F2F4EF; margin-bottom: 10px; }
.wx-modal-content { font-size: 14px; color: #A9AFA4; line-height: 1.65; white-space: pre-line; }
.wx-modal-footer { display: flex; border-top: 1px solid #2A2D27; }
.wx-modal-btn {
  flex: 1; height: 48px; border: 0; background: transparent;
  font-size: 15px; font-weight: 600; color: #A9AFA4; cursor: pointer;
}
.wx-modal-btn + .wx-modal-btn { border-left: 1px solid #2A2D27; }
.wx-modal-btn.confirm { color: #3DDC84; }
.wx-modal-btn:active { background: rgba(255, 255, 255, 0.05); }

.wx-actionsheet {
  width: 100%;
  background: #181B17;
  border-radius: 18px 18px 0 0;
  overflow: hidden;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  animation: wxSlideUp 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.wx-as-alert {
  padding: 14px 16px;
  text-align: center;
  font-size: 12px;
  color: #7D8378;
  border-bottom: 1px solid #2A2D27;
}
.wx-as-item {
  width: 100%;
  height: 54px;
  border: 0;
  background: #1C1F1B;
  color: #F2F4EF;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #262923;
}
.wx-as-item:active { background: #262923; }
.wx-as-cancel {
  margin-top: 8px;
  width: 100%;
  height: 54px;
  border: 0;
  background: #1C1F1B;
  color: #A9AFA4;
  font-size: 16px;
  cursor: pointer;
}

.wx-picker-sheet {
  width: 100%;
  background: #1C1F1B;
  border-radius: 18px 18px 0 0;
  padding: 16px 20px max(20px, env(safe-area-inset-bottom));
  animation: wxSlideUp 0.2s ease;
}
.wx-picker-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; font-size: 15px; font-weight: 600;
}
.wx-picker-head button {
  border: 0; background: transparent; font-size: 15px; cursor: pointer; padding: 4px 8px;
}
.wx-picker-native {
  width: 100%;
  height: 46px;
  border-radius: 10px;
  border: 1px solid #3A3E36;
  background: #262923;
  color: #F2F4EF;
  padding: 0 14px;
  font-size: 16px;
  color-scheme: dark;
}
.wx-picker-opt {
  width: 100%;
  padding: 14px 12px;
  border: 0;
  border-bottom: 1px solid #2A2D27;
  background: transparent;
  color: #F2F4EF;
  font-size: 15px;
  text-align: center;
  cursor: pointer;
}
.wx-picker-opt.selected { color: #3DDC84; font-weight: 700; }

@keyframes wxFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes wxSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ===== 右侧客户预览控制台 ===== */
.inspector-panel {
  width: 390px;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #2A2D27 transparent;
}
.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.panel-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #111311;
  background: #3DDC84;
  padding: 3px 9px;
  border-radius: 99px;
  margin-bottom: 8px;
}
.panel-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: #F2F4EF;
}
.panel-sub {
  margin: 5px 0 0;
  font-size: 13px;
  color: #8F9689;
  line-height: 1.5;
}
.panel-close-mobile {
  display: none;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid #3A3E36; background: #1C1F1B; color: #F2F4EF; cursor: pointer;
}

.panel-card {
  background: #151814;
  border: 1px solid #262A23;
  border-radius: 16px;
  padding: 15px;
}
.panel-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: #E2E6DE;
  margin-bottom: 10px;
}
.status-dot {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 99px;
  background: #262923;
  color: #A9AFA4;
}
.status-dot.on { background: #173A26; color: #3DDC84; }
.meta-tag {
  font-size: 11px;
  color: #7D8378;
  font-weight: 500;
  font-family: ui-monospace, Menlo, monospace;
}

.tips-list {
  margin: 0 0 12px;
  padding-left: 16px;
  font-size: 12px;
  color: #A9AFA4;
  line-height: 1.65;
}
.tips-list li + li { margin-top: 4px; }
.tips-list strong { color: #F2F4EF; }
.tips-list code {
  background: #262923;
  color: #3DDC84;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
}

.panel-actions {
  display: flex;
  gap: 8px;
}
.p-btn {
  flex: 1;
  height: 36px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  border: 0;
  transition: opacity 0.15s, background 0.15s;
}
.p-btn.full { width: 100%; }
.p-btn.primary { background: #3DDC84; color: #111311; }
.p-btn.ghost { background: #22261F; color: #F2F4EF; border: 1px solid #353931; }
.p-btn:hover { opacity: 0.9; }

.figma-thumb-wrap {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #2A2D27;
  background: #E5E5E5;
  cursor: zoom-in;
}
.figma-thumb { width: 100%; height: 152px; object-fit: cover; display: block; }
.figma-thumb-hint {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 6px 10px;
  background: linear-gradient(transparent, rgba(17, 19, 17, 0.85));
  font-size: 11px; color: #F2F4EF; text-align: center;
}

.route-groups { display: flex; flex-direction: column; gap: 10px; }
.route-group-title { font-size: 11px; color: #7D8378; margin-bottom: 6px; }
.route-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.route-pill {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid #2B3028;
  background: #1C1F1B;
  color: #C7CCC2;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.route-pill:hover { border-color: #3DDC84; color: #F2F4EF; }
.route-pill.active { background: #173A26; border-color: #3DDC84; color: #3DDC84; font-weight: 700; }

/* Figma 大图 Lightbox */
.lightbox[hidden] { display: none; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.82); }
.lightbox-box {
  position: relative;
  z-index: 1;
  max-width: 960px;
  width: 100%;
  max-height: 90dvh;
  background: #181B17;
  border: 1px solid #30352D;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.lightbox-top {
  padding: 12px 16px;
  border-bottom: 1px solid #2A2D27;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
}
.lightbox-close {
  border: 1px solid #3A3E36; background: #262923; color: #F2F4EF;
  padding: 4px 12px; border-radius: 8px; cursor: pointer; font-size: 12px;
}
.lightbox-body { padding: 16px; overflow: auto; background: #E5E5E5; text-align: center; }
.lightbox-body img { max-width: 100%; height: auto; border-radius: 8px; }

/* ===== 手机真机 / 窄屏模式（≤ 860px）：全屏原生小程序体验 ===== */
@media (max-width: 860px) {
  .preview-layout {
    padding: 0;
    gap: 0;
    background: #111311;
  }
  .device-column { width: 100%; height: 100%; }
  .phone-frame {
    --screen-w: 100vw;
    --rpx: calc(100vw / 750);
    width: 100%;
    height: 100%;
    padding: 0;
    border-radius: 0;
    background: #111311;
    box-shadow: none;
  }
  .phone-notch, .phone-home-bar, .wx-statusbar { display: none; }
  .wx-viewport { border-radius: 0; }
  .wx-navbar { padding-top: env(safe-area-inset-top); height: calc(44px + env(safe-area-inset-top)); }
  .wx-tabbar { height: calc(56px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); }

  /* 控制台变成可展开抽屉 */
  .inspector-panel {
    position: fixed;
    inset: 0;
    width: 100%;
    max-height: 100dvh;
    background: #0E100E;
    z-index: 200;
    padding: 18px 16px 32px;
    transform: translateY(100%);
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: none;
  }
  .inspector-panel.open {
    transform: translateY(0);
    pointer-events: auto;
  }
  .panel-close-mobile { display: inline-flex; align-items: center; justify-content: center; }
}
