/* 新建表单弹窗（公共组件，form.html / edit.html 共用） */
.form-create-modal-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.form-create-modal-mask.show {
    display: flex;
}
.form-create-modal {
    width: 1200px;
    height: 800px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.form-create-modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}
.form-create-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}
.form-create-modal-close {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.form-create-modal-close:hover {
    color: #666;
}
.form-create-modal-close svg {
    width: 20px;
    height: 20px;
}
.form-create-modal-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}
.form-create-sidebar {
    flex: 0 0 200px;
    box-sizing: border-box;
    background: #fff;
    border-right: 1px solid #f0f0f0;
    padding: 16px;
    overflow-y: auto;
}
.form-create-sidebar::-webkit-scrollbar,
.form-create-scroll::-webkit-scrollbar {
    width: 4px;
}
.form-create-sidebar::-webkit-scrollbar-track,
.form-create-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.form-create-sidebar::-webkit-scrollbar-thumb,
.form-create-scroll::-webkit-scrollbar-thumb {
    border-radius: 2px;
    background: #d0d0d0;
}
.form-create-cat-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    box-sizing: border-box;
    padding: 0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}
.form-create-cat-item:hover {
    color: #266fff;
    background: #f5f8ff;
}
.form-create-cat-item.active {
    color: #266fff;
    background: #edf3ff;
}
.form-create-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f4f4f4;
}
.form-create-actions {
    display: flex;
    gap: 12px;
    padding: 16px 16px 0;
}
.form-create-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
    color: #333;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.form-create-action-btn:hover{
    transform: translateY(-4px);
}
.form-create-action-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.form-create-action-icon svg {
    width: 20px;
    height: 20px;
    color: #fff;
}
.form-create-action-icon.blue { background: #266fff; }
.form-create-action-icon.green { background: #67c23a; }
.form-create-action-icon.orange { background: #e6a23c; }
.form-create-action-icon.red { background: #f56c6c; }
.form-create-ai-tag {
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 12px;
    color: #266fff;
    font-weight: 600;
}
.form-create-scroll {
    flex: 1;
    padding: 0 16px 16px;
    overflow-y: auto;
}
.form-create-template-section {
    scroll-margin-top: 0;
}
.form-create-template-section + .form-create-template-section {
    margin-top: 32px;
}
.form-create-section-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    padding: 12px 0;
}
.form-create-empty {
    padding: 28px 0;
    color: #999;
    font-size: 14px;
    text-align: center;
}
.form-create-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.form-create-tpl-card {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    position: relative;
    aspect-ratio: 370 / 550;
    display: flex;
    flex-direction: column;
}
/* 整卡片 hover 蒙层 */
.form-create-tpl-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1;
}
.form-create-tpl-card:hover::after {
    opacity: 1;
}
.form-create-tpl-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.form-create-tpl-cover {
    flex: 1;
    min-height: 0;
    background: #e9ebef;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.form-create-tpl-cover-image { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.form-create-tpl-cover-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #8d949e;
    font-size: 13px;
    line-height: 1.6;
}
.form-create-tpl-info {
    padding: 12px;
}
.form-create-tpl-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.form-create-tpl-desc {
    font-size: 12px;
    color: #999;
    line-height: 18px;
    height: 36px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
/* 模板卡片 hover 预览按钮（相对整卡片居中，置于蒙层之上） */
.form-create-tpl-cover {
    overflow: hidden;
}
.form-create-tpl-preview {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    padding: 8px 22px;
    background: rgba(38, 111, 255, 0.92);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 2;
}
.form-create-tpl-card:hover .form-create-tpl-preview {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}
.form-create-tpl-preview:hover {
    background: #266fff;
}
