/**
 * 组件样式
 * 页面由组件拼成，这里是各组件的排版；通用外观（背景、留白）由行内样式控制。
 * 编辑器预览态的选中框与工具条也在这里。
 */

/* ========== 组件通用 ========== */
.blk {
  padding: 72px 0;
}

.blk + .blk {
  border-top: 1px solid transparent;
}

.blk-hero {
  padding: 0;
}

.blk-narrow .container {
  width: min(760px, calc(100% - 48px));
}

.blk-title {
  font-size: clamp(24px, 3vw, 30px);
  letter-spacing: -.01em;
}

.blk-text-body p {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 15px;
}

.blk-text-body p:last-child {
  margin-bottom: 0;
}

/* ========== 图片与视频 ========== */
.blk-image img {
  border-radius: var(--radius-lg);
}

.blk-video video {
  width: 100%;
  border-radius: var(--radius-lg);
  background: #000;
  display: block;
}

/* ========== 按钮组 ========== */
.blk-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ========== 分隔线 ========== */
.blk-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}

/* ========== 卡片组内的图片 ========== */
.blk-card-image {
  width: 100%;
  margin-bottom: 14px;
  border-radius: var(--radius);
  object-fit: cover;
}

/* ========== 图文组件 ========== */
.blk-media {
  display: flex;
  align-items: center;
  gap: 48px;
}

.blk-media-figure,
.blk-media-body {
  flex: 1;
  min-width: 0;
}

.blk-media-figure img {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.blk-media-body h2 {
  font-size: clamp(22px, 2.6vw, 28px);
  margin-bottom: 12px;
}

.blk-media-text {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 16px;
}

.blk-media-body .btn {
  margin-top: 20px;
}

/* ========== 图标清单 ========== */
.blk-rich-list {
  display: grid;
  gap: 16px 32px;
}

.blk-rich-list li {
  display: grid;
  gap: 4px;
  padding-left: 26px;
  position: relative;
}

.blk-rich-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/11px no-repeat;
}

.blk-rich-list strong {
  color: var(--ink);
  font-size: 15px;
}

.blk-rich-list span {
  color: var(--muted);
  font-size: 14px;
}

/* ========== 编辑器预览态 ========== */
.is-preview #page [data-block-id] {
  position: relative;
  outline: 1px dashed transparent;
  outline-offset: -1px;
  transition: outline-color .15s ease;
}

.is-preview #page [data-block-id]:hover {
  outline-color: rgba(37, 99, 235, .4);
  cursor: pointer;
}

.is-preview #page [data-block-id].is-selected {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.blk-toolbar {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  display: none;
  gap: 2px;
  padding: 3px;
  border-radius: 8px;
  background: rgba(15, 23, 42, .88);
  box-shadow: var(--shadow-md);
}

.is-preview #page [data-block-id]:hover > .blk-toolbar,
.is-preview #page [data-block-id].is-selected > .blk-toolbar {
  display: flex;
}

.blk-toolbar button {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.blk-toolbar button:hover {
  background: rgba(255, 255, 255, .18);
}

.blk-empty {
  padding: 80px 24px;
  color: var(--faint);
  text-align: center;
  font-size: 14px;
}

/* ========== 响应式：组件内分栏在手机上一律单栏 ========== */
@media (max-width: 860px) {
  .blk {
    padding: 48px 0;
  }

  .blk-media {
    flex-direction: column !important;
    gap: 28px;
  }

  .feature-grid,
  .blk-rich-list {
    grid-template-columns: 1fr !important;
  }

  .plan-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}
