/* =========================================================
   小程序预览渲染样式（375 设计稿：所有尺寸 = rpx / 2）
   颜色全部走 CSS 变量，由 THEMES.vars() 注入
   ========================================================= */

.mp {
  --p: #1677FF;
  --pd: #0A5ADB;
  --pl: #4A9BFF;
  --ac: #FF6B00;
  --bg: #F2F5FA;
  --card: #FFFFFF;
  --tx: #1A2A3A;
  --sub: #98A2B3;
  --navtx: #FFFFFF;
  --line: #EEF1F6;
  --brd: 10px;

  width: 375px;
  position: relative;
  overflow: hidden;
  background: var(--bg);
  color: var(--tx);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.mp * { margin: 0; padding: 0; box-sizing: border-box; }

.mp-grad { background: linear-gradient(135deg, var(--pl) 0%, var(--p) 55%, var(--pd) 100%); }

/* ---------- 状态栏 / 导航栏 ---------- */
.mp-statusbar {
  height: 40px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; color: var(--navtx); font-size: 11px; font-weight: 700;
}
.mp-navbar { height: 44px; display: flex; align-items: center; justify-content: center; position: relative; color: var(--navtx); }
.mp-nav-title { font-size: 16px; font-weight: 600; }
.mp-capsule {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  height: 32px; padding: 0 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .3);
  display: flex; align-items: center; gap: 10px; color: var(--navtx); font-size: 13px;
}

/* ---------- 页面容器 ---------- */
.mp-page { padding-bottom: 86px; }
.mp-body-pad { padding: 0 12px; }

/* ---------- 门店条 ---------- */
.mp-shopbar { display: flex; align-items: center; padding: 14px 12px 16px; }
.mp-logo {
  width: 46px; height: 46px; border-radius: 50%; background: var(--card);
  color: var(--p); font-size: 20px; font-weight: 800; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(255, 255, 255, .55);
}
.mp-logo img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.mp-shopmeta { flex: 1; margin-left: 10px; min-width: 0; color: var(--navtx); }
.mp-shopname { display: flex; align-items: center; font-size: 16px; font-weight: 700; min-width: 0; }
.mp-shopname span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 178px; }
.mp-switch {
  margin-left: 7px; padding: 2px 6px; border-radius: 999px;
  background: rgba(255, 255, 255, .22); font-size: 10px; font-weight: 400;
  display: flex; align-items: center; gap: 2px;
}
.mp-shopsub { margin-top: 4px; font-size: 11px; opacity: .9; }
.mp-status { padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .2); color: var(--navtx); font-size: 11px; display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.mp-dot { width: 6px; height: 6px; border-radius: 50%; background: #4CF08A; }

/* ---------- 公告 ---------- */
.mp-notice {
  display: flex; align-items: center; height: 36px; padding: 0 12px;
  background: var(--p10);
  border-bottom: 1px solid var(--p20);
}
.mp-notice-tag {
  padding: 2px 6px; border-radius: 3px; font-size: 10px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--pl), var(--pd)); flex: 0 0 auto;
}
.mp-notice-text {
  flex: 1; margin-left: 8px; font-size: 12px; color: var(--tx);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}

/* ---------- 主轮播 ---------- */
.mp-hero {
  position: relative; margin: 10px 12px 0; height: 187px; border-radius: 12px;
  overflow: hidden; box-shadow: 0 5px 14px rgba(0, 0, 0, .08);
}
.mp-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-counter {
  position: absolute; right: 20px; bottom: 10px; padding: 2px 9px; border-radius: 999px;
  font-size: 10px; color: #fff; background: rgba(0, 0, 0, .35);
}

