/* 浮层：Toast、公共模块面板、自定义模块弹窗、插入图片弹窗 */

/* Toast */
.toast { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); background: #10b981; color: #fff; padding: 10px 24px; border-radius: 8px; font-size: 14px; font-weight: 500; z-index: 999; display: none; box-shadow: 0 4px 12px rgba(16,185,129,0.3); }
.toast.show { display: block; animation: fadeInOut 2s ease; }
@keyframes fadeInOut { 0%{opacity:0;transform:translateX(-50%) translateY(-10px)} 15%{opacity:1;transform:translateX(-50%) translateY(0)} 85%{opacity:1} 100%{opacity:0} }

/* 浮层通用 */
.table-editor-close { background:none; border:none; font-size:22px; cursor:pointer; color:#94a3b8; line-height:1; padding:0 4px; }
.table-editor-close:hover { color:#1e293b; }

/* 公共模块选择面板 */
.module-panel-overlay { display:none; position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.5); z-index:1000; align-items:center; justify-content:center; }
.module-panel-overlay.show { display:flex; }
.module-panel { background:#fff; border-radius:12px; width:560px; max-width:92vw; max-height:80vh; display:flex; flex-direction:column; box-shadow:0 20px 60px rgba(0,0,0,0.2); }
.module-panel-header { display:flex; align-items:center; justify-content:space-between; padding:14px 20px; border-bottom:1px solid #e2e8f0; }
.module-panel-header span { font-size:14px; font-weight:600; color:#1e293b; }
.module-panel-body { padding:16px 20px; overflow-y:auto; display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.module-card { border:1px solid #e2e8f0; border-radius:8px; padding:14px; cursor:pointer; transition:all 0.15s; }
.module-card:hover { border-color:var(--primary); box-shadow:0 2px 8px rgba(99,102,241,0.15); }
.module-card-name { font-size:13px; font-weight:600; color:#1e293b; margin-bottom:4px; }
.module-card-desc { font-size:11px; color:#94a3b8; }

/* 自定义模块弹窗 */
.custom-module-overlay { display:none; position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.5); z-index:1000; align-items:center; justify-content:center; }
.custom-module-overlay.show { display:flex; }
.custom-module-panel { background:#fff; border-radius:12px; width:600px; max-width:92vw; max-height:80vh; display:flex; flex-direction:column; box-shadow:0 20px 60px rgba(0,0,0,0.2); }
.custom-module-header { display:flex; align-items:center; justify-content:space-between; padding:14px 20px; border-bottom:1px solid #e2e8f0; }
.custom-module-header span { font-size:14px; font-weight:600; color:#1e293b; }
.custom-module-body { padding:16px 20px; overflow-y:auto; flex:1; }
.custom-module-list { margin-bottom:12px; }
.cm-item { display:flex; align-items:center; justify-content:space-between; padding:10px 12px; border:1px solid #e2e8f0; border-radius:6px; margin-bottom:8px; }
.cm-item-name { font-size:13px; font-weight:500; color:#1e293b; }
.cm-item-actions { display:flex; gap:6px; }
.cm-item-actions button { font-size:11px; padding:3px 8px; border-radius:4px; border:1px solid #e2e8f0; background:#fff; cursor:pointer; }
.cm-item-actions .cm-use { color:#10b981; border-color:#10b981; }
.cm-item-actions .cm-use:hover { background:#ecfdf5; }
.cm-item-actions .cm-edit { color:var(--primary); border-color:var(--primary); }
.cm-item-actions .cm-edit:hover { background:#eef2ff; }
.cm-item-actions .cm-del { color:#ef4444; border-color:#ef4444; }
.cm-item-actions .cm-del:hover { background:#fef2f2; }
.cm-ai-tip { font-size:11px; line-height:1.6; color:#94a3b8; background:#f8fafc; border:1px solid #e2e8f0; border-radius:6px; padding:8px 10px; margin-bottom:12px; }
.cm-field { margin-bottom:12px; }
.cm-field label { display:block; font-size:12px; color:#64748b; margin-bottom:4px; }
.cm-field input, .cm-field textarea { width:100%; padding:8px 12px; border:1px solid #e2e8f0; border-radius:6px; font-size:13px; outline:none; font-family:inherit; }
.cm-field textarea { font-family:'JetBrains Mono',Menlo,Monaco,monospace; resize:vertical; }
.cm-field input:focus, .cm-field textarea:focus { border-color:var(--primary); }
.cm-preview-label { font-size:11px; color:#94a3b8; margin-bottom:4px; }
.cm-preview { border:1px dashed #e2e8f0; border-radius:6px; padding:12px; min-height:60px; margin-bottom:12px; overflow:hidden; }
.cm-form-actions { display:flex; gap:8px; justify-content:flex-end; }
.cm-add-btn { width:100%; margin-top:4px; }

/* 插入图片弹窗 */
.image-insert-overlay { display:none; position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.5); z-index:1000; align-items:center; justify-content:center; }
.image-insert-overlay.show { display:flex; }
.image-insert-panel { background:#fff; border-radius:12px; width:420px; max-width:92vw; box-shadow:0 20px 60px rgba(0,0,0,0.2); }
.image-insert-header { display:flex; align-items:center; justify-content:space-between; padding:14px 20px; border-bottom:1px solid #e2e8f0; }
.image-insert-header span { font-size:14px; font-weight:600; color:#1e293b; }
.image-insert-body { padding:16px 20px; }
.img-section { margin-bottom:16px; }
.img-section-title { display:flex; align-items:center; gap:6px; font-size:13px; font-weight:600; color:#1e293b; margin-bottom:6px; }
.img-badge-recommend { font-size:10px; font-weight:600; color:#10b981; background:#ecfdf5; border:1px solid #10b981; border-radius:4px; padding:1px 6px; }
.img-hint { font-size:11px; color:#94a3b8; margin:0 0 8px; line-height:1.5; }
.img-warn-hint { font-size:11px; color:#d97706; margin:0 0 8px; line-height:1.5; }
.img-input-row { display:flex; gap:8px; }
.img-input-row input { flex:1; padding:8px 12px; border:1px solid #e2e8f0; border-radius:6px; font-size:13px; outline:none; font-family:inherit; }
.img-input-row input:focus { border-color:var(--primary); }
.img-divider { display:flex; align-items:center; gap:10px; margin:16px 0; color:#cbd5e1; font-size:11px; }
.img-divider::before, .img-divider::after { content:''; flex:1; height:1px; background:#e2e8f0; }
.img-local-btn { width:100%; }
