.form-designer {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 230px minmax(480px, 1fr) 370px;
    min-width: 0;
    min-height: 0;
    background: #f4f7fb;
}

.form-component-panel,
.form-property-panel {
    position: relative;
    z-index: 4;
    min-width: 0;
    min-height: 0;
    background: #fff;
}

.form-component-panel {
    overflow-y: auto;
    border-right: 1px solid var(--line);
}

.form-panel-heading {
    padding: 23px 20px 18px;
    border-bottom: 1px solid #edf0f5;
}

.form-panel-heading > span {
    color: #98a3b6;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .16em;
}

.form-panel-heading h2 {
    margin: 5px 0 4px;
    font-size: 18px;
}

.form-panel-heading p {
    margin: 0;
    color: #929daf;
    font-size: 10px;
}

.component-group {
    padding: 18px 16px 3px;
}

.component-group h3 {
    margin: 0 0 10px 4px;
    color: #7e8ba1;
    font-size: 10px;
    font-weight: 700;
}

.component-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.component-grid button {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    min-height: 46px;
    padding: 7px 8px;
    color: #45536b;
    background: #fafbfd;
    border: 1px solid #e5e9f0;
    border-radius: 8px;
    cursor: grab;
    font-size: 10px;
    text-align: left;
    transition: 150ms ease;
}

.component-grid button:hover {
    color: var(--blue);
    background: var(--blue-soft);
    border-color: #aabed8;
    transform: translateY(-1px);
}

.component-grid button:active { cursor: grabbing; }

.component-grid i {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 25px;
    height: 25px;
    color: var(--blue);
    background: #eaf1fb;
    border-radius: 7px;
    font-size: 13px;
    font-style: normal;
    font-weight: 750;
}

