/**
 * 公共模板渲染模块样式
 *
 * 用于配合 common-template-renderer.js 使用
 * 实现 Grid 布局的模板展示
 */

/* Section 容器 */
.template-section {
    margin-bottom: 20px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

/* Section 内部容器（Grid 布局） */
.template-section-inner {
    display: grid;
    grid-template-columns: repeat(12, 1fr);  /* 12列均分 */
    grid-auto-rows: minmax(60px, auto);        /* 最小60px，自动扩展 */
    grid-auto-flow: row;                       /* 按顺序排列，与编辑器一致 */
    gap: 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Block 元素 */
.template-block {
    box-sizing: border-box;
    padding: 10px;
    border: 1px solid transparent; /* 默认无边框，调试时可设置颜色 */
}

/* 按钮Block：移除padding，但保留border */
.template-block[data-block-type="button"] {
    padding: 0 !important;
}

/* Block 类型样式 */
.template-block .block-text {
    line-height: 1.8;
}

.template-block .block-heading {
    line-height: 1.3;
    font-weight: 700;
}

.template-block .block-image img {
    max-width: 100%;
    height: auto;
    display: block;
}

.template-block .block-video video {
    max-width: 100%;
    height: auto;
}

.template-block .block-button {
    display: inline-block;
    padding: 10px 20px;
    background: #4facfe;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s;
}

.template-block .block-button:hover {
    background: #00c6fb;
}

.template-block .block-divider {
    height: 2px;
    background: #e2e8f0;
    margin: 20px 0;
}

.template-block .block-spacer {
    background: rgba(0, 0, 0, 0.05);
    min-height: 20px;
}

.template-block .block-table {
    width: 100%;
    border-collapse: collapse;
}

.template-block .block-table th,
.template-block .block-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.template-block .block-table th {
    background: #f5f5f5;
}

.template-block .block-placeholder {
    background: #f0f0f0;
    padding: 20px;
    text-align: center;
    color: #999;
    border: 1px dashed #ccc;
}

/* 空状态 */
.template-empty {
    padding: 40px;
    text-align: center;
    color: #999;
    border: 2px dashed #ddd;
    background: #f9f9f9;
}
