/* ============================================================
   可视化搭建器生成的组件样式（前台渲染 + 后台画布预览共用）
   说明：搭建器输出语义化 HTML，用 data-gb-type 标记组件类型，
        以下样式让各组件在前台正常显示、在移动端自适应。
   ============================================================ */

/* 分栏布局 */
.gb-columns {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.gb-columns > .gb-col {
  flex: 1 1 0;
  min-width: 0;
}
@media (max-width: 760px) {
  .gb-columns { flex-direction: column; }
  .gb-columns > .gb-col { flex: 1 1 auto; width: 100%; }
}

/* 文字组件 */
.gb-text { line-height: 1.8; }
.gb-text p { margin: 0 0 1em; }
.gb-text p:last-child { margin-bottom: 0; }

/* 图片组件 */
.gb-image { margin: 0; }
.gb-image img {
  max-width: 100%;
  height: auto;
  display: inline-block;
  border-radius: inherit;
}
.gb-image figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-mute, #6e838e);
  text-align: inherit;
}

/* 按钮组件 */
.gb-button a.gb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 26px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  border-radius: 8px;
  text-decoration: none;
  background: var(--primary, #00a0f0);
  color: #fff;
  border: 2px solid transparent;
  transition: filter 0.2s ease, transform 0.2s ease;
}
.gb-button a.gb-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

/* 列表组件 */
.gb-list { margin: 0; padding-left: 1.5em; }
.gb-list li { margin-bottom: 0.4em; }

/* 引用组件 */
.gb-quote {
  margin: 0;
  padding: 18px 24px;
  background: var(--accent-soft, #e0f7f7);
  border-left: 4px solid var(--accent, #00c8c8);
  border-radius: 0 var(--radius, 10px) var(--radius, 10px) 0;
  color: var(--primary-darker, #006ca8);
  line-height: 1.8;
}

/* 分隔线组件 */
.gb-divider {
  border: 0;
  border-top: 1px solid var(--border, #d5e7f0);
  margin: 24px 0;
}

/* 间距组件 */
.gb-spacer { height: 40px; }

/* 文件下载组件（前台展示样式） */
.gb-file { margin: 14px 0; }
.gb-file-link {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  min-width: 280px;
  max-width: 100%;
  background: var(--card, #fff);
  border: 1px solid var(--border, #d5e7f0);
  border-radius: 12px;
  color: var(--text, #16242c);
  text-decoration: none;
  transition: all .18s ease;
  box-shadow: 0 1px 2px rgba(15,42,62,.04);
}
.gb-file-link:hover {
  border-color: var(--accent, #00c8c8);
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  transform: translateY(-1px);
  text-decoration: none;
}
.gb-file-icon {
  flex: 0 0 auto;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  font-weight: 800; font-size: 12px; letter-spacing: .04em;
  background: var(--accent-soft, #e0f7f7);
  color: var(--primary-darker, #006ca8);
}
.gb-file-link--plain .gb-file-icon { background: #f3f4f6; color: var(--text-mute, #6e838e); }
.gb-file-info {
  flex: 1 1 auto;
  display: flex; flex-direction: column; gap: 3px;
  min-width: 0;
}
.gb-file-info .gb-file-name {
  font-weight: 700; font-size: 15px; line-height: 1.4;
  color: var(--text);
  word-break: break-all;
}
.gb-file-info .gb-file-desc { font-size: 13px; color: var(--text-mute); line-height: 1.4; }
.gb-file-info .gb-file-size { font-size: 11px; color: var(--text-mute); }
.gb-file-action {
  flex: 0 0 auto;
  background: var(--primary, #00a0f0);
  color: #fff;
  font-size: 13px; font-weight: 600;
  padding: 8px 14px; border-radius: 8px;
  white-space: nowrap;
  transition: filter .15s;
}
.gb-file-link:hover .gb-file-action { filter: brightness(1.08); }

/* 按扩展类型给图标上色（PDF 红 / Word 蓝 / Excel 绿 / PPT 橙 / 压缩 黄 / 图片 紫） */
.gb-file-link--ext-pdf  .gb-file-icon { background: #fee2e2; color: #b91c1c; }
.gb-file-link--ext-doc  .gb-file-icon { background: #dbeafe; color: #1d4ed8; }
.gb-file-link--ext-xls  .gb-file-icon { background: #dcfce7; color: #15803d; }
.gb-file-link--ext-ppt  .gb-file-icon { background: #ffedd5; color: #c2410c; }
.gb-file-link--ext-zip  .gb-file-icon { background: #fef3c7; color: #a16207; }
.gb-file-link--ext-txt  .gb-file-icon { background: #e0f7f7; color: var(--primary-darker); }
.gb-file-link--ext-img  .gb-file-icon { background: #ede9fe; color: #6d28d9; }

@media (max-width: 560px) {
  .gb-file-link { gap: 12px; padding: 12px 14px; min-width: 0; }
  .gb-file-icon { width: 42px; height: 42px; }
  .gb-file-action { padding: 7px 10px; font-size: 12px; }
}