.form-canvas-area {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background-color: #f5f8fc;
    background-image: radial-gradient(#d5dce8 .7px, transparent .8px);
    background-size: 18px 18px;
}

.form-canvas-toolbar {
    position: absolute;
    z-index: 3;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    padding: 15px 22px;
    background: linear-gradient(to bottom, rgba(245, 248, 252, .99), rgba(245, 248, 252, .82), transparent);
}

.form-canvas-toolbar h1 {
    margin: 3px 0 0;
    font-size: 20px;
}

.form-canvas-toolbar > div:last-child {
    display: flex;
    gap: 8px;
}

.form-scroll {
    position: absolute;
    inset: 0;
    overflow: auto;
    padding: 96px 42px 90px;
}

.form-sheet {
    width: min(720px, 100%);
    min-height: 560px;
    margin: 0 auto;
    overflow: hidden;
    background: white;
    border: 1px solid #dfe5ee;
    border-radius: 13px;
    box-shadow: 0 14px 38px rgba(36, 58, 92, .11);
}

.form-sheet-header {
    position: relative;
    padding: 27px 30px 22px;
    background: linear-gradient(135deg, #173f79, #315f9d);
    cursor: pointer;
}

.form-sheet-header::after {
    content: "点击设置表单属性";
    position: absolute;
    top: 18px;
    right: 22px;
    color: rgba(255, 255, 255, .62);
    font-size: 9px;
}

.form-sheet-badge {
    display: inline-flex;
    padding: 4px 8px;
    color: #eaf3ff;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .17);
    border-radius: 12px;
    font-size: 9px;
}

.form-sheet-header h2 {
    margin: 12px 0 6px;
    color: white;
    font-size: 22px;
}

.form-sheet-header p {
    margin: 0;
    color: rgba(236, 244, 255, .72);
    font-size: 10px;
}

.form-dropzone {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-content: start;
    min-height: 390px;
    padding: 24px 28px;
    transition: 150ms ease;
}

.form-dropzone.drag-over {
    background: rgba(36, 92, 164, .04);
    box-shadow: inset 0 0 0 2px rgba(36, 92, 164, .18);
}

.form-empty-state {
    grid-column: 1 / -1;
    display: grid;
    place-items: center;
    align-self: center;
    min-height: 310px;
    color: #96a1b3;
    border: 1px dashed #cbd5e3;
    border-radius: 10px;
    font-size: 11px;
    text-align: center;
}

.form-empty-state span {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin: 0 auto 10px;
    color: var(--blue);
    background: var(--blue-soft);
    border-radius: 14px;
    font-size: 24px;
}

.form-field-card {
    position: relative;
    min-width: 0;
    padding: 13px 14px 14px;
    background: #fbfcfe;
    border: 1px solid #e4e9f0;
    border-radius: 9px;
    cursor: pointer;
    transition: 150ms ease;
}

.form-field-card.full { grid-column: 1 / -1; }
.form-field-card:hover { border-color: #a9b9d0; box-shadow: 0 5px 14px rgba(37, 62, 96, .07); }
.form-field-card.selected { background: #fff; border-color: #6e94c3; box-shadow: 0 0 0 3px rgba(36, 92, 164, .09); }
.form-field-card.dragging { opacity: .45; }

.field-card-top {
    display: flex;
    align-items: center;
    min-height: 18px;
    margin-bottom: 8px;
}

.field-drag-handle {
    margin-right: 6px;
    color: #a4afbf;
    cursor: grab;
    font-size: 12px;
}

.field-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    color: #334059;
    font-size: 11px;
    font-weight: 680;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.field-required { margin-right: 3px; color: #e15151; }
.field-key { color: #99a4b5; font-size: 8px; }

.field-card-actions {
    position: absolute;
    z-index: 2;
    top: -11px;
    right: 8px;
    display: none;
    gap: 3px;
    padding: 3px;
    background: white;
    border: 1px solid #dce3ed;
    border-radius: 7px;
    box-shadow: 0 4px 12px rgba(35, 56, 88, .1);
}

.form-field-card:hover .field-card-actions,
.form-field-card.selected .field-card-actions { display: flex; }

.field-card-actions button {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    padding: 0;
    color: #68768d;
    background: white;
    border: 0;
    border-radius: 5px;
    cursor: pointer;
    font-size: 10px;
}

.field-card-actions button:hover { color: var(--blue); background: var(--blue-soft); }
.field-card-actions button.danger:hover { color: var(--danger); background: #fff0f0; }

.field-mock-input,
.field-mock-textarea,
.field-mock-upload {
    display: flex;
    align-items: center;
    min-height: 36px;
    padding: 0 10px;
    color: #a2acba;
    background: white;
    border: 1px solid #dce2eb;
    border-radius: 7px;
    font-size: 10px;
}

.field-mock-input.select::after { content: "⌄"; margin-left: auto; color: #7f8da2; }
.field-mock-textarea { align-items: flex-start; min-height: 68px; padding-top: 10px; }
.field-mock-upload { justify-content: center; color: var(--blue); border-style: dashed; }
.field-mock-radio { display: flex; flex-wrap: wrap; gap: 13px; color: #6f7c91; font-size: 10px; }
.field-mock-radio span::before { content: ""; display: inline-block; width: 11px; height: 11px; margin-right: 5px; vertical-align: -2px; border: 1px solid #aeb9c9; border-radius: 50%; }
.field-help { display: block; margin-top: 6px; color: #9ca6b5; font-size: 8px; line-height: 1.4; }

.form-divider-card {
    grid-column: 1 / -1;
    padding: 10px 2px;
    cursor: pointer;
}

.form-divider-line { display: flex; align-items: center; gap: 10px; color: #59677d; font-size: 11px; font-weight: 700; }
.form-divider-line::after { content: ""; flex: 1; height: 1px; background: #dfe4ec; }

.form-sheet-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    padding: 13px 28px;
    color: #94a0b1;
    background: #fafbfd;
    border-top: 1px solid #e8ecf2;
    font-size: 9px;
}

.form-sheet-footer button {
    min-width: 96px;
    min-height: 34px;
    color: white;
    background: #9eb2cd;
    border: 0;
    border-radius: 7px;
    font-size: 11px;
}

.form-property-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    border-left: 1px solid var(--line);
    box-shadow: -8px 0 24px rgba(38, 58, 86, .05);
}

.form-property-header {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 68px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
}

.form-property-header h2 { margin: 0; font-size: 16px; }
.form-property-header small { display: block; margin-top: 3px; color: #8c97a9; font-size: 9px; }
.form-property-content { overflow-y: auto; }

.form-property-section {
    padding: 18px;
    border-bottom: 1px solid #edf0f5;
}

.form-property-section h3 { margin: 0 0 13px; font-size: 12px; }
.form-property-section .form-field + .form-field { margin-top: 12px; }

.inline-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 38px;
    color: #46546d;
    font-size: 10px;
    font-weight: 650;
}

.field-key-status { min-height: 15px; margin-top: -2px; color: #929daf; font-size: 8px; }
.field-key-status.error { color: var(--danger); }

.form-property-footer {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 8px;
    min-height: 62px;
    padding: 12px 16px;
    background: #fbfcfe;
    border-top: 1px solid var(--line);
}

.form-preview-modal { width: min(760px, calc(100vw - 40px)); }
.preview-form-heading { margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #e7ebf1; }
.preview-form-heading h3 { margin: 0 0 7px; font-size: 19px; }
.preview-form-heading p { margin: 0; color: #8490a4; font-size: 10px; }
.preview-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.preview-field.full { grid-column: 1 / -1; }
.preview-field label { display: block; margin-bottom: 7px; color: #3d4a61; font-size: 10px; font-weight: 680; }
.preview-field input,
.preview-field select,
.preview-field textarea { width: 100%; min-height: 38px; padding: 8px 10px; background: #fff; border: 1px solid #d9e0e9; border-radius: 7px; outline: none; font-size: 11px; }
.preview-field textarea { min-height: 78px; resize: vertical; }
.preview-field input:focus,
.preview-field select:focus,
.preview-field textarea:focus { border-color: #7e9fc7; box-shadow: 0 0 0 3px rgba(36, 92, 164, .08); }
.preview-divider { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin: 5px 0; color: #526078; font-size: 11px; font-weight: 700; }
.preview-divider::after { content: ""; flex: 1; height: 1px; background: #dfe4ec; }

@media (max-width: 1180px) {
    .form-designer { grid-template-columns: 205px minmax(430px, 1fr) 330px; }
    .form-scroll { padding-right: 24px; padding-left: 24px; }
}

@media (max-width: 920px) {
    .form-designer { grid-template-columns: 180px minmax(390px, 1fr); }
    .form-property-panel { position: absolute; z-index: 10; top: 8px; right: 8px; bottom: 8px; width: min(360px, calc(100vw - 100px)); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
}
