/* 访客端 H5 通用样式：移动端优先，桌面居中模拟手机宽度 */

:root {
  --primary: #e4393c;
  --primary-dark: #c62d30;
  --text: #1f2329;
  --text-2: #5c6570;
  --text-3: #98a1ab;
  --bg: #f5f6f8;
  --card: #ffffff;
  --line: #eceef1;
  --radius: 14px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* 全局皮肤（P33）—— 后台「全局设置」写这些变量，访客端与预览共用 */
  --btn-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --btn-color: #ffffff;
  --btn-h: 44px;
  --btn-r: 24px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

/*
 * App 式页面壳（P30，结构对齐 fog-shell.html）
 *
 *   body        固定视口、不滚动；壳外浅灰底（桌面上看得出"这是一个手机壳"）
 *   .h5-frame   页面容器：最大 420px 居中，flex 三段（顶栏 / 内容 / 底栏）
 *   .h5-content 唯一滚动区；顶栏与购买栏不随内容滚动
 *
 * 为什么改：原来整页滚 + 顶栏 sticky + 购买栏 fixed，桌面端会出现
 * "内容比购买栏宽、购买栏贴窗口边缘"的错位，安全区（刘海/home 条）也算不准。
 * 壳内滚动之后，一屏高度、安全区、底部固定栏三者才统一。
 */
body {
  background: #f0f1f3;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue',
    'Microsoft YaHei', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  overflow: hidden;
  display: flex;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
}

.h5-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 420px;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.04), 0 14px 44px rgba(15, 23, 42, 0.1);
}

/* 手机上就是全屏，不要那圈投影 */
@media (max-width: 420px) {
  .h5-frame {
    box-shadow: none;
  }
}

/* 唯一滚动区 */
.h5-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  /*
   * P42：水平留白收到这一层
   *
   * 原来靠每个 `.section` 的 `margin:12px` 留边，区块一旦裸放（不套容器）就贴屏边。
   * 改成壳自己带 12px 内边距后：裸块天然有边距，`.section` 只需保留上下间距，
   * 通栏块（封面/导航/自定义代码）用负边距抵消。
   */
  padding: 0 12px;
  padding-bottom: calc(10px + var(--safe-bottom));
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
}