/* ---------- 长条图 ---------- */
.mp-strip { position: relative; margin: 10px 12px 0; height: 50px; border-radius: 10px; overflow: hidden; box-shadow: 0 4px 12px rgba(0, 0, 0, .06); }
.mp-strip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-dots { position: absolute; right: 10px; bottom: 8px; display: flex; gap: 4px; }
.mp-dots i { width: 6px; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .5); }
.mp-dots i.on { width: 16px; background: #fff; }

/* ---------- 卡片 ---------- */
.mp-card { margin: 10px 12px 0; padding: 13px 12px; background: var(--card); border-radius: var(--brd); }
.mp-card--shadow { box-shadow: 0 2px 9px rgba(0, 0, 0, .05); }
.mp-card--outline { border: 1px solid var(--line); box-shadow: none; }
.mp-card--flat { background: var(--p6); box-shadow: none; }

.mp-sec { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.mp-sec-left { display: flex; align-items: center; }
.mp-sec-bar { width: 4px; height: 16px; border-radius: 999px; background: linear-gradient(180deg, var(--pl), var(--pd)); margin-right: 7px; }
.mp-sec-title { font-size: 16px; font-weight: 700; }
.mp-sec-badge { margin-left: 6px; padding: 2px 5px; border-radius: 3px; font-size: 9px; color: var(--pd); background: var(--p15); }
.mp-sec-more { font-size: 11px; color: var(--sub); }

/* ---------- 四宫格入口 ---------- */
.mp-entry-grid { display: flex; }
.mp-entry-item { flex: 1; text-align: center; }
.mp-entry-icon {
  width: 50px; height: 50px; margin: 0 auto; border-radius: 14px;
  background: var(--p12);
  display: flex; align-items: center; justify-content: center; font-size: 23px; line-height: 1;
}
.mp-entry-text { display: block; margin-top: 8px; font-size: 13px; font-weight: 700; }
.mp-entry-sub { display: block; margin-top: 3px; font-size: 10px; color: var(--sub); }

/* ---------- 优惠券 ---------- */
.mp-coupon { margin-bottom: 14px; }
.mp-coupon:last-child { margin-bottom: 0; }
.mp-coupon-media { position: relative; border-radius: 7px; overflow: hidden; box-shadow: 0 3px 9px rgba(0, 0, 0, .08); }
.mp-coupon-media img { width: 100%; display: block; }
.mp-claim {
  position: absolute; right: 9px; bottom: 9px; padding: 5px 15px; border-radius: 999px;
  font-size: 13px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--acsoft), var(--ac));
  box-shadow: 0 3px 8px var(--ac45);
}
.mp-coupon-foot { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 8px; }
.mp-coupon-title { display: block; font-size: 14px; font-weight: 600; }
.mp-coupon-sub { display: block; margin-top: 3px; font-size: 11px; color: var(--sub); }
.mp-coupon-count { font-size: 10px; color: var(--ac); flex: 0 0 auto; margin-left: 8px; }

/* ---------- 商城：搜索 + 分类 + 商品 ---------- */
.mp-search { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.mp-search-box { flex: 1; height: 34px; border-radius: 999px; background: rgba(255, 255, 255, .92); display: flex; align-items: center; padding: 0 12px; font-size: 13px; color: var(--sub); }
.mp-search-btn { font-size: 14px; font-weight: 600; color: var(--navtx); }
.mp-cate { display: flex; gap: 4px; padding: 10px 12px; background: var(--card); overflow: hidden; }
.mp-cate-item { padding: 4px 10px; font-size: 12px; color: var(--sub); white-space: nowrap; }
.mp-cate-item.on { color: var(--p); font-weight: 700; background: var(--p12); border-radius: 8px; }
.mp-goods-grid { display: flex; flex-wrap: wrap; padding: 0 12px; }
.mp-goods-item {
  width: 171px; margin-top: 10px; background: var(--card); border-radius: 9px;
  overflow: hidden; box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
}
.mp-goods-item:nth-child(even) { margin-left: 9px; }
.mp-goods-media { width: 171px; height: 171px; background: var(--line); }
.mp-goods-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-goods-body { padding: 8px 9px 10px; }
.mp-goods-name { font-size: 13px; font-weight: 600; line-height: 1.35; height: 35px; overflow: hidden; }
.mp-goods-spec { margin-top: 3px; font-size: 10px; color: var(--sub); }
.mp-goods-price { margin-top: 7px; display: flex; align-items: baseline; }
.mp-goods-price b { font-size: 19px; color: var(--ac); font-weight: 700; }
.mp-goods-price s { margin-left: 5px; font-size: 10px; color: var(--sub); }
.mp-goods-buy {
  margin-left: auto; width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--acsoft), var(--ac));
  color: #fff; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- AI 页 ---------- */
