/* ============================================================
 * 预览沙箱（/preview/*）
 * 顶部演示条 + 只读按钮视觉
 * ============================================================ */

:root {
  --preview-chrome-h: 44px;
  --preview-accent: #7c3aed;
  --preview-accent-soft: #ede9fe;
  --preview-accent-ink: #5b21b6;
}

/* 整页预留顶部条高度 */
body.has-preview-chrome {
  padding-top: var(--preview-chrome-h);
}

.preview-chrome {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--preview-chrome-h);
  z-index: 9000;
  background: linear-gradient(90deg, #6d28d9 0%, #7c3aed 50%, #8b5cf6 100%);
  color: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,.05), 0 8px 20px -12px rgba(109,40,217,.5);
  -webkit-backdrop-filter: saturate(160%);
          backdrop-filter: saturate(160%);
}
.preview-chrome-inner {
  height: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.preview-tag {
  font-size: 16px;
  flex-shrink: 0;
}
.preview-msg {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  line-height: 1.2;
  letter-spacing: .2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.preview-msg strong { font-weight: 600; }
.preview-msg-sep {
  margin: 0 8px;
  opacity: .5;
}
.preview-msg-sub { opacity: .85; }

.preview-chrome-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.preview-home,
.preview-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s ease, transform .15s ease;
}
.preview-home {
  color: #fff;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.25);
}
.preview-home:hover {
  background: rgba(255,255,255,.25);
  text-decoration: none;
  color: #fff;
}
.preview-home svg { width: 12px; height: 12px; }
.preview-cta {
  background: #fff;
  color: var(--preview-accent-ink);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0,0,0,.1);
}
.preview-cta:hover {
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--preview-accent-ink);
}

/* 窄屏：隐藏副文案 */
@media (max-width: 640px) {
  .preview-msg-sub, .preview-msg-sep { display: none; }
  .preview-home span { display: none; }
  .preview-home { padding: 0 10px; }
  .preview-cta { padding: 0 10px; font-size: 12.5px; }
  .preview-chrome-inner { padding: 0 12px; gap: 8px; }
}

/* ============================================================
 * 只读按钮与锁定徽章
 * 业务按钮加 data-preview-lock 或类 .is-preview-locked 即可
 * ============================================================ */
.is-preview-locked,
[data-preview-lock] {
  position: relative;
  cursor: not-allowed !important;
  opacity: .62;
  filter: grayscale(.25);
}
.is-preview-locked:hover,
[data-preview-lock]:hover {
  transform: none !important;
}
.preview-lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  margin-left: 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--preview-accent-soft);
  color: var(--preview-accent-ink);
  vertical-align: middle;
}
.preview-lock-badge::before {
  content: "🔒";
  font-size: 10px;
}

/* 登录引导 toast */
.preview-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  z-index: 9100;
  background: #1f2937;
  color: #fff;
  padding: 14px 20px;
  border-radius: 14px;
  box-shadow: 0 20px 50px -12px rgba(0,0,0,.4);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 320px;
  max-width: 90vw;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.preview-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.preview-toast-text {
  flex: 1;
  line-height: 1.4;
}
.preview-toast-text strong {
  display: block;
  font-weight: 600;
  margin-bottom: 2px;
}
.preview-toast-sub {
  font-size: 12.5px;
  opacity: .75;
}
.preview-toast-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: #fff;
  color: #1f2937;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  flex-shrink: 0;
}
.preview-toast-cta:hover {
  color: #1f2937;
  text-decoration: none;
}

/* ============================================================
 * 预览页"卡片/面板"复用：用于落地页简化版布局
 * ============================================================ */

.preview-page {
  min-height: calc(100vh - var(--preview-chrome-h));
  background: var(--bg);
}

.preview-container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 28px 24px 64px;
}

.preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}
.preview-heading h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.3px;
  margin: 0;
}
.preview-heading p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* 通用 panel/section */
.preview-panel {
  background: rgba(255,255,255,.88);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
  margin-bottom: 18px;
}
.preview-panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 14px;
}
.preview-panel-title::before {
  content: "";
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: var(--brand);
}

@media (max-width: 640px) {
  .preview-container { padding: 20px 16px 48px; }
  .preview-heading h1 { font-size: 22px; }
  .preview-panel { padding: 18px; }
}
