/* ===== 表单生成器 ===== */
.fb-hero {
    background: linear-gradient(160deg, #eff6ff 0%, #f0f7ff 100%);
    border: 1px solid #dbeafe;
    border-radius: 22px;
    padding: 30px;
    margin-bottom: 26px;
    box-shadow: 0 12px 36px rgba(37, 99, 235, .08);
}

.fb-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.fb-logo {
    font-size: 28px;
    background: #dbeafe;
    border-radius: 14px;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fb-title {
    font-size: 20px;
    font-weight: 800;
    color: #1d4ed8;
}

.fb-sub {
    font-size: 13px;
    color: #60a5fa;
}

/* ===== 字段编辑器 ===== */
.fb-editor {
    background: #fff;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    padding: 16px;
}

.fb-editor-head {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 12px;
}

.fb-editor-tip {
    font-size: 11px;
    font-weight: 400;
    color: #94a3b8;
}

.fb-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fb-row {
    display: grid;
    grid-template-columns: 130px 1fr 1fr auto 1fr 1fr 34px;
    gap: 8px;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px 10px;
}

@media (max-width: 900px) {
    .fb-row {
        grid-template-columns: 1fr 1fr;
    }
    .fb-field-type { grid-column: span 2; }
    .fb-options { grid-column: span 2; }
    .fb-del { grid-column: span 2; justify-self: end; }
}

.fb-row input[type="text"],
.fb-row select {
    min-width: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 13px;
    color: #0f172a;
    background: #fff;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.fb-row input[type="text"]:focus,
.fb-row select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
}

.fb-row input::placeholder {
    color: #b6c2d2;
    font-size: 12px;
}

.fb-req-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
    cursor: pointer;
}

.fb-req-wrap input {
    accent-color: #3b82f6;
}

.fb-del {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 8px;
    background: #fee2e2;
    color: #dc2626;
    font-size: 13px;
    cursor: pointer;
    transition: background .2s;
}

.fb-del:hover {
    background: #fecaca;
}

.fb-editor-foot {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.fb-btn-add {
    border: 1px dashed #93c5fd;
    background: transparent;
    color: #2563eb;
    border-radius: 10px;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}

.fb-btn-add:hover {
    background: #eff6ff;
    border-style: solid;
}

.fb-btn {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 9px 26px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .28);
    transition: transform .15s, box-shadow .2s, opacity .2s;
}

.fb-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, .36);
}

.fb-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* ===== 输出区 ===== */
.fb-output {
    margin-top: 18px;
    background: #fff;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    overflow: hidden;
}

.fb-output-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px 0;
    border-bottom: 1px solid #e2e8f0;
}

.fb-tab {
    border: none;
    background: transparent;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.fb-tab.active {
    color: #1d4ed8;
    border-bottom-color: #2563eb;
}

.fb-copy {
    margin-left: auto;
    margin-bottom: 8px;
    border: 1px solid #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 8px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}

.fb-copy:hover {
    background: #dbeafe;
}

.fb-copy.copied {
    background: #d1fae5;
    border-color: #6ee7b7;
    color: #047857;
}

.fb-pane {
    padding: 16px;
}

/* 预览表单样式（与 laravelcollective 渲染结果对应） */
.fb-preview-form {
    max-width: 560px;
}

.fb-field {
    margin-bottom: 14px;
}

.fb-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.fb-req {
    color: #ef4444;
    font-style: normal;
}

.fb-input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    color: #0f172a;
    background: #fff;
    box-sizing: border-box;
    outline: none;
}

.fb-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
}

.fb-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #334155;
    cursor: pointer;
    margin-bottom: 6px;
}

.fb-check input {
    accent-color: #3b82f6;
}

.fb-submit {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 28px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}

.fb-submit:hover {
    background: #1d4ed8;
}

.fb-code {
    margin: 0;
    background: #0f172a;
    color: #a5f3fc;
    border-radius: 10px;
    padding: 16px;
    font-size: 13px;
    line-height: 1.7;
    overflow: auto;
    max-height: 480px;
    white-space: pre;
}

.fb-error {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #dc2626;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    margin-top: 12px;
}

/* ===== 黑夜模式 ===== */
[data-theme="dark"] .fb-hero {
    background: linear-gradient(160deg, #101c3a 0%, #0f1a33 100%);
    border-color: #1e2a4a;
    box-shadow: none;
}

[data-theme="dark"] .fb-logo {
    background: #1e2a4a;
}

[data-theme="dark"] .fb-title { color: #93c5fd; }

[data-theme="dark"] .fb-sub { color: #3b82f6; }

[data-theme="dark"] .fb-editor {
    background: #131c31;
    border-color: #1e2a4a;
}

[data-theme="dark"] .fb-editor-head { color: #93c5fd; }

[data-theme="dark"] .fb-editor-tip { color: #4b5563; }

[data-theme="dark"] .fb-row {
    background: #0f172a;
    border-color: #24334f;
}

[data-theme="dark"] .fb-row input[type="text"],
[data-theme="dark"] .fb-row select {
    background: #131c31;
    border-color: #24334f;
    color: #e5e7eb;
}

[data-theme="dark"] .fb-row input::placeholder { color: #4b5563; }

[data-theme="dark"] .fb-req-wrap { color: #94a3b8; }

[data-theme="dark"] .fb-btn-add {
    border-color: #2e4a7a;
    color: #60a5fa;
}

[data-theme="dark"] .fb-btn-add:hover {
    background: rgba(37, 99, 235, .12);
}

[data-theme="dark"] .fb-output {
    background: #131c31;
    border-color: #1e2a4a;
}

[data-theme="dark"] .fb-output-tabs { border-bottom-color: #24334f; }

[data-theme="dark"] .fb-tab { color: #94a3b8; }

[data-theme="dark"] .fb-tab.active { color: #93c5fd; }

[data-theme="dark"] .fb-copy {
    background: rgba(37, 99, 235, .15);
    border-color: #2e4a7a;
    color: #93c5fd;
}

[data-theme="dark"] .fb-copy:hover { background: rgba(37, 99, 235, .25); }

[data-theme="dark"] .fb-label { color: #94a3b8; }

[data-theme="dark"] .fb-input {
    background: #0f172a;
    border-color: #24334f;
    color: #e5e7eb;
}

[data-theme="dark"] .fb-check { color: #94a3b8; }

[data-theme="dark"] .fb-error {
    border-color: #7f1d1d;
    background: #2a1515;
    color: #fca5a5;
}