/* 顶部条 */
.h5-topbar {
  position: relative;
  z-index: 20;
  flex: none;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.h5-topbar .logo {
  height: 22px;
  width: auto;
}

.h5-topbar .name {
  font-size: 16px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 区块 */
.section {
  background: var(--card);
  border-radius: var(--radius);
  /* P42：水平边距由 .h5-content 统一提供，这里只管上下 */
  margin: 12px 0;
  padding: 16px;
}

/* ---------- 自定义区块的容器（P42） ----------
 *
 * 容器不是区块类型，而是区块的一个分组属性：相邻同名 `box` 的块渲染在同一个 .diy-box 里，
 * 不设容器的块裸放在壳里。四种预设样式与 H5TplService::BOX_STYLES 一一对应。
 *
 * 为什么用 padding 而不是子元素 margin：容器内的块（尤其 code、image 自带的 margin）
 * 逐块处理容易漏，容器统一内边距 + 块间 `+` 相邻选择器最稳。
 */
.diy-box {
  border-radius: var(--radius);
  margin: 12px 0;
  padding: 12px;
}

.diy-box--card {
  background: var(--card);
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.06);
}

.diy-box--soft {
  background: #f6f7f9;
}

.diy-box--line {
  background: var(--card);
  border: 1px solid var(--line);
}

/* 只分组：不画背景、不留内边距，等价于裸放，只是告诉编辑器「这几块是一组」 */
.diy-box--plain {
  padding: 0;
}

/* 容器内不需要再叠一层通栏负边距（容器自己有内边距） */
.diy-box .diy-navbar,
.diy-box .diy-code {
  margin-left: 0;
  margin-right: 0;
}

/*
 * 通栏块：抵消 .h5-content 的水平内边距，让导航/代码铺满整宽
 *
 * 线上是 `#app > 块`，预览里多一层 `.pv-blk`（无 padding/margin/overflow），
 * 所以两条选择器都要写。容器内的块由上面 `.diy-box .xxx` 收回，保持容器留白。
 * 轮播图**不在这里**：它有圆角，本来就该跟内容区留边（规格 8px 边距）。
 */
.h5-content > .diy-navbar,
.h5-content > .diy-code,
.h5-content > .pv-blk > .diy-navbar,
.h5-content > .pv-blk > .diy-code {
  margin-left: -12px;
  margin-right: -12px;
  width: calc(100% + 24px);
  max-width: none;
  border-radius: 0;
}

/* ============================================================
 * 轮播图（P50）—— 规格照 UI主题/fogshop-ui-mobile/preview/fog-swiper.html
 *
 * 尺寸/间距/颜色全部走 CSS 变量：作者在后台调高度、圆角，改的是 --fs-h / --fs-radius，
 * 不需要重新生成样式表。
 *
 * 为什么用 transform 而不是 scroll-snap：
 *   snap 在部分安卓 WebView 上会和页面纵向滚动抢手势（表现为"划不动"或"整页跟着跳"），
 *   位移法只有一个属性在变，过渡交给 CSS，最不容易出意外。
 * ============================================================ */
.fs {
  --fs-h: 180px;
  --fs-radius: 12px;
  --fog-swiper-interval: 3500ms;
  position: relative;
  height: var(--fs-h);
  /* 与 .section 的纵向间距保持一致；左右不用留 —— .h5-content 已有 12px 内边距 */
  margin: 12px 0;
  border-radius: var(--fs-radius);
  overflow: hidden;
  /* 图片没加载完时的占位底色，避免白闪 */
  background: #e8eaee;
  -webkit-tap-highlight-color: transparent;
  /* 纵向滚动交还给页面，只让我们接管横向 */
  touch-action: pan-y;
}

.fs-track {
  display: flex;
  height: 100%;
  transition: transform 0.45s cubic-bezier(0.25, 0.8, 0.35, 1);
  will-change: transform;
}

.fs-slide {
  position: relative;
  flex: 0 0 100%;
  height: 100%;
  overflow: hidden;
}

.fs-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 无图时的默认渐变（作者填了起止色会用 inline style 覆盖） */
.fs-slide.is-text {
  background: linear-gradient(135deg, #59a7ff, #2e8cf0);
}

/* 整屏可点：单独一层，不把 img 包进 <a>（那会打乱 flex，标题也点不到） */
.fs-hit {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.fs-title,
.fs-sub {
  position: absolute;
  left: 18px;
  max-width: 70%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  z-index: 1;
  pointer-events: none;
}

.fs-title {
  bottom: 16px;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.18);
}

.fs-sub {
  bottom: 8px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.5px;
}

/* 主副标题同现时标题上移，否则两行会挤在一起 */
.fs-slide.has-sub .fs-title {
  bottom: 30px;
}

/* ---------- 指示器：一种 DOM，靠修饰类换形态与位置 ---------- */

.fs-dots {
  position: absolute;
  left: 50%;
  bottom: 9px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 2;
  /*
   * 规格没写阴影。加它是为了浅色图：白点压在 #fff 上会彻底消失，
   * 而"指示器看不见"是这样的组件最难被反馈的问题（用户以为只有一张）。
   */
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.28));
}

.fs-dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  transition: width 0.3s ease, height 0.3s ease, background 0.3s ease, transform 0.18s ease;
}

/* 视觉 6px、可点区域外扩到 16px：手机上手点得中 */
.fs-dot::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 999px;
}

/*
 * 指示器由 hover 驱动切换（P51）：鼠标扫过即切，不用点。
 * 所以 hover 必须给出明确反馈 —— 否则用户不知道"划过去就换了一张"是自己的鼠标干的。
 */
.fs-dot:hover {
  background: #fff;
  transform: scale(1.25);
}

.fs-dot.is-on {
  width: 16px;
  background: #fff;
}

/* 右侧竖胶囊 */
.fs--ind-right .fs-dots {
  left: auto;
  right: 8px;
  bottom: 50%;
  transform: translateY(50%);
  flex-direction: column;
  gap: 5px;
}

.fs--ind-right .fs-dot {
  width: 4px;
  height: 4px;
}

.fs--ind-right .fs-dot.is-on {
  width: 4px;
  height: 14px;
}

/* 顶部进度条：4px 方块横排，间距靠 margin（容器 gap 归零） */
.fs--ind-bar .fs-dots {
  left: auto;
  right: 10px;
  top: 9px;
  bottom: auto;
  transform: none;
  gap: 0;
}

.fs--ind-bar .fs-dot {
  width: 4px;
  height: 4px;
  margin: 0 2px;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.4);
}