.mp-ai-head { display: flex; align-items: center; padding: 14px 12px 16px; }
.mp-ai-avatar { width: 48px; height: 48px; border-radius: 50%; background: rgba(255, 255, 255, .92); display: flex; align-items: center; justify-content: center; font-size: 24px; flex: 0 0 auto; }
.mp-ai-meta { flex: 1; margin-left: 10px; color: var(--navtx); }
.mp-ai-name { font-size: 17px; font-weight: 700; }
.mp-ai-status { margin-top: 5px; font-size: 11px; opacity: .9; display: flex; align-items: center; gap: 4px; }
.mp-ai-btn { padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, .22); color: var(--navtx); font-size: 11px; }
.mp-ai-body { padding: 12px; }
.mp-ai-tip { text-align: center; font-size: 10px; color: var(--sub); margin-bottom: 10px; }
.mp-msg { display: flex; align-items: flex-start; margin-bottom: 13px; }
.mp-msg-avatar { width: 33px; height: 33px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 16px; flex: 0 0 auto; }
.mp-msg-avatar.user { background: linear-gradient(135deg, var(--pl), var(--pd)); color: #fff; font-size: 14px; font-weight: 700; }
.mp-bubble {
  max-width: 250px; margin-left: 8px; padding: 11px 13px; border-radius: 4px 11px 11px 11px;
  background: var(--card); font-size: 13px; line-height: 1.6; white-space: pre-wrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
}
.mp-msg.user { flex-direction: row-reverse; }
.mp-msg.user .mp-bubble { margin: 0 8px 0 0; background: linear-gradient(135deg, var(--pl), var(--p)); color: #fff; border-radius: 11px 4px 11px 11px; }
.mp-quick { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 12px; }
.mp-quick span { padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 11px; color: var(--tx); }
.mp-ai-input { display: flex; align-items: center; gap: 8px; margin: 12px; padding: 5px 5px 5px 13px; background: var(--card); border-radius: 999px; box-shadow: 0 2px 9px rgba(0, 0, 0, .06); }
.mp-ai-input input { flex: 1; border: none; background: transparent; color: var(--tx); font-size: 13px; }
.mp-ai-send { padding: 8px 17px; border-radius: 999px; background: linear-gradient(135deg, var(--pl), var(--pd)); color: #fff; font-size: 13px; font-weight: 700; }

/* ---------- 券包 ---------- */
.mp-cp-head { padding: 17px 12px 20px; display: flex; align-items: center; justify-content: space-between; color: var(--navtx); }
.mp-cp-num { font-size: 33px; font-weight: 800; }
.mp-cp-unit { margin-left: 6px; font-size: 13px; opacity: .92; }
.mp-cp-btn { padding: 6px 13px; border-radius: 999px; background: rgba(255, 255, 255, .22); font-size: 12px; }
.mp-cp-tabs { display: flex; margin: 0 12px; padding: 10px 0; background: var(--card); border-radius: var(--brd) var(--brd) 0 0; }
.mp-cp-tab { flex: 1; text-align: center; font-size: 12px; color: var(--sub); }
.mp-cp-tab.on { color: var(--p); font-weight: 700; }
.mp-cp-list { margin: 0 12px; padding: 12px; background: var(--card); border-radius: 0 0 var(--brd) var(--brd); }
.mp-cp-item { margin-bottom: 13px; }
.mp-cp-item:last-child { margin-bottom: 0; }
.mp-cp-media { position: relative; border-radius: 7px; overflow: hidden; }
.mp-cp-media img { width: 100%; display: block; }
.mp-cp-media.gray { opacity: .5; filter: grayscale(100%); }

/* ---------- 我的 ---------- */
.mp-mn-head { padding: 15px 12px 0; }
.mp-mn-user { display: flex; align-items: center; }
.mp-mn-avatar { width: 58px; height: 58px; border-radius: 50%; background: var(--card); color: var(--p); font-size: 24px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.mp-mn-meta { flex: 1; margin-left: 11px; color: var(--navtx); min-width: 0; }
.mp-mn-line { display: flex; align-items: center; }
.mp-mn-name { font-size: 18px; font-weight: 700; }
.mp-mn-level { margin-left: 7px; padding: 2px 7px; border-radius: 999px; font-size: 10px; font-weight: 700; background: linear-gradient(135deg, #FFE6A6, #FFC247); color: #6B4A00; }
.mp-mn-phone { margin-top: 5px; font-size: 11px; opacity: .9; }
.mp-mn-stats { display: flex; margin-top: 17px; padding: 13px 0 15px; border-top: 1px solid rgba(255, 255, 255, .18); }
.mp-mn-stat { flex: 1; text-align: center; color: var(--navtx); }
.mp-mn-stat b { display: block; font-size: 19px; font-weight: 800; }
.mp-mn-stat span { margin-top: 4px; display: block; font-size: 11px; opacity: .88; }
.mp-mn-flows { display: flex; padding: 4px 0; }
.mp-mn-flow { flex: 1; text-align: center; }
.mp-mn-flow-icon { width: 44px; height: 44px; margin: 0 auto; border-radius: 50%; background: var(--p14); display: flex; align-items: center; justify-content: center; font-size: 20px; position: relative; }
.mp-mn-flow-badge { position: absolute; right: -2px; top: -2px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 999px; background: #FF3B30; color: #fff; font-size: 9px; line-height: 15px; border: 1.5px solid var(--card); }
.mp-mn-flow-text { margin-top: 7px; display: block; font-size: 11px; color: var(--sub); }
.mp-mn-menu { display: flex; align-items: center; padding: 13px 0 13px 10px; border-bottom: 1px solid var(--line); }
.mp-mn-menu:last-child { border-bottom: none; }
.mp-mn-menu-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--p14); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.mp-mn-menu-body { flex: 1; margin-left: 10px; }
.mp-mn-menu-text { font-size: 14px; font-weight: 600; }
.mp-mn-menu-sub { margin-top: 3px; display: block; font-size: 10px; color: var(--sub); }
.mp-mn-arrow { font-size: 20px; color: var(--sub); margin-right: 4px; }

.mp-foot { margin-top: 22px; text-align: center; font-size: 11px; color: var(--sub); padding-bottom: 12px; }

/* ---------- 底部 tabBar + 悬浮球 ---------- */
.mp-tabbar { position: relative; background: var(--card); box-shadow: 0 -3px 15px rgba(0, 0, 0, .07); }
.mp-tabbar-inner { display: flex; align-items: center; height: 52px; }
.mp-tab-slot { flex: 1; }
.mp-tab-item { flex: 1; text-align: center; }
.mp-tab-icon { width: 30px; height: 30px; margin: 0 auto; border-radius: 10px; display: flex; align-items: center; justify-content: center; position: relative; }
.mp-tab-icon.on { background: var(--p12); }
.mp-tab-emoji { font-size: 20px; line-height: 1; opacity: .45; }
.mp-tab-icon.on .mp-tab-emoji { opacity: 1; }
.mp-tab-badge {
  position: absolute; right: -3px; top: -3px; min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 999px; background: #FF3B30; color: #fff; font-size: 9px; line-height: 15px;
  border: 1px solid var(--card);
}
.mp-tab-text { display: block; margin-top: 3px; font-size: 10.5px; color: var(--sub); }
.mp-tab-text.on { color: var(--p); font-weight: 700; }

.mp-fab-wrap { position: absolute; left: 50%; bottom: 28px; width: 58px; height: 58px; margin-left: -29px; }
.mp-fab-halo {
  position: absolute; left: 50%; top: 50%; width: 89px; height: 89px; margin: -44.5px 0 0 -44.5px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--p30) 0%, transparent 70%);
  animation: mpBreathe 2.4s ease-in-out infinite;
}
.mp-fab {
  position: absolute; left: 0; top: 0; width: 58px; height: 58px; border-radius: 50%;
  background: linear-gradient(135deg, var(--pl) 0%, var(--p) 50%, var(--pd) 100%);
  border: 2.5px solid #fff; box-shadow: 0 5px 13px var(--pd45);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px; font-weight: 800; letter-spacing: .5px;
}
.mp-fab-badge {
  position: absolute; right: -4px; top: -1px; padding: 1px 5px; border-radius: 999px;
  background: #FF3B30; color: #fff; font-size: 8.5px; font-weight: 700; border: 1px solid #fff;
}
.mp-fab-label {
  position: absolute; left: 50%; top: 62px; transform: translateX(-50%);
  font-size: 9.5px; font-weight: 700; color: var(--p); white-space: nowrap;
}
.mp-home-indicator { height: 17px; background: var(--card); display: flex; align-items: center; justify-content: center; }
.mp-home-indicator i { display: block; width: 134px; height: 5px; border-radius: 999px; background: var(--tx); opacity: .8; }

@keyframes mpBreathe {
  0% { transform: scale(1); opacity: .6; }
  50% { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}

/* 深色主题：状态栏/导航文字由主题 tx 兜底 */
.mp.dark .mp-coupon-foot,
.mp.dark .mp-bubble { color: var(--tx); }
.mp.dark .mp-card--shadow { box-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
