/* 小程序搭建页：组件外观 + 手机画布示意（与 wzdj-builder 共用块级布局） */

/* 手机外框固定高度，内容在内部滚动，不把整列撑高 */
.xcx-page .wzdj-builder {
  align-items: start;
}

.xcx-page .wb-canvas-wrap--phone {
  width: 100%;
  max-width: 390px;
  margin-left: auto;
  margin-right: auto;
  height: min(720px, calc(100vh - 170px));
  max-height: min(720px, calc(100vh - 170px));
  min-height: 0;
  flex-shrink: 0;
  overflow-x: visible;
  overflow-y: hidden;
}

.xcx-page .wb-canvas-wrap--phone .wb-canvas {
  flex: 1 1 0;
  min-height: 0 !important;
  overflow-x: visible;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE / 旧 Edge */
}

.xcx-page .wb-canvas-wrap--phone .wb-canvas::-webkit-scrollbar {
  display: none; /* Chrome / Safari / Edge */
  width: 0;
  height: 0;
}

/* 画布内各组件（含 .wb-block__inner、分段 Tab 横滑等）：隐藏滚动条，保留滚轮/触控滑动 */
.xcx-page .wb-canvas-wrap--phone .wb-block,
.xcx-page .wb-canvas-wrap--phone .wb-block * {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.xcx-page .wb-canvas-wrap--phone .wb-block::-webkit-scrollbar,
.xcx-page .wb-canvas-wrap--phone .wb-block *::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* 可滚动内容层：高度由组件撑开，外框不跟涨 */
.xcx-canvas-sheet {
  position: relative;
  box-sizing: border-box;
  padding-bottom: 8px;
}

.xcx-page .wb-canvas.wb-canvas--empty {
  display: flex;
  flex-direction: column;
}

.xcx-page .wb-canvas.wb-canvas--empty .xcx-canvas-sheet {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.xcx-page .wb-canvas:not(.wb-canvas--empty) .xcx-canvas-sheet {
  display: block;
}

/* 预览时仍保持手机框尺寸，不占满整屏高度 */
body.wb-preview-mode.xcx-page .wb-canvas-wrap--phone {
  min-height: 0 !important;
  height: min(720px, calc(100vh - 80px));
  max-height: min(720px, calc(100vh - 80px));
}

.xcx-comp {
  border-radius: 0;
}

/* 状态栏 */
.xcx-comp--status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 14px 2px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.xcx-status-icons {
  font-size: 0.5rem;
  opacity: 0.5;
  letter-spacing: 1px;
}

/* 导航栏 */
.xcx-comp--navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  min-height: 44px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.xcx-nav-title {
  flex: 1;
  text-align: center;
  font-weight: 700;
  font-size: 0.9375rem;
}

.xcx-nav-placeholder {
  width: 28px;
  text-align: center;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
}

/* 搜索 */
.xcx-comp--search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.xcx-search-icon {
  opacity: 0.55;
  font-size: 1rem;
}

/* Banner */
.xcx-comp--banner {
  padding: 0 12px;
}

.xcx-banner-ph {
  min-height: 120px;
  border-radius: 12px;
}

/* 宫格 */
.xcx-comp--grid4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 12px 10px;
  text-align: center;
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.xcx-grid4-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.xcx-grid4-dot {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.5), rgba(34, 211, 238, 0.35));
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* 列表 */
.xcx-comp--cells {
  margin: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.xcx-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
}

.xcx-cell:last-child {
  border-bottom: none;
}

.xcx-cell-arrow {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* 卡片 */
.xcx-comp--card {
  margin: 8px 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.22);
}

.xcx-card-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.xcx-card-text {
  flex: 1;
  min-width: 0;
}

.xcx-card-title {
  font-weight: 700;
  font-size: 0.9375rem;
  margin-bottom: 6px;
}

.xcx-card-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.xcx-card-ph {
  flex: 0 0 88px;
  min-height: 72px;
  border-radius: 8px;
}

/* 主按钮行 */
.xcx-comp--btn-row {
  padding: 12px 16px;
  text-align: center;
}

.xcx-comp--btn-row .wb-link-slot--btn {
  justify-content: center;
}

/* 分隔线 */
.xcx-comp--hr {
  padding: 6px 16px;
}

.xcx-hr {
  border: none;
  height: 1px;
  margin: 0;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* 顶部分段 Tab（与底栏并存，智能搭建会随机插入） */
.xcx-comp--segtabs.wb-comp {
  padding: 8px 12px 10px;
}

.xcx-segtabs-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.xcx-segtab {
  flex: 0 0 auto;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

.xcx-segtab.is-active {
  color: var(--text);
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.18);
}

/* 底栏 Tab（2 / 3 / 4 列，图标可上传） */
.xcx-comp--tabbar.wb-comp {
  padding: 6px 2px 8px;
}

.xcx-comp--tabbar {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  padding: 8px 6px 10px;
  border-top: 1px solid var(--border);
  background: rgba(8, 8, 10, 0.92);
  backdrop-filter: blur(8px);
}

.xcx-tabbar--cols2 .xcx-tab {
  flex: 1;
  max-width: 50%;
}

.xcx-tabbar--cols3 .xcx-tab {
  flex: 1;
  max-width: 34%;
}

.xcx-tabbar--cols4 .xcx-tab {
  flex: 1;
  min-width: 0;
}

.xcx-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.625rem;
  color: var(--text-muted);
}

.xcx-tab-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

/* Tab 图标位（与 wb-allow-img 联动） */
.xcx-tab-icon.wb-allow-img {
  width: 32px;
  height: 32px;
  min-height: 32px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.xcx-tab-icon .wb-allow-img__body {
  font-size: 0.5rem;
  line-height: 1.2;
  text-align: center;
  padding: 2px;
  color: var(--text-muted);
}

.xcx-tab-icon .wb-allow-img__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.xcx-tab-icon .wb-img-actions {
  position: absolute;
  left: 50%;
  bottom: -2px;
  transform: translateX(-50%);
  flex-wrap: nowrap;
  gap: 2px;
  padding: 2px;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 4px;
  border: 1px solid var(--border);
  z-index: 2;
}

.xcx-tab-icon .wb-img-btn {
  padding: 2px 5px;
  font-size: 0.5625rem;
}

/* 旧版底栏圆点占位（兼容已保存画布） */
.xcx-tab-dot {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
}

/* 小程序轮播在窄画布内的指示点 */
.xcx-comp--swiper.wb-comp--carousel {
  margin: 0 8px;
}

/* 导出预览页略浅底 */
.xcx-export-body main {
  min-height: 100vh;
}

/* 预览时隐藏小程序页「清空」 */
body.wb-preview-mode #xcxBtnClear {
  display: none !important;
}