/* 进度条形态横排靠得很近，hover 只改颜色不放大，否则会压到相邻方块 */
.fs--ind-bar .fs-dot:hover {
  transform: none;
}

/*
 * 当前段：26px 的"轨道 + 填充"（P52 合并了原来的静态白条）
 *
 * 静态那条本来就是填充条的"没走完"状态，摆成两个选项只会让作者纠结选哪个。
 * 现在选了顶部进度条就一定有填充 —— 等于把停留倒计时直接画出来。
 */
.fs--ind-bar .fs-dot.is-on {
  width: 26px;
  background: rgba(255, 255, 255, 0.38);
  overflow: hidden;
}

.fs--ind-bar .fs-dot.is-on .fs-fill {
  position: absolute;
  inset: 0;
  background: #fff;
  transform-origin: left center;
  /*
   * duration 直接吃根节点注进来的 --fog-swiper-interval（= 后台配的停留时长），
   * JS 里只负责"换一个节点"触发重播，不在 JS 里算动画时长 —— 两处各算一次必然不同步。
   */
  animation: fs-fill var(--fog-swiper-interval) linear forwards;
}

@keyframes fs-fill {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

/* 悬停暂停：选择器权重必须≥动画那条，否则 animation 简写会把 play-state 重置 */
.fs--ind-bar.is-paused .fs-dot.is-on .fs-fill {
  animation-play-state: paused;
}

/* 不自动播放时进度条没有"进度"可言，直接满格静态 */
.fs--no-auto.fs--ind-bar .fs-dot.is-on .fs-fill {
  animation: none;
  transform: scaleX(1);
}

/* ---------- 桌面箭头：≥768px 才显示，悬停才出现 ---------- */

.fs-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 3;
}

.fs-btn-prev {
  left: 8px;
}

.fs-btn-next {
  right: 8px;
}

.fs:hover .fs-btn {
  opacity: 1;
}

.fs--no-arrow .fs-btn {
  display: none !important;
}

@media (min-width: 768px) {
  .fs-btn {
    display: flex;
  }
}

/* 系统开了"减少动效"：进度条直接满格，别做扫动 */
@media (prefers-reduced-motion: reduce) {
  .fs--ind-bar .fs-dot.is-on .fs-fill {
    animation: none;
    transform: scaleX(1);
  }

  .fs-track {
    transition-duration: 0.01ms;
  }
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-title::before {
  content: '';
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--primary);
}

/* 封面 */
.cover {
  width: 100%;
  border-radius: var(--radius);
  background: #f0f1f3;
}

.cover-empty {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f3f4f6, #e8eaed);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 13px;
}

/* 产品标题区 */
.product-name {
  font-size: 19px;
  font-weight: 600;
  margin: 0 0 6px;
  line-height: 1.4;
}

.product-desc {
  color: var(--text-2);
  font-size: 14px;
  margin: 0;
  white-space: pre-wrap;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 12px;
}

.price {
  color: var(--primary);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}

.price::before {
  content: '¥';
  font-size: 15px;
  margin-right: 1px;
}

.price-origin {
  color: var(--text-3);
  font-size: 13px;
  text-decoration: line-through;
}

.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 11px;
  background: #fff1f0;
  color: var(--primary);
}

.meta-row {
  display: flex;
  gap: 16px;
  color: var(--text-3);
  font-size: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

/* 富文本详情 */
.detail-body {
  font-size: 14.5px;
  color: #33383f;
  word-break: break-word;
}

.detail-body img {
  border-radius: 8px;
  margin: 8px 0;
}

.detail-body p {
  margin: 0 0 10px;
}

/* 客服 */
.service {
  display: flex;
  gap: 12px;
  align-items: center;
}

.service img {
  width: 92px;
  height: 92px;
  border-radius: 8px;
  object-fit: cover;
}

/* hidden 属性必须赢过任何组件自身的 display 规则
   （否则 .buybar{display:flex} 会把 hidden 的购买条顶出来，404/失败页挂个 ¥0.00） */
[hidden] {
  display: none !important;
}

/* 底部购买栏 */
.buybar {
  position: relative;
  z-index: 30;
  flex: none;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + var(--safe-bottom));
  display: flex;
  align-items: center;
  gap: 12px;
}

.buybar-inner {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
}

.buybar .price {
  font-size: 22px;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  transition: opacity 0.15s;
}

.btn:active {
  opacity: 0.85;
}

.btn:disabled {
  background: #c8ccd2;
  cursor: not-allowed;
}

