/* 模板卡片网格 */
.dt-tpl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}
.dt-tpl-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--divider, #e5e7eb);
    border-radius: var(--radius-lg, 12px);
    cursor: pointer;
    transition: all 0.15s;
}
.dt-tpl-card:hover {
    border-color: var(--primary, #2563EB);
    box-shadow: 0 4px 12px rgba(37,99,235,0.1);
    transform: translateY(-1px);
}
.dt-tpl-icon {
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary, #2563EB), #6366F1);
    border-radius: 12px;
    color: #fff;
    font-size: 22px;
    flex-shrink: 0;
}
.dt-tpl-info { flex: 1; }
.dt-tpl-info h4 { font-size: 15px; margin: 0 0 4px; color: var(--text-primary); }
.dt-tpl-info p { font-size: 13px; margin: 0; color: var(--text-muted); }
.dt-tpl-arrow { font-size: 20px; color: var(--text-muted); }

/* 编辑头部 */
.dt-edit-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    flex-wrap: wrap; gap: 12px; margin-bottom: var(--spacing-lg);
}
.dt-edit-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* 字段表单 */
.dt-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: var(--spacing-xl);
}
.dt-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.dt-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--divider, #e5e7eb);
    border-radius: var(--radius-md, 8px);
    font-size: 14px;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.dt-input:focus {
    outline: none;
    border-color: var(--primary, #2563EB);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* 预览区域 */
.dt-preview-section {
    border-top: 1px solid var(--divider, #e5e7eb);
    padding-top: var(--spacing-lg);
}
.dt-preview-section h4 {
    font-size: 15px;
    margin: 0 0 12px;
    color: var(--text-secondary);
    display: flex; align-items: center; gap: 6px;
}
.dt-preview {
    border: none;
    border-radius: 0;
    padding: 0;
    font-size: 14px;
    line-height: 1.8;
    white-space: normal;
    color: var(--text-primary);
    max-height: none;
    overflow-y: visible;
}

/* 文书预览 - 模拟A4纸张 */
.dt-preview-doc {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 40px 50px;
    max-width: 700px;
    margin: 0 auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    font-family: 'SimSun', 'Songti SC', serif;
    line-height: 1.8;
    color: #000;
}
.dt-preview-br { height: 12px; }
.dt-preview-p { margin: 2px 0; }
.dt-preview-table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
}
.dt-preview-table td {
    border: 1px solid #333;
    padding: 6px 8px;
    font-size: 13px;
    vertical-align: middle;
}

/* 动画增强 */
.dt-tpl-card {
    animation: fadeInUp 0.3s ease both;
}
.dt-tpl-card:nth-child(2) { animation-delay: 40ms; }
.dt-tpl-card:nth-child(3) { animation-delay: 80ms; }
.dt-tpl-card:nth-child(4) { animation-delay: 120ms; }
.dt-tpl-card:nth-child(5) { animation-delay: 160ms; }
.dt-tpl-card:nth-child(6) { animation-delay: 200ms; }
.dt-tpl-card:nth-child(7) { animation-delay: 240ms; }
.dt-field {
    animation: fadeInUp 0.3s ease both;
}
.dt-preview-doc {
    animation: fadeIn 0.3s ease 0.1s both;
}
