/* web-shell.css —— Web 版外壳与小程序基础组件默认样式（页面自身样式在 webapp-payload.js 内按页作用域注入） */

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: #2b2f38;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  overflow: hidden;
}
body.wx-mobile { background: #fff; }

/* ===== 手机屏容器（内部固定 375px 逻辑宽，rpx÷2） ===== */
.wx-screen {
  position: relative;
  width: 375px;
  margin: 0 auto;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-size: 16px;
  color: #000;
  box-shadow: 0 0 40px rgba(0,0,0,.45);
  /* 恒为 position:fixed 后代的包含块：页面 wxss 里的 input-bar/浮层(fixed)
     必须锚定 375px 逻辑屏而非浏览器窗口（桌面端无 scale 时曾横跨全窗口）。
     移动端 fitScreen 的行内 scale 会覆盖此值，行为不变。 */
  transform: translateZ(0);
}
body.wx-mobile .wx-screen { box-shadow: none; }

/* ===== 导航栏 ===== */
.wx-navbar {
  position: relative;
  flex: 0 0 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  z-index: 500;
  border-bottom: .5px solid rgba(0,0,0,.04);
}
.wx-nav-back {
  position: absolute;
  left: 0; top: 0;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; line-height: 1;
  cursor: pointer;
  visibility: hidden;
}
.wx-nav-title {
  max-width: 60%;
  font-size: 17px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wx-nav-right { position: absolute; right: 10px; top: 0; height: 44px; display: flex; align-items: center; gap: 12px; }
.wx-nav-new-conv {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: #576b95;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}
.wx-nav-new-conv:hover { background: rgba(87,107,149,0.1); }
.wx-nav-new-conv:active { background: rgba(87,107,149,0.2); }
.wx-conn-dot { width: 8px; height: 8px; border-radius: 50%; background: #f0a020; display: inline-block; }
.wx-conn-dot.ok { background: #2fbf6b; }
.wx-conn-dot.err { background: #e64340; }

/* ===== 页面区 ===== */
.wx-pages { flex: 1 1 auto; position: relative; overflow: hidden; }
.wx-page {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: #f8f9fa;
}
.wx-page::-webkit-scrollbar { width: 0; height: 0; }

/* ===== tabBar ===== */
.wx-tabbar {
  flex: 0 0 52px;
  height: 52px;
  display: flex;
  border-top: .5px solid rgba(0,0,0,.08);
  z-index: 500;
  background: #fff;
}
.wx-tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  user-select: none;
}
.wx-tab-item img { width: 24px; height: 24px; display: block; }
.wx-tab-text { font-size: 10px; line-height: 1.2; }

/* ===== 小程序基础组件默认样式 ===== */
.wx-screen div, .wx-screen span, .wx-screen img, .wx-screen input, .wx-screen textarea, .wx-screen button { box-sizing: border-box; }

/* ===== 全局客服悬浮按钮 ===== */
/* 默认隐藏；离开进入页（splash）后由 JS 加 .fab-visible 类才显示 */
.customer-service-fab {
  position: absolute;
  right: 16px;
  bottom: 70px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}
.customer-service-fab.fab-visible {
  display: flex;
}
.customer-service-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}
.customer-service-fab:active {
  transform: translateY(0);
}
.customer-service-fab svg {
  width: 24px;
  height: 24px;
  fill: #fff;
}

/* ===== 客服面板遮罩 ===== */
.customer-service-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9100;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.customer-service-overlay.show {
  display: block;
  opacity: 1;
}

/* ===== 客服面板 ===== */
.customer-service-panel {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 90%;
  max-width: 420px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
  z-index: 9200;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
.customer-service-panel.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}
.customer-service-header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.customer-service-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin: 0;
}
.customer-service-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  color: #999;
  font-size: 24px;
  line-height: 1;
}
.customer-service-close:hover {
  background: #f5f5f5;
  color: #666;
}
.customer-service-body {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
}
.customer-service-section {
  margin-bottom: 20px;
}
.customer-service-section:last-child {
  margin-bottom: 0;
}
.customer-service-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #666;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.customer-service-section-title svg {
  width: 16px;
  height: 16px;
  fill: #667eea;
}
.customer-service-item {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s;
  cursor: pointer;
}
.customer-service-item:hover {
  background: #e9ecef;
  transform: translateX(2px);
}
.customer-service-item-content {
  flex: 1;
}
.customer-service-item-label {
  font-size: 13px;
  color: #999;
  margin-bottom: 4px;
}
.customer-service-item-value {
  font-size: 15px;
  color: #333;
  font-weight: 500;
}
.customer-service-item-action {
  font-size: 12px;
  color: #667eea;
  font-weight: 500;
  white-space: nowrap;
}
.customer-service-context {
  background: #fff9e6;
  border: 1px solid #ffe58f;
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
  color: #666;
  line-height: 1.6;
}
.customer-service-context-title {
  font-weight: 600;
  color: #d48806;
  margin-bottom: 6px;
}
.customer-service-footer {
  padding: 16px 20px;
  border-top: 1px solid #f0f0f0;
  text-align: center;
  font-size: 12px;
  color: #999;
}

/* 移动端适配 */
body.wx-mobile .customer-service-panel {
  width: 92%;
  max-width: none;
}
.wxe-view, .wxe-scroll-view, .wxe-swiper, .wxe-form, .wxe-navigator, .wxe-picker, .wxe-map, .wxe-rich-text { display: block; }
.wxe-text, .wxe-label { display: inline; }
.wx-preline { white-space: pre-line; }
img.wxe-image, img.wxe-cover-image { display: inline-block; width: 320px; height: 240px; }
.wx-img-aspectFill { object-fit: cover; }
.wx-img-aspectFit { object-fit: contain; }
.wx-img-scaleToFill { object-fit: fill; }
.wx-img-widthFix { height: auto !important; }
.wx-img-heightFix { width: auto !important; }
.wx-hidden { display: none !important; }
.wx-navigator, .wxe-picker { cursor: pointer; }

.wxe-input, .wxe-textarea {
  font: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  min-height: 1.4em;
  display: block;
}
.wxe-textarea { resize: none; }

.wxe-button {
  font: inherit;
  border: none;
  outline: none;
  cursor: pointer;
  position: relative;
  display: block;
  margin-left: auto;
  margin-right: auto;
  padding-left: 14px;
  padding-right: 14px;
  font-size: 18px;
  line-height: 2.55;
  border-radius: 5px;
  background: #f8f8f8;
  color: #000;
  text-align: center;
  overflow: hidden;
}
.wxe-button.wx-btn-primary { background: #07c160; color: #fff; }
.wxe-button.wx-btn-warn { background: #fff; color: #e64340; }
.wxe-button.wx-btn-mini { display: inline-block; line-height: 2.3; font-size: 13px; padding: 0 1.34em; }
.wxe-button.wx-btn-plain { background: transparent; border: 1px solid currentColor; }
.wxe-button.wx-btn-loading::before {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  margin-right: 6px;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: wx-spin .7s linear infinite;
}
.wxe-button[disabled], .wxe-button:disabled { opacity: .55; cursor: default; }

.wx-scroll-y { overflow-y: auto !important; }
.wx-scroll-noy { overflow-y: hidden; }
.wx-scroll-x { overflow-x: auto !important; white-space: nowrap; }
.wxe-scroll-view::-webkit-scrollbar { width: 0; height: 0; }

.wxe-map { min-height: 100px; background: #eef1f5; position: relative; overflow: hidden; }
.wx-map-real { z-index: 0; }
.wx-map-pin {
  width: 22px; height: 22px;
  background: #7B8FF0;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
}
.wx-map-fallback { padding: 10px; }
.wx-map-fb-head { font-size: 13px; color: #666; margin-bottom: 6px; }
.wx-map-fb-item { font-size: 12px; color: #333; padding: 3px 0; border-bottom: .5px dashed #e2e6ec; }
.wx-map-fb-open { margin-top: 8px; font-size: 12px; color: #576b95; cursor: pointer; }

/* ===== toast / loading ===== */
.wx-toast {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  min-width: 120px;
  max-width: 80%;
  background: rgba(17,17,17,.85);
  color: #fff;
  border-radius: 8px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 3000;
  text-align: center;
}
.wx-toast.wx-toast-plain { padding: 10px 16px; min-width: 0; border-radius: 6px; }
.wx-toast-icon { font-size: 34px; line-height: 1; }
.wx-toast-title { font-size: 14px; line-height: 1.4; word-break: break-all; }
.wx-spinner {
  width: 28px; height: 28px;
  border: 3px solid rgba(255,255,255,.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: wx-spin .7s linear infinite;
}
@keyframes wx-spin { to { transform: rotate(360deg); } }

/* ===== modal ===== */
.wx-modal-mask, .wx-sheet-mask, .wx-preview-mask {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 3500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wx-modal {
  width: 80%;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  text-align: center;
}
.wx-modal-title { font-size: 17px; font-weight: 600; padding: 22px 20px 0; }
.wx-modal-content { font-size: 15px; color: #555; padding: 14px 20px 22px; line-height: 1.5; word-break: break-all; }
.wx-modal-title + .wx-modal-content { padding-top: 8px; }
.wx-modal-editable { padding: 14px 20px 22px; }
.wx-modal-title + .wx-modal-editable { padding-top: 12px; }
.wx-modal-input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 40px;
  padding: 8px 10px;
  font-size: 15px;
  font-family: inherit;
  color: #333;
  background: #f7f7f7;
  border: .5px solid #e0e0e0;
  border-radius: 4px;
  resize: none;
  outline: none;
}
.wx-modal-input:focus { border-color: #576B95; background: #fff; }
.wx-modal-btns { display: flex; border-top: .5px solid #e5e5e5; }
.wx-modal-btn {
  flex: 1;
  padding: 13px 0;
  font-size: 16px;
  cursor: pointer;
  user-select: none;
}
.wx-modal-btn.ok { font-weight: 600; }
.wx-modal-btn + .wx-modal-btn { border-left: .5px solid #e5e5e5; }

/* ===== 底部弹层（picker / actionSheet） ===== */
.wx-sheet-mask { align-items: flex-end; }
.wx-sheet {
  width: 100%;
  background: #fff;
  border-radius: 14px 14px 0 0;
  overflow: hidden;
  animation: wx-sheet-in .18s ease-out;
}
@keyframes wx-sheet-in { from { transform: translateY(40%); } to { transform: translateY(0); } }
.wx-sheet-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: .5px solid #eee; }
.wx-sheet-cancel { color: #888; cursor: pointer; font-size: 15px; }
.wx-sheet-title { font-size: 15px; font-weight: 500; }
.wx-sheet-ok { color: #576b95; cursor: pointer; font-size: 15px; font-weight: 600; }
.wx-sheet-body { padding: 18px 16px 26px; }
.wx-sheet-date { width: 100%; font-size: 17px; padding: 8px 10px; border: 1px solid #e2e6ec; border-radius: 8px; }
.wx-sheet-list { max-height: 45vh; overflow-y: auto; }
.wx-sheet-item {
  padding: 14px 16px;
  text-align: center;
  font-size: 16px;
  border-bottom: .5px solid #f2f2f2;
  cursor: pointer;
}
.wx-sheet-item.active { color: #7B8FF0; font-weight: 600; }
.wx-sheet-item:active { background: #f6f7fb; }
.wx-sheet-cancel-btn {
  padding: 14px 16px;
  text-align: center;
  font-size: 16px;
  color: #666;
  border-top: 6px solid #f4f5f7;
  cursor: pointer;
}
.wx-multi-cols { display: flex; max-height: 42vh; }
.wx-multi-col { flex: 1; overflow-y: auto; border-right: .5px solid #f2f2f2; }
.wx-multi-col:last-child { border-right: none; }
.wx-multi-col .wx-sheet-item { font-size: 15px; padding: 12px 8px; }

/* ===== 图片预览 ===== */
.wx-preview-mask { background: rgba(0,0,0,.92); z-index: 4000; }
.wx-preview-img { max-width: 100%; max-height: 88%; object-fit: contain; }
.wx-preview-idx { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: #ddd; font-size: 13px; }
.wx-preview-prev, .wx-preview-next {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 40px; height: 60px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 34px; cursor: pointer; user-select: none;
}
.wx-preview-prev { left: 2px; }
.wx-preview-next { right: 2px; }