.btn-block {
  display: block;
  width: 100%;
}

.btn-ghost {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12.5px;
  border-radius: 6px;
  font-weight: 500;
}

.btn-main {
  flex: 1;
}

/* 支付方式 */
.pay-methods {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pay-method {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
}

.pay-method.active {
  border-color: var(--primary);
  background: #fff8f8;
}

.pay-method .radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid #c8ccd2;
  flex: none;
  position: relative;
}

.pay-method.active .radio {
  border-color: var(--primary);
}

.pay-method.active .radio::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--primary);
}

/* 交付内容 */
.delivery-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
}

.delivery-title {
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.delivery-value {
  background: #f6f7f9;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  word-break: break-all;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.delivery-qrcode {
  text-align: center;
}

.delivery-qrcode img {
  max-width: 220px;
  margin: 0 auto;
  border-radius: 8px;
}

.hint {
  color: var(--text-3);
  font-size: 12.5px;
  margin-top: 6px;
}

/* 状态 */
.state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-2);
}

.state .icon {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 12px;
}

/* 404 页（域名未绑产品）：插画取自 UI-B 模板（Rocker）自带素材 */
.nf404 {
  text-align: center;
  padding: 48px 24px 60px;
  color: var(--text-2);
}

.nf404-img {
  width: min(72vw, 300px);
  height: auto;
  display: block;
  margin: 0 auto 4px;
}

.nf404-code {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-1);
  margin-top: 8px;
}

.nf404-code span {
  color: #f5576c;
}

.nf404-title {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text-1);
  margin-top: 10px;
}

.nf404-sub {
  font-size: 12.5px;
  color: var(--text-3);
  margin-top: 6px;
}

.nf404-btn {
  display: inline-block;
  margin-top: 22px;
  padding: 9px 28px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  text-decoration: none;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--line);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 提示条 */
.toast {
  position: fixed;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 999;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}

/* 遮罩层表单（联系方式） */
.mask {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 420px;
  background: rgba(0, 0, 0, 0.45);
  z-index: 100;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.mask.show {
  display: flex;
}

.sheet {
  background: #fff;
  width: 100%;
  max-width: 420px;
  border-radius: 16px 16px 0 0;
  padding: 20px 16px calc(20px + var(--safe-bottom));
}

.sheet h4 {
  margin: 0 0 14px;
  font-size: 16px;
}

.input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  font-size: 15px;
  outline: none;
}

.input:focus {
  border-color: var(--primary);
}

.sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.sheet-actions .btn {
  flex: 1;
}

/* 页脚：备案号 + 品牌署名（后台「品牌与 SEO」配置，留空则不渲染） */
.h5-footer {
  padding: 18px 12px 26px;
  text-align: center;
  font-size: 12px;
  color: #9aa0a6;
  line-height: 1.7;
}

/* ---------- 落地页自定义区块（P29 / 3-7） ---------- */
.diy-image {
  display: block;
  width: 100%;
  border-radius: 8px;
  margin: 8px 0;
}

.diy-video {
  display: block;
  width: 100%;
  border-radius: 8px;
  margin: 8px 0;
  background: #000;
}

.diy-notice {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff7e6;
  border: 1px solid #ffe0a3;
  color: #8a5a00;
  font-size: 13px;
  line-height: 1.6;
}

.diy-hr {
  border: none;
  border-top: 1px solid #eceff3;
  margin: 16px 0;
}

.diy-quote {
  margin: 10px 0;
  padding: 8px 12px;
  border-left: 3px solid #4b7bec;
  background: #f6f8fc;
  color: #4a4f57;
  font-size: 14px;
  line-height: 1.7;
}

.diy-btn {
  display: block;
  width: 100%;
  margin: 12px 0;
  text-align: center;
}

/*
 * 普通按钮的三种样式（P46）
 *
 * 默认（primary）直接用 .btn 的主色，这里不重复写 —— 皮肤改了主色，它跟着变。
 * ghost / plain 是"次要操作"用的：一页只有一个主张，其余都该往后退。
 */
.diy-btn--ghost {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}

.diy-btn--plain {
  background: transparent;
  color: var(--primary);
  padding-left: 0;
  padding-right: 0;
}

