/* 模板引入页：全屏 iframe + 右侧微信悬浮 */
html, body.preview-page {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #fff;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

#iframe {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  border: 0;
  background: #fff;
}

.preview-empty {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  color: #4A5C7A;
  font-size: 15px;
}

.preview-empty a {
  color: #1F6BFF;
  font-weight: 600;
  text-decoration: none;
}

/* ----- 右侧微信悬浮 ----- */
.wx-dock {
  position: fixed;
  right: 20px;
  top: 38%;
  z-index: 99999;
  width: 196px;
  filter: drop-shadow(0 10px 24px rgba(47, 128, 237, 0.18));
}

.wx-dock-tab {
  display: none;
}

.wx-dock-panel {
  position: relative;
}

.wx-dock-head {
  position: relative;
  z-index: 2;
  height: 42px;
  margin: 0 6px -10px;
  padding: 0 8px 0 14px;
  border-radius: 21px;
  background: linear-gradient(90deg, #5BA8FF 0%, #3B8FFF 100%);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 6px 14px rgba(59, 143, 255, 0.35);
}

.wx-dock-head-ico {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wx-dock-head-ico svg {
  width: 20px;
  height: 20px;
  display: block;
}

.wx-dock-head-text {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.wx-dock-hide {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}

.wx-dock-hide svg {
  width: 16px;
  height: 16px;
  display: block;
}

.wx-dock-hide:hover {
  background: rgba(255, 255, 255, 0.42);
}

.wx-dock-card {
  background: #fff;
  border-radius: 18px;
  padding: 28px 16px 16px;
  text-align: center;
  box-shadow: 0 8px 28px rgba(22, 42, 82, 0.12);
}

.wx-dock-qr {
  position: relative;
  width: 158px;
  height: 158px;
  margin: 0 auto 8px;
}

.wx-dock-qr img {
  width: 158px;
  height: 158px;
  display: block;
}

.wx-dock-qr-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  background: #fff;
  border-radius: 8px;
  color: #07C160;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px #fff;
}

.wx-dock-qr-logo svg {
  width: 22px;
  height: 22px;
  display: block;
}

.wx-dock-tip {
  color: #8A97B0;
  font-size: 13px;
  line-height: 1.4;
  margin: 2px 0 4px;
}

.wx-dock-tip-m {
  display: none;
}

.wx-dock-id {
  display: inline-block;
  border: 0;
  background: none;
  padding: 0;
  color: #3B8FFF;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.4px;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.4;
}

.wx-dock-id:hover {
  text-decoration: underline;
}

.wx-dock-id.is-copied {
  color: #07C160;
  text-decoration: none;
}

/* 收起：右侧竖条 */
.wx-dock.is-collapsed {
  right: 0;
  top: 40%;
  width: auto;
  filter: drop-shadow(0 6px 16px rgba(47, 128, 237, 0.22));
}

.wx-dock.is-collapsed .wx-dock-panel {
  display: none;
}

.wx-dock.is-collapsed .wx-dock-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 14px 8px;
  border: 0;
  border-radius: 12px 0 0 12px;
  background: linear-gradient(180deg, #5BA8FF 0%, #3B8FFF 100%);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.wx-dock.is-collapsed .wx-dock-tab svg {
  width: 18px;
  height: 18px;
  display: block;
  writing-mode: horizontal-tb;
}

@media (max-width: 640px) {
  .wx-dock {
    right: 10px;
    top: auto;
    bottom: 88px;
    width: auto;
    min-width: 148px;
  }

  .wx-dock-qr {
    display: none;
  }

  .wx-dock-tip-pc {
    display: none;
  }

  .wx-dock-tip-m {
    display: block;
  }

  .wx-dock-card {
    padding: 22px 16px 14px;
  }

  .wx-dock-head {
    height: 38px;
    margin-bottom: -8px;
  }

  .wx-dock-head-text {
    font-size: 14px;
  }

  .wx-dock-id {
    font-size: 16px;
  }

  .wx-dock.is-collapsed {
    right: 0;
    top: auto;
    bottom: 120px;
  }
}
