/* 悬浮编辑面板 - 莫兰迪色系设计 */
.floating-editor {
    position: fixed;
    width: 400px;
    background: rgba(250, 250, 250, 0.95);
    backdrop-filter: blur(24px) saturate(150%);
    border: 1px solid rgba(198, 169, 179, 0.3);
    border-radius: 20px;
    box-shadow: 0 16px 40px rgba(74, 68, 65, 0.15), 
                0 0 0 1px rgba(255, 255, 255, 0.8) inset;
    z-index: 10000;
    display: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    overflow: hidden;
    user-select: none;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    animation: floatingEditorSlideIn 0.4s ease-out;
}

@keyframes floatingEditorSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.floating-editor.dragging {
    box-shadow: 0 24px 60px rgba(74, 68, 65, 0.2);
    transform: scale(1.02);
}

/* 头部设计 - 莫兰迪风格 */
.floating-editor-header {
    background: linear-gradient(135deg, rgba(198, 169, 179, 0.15) 0%, rgba(167, 185, 194, 0.1) 100%);
    padding: 24px 28px;
    border-bottom: 1px solid rgba(198, 169, 179, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: grab;
    position: relative;
    overflow: hidden;
}

.floating-editor-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.8s ease;
}

.floating-editor-header:hover::before {
    left: 100%;
}

.floating-editor-header:active {
    cursor: grabbing;
}

/* 元素标签 */
.element-tag {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 16px;
    font-weight: 600;
    color: #4a4441;
}

.tag-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--morandi-pink) 0%, rgba(198, 169, 179, 0.8) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(198, 169, 179, 0.25);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}


/* 关闭按钮 */
.close-btn {
    background: rgba(237, 233, 230, 0.6);
    border: 1px solid rgba(198, 169, 179, 0.2);
    color: #6b615c;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-weight: 400;
}


/* 主体内容 */
.floating-editor-body {
    padding: 28px;
    max-height: 500px;
    overflow-y: auto;
    color: #4a4441;
}

/* 编辑器部分 */
.editor-section {
    margin-bottom: 28px;
}

.section-title {
    font-size: 13px;
    font-weight: 700;
    color: #6b615c;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 16px;
    background: linear-gradient(to bottom, var(--morandi-pink), var(--morandi-blue));
    border-radius: 2px;
}

.section-subtitle {
    font-size: 13px;
    font-weight: 600;
    color: #6b615c;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 内容编辑器 */
.content-editor {
    width: 100%;
    min-height: 100px;
    background: rgba(245, 244, 243, 0.8);
    border: 1px solid rgba(198, 169, 179, 0.2);
    border-radius: 12px;
    padding: 16px;
    font-size: 14px;
    line-height: 1.6;
    color: #4a4441;
    resize: vertical;
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', monospace;
}

.content-editor:focus {
    outline: none;
    border-color: var(--morandi-blue);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 3px rgba(167, 185, 194, 0.15);
}

.content-editor::placeholder {
    color: #9b9289;
    font-style: italic;
}

/* 间距控制 */
.spacing-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.spacing-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: rgba(245, 244, 243, 0.6);
    border: 1px solid rgba(198, 169, 179, 0.15);
    border-radius: 12px;
    transition: all 0.3s ease;
}


.spacing-label {
    font-size: 14px;
    font-weight: 600;
    color: #6b615c;
    min-width: 80px;
}

.spacing-inputs {
    display: flex;
    gap: 12px;
}

.spacing-input {
    width: 60px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(198, 169, 179, 0.2);
    border-radius: 8px;
    text-align: center;
    font-size: 13px;
    color: #4a4441;
    transition: all 0.3s ease;
}

.spacing-input:focus {
    outline: none;
    border-color: var(--morandi-blue);
    box-shadow: 0 0 0 2px rgba(167, 185, 194, 0.15);
}