/*
 * 行动号召（P46 拆出，P47 改为吸底 + 全自定义）
 *
 * 和普通按钮的区别不是"大一点"，而是三层：整页唯一、固定吸底、样式全自定义。
 * 副文案是转化率的关键 —— 光一句「立即加入」说服不了人，得给它一个理由。
 *
 * 颜色 / 边框 / 圆角由作者填的值经 inline style 覆盖（留空则用这里的默认），
 * 所以这里只写"默认长什么样"，不再有 grad/dark 之类的预设法。
 */
.diy-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 14px 0;
  padding: 13px 20px;
  border: 0;
  border-radius: var(--btn-r, 24px);
  font-family: inherit;
  /*
   * 字号/行高必须显式给：<button> 的 UA 默认是 13.33px、<a> 走继承，
   * 不写死的话同一个组件在"有链接"和"没链接"两种形态下大小会不一样。
   */
  font-size: 15px;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s, opacity 0.15s;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 18px rgba(17, 24, 39, 0.16);
}

.diy-cta:active {
  transform: scale(0.985);
  opacity: 0.92;
}

.diy-cta__text {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.2px;
}

.diy-cta__sub {
  margin-top: 3px;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.3;
  opacity: 0.86;
}

/*
 * 底部固定栏
 *
 * 是 .h5-frame 的 flex 子项（和 .buybar 同一层），**不是 position:fixed**：
 * 整页是"壳内滚动"（.h5-content 唯一滚动区），fixed 会贴到浏览器窗口底部，
 * 桌面宽屏下跟 420px 的壳错位。
 *
 * background-color 用 inherit 跟随页面背景色：按钮下方的滚动内容不会透出来，
 * 又不会像 background:inherit 那样把背景图重复铺一遍。
 */
.h5-cta-bar {
  position: relative;
  z-index: 28;
  flex: none;
  padding: 8px 12px calc(8px + var(--safe-bottom));
  background-color: inherit;
}

.h5-cta-bar .diy-cta {
  /* margin: 0 auto —— 作者把宽度调到 <100% 时要居中，靠 auto 而不是 text-align */
  margin: 0 auto;
}

/*
 * 自定义代码区块（P40）
 *
 * 只做「兜底不撑破页面」这一件事：宽度跟随内容区、超宽元素裁掉。
 * 其余样式全是作者自己写的，这里一律不干预 —— 一旦给它加 padding/字体，
 * 作者写的 style 就得跟我们的默认值打架。
 */
.diy-code {
  overflow: hidden;
}
.diy-code img,
.diy-code iframe,
.diy-code video {
  max-width: 100%;
}

/*
 * 只在后台画布/预览里出现的边界线（线上不加）：
 * 自定义代码没有默认样式，画布上很可能"看不见这一块在哪"。
 * 用 outline 而不是 border —— 不占布局，不会把作者算好的间距顶歪。
 */
.diy-code--pv {
  outline: 1px dashed #cfd6e0;
  outline-offset: 2px;
}

/* ---------- 预览占位（后台实时预览用，线上不会出现） ---------- */
.preview-empty {
  padding: 38px 16px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  line-height: 1.7;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
}

/*
 * 布局型区块：顶部导航（P31）
 *
 * 「封面」区块已合并进轮播图（P51），所以这里没有 .diy-cover ——
 * 单图 = 只有一屏的轮播，渲染走同一段代码。留着的样式只会让人以为还有这个组件。
 */
.diy-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}

.diy-navbar__title {
  font-size: 16px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diy-navbar__link {
  flex: none;
  font-size: 13px;
  color: var(--primary);
}

/* 预览里"有区块但没填内容"的占位：作者才知道块加成功了 */
.diy-empty {
  padding: 14px;
  margin: 6px 0;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

/* ---------- 预览里的区块框（P32 画布点选定位） ----------
 * 只用 outline，不占布局：预览必须和线上长得一样，加个 margin 就失真了。
 */
.pv-blk {
  position: relative;
  cursor: pointer;
  outline: 1px dashed transparent;
  outline-offset: -1px;
  transition: outline-color 0.15s;
}

.pv-blk:hover {
  outline-color: rgba(75, 123, 236, 0.45);
}

.pv-blk.is-active {
  outline: 2px solid #4b7bec;
  outline-offset: -2px;
}


/* ---------- 全局皮肤：底部购买栏（P33） ----------
 * 用变量而不是直接改选择器：后台一改值就生效，预览与线上同一套。
 */
.buybar .btn-main {
  background: var(--btn-bg);
  color: var(--btn-color);
  height: var(--btn-h);
  border-radius: var(--btn-r);
  padding: 0 18px;
  box-sizing: border-box;
}

/*
 * 流光边框 / 按钮抖动 / 悬浮人物图 / 限时秒杀标 的样式已随「页面设置」一起删除（P46）
 *
 * 这些效果的开关原来是全局皮肤字段，字段删了、元素也不会再被创建 ——
 * 留着 CSS 只会让人以为「还有这个功能，只是没找到入口」，属于最难排查的一类死代码。
 * 要恢复就按区块做：效果属于按钮自己，不该是页面级开关。
 */

/* ---------- 业务型区块（P33，内容为示例文案） ---------- */
.diy-block-title {
  margin: 4px 0 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.diy-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 10px 0;
}

.diy-stats[data-n="2"] { grid-template-columns: repeat(2, 1fr); }
.diy-stats[data-n="4"] { grid-template-columns: repeat(2, 1fr); }

.diy-stat {
  padding: 12px 6px;
  border-radius: 12px;
  background: #f7f8fa;
  text-align: center;
}

.diy-stat b {
  display: block;
  font-size: 19px;
  line-height: 1.25;
  color: var(--text);
}

.diy-stat span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-3);
}

