/* 系统前台核心样式：弹窗、提示条、悬浮栏基础、手机底部栏、间距、预览选框 */
*, *::before, *::after { box-sizing: border-box; }
img { max-width: 100%; height: auto; }
.jm-icon-img { width: 22px; height: 22px; object-fit: contain; display: inline-block; vertical-align: middle; }

/* 区块上下间距 */
.pt-none { padding-top: 0; }
.pt-sm { padding-top: 24px; }
.pt-md { padding-top: 48px; }
.pt-lg { padding-top: 72px; }
.pt-xl { padding-top: 96px; }
.pb-none { padding-bottom: 0; }
.pb-sm { padding-bottom: 24px; }
.pb-md { padding-bottom: 48px; }
.pb-lg { padding-bottom: 72px; }
.pb-xl { padding-bottom: 96px; }

@media (min-width: 768px) { .hide-pc { display: none !important; } }
@media (max-width: 767px) {
  .hide-mobile { display: none !important; }
  .pt-md { padding-top: 32px; }
  .pt-lg { padding-top: 44px; }
  .pt-xl { padding-top: 56px; }
  .pb-md { padding-bottom: 32px; }
  .pb-lg { padding-bottom: 44px; }
  .pb-xl { padding-bottom: 56px; }
}

/* 进场动画 */
[data-animate], .anim-fade-up, .anim-fade-in { transition: opacity .6s ease, transform .6s ease; }
.anim-fade-up { opacity: 0; transform: translateY(24px); }
.anim-fade-in { opacity: 0; }
.anim-fade-up.is-in, .anim-fade-in.is-in { opacity: 1; transform: none; }

/* 蜜罐字段（CSS 隐藏，不用 type=hidden） */
.jm-hp { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; }

