.custom-editor{border:1px solid var(--color-border);border-radius:var(--radius-lg);background:var(--color-bg-secondary);overflow:hidden;position:relative;font-family:var(--font-family-sans)}.custom-editor-container{border:1px solid var(--color-border);border-radius:var(--radius-lg);background:var(--color-bg-primary);overflow:hidden;position:relative;transition:all 0.3s ease}.custom-editor-container:focus-within{border-color:var(--color-primary);box-shadow:0 0 0 2px var(--color-primary-light)}.editor-toolbar,.custom-editor-toolbar{display:flex;flex-wrap:wrap;gap:0.25rem;padding:0.75rem;background:var(--color-bg-accent);border-bottom:1px solid var(--color-border);position:relative}.toolbar-btn,.custom-editor-btn{display:inline-flex;align-items:center;justify-content:center;min-width:2.25rem;height:2.25rem;padding:0.5rem;border:1px solid var(--color-border);background:var(--color-bg-primary);color:var(--color-text-secondary);border-radius:var(--radius-md);cursor:pointer;transition:all 0.2s ease;font-size:0.875rem;font-weight:500;text-decoration:none}.toolbar-btn:hover,.custom-editor-btn:hover{background:var(--color-bg-hover);color:var(--color-text-primary);border-color:var(--color-border-hover);transform:translateY(-1px)}.toolbar-btn:active,.custom-editor-btn:active{transform:translateY(0)}.toolbar-btn.active,.custom-editor-btn.active{background:var(--color-primary);color:var(--color-light);border-color:var(--color-primary);box-shadow:0 2px 4px rgba(0,0,0,0.1)}.toolbar-btn:disabled,.custom-editor-btn:disabled{opacity:0.5;cursor:not-allowed;pointer-events:none}.toolbar-separator{width:1px;height:1.5rem;background:var(--color-border);margin:0.375rem 0.5rem;flex-shrink:0}.editor-content,.custom-editor-content{min-height:200px;max-height:600px;padding:1rem;outline:none;background:var(--color-bg-primary);color:var(--color-text-primary);overflow-y:auto;font-size:0.95rem;line-height:1.6;border:none;resize:none}.editor-content:focus,.custom-editor-content:focus{outline:none}.custom-editor-content[contenteditable="true"]:empty:before{content:attr(data-placeholder);color:var(--color-text-secondary);opacity:0.7;font-style:italic;pointer-events:none}.custom-editor-source{min-height:200px;max-height:600px;padding:1rem;font-family:'Monaco','Menlo','Ubuntu Mono',monospace;font-size:0.875rem;line-height:1.5;background:var(--color-bg-primary);color:var(--color-text-primary);border:none;outline:none;resize:none;overflow-y:auto;white-space:pre-wrap;tab-size:2}.custom-editor-source:focus{outline:none}.custom-editor-preview{min-height:200px;max-height:600px;padding:1rem;background:var(--color-bg-primary);color:var(--color-text-primary);overflow-y:auto;border:none;line-height:1.6}.custom-editor-preview h1,.custom-editor-preview h2,.custom-editor-preview h3,.custom-editor-preview h4,.custom-editor-preview h5,.custom-editor-preview h6{margin-top:1.5em;margin-bottom:0.5em;font-weight:600;line-height:1.3;color:var(--color-text-primary)}.custom-editor-preview h1{font-size:1.875rem;border-bottom:2px solid var(--color-border);padding-bottom:0.5rem}.custom-editor-preview h2{font-size:1.5rem}.custom-editor-preview h3{font-size:1.25rem}.custom-editor-preview p{margin-bottom:1em;color:var(--color-text-primary)}.custom-editor-preview a{color:var(--color-primary);text-decoration:underline;transition:color 0.2s ease}.custom-editor-preview a:hover{color:var(--color-primary-hover)}.custom-editor-preview ul,.custom-editor-preview ol{margin-bottom:1em;padding-left:2em}.custom-editor-preview li{margin-bottom:0.5em}.custom-editor-preview blockquote{margin:1em 0;padding:1em;border-left:4px solid var(--color-primary);background:var(--color-bg-secondary);border-radius:0 var(--radius-md) var(--radius-md) 0;font-style:italic;color:var(--color-text-secondary)}.custom-editor-preview table{width:100%;border-collapse:collapse;margin:1em 0;border:1px solid var(--color-border);border-radius:var(--radius-md);overflow:hidden}.custom-editor-preview table th,.custom-editor-preview table td{padding:0.75rem;text-align:left;border-bottom:1px solid var(--color-border)}.custom-editor-preview table th{background:var(--color-bg-secondary);font-weight:600;color:var(--color-text-primary)}.custom-editor-preview table tr:last-child td{border-bottom:none}.custom-editor-preview img{max-width:100%;height:auto;margin:1em 0;border-radius:var(--radius-md);box-shadow:0 2px 8px rgba(0,0,0,0.1)}.custom-editor-preview code{font-family:'Monaco','Menlo','Ubuntu Mono',monospace;background:var(--color-bg-secondary);padding:0.25rem 0.5rem;border-radius:var(--radius-sm);font-size:0.875rem;color:var(--color-text-primary)}.custom-editor-preview pre{background:var(--color-bg-secondary);padding:1rem;border-radius:var(--radius-md);overflow-x:auto;margin:1em 0}.custom-editor-preview pre code{background:none;padding:0}.custom-editor-status{padding:0.5rem 0.75rem;font-size:0.75rem;color:var(--color-text-secondary);background:var(--color-bg-secondary);border-top:1px solid var(--color-border);display:flex;justify-content:space-between;align-items:center}.auto-save-indicator{color:var(--color-success);font-weight:500;animation:fadeIn 0.3s ease}@keyframes fadeIn{from{opacity:0}to{opacity:1}}.custom-editor-container.fullscreen{position:fixed!important;top:0!important;left:0!important;width:100vw!important;height:100vh!important;z-index:9999!important;background:var(--color-bg-primary)!important;border-radius:0!important;border:none!important}.custom-editor-container.fullscreen .custom-editor-content,.custom-editor-container.fullscreen .custom-editor-source,.custom-editor-container.fullscreen .custom-editor-preview{height:calc(100vh - 120px)!important;max-height:none!important}.custom-editor-container.fullscreen .custom-editor-toolbar{padding:1rem}.custom-editor-modal{display:none;position:fixed;top:0;left:0;width:100%;height:100%;z-index:10000;animation:modalFadeIn 0.3s ease}@keyframes modalFadeIn{from{opacity:0;transform:scale(0.95)}to{opacity:1;transform:scale(1)}}.modal-backdrop{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.5);backdrop-filter:blur(4px)}.modal-content{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background:var(--color-bg-primary);border-radius:var(--radius-lg);box-shadow:0 10px 40px rgba(0,0,0,0.2);width:90%;max-width:500px;max-height:90vh;overflow:hidden;border:1px solid var(--color-border)}.modal-header{padding:1rem 1.25rem;border-bottom:1px solid var(--color-border);display:flex;justify-content:space-between;align-items:center;background:var(--color-bg-secondary)}.modal-header h3{margin:0;color:var(--color-text-primary);font-size:1.125rem;font-weight:600}.modal-close{background:none;border:none;font-size:1.5rem;cursor:pointer;color:var(--color-text-secondary);padding:0.25rem;width:2rem;height:2rem;display:flex;align-items:center;justify-content:center;border-radius:var(--radius-sm);transition:all 0.2s ease}.modal-close:hover{background:var(--color-bg-hover);color:var(--color-text-primary)}.modal-body{padding:1.25rem;overflow-y:auto;max-height:calc(90vh - 160px)}.modal-body .form-group{margin-bottom:1rem}.modal-body .form-group:last-child{margin-bottom:0}.modal-body label{display:block;margin-bottom:0.5rem;color:var(--color-text-primary);font-weight:500;font-size:0.875rem}.modal-body input[type="url"],.modal-body input[type="text"],.modal-body input[type="number"]{width:100%;padding:0.75rem;border:1px solid var(--color-border);border-radius:var(--radius-md);background:var(--color-bg-secondary);color:var(--color-text-primary);font-size:0.875rem;transition:border-color 0.2s ease}.modal-body input:focus{outline:none;border-color:var(--color-primary);box-shadow:0 0 0 2px var(--color-primary-light)}.modal-body input[type="checkbox"]{margin-right:0.5rem;accent-color:var(--color-primary)}.modal-footer{padding:1rem 1.25rem;border-top:1px solid var(--color-border);display:flex;gap:0.75rem;justify-content:flex-end;background:var(--color-bg-secondary)}.modal-footer button{padding:0.75rem 1.5rem;border:1px solid var(--color-border);border-radius:var(--radius-md);cursor:pointer;font-size:0.875rem;font-weight:500;transition:all 0.2s ease;min-width:80px}.btn-cancel{background:var(--color-bg-primary);color:var(--color-text-primary);border-color:var(--color-border)}.btn-cancel:hover{background:var(--color-bg-hover);border-color:var(--color-border-hover)}.btn-insert{background:var(--color-primary);color:var(--color-light);border-color:var(--color-primary)}.btn-insert:hover{background:var(--color-primary-hover);transform:translateY(-1px);box-shadow:0 2px 8px rgba(0,0,0,0.15)}[data-theme="dark"] .custom-editor{border-color:var(--color-border-dark)}[data-theme="dark"] .editor-toolbar,[data-theme="dark"] .custom-editor-toolbar{background:var(--color-bg-accent-dark);border-color:var(--color-border-dark)}[data-theme="dark"] .toolbar-btn,[data-theme="dark"] .custom-editor-btn{color:var(--color-text-secondary-dark);background:var(--color-bg-primary-dark);border-color:var(--color-border-dark)}[data-theme="dark"] .toolbar-btn:hover,[data-theme="dark"] .custom-editor-btn:hover{background:var(--color-bg-hover-dark);color:var(--color-text-primary-dark)}[data-theme="dark"] .editor-content,[data-theme="dark"] .custom-editor-content{background:var(--color-bg-primary-dark);color:var(--color-text-primary-dark)}.custom-editor-content ::selection{background:#007cba!important;color:white!important}.custom-editor-content::-moz-selection{background:#007cba!important;color:white!important}.custom-editor-content{user-select:text;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text}.custom-editor-content *{user-select:text;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text}.custom-editor-content p::selection,.custom-editor-content span::selection,.custom-editor-content div::selection,.custom-editor-content h1::selection,.custom-editor-content h2::selection,.custom-editor-content h3::selection,.custom-editor-content strong::selection,.custom-editor-content em::selection,.custom-editor-content u::selection,.custom-editor-content li::selection{background:#007cba!important;color:white!important}.custom-editor-content p::-moz-selection,.custom-editor-content span::-moz-selection,.custom-editor-content div::-moz-selection,.custom-editor-content h1::-moz-selection,.custom-editor-content h2::-moz-selection,.custom-editor-content h3::-moz-selection,.custom-editor-content strong::-moz-selection,.custom-editor-content em::-moz-selection,.custom-editor-content u::-moz-selection,.custom-editor-content li::-moz-selection{background:#007cba!important;color:white!important}.custom-editor-content:focus{box-shadow:inset 0 0 0 2px var(--color-primary-light)}.editor-loading{position:relative}.editor-loading::after{content:'';position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(var(--color-bg-primary-rgb),0.8);display:flex;align-items:center;justify-content:center;z-index:10}.custom-editor-content.drag-over{border-color:var(--color-primary);background:var(--color-primary-light)}@media (max-width:768px){.editor-toolbar,.custom-editor-toolbar{gap:0.125rem;padding:0.5rem;flex-wrap:wrap}.toolbar-btn,.custom-editor-btn{min-width:2rem;height:2rem;font-size:0.75rem}.toolbar-separator{height:1.25rem;margin:0.375rem 0.25rem}.custom-editor-content,.custom-editor-source,.custom-editor-preview{padding:0.75rem;font-size:0.875rem}.modal-content{width:95%;margin:1rem}.modal-body{padding:1rem}.modal-footer{padding:0.75rem 1rem;flex-direction:column-reverse}.modal-footer button{width:100%;margin-bottom:0.5rem}.modal-footer button:last-child{margin-bottom:0}}@media (max-width:640px){.toolbar-btn,.custom-editor-btn{min-width:1.75rem;height:1.75rem;padding:0.25rem}.custom-editor-status{font-size:0.625rem;padding:0.375rem 0.5rem;flex-direction:column;align-items:flex-start;gap:0.25rem}}@media print{.custom-editor-toolbar,.custom-editor-status,.modal-backdrop,.modal-content{display:none!important}.custom-editor-content,.custom-editor-preview{border:none!important;box-shadow:none!important;background:white!important;color:black!important}}@media (prefers-contrast:high){.custom-editor{border-width:2px}.toolbar-btn,.custom-editor-btn{border-width:2px}.toolbar-btn:focus,.custom-editor-btn:focus{outline:2px solid var(--color-text-primary);outline-offset:2px}}@media (prefers-reduced-motion:reduce){.custom-editor-container,.toolbar-btn,.custom-editor-btn,.modal-content,.auto-save-indicator{animation:none!important;transition:none!important}}