.diy-members__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 10px;
  margin: 6px 0 4px;
}

.diy-member {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.diy-member__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #eef1ff, #dfe6ff);
  color: #4b5bd6;
  font-size: 16px;
  font-weight: 600;
}

.diy-member__name {
  max-width: 100%;
  font-size: 12px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diy-member__note {
  font-size: 11px;
  color: var(--text-3);
}

.diy-faq {
  margin: 8px 0;
}

.diy-faq__item {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.diy-faq__item summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  list-style: none;
}

.diy-faq__item summary::-webkit-details-marker {
  display: none;
}

.diy-faq__item summary::after {
  content: '＋';
  float: right;
  color: var(--text-3);
}

.diy-faq__item[open] summary::after {
  content: '－';
}

.diy-faq__a {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-2);
}

.diy-reviews {
  margin: 8px 0;
}

.diy-review {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.diy-review:last-child {
  border-bottom: 0;
}

.diy-review__avatar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #eef1ff, #dfe6ff);
  color: #4b5bd6;
  font-size: 14px;
  font-weight: 600;
}

.diy-review__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.diy-review__text {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-2);
}

/* ---------- 后台画布拖拽指示（P33） ----------
 * 只在 editable 模式生效；线上不会出现这些类。
 */
.pv-blk.is-dragging {
  opacity: 0.45;
}

.pv-blk.is-drop-before {
  box-shadow: inset 0 3px 0 0 #4b7bec;
}

.pv-blk.is-drop-after {
  box-shadow: inset 0 -3px 0 0 #4b7bec;
}

/* ---------- 后台画布拖拽指示（P33） ----------
 * 只在 editable 模式生效；线上不会出现这些类。
 */
.pv-blk.is-dragging {
  opacity: 0.45;
}

.pv-blk.is-drop-before {
  box-shadow: inset 0 3px 0 0 #4b7bec;
}

.pv-blk.is-drop-after {
  box-shadow: inset 0 -3px 0 0 #4b7bec;
}

/* ---------- P66：底部自助入口（成为推广员 / 申请开站） ----------
 * 不做成浮窗：访客是来买东西的，浮窗会挡住购买栏；
 * 放在内容末尾，只有真的滑到底的人才看到 —— 正好是"想合作"的那批人。
 */
.h5-join {
  padding: 18px 16px 28px;
  text-align: center;
  font-size: 13px;
  color: #9aa0aa;
}

.h5-join a {
  color: #4b7bec;
  text-decoration: none;
}

/* ---------- P81：个人码收款页 ----------
 * 收款码是**买家唯一要操作的东西**，给足尺寸与白底：
 * 截图压缩、暗色主题、二维码被圆角裁切都会导致扫不出来，
 * 而扫不出来的表现是"买家说付不了"，排查时根本想不到是样式问题。
 */
.pay-qr {
  display: block;
  width: 232px;
  height: 232px;
  max-width: 70vw;
  max-height: 70vw;
  margin: 6px auto 0;
  object-fit: contain;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #eef0f3;
  padding: 6px;
  box-sizing: border-box;
}

/* 金额提示必须显眼：买家手输金额，差一分就对不上账 */
.pay-amount-warn {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff7e6;
  color: #ad6800;
  font-size: 13px;
  line-height: 1.6;
  text-align: left;
}

.pay-amount-warn b {
  font-size: 15px;
}