/* 弹窗基础 */
[data-modal] {
  position: fixed; inset: 0; z-index: 9000; display: none; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .62); padding: 16px; backdrop-filter: blur(2px);
}
[data-modal].is-open { display: flex; }
.jm-modal-card {
  position: relative; width: 100%; max-width: 460px; background: #fff; color: #222;
  border-radius: 10px; padding: 28px 26px; box-shadow: 0 20px 60px rgba(0,0,0,.35); max-height: 92vh; overflow-y: auto;
}
.jm-modal-close {
  position: absolute; top: 12px; right: 14px; border: none; background: transparent; font-size: 22px;
  cursor: pointer; color: #888; line-height: 1; padding: 4px;
}
.jm-modal-close:hover { color: #222; }
.jm-modal-title { margin: 0 0 8px; font-size: 20px; font-weight: 600; text-align: center; }
.jm-modal-tip { margin: 0 0 16px; font-size: 13px; color: #666; text-align: center; }
.jm-wechat-qr { display: block; width: 200px; height: 200px; object-fit: contain; margin: 12px auto; border: 1px solid #eee; border-radius: 6px; }
.jm-wechat-id { text-align: center; font-weight: 600; font-size: 15px; margin: 8px 0 14px; }

/* 表单字段 */
.jm-form-row { margin-bottom: 12px; }
.jm-form-label { display: block; font-size: 13px; margin-bottom: 4px; color: #444; }
.jm-form-input, .jm-form-select, .jm-form-textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #dcdcdc; border-radius: 6px; font-size: 14px;
  font-family: inherit; outline: none; background: #fff; color: #222;
}
.jm-form-input:focus, .jm-form-select:focus, .jm-form-textarea:focus { border-color: var(--c-primary, #c69c4b); }
.jm-region-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.jm-consent { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; color: #666; cursor: pointer; }
.jm-consent a { color: var(--c-primary, #b88b37); text-decoration: underline; }
.jm-form-submit {
  width: 100%; padding: 11px 18px; border: none; border-radius: 6px; font-size: 15px; font-weight: 600;
  cursor: pointer; background: var(--c-primary, #c69c4b); color: #fff;
}
.jm-form-submit:disabled { opacity: .6; cursor: not-allowed; }
.jm-form-msg { margin-top: 8px; font-size: 13px; text-align: center; min-height: 18px; }
.jm-form-msg.is-error { color: #d93025; }
.jm-form-msg.is-ok { color: #1e8e3e; }

.brand-promo { position: fixed; left: 0; top: 46%; z-index: 36; transform: translateY(-50%); }
.brand-promo button {
  border: none; cursor: pointer; background: var(--c-primary, #c8553d); color: #fff;
  border-radius: 0 12px 12px 0; padding: 14px 8px; writing-mode: vertical-rl;
  letter-spacing: 2px; font-size: 14px; font-weight: 700;
}
.brand-chat-log { max-height: 180px; overflow: auto; margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; }
.brand-chat-log p { margin: 0; padding: 8px 10px; border-radius: 8px; font-size: 13px; white-space: pre-wrap; }
.brand-chat-log .is-me { align-self: flex-end; background: #f7efe4; }
.brand-chat-log .is-them { align-self: flex-start; background: #f3f4f6; }
.footer-nearby { padding: 8px 0 12px; display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 13px; }
.footer-nearby a { text-decoration: underline; }

/* 提示条 Toast */
.jm-toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%); z-index: 9999;
  padding: 10px 22px; border-radius: 6px; font-size: 14px; color: #fff; background: #231815;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); opacity: 0; pointer-events: none; transition: opacity .25s;
}
.jm-toast.is-show { opacity: 1; }
.jm-toast.is-success { background: #2e7d32; }
.jm-toast.is-error { background: #c62828; }

/* 手机底部转化栏 */
.jm-mobile-bar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 8000;
  background: #fff; border-top: 1px solid #e6e0d5; box-shadow: 0 -2px 12px rgba(0,0,0,.08);
  height: 58px;
}
.jm-mobile-bar-inner { display: flex; height: 100%; align-items: stretch; }
.jm-mobile-bar-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 11px; color: #333; text-decoration: none;
}
.jm-mobile-bar-item.is-highlight {
  flex: 1.5; background: var(--c-primary, #c69c4b); color: #fff; font-weight: 600; font-size: 13px;
}
@media (max-width: 767px) {
  .jm-mobile-bar { display: block; }
  body.has-mobile-bar { padding-bottom: 62px; }
}

/* 后台预览框点选联动 */
body.is-preview [data-block-id] { position: relative; transition: outline .15s; cursor: pointer; }
body.is-preview [data-block-id]:hover { outline: 2px dashed #c69c4b; outline-offset: -2px; }
body.is-preview [data-block-id].is-selected { outline: 3px solid #b88b37; outline-offset: -3px; }
.blk-error { padding: 16px; background: #fff1f0; color: #cf1322; border: 1px solid #ffa39e; margin: 12px; font-size: 13px; }

/* ===== 右侧悬浮：我要加盟 / 品牌推广（客服入口） ===== */
.jm-dock {
  position: fixed; right: 0; bottom: 112px; z-index: 9000;
  display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
  pointer-events: none;
}
.jm-dock__btn {
  pointer-events: auto; display: flex; align-items: center; gap: 8px; border: 0; cursor: pointer;
  padding: 13px 16px 13px 14px; border-radius: 16px 0 0 16px;
  font-size: 15px; font-weight: 700; letter-spacing: .5px; color: #fff;
  box-shadow: 0 12px 26px rgba(0, 0, 0, .22);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
  position: relative; overflow: visible;
}
.jm-dock__btn--join {
  background: linear-gradient(135deg, var(--c-primary, #8a6d3b), var(--c-accent, #c69c4b));
  padding: 17px 20px 17px 16px; font-size: 17px;
}
.jm-dock__btn--join::after {
  content: ""; position: absolute; inset: 0; border-radius: 16px 0 0 16px;
  box-shadow: 0 0 0 0 rgba(198, 156, 75, .55);
  animation: jm-dock-pulse 2.8s ease-out infinite; pointer-events: none;
}
@keyframes jm-dock-pulse {
  0% { box-shadow: 0 0 0 0 rgba(198, 156, 75, .55); }
  60% { box-shadow: 0 0 0 14px rgba(198, 156, 75, 0); }
  100% { box-shadow: 0 0 0 0 rgba(198, 156, 75, 0); }
}
.jm-dock__btn--promo { background: rgba(35, 24, 21, .88); padding: 10px 14px; font-size: 13px; font-weight: 600; }
.jm-dock__btn:hover { transform: translateX(-5px); filter: brightness(1.04); }
.jm-dock__btn:active { transform: translateX(-2px) scale(.99); }
.jm-dock__ico { display: inline-flex; }
@media (prefers-reduced-motion: reduce) { .jm-dock__btn--join::after { animation: none; } }

/* ===== 客服面板 ===== */
.jm-cs [hidden] { display: none !important; }
.jm-cs { position: fixed; inset: 0; z-index: 9500; display: flex; align-items: flex-end; justify-content: flex-end; padding: 0 26px 26px; }
.jm-cs[hidden] { display: none; }
.jm-cs__mask { position: absolute; inset: 0; background: rgba(12, 10, 8, .4); }
.jm-cs__panel {
  position: relative; display: flex; flex-direction: column;
  width: 392px; max-width: 100%; height: 560px; max-height: calc(100vh - 52px);
  background: #fff; border-radius: 18px; overflow: hidden;
  box-shadow: 0 26px 64px rgba(0, 0, 0, .3);
}
.jm-cs__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px; background: linear-gradient(135deg, var(--c-primary, #8a6d3b), var(--c-accent, #c69c4b)); color: #fff;
}
.jm-cs__id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.jm-cs__id strong { display: block; font-size: 16px; line-height: 1.3; }
.jm-cs__id em { display: block; font-size: 12px; font-style: normal; opacity: .88; margin-top: 2px; }
.jm-cs__dot { width: 9px; height: 9px; border-radius: 50%; background: #8ff0a4; box-shadow: 0 0 0 3px rgba(143, 240, 164, .28); flex: none; }
.jm-cs__dot.is-off { background: #ffd166; box-shadow: 0 0 0 3px rgba(255, 209, 102, .3); }
.jm-cs__close { border: 0; background: rgba(255, 255, 255, .18); color: #fff; width: 30px; height: 30px; border-radius: 8px; font-size: 18px; line-height: 1; cursor: pointer; flex: none; }
.jm-cs__close:hover { background: rgba(255, 255, 255, .3); }

.jm-cs__intro { padding: 14px 18px 0; }
.jm-cs__tip { margin: 0; font-size: 13px; color: #6b6257; line-height: 1.6; }

.jm-cs__form { padding: 12px 18px 18px; display: flex; flex-direction: column; gap: 10px; overflow: auto; }
.jm-cs__row { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #4a423a; }
.jm-cs__row b { color: #c8553d; font-weight: 600; }
.jm-cs__input {
  width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #e3ddd3; border-radius: 10px;
  font-size: 14px; color: #241f1a; background: #fdfcfa; outline: none; transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
.jm-cs__input:focus { border-color: var(--c-primary, #8a6d3b); box-shadow: 0 0 0 3px rgba(138, 109, 59, .12); }
.jm-cs__area { resize: vertical; min-height: 74px; }
.jm-cs__submit {
  margin-top: 4px; border: 0; cursor: pointer; padding: 12px; border-radius: 10px; color: #fff; font-size: 15px; font-weight: 700;
  background: linear-gradient(135deg, var(--c-primary, #8a6d3b), var(--c-accent, #c69c4b));
}
.jm-cs__submit[disabled] { opacity: .6; cursor: default; }
.jm-cs__msg { margin: 0; min-height: 18px; font-size: 12px; color: #c62828; }
.jm-cs__msg.is-ok { color: #2e7d32; }

.jm-cs__log { padding: 12px 18px; overflow: auto; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: #2f2a24; }
.jm-cs__log p { margin: 0; padding: 8px 10px; border-radius: 10px; background: #f4f1ec; max-width: 86%; white-space: pre-wrap; }
.jm-cs__log p.is-me { align-self: flex-end; background: #f7efe4; }

.jm-cs__chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.jm-cs__msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; background: #fbfaf7; }
.jm-cs__msgs .bubble { max-width: 82%; padding: 10px 12px; border-radius: 12px; font-size: 14px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.jm-cs__msgs .is-them { align-self: flex-start; background: #fff; border: 1px solid #eee7dc; color: #2f2a24; }
.jm-cs__msgs .is-me { align-self: flex-end; background: var(--c-primary, #8a6d3b); color: #fff; }
.jm-cs__msgs .is-sys { align-self: center; background: transparent; color: #9a9086; font-size: 12px; padding: 2px 0; }
.jm-cs__msgs .stamp { font-size: 11px; color: #a89f95; margin: 0 4px; }
.jm-cs__send { display: flex; gap: 8px; padding: 12px; border-top: 1px solid #f0ece5; background: #fff; }
.jm-cs__sendinput {
  flex: 1; min-height: 40px; max-height: 96px; resize: none; padding: 10px 12px; border: 1px solid #e3ddd3; border-radius: 10px;
  font-size: 14px; font-family: inherit; outline: none;
}
.jm-cs__sendinput:focus { border-color: var(--c-primary, #8a6d3b); }
.jm-cs__sendbtn {
  border: 0; cursor: pointer; padding: 0 18px; border-radius: 10px; color: #fff; font-size: 14px; font-weight: 700;
  background: linear-gradient(135deg, var(--c-primary, #8a6d3b), var(--c-accent, #c69c4b));
}
.jm-cs__sendbtn[disabled] { opacity: .55; cursor: default; }

@media (max-width: 767px) {
  .jm-dock { top: auto; bottom: 96px; transform: none; gap: 8px; }
  .jm-dock__btn { padding: 10px 12px; font-size: 13px; border-radius: 12px 0 0 12px; }
  .jm-dock__btn--join { padding: 12px 14px; font-size: 14px; }
  .jm-dock__btn--promo { font-size: 12px; padding: 8px 11px; }
  .jm-cs { padding: 0; align-items: flex-end; }
  .jm-cs__panel { width: 100%; height: auto; max-height: 88vh; border-radius: 16px 16px 0 0; }
  .jm-cs__chat { min-height: 62vh; }
}
