/* ===== EDITOR LAYOUT ===== */
.ced-layout{display:grid;grid-template-columns:minmax(250px,280px) minmax(0,1fr);gap:12px;align-items:start}
@media(max-width:900px){.ced-layout{grid-template-columns:1fr;gap:10px}}
@media(max-width:680px){.ced-layout{grid-template-columns:1fr;gap:8px}}

.ced-panel{background:#fff;border:1px solid var(--border);border-radius:16px;overflow:hidden;position:sticky;top:80px;max-height:calc(100vh - 100px);display:flex;flex-direction:column;min-width:0}
.ced-tabs{display:flex;border-bottom:1px solid var(--border);flex-shrink:0}
.ced-tab{flex:1;height:40px;display:flex;align-items:center;justify-content:center;gap:5px;font-size:11px;font-weight:700;letter-spacing:.02em;text-transform:none;color:var(--text-soft);cursor:pointer;border:none;background:none;font-family:inherit;border-bottom:2px solid transparent;transition:background-color .18s ease,border-bottom-color .18s ease;padding:0 8px;white-space:nowrap}
.ced-tab .site-icon{display:none}
.ced-tab.is-active{background:var(--primary);color:#fff;-webkit-text-fill-color:#fff;border-bottom-color:var(--primary)}
.ced-tab.is-active:hover,.ced-tab.is-active:focus,.ced-tab.is-active:focus-visible{color:#fff;-webkit-text-fill-color:#fff}
.ced-tab-panel{padding:14px;display:none;max-height:none;overflow-y:auto;flex:1;min-height:0}
.ced-tab-panel.is-active{display:block}
.ced-section-title{font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--text-soft);margin-bottom:8px}

.ced-paper-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:4px}
.ced-paper-btn{display:flex;flex-direction:column;align-items:center;gap:4px;padding:0;border-radius:8px;border:2px solid var(--border);background:var(--bg);cursor:pointer;font-family:inherit;transition:all .18s;overflow:hidden;font-size:10px;font-weight:700;color:var(--text-soft)}
.ced-paper-btn img{width:100%;height:40px;object-fit:cover;display:block}
.ced-paper-btn span{padding:3px 4px 6px;text-align:center}
.ced-paper-btn:hover{border-color:var(--primary)}
.ced-paper-btn.is-active{border-color:var(--primary);color:var(--primary)}

.ced-chip-row{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:4px}
.ced-chip{height:28px;padding:0 12px;border-radius:999px;font-size:11px;font-weight:600;border:1.5px solid var(--border);background:var(--bg);cursor:pointer;color:var(--text-soft);transition:all .18s;font-family:inherit}
.ced-chip:hover{border-color:var(--primary);color:var(--primary)}
.ced-chip.is-active{border-color:var(--primary);background:rgba(47,111,237,.08);color:var(--primary)}

.ced-wm-box{background:var(--bg);border:1px solid var(--border);border-radius:10px;padding:12px;margin-bottom:4px}
.ced-logo-mini-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin:8px 0}
.ced-logo-mini{aspect-ratio:1;border-radius:6px;border:1.5px solid var(--border);background:#fff;cursor:pointer;overflow:hidden;transition:border-color .18s;display:flex;align-items:center;justify-content:center;padding:4px;box-sizing:border-box}
.ced-logo-mini:hover,.ced-logo-mini.is-active{border-color:var(--primary)}
.ced-logo-mini img{width:100%;height:auto;max-height:100%;object-fit:contain;display:block;flex-shrink:0}

.ced-action-btn{display:flex;align-items:center;gap:6px;width:100%;padding:8px 12px;border-radius:8px;border:1.5px solid var(--border);background:#fff;cursor:pointer;font-size:12px;font-weight:600;color:var(--text-soft);font-family:inherit;transition:all .18s;margin-bottom:6px}
.ced-action-btn:hover{border-color:var(--primary);color:var(--primary)}
.ced-action-btn .site-icon{width:16px;height:16px}
.ced-action-btn--danger{color:#7f1d1d;border-color:rgba(127,29,29,.2)}
.ced-action-btn--danger:hover{border-color:#7f1d1d;background:rgba(127,29,29,.04)}

.ced-elem-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:4px}
.ced-elem-btn{display:flex;flex-direction:column;align-items:center;gap:5px;padding:10px 6px;border-radius:16px;border:1.5px solid var(--border);background:var(--bg);cursor:pointer;font-family:inherit;transition:all .18s;font-size:11px;font-weight:600;color:var(--text-soft)}
.ced-elem-btn:hover{border-color:var(--primary);color:var(--primary);background:rgba(47,111,237,.05)}
.ced-elem-btn .site-icon{width:20px;height:20px}

.ced-seal-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.ced-seal-item{aspect-ratio:1;border-radius:8px;border:1.5px solid var(--border);background:var(--bg);cursor:pointer;overflow:hidden;transition:all .18s;display:flex;align-items:center;justify-content:center;padding:6px;box-sizing:border-box}
.ced-seal-item:hover{border-color:var(--primary);background:rgba(47,111,237,.05)}
.ced-seal-item img{width:100%;height:auto;max-height:100%;object-fit:contain;display:block;flex-shrink:0}
.ced-seal-label{font-size:9px;font-weight:700;color:var(--text-soft);text-align:center;letter-spacing:.04em;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%;padding:0 2px}

.ced-logo-grid-item{aspect-ratio:1;border-radius:8px;border:1.5px solid var(--border);background:#fff;cursor:pointer;overflow:hidden;transition:all .18s;display:flex;align-items:center;justify-content:center;padding:6px;box-sizing:border-box}
.ced-logo-grid-item:hover{border-color:var(--primary);background:rgba(47,111,237,.05)}
.ced-logo-grid-item.is-active{border-color:var(--primary);box-shadow:0 0 0 2px rgba(47,111,237,.25)}
.ced-logo-grid-item img{width:100%;height:auto;max-height:100%;object-fit:contain;display:block;flex-shrink:0}

.ced-layer-list{display:flex;flex-direction:column;gap:4px}
.ced-layer-item{display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:8px;cursor:pointer;transition:background .18s;font-size:12px;color:var(--text-soft)}
.ced-layer-item:hover{background:var(--bg)}
.ced-layer-item.is-selected{background:rgba(47,111,237,.08);color:var(--primary)}
.ced-layer-item .site-icon{width:15px;height:15px;flex-shrink:0}

.ced-props-box{background:var(--bg);border:1px solid var(--border);border-radius:10px;padding:12px}
.ced-row{display:flex;align-items:center;gap:6px;margin-bottom:8px;flex-wrap:wrap}
.ced-label{font-size:11px;color:var(--text-soft);flex-shrink:0;min-width:32px}
.ced-input{border:1.5px solid var(--border-strong);border-radius:6px;padding:5px 8px;font-size:12px;font-family:inherit;color:var(--text);outline:none;width:100%}
.ced-input:focus{border-color:var(--primary)}
.ced-input--sm{width:56px}
.ced-select{border:1.5px solid var(--border-strong);border-radius:6px;padding:5px 8px;font-size:12px;font-family:inherit;color:var(--text);background:#fff;outline:none;cursor:pointer;flex:1}
.ced-color{width:28px;height:26px;border:1.5px solid var(--border-strong);border-radius:6px;cursor:pointer;padding:2px;flex-shrink:0}
.ced-icon-btn{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:6px;border:1.5px solid var(--border);background:var(--bg);cursor:pointer;color:var(--text-soft);transition:all .18s;flex-shrink:0}
.ced-icon-btn:hover{border-color:var(--primary);color:var(--primary)}
.ced-icon-btn.is-active{background:rgba(47,111,237,.1);color:var(--primary);border-color:var(--primary)}
.ced-icon-btn--danger:hover{border-color:#7f1d1d;color:#7f1d1d}
.ced-icon-btn .site-icon{width:16px;height:16px}
.ced-field{margin-bottom:14px}
.ced-field label{display:block;font-size:12px;font-weight:600;color:var(--text-soft);margin-bottom:5px}

.ced-canvas-col{display:flex;flex-direction:column;gap:0;background:#fff;border:1px solid var(--border);border-radius:16px;overflow:visible;position:sticky;top:80px;align-self:start;min-width:0;width:100%}
.ced-canvas-toolbar{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;border-bottom:1px solid var(--border);background:#fff;gap:8px;flex-wrap:wrap}
.ced-title-input{border:none;outline:none;font-size:13px;font-weight:600;color:var(--text);background:transparent;font-family:inherit;width:180px;padding:4px 8px;border-radius:6px;transition:background .18s}
.ced-title-input:hover,.ced-title-input:focus{background:var(--bg)}
.ced-zoom-select{border:1.5px solid var(--border-strong);border-radius:6px;padding:4px 8px;font-size:12px;font-family:inherit;color:var(--text);background:#fff;outline:none;cursor:pointer}
.ced-canvas-area{background:#c8cdd6;display:flex;align-items:flex-start;justify-content:center;padding:8px;min-height:300px;overflow:auto;min-width:0;width:100%;box-sizing:border-box}
.ced-canvas-wrap{box-shadow:0 2px 16px rgba(15,32,59,.18);overflow:hidden;transform-origin:top center;transition:transform .2s;flex-shrink:0;max-width:100%;margin:0 auto}
.ced-status{display:flex;align-items:center;gap:12px;padding:8px 14px;border-top:1px solid var(--border);font-size:11px;color:var(--text-soft);background:#fff;flex-wrap:wrap}
.ced-status__dot{width:6px;height:6px;border-radius:50%;background:#2d6a4f;flex-shrink:0}
.ced-status__paper{padding:2px 10px;border-radius:999px;background:rgba(47,111,237,.07);color:var(--primary);font-weight:600;font-size:11px}

.ced-sig-color{width:22px;height:22px;border-radius:50%;border:2px solid transparent;cursor:pointer;transition:border-color .18s;flex-shrink:0}
.ced-sig-color.is-active{border-color:var(--primary)}

.ced-toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%) translateY(20px);background:var(--text);color:#fff;padding:10px 20px;border-radius:999px;font-size:13px;font-weight:600;opacity:0;transition:all .3s;z-index:99999;pointer-events:none}
.ced-toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

.tpl-modal{position:fixed;inset:0;z-index:99999;display:flex;align-items:center;justify-content:center;opacity:0;pointer-events:none;transition:opacity .22s}
.tpl-modal.is-open{opacity:1;pointer-events:auto}
.tpl-modal__backdrop{position:absolute;inset:0;background:rgba(14,30,51,.5);backdrop-filter:blur(4px)}
.tpl-modal__box{position:relative;background:#fff;border-radius:var(--radius-xl,16px);overflow:hidden;width:90%;max-width:560px;max-height:90vh;overflow-y:auto;box-shadow:0 40px 100px rgba(15,32,59,.2)}
.tpl-modal__close{position:absolute;top:14px;right:14px;width:36px;height:36px;border-radius:50%;background:var(--bg,#f5f7fa);border:1px solid var(--border,#e2e8f0);cursor:pointer;display:flex;align-items:center;justify-content:center;z-index:1;font-size:18px;line-height:1}
.tpl-modal__footer{padding:16px 24px 24px;border-top:1px solid var(--border,#e2e8f0);display:flex;justify-content:center;gap:10px}

.tpl-card__btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:36px;padding:0 14px;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;border:none;font-family:inherit;transition:all .18s;white-space:nowrap}
.tpl-card__btn--primary{background:var(--primary,#2f6fed);color:#fff}
.tpl-card__btn--primary:hover{background:#1a5cd8}
.tpl-card__btn--ghost{background:transparent;color:var(--text-soft,#64748b);border:1.5px solid var(--border,#e2e8f0)}
.tpl-card__btn--ghost:hover{border-color:var(--primary,#2f6fed);color:var(--primary,#2f6fed)}

@media(max-width:900px){.ced-panel,.ced-canvas-col{position:static;top:auto;max-height:none}.ced-tab-panel{max-height:52vh;padding:12px}.ced-canvas-area{padding:10px}}
@media(max-width:680px){.ced-tabs{overflow-x:auto;overflow-y:hidden;scrollbar-width:none;flex-wrap:nowrap}.ced-tabs::-webkit-scrollbar{display:none}.ced-tab{flex:1 0 auto;min-width:64px;height:34px;font-size:10px;padding:0 8px}.ced-tab-panel{padding:10px;max-height:none}.ced-paper-grid,.ced-seal-grid{grid-template-columns:repeat(2,1fr)}.ced-elem-grid{grid-template-columns:1fr 1fr;gap:6px}.ced-canvas-toolbar{padding:8px 10px;gap:6px}.ced-title-input{width:140px;font-size:12px}.ced-canvas-col{width:100%;max-width:100%;min-width:0}.ced-canvas-area{padding:8px 0;overflow-x:auto;overflow-y:hidden;justify-content:flex-start;box-sizing:border-box}.ced-canvas-wrap{margin:0;min-width:unset;max-width:none}.ced-status{padding:8px 10px;gap:8px}}