/* 字体控制 */
.font-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.font-row {
    display: flex;
    gap: 12px;
}

.select-input {
    flex: 1;
    padding: 10px 14px;
    background: rgba(245, 244, 243, 0.8);
    border: 1px solid rgba(198, 169, 179, 0.2);
    border-radius: 10px;
    font-size: 13px;
    color: #4a4441;
    cursor: pointer;
    transition: all 0.3s ease;
}

.select-input:focus {
    outline: none;
    border-color: var(--morandi-blue);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 2px rgba(167, 185, 194, 0.15);
}

/* 颜色选择器 */
.color-picker {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(245, 244, 243, 0.6);
    border: 1px solid rgba(198, 169, 179, 0.15);
    border-radius: 12px;
    transition: all 0.3s ease;
}


.color-preview {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 2px solid rgba(198, 169, 179, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}


.color-input {
    width: 40px;
    height: 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0;
    position: absolute;
    pointer-events: none;
}

.color-text {
    flex: 1;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(198, 169, 179, 0.2);
    border-radius: 8px;
    font-size: 13px;
    color: #4a4441;
    font-family: monospace;
    transition: all 0.3s ease;
}

.color-text:focus {
    outline: none;
    border-color: var(--morandi-blue);
    box-shadow: 0 0 0 2px rgba(167, 185, 194, 0.15);
}

/* 对齐控制 */
.alignment-controls {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.alignment-btn {
    width: 40px;
    height: 40px;
    background: rgba(245, 244, 243, 0.8);
    border: 1px solid rgba(198, 169, 179, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    color: #6b615c;
}


.alignment-btn.active {
    background: var(--morandi-blue);
    border-color: var(--morandi-blue);
    color: white;
    box-shadow: 0 2px 8px rgba(167, 185, 194, 0.3);
}

/* 高级设置切换 */
.advanced-toggle {
    padding: 16px 0;
    cursor: pointer;
    transition: all 0.3s ease;
    border-top: 1px solid rgba(198, 169, 179, 0.15);
    margin-top: 20px;
}


.advanced-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #6b615c;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toggle-icon {
    font-size: 12px;
    transition: transform 0.3s ease;
    color: var(--morandi-blue);
}

.advanced-toggle.active .toggle-icon {
    transform: rotate(90deg);
}

.advanced-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.advanced-content.show {
    max-height: 200px;
}

.form-group {
    margin-top: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #6b615c;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    background: rgba(245, 244, 243, 0.8);
    border: 1px solid rgba(198, 169, 179, 0.2);
    border-radius: 10px;
    font-size: 13px;
    color: #4a4441;
    font-family: 'SF Mono', Monaco, monospace;
    resize: vertical;
    transition: all 0.3s ease;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--morandi-blue);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 2px rgba(167, 185, 194, 0.15);
}

/* 底部操作区 */
.floating-editor-footer {
    padding: 20px 28px;
    background: rgba(237, 233, 230, 0.6);
    border-top: 1px solid rgba(198, 169, 179, 0.2);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.footer-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.footer-btn.discard {
    background: rgba(196, 154, 154, 0.15);
    color: #c49a9a;
    border: 1px solid rgba(196, 154, 154, 0.3);
}


.footer-btn.save {
    background: linear-gradient(135deg, var(--morandi-green) 0%, rgba(193, 207, 161, 0.9) 100%);
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(193, 207, 161, 0.3);
}


/* 滚动条美化 */
.floating-editor-body::-webkit-scrollbar {
    width: 6px;
}

.floating-editor-body::-webkit-scrollbar-track {
    background: rgba(245, 244, 243, 0.3);
    border-radius: 3px;
}

.floating-editor-body::-webkit-scrollbar-thumb {
    background: rgba(198, 169, 179, 0.4);
    border-radius: 3px;
}

.floating-editor-body::-webkit-scrollbar-thumb:hover {
    background: rgba(167, 185, 194, 0.6);
